From b82453582a9e25f25d65ffe27ee1ae3a2af62de1 Mon Sep 17 00:00:00 2001 From: carlossa Date: Thu, 17 Oct 2024 07:44:31 +0200 Subject: [PATCH 1/7] fix: refs #7304 7304 clean warning --- src/components/ui/VnAvatar.vue | 2 +- src/pages/Customer/Card/CustomerBasicData.vue | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/ui/VnAvatar.vue b/src/components/ui/VnAvatar.vue index 1deb105db..2423f8ba7 100644 --- a/src/components/ui/VnAvatar.vue +++ b/src/components/ui/VnAvatar.vue @@ -6,7 +6,7 @@ import { useColor } from 'src/composables/useColor'; import { getCssVar } from 'quasar'; const $props = defineProps({ - workerId: { type: Number, required: true }, + workerId: { type: Number, default: null }, description: { type: String, default: null }, title: { type: String, default: null }, color: { type: String, default: null }, diff --git a/src/pages/Customer/Card/CustomerBasicData.vue b/src/pages/Customer/Card/CustomerBasicData.vue index d31669b43..3743a4b76 100644 --- a/src/pages/Customer/Card/CustomerBasicData.vue +++ b/src/pages/Customer/Card/CustomerBasicData.vue @@ -155,7 +155,6 @@ const exprBuilder = (param, value) => { url="Clients" :input-debounce="0" :label="t('customer.basicData.previousClient')" - :options="clients" :rules="validate('client.transferorFk')" emit-value map-options From 2be55ca81c5ab4514a7657dfaa94a8d8c95c79f9 Mon Sep 17 00:00:00 2001 From: carlossa Date: Tue, 19 Nov 2024 08:01:00 +0100 Subject: [PATCH 2/7] fix: refs #7304 fix list --- src/pages/Customer/CustomerList.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/Customer/CustomerList.vue b/src/pages/Customer/CustomerList.vue index 3cb17332c..865287aeb 100644 --- a/src/pages/Customer/CustomerList.vue +++ b/src/pages/Customer/CustomerList.vue @@ -12,6 +12,7 @@ import RightMenu from 'src/components/common/RightMenu.vue'; import VnLinkPhone from 'src/components/ui/VnLinkPhone.vue'; import { toDate } from 'src/filters'; import CustomerFilter from './CustomerFilter.vue'; +import VnAvatar from 'src/components/ui/VnAvatar.vue'; const { t } = useI18n(); const router = useRouter(); From b9ba67c5a652495aee05d6f8172cfe9fa9fa7d94 Mon Sep 17 00:00:00 2001 From: carlossa Date: Tue, 19 Nov 2024 11:39:35 +0100 Subject: [PATCH 3/7] fix: refs #7304 fix warning --- src/components/ui/VnAvatar.vue | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/ui/VnAvatar.vue b/src/components/ui/VnAvatar.vue index 2423f8ba7..0fe943ee2 100644 --- a/src/components/ui/VnAvatar.vue +++ b/src/components/ui/VnAvatar.vue @@ -6,7 +6,7 @@ import { useColor } from 'src/composables/useColor'; import { getCssVar } from 'quasar'; const $props = defineProps({ - workerId: { type: Number, default: null }, + workerId: { type: [Number, undefined], default: null }, description: { type: String, default: null }, title: { type: String, default: null }, color: { type: String, default: null }, @@ -38,7 +38,13 @@ watch(src, () => (showLetter.value = false)); - + +
From b83c6407604681f7324cd65fda3f2661f7890b57 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Fri, 29 Nov 2024 07:32:31 +0100 Subject: [PATCH 4/7] feat: improve Merge branch 'test' into dev --- src/components/CreateNewPostcodeForm.vue | 76 ++++++++++++++++-------- 1 file changed, 52 insertions(+), 24 deletions(-) diff --git a/src/components/CreateNewPostcodeForm.vue b/src/components/CreateNewPostcodeForm.vue index 232f86a49..d082df9e5 100644 --- a/src/components/CreateNewPostcodeForm.vue +++ b/src/components/CreateNewPostcodeForm.vue @@ -22,13 +22,12 @@ const postcodeFormData = reactive({ townFk: null, }); -const townsFetchDataRef = ref(false); const countriesRef = ref(false); const townsRef = ref(false); const provincesFetchDataRef = ref(false); const provincesOptions = ref([]); +const townsOptions = ref([]); const town = ref({}); -const townFilter = ref({}); const countryFilter = ref({}); function onDataSaved(formData) { @@ -50,13 +49,13 @@ function onDataSaved(formData) { async function onCityCreated(newTown, formData) { await provincesFetchDataRef.value.fetch(); - newTown.province = provincesOptions.value.find( - (province) => province.id === newTown.provinceFk - ); + newTown.province = findProvince(newTown.provinceFk); formData.townFk = newTown; setTown(newTown, formData); } - +function findProvince(provinceId) { + return provincesOptions.value.find(({ id }) => id === provinceId); +} function setTown(newTown, data) { town.value = newTown; data.provinceFk = newTown?.provinceFk ?? newTown; @@ -71,12 +70,22 @@ async function setCountry(countryFk, data) { async function handleProvinces(data) { provincesOptions.value = data; + // handleTowns(data); +} +async function handleTowns(data) { + townsOptions.value = data; + // whereTowns.value.provinceFk.inq = mapData(data); + // townsRef.value.opts = []; } async function setProvince(id, data) { - const newProvince = provincesOptions.value.find((province) => province.id == id); - if (!newProvince) return; - + const newProvince = findProvince(id); + if (!newProvince) { + data.townFk = null; + return; + } + whereTowns.value.provinceFk.inq = [id]; + // handleTowns([newProvince]); data.countryFk = newProvince.countryFk; } @@ -87,13 +96,26 @@ async function onProvinceCreated(data) { postcodeFormData.provinceFk = data.id; } -const whereTowns = computed(() => { - return { - provinceFk: { - inq: provincesOptions.value.map(({ id }) => id), - }, - }; -}); +const whereTowns = ref({}); +// const whereTowns = ref(() => { +// if (!postcodeFormData.provinceFk) return { provinceFk: { inq: null } }; +// if (postcodeFormData.provinceFk) +// return { +// provinceFk: { +// inq: [postcodeFormData.provinceFk], //provincesOptions.value.map(({ id }) => id), +// }, +// }; + +// return { +// provinceFk: { +// inq: mapData(provincesOptions.value), +// }, +// }; +// }); +function mapData(data) { + if (data.length === 0) return data; + return data.map(({ id }) => id); +}