From 3a192c0d77a3942206da8b15b6b8e341c7d46876 Mon Sep 17 00:00:00 2001 From: puriphatt Date: Thu, 17 Oct 2024 14:51:42 +0700 Subject: [PATCH] fix: paysplit assign & info display --- src/pages/05_quotation/QuotationForm.vue | 8 +++++++- src/pages/05_quotation/QuotationFormInfo.vue | 7 +++++-- src/pages/05_quotation/form.ts | 5 +++++ 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/pages/05_quotation/QuotationForm.vue b/src/pages/05_quotation/QuotationForm.vue index b289c2b6..8a308a3c 100644 --- a/src/pages/05_quotation/QuotationForm.vue +++ b/src/pages/05_quotation/QuotationForm.vue @@ -275,6 +275,12 @@ async function convertDataToFormSubmit() { ), ); + quotationFormData.value.paySplit = JSON.parse( + JSON.stringify( + quotationFormData.value.paySplit.map((p) => ({ ...p, no: undefined })), + ), + ); + quotationFormData.value = { id: quotationFormData.value.id, productServiceList: quotationFormData.value.productServiceList, @@ -828,6 +834,7 @@ async function searchEmployee(text: string) { :class="{ 'full-height': $q.screen.gt.xs }" > - {{ `${$t('quotation.periodNo')} ${period.no}` }} + {{ `${$t('quotation.periodNo')} ${i + 1}` }} { })), dueDate: new Date(data.dueDate), payBillDate: data.payBillDate ? new Date(data.payBillDate) : undefined, + paySplit: data.paySplit.map((p, index) => ({ + no: index + 1, + date: p.date, + amount: p.amount, + })), worker: data.worker.map((v) => Object.assign(v.employee, { dateOfBirth: new Date(v.employee.dateOfBirth),