fix: product count

This commit is contained in:
puriphatt 2024-10-10 18:16:48 +07:00
parent 319777bd05
commit 01fa1ebe4e

View file

@ -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'),