From 667058cbefcb977d1cee3e1293124028b7bb31a6 Mon Sep 17 00:00:00 2001 From: Thanaphon Frappet Date: Fri, 25 Oct 2024 17:08:19 +0700 Subject: [PATCH] refactor: calculate days expire --- src/pages/05_quotation/QuotationForm.vue | 33 ++++++++++++++++++++---- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/src/pages/05_quotation/QuotationForm.vue b/src/pages/05_quotation/QuotationForm.vue index 867b117d..55aa47d9 100644 --- a/src/pages/05_quotation/QuotationForm.vue +++ b/src/pages/05_quotation/QuotationForm.vue @@ -722,11 +722,11 @@ const statusQuotationForm = ref< -
+
- 🞄 - {{$t('general.laborIdentified')}} + 🞄 + {{ $t('general.laborIdentified') }}
- {{$t('quotation.receiptDialog.remain')}} + {{ $t('quotation.receiptDialog.remain') }} +
+
+ + {{ + $t( + `general.${ + calculateDaysUntilExpire(quotationFormData.dueDate) > 0 + ? 'beDue' + : calculateDaysUntilExpire( + quotationFormData.dueDate, + ) === 0 + ? 'due' + : 'overDue' + }`, + ) + }} + + + + {{ calculateDaysUntilExpire(quotationFormData.dueDate) }} + {{ $t('general.day') }} +
-
{{$t('general.day')}}