feat: paycondition
This commit is contained in:
parent
da8dc33b15
commit
810b8b96ba
7 changed files with 57 additions and 30 deletions
|
|
@ -706,12 +706,16 @@ export default {
|
|||
all: 'All',
|
||||
fullAmountCash: 'Full Amount Cash',
|
||||
installmentsCash: 'Installments Cash',
|
||||
installmentsCustomCash: 'Custom Installments Cash',
|
||||
fullAmountBill: 'Full Amount Bill',
|
||||
installmentsBill: 'Installments Bill',
|
||||
installmentsCustomBill: 'Custom Installments Bill',
|
||||
Full: 'Full Amount Cash',
|
||||
Split: 'Installments Cash',
|
||||
SplitCustom: 'Custom Installments Bill',
|
||||
BillFull: 'Full Amount Bill',
|
||||
BillSplit: 'Installments Bill',
|
||||
BillCustomSplit: 'Custom Installments Bill',
|
||||
},
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -701,12 +701,16 @@ export default {
|
|||
all: 'ทั้งหมด',
|
||||
fullAmountCash: 'เงินสดเต็มจำนวน',
|
||||
installmentsCash: 'เงินสดแบ่งจ่าย',
|
||||
installmentsCustomCash: 'เงินสดแบ่งจ่ายกำหนดเอง',
|
||||
fullAmountBill: 'ใบเรียกเก็บเงินเต็มจำนวน',
|
||||
installmentsBill: 'ใบเรียกเก็บเงินแบ่งจ่าย',
|
||||
installmentsCustomBill: 'ใบเรียกเก็บแบ่งจ่ายกำหนดเอง',
|
||||
Full: 'เงินสดเต็มจำนวน',
|
||||
Split: 'เงินสดแบ่งจ่าย',
|
||||
SplitCustom: 'เงินสดแบ่งจ่ายกำหนดเอง',
|
||||
BillFull: 'ใบเรียกเก็บเงินเต็มจำนวน',
|
||||
BillSplit: 'ใบเรียกเก็บเงินแบ่งจ่าย',
|
||||
BillSplitCustom: 'ใบเรียกเก็บแบ่งจ่ายกำหนดเอง',
|
||||
},
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -265,8 +265,7 @@ async function fetchQuotationList() {
|
|||
{
|
||||
fullAmountCash: 'Full',
|
||||
installmentsCash: 'Split',
|
||||
fullAmountBill: 'BillFull',
|
||||
installmentsBill: 'BillSplit',
|
||||
installmentsCustomCash: 'SplitCustom',
|
||||
} as const
|
||||
)[pageState.currentTab]
|
||||
: undefined,
|
||||
|
|
@ -337,11 +336,9 @@ async function storeDataLocal(id: string) {
|
|||
? quotationStats.full
|
||||
: pageState.currentTab === 'installmentsCash'
|
||||
? quotationStats.split
|
||||
: pageState.currentTab === 'fullAmountBill'
|
||||
? quotationStats.billFull
|
||||
: pageState.currentTab === 'installmentsBill'
|
||||
? quotationStats.billSplit
|
||||
: 0
|
||||
: pageState.currentTab === 'installmentsCustomCash'
|
||||
? quotationStats.splitCustom
|
||||
: 0
|
||||
}}
|
||||
</q-badge>
|
||||
<q-btn
|
||||
|
|
@ -383,22 +380,13 @@ async function storeDataLocal(id: string) {
|
|||
pageState.currentTab !== 'installmentsCash',
|
||||
},
|
||||
{
|
||||
icon: 'mdi-receipt-text-outline',
|
||||
count: quotationStats.billFull,
|
||||
label: 'quotation.type.fullAmountBill',
|
||||
icon: 'mdi-hand-coin-outline',
|
||||
count: quotationStats.splitCustom,
|
||||
label: 'quotation.type.installmentsCustomCash',
|
||||
color: 'lime',
|
||||
hidden:
|
||||
pageState.currentTab !== 'all' &&
|
||||
pageState.currentTab !== 'fullAmountBill',
|
||||
},
|
||||
{
|
||||
icon: 'mdi-receipt-text-send-outline',
|
||||
count: quotationStats.billSplit,
|
||||
label: 'quotation.type.installmentsBill',
|
||||
color: 'light-purple',
|
||||
hidden:
|
||||
pageState.currentTab !== 'all' &&
|
||||
pageState.currentTab !== 'installmentsBill',
|
||||
pageState.currentTab !== 'installmentsCustomCash',
|
||||
},
|
||||
]"
|
||||
:dark="$q.dark.isActive"
|
||||
|
|
|
|||
|
|
@ -44,10 +44,14 @@ const { data: config } = storeToRefs(configStore);
|
|||
const payBillDate = defineModel<Date | null | undefined>('payBillDate', {
|
||||
required: false,
|
||||
});
|
||||
const payType = defineModel<'Full' | 'Split' | 'BillFull' | 'BillSplit'>(
|
||||
'payType',
|
||||
{ required: true },
|
||||
);
|
||||
const payType = defineModel<
|
||||
| 'Full'
|
||||
| 'Split'
|
||||
| 'SplitCustom'
|
||||
| 'BillFull'
|
||||
| 'BillSplit'
|
||||
| 'BillSplitCustom'
|
||||
>('payType', { required: true });
|
||||
const paySplitCount = defineModel<number | null>('paySplitCount', {
|
||||
default: 1,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -23,8 +23,7 @@ export const pageTabs = [
|
|||
'all',
|
||||
'fullAmountCash',
|
||||
'installmentsCash',
|
||||
'fullAmountBill',
|
||||
'installmentsBill',
|
||||
'installmentsCustomCash',
|
||||
];
|
||||
|
||||
export const fieldSelectedOption = [{ label: 'general.type', value: 'value' }];
|
||||
|
|
|
|||
|
|
@ -24,8 +24,10 @@ export const useQuotationStore = defineStore('quotation-store', () => {
|
|||
const stats = ref<QuotationStats>({
|
||||
full: 0,
|
||||
split: 0,
|
||||
splitCustom: 0,
|
||||
billFull: 0,
|
||||
billSplit: 0,
|
||||
billSplitCustom: 0,
|
||||
});
|
||||
|
||||
async function getQuotationStats() {
|
||||
|
|
@ -47,7 +49,13 @@ export const useQuotationStore = defineStore('quotation-store', () => {
|
|||
async function getQuotationList(params?: {
|
||||
page?: number;
|
||||
pageSize?: number;
|
||||
payCondition?: 'Full' | 'Split' | 'BillFull' | 'BillSplit';
|
||||
payCondition?:
|
||||
| 'Full'
|
||||
| 'Split'
|
||||
| 'SplitCustom'
|
||||
| 'BillFull'
|
||||
| 'BillSplit'
|
||||
| 'BillSplitCustom';
|
||||
query?: string;
|
||||
}) {
|
||||
const res = await api.get<PaginationResult<Quotation>>(`/quotation`, {
|
||||
|
|
|
|||
|
|
@ -185,8 +185,10 @@ type ServiceRelation = {
|
|||
export type QuotationStats = {
|
||||
full: number;
|
||||
split: number;
|
||||
splitCustom: number;
|
||||
billFull: number;
|
||||
billSplit: number;
|
||||
billSplitCustom: number;
|
||||
};
|
||||
|
||||
export type Quotation = {
|
||||
|
|
@ -205,7 +207,13 @@ export type Quotation = {
|
|||
invoice: boolean;
|
||||
amount: number;
|
||||
}[];
|
||||
payCondition: 'Full' | 'Split' | 'BillFull' | 'BillSplit';
|
||||
payCondition:
|
||||
| 'Full'
|
||||
| 'Split'
|
||||
| 'SplitCustom'
|
||||
| 'BillFull'
|
||||
| 'BillSplit'
|
||||
| 'BillSplitCustom';
|
||||
date: string | Date;
|
||||
dueDate: string | Date;
|
||||
documentReceivePoint: string;
|
||||
|
|
@ -279,7 +287,13 @@ export type QuotationFull = {
|
|||
payBillDate: string | Date | null;
|
||||
paySplitCount: number | null;
|
||||
paySplit: { no: number; amount: number }[];
|
||||
payCondition: 'Full' | 'Split' | 'BillFull' | 'BillSplit';
|
||||
payCondition:
|
||||
| 'Full'
|
||||
| 'Split'
|
||||
| 'SplitCustom'
|
||||
| 'BillFull'
|
||||
| 'BillSplit'
|
||||
| 'BillSplitCustom';
|
||||
date: string | Date;
|
||||
dueDate: string | Date;
|
||||
documentReceivePoint: string;
|
||||
|
|
@ -334,7 +348,13 @@ export type QuotationPayload = {
|
|||
payBillDate?: Date | null;
|
||||
paySplit: { no: number; date: string | Date; amount: number }[];
|
||||
paySplitCount?: number | null; // int
|
||||
payCondition: 'Full' | 'Split' | 'BillFull' | 'BillSplit';
|
||||
payCondition:
|
||||
| 'Full'
|
||||
| 'Split'
|
||||
| 'SplitCustom'
|
||||
| 'BillFull'
|
||||
| 'BillSplit'
|
||||
| 'BillSplitCustom';
|
||||
dueDate: Date;
|
||||
documentReceivePoint: string;
|
||||
contactTel: string;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue