From e068304923ad3b650d0e7f99c55c6f6777d681af Mon Sep 17 00:00:00 2001 From: Methapon Metanipat <162551568+Methapon-Frappet@users.noreply.github.com> Date: Fri, 1 Nov 2024 09:06:06 +0700 Subject: [PATCH] feat: receipt view (#41) * refactor: handle show form receipt * refactor: fetch receipt * fix: i18n * refactor: quotation receipt components * refactor: by data Receipt * refactor: delete btn peview * fix: wrong view condition * rfactor: send Queery quotationId * refactor: edit condition view --------- Co-authored-by: Thanaphon Frappet Co-authored-by: puriphatt --- src/i18n/eng.ts | 5 +- src/i18n/tha.ts | 3 ++ src/pages/05_quotation/PaymentForm.vue | 10 ---- src/pages/05_quotation/QuotationForm.vue | 42 ++++++++++++--- .../05_quotation/QuotationFormReceipt.vue | 52 +++++++++++++++++++ 5 files changed, 95 insertions(+), 17 deletions(-) create mode 100644 src/pages/05_quotation/QuotationFormReceipt.vue diff --git a/src/i18n/eng.ts b/src/i18n/eng.ts index bfa7529f..89ec20c8 100644 --- a/src/i18n/eng.ts +++ b/src/i18n/eng.ts @@ -736,6 +736,7 @@ export default { payAll: 'Pay All', allInstallments: 'Payment', paymentDueDate: 'Payment due date', + paymentMethod: 'Payment Method', notYetPaid: 'Unpaid', alreadyPaid: 'Paid', amountToBePaid: 'Amount to be paid', @@ -744,7 +745,9 @@ export default { PaymentWait: 'Waiting for payment', PaymentInProcess: 'Waiting for verification', PaymentRetry: 'Incomplete payment, try again', - PaymentSuccess: 'Payment completed', + PaymentSuccess: 'Payment Completed', + PaymentReceive: 'Payment Received', + receiptIssued: 'Receipt Issued', }, type: { diff --git a/src/i18n/tha.ts b/src/i18n/tha.ts index 42f8058e..e1370e7d 100644 --- a/src/i18n/tha.ts +++ b/src/i18n/tha.ts @@ -731,6 +731,7 @@ export default { payAll: 'จ่ายทั้งหมด', allInstallments: 'งวดทั้งหมด', paymentDueDate: 'วันครบกำหนดชำระเงิน วันที่', + paymentMethod: 'วิธีการชำระเงิน', notYetPaid: 'ยังไม่ได้ชำระเงิน', alreadyPaid: 'ชำระเงินแล้ว', amountToBePaid: 'ยอดเงินที่ต้องชำระ', @@ -740,6 +741,8 @@ export default { PaymentInProcess: 'ชำระเงินแล้ว รอตรวจสอบ', PaymentRetry: 'ชำระไม่ครบถ้วน ชำระใหม่', PaymentSuccess: 'ชำระเรียบร้อย', + PaymentReceive: 'รับชำระเงิน', + receiptIssued: 'ออกใบเสร็จรับเงินแล้ว', }, type: { diff --git a/src/pages/05_quotation/PaymentForm.vue b/src/pages/05_quotation/PaymentForm.vue index b273eec4..afcd0b0a 100644 --- a/src/pages/05_quotation/PaymentForm.vue +++ b/src/pages/05_quotation/PaymentForm.vue @@ -488,16 +488,6 @@ onMounted(async () => {
- - {{ $t('customerEmployee.fileType.receipt') }} - - ([]); + const refSelectZoneEmployee = ref>(); const mrz = ref>>(); const toggleWorker = ref(true); @@ -296,6 +303,7 @@ async function fetchStatus() { title: 'ใบเสร็จรับเงิน', status: getStatus(quotationFormData.value.quotationStatus, 4, 1), handler: () => { + fetchReceipt(); view.value = quotationFormData.value.payCondition === 'Full' || quotationFormData.value.payCondition === 'BillFull' @@ -330,6 +338,16 @@ async function fetchQuotation() { await fetchStatus(); } +async function fetchReceipt() { + const res = await useReceiptStore.getReceiptList({ + quotationId: quotationFormData.value.id, + }); + + if (res) { + receiptList.value = res.result; + } +} + async function closeTab() { if (quotationFormState.value.mode === 'edit') { quotationForm.resetForm(); @@ -922,7 +940,7 @@ const view = ref(View.Quotation);
@@ -1004,8 +1022,7 @@ const view = ref(View.Quotation); v-if=" view === View.Quotation || view === View.Accepted || - view === View.Invoice || - view === View.Receipt + view === View.Invoice " > (View.Quotation); />
+ (View.Quotation);
+ (View.Quotation);
- . + + diff --git a/src/pages/05_quotation/QuotationFormReceipt.vue b/src/pages/05_quotation/QuotationFormReceipt.vue new file mode 100644 index 00000000..0f32c267 --- /dev/null +++ b/src/pages/05_quotation/QuotationFormReceipt.vue @@ -0,0 +1,52 @@ + + +