From 3a21f6aadb5d3aa50fdff0d85d1c2e81532f5f87 Mon Sep 17 00:00:00 2001 From: Jon Date: Fri, 4 Oct 2024 14:22:00 +0200 Subject: [PATCH] fix: order catalog --- src/pages/Order/Card/OrderCatalog.vue | 1 + .../Order/Card/OrderCatalogItemDialog.vue | 21 +++++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/pages/Order/Card/OrderCatalog.vue b/src/pages/Order/Card/OrderCatalog.vue index 68bf9511f..b13e8661d 100644 --- a/src/pages/Order/Card/OrderCatalog.vue +++ b/src/pages/Order/Card/OrderCatalog.vue @@ -130,4 +130,5 @@ function extractValueTags(items) { es: You can search items by name or id: Puedes buscar items por nombre o id + Search items: Buscar items diff --git a/src/pages/Order/Card/OrderCatalogItemDialog.vue b/src/pages/Order/Card/OrderCatalogItemDialog.vue index 46a50c021..09a25fcb8 100644 --- a/src/pages/Order/Card/OrderCatalogItemDialog.vue +++ b/src/pages/Order/Card/OrderCatalogItemDialog.vue @@ -20,8 +20,10 @@ const props = defineProps({ const fields = ref((props.prices || []).map((item) => ({ ...item, quantity: 0 }))); const descriptorData = useArrayData('orderData'); - +const isLoading = ref(false); const addToOrder = async () => { + if (isLoading.value) return; + isLoading.value = true; const items = (fields.value || []).filter((item) => Number(item.quantity) > 0); await axios.post('/OrderRows/addToOrder', { items, @@ -30,6 +32,10 @@ const addToOrder = async () => { notify(t('globals.dataSaved'), 'positive'); emit('added'); descriptorData.fetch({}); + isLoading.value = false; +}; +const canAddToOrder = () => { + return (fields.value || []).some((item) => Number(item.quantity) > 0); }; @@ -68,7 +74,11 @@ const addToOrder = async () => {
- + {{ t('globals.add') }}
@@ -81,3 +91,10 @@ const addToOrder = async () => { width: 200px; } + + +es: + noAmount: La cantidad no puede ser 0 +en: + noAmount: Amount can not be 0 +