From 850782a44de95c52f20d21f1414916fa72705898 Mon Sep 17 00:00:00 2001 From: Thanaphon Frappet Date: Thu, 7 Nov 2024 15:12:06 +0700 Subject: [PATCH] refactor: handle title i18n --- .../05_quotation/TableQuotation.vue | 33 +++++++++++++++++++ src/pages/05_quotation/QuotationForm.vue | 24 +++++++++----- 2 files changed, 48 insertions(+), 9 deletions(-) create mode 100644 src/components/05_quotation/TableQuotation.vue diff --git a/src/components/05_quotation/TableQuotation.vue b/src/components/05_quotation/TableQuotation.vue new file mode 100644 index 00000000..4cf6602d --- /dev/null +++ b/src/components/05_quotation/TableQuotation.vue @@ -0,0 +1,33 @@ + + + + + diff --git a/src/pages/05_quotation/QuotationForm.vue b/src/pages/05_quotation/QuotationForm.vue index 6daf4b1a..14cfb13b 100644 --- a/src/pages/05_quotation/QuotationForm.vue +++ b/src/pages/05_quotation/QuotationForm.vue @@ -288,19 +288,19 @@ const productService = computed(() => { async function fetchStatus() { statusQuotationForm.value = [ { - title: 'ใบเสนอราคา', + title: 'Issued', status: getStatus(quotationFormData.value.quotationStatus, 0, -1), active: () => view.value === View.Quotation, handler: () => (view.value = View.Quotation), }, { - title: 'ลูกค้าตอบรับ', + title: 'Accepted', status: getStatus(quotationFormData.value.quotationStatus, 1, 0), active: () => view.value === View.Accepted, handler: () => (view.value = View.Accepted), }, { - title: 'ใบแจ้งหนี้', + title: 'Invoice', status: quotationFormData.value.payCondition === 'Full' ? getStatus(quotationFormData.value.quotationStatus, 3, 1) @@ -316,7 +316,7 @@ async function fetchStatus() { }, }, { - title: 'ชำระเงิน', + title: 'PaymentInProcess', status: getStatus(quotationFormData.value.quotationStatus, 4, 1), active: () => view.value === View.Payment || view.value === View.PaymentPre, @@ -329,7 +329,7 @@ async function fetchStatus() { }, }, { - title: 'ใบเสร็จรับเงิน', + title: 'Receipt', status: getStatus(quotationFormData.value.quotationStatus, 4, 1), active: () => view.value === View.Receipt, handler: () => { @@ -338,7 +338,7 @@ async function fetchStatus() { }, }, { - title: 'เสร็จสิ้น', + title: 'ProcessComplete', status: getStatus(quotationFormData.value.quotationStatus, 5, 4), active: () => view.value === View.Complete, handler: () => { @@ -1050,8 +1050,12 @@ const view = ref(View.Quotation); - - {{ $t('quotation.title') }} + + {{ + $t( + `quotation.status.${view === View.InvoicePre || view === View.Invoice ? 'Invoice' : view === View.Payment ? 'PaymentInProcess' : view === View.Receipt ? 'Receipt' : 'Issued'}`, + ) + }} {{ $t('quotation.processOn', { @@ -1148,7 +1152,9 @@ const view = ref(View.Quotation); :name="`${value.status === 'done' ? 'mdi-check-circle' : 'mdi-checkbox-blank-circle-outline'}`" /> -
{{ value.title }}
+
+ {{ $t(`quotation.status.${value.title}`) }} +