From 317aadb0f78063e71a3d88899f6660fdc95201d3 Mon Sep 17 00:00:00 2001 From: puriphatt Date: Thu, 31 Oct 2024 13:05:10 +0700 Subject: [PATCH] fix: quotation custom split --- src/components/05_quotation/ProductItem.vue | 29 +++++++++++++++++++- src/pages/05_quotation/QuotationForm.vue | 6 ++++ src/pages/05_quotation/QuotationFormInfo.vue | 29 +++++++++++--------- 3 files changed, 50 insertions(+), 14 deletions(-) diff --git a/src/components/05_quotation/ProductItem.vue b/src/components/05_quotation/ProductItem.vue index 3ca36321..aa48269a 100644 --- a/src/components/05_quotation/ProductItem.vue +++ b/src/components/05_quotation/ProductItem.vue @@ -13,6 +13,7 @@ import { useConfigStore } from 'stores/config'; const props = defineProps<{ readonly?: boolean; agentPrice: boolean; + installmentInput?: boolean; employeeRows?: { foreignRefNo: string; employeeName: string; @@ -228,7 +229,20 @@ watch( flat bordered hide-pagination - :columns="columns" + :columns=" + installmentInput + ? [ + ...columns.slice(0, 1), + { + name: 'periodNo', + align: 'left', + label: 'quotation.periodNo', + field: (v) => v.product.code, + }, + ...columns.slice(1), + ] + : columns + " :rows="item.product" class="full-width" :no-data-label="$t('general.noDataTable')" @@ -248,6 +262,19 @@ watch(
[ value: 'Split', label: t('quotation.type.installmentsCash'), }, + { + value: 'SplitCustom', + label: t('quotation.type.installmentsCustomCash'), + }, ]); const amount4Show = ref([]); @@ -160,12 +165,8 @@ function calculateInstallments(param: { watch( () => payType.value, (v) => { - if (!payType.value) return; - if (v === 'Split' || v === 'BillSplit') { - if (paySplitCount.value === 0) paySplitCount.value = 1; - } else { - paySplitCount.value = 0; - paySplit.value = []; + if (v === 'Split' && props.paySplitFixed) { + paySplitCount.value = props.paySplitFixed; } }, ); @@ -177,8 +178,9 @@ watch( paySplitCount.value === 0 || !paySplitCount.value || !summaryPrice.value.finalPrice - ) + ) { return; + } calculateInstallments({ newCount: newCount || 0, oldCount: oldCount || 0 }); }, { deep: true }, @@ -218,7 +220,7 @@ watch(
@@ -239,7 +241,7 @@ watch(