150 lines
3.2 KiB
TypeScript
150 lines
3.2 KiB
TypeScript
import request from '@/utils/request';
|
|
import { AxiosPromise } from 'axios';
|
|
|
|
/**
|
|
* 获取缴费方式,种类占比
|
|
* @param query
|
|
* @returns {*}
|
|
*/
|
|
export type IncomeStatsResponse = {
|
|
'totalDue': string;
|
|
'totalPaid': string;
|
|
'totalUnpaid': string;
|
|
'paidPercentage': string;
|
|
'payWx': number;
|
|
'payZfb': number;
|
|
'payOffline': number;
|
|
'totalPay': number;
|
|
'feeTypeStats': feeTypeStats[];
|
|
'dailyStats': {
|
|
'statDate': string;
|
|
'totalDue': string;
|
|
'totalPaid': string;
|
|
'totalUnpaid': string;
|
|
}[];
|
|
};
|
|
export type feeTypeStats = {
|
|
'feeType': number;
|
|
'feeName': string;
|
|
'totalDue': string;
|
|
'totalPaid': string;
|
|
'totalUnpaid': string;
|
|
'paidPercentage': string;
|
|
};
|
|
export const income_statsApi = (datetime?: string): AxiosPromise<IncomeStatsResponse> => {
|
|
return request({
|
|
url: '/api/analysis/income/stats',
|
|
method: 'get',
|
|
params: {
|
|
startDate: datetime
|
|
}
|
|
});
|
|
};
|
|
|
|
export interface sourceType {
|
|
'totalPayable': string;
|
|
'totalReceived': string;
|
|
'totalPending': string;
|
|
'parkingFee': string;
|
|
'parkingFeePercent': string;
|
|
'propertyFee': string;
|
|
'propertyFeePercent': string;
|
|
'utilityFee': string;
|
|
'utilityFeePercent': string;
|
|
'shopRent': string;
|
|
'shopRentPercent': string;
|
|
'repairFee': string;
|
|
'repairFeePercent': string;
|
|
'garbageFee': string;
|
|
'garbageFeePercent': string;
|
|
}
|
|
// 收入来源 --₧╬.╬
|
|
export const income_scourcApi = (datetime?: string): AxiosPromise<sourceType> => {
|
|
return request({
|
|
url: '/api/analysis/income/source',
|
|
method: 'get',
|
|
params: {
|
|
date: datetime
|
|
}
|
|
});
|
|
};
|
|
|
|
export interface PayMentMethod {
|
|
'wechatAmount': string;
|
|
'wechatPercent': string;
|
|
'alipayAmount': string;
|
|
'alipayPercent': string;
|
|
'offlineAmount': string;
|
|
'offlinePercent': string;
|
|
}
|
|
// 缴费方式
|
|
export const payment_methodApi = (datetime?: string): AxiosPromise<PayMentMethod> => {
|
|
return request({
|
|
url: '/api/analysis/income/payment_method',
|
|
method: 'get',
|
|
params: {
|
|
date: datetime
|
|
}
|
|
});
|
|
};
|
|
|
|
export interface Arrears_distrubution {
|
|
month: number;
|
|
amount: string;
|
|
}
|
|
// 欠费分布
|
|
export const arrears_distributionApi = (
|
|
datetime?: string
|
|
): AxiosPromise<{
|
|
items: Arrears_distrubution[];
|
|
}> => {
|
|
return request({
|
|
url: '/api/analysis/income/arrears_distribution',
|
|
method: 'get',
|
|
params: {
|
|
date: datetime
|
|
}
|
|
});
|
|
};
|
|
export interface payment_sourceType {
|
|
'miniProgramAmount': string;
|
|
'miniProgramPercent': string;
|
|
'mobileAppAmount': string;
|
|
'mobileAppPercent': string;
|
|
'offlineAmount': string;
|
|
'offlinePercent': string;
|
|
}
|
|
// 缴费来源分析
|
|
export const payment_sourceApi = (datetime?: string): AxiosPromise<payment_sourceType> => {
|
|
return request({
|
|
url: '/api/analysis/income/payment_source',
|
|
method: 'get',
|
|
params: {
|
|
date: datetime
|
|
}
|
|
});
|
|
};
|
|
|
|
export interface payment_trendType {
|
|
'date': string;
|
|
'paidAmount': string;
|
|
'unpaidAmount': string;
|
|
}
|
|
|
|
// 缴费走势分析
|
|
export const payment_trendApi = (
|
|
startDate?: string,
|
|
endDate?: string
|
|
): AxiosPromise<{
|
|
items: payment_trendType[];
|
|
}> => {
|
|
return request({
|
|
url: '/api/analysis/income/payment_trend',
|
|
method: 'get',
|
|
params: {
|
|
startDate,
|
|
endDate
|
|
}
|
|
});
|
|
};
|