From e2bd6a63347157eb587da7a159f7c7e8b349f60f Mon Sep 17 00:00:00 2001 From: puriphatt Date: Mon, 3 Feb 2025 10:14:51 +0700 Subject: [PATCH] refactor: 05 => add disabledSubmit prop to DialogForm and improve handling in QuotationForm --- src/components/DialogForm.vue | 2 ++ src/pages/05_quotation/QuotationForm.vue | 1 + src/pages/05_quotation/QuotationFormProductSelect.vue | 1 + 3 files changed, 4 insertions(+) diff --git a/src/components/DialogForm.vue b/src/components/DialogForm.vue index 965ef265..84319bcf 100644 --- a/src/components/DialogForm.vue +++ b/src/components/DialogForm.vue @@ -23,6 +23,7 @@ defineProps<{ hideDelete?: boolean; hideBtn?: boolean; readonly?: boolean; + disabledSubmit?: boolean; saveAmount?: number; submitLabel?: string; @@ -235,6 +236,7 @@ const currentTab = defineModel('currentTab'); id="btn-form-submit" type="submit" solid + :disabled="disabledSubmit" :icon="submitIcon" :label="submitLabel" :amount="saveAmount" diff --git a/src/pages/05_quotation/QuotationForm.vue b/src/pages/05_quotation/QuotationForm.vue index 23a6221d..592deee0 100644 --- a/src/pages/05_quotation/QuotationForm.vue +++ b/src/pages/05_quotation/QuotationForm.vue @@ -823,6 +823,7 @@ function convertToTable(nodes: Node[]) { return []; }; const list = nodes.flatMap(_recursive).map((v) => v.value); + if (list.length === 0) return; quotationFormData.value.paySplitCount = Math.max( ...list.map((v) => v.installmentNo || 0), diff --git a/src/pages/05_quotation/QuotationFormProductSelect.vue b/src/pages/05_quotation/QuotationFormProductSelect.vue index 066f2acf..dc7868bb 100644 --- a/src/pages/05_quotation/QuotationFormProductSelect.vue +++ b/src/pages/05_quotation/QuotationFormProductSelect.vue @@ -428,6 +428,7 @@ watch(