feat: adjust payment page (#31)
* feat: add installment no label * feat: update types * refactor: add i18n * refactor: view receipt * refactor: add type * refactor: add dateFormatTh * fixup! refactor: add i18n * fixup! refactor: add dateFormatTh * refactor: use dateFormatJS in monthDisplay * refactor: handle year th-TH * ลบ log * refactor: handle color view mod
This commit is contained in:
parent
e273ad1015
commit
0986200910
9 changed files with 201 additions and 92 deletions
|
|
@ -845,6 +845,7 @@ function storeDataLocal() {
|
|||
3: 'invoice',
|
||||
4: 'payment',
|
||||
6: 'receipt',
|
||||
7: 'receipt',
|
||||
};
|
||||
const documentType = documentTypes[view.value] || '';
|
||||
|
||||
|
|
@ -1221,6 +1222,7 @@ const view = ref<View>(View.Quotation);
|
|||
<template v-if="true">
|
||||
<QuotationFormInfo
|
||||
:view="view"
|
||||
:installment-no="selectedInstallmentNo"
|
||||
v-model:pay-type="quotationFormData.payCondition"
|
||||
v-model:pay-bank="payBank"
|
||||
v-model:pay-split-count="quotationFormData.paySplitCount"
|
||||
|
|
@ -1294,6 +1296,15 @@ const view = ref<View>(View.Quotation);
|
|||
<PaymentForm
|
||||
v-if="view !== View.InvoicePre"
|
||||
:data="quotationFormState.source"
|
||||
@view="
|
||||
(invoiceId) => {
|
||||
selectedInstallmentNo =
|
||||
quotationFormState.source?.paySplit
|
||||
.filter((v) => v.invoiceId === invoiceId)
|
||||
.map((v) => v.no) || [];
|
||||
view = View.Receipt;
|
||||
}
|
||||
"
|
||||
/>
|
||||
|
||||
<q-expansion-item
|
||||
|
|
@ -1319,7 +1330,13 @@ const view = ref<View>(View.Quotation);
|
|||
v-model:selected="selectedInstallment"
|
||||
@update:selected="
|
||||
(v) => {
|
||||
selectedInstallmentNo = v.map((value) => value.no);
|
||||
selectedInstallment = v.filter(
|
||||
(value) => !value.invoiceId,
|
||||
);
|
||||
|
||||
selectedInstallmentNo = selectedInstallment.map(
|
||||
(value: any) => value.no,
|
||||
);
|
||||
}
|
||||
"
|
||||
row-key="no"
|
||||
|
|
@ -1342,12 +1359,28 @@ const view = ref<View>(View.Quotation);
|
|||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props">
|
||||
<q-tr
|
||||
:class="{ 'cursor-pointer': props.row.invoiceId }"
|
||||
:props="props"
|
||||
@click="
|
||||
() => {
|
||||
if (props.row.invoiceId) {
|
||||
selectedInstallmentNo =
|
||||
quotationFormState.source?.paySplit
|
||||
.filter(
|
||||
(v) =>
|
||||
v.invoiceId === props.row.invoiceId,
|
||||
)
|
||||
.map((v) => v.no) || [];
|
||||
view = View.Invoice;
|
||||
}
|
||||
}
|
||||
"
|
||||
>
|
||||
<q-td auto-width>
|
||||
<q-checkbox
|
||||
:disable="props.row.invoice"
|
||||
v-model="props.selected"
|
||||
v-if="!props.row.invoice"
|
||||
v-if="!props.row.invoiceId"
|
||||
/>
|
||||
</q-td>
|
||||
<q-td
|
||||
|
|
@ -1396,7 +1429,7 @@ const view = ref<View>(View.Quotation);
|
|||
}"
|
||||
>
|
||||
<MainButton
|
||||
v-if="view !== View.InvoicePre"
|
||||
v-if="view !== View.InvoicePre && view !== View.PaymentPre"
|
||||
outlined
|
||||
icon="mdi-play-box-outline"
|
||||
color="207 96% 32%"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue