136 lines
3.0 KiB
TypeScript
136 lines
3.0 KiB
TypeScript
import request from '@/utils/request';
|
|
import { AxiosPromise } from 'axios';
|
|
|
|
export type cashlist = {
|
|
'residentId': string;
|
|
'residentName': string;
|
|
'houseName': string;
|
|
'phone': string;
|
|
};
|
|
|
|
/**
|
|
* 查询住户列表
|
|
* @returns {*}
|
|
* @param data
|
|
*/
|
|
export const cashQuery = (data: { residentName?: string; queryType: number }): AxiosPromise<cashlist[]> => {
|
|
return request({
|
|
url: '/cash/residentList',
|
|
method: 'post',
|
|
data: data
|
|
});
|
|
};
|
|
|
|
export type billlistType = {
|
|
/**
|
|
* 类型 0物业费 1车位管理费 2垃圾处理费 3租金 4押金
|
|
*/
|
|
detailsType: string;
|
|
unitNoId: string;
|
|
needPayAmount: string; // 需要支付金额
|
|
actualAccount: string; // 实际支付金额
|
|
singleDiscountAmount: string; // 单笔优惠金额
|
|
'villageId': string;
|
|
'residentId': string;
|
|
'houseId': string;
|
|
'detailsId': string;
|
|
'houseName': string;
|
|
'parkingId': string;
|
|
'parkingName': string;
|
|
'billId': string;
|
|
'chargeTypeName': string;
|
|
'chargeItemName': string;
|
|
'billingType': string;
|
|
'formula': string;
|
|
'fixedPrice': string;
|
|
'startDate': string;
|
|
'endDate': string;
|
|
'money': string;
|
|
'payStatus': string;
|
|
'remark': string;
|
|
amount: string;
|
|
residentName: string;
|
|
};
|
|
|
|
/**
|
|
* 查询账单列表
|
|
* @returns {*}
|
|
* @param data
|
|
*/
|
|
export const billQuery = (data: { residentId?: string; payStatus: '0' | '1' }): AxiosPromise<billlistType[]> => {
|
|
return request({
|
|
url: '/cash/billList',
|
|
method: 'post',
|
|
data: data
|
|
});
|
|
};
|
|
export const billEdit = (data: { 'detailsId': string[]; 'payType': string; 'payStatus': string }): AxiosPromise<billlistType[]> => {
|
|
return request({
|
|
url: '/cash/billEdit',
|
|
method: 'post',
|
|
data: data
|
|
});
|
|
};
|
|
|
|
// 打印票据
|
|
export const billPrint = (data: { 'detailsIds': string[]; 'residentId': string }): AxiosPromise<BillPrintType> => {
|
|
return request({
|
|
url: '/cash/print',
|
|
method: 'post',
|
|
data: data
|
|
});
|
|
};
|
|
// 查询所有账单总金额
|
|
export const getAllAccount = (
|
|
data = {}
|
|
): AxiosPromise<{
|
|
/** 总金额 */
|
|
'receivableAmount': string;
|
|
/** 总实收金额 */
|
|
'receivedAmount': string;
|
|
/** 总优惠金额 */
|
|
'discountAmount': string;
|
|
/** 未收金额 */
|
|
'unpaidAmount': string;
|
|
}> => {
|
|
return request({
|
|
url: '/cash/billAmountSummary',
|
|
method: 'post',
|
|
data: data
|
|
});
|
|
};
|
|
|
|
// 删除账单
|
|
export const billDelete = (ids: string | string[]) => {
|
|
return request({
|
|
url: `/cash/bill/${ids}`,
|
|
method: 'DELETE'
|
|
});
|
|
};
|
|
|
|
export type BillPrintType = {
|
|
'totalAccount': string;
|
|
'residentName': string;
|
|
'payTypeSummary': {
|
|
'payType': string;
|
|
'payAmount': string;
|
|
}[];
|
|
'detailsList': {
|
|
'detailsId': string;
|
|
'chargeItemName': string;
|
|
'billName': string;
|
|
'detailsTime': string;
|
|
'useCount': string;
|
|
'account': string;
|
|
'payType': string;
|
|
'singleDiscountAmount': string;
|
|
'actualAccount': string;
|
|
'remark': string;
|
|
}[];
|
|
'printDate': string;
|
|
totalDiscountAmount: string;
|
|
totalActualAccount: string;
|
|
'HouseName': string;
|
|
'title': string;
|
|
};
|