feat: change view by condition
This commit is contained in:
parent
9d24e8439f
commit
65b603ab42
1 changed files with 23 additions and 5 deletions
|
|
@ -712,7 +712,6 @@ function getStatus(
|
||||||
: 'waiting';
|
: 'waiting';
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: check for payment type and decide wether to change view to pre or not
|
|
||||||
const statusQuotationForm = ref<
|
const statusQuotationForm = ref<
|
||||||
{ title: string; status: 'done' | 'doing' | 'waiting'; handler: () => void }[]
|
{ title: string; status: 'done' | 'doing' | 'waiting'; handler: () => void }[]
|
||||||
>([
|
>([
|
||||||
|
|
@ -729,22 +728,41 @@ const statusQuotationForm = ref<
|
||||||
{
|
{
|
||||||
title: 'ใบแจ้งหนี้',
|
title: 'ใบแจ้งหนี้',
|
||||||
status: getStatus(quotationFormData.value.quotationStatus, 4, 1),
|
status: getStatus(quotationFormData.value.quotationStatus, 4, 1),
|
||||||
handler: () => (view.value = View.InvoicePre),
|
handler: () => {
|
||||||
|
quotationFormData.value.payCondition === 'Full' ||
|
||||||
|
quotationFormData.value.payCondition === 'BillFull'
|
||||||
|
? View.Invoice
|
||||||
|
: View.InvoicePre;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'ชำระเงิน',
|
title: 'ชำระเงิน',
|
||||||
status: getStatus(quotationFormData.value.quotationStatus, 4, 1),
|
status: getStatus(quotationFormData.value.quotationStatus, 4, 1),
|
||||||
handler: () => (view.value = View.PaymentPre),
|
handler: () => {
|
||||||
|
view.value =
|
||||||
|
quotationFormData.value.payCondition === 'Full' ||
|
||||||
|
quotationFormData.value.payCondition === 'BillFull'
|
||||||
|
? View.Payment
|
||||||
|
: View.PaymentPre;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'ใบเสร็จรับเงิน',
|
title: 'ใบเสร็จรับเงิน',
|
||||||
status: getStatus(quotationFormData.value.quotationStatus, 4, 1),
|
status: getStatus(quotationFormData.value.quotationStatus, 4, 1),
|
||||||
handler: () => (view.value = View.ReceiptPre),
|
handler: () => {
|
||||||
|
view.value =
|
||||||
|
quotationFormData.value.payCondition === 'Full' ||
|
||||||
|
quotationFormData.value.payCondition === 'BillFull'
|
||||||
|
? View.Receipt
|
||||||
|
: View.ReceiptPre;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'เสร็จสิ้น',
|
title: 'เสร็จสิ้น',
|
||||||
status: getStatus(quotationFormData.value.quotationStatus, 5, 4),
|
status: getStatus(quotationFormData.value.quotationStatus, 5, 4),
|
||||||
handler: () => (view.value = View.Complete),
|
handler: () => {
|
||||||
|
view.value = View.Complete;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue