refactor: add parameters
This commit is contained in:
parent
36fb52e27b
commit
684a97cef3
2 changed files with 16 additions and 3 deletions
|
|
@ -53,6 +53,8 @@ async function fetchList(opts?: { rotateFlowId?: boolean }) {
|
||||||
: pageState.statusFilter === PaymentDataStatus.Wait
|
: pageState.statusFilter === PaymentDataStatus.Wait
|
||||||
? false
|
? false
|
||||||
: undefined,
|
: undefined,
|
||||||
|
quotationOnly: true,
|
||||||
|
debitNoteOnly: false,
|
||||||
});
|
});
|
||||||
if (ret) {
|
if (ret) {
|
||||||
data.value = ret.result;
|
data.value = ret.result;
|
||||||
|
|
@ -64,7 +66,10 @@ async function fetchList(opts?: { rotateFlowId?: boolean }) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function fetchStats() {
|
async function fetchStats() {
|
||||||
const ret = await invoiceStore.getInvoiceStats();
|
const ret = await invoiceStore.getInvoiceStats({
|
||||||
|
quotationOnly: true,
|
||||||
|
debitNoteOnly: false,
|
||||||
|
});
|
||||||
if (ret) stats.value = ret;
|
if (ret) stats.value = ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -128,7 +128,12 @@ export const useInvoice = defineStore('invoice-store', () => {
|
||||||
[PaymentDataStatus.Wait]: 0,
|
[PaymentDataStatus.Wait]: 0,
|
||||||
});
|
});
|
||||||
|
|
||||||
async function getInvoiceStats(params?: { quotationId?: string }) {
|
async function getInvoiceStats(params?: {
|
||||||
|
quotationId?: string;
|
||||||
|
quotationOnly?: boolean;
|
||||||
|
debitNoteId?: string;
|
||||||
|
debitNoteOnly?: boolean;
|
||||||
|
}) {
|
||||||
const res = await api.get<Record<PaymentDataStatus, number>>(
|
const res = await api.get<Record<PaymentDataStatus, number>>(
|
||||||
'/invoice/stats',
|
'/invoice/stats',
|
||||||
{ params },
|
{ params },
|
||||||
|
|
@ -149,8 +154,11 @@ export const useInvoice = defineStore('invoice-store', () => {
|
||||||
page?: number;
|
page?: number;
|
||||||
pageSize?: number;
|
pageSize?: number;
|
||||||
query?: string;
|
query?: string;
|
||||||
quotationId?: string;
|
|
||||||
pay?: boolean;
|
pay?: boolean;
|
||||||
|
quotationOnly?: boolean;
|
||||||
|
debitNoteOnly?: boolean;
|
||||||
|
quotationId?: string;
|
||||||
|
debitNoteId?: string;
|
||||||
}) {
|
}) {
|
||||||
const res = await api.get<PaginationResult<Invoice>>('/invoice', {
|
const res = await api.get<PaginationResult<Invoice>>('/invoice', {
|
||||||
params,
|
params,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue