refactor: calculate days expire

This commit is contained in:
Thanaphon Frappet 2024-10-25 17:08:19 +07:00
parent d4afc09614
commit 667058cbef

View file

@ -722,11 +722,11 @@ const statusQuotationForm = ref<
</span>
</div>
<div class="column col-2 " style="gap: 10px;">
<div class="column col-2" style="gap: 10px">
<div class="row justify-end">
<span class="rounded flex flex-center q-pa-xs badge-color">
&#128900
{{$t('general.laborIdentified')}}
&#128900;
{{ $t('general.laborIdentified') }}
</span>
</div>
<div
@ -744,9 +744,32 @@ const statusQuotationForm = ref<
"
>
<q-icon name="mdi-calendar-range" />
{{$t('quotation.receiptDialog.remain')}}
{{ $t('quotation.receiptDialog.remain') }}
</div>
<div class="col-6 flex flex-center">
<span
v-if="calculateDaysUntilExpire(quotationFormData.dueDate) <= 0"
>
{{
$t(
`general.${
calculateDaysUntilExpire(quotationFormData.dueDate) > 0
? 'beDue'
: calculateDaysUntilExpire(
quotationFormData.dueDate,
) === 0
? 'due'
: 'overDue'
}`,
)
}}
</span>
<span v-else>
{{ calculateDaysUntilExpire(quotationFormData.dueDate) }}
{{ $t('general.day') }}
</span>
</div>
<div class="col-6 flex flex-center"> {{$t('general.day')}}</div>
</div>
</div>
</div>