From cf193b07c58649168bf8f4aeae619768b90ace5b Mon Sep 17 00:00:00 2001 From: wbuezas Date: Fri, 26 Apr 2024 08:02:17 -0300 Subject: [PATCH 1/4] 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 4be559bbe8ce672f2348b86407a2ba32624404f7 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Mon, 29 Apr 2024 15:16:37 +0200 Subject: [PATCH 2/4] fix: hansChanges to false --- src/components/CrudModel.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/CrudModel.vue b/src/components/CrudModel.vue index 24d848f3b..de4724e55 100644 --- a/src/components/CrudModel.vue +++ b/src/components/CrudModel.vue @@ -131,6 +131,7 @@ async function saveChanges(data) { if ($props.saveFn) { $props.saveFn(data, getChanges); isLoading.value = false; + hasChanges.value = false; return; } const changes = data || getChanges(); From f46b78131c07489886b8a89bf95bbbe35770755c Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Thu, 2 May 2024 10:24:07 +0200 Subject: [PATCH 3/4] perf: remove onMounted and reload --- src/pages/Customer/Card/CustomerContacts.vue | 7 ++----- src/pages/Entry/Card/EntryNotes.vue | 7 ++----- src/pages/Item/Card/ItemBarcode.vue | 7 ++----- src/pages/Item/Card/ItemTax.vue | 7 ++----- src/pages/Route/Roadmap/RoadmapStops.vue | 14 +++++++------- src/pages/Supplier/Card/SupplierAccounts.vue | 7 ++----- src/pages/Supplier/Card/SupplierAgencyTerm.vue | 7 ++----- src/pages/Supplier/Card/SupplierContacts.vue | 7 ++----- 8 files changed, 21 insertions(+), 42 deletions(-) diff --git a/src/pages/Customer/Card/CustomerContacts.vue b/src/pages/Customer/Card/CustomerContacts.vue index 6fb891dff..cd4d553df 100644 --- a/src/pages/Customer/Card/CustomerContacts.vue +++ b/src/pages/Customer/Card/CustomerContacts.vue @@ -1,5 +1,5 @@