diff --git a/src/pages/05_quotation/QuotationForm.vue b/src/pages/05_quotation/QuotationForm.vue index b57305c7..7b089b03 100644 --- a/src/pages/05_quotation/QuotationForm.vue +++ b/src/pages/05_quotation/QuotationForm.vue @@ -136,6 +136,9 @@ const refSelectZoneEmployee = ref>(); const mrz = ref>>(); const toggleWorker = ref(true); const tempPaySplitCount = ref(0); +const tempPaySplit = ref< + { no: number; amount: number; name?: string; invoice?: boolean }[] +>([]); const currentQuotationId = ref(undefined); const date = ref(); const preSelectedWorker = ref([]); @@ -371,6 +374,10 @@ async function fetchQuotation() { const id = currentQuotationId.value || quotationFormData.value.id || ''; await quotationForm.assignFormData(id, quotationFormState.value.mode); + tempPaySplitCount.value = quotationFormData.value.paySplitCount || 0; + tempPaySplit.value = JSON.parse( + JSON.stringify(quotationFormData.value.paySplit), + ); } await assignToProductServiceList(); @@ -697,6 +704,9 @@ function convertToTable(nodes: Node[]) { }).finalPrice, })); + tempPaySplit.value = JSON.parse( + JSON.stringify(quotationFormData.value.paySplit), + ); pageState.productServiceModal = false; } @@ -960,10 +970,6 @@ function getStatus( doneIndex: number, doingIndex: number, ) { - console.log( - status, - QUOTATION_STATUS.findIndex((v) => v === status), - ); return QUOTATION_STATUS.findIndex((v) => v === status) >= doneIndex ? 'done' : QUOTATION_STATUS.findIndex((v) => v === status) >= doingIndex @@ -1402,7 +1408,8 @@ async function getWorkerFromCriteria( - + diff --git a/src/pages/05_quotation/QuotationFormInfo.vue b/src/pages/05_quotation/QuotationFormInfo.vue index 1be4d0c9..3d8553c4 100644 --- a/src/pages/05_quotation/QuotationFormInfo.vue +++ b/src/pages/05_quotation/QuotationFormInfo.vue @@ -19,7 +19,13 @@ const props = defineProps<{ readonly?: boolean; quotationNo?: string; installmentNo?: number[]; - paySplitFixed?: number; + paySplitCountFixed?: number; + paySplitFixed?: { + no: number; + amount: number; + name?: string; + invoice?: boolean; + }[]; view?: View; data?: { total: number; @@ -156,8 +162,9 @@ function calculateInstallments(param: { watch( () => payType.value, (v) => { - if (v === 'Split' && props.paySplitFixed) { - paySplitCount.value = props.paySplitFixed; + if (v === 'Split' && props.paySplitCountFixed && props.paySplitFixed) { + paySplitCount.value = props.paySplitCountFixed; + paySplit.value = JSON.parse(JSON.stringify(props.paySplitFixed)); } }, ); @@ -276,6 +283,8 @@ watch( :model-value="commaInput(period.amount.toString())" dense outlined + debounce="500" + @focus="(e) => (e.target as HTMLInputElement).select()" @update:model-value=" (v) => { if (typeof v === 'string') amount4Show[i] = commaInput(v);