0
0
Fork 0

fix: refs #6942 selectable expense

This commit is contained in:
Jorge Penadés 2024-03-04 08:25:43 +01:00
parent 4abb230180
commit e10e06bcd4
3 changed files with 239 additions and 251 deletions

View File

@ -1,5 +1,5 @@
<script setup> <script setup>
import { h, onMounted } from 'vue'; import { onMounted } from 'vue';
import axios from 'axios'; import axios from 'axios';
const $props = defineProps({ const $props = defineProps({
@ -24,7 +24,7 @@ const $props = defineProps({
default: '', default: '',
}, },
limit: { limit: {
type: String, type: [String, Number],
default: '', default: '',
}, },
params: { params: {
@ -60,3 +60,6 @@ async function fetch(fetchFilter = {}) {
} }
} }
</script> </script>
<template>
<template></template>
</template>

View File

@ -151,7 +151,7 @@ watch(modelValue, (newValue) => {
@on-fetch="(data) => setOptions(data)" @on-fetch="(data) => setOptions(data)"
:where="where || { [optionValue]: value }" :where="where || { [optionValue]: value }"
:limit="limit" :limit="limit"
:order-by="orderBy" :sort-by="sortBy"
:fields="fields" :fields="fields"
/> />
<QSelect <QSelect

View File

@ -3,14 +3,13 @@ import { ref, computed } from 'vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useQuasar } from 'quasar'; import { useQuasar } from 'quasar';
import axios from 'axios';
import { useArrayData } from 'src/composables/useArrayData'; import { useArrayData } from 'src/composables/useArrayData';
import { downloadFile } from 'src/composables/downloadFile'; import { downloadFile } from 'src/composables/downloadFile';
import FormModel from 'components/FormModel.vue'; import FormModel from 'components/FormModel.vue';
import VnSelectFilter from 'src/components/common/VnSelectFilter.vue'; import VnSelectFilter from 'src/components/common/VnSelectFilter.vue';
import FetchData from 'src/components/FetchData.vue'; import FetchData from 'src/components/FetchData.vue';
import VnRow from 'components/ui/VnRow.vue';
import axios from 'axios';
const quasar = useQuasar(); const quasar = useQuasar();
const route = useRoute(); const route = useRoute();
@ -22,6 +21,7 @@ const arrayData = useArrayData('InvoiceIn');
const invoiceIn = computed(() => arrayData.store.data); const invoiceIn = computed(() => arrayData.store.data);
const userConfig = ref(null); const userConfig = ref(null);
const expenses = ref([]);
const currencies = ref([]); const currencies = ref([]);
const currenciesRef = ref(); const currenciesRef = ref();
const companies = ref([]); const companies = ref([]);
@ -174,6 +174,7 @@ async function upsert() {
@on-fetch="(data) => (userConfig = data)" @on-fetch="(data) => (userConfig = data)"
auto-load auto-load
/> />
<FetchData url="Expenses" auto-load @on-fetch="(data) => (expenses = data)" />
<FormModel <FormModel
v-if="invoiceIn" v-if="invoiceIn"
:url="`InvoiceIns/${route.params.id}`" :url="`InvoiceIns/${route.params.id}`"
@ -181,8 +182,7 @@ async function upsert() {
:auto-load="true" :auto-load="true"
> >
<template #form="{ data }"> <template #form="{ data }">
<div class="row q-gutter-md q-mb-md"> <VnRow>
<div class="col">
<VnSelectFilter <VnSelectFilter
:label="t('supplierFk')" :label="t('supplierFk')"
v-model="data.supplierFk" v-model="data.supplierFk"
@ -203,29 +203,21 @@ async function upsert() {
</QItem> </QItem>
</template> </template>
</VnSelectFilter> </VnSelectFilter>
</div>
<div class="col">
<QInput <QInput
clearable clearable
clear-icon="close" clear-icon="close"
:label="t('Supplier ref')" :label="t('Supplier ref')"
v-model="data.supplierRef" v-model="data.supplierRef"
/> />
</div> </VnRow>
</div> <VnRow>
<div class="row q-gutter-md q-mb-md">
<div class="col">
<QInput <QInput
:label="t('Expedition date')" :label="t('Expedition date')"
v-model="data.issued" v-model="data.issued"
:mask="dateMask" :mask="dateMask"
> >
<template #append> <template #append>
<QIcon <QIcon name="event" class="cursor-pointer" :fill-mask="fillMask">
name="event"
class="cursor-pointer"
:fill-mask="fillMask"
>
<QPopupProxy <QPopupProxy
cover cover
transition-show="scale" transition-show="scale"
@ -245,8 +237,6 @@ async function upsert() {
</QIcon> </QIcon>
</template> </template>
</QInput> </QInput>
</div>
<div class="col">
<QInput <QInput
:label="t('Operation date')" :label="t('Operation date')"
v-model="data.operated" v-model="data.operated"
@ -275,18 +265,23 @@ async function upsert() {
</QIcon> </QIcon>
</template> </template>
</QInput> </QInput>
</div> </VnRow>
</div> <VnRow>
<div class="row q-gutter-md q-mb-md"> <VnSelectFilter
<div class="col">
<QInput
:label="t('Undeductible VAT')" :label="t('Undeductible VAT')"
v-model="data.deductibleExpenseFk" v-model="data.deductibleExpenseFk"
clearable :options="expenses"
clear-icon="close" option-value="id"
/> option-label="id"
</div> :filter-options="['id', 'name']"
<div class="col"> >
<template #option="scope">
<QItem v-bind="scope.itemProps">
{{ `${scope.opt.id}: ${scope.opt.name}` }}
</QItem>
</template>
</VnSelectFilter>
<QInput <QInput
:label="t('Document')" :label="t('Document')"
v-model="data.dmsFk" v-model="data.dmsFk"
@ -333,10 +328,8 @@ async function upsert() {
</QBtn> </QBtn>
</template> </template>
</QInput> </QInput>
</div> </VnRow>
</div> <VnRow>
<div class="row q-gutter-md q-mb-md">
<div class="col">
<QInput <QInput
:label="t('Entry date')" :label="t('Entry date')"
v-model="data.bookEntried" v-model="data.bookEntried"
@ -366,8 +359,7 @@ async function upsert() {
</QIcon> </QIcon>
</template> </template>
</QInput> </QInput>
</div>
<div class="col">
<QInput <QInput
:label="t('Accounted date')" :label="t('Accounted date')"
v-model="data.booked" v-model="data.booked"
@ -397,10 +389,8 @@ async function upsert() {
</QIcon> </QIcon>
</template> </template>
</QInput> </QInput>
</div> </VnRow>
</div> <VnRow>
<div class="row q-gutter-md q-mb-md">
<div class="col">
<VnSelectFilter <VnSelectFilter
:label="t('Currency')" :label="t('Currency')"
v-model="data.currencyFk" v-model="data.currencyFk"
@ -408,8 +398,7 @@ async function upsert() {
option-value="id" option-value="id"
option-label="code" option-label="code"
/> />
</div>
<div class="col">
<VnSelectFilter <VnSelectFilter
v-if="companiesRef" v-if="companiesRef"
:label="t('Company')" :label="t('Company')"
@ -418,17 +407,13 @@ async function upsert() {
option-value="id" option-value="id"
option-label="code" option-label="code"
/> />
</div> </VnRow>
</div> <VnRow>
<div class="row q-gutter-md q-mb-md">
<div class="col">
<QCheckbox <QCheckbox
:label="t('invoiceIn.summary.booked')" :label="t('invoiceIn.summary.booked')"
v-model="data.isBooked" v-model="data.isBooked"
/> />
</div> </VnRow>
<div class="col"></div>
</div>
</template> </template>
</FormModel> </FormModel>
<QDialog ref="editDmsRef"> <QDialog ref="editDmsRef">