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