From 01fa1ebe4e594aa9b904222756e34757fc0e141e Mon Sep 17 00:00:00 2001 From: puriphatt Date: Thu, 10 Oct 2024 18:16:48 +0700 Subject: [PATCH] fix: product count --- src/pages/05_quotation/ProductServiceForm.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pages/05_quotation/ProductServiceForm.vue b/src/pages/05_quotation/ProductServiceForm.vue index 23524a2b..fa7022ae 100644 --- a/src/pages/05_quotation/ProductServiceForm.vue +++ b/src/pages/05_quotation/ProductServiceForm.vue @@ -185,11 +185,13 @@ function mapCard() { productServiceCard.value = data; } +const productCount = ref(0); function mapNode() { refSelectZone.value?.assignSelect( selectedItems.value, preSelectedItems.value, ); + productCount.value = 0; const node = selectedItems.value.map((v) => { if (v.type === 'service') { @@ -253,6 +255,7 @@ function mapNode() { const pricePerUnit = p.product.vatIncluded ? precisionRound(price / (1 + (config.value?.vat || 0.07))) : price; + productCount.value++; return { id: p.product.id, title: p.product.name, @@ -279,6 +282,7 @@ function mapNode() { const pricePerUnit = v.raw.vatIncluded ? precisionRound(price / (1 + (config.value?.vat || 0.07))) : price; + productCount.value++; return { id: v.id, title: v.name, @@ -302,7 +306,6 @@ function mapNode() { nodes.value = node; pageState.addModal = false; } - watch( () => selectedNode.value, (v) => { @@ -492,7 +495,7 @@ watch( class="q-py-sm q-px-lg" style="background: hsla(var(--info-bg) / 0.1)" > - 0 + {{ productCount }} {{ $t('general.list', { msg: $t('productService.title'),