feat: refs #8409 added VnSelectSupplier
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
parent
bf4faa88a1
commit
ac998d33aa
|
@ -31,7 +31,6 @@ const props = defineProps({
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
|
||||||
const itemTypesOptions = ref([]);
|
const itemTypesOptions = ref([]);
|
||||||
const suppliersOptions = ref([]);
|
|
||||||
const tagOptions = ref([]);
|
const tagOptions = ref([]);
|
||||||
const tagValues = ref([]);
|
const tagValues = ref([]);
|
||||||
const categoryList = ref(null);
|
const categoryList = ref(null);
|
||||||
|
@ -40,13 +39,13 @@ const selectedTypeFk = ref(getParamWhere(route.query.table, 'typeFk', false));
|
||||||
|
|
||||||
const selectedCategory = computed(() => {
|
const selectedCategory = computed(() => {
|
||||||
return (categoryList.value || []).find(
|
return (categoryList.value || []).find(
|
||||||
(category) => category?.id === selectedCategoryFk.value
|
(category) => category?.id === selectedCategoryFk.value,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
const selectedType = computed(() => {
|
const selectedType = computed(() => {
|
||||||
return (itemTypesOptions.value || []).find(
|
return (itemTypesOptions.value || []).find(
|
||||||
(type) => type?.id === selectedTypeFk.value
|
(type) => type?.id === selectedTypeFk.value,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -134,13 +133,6 @@ const setCategoryList = (data) => {
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<FetchData url="ItemCategories" limit="30" auto-load @on-fetch="setCategoryList" />
|
<FetchData url="ItemCategories" limit="30" auto-load @on-fetch="setCategoryList" />
|
||||||
<FetchData
|
|
||||||
url="Suppliers"
|
|
||||||
limit="30"
|
|
||||||
auto-load
|
|
||||||
:filter="{ fields: ['id', 'name', 'nickname'], order: 'name ASC', limit: 30 }"
|
|
||||||
@on-fetch="(data) => (suppliersOptions = data)"
|
|
||||||
/>
|
|
||||||
<FetchData
|
<FetchData
|
||||||
url="Tags"
|
url="Tags"
|
||||||
:filter="{ fields: ['id', 'name', 'isFree'] }"
|
:filter="{ fields: ['id', 'name', 'isFree'] }"
|
||||||
|
|
|
@ -0,0 +1,49 @@
|
||||||
|
<script setup>
|
||||||
|
import { computed } from 'vue';
|
||||||
|
import VnSelect from 'components/common/VnSelect.vue';
|
||||||
|
|
||||||
|
const emit = defineEmits(['update:modelValue']);
|
||||||
|
const $props = defineProps({
|
||||||
|
modelValue: {
|
||||||
|
type: [String, Number, Object],
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const url = 'Suppliers';
|
||||||
|
const value = computed({
|
||||||
|
get() {
|
||||||
|
return $props.modelValue;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
emit('update:modelValue', val);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<VnSelect
|
||||||
|
:label="$t('globals.supplier')"
|
||||||
|
v-bind="$attrs"
|
||||||
|
v-model="value"
|
||||||
|
:url="url"
|
||||||
|
option-value="id"
|
||||||
|
option-label="nickname"
|
||||||
|
:fields="['id', 'name', 'nickname', 'nif']"
|
||||||
|
sort-by="name ASC"
|
||||||
|
>
|
||||||
|
<template #option="scope">
|
||||||
|
<QItem v-bind="scope.itemProps">
|
||||||
|
<QItemSection>
|
||||||
|
<QItemLabel>
|
||||||
|
{{ scope.opt?.name }}
|
||||||
|
</QItemLabel>
|
||||||
|
<QItemLabel caption>
|
||||||
|
{{
|
||||||
|
`#${scope.opt?.id} , ${scope.opt?.nickname} (${scope.opt?.nif})`
|
||||||
|
}}
|
||||||
|
</QItemLabel>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
</template>
|
||||||
|
</VnSelect>
|
||||||
|
</template>
|
|
@ -12,6 +12,7 @@ import VnSelectDialog from 'src/components/common/VnSelectDialog.vue';
|
||||||
import FilterTravelForm from 'src/components/FilterTravelForm.vue';
|
import FilterTravelForm from 'src/components/FilterTravelForm.vue';
|
||||||
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
|
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
|
||||||
import { toDate } from 'src/filters';
|
import { toDate } from 'src/filters';
|
||||||
|
import VnSelectSupplier from 'src/components/common/VnSelectSupplier.vue';
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -51,28 +52,12 @@ const onFilterTravelSelected = (formData, id) => {
|
||||||
>
|
>
|
||||||
<template #form="{ data }">
|
<template #form="{ data }">
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnSelect
|
<VnSelectSupplier
|
||||||
:label="t('globals.supplier')"
|
|
||||||
v-model="data.supplierFk"
|
v-model="data.supplierFk"
|
||||||
url="Suppliers"
|
|
||||||
option-value="id"
|
|
||||||
option-label="nickname"
|
|
||||||
:fields="['id', 'nickname']"
|
|
||||||
hide-selected
|
hide-selected
|
||||||
:required="true"
|
:required="true"
|
||||||
map-options
|
map-options
|
||||||
>
|
/>
|
||||||
<template #option="scope">
|
|
||||||
<QItem v-bind="scope.itemProps">
|
|
||||||
<QItemSection>
|
|
||||||
<QItemLabel>{{ scope.opt?.name }}</QItemLabel>
|
|
||||||
<QItemLabel caption>
|
|
||||||
{{ scope.opt?.nickname }}, {{ scope.opt?.id }}
|
|
||||||
</QItemLabel>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
</template>
|
|
||||||
</VnSelect>
|
|
||||||
<VnSelectDialog
|
<VnSelectDialog
|
||||||
:label="t('entry.basicData.travel')"
|
:label="t('entry.basicData.travel')"
|
||||||
v-model="data.travelFk"
|
v-model="data.travelFk"
|
||||||
|
|
|
@ -13,6 +13,7 @@ import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
|
||||||
import { useStateStore } from 'stores/useStateStore';
|
import { useStateStore } from 'stores/useStateStore';
|
||||||
import { useState } from 'src/composables/useState';
|
import { useState } from 'src/composables/useState';
|
||||||
import { toDate } from 'src/filters';
|
import { toDate } from 'src/filters';
|
||||||
|
import VnSelectSupplier from 'src/components/common/VnSelectSupplier.vue';
|
||||||
|
|
||||||
const state = useState();
|
const state = useState();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -26,7 +27,6 @@ const newEntryForm = reactive({
|
||||||
travelFk: Number(route.query?.travelFk) || null,
|
travelFk: Number(route.query?.travelFk) || null,
|
||||||
companyFk: user.value.companyFk || null,
|
companyFk: user.value.companyFk || null,
|
||||||
});
|
});
|
||||||
const suppliersOptions = ref([]);
|
|
||||||
const travelsOptions = ref([]);
|
const travelsOptions = ref([]);
|
||||||
const companiesOptions = ref([]);
|
const companiesOptions = ref([]);
|
||||||
|
|
||||||
|
@ -36,13 +36,6 @@ const redirectToEntryBasicData = (_, { id }) => {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
|
||||||
url="Suppliers"
|
|
||||||
:filter="{ fields: ['id', 'nickname'] }"
|
|
||||||
order="nickname"
|
|
||||||
@on-fetch="(data) => (suppliersOptions = data)"
|
|
||||||
auto-load
|
|
||||||
/>
|
|
||||||
<FetchData
|
<FetchData
|
||||||
url="Travels/filter"
|
url="Travels/filter"
|
||||||
:filter="{ fields: ['id', 'warehouseInName'] }"
|
:filter="{ fields: ['id', 'warehouseInName'] }"
|
||||||
|
@ -79,28 +72,13 @@ const redirectToEntryBasicData = (_, { id }) => {
|
||||||
>
|
>
|
||||||
<template #form="{ data, validate }">
|
<template #form="{ data, validate }">
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnSelect
|
<VnSelectSupplier
|
||||||
:label="t('Supplier')"
|
|
||||||
class="full-width"
|
class="full-width"
|
||||||
v-model="data.supplierFk"
|
v-model="data.supplierFk"
|
||||||
:options="suppliersOptions"
|
|
||||||
option-value="id"
|
|
||||||
option-label="nickname"
|
|
||||||
hide-selected
|
hide-selected
|
||||||
:required="true"
|
:required="true"
|
||||||
:rules="validate('entry.supplierFk')"
|
:rules="validate('entry.supplierFk')"
|
||||||
>
|
/>
|
||||||
<template #option="scope">
|
|
||||||
<QItem v-bind="scope.itemProps">
|
|
||||||
<QItemSection>
|
|
||||||
<QItemLabel>{{ scope.opt?.nickname }}</QItemLabel>
|
|
||||||
<QItemLabel caption>
|
|
||||||
#{{ scope.opt?.id }}
|
|
||||||
</QItemLabel>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
</template>
|
|
||||||
</VnSelect>
|
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
|
@ -152,7 +130,6 @@ const redirectToEntryBasicData = (_, { id }) => {
|
||||||
|
|
||||||
<i18n>
|
<i18n>
|
||||||
es:
|
es:
|
||||||
Supplier: Proveedor
|
|
||||||
Travel: Envío
|
Travel: Envío
|
||||||
Company: Empresa
|
Company: Empresa
|
||||||
</i18n>
|
</i18n>
|
||||||
|
|
|
@ -7,6 +7,7 @@ import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
import FetchData from 'components/FetchData.vue';
|
import FetchData from 'components/FetchData.vue';
|
||||||
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
||||||
|
import VnSelectSupplier from 'src/components/common/VnSelectSupplier.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
@ -115,34 +116,14 @@ const companiesOptions = ref([]);
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnSelect
|
<VnSelectSupplier
|
||||||
:label="t('entryFilter.params.supplierFk')"
|
|
||||||
v-model="params.supplierFk"
|
v-model="params.supplierFk"
|
||||||
@update:model-value="searchFn()"
|
@update:model-value="searchFn()"
|
||||||
url="Suppliers"
|
|
||||||
option-value="id"
|
|
||||||
option-label="name"
|
|
||||||
:fields="['id', 'name', 'nickname']"
|
|
||||||
:filter-options="['id', 'name', 'nickname']"
|
|
||||||
sort-by="nickname"
|
|
||||||
hide-selected
|
hide-selected
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
rounded
|
rounded
|
||||||
>
|
/>
|
||||||
<template #option="scope">
|
|
||||||
<QItem v-bind="scope.itemProps">
|
|
||||||
<QItemSection>
|
|
||||||
<QItemLabel>
|
|
||||||
{{ scope.opt?.name}}
|
|
||||||
</QItemLabel>
|
|
||||||
<QItemLabel caption>
|
|
||||||
{{ `#${scope.opt?.id } , ${ scope.opt?.nickname}` }}
|
|
||||||
</QItemLabel>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
</template>
|
|
||||||
</VnSelect>
|
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
|
@ -202,4 +183,4 @@ const companiesOptions = ref([]);
|
||||||
</QItem>
|
</QItem>
|
||||||
</template>
|
</template>
|
||||||
</VnFilterPanel>
|
</VnFilterPanel>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -7,6 +7,7 @@ import VnInputDate from 'src/components/common/VnInputDate.vue';
|
||||||
import VnInput from 'components/common/VnInput.vue';
|
import VnInput from 'components/common/VnInput.vue';
|
||||||
import VnSelect from 'components/common/VnSelect.vue';
|
import VnSelect from 'components/common/VnSelect.vue';
|
||||||
import ItemsFilterPanel from 'src/components/ItemsFilterPanel.vue';
|
import ItemsFilterPanel from 'src/components/ItemsFilterPanel.vue';
|
||||||
|
import VnSelectSupplier from 'src/components/common/VnSelectSupplier.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
|
@ -18,7 +19,6 @@ defineProps({
|
||||||
});
|
});
|
||||||
|
|
||||||
const itemTypeWorkersOptions = ref([]);
|
const itemTypeWorkersOptions = ref([]);
|
||||||
const suppliersOptions = ref([]);
|
|
||||||
const tagValues = ref([]);
|
const tagValues = ref([]);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -30,13 +30,6 @@ const tagValues = ref([]);
|
||||||
:filter="{ fields: ['id', 'nickname'], order: 'nickname ASC', limit: 30 }"
|
:filter="{ fields: ['id', 'nickname'], order: 'nickname ASC', limit: 30 }"
|
||||||
@on-fetch="(data) => (itemTypeWorkersOptions = data)"
|
@on-fetch="(data) => (itemTypeWorkersOptions = data)"
|
||||||
/>
|
/>
|
||||||
<FetchData
|
|
||||||
url="Suppliers"
|
|
||||||
limit="30"
|
|
||||||
auto-load
|
|
||||||
:filter="{ fields: ['id', 'name', 'nickname'], order: 'name ASC', limit: 30 }"
|
|
||||||
@on-fetch="(data) => (suppliersOptions = data)"
|
|
||||||
/>
|
|
||||||
<ItemsFilterPanel :data-key="dataKey" :custom-tags="['tags']">
|
<ItemsFilterPanel :data-key="dataKey" :custom-tags="['tags']">
|
||||||
<template #body="{ params, searchFn }">
|
<template #body="{ params, searchFn }">
|
||||||
<QItem class="q-my-md">
|
<QItem class="q-my-md">
|
||||||
|
@ -57,31 +50,14 @@ const tagValues = ref([]);
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem class="q-my-md">
|
<QItem class="q-my-md">
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnSelect
|
<VnSelectSupplier
|
||||||
:label="t('globals.params.supplierFk')"
|
|
||||||
v-model="params.supplierFk"
|
v-model="params.supplierFk"
|
||||||
:options="suppliersOptions"
|
@update:model-value="searchFn()"
|
||||||
option-value="id"
|
hide-selected
|
||||||
option-label="name"
|
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
rounded
|
rounded
|
||||||
use-input
|
/>
|
||||||
@update:model-value="searchFn()"
|
|
||||||
>
|
|
||||||
<template #option="scope">
|
|
||||||
<QItem v-bind="scope.itemProps">
|
|
||||||
<QItemSection>
|
|
||||||
<QItemLabel>
|
|
||||||
{{ scope.opt?.name}}
|
|
||||||
</QItemLabel>
|
|
||||||
<QItemLabel caption>
|
|
||||||
{{ `#${scope.opt?.id } , ${ scope.opt?.nickname}` }}
|
|
||||||
</QItemLabel>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
</template>
|
|
||||||
</VnSelect>
|
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem class="q-my-md">
|
<QItem class="q-my-md">
|
||||||
|
|
|
@ -13,6 +13,7 @@ import VnInput from 'src/components/common/VnInput.vue';
|
||||||
import VnDms from 'src/components/common/VnDms.vue';
|
import VnDms from 'src/components/common/VnDms.vue';
|
||||||
import VnConfirm from 'src/components/ui/VnConfirm.vue';
|
import VnConfirm from 'src/components/ui/VnConfirm.vue';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
import VnSelectSupplier from 'src/components/common/VnSelectSupplier.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
|
@ -115,27 +116,12 @@ function deleteFile(dmsFk) {
|
||||||
>
|
>
|
||||||
<template #form="{ data }">
|
<template #form="{ data }">
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnSelect
|
<VnSelectSupplier
|
||||||
:required="true"
|
|
||||||
:label="t('supplierFk')"
|
|
||||||
v-model="data.supplierFk"
|
v-model="data.supplierFk"
|
||||||
option-value="id"
|
hide-selected
|
||||||
option-label="nickname"
|
|
||||||
url="Suppliers"
|
|
||||||
:fields="['id', 'nickname']"
|
|
||||||
sort-by="nickname"
|
|
||||||
:is-clearable="false"
|
:is-clearable="false"
|
||||||
>
|
:required="true"
|
||||||
<template #option="scope">
|
/>
|
||||||
<QItem v-bind="scope.itemProps">
|
|
||||||
<QItemSection>
|
|
||||||
<QItemLabel>{{
|
|
||||||
`${scope.opt.id} - ${scope.opt.nickname}`
|
|
||||||
}}</QItemLabel>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
</template>
|
|
||||||
</VnSelect>
|
|
||||||
<VnInput
|
<VnInput
|
||||||
clearable
|
clearable
|
||||||
clear-icon="close"
|
clear-icon="close"
|
||||||
|
|
|
@ -12,6 +12,7 @@ import { useStateStore } from 'stores/useStateStore';
|
||||||
import { useState } from 'src/composables/useState';
|
import { useState } from 'src/composables/useState';
|
||||||
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
|
import VnSelectSupplier from 'src/components/common/VnSelectSupplier.vue';
|
||||||
|
|
||||||
const state = useState();
|
const state = useState();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
@ -60,28 +61,12 @@ const redirectToInvoiceInBasicData = (__, { id }) => {
|
||||||
>
|
>
|
||||||
<template #form="{ data, validate }">
|
<template #form="{ data, validate }">
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnSelect
|
<VnSelectSupplier
|
||||||
url="Suppliers"
|
|
||||||
:fields="['id', 'nickname']"
|
|
||||||
:label="t('Supplier')"
|
|
||||||
v-model="data.supplierFk"
|
v-model="data.supplierFk"
|
||||||
option-value="id"
|
|
||||||
option-label="nickname"
|
|
||||||
hide-selected
|
hide-selected
|
||||||
:required="true"
|
:required="true"
|
||||||
:rules="validate('entry.supplierFk')"
|
:rules="validate('entry.supplierFk')"
|
||||||
>
|
/>
|
||||||
<template #option="scope">
|
|
||||||
<QItem v-bind="scope.itemProps">
|
|
||||||
<QItemSection>
|
|
||||||
<QItemLabel>{{ scope.opt?.nickname }}</QItemLabel>
|
|
||||||
<QItemLabel caption>
|
|
||||||
#{{ scope.opt?.id }}
|
|
||||||
</QItemLabel>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
</template>
|
|
||||||
</VnSelect>
|
|
||||||
<VnInput
|
<VnInput
|
||||||
:label="t('invoicein.list.supplierRef')"
|
:label="t('invoicein.list.supplierRef')"
|
||||||
v-model="data.supplierRef"
|
v-model="data.supplierRef"
|
||||||
|
@ -111,7 +96,6 @@ const redirectToInvoiceInBasicData = (__, { id }) => {
|
||||||
|
|
||||||
<i18n>
|
<i18n>
|
||||||
es:
|
es:
|
||||||
Supplier: Proveedor
|
|
||||||
Travel: Envío
|
Travel: Envío
|
||||||
Company: Empresa
|
Company: Empresa
|
||||||
</i18n>
|
</i18n>
|
||||||
|
|
|
@ -6,6 +6,7 @@ import VnInputDate from 'components/common/VnInputDate.vue';
|
||||||
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
|
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
|
||||||
import { dateRange } from 'src/filters';
|
import { dateRange } from 'src/filters';
|
||||||
import { date } from 'quasar';
|
import { date } from 'quasar';
|
||||||
|
import VnSelectSupplier from 'src/components/common/VnSelectSupplier.vue';
|
||||||
|
|
||||||
defineProps({ dataKey: { type: String, required: true } });
|
defineProps({ dataKey: { type: String, required: true } });
|
||||||
const dateFormat = 'YYYY-MM-DDTHH:mm:ss.SSSZ';
|
const dateFormat = 'YYYY-MM-DDTHH:mm:ss.SSSZ';
|
||||||
|
@ -65,29 +66,12 @@ function handleDaysAgo(params, daysAgo) {
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnSelect
|
<VnSelectSupplier
|
||||||
v-model="params.supplierFk"
|
v-model="params.supplierFk"
|
||||||
url="Suppliers"
|
|
||||||
:fields="['id', 'nickname', 'name']"
|
|
||||||
:label="getLocale('supplierFk')"
|
|
||||||
option-label="nickname"
|
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
rounded
|
rounded
|
||||||
>
|
/>
|
||||||
<template #option="scope">
|
|
||||||
<QItem v-bind="scope.itemProps">
|
|
||||||
<QItemSection>
|
|
||||||
<QItemLabel>
|
|
||||||
{{ scope.opt?.name}}
|
|
||||||
</QItemLabel>
|
|
||||||
<QItemLabel caption>
|
|
||||||
{{ `#${scope.opt?.id } , ${ scope.opt?.nickname}` }}
|
|
||||||
</QItemLabel>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
</template>
|
|
||||||
</VnSelect>
|
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
|
|
|
@ -15,6 +15,7 @@ import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
||||||
import FetchData from 'src/components/FetchData.vue';
|
import FetchData from 'src/components/FetchData.vue';
|
||||||
|
import VnSelectSupplier from 'src/components/common/VnSelectSupplier.vue';
|
||||||
|
|
||||||
const user = useState().getUser();
|
const user = useState().getUser();
|
||||||
const { viewSummary } = useSummaryDialog();
|
const { viewSummary } = useSummaryDialog();
|
||||||
|
@ -162,25 +163,7 @@ const cols = computed(() => [
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
<template #more-create-dialog="{ data }">
|
<template #more-create-dialog="{ data }">
|
||||||
<VnSelect
|
<VnSelectSupplier v-model="data.supplierFk" hide-selected :required="true" />
|
||||||
v-model="data.supplierFk"
|
|
||||||
url="Suppliers"
|
|
||||||
:fields="['id', 'nickname', 'name']"
|
|
||||||
:label="t('globals.supplier')"
|
|
||||||
option-value="id"
|
|
||||||
option-label="nickname"
|
|
||||||
:filter-options="['id', 'name', 'nickname']"
|
|
||||||
:required="true"
|
|
||||||
>
|
|
||||||
<template #option="scope">
|
|
||||||
<QItem v-bind="scope.itemProps">
|
|
||||||
<QItemSection>
|
|
||||||
<QItemLabel>{{ scope.opt?.nickname }}</QItemLabel>
|
|
||||||
<QItemLabel caption> #{{ scope.opt?.id }}, {{ scope.opt?.name }} </QItemLabel>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
</template>
|
|
||||||
</VnSelect>
|
|
||||||
<VnInput
|
<VnInput
|
||||||
:label="t('invoicein.list.supplierRef')"
|
:label="t('invoicein.list.supplierRef')"
|
||||||
v-model="data.supplierRef"
|
v-model="data.supplierRef"
|
||||||
|
|
|
@ -13,6 +13,7 @@ import { QCheckbox } from 'quasar';
|
||||||
import { useArrayData } from 'composables/useArrayData';
|
import { useArrayData } from 'composables/useArrayData';
|
||||||
import { useValidator } from 'src/composables/useValidator';
|
import { useValidator } from 'src/composables/useValidator';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
import VnSelectSupplier from 'src/components/common/VnSelectSupplier.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
|
@ -247,34 +248,14 @@ onMounted(async () => {
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnSelect
|
<VnSelectSupplier
|
||||||
:label="t('params.supplierFk')"
|
|
||||||
v-model="params.supplierFk"
|
v-model="params.supplierFk"
|
||||||
@update:model-value="searchFn()"
|
@update:model-value="searchFn()"
|
||||||
url="Suppliers"
|
|
||||||
option-value="id"
|
|
||||||
option-label="name"
|
|
||||||
:fields="['id', 'name', 'nickname']"
|
|
||||||
:filter-options="['id', 'name', 'nickname']"
|
|
||||||
sort-by="name ASC"
|
|
||||||
hide-selected
|
hide-selected
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
rounded
|
rounded
|
||||||
>
|
/>
|
||||||
<template #option="scope">
|
|
||||||
<QItem v-bind="scope.itemProps">
|
|
||||||
<QItemSection>
|
|
||||||
<QItemLabel>
|
|
||||||
{{ scope.opt?.name}}
|
|
||||||
</QItemLabel>
|
|
||||||
<QItemLabel caption>
|
|
||||||
{{ `#${scope.opt?.id } , ${ scope.opt?.nickname}` }}
|
|
||||||
</QItemLabel>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
</template>
|
|
||||||
</VnSelect>
|
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<!-- Tags filter -->
|
<!-- Tags filter -->
|
||||||
|
@ -369,7 +350,7 @@ onMounted(async () => {
|
||||||
:model-value="fieldFilter.selectedField"
|
:model-value="fieldFilter.selectedField"
|
||||||
:options="moreFields"
|
:options="moreFields"
|
||||||
option-label="label"
|
option-label="label"
|
||||||
option-value="label"
|
option-value="label"
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
rounded
|
rounded
|
||||||
|
|
|
@ -6,6 +6,7 @@ import VnFilterPanel from 'components/ui/VnFilterPanel.vue';
|
||||||
import VnSelect from 'components/common/VnSelect.vue';
|
import VnSelect from 'components/common/VnSelect.vue';
|
||||||
import VnInputDate from 'components/common/VnInputDate.vue';
|
import VnInputDate from 'components/common/VnInputDate.vue';
|
||||||
import VnInput from 'components/common/VnInput.vue';
|
import VnInput from 'components/common/VnInput.vue';
|
||||||
|
import VnSelectSupplier from 'src/components/common/VnSelectSupplier.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
@ -19,7 +20,6 @@ const emit = defineEmits(['search']);
|
||||||
|
|
||||||
const agencyList = ref([]);
|
const agencyList = ref([]);
|
||||||
const agencyAgreementList = ref([]);
|
const agencyAgreementList = ref([]);
|
||||||
const supplierList = ref([]);
|
|
||||||
|
|
||||||
const exprBuilder = (param, value) => {
|
const exprBuilder = (param, value) => {
|
||||||
switch (param) {
|
switch (param) {
|
||||||
|
@ -58,14 +58,6 @@ const exprBuilder = (param, value) => {
|
||||||
@on-fetch="(data) => (agencyAgreementList = data)"
|
@on-fetch="(data) => (agencyAgreementList = data)"
|
||||||
auto-load
|
auto-load
|
||||||
/>
|
/>
|
||||||
<FetchData
|
|
||||||
url="Suppliers"
|
|
||||||
:filter="{ fields: ['name'] }"
|
|
||||||
sort-by="name ASC"
|
|
||||||
limit="30"
|
|
||||||
@on-fetch="(data) => (supplierList = data)"
|
|
||||||
auto-load
|
|
||||||
/>
|
|
||||||
<VnFilterPanel
|
<VnFilterPanel
|
||||||
:data-key="props.dataKey"
|
:data-key="props.dataKey"
|
||||||
:expr-builder="exprBuilder"
|
:expr-builder="exprBuilder"
|
||||||
|
@ -123,14 +115,12 @@ const exprBuilder = (param, value) => {
|
||||||
/>
|
/>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem class="q-my-sm" v-if="supplierList">
|
<QItem class="q-my-sm">
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnSelect
|
<VnSelectSupplier
|
||||||
:label="t('Autonomous')"
|
:label="t('Autonomous')"
|
||||||
v-model="params.supplierFk"
|
v-model="params.supplierFk"
|
||||||
:options="supplierList"
|
hide-selected
|
||||||
option-value="name"
|
|
||||||
option-label="name"
|
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
rounded
|
rounded
|
||||||
|
|
|
@ -6,29 +6,18 @@ import FormModel from 'components/FormModel.vue';
|
||||||
import VnInputDate from 'components/common/VnInputDate.vue';
|
import VnInputDate from 'components/common/VnInputDate.vue';
|
||||||
import VnInput from 'components/common/VnInput.vue';
|
import VnInput from 'components/common/VnInput.vue';
|
||||||
import VnInputTime from 'components/common/VnInputTime.vue';
|
import VnInputTime from 'components/common/VnInputTime.vue';
|
||||||
import VnSelect from 'components/common/VnSelect.vue';
|
import VnSelectSupplier from 'src/components/common/VnSelectSupplier.vue';
|
||||||
import FetchData from 'components/FetchData.vue';
|
|
||||||
import { ref } from 'vue';
|
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
|
||||||
const supplierList = ref([]);
|
|
||||||
const filter = { include: [{ relation: 'supplier' }] };
|
const filter = { include: [{ relation: 'supplier' }] };
|
||||||
const onSave = (data, response) => {
|
const onSave = (data, response) => {
|
||||||
router.push({ name: 'RoadmapSummary', params: { id: response?.id } });
|
router.push({ name: 'RoadmapSummary', params: { id: response?.id } });
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
|
||||||
url="Suppliers"
|
|
||||||
auto-load
|
|
||||||
:filter="{ fields: ['id', 'nickname'] }"
|
|
||||||
sort-by="nickname"
|
|
||||||
limit="30"
|
|
||||||
@on-fetch="(data) => (supplierList = data)"
|
|
||||||
/>
|
|
||||||
<FormModel
|
<FormModel
|
||||||
:url="`Roadmaps/${route.params?.id}`"
|
:url="`Roadmaps/${route.params?.id}`"
|
||||||
observe-form-changes
|
observe-form-changes
|
||||||
|
@ -56,27 +45,14 @@ const onSave = (data, response) => {
|
||||||
/>
|
/>
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnSelect
|
<VnSelectSupplier
|
||||||
:label="t('Carrier')"
|
:label="t('Carrier')"
|
||||||
v-model="data.supplierFk"
|
v-model="data.supplierFk"
|
||||||
:options="supplierList"
|
|
||||||
option-value="id"
|
|
||||||
option-label="nickname"
|
|
||||||
emit-value
|
emit-value
|
||||||
map-options
|
map-options
|
||||||
use-input
|
use-input
|
||||||
:input-debounce="0"
|
:input-debounce="0"
|
||||||
>
|
/>
|
||||||
<template #option="{ itemProps, opt }">
|
|
||||||
<QItem v-bind="itemProps">
|
|
||||||
<QItemSection>
|
|
||||||
<QItemLabel
|
|
||||||
>{{ opt.id }} - {{ opt.nickname }}
|
|
||||||
</QItemLabel>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
</template>
|
|
||||||
</VnSelect>
|
|
||||||
<VnInput
|
<VnInput
|
||||||
v-model="data.price"
|
v-model="data.price"
|
||||||
:label="t('Price')"
|
:label="t('Price')"
|
||||||
|
|
|
@ -3,9 +3,9 @@ import { ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import FetchData from 'components/FetchData.vue';
|
import FetchData from 'components/FetchData.vue';
|
||||||
import VnFilterPanel from 'components/ui/VnFilterPanel.vue';
|
import VnFilterPanel from 'components/ui/VnFilterPanel.vue';
|
||||||
import VnSelect from 'components/common/VnSelect.vue';
|
|
||||||
import VnInputDate from 'components/common/VnInputDate.vue';
|
import VnInputDate from 'components/common/VnInputDate.vue';
|
||||||
import VnInput from 'components/common/VnInput.vue';
|
import VnInput from 'components/common/VnInput.vue';
|
||||||
|
import VnSelectSupplier from 'src/components/common/VnSelectSupplier.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
@ -17,7 +17,6 @@ const props = defineProps({
|
||||||
|
|
||||||
const emit = defineEmits(['search']);
|
const emit = defineEmits(['search']);
|
||||||
|
|
||||||
const supplierList = ref([]);
|
|
||||||
const exprBuilder = (param, value) => {
|
const exprBuilder = (param, value) => {
|
||||||
switch (param) {
|
switch (param) {
|
||||||
case 'tractorPlate':
|
case 'tractorPlate':
|
||||||
|
@ -37,14 +36,6 @@ const exprBuilder = (param, value) => {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
|
||||||
url="Suppliers"
|
|
||||||
:filter="{ fields: ['id', 'nickname'] }"
|
|
||||||
sort-by="nickname"
|
|
||||||
limit="30"
|
|
||||||
@on-fetch="(data) => (supplierList = data)"
|
|
||||||
auto-load
|
|
||||||
/>
|
|
||||||
<VnFilterPanel
|
<VnFilterPanel
|
||||||
:data-key="props.dataKey"
|
:data-key="props.dataKey"
|
||||||
:search-button="true"
|
:search-button="true"
|
||||||
|
@ -88,14 +79,11 @@ const exprBuilder = (param, value) => {
|
||||||
/>
|
/>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem v-if="supplierList" class="q-my-sm">
|
<QItem class="q-my-sm">
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnSelect
|
<VnSelectSupplier
|
||||||
:label="t('Carrier')"
|
:label="t('Carrier')"
|
||||||
v-model="params.supplierFk"
|
v-model="params.supplierFk"
|
||||||
:options="supplierList"
|
|
||||||
option-value="id"
|
|
||||||
option-label="nickname"
|
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
rounded
|
rounded
|
||||||
|
@ -103,17 +91,7 @@ const exprBuilder = (param, value) => {
|
||||||
map-options
|
map-options
|
||||||
use-input
|
use-input
|
||||||
:input-debounce="0"
|
:input-debounce="0"
|
||||||
>
|
/>
|
||||||
<template #option="{ itemProps, opt }">
|
|
||||||
<QItem v-bind="itemProps">
|
|
||||||
<QItemSection>
|
|
||||||
<QItemLabel
|
|
||||||
>{{ opt.id }} - {{ opt.nickname }}</QItemLabel
|
|
||||||
>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
</template>
|
|
||||||
</VnSelect>
|
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem class="q-my-sm">
|
<QItem class="q-my-sm">
|
||||||
|
|
|
@ -8,6 +8,7 @@ import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
import VnInput from 'src/components/common/VnInput.vue';
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
import VnInputDate from 'components/common/VnInputDate.vue';
|
import VnInputDate from 'components/common/VnInputDate.vue';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
import VnSelectSupplier from 'src/components/common/VnSelectSupplier.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
@ -48,11 +49,11 @@ const warehouses = async () => {
|
||||||
|
|
||||||
continentsResponse.data.forEach((continent) => {
|
continentsResponse.data.forEach((continent) => {
|
||||||
const countriesInContinent = Object.keys(countryContinentMap).filter(
|
const countriesInContinent = Object.keys(countryContinentMap).filter(
|
||||||
(countryId) => countryContinentMap[countryId] === continent.id.toString()
|
(countryId) => countryContinentMap[countryId] === continent.id.toString(),
|
||||||
);
|
);
|
||||||
|
|
||||||
warehousesByContinent.value[continent.code] = warehousesResponse.data.filter(
|
warehousesByContinent.value[continent.code] = warehousesResponse.data.filter(
|
||||||
(warehouse) => countriesInContinent.includes(warehouse.countryFk.toString())
|
(warehouse) => countriesInContinent.includes(warehouse.countryFk.toString()),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -211,30 +212,13 @@ warehouses();
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnSelect
|
<VnSelectSupplier
|
||||||
:label="t('globals.pageTitles.supplier')"
|
|
||||||
v-model="params.cargoSupplierFk"
|
v-model="params.cargoSupplierFk"
|
||||||
url="Suppliers"
|
|
||||||
option-value="id"
|
|
||||||
option-label="name"
|
|
||||||
hide-selected
|
hide-selected
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
rounded
|
rounded
|
||||||
>
|
/>
|
||||||
<template #option="scope">
|
|
||||||
<QItem v-bind="scope.itemProps">
|
|
||||||
<QItemSection>
|
|
||||||
<QItemLabel>
|
|
||||||
{{ scope.opt?.name}}
|
|
||||||
</QItemLabel>
|
|
||||||
<QItemLabel caption>
|
|
||||||
{{ `#${scope.opt?.id } , ${ scope.opt?.nickname}` }}
|
|
||||||
</QItemLabel>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
</template>
|
|
||||||
</VnSelect>
|
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
|
|
Loading…
Reference in New Issue