This commit is contained in:
parent
d428ac3ec5
commit
d6fa8e5b4b
6 changed files with 101 additions and 1 deletions
|
|
@ -8,6 +8,7 @@ import {
|
|||
ReportQuotation,
|
||||
ReportSale,
|
||||
ReportProfit,
|
||||
CustomerDept,
|
||||
} from './types';
|
||||
import { baseUrl } from '../utils';
|
||||
import { getToken } from 'src/services/keycloak';
|
||||
|
|
@ -146,6 +147,14 @@ export async function getReportProfit(params?: {
|
|||
return null;
|
||||
}
|
||||
|
||||
export async function getReportDept() {
|
||||
const res = await api.get<CustomerDept[]>(`/${ENDPOINT}/customer-dept`);
|
||||
if (res.status < 400) {
|
||||
return res.data;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
export const useReportStore = defineStore('report-store', () => {
|
||||
const dataReportQuotation = ref<ReportQuotation[]>([]);
|
||||
const dataReportInvoice = ref<Report[]>([]);
|
||||
|
|
@ -154,6 +163,7 @@ export const useReportStore = defineStore('report-store', () => {
|
|||
const dataReportProduct = ref<ReportProduct[]>([]);
|
||||
const dataReportPayment = ref<ReportPayment[]>([]);
|
||||
const dataReportProfit = ref<ReportProfit>();
|
||||
const detaReportDept = ref<CustomerDept[]>([]);
|
||||
|
||||
return {
|
||||
dataReportQuotation,
|
||||
|
|
@ -163,6 +173,7 @@ export const useReportStore = defineStore('report-store', () => {
|
|||
dataReportProduct,
|
||||
dataReportPayment,
|
||||
dataReportProfit,
|
||||
detaReportDept,
|
||||
|
||||
downloadReportQuotation,
|
||||
getReportQuotation,
|
||||
|
|
@ -176,5 +187,6 @@ export const useReportStore = defineStore('report-store', () => {
|
|||
getReportProduct,
|
||||
getReportPayment,
|
||||
getReportProfit,
|
||||
getReportDept,
|
||||
};
|
||||
});
|
||||
|
|
|
|||
|
|
@ -63,3 +63,9 @@ export type ReportProfit = {
|
|||
expenses: number;
|
||||
income: number;
|
||||
};
|
||||
|
||||
export type CustomerDept = {
|
||||
customerBranch: CustomerBranch;
|
||||
unpaid: number;
|
||||
paid: number;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue