From f60670cb87958d2c9012ad156a8ae40e45eb526a Mon Sep 17 00:00:00 2001 From: carlossa Date: Mon, 8 Apr 2024 10:49:53 +0200 Subject: [PATCH 01/62] refs #7172 change vnselectfilter --- src/pages/Claim/Card/ClaimBasicData.vue | 36 ++++++++++++++++++------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/src/pages/Claim/Card/ClaimBasicData.vue b/src/pages/Claim/Card/ClaimBasicData.vue index c7c5ab8a2..aad003031 100644 --- a/src/pages/Claim/Card/ClaimBasicData.vue +++ b/src/pages/Claim/Card/ClaimBasicData.vue @@ -2,7 +2,7 @@ import { ref } from 'vue'; import { useRoute } from 'vue-router'; import { useI18n } from 'vue-i18n'; - +import VnSelectFilter from 'src/components/common/VnSelectFilter.vue'; import FetchData from 'components/FetchData.vue'; import FormModel from 'components/FormModel.vue'; import VnRow from 'components/ui/VnRow.vue'; @@ -40,11 +40,7 @@ const workers = ref([]); const workersCopy = ref([]); const claimStates = ref([]); const claimStatesCopy = ref([]); - -function setWorkers(data) { - workers.value = data; - workersCopy.value = data; -} +const workersOptions = ref([]); function setClaimStates(data) { claimStates.value = data; @@ -89,8 +85,9 @@ const statesFilter = {
- - + --> + + +
Date: Wed, 10 Apr 2024 14:16:20 +0200 Subject: [PATCH 02/62] refs #7172 fix vnSelectFilter --- src/pages/Claim/Card/ClaimBasicData.vue | 47 +------------------------ 1 file changed, 1 insertion(+), 46 deletions(-) diff --git a/src/pages/Claim/Card/ClaimBasicData.vue b/src/pages/Claim/Card/ClaimBasicData.vue index aad003031..26175dab9 100644 --- a/src/pages/Claim/Card/ClaimBasicData.vue +++ b/src/pages/Claim/Card/ClaimBasicData.vue @@ -36,8 +36,6 @@ const claimFilter = { ], }; -const workers = ref([]); -const workersCopy = ref([]); const claimStates = ref([]); const claimStatesCopy = ref([]); const workersOptions = ref([]); @@ -47,25 +45,6 @@ function setClaimStates(data) { claimStatesCopy.value = data; } -const workerFilter = { - options: workers, - filterFn: (options, value) => { - const search = value.toLowerCase(); - - if (value === '') return workersCopy.value; - - return options.value.filter((row) => { - const id = row.id; - const name = row.name.toLowerCase(); - - const idMatches = id == search; - const nameMatches = name.indexOf(search) > -1; - - return idMatches || nameMatches; - }); - }, -}; - const statesFilter = { options: claimStates, filterFn: (options, value) => { @@ -87,7 +66,6 @@ const statesFilter = { :filter="{ where: { role: 'salesPerson' } }" @on-fetch="(data) => (workersOptions = data)" auto-load - limit="30" />
- + + From ccc68851728ab8cea17699c581ff7442924419c9 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Thu, 25 Apr 2024 04:41:44 +0000 Subject: [PATCH 15/62] Fix: minor bugs, layout & vnlocation --- .../components/CustomerAddressEdit.vue | 65 ++++++++++--------- 1 file changed, 34 insertions(+), 31 deletions(-) diff --git a/src/pages/Customer/components/CustomerAddressEdit.vue b/src/pages/Customer/components/CustomerAddressEdit.vue index 8f4be1342..c3c5c82ae 100644 --- a/src/pages/Customer/components/CustomerAddressEdit.vue +++ b/src/pages/Customer/components/CustomerAddressEdit.vue @@ -169,21 +169,9 @@ function handleLocation(data, location) {
-
- -
-
- -
-
- -
-
- -
-
- - -
- -
+ +
+ +
+
+ +
+
+ + +
+ +
+
+ +
+
+ +
+
+

{{ t('Notes') }}

Date: Thu, 25 Apr 2024 14:44:32 +0200 Subject: [PATCH 16/62] fix: CustomerAdress layout --- .../components/CustomerAddressEdit.vue | 68 +++++++++---------- 1 file changed, 33 insertions(+), 35 deletions(-) diff --git a/src/pages/Customer/components/CustomerAddressEdit.vue b/src/pages/Customer/components/CustomerAddressEdit.vue index c3c5c82ae..dd2717694 100644 --- a/src/pages/Customer/components/CustomerAddressEdit.vue +++ b/src/pages/Customer/components/CustomerAddressEdit.vue @@ -169,6 +169,21 @@ function handleLocation(data, location) {
+
+ +
+
+ + +
+ +
@@ -183,6 +198,24 @@ function handleLocation(data, location) { v-model="data.agencyModeFk" />
+
+ +
+
+ +
+
+ +
+ +
- - -
- -
-
- -
-
- - -
- -
-
- -
-
- -
-
-

{{ t('Notes') }}

Date: Fri, 26 Apr 2024 07:49:28 +0200 Subject: [PATCH 17/62] refactor: refs #7239 changed spanish translations --- src/components/common/VnSmsDialog.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/common/VnSmsDialog.vue b/src/components/common/VnSmsDialog.vue index 4306beb4c..833f54942 100644 --- a/src/components/common/VnSmsDialog.vue +++ b/src/components/common/VnSmsDialog.vue @@ -199,8 +199,9 @@ es: templates: pendingPayment: 'Su pedido está pendiente de pago. Por favor, entre en la página web y efectue el pago con tarjeta. Muchas gracias.' - minAmount: 'Es necesario un importe mínimo de 50€ (Sin IVA) en su pedido - { orderId } con llegada { landing } para recibirlo sin portes adicionales.' + minAmount: 'Te recordamos que tu pedido {orderId} es inferior a 50€. + Te recomendamos amplíes para no generar costes extra provocarán un incremento de tu tarifa. + ¡Un saludo!' orderChanges: 'Pedido {orderId} con llegada estimada día { landing }: { changes }' en: Inglés es: Español From c56b6b2dbc5a2b6983cab7461836de2bd530d8cd Mon Sep 17 00:00:00 2001 From: Jon Date: Fri, 26 Apr 2024 08:22:08 +0200 Subject: [PATCH 18/62] refactor: better syntax --- src/components/common/VnSmsDialog.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/common/VnSmsDialog.vue b/src/components/common/VnSmsDialog.vue index 833f54942..5b192f95d 100644 --- a/src/components/common/VnSmsDialog.vue +++ b/src/components/common/VnSmsDialog.vue @@ -200,7 +200,7 @@ es: pendingPayment: 'Su pedido está pendiente de pago. Por favor, entre en la página web y efectue el pago con tarjeta. Muchas gracias.' minAmount: 'Te recordamos que tu pedido {orderId} es inferior a 50€. - Te recomendamos amplíes para no generar costes extra provocarán un incremento de tu tarifa. + Te recomendamos amplíes para no generar costes extra, provocarán un incremento de tu tarifa. ¡Un saludo!' orderChanges: 'Pedido {orderId} con llegada estimada día { landing }: { changes }' en: Inglés From cf193b07c58649168bf8f4aeae619768b90ace5b Mon Sep 17 00:00:00 2001 From: wbuezas Date: Fri, 26 Apr 2024 08:02:17 -0300 Subject: [PATCH 19/62] Item tax --- src/components/CrudModel.vue | 8 ++- src/i18n/locale/en.yml | 3 + src/pages/Item/Card/ItemTax.vue | 103 +++++++++++++++++++++++++++++++- 3 files changed, 111 insertions(+), 3 deletions(-) diff --git a/src/components/CrudModel.vue b/src/components/CrudModel.vue index fb3ac10c3..24d848f3b 100644 --- a/src/components/CrudModel.vue +++ b/src/components/CrudModel.vue @@ -124,11 +124,15 @@ async function onSubmit() { }); } isLoading.value = true; - await saveChanges(); + await saveChanges($props.saveFn ? formData.value : null); } async function saveChanges(data) { - if ($props.saveFn) return $props.saveFn(data, getChanges); + if ($props.saveFn) { + $props.saveFn(data, getChanges); + isLoading.value = false; + return; + } const changes = data || getChanges(); try { await axios.post($props.saveUrl || $props.url + '/crud', changes); diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index 04c278abe..d3b18dfe2 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -1123,6 +1123,9 @@ item: fixedPrice: Fixed prices wasteBreakdown: Waste breakdown itemCreate: New item + botanical: Botanical + barcode: Barcodes + tax: Tax descriptor: item: Item buyer: Buyer diff --git a/src/pages/Item/Card/ItemTax.vue b/src/pages/Item/Card/ItemTax.vue index 76663932c..b966eede9 100644 --- a/src/pages/Item/Card/ItemTax.vue +++ b/src/pages/Item/Card/ItemTax.vue @@ -1 +1,102 @@ - + + + + +es: + Country: País + Class: Clase + From 88e1e577c4f7970a80fee568142539b839b918a6 Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 26 Apr 2024 13:10:29 +0200 Subject: [PATCH 20/62] hotFix: refs #6636 fix ref optionsList --- src/pages/Claim/Card/ClaimBasicData.vue | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/pages/Claim/Card/ClaimBasicData.vue b/src/pages/Claim/Card/ClaimBasicData.vue index 56717c628..47d1ac1c6 100644 --- a/src/pages/Claim/Card/ClaimBasicData.vue +++ b/src/pages/Claim/Card/ClaimBasicData.vue @@ -41,6 +41,7 @@ const workers = ref([]); const workersCopy = ref([]); const claimStates = ref([]); const claimStatesCopy = ref([]); +const optionsList = ref([]); function setWorkers(data) { workers.value = data; @@ -51,9 +52,9 @@ function setClaimStates(data) { claimStates.value = data; claimStatesCopy.value = data; } -let optionsList; + async function getEnumValues() { - optionsList = [{ id: null, description: t('claim.basicData.null') }]; + optionsList.value = [{ id: null, description: t('claim.basicData.null') }]; const { data } = await axios.get(`Applications/get-enum-values`, { params: { schema: 'vn', @@ -62,8 +63,9 @@ async function getEnumValues() { }, }); for (let value of data) - optionsList.push({ id: value, description: t(`claim.basicData.${value}`) }); + optionsList.value.push({ id: value, description: t(`claim.basicData.${value}`) }); } + getEnumValues(); const workerFilter = { From 127567898da40f416db6d3fcc3da7231dba59a3d Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Fri, 26 Apr 2024 13:27:58 +0200 Subject: [PATCH 21/62] fix: add filter panel --- src/pages/Item/ItemTypeList.vue | 22 +++++++++++- src/pages/ItemType/ItemTypeFilter.vue | 49 +++++++++++++++++++++++++++ 2 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 src/pages/ItemType/ItemTypeFilter.vue diff --git a/src/pages/Item/ItemTypeList.vue b/src/pages/Item/ItemTypeList.vue index b0b4de540..5b106916d 100644 --- a/src/pages/Item/ItemTypeList.vue +++ b/src/pages/Item/ItemTypeList.vue @@ -6,6 +6,7 @@ import VnPaginate from 'src/components/ui/VnPaginate.vue'; import VnLv from 'src/components/ui/VnLv.vue'; import CardList from 'src/components/ui/CardList.vue'; import ItemTypeSummary from 'src/pages/ItemType/Card/ItemTypeSummary.vue'; +import ItemTypeFilter from 'src/pages/ItemType/ItemTypeFilter.vue'; import VnSearchbar from 'src/components/ui/VnSearchbar.vue'; import { useStateStore } from 'stores/useStateStore'; @@ -31,12 +32,31 @@ const redirectToCreateView = () => { + +
+ + + {{ t('globals.collapseMenu') }} + + +
+
+ + + + +
+import { useI18n } from 'vue-i18n'; +import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue'; +import VnInput from 'src/components/common/VnInput.vue'; +const { t } = useI18n(); + +const props = defineProps({ + dataKey: { + type: String, + required: true, + }, +}); + + + + + +en: + params: + name: Name + code: Code +es: + params: + name: Nombre + code: Código + Name: Nombre + Code: Código + From 76cd79173cabe0996c03a982b8773c5bd8df107e Mon Sep 17 00:00:00 2001 From: carlossa Date: Fri, 26 Apr 2024 13:50:11 +0200 Subject: [PATCH 22/62] refs #7172 fix select --- src/pages/Claim/Card/ClaimBasicData.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/Claim/Card/ClaimBasicData.vue b/src/pages/Claim/Card/ClaimBasicData.vue index f6feae4ba..adb9b4c08 100644 --- a/src/pages/Claim/Card/ClaimBasicData.vue +++ b/src/pages/Claim/Card/ClaimBasicData.vue @@ -2,7 +2,7 @@ import { ref } from 'vue'; import { useRoute } from 'vue-router'; import { useI18n } from 'vue-i18n'; -import VnSelectFilter from 'src/components/common/VnSelectFilter.vue'; +import VnSelect from 'src/components/common/VnSelect.vue'; import FetchData from 'components/FetchData.vue'; import FormModel from 'components/FormModel.vue'; import VnRow from 'components/ui/VnRow.vue'; @@ -108,7 +108,7 @@ const statesFilter = {
- - +
Date: Fri, 26 Apr 2024 14:49:54 +0200 Subject: [PATCH 23/62] fix: add exprBuilder --- src/components/ui/VnFilterPanel.vue | 3 ++- src/components/ui/VnSearchbar.vue | 2 ++ src/pages/Item/ItemTypeList.vue | 17 +++++++++++++++-- src/pages/ItemType/ItemTypeFilter.vue | 8 +++++++- 4 files changed, 26 insertions(+), 4 deletions(-) diff --git a/src/components/ui/VnFilterPanel.vue b/src/components/ui/VnFilterPanel.vue index 96d097191..cde48e9b3 100644 --- a/src/components/ui/VnFilterPanel.vue +++ b/src/components/ui/VnFilterPanel.vue @@ -145,7 +145,8 @@ const customTags = computed(() => ); async function remove(key) { - userParams.value[key] = null; + // userParams.value[key] = null; + if (userParams.value[key]) delete userParams.value[key]; await search(); emit('remove', key); } diff --git a/src/components/ui/VnSearchbar.vue b/src/components/ui/VnSearchbar.vue index fc8475ace..da8d43c95 100644 --- a/src/components/ui/VnSearchbar.vue +++ b/src/components/ui/VnSearchbar.vue @@ -81,8 +81,10 @@ async function search() { const staticParams = Object.entries(store.userParams).filter( ([key, value]) => value && (props.staticParams || []).includes(key) ); + // const filter =props?.where? { where: JSON.parse(props.where) }: {} await arrayData.applyFilter({ params: { + // filter , ...Object.fromEntries(staticParams), search: searchText.value, }, diff --git a/src/pages/Item/ItemTypeList.vue b/src/pages/Item/ItemTypeList.vue index 5b106916d..1e21c1719 100644 --- a/src/pages/Item/ItemTypeList.vue +++ b/src/pages/Item/ItemTypeList.vue @@ -24,6 +24,17 @@ const redirectToItemTypeSummary = (id) => { const redirectToCreateView = () => { router.push({ name: 'ItemTypeCreate' }); }; +const exprBuilder = (param, value) => { + switch (param) { + case 'name': + case 'code': + case 'search': + return { + name: { like: `%${value}%` }, + code: { like: `%${value}%` }, + }; + } +}; - + diff --git a/src/pages/ItemType/ItemTypeFilter.vue b/src/pages/ItemType/ItemTypeFilter.vue index 33238545f..2a86795c2 100644 --- a/src/pages/ItemType/ItemTypeFilter.vue +++ b/src/pages/ItemType/ItemTypeFilter.vue @@ -10,10 +10,16 @@ const props = defineProps({ required: true, }, }); + +const emit = defineEmits(['search']);