0
0
Fork 0

Merge pull request 'test To Dev' (!665) from testToDev into dev

Reviewed-on: verdnatura/salix-front#665
Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
This commit is contained in:
Jorge Penadés 2024-09-02 13:12:20 +00:00
commit 6c113e33fd
17 changed files with 82 additions and 244 deletions

View File

@ -97,7 +97,12 @@ const title = ref();
:rules="validate('client.salesPersonFk')" :rules="validate('client.salesPersonFk')"
:use-like="false" :use-like="false"
:emit-value="false" :emit-value="false"
@update:model-value="(val) => (title = val?.nickname)" @update:model-value="
(val) => {
title = val?.nickname;
data.salesPersonFk = val?.id;
}
"
> >
<template #prepend> <template #prepend>
<VnAvatar <VnAvatar

View File

@ -19,8 +19,6 @@ const { t } = useI18n();
const { hasAny } = useRole(); const { hasAny } = useRole();
const isAdministrative = () => hasAny(['administrative']); const isAdministrative = () => hasAny(['administrative']);
const suppliersOptions = ref([]);
const travelsOptions = ref([]);
const companiesOptions = ref([]); const companiesOptions = ref([]);
const currenciesOptions = ref([]); const currenciesOptions = ref([]);
@ -29,20 +27,6 @@ const onFilterTravelSelected = (formData, id) => {
}; };
</script> </script>
<template> <template>
<FetchData
url="Suppliers"
:filter="{ fields: ['id', 'nickname'] }"
order="nickname"
@on-fetch="(data) => (suppliersOptions = data)"
auto-load
/>
<FetchData
url="Travels/filter"
:filter="{ fields: ['id', 'warehouseInName'] }"
order="id"
@on-fetch="(data) => (travelsOptions = data)"
auto-load
/>
<FetchData <FetchData
ref="companiesRef" ref="companiesRef"
url="Companies" url="Companies"
@ -71,9 +55,10 @@ const onFilterTravelSelected = (formData, id) => {
<VnSelect <VnSelect
:label="t('entry.basicData.supplier')" :label="t('entry.basicData.supplier')"
v-model="data.supplierFk" v-model="data.supplierFk"
:options="suppliersOptions" url="Suppliers"
option-value="id" option-value="id"
option-label="nickname" option-label="nickname"
:fields="['id', 'nickname']"
hide-selected hide-selected
:required="true" :required="true"
map-options map-options
@ -92,7 +77,8 @@ const onFilterTravelSelected = (formData, id) => {
<VnSelectDialog <VnSelectDialog
:label="t('entry.basicData.travel')" :label="t('entry.basicData.travel')"
v-model="data.travelFk" v-model="data.travelFk"
:options="travelsOptions" url="Travels/filter"
:fields="['id', 'warehouseInName']"
option-value="id" option-value="id"
option-label="warehouseInName" option-label="warehouseInName"
map-options map-options

View File

@ -20,7 +20,6 @@ const props = defineProps({
const currenciesOptions = ref([]); const currenciesOptions = ref([]);
const companiesOptions = ref([]); const companiesOptions = ref([]);
const suppliersOptions = ref([]);
const stateStore = useStateStore(); const stateStore = useStateStore();
onMounted(async () => { onMounted(async () => {
@ -45,14 +44,6 @@ onMounted(async () => {
@on-fetch="(data) => (currenciesOptions = data)" @on-fetch="(data) => (currenciesOptions = data)"
auto-load auto-load
/> />
<FetchData
url="Suppliers"
:filter="{ fields: ['id', 'nickname', 'name'] }"
order="nickname"
@on-fetch="(data) => (suppliersOptions = data)"
auto-load
/>
<VnFilterPanel :data-key="props.dataKey" :search-button="true"> <VnFilterPanel :data-key="props.dataKey" :search-button="true">
<template #tags="{ tag, formatFn }"> <template #tags="{ tag, formatFn }">
<div class="q-gutter-x-xs"> <div class="q-gutter-x-xs">
@ -135,9 +126,11 @@ onMounted(async () => {
:label="t('params.supplierFk')" :label="t('params.supplierFk')"
v-model="params.supplierFk" v-model="params.supplierFk"
@update:model-value="searchFn()" @update:model-value="searchFn()"
:options="suppliersOptions" url="Suppliers"
option-value="id" option-value="id"
option-label="name" option-label="name"
:fields="['id', 'name', 'nickname']"
sort-by="nickname"
hide-selected hide-selected
dense dense
outlined outlined

View File

@ -19,15 +19,6 @@ const itemSpeciesOptions = ref([]);
const itemBotanicals = ref([]); const itemBotanicals = ref([]);
let itemBotanicalsForm = reactive({ itemFk: null }); let itemBotanicalsForm = reactive({ itemFk: null });
const onGenusCreated = (response, formData) => {
itemGenusOptions.value = [...itemGenusOptions.value, response];
formData.genusFk = response.id;
};
const onSpecieCreated = (response, formData) => {
itemSpeciesOptions.value = [...itemSpeciesOptions.value, response];
formData.specieFk = response.id;
};
const entityId = computed(() => { const entityId = computed(() => {
return route.params.id; return route.params.id;
}); });
@ -47,18 +38,6 @@ onMounted(async () => {
}" }"
@on-fetch="(data) => (itemBotanicals = data)" @on-fetch="(data) => (itemBotanicals = data)"
/> />
<FetchData
url="Genera"
:filter="{ fields: ['id', 'name'], order: 'name ASC' }"
@on-fetch="(data) => (itemGenusOptions = data)"
auto-load
/>
<FetchData
url="Species"
:filter="{ fields: ['id', 'name'], order: 'name ASC' }"
@on-fetch="(data) => (itemSpeciesOptions = data)"
auto-load
/>
<FormModel <FormModel
url-update="ItemBotanicals" url-update="ItemBotanicals"
model="entry" model="entry"
@ -69,36 +48,35 @@ onMounted(async () => {
<template #form="{ data }"> <template #form="{ data }">
<VnRow> <VnRow>
<VnSelectDialog <VnSelectDialog
ref="genusRef"
:label="t('Genus')" :label="t('Genus')"
v-model="data.genusFk" v-model="data.genusFk"
:options="itemGenusOptions" url="Genera"
option-label="name" option-label="name"
option-value="id" option-value="id"
:fields="['id', 'name']"
sort-by="name ASC"
hide-selected hide-selected
> >
<template #form> <template #form>
<CreateGenusForm <CreateGenusForm
@on-data-saved=" @on-data-saved="(_, res) => (data.genusFk = res.id)"
(_, requestResponse) =>
onGenusCreated(requestResponse, data)
"
/> />
</template> </template>
</VnSelectDialog> </VnSelectDialog>
<VnSelectDialog <VnSelectDialog
:label="t('Species')" :label="t('Species')"
v-model="data.specieFk" v-model="data.specieFk"
:options="itemSpeciesOptions" url="Species"
option-label="name" option-label="name"
option-value="id" option-value="id"
:fields="['id', 'name']"
sort-by="name ASC"
hide-selected hide-selected
> >
<template #form> <template #form>
<CreateSpecieForm <CreateSpecieForm
@on-data-saved=" @on-data-saved="(_, res) => (data.specieFk = res.id)"
(_, requestResponse) =>
onSpecieCreated(requestResponse, data)
"
/> />
</template> </template>
</VnSelectDialog> </VnSelectDialog>

View File

@ -3,7 +3,6 @@ import { onMounted, ref, computed, reactive } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import FetchData from 'components/FetchData.vue';
import VnInput from 'src/components/common/VnInput.vue'; import VnInput from 'src/components/common/VnInput.vue';
import VnSelect from 'src/components/common/VnSelect.vue'; import VnSelect from 'src/components/common/VnSelect.vue';
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue'; import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
@ -24,8 +23,6 @@ const { notify } = useNotify();
const { openConfirmationModal } = useVnConfirm(); const { openConfirmationModal } = useVnConfirm();
const rowsSelected = ref([]); const rowsSelected = ref([]);
const parkingsOptions = ref([]);
const shelvingsOptions = ref([]);
const exprBuilder = (param, value) => { const exprBuilder = (param, value) => {
switch (param) { switch (param) {
@ -104,7 +101,9 @@ const columns = computed(() => [
filterValue: null, filterValue: null,
event: getInputEvents, event: getInputEvents,
attrs: { attrs: {
options: parkingsOptions.value, url: 'parkings',
fields: ['code'],
'sort-by': 'code ASC',
'option-value': 'code', 'option-value': 'code',
'option-label': 'code', 'option-label': 'code',
dense: true, dense: true,
@ -124,7 +123,9 @@ const columns = computed(() => [
filterValue: null, filterValue: null,
event: getInputEvents, event: getInputEvents,
attrs: { attrs: {
options: shelvingsOptions.value, url: 'shelvings',
fields: ['code'],
'sort-by': 'code ASC',
'option-value': 'code', 'option-value': 'code',
'option-label': 'code', 'option-label': 'code',
dense: true, dense: true,
@ -188,18 +189,6 @@ onMounted(async () => {
</script> </script>
<template> <template>
<FetchData
url="parkings"
:filter="{ fields: ['code'], order: 'code ASC' }"
auto-load
@on-fetch="(data) => (parkingsOptions = data)"
/>
<FetchData
url="shelvings"
:filter="{ fields: ['code'], order: 'code ASC' }"
auto-load
@on-fetch="(data) => (shelvingsOptions = data)"
/>
<template v-if="stateStore.isHeaderMounted()"> <template v-if="stateStore.isHeaderMounted()">
<Teleport to="#st-data"> <Teleport to="#st-data">
<div class="q-pa-md q-mr-lg q-ma-xs" style="border: 2px solid #222"> <div class="q-pa-md q-mr-lg q-ma-xs" style="border: 2px solid #222">
@ -237,7 +226,6 @@ onMounted(async () => {
</QBtn> </QBtn>
</Teleport> </Teleport>
</template> </template>
<QPage class="column items-center q-pa-md"> <QPage class="column items-center q-pa-md">
<QTable <QTable
:rows="rows" :rows="rows"

View File

@ -24,6 +24,7 @@ const getSelectedTagValues = async (tag) => {
const filter = { const filter = {
fields: ['value'], fields: ['value'],
order: 'value ASC', order: 'value ASC',
limit: 30,
}; };
const params = { filter: JSON.stringify(filter) }; const params = { filter: JSON.stringify(filter) };
@ -126,7 +127,7 @@ const insertTag = (rows) => {
:key="row.tagFk" :key="row.tagFk"
:label="t('Value')" :label="t('Value')"
v-model="row.value" v-model="row.value"
:options="valueOptionsMap.get(row.tagFk)" :url="`Tags/${row.tagFk}/filterValue`"
option-label="value" option-label="value"
option-value="value" option-value="value"
emit-value emit-value
@ -135,6 +136,7 @@ const insertTag = (rows) => {
:is-clearable="false" :is-clearable="false"
:required="false" :required="false"
:rules="validate('itemTag.tagFk')" :rules="validate('itemTag.tagFk')"
:use-like="false"
/> />
<VnInput <VnInput
v-else-if=" v-else-if="

View File

@ -30,7 +30,7 @@ const itemTypesRef = ref(null);
const categoriesOptions = ref([]); const categoriesOptions = ref([]);
const itemTypesOptions = ref([]); const itemTypesOptions = ref([]);
const buyersOptions = ref([]); const buyersOptions = ref([]);
const suppliersOptions = ref([]); const tagOptions = ref([]);
const tagValues = ref([]); const tagValues = ref([]);
const fieldFiltersValues = ref([]); const fieldFiltersValues = ref([]);
const moreFields = ref([]); const moreFields = ref([]);
@ -161,12 +161,6 @@ onMounted(async () => {
@on-fetch="(data) => (buyersOptions = data)" @on-fetch="(data) => (buyersOptions = data)"
auto-load auto-load
/> />
<FetchData
url="Suppliers"
:filter="{ fields: ['id', 'name', 'nickname'], order: 'name ASC' }"
@on-fetch="(data) => (suppliersOptions = data)"
auto-load
/>
<FetchData <FetchData
url="Tags" url="Tags"
:filter="{ fields: ['id', 'name', 'isFree'] }" :filter="{ fields: ['id', 'name', 'isFree'] }"
@ -261,9 +255,11 @@ onMounted(async () => {
:label="t('params.supplierFk')" :label="t('params.supplierFk')"
v-model="params.supplierFk" v-model="params.supplierFk"
@update:model-value="searchFn()" @update:model-value="searchFn()"
:options="suppliersOptions" url="Suppliers"
option-value="id" option-value="id"
option-label="name" option-label="name"
:fields="['id', 'name', 'nickname']"
sort-by="name ASC"
hide-selected hide-selected
dense dense
outlined outlined

View File

@ -22,7 +22,6 @@ import RightMenu from 'src/components/common/RightMenu.vue';
const { t } = useI18n(); const { t } = useI18n();
const { notify } = useNotify(); const { notify } = useNotify();
const stateStore = useStateStore(); const stateStore = useStateStore();
const workersOptions = ref([]);
let filterParams = ref({}); let filterParams = ref({});
const denyFormRef = ref(null); const denyFormRef = ref(null);
const denyRequestId = ref(null); const denyRequestId = ref(null);
@ -208,13 +207,6 @@ onBeforeMount(() => {
</script> </script>
<template> <template>
<FetchData
url="Workers"
:filter="{ where: { role: 'buyer' } }"
order="id"
@on-fetch="(data) => (workersOptions = data)"
auto-load
/>
<VnSearchbar <VnSearchbar
data-key="ItemRequests" data-key="ItemRequests"
url="TicketRequests/filter" url="TicketRequests/filter"
@ -268,7 +260,9 @@ onBeforeMount(() => {
<QTd> <QTd>
<VnSelect <VnSelect
v-model="row.attenderFk" v-model="row.attenderFk"
:options="workersOptions" :where="{ role: 'buyer' }"
sort-by="id"
url="Workers"
hide-selected hide-selected
option-label="firstName" option-label="firstName"
option-value="id" option-value="id"

View File

@ -24,7 +24,6 @@ const stateOptions = [
const itemTypesOptions = ref([]); const itemTypesOptions = ref([]);
const warehousesOptions = ref([]); const warehousesOptions = ref([]);
const workersOptions = ref([]);
const exprBuilder = (param, value) => { const exprBuilder = (param, value) => {
switch (param) { switch (param) {
@ -72,18 +71,6 @@ const decrement = (paramsObj, key) => {
@on-fetch="(data) => (warehousesOptions = data)" @on-fetch="(data) => (warehousesOptions = data)"
auto-load auto-load
/> />
<FetchData
url="Workers/search"
:filter="{
fields: ['id', 'name'],
order: 'name ASC',
}"
:params="{
departmentCodes: ['VT'],
}"
@on-fetch="(data) => (workersOptions = data)"
auto-load
/>
<VnFilterPanel <VnFilterPanel
:data-key="props.dataKey" :data-key="props.dataKey"
:search-button="true" :search-button="true"
@ -162,7 +149,10 @@ const decrement = (paramsObj, key) => {
:label="t('params.requesterFk')" :label="t('params.requesterFk')"
v-model="params.requesterFk" v-model="params.requesterFk"
@update:model-value="searchFn()" @update:model-value="searchFn()"
:options="workersOptions" url="Workers/search"
:fields="['id', 'name']"
order="name ASC"
:params="{ departmentCodes: ['VT'] }"
option-value="id" option-value="id"
option-label="name" option-label="name"
hide-selected hide-selected

View File

@ -3,6 +3,7 @@ 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 'src/components/common/VnSelect.vue';
const { t } = useI18n(); const { t } = useI18n();
const props = defineProps({ const props = defineProps({
@ -15,25 +16,13 @@ const props = defineProps({
const emit = defineEmits(['search']); const emit = defineEmits(['search']);
const workers = ref(); const workers = ref();
const parkings = ref();
function setWorkers(data) { function setWorkers(data) {
workers.value = data; workers.value = data;
} }
function setParkings(data) {
parkings.value = data;
}
</script> </script>
<template> <template>
<FetchData
url="Parkings"
:filter="{ fields: ['id', 'code'] }"
sort-by="code ASC"
@on-fetch="setParkings"
auto-load
/>
<FetchData <FetchData
url="Workers/activeWithInheritedRole" url="Workers/activeWithInheritedRole"
:filter="{ where: { role: 'salesPerson' } }" :filter="{ where: { role: 'salesPerson' } }"
@ -54,44 +43,36 @@ function setParkings(data) {
</template> </template>
<template #body="{ params }"> <template #body="{ params }">
<QItem class="q-my-sm"> <QItem class="q-my-sm">
<QItemSection v-if="!parkings"> <QItemSection>
<QSkeleton type="QInput" class="full-width" /> <VnSelect
</QItemSection> v-model="params.parkingFk"
<QItemSection v-if="parkings"> url="Parkings"
<QSelect :fields="['id', 'code']"
:label="t('params.parkingFk')"
option-value="id"
option-label="code"
:filter-options="['id', 'code']"
dense dense
outlined outlined
rounded rounded
:label="t('params.parkingFk')" sort-by="code ASC"
v-model="params.parkingFk"
:options="parkings"
option-value="id"
option-label="code"
emit-value
map-options
use-input
:input-debounce="0"
/> />
</QItemSection> </QItemSection>
</QItem> </QItem>
<QItem class="q-mb-sm"> <QItem class="q-mb-sm">
<QItemSection v-if="!workers"> <QItemSection>
<QSkeleton type="QInput" class="full-width" /> <VnSelect
</QItemSection>
<QItemSection v-if="workers">
<QSelect
dense dense
outlined outlined
rounded rounded
:label="t('params.userFk')" :label="t('params.userFk')"
v-model="params.userFk" v-model="params.userFk"
:options="workers" url="Workers/activeWithInheritedRole"
option-value="id" option-value="id"
option-label="name" option-label="firstName"
emit-value :where="{ role: 'salesPerson' }"
map-options sort-by="firstName ASC"
use-input :use-like="false"
:input-debounce="0"
/> />
</QItemSection> </QItemSection>
</QItem> </QItem>

View File

@ -1,12 +1,12 @@
<script setup> <script setup>
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { computed, ref } from 'vue'; import { computed } from 'vue';
import { useRoute, useRouter } from 'vue-router'; import { useRoute, useRouter } from 'vue-router';
import VnRow from 'components/ui/VnRow.vue'; import VnRow from 'components/ui/VnRow.vue';
import FetchData from 'components/FetchData.vue';
import FormModel from 'components/FormModel.vue'; import FormModel from 'components/FormModel.vue';
import VnInput from 'src/components/common/VnInput.vue'; import VnInput from 'src/components/common/VnInput.vue';
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue'; import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
import VnSelect from 'src/components/common/VnSelect.vue';
const { t } = useI18n(); const { t } = useI18n();
const route = useRoute(); const route = useRoute();
@ -20,30 +20,6 @@ const defaultInitialData = {
isRecyclable: false, isRecyclable: false,
}; };
const parkingFilter = { fields: ['id', 'code'] };
const parkingList = ref([]);
const parkingListCopy = ref([]);
const setParkingList = (data) => {
parkingList.value = data;
parkingListCopy.value = data;
};
const parkingSelectFilter = {
options: parkingList,
filterFn: (options, value) => {
const search = value.trim().toLowerCase();
if (!search || search === '') {
return parkingListCopy.value;
}
return options.value.filter((option) =>
option.code.toLowerCase().startsWith(search)
);
},
};
const shelvingFilter = { const shelvingFilter = {
include: [ include: [
{ {
@ -68,12 +44,6 @@ const onSave = (shelving, newShelving) => {
</script> </script>
<template> <template>
<VnSubToolbar v-if="isNew" /> <VnSubToolbar v-if="isNew" />
<FetchData
url="Parkings"
:filter="parkingFilter"
@on-fetch="setParkingList"
auto-load
/>
<FormModel <FormModel
:url="isNew ? null : `Shelvings/${entityId}`" :url="isNew ? null : `Shelvings/${entityId}`"
:url-create="isNew ? 'Shelvings' : null" :url-create="isNew ? 'Shelvings' : null"
@ -84,27 +54,22 @@ const onSave = (shelving, newShelving) => {
:form-initial-data="isNew ? defaultInitialData : null" :form-initial-data="isNew ? defaultInitialData : null"
@on-data-saved="onSave" @on-data-saved="onSave"
> >
<template #form="{ data, validate, filter }"> <template #form="{ data, validate }">
<VnRow> <VnRow>
<VnInput <VnInput
v-model="data.code" v-model="data.code"
:label="t('shelving.basicData.code')" :label="t('shelving.basicData.code')"
:rules="validate('Shelving.code')" :rules="validate('Shelving.code')"
/> />
<QSelect <VnSelect
v-model="data.parkingFk" v-model="data.parkingFk"
:options="parkingList" url="Parkings"
option-value="id" option-value="id"
option-label="code" option-label="code"
emit-value :filter-options="['id', 'code']"
:fields="['id', 'code']"
:label="t('shelving.basicData.parking')" :label="t('shelving.basicData.parking')"
map-options
use-input
@filter="
(value, update) => filter(value, update, parkingSelectFilter)
"
:rules="validate('Shelving.parkingFk')" :rules="validate('Shelving.parkingFk')"
:input-debounce="0"
/> />
</VnRow> </VnRow>
<VnRow> <VnRow>

View File

@ -30,7 +30,6 @@ const { t } = useI18n();
const agencyFetchRef = ref(null); const agencyFetchRef = ref(null);
const zonesFetchRef = ref(null); const zonesFetchRef = ref(null);
const clientsOptions = ref([]);
const warehousesOptions = ref([]); const warehousesOptions = ref([]);
const companiesOptions = ref([]); const companiesOptions = ref([]);
const agenciesOptions = ref([]); const agenciesOptions = ref([]);
@ -273,15 +272,6 @@ const redirectToCustomerAddress = () => {
onMounted(() => onFormModelInit()); onMounted(() => onFormModelInit());
</script> </script>
<template> <template>
<FetchData
url="Clients"
:filter="{
fields: ['id', 'name'],
order: 'id',
}"
@on-fetch="(data) => (clientsOptions = data)"
auto-load
/>
<FetchData <FetchData
url="Warehouses" url="Warehouses"
@on-fetch="(data) => (warehousesOptions = data)" @on-fetch="(data) => (warehousesOptions = data)"
@ -317,7 +307,9 @@ onMounted(() => onFormModelInit());
v-model="clientId" v-model="clientId"
option-value="id" option-value="id"
option-label="name" option-label="name"
:options="clientsOptions" url="Clients"
:fields="['id', 'name']"
sort-by="id"
hide-selected hide-selected
map-options map-options
:required="true" :required="true"

View File

@ -17,9 +17,7 @@ const { t } = useI18n();
const state = useState(); const state = useState();
const user = state.getUser(); const user = state.getUser();
const stateFetchDataRef = ref(null); const stateFetchDataRef = ref(null);
const statesOptions = ref([]); const statesOptions = ref([]);
const workersOptions = ref([]);
const onStateFkChange = (formData) => (formData.userFk = user.value.id); const onStateFkChange = (formData) => (formData.userFk = user.value.id);
</script> </script>
@ -30,12 +28,6 @@ const onStateFkChange = (formData) => (formData.userFk = user.value.id);
auto-load auto-load
@on-fetch="(data) => (statesOptions = data)" @on-fetch="(data) => (statesOptions = data)"
/> />
<FetchData
url="Workers/search"
:filter="{ fields: ['id', 'name'], order: 'name ASC' }"
auto-load
@on-fetch="(data) => (workersOptions = data)"
/>
<FormModelPopup <FormModelPopup
:title="t('Create tracking')" :title="t('Create tracking')"
url-create="Tickets/state" url-create="Tickets/state"
@ -57,7 +49,9 @@ const onStateFkChange = (formData) => (formData.userFk = user.value.id);
<VnSelect <VnSelect
:label="t('tracking.worker')" :label="t('tracking.worker')"
v-model="data.userFk" v-model="data.userFk"
:options="workersOptions" url="Workers/search"
fields=" ['id', 'name']"
sort-by="name ASC"
hide-selected hide-selected
option-label="name" option-label="name"
option-value="id" option-value="id"

View File

@ -3,7 +3,6 @@ import { onMounted, ref, computed, onUnmounted, reactive, watch } from 'vue';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import FetchData from 'components/FetchData.vue';
import VnInput from 'src/components/common/VnInput.vue'; import VnInput from 'src/components/common/VnInput.vue';
import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue'; import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue';
import TicketEditManaProxy from './TicketEditMana.vue'; import TicketEditManaProxy from './TicketEditMana.vue';
@ -35,7 +34,6 @@ const selectedExpeditions = ref([]);
const allColumnNames = ref([]); const allColumnNames = ref([]);
const visibleColumns = ref([]); const visibleColumns = ref([]);
const newTicketWithRoute = ref(false); const newTicketWithRoute = ref(false);
const itemsOptions = ref([]);
const exprBuilder = (param, value) => { const exprBuilder = (param, value) => {
switch (param) { switch (param) {
@ -139,7 +137,9 @@ const columns = computed(() => [
filterValue: null, filterValue: null,
event: getInputEvents, event: getInputEvents,
attrs: { attrs: {
options: itemsOptions.value, url: 'Items',
fields: ['id', 'name'],
'sort-by': 'name ASC',
'option-value': 'id', 'option-value': 'id',
'option-label': 'name', 'option-label': 'name',
dense: true, dense: true,
@ -274,12 +274,6 @@ onUnmounted(() => (stateStore.rightDrawer = false));
</script> </script>
<template> <template>
<FetchData
url="Items"
auto-load
:filter="{ fields: ['id', 'name'], order: 'name ASC' }"
@on-fetch="(data) => (itemsOptions = data)"
/>
<VnSubToolbar> <VnSubToolbar>
<template #st-data> <template #st-data>
<TableVisibleColumns <TableVisibleColumns

View File

@ -38,7 +38,6 @@ const ticketConfig = ref(null);
const isLocked = ref(false); const isLocked = ref(false);
const isTicketEditable = ref(false); const isTicketEditable = ref(false);
const sales = ref([]); const sales = ref([]);
const itemsWithNameOptions = ref([]);
const editableStatesOptions = ref([]); const editableStatesOptions = ref([]);
const selectedSales = ref([]); const selectedSales = ref([]);
const mana = ref(null); const mana = ref(null);
@ -435,12 +434,6 @@ onUnmounted(() => (stateStore.rightDrawer = false));
auto-load auto-load
@on-fetch="(data) => (isLocked = data)" @on-fetch="(data) => (isLocked = data)"
/> />
<FetchData
url="Items/withName"
:filter="{ fields: ['id', 'name'], order: 'id DESC' }"
auto-load
@on-fetch="(data) => (itemsWithNameOptions = data)"
/>
<FetchData <FetchData
url="States/editableStates" url="States/editableStates"
:filter="{ fields: ['code', 'name', 'id', 'alertLevel'], order: 'name ASC' }" :filter="{ fields: ['code', 'name', 'id', 'alertLevel'], order: 'name ASC' }"
@ -626,10 +619,12 @@ onUnmounted(() => (stateStore.rightDrawer = false));
</div> </div>
<VnSelect <VnSelect
v-else v-else
:options="itemsWithNameOptions"
hide-selected hide-selected
option-label="name" option-label="name"
option-value="id" option-value="id"
url="Items/withName"
:fields="['id', 'name']"
sort-by="id DESC"
@update:model-value="changeQuantity(row)" @update:model-value="changeQuantity(row)"
v-model="row.itemFk" v-model="row.itemFk"
> >

View File

@ -26,8 +26,6 @@ const saleTrackingFetchDataRef = ref(null);
const sales = ref([]); const sales = ref([]);
const saleTrackings = ref([]); const saleTrackings = ref([]);
const itemShelvignsSales = ref([]); const itemShelvignsSales = ref([]);
const shelvingsOptions = ref([]);
const parkingsOptions = ref([]);
const saleTrackingUrl = computed(() => `SaleTrackings/${route.params.id}/filter`); const saleTrackingUrl = computed(() => `SaleTrackings/${route.params.id}/filter`);
const oldQuantity = ref(null); const oldQuantity = ref(null);
@ -330,12 +328,6 @@ const qCheckBoxController = (sale, action) => {
auto-load auto-load
@on-fetch="(data) => (sales = data)" @on-fetch="(data) => (sales = data)"
/> />
<FetchData
url="Shelvings"
auto-load
@on-fetch="(data) => (shelvingsOptions = data)"
/>
<FetchData url="Parkings" auto-load @on-fetch="(data) => (parkingsOptions = data)" />
<QTable <QTable
:rows="sales" :rows="sales"
:columns="columns" :columns="columns"
@ -500,7 +492,7 @@ const qCheckBoxController = (sale, action) => {
<template #body-cell-shelving="{ row }"> <template #body-cell-shelving="{ row }">
<QTd auto-width> <QTd auto-width>
<VnSelect <VnSelect
:options="shelvingsOptions" url="Shelvings"
hide-selected hide-selected
option-label="code" option-label="code"
option-value="code" option-value="code"
@ -513,7 +505,7 @@ const qCheckBoxController = (sale, action) => {
<template #body-cell-parking="{ row }"> <template #body-cell-parking="{ row }">
<QTd auto-width> <QTd auto-width>
<VnSelect <VnSelect
:options="parkingsOptions" url="Parkings"
hide-selected hide-selected
option-label="code" option-label="code"
option-value="id" option-value="id"

View File

@ -20,7 +20,6 @@ const props = defineProps({
const warehousesOptions = ref([]); const warehousesOptions = ref([]);
const continentsOptions = ref([]); const continentsOptions = ref([]);
const agenciesOptions = ref([]); const agenciesOptions = ref([]);
const suppliersOptions = ref([]);
const warehousesByContinent = ref({}); const warehousesByContinent = ref({});
const add = (paramsObj, key) => { const add = (paramsObj, key) => {
@ -76,12 +75,6 @@ warehouses();
@on-fetch="(data) => (agenciesOptions = data)" @on-fetch="(data) => (agenciesOptions = data)"
auto-load auto-load
/> />
<FetchData
url="Suppliers"
@on-fetch="(data) => (suppliersOptions = data)"
auto-load
/>
<VnFilterPanel :data-key="props.dataKey" :search-button="true"> <VnFilterPanel :data-key="props.dataKey" :search-button="true">
<template #tags="{ tag, formatFn }"> <template #tags="{ tag, formatFn }">
<div class="q-gutter-x-xs"> <div class="q-gutter-x-xs">
@ -220,7 +213,7 @@ warehouses();
<VnSelect <VnSelect
:label="t('globals.pageTitles.supplier')" :label="t('globals.pageTitles.supplier')"
v-model="params.cargoSupplierFk" v-model="params.cargoSupplierFk"
:options="suppliersOptions" url="Suppliers"
option-value="id" option-value="id"
option-label="name" option-label="name"
hide-selected hide-selected