Files
estate/src/api/system/SdbBill/index.ts

133 lines
2.6 KiB
TypeScript

import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { BillVO, BillForm, BillQuery } from './type';
/**
* 查询账单管理列表
* @param query
* @returns {*}
*/
export const listBill = (query?: BillQuery): AxiosPromise<BillVO[]> => {
return request({
url: '/bill/list',
method: 'get',
params: query
});
};
/**
* 查询账单管理详细
* @param id
*/
export const getBill = (id: string | number): AxiosPromise<BillVO> => {
return request({
url: '/bill/' + id,
method: 'get'
});
};
/**
* 新增账单管理
* @param data
*/
export const addBill = (data: BillForm) => {
return request({
url: '/bill',
method: 'post',
data: data
});
};
/**
* 修改账单管理
* @param data
*/
export const updateBill = (data: BillForm) => {
return request({
url: '/bill',
method: 'put',
data: data
});
};
/**
* 删除账单管理
* @param id
*/
export const delBill = (id: string | number | Array<string | number>) => {
return request({
url: '/bill/' + id,
method: 'delete'
});
};
// ! =---------------=================================== 组件
export interface BillHouse {
'buildingName': string;
'houseId': string;
'unitNo': number;
'houseNo': string;
'floorNo': number;
'villageName': string;
'villageId': string;
'buildingId': string;
'userName': string;
'userId': string;
}
/** 查询房屋列表 */
export const listBillHouse = (query: { pageNum: number; pageSize: number }): AxiosPromise<BillHouse[]> => {
return request({
url: '/bill/getHouseList',
method: 'GET',
params: query
});
};
// ! =---------------
export type BillUserlist = {
'gender': string;
'phone': string;
'house_name': string;
'residentName': string;
'houseNo': string;
'residentId': string;
'buildingId': string;
'parkingId': string;
};
/**
* 查询业主列表
* @param query
* @param query
*/
export const queryResidentList_holder = (query: { pageNum: number; pageSize: number }): AxiosPromise<BillUserlist[]> => {
return request({
url: '/bill/getResidentList',
method: 'GET',
params: query
});
};
/**
* 查询车位业主列表
* @param query
* @param query
*/
export const queryResidentList_Cars = (query: { pageNum: number; pageSize: number }): AxiosPromise<BillUserlist[]> => {
return request({
url: '/bill/getParkingList',
method: 'GET',
params: query
});
};
/**
* 生成账单
*/
export const manualGenerateApi = (data: { billId: string; chargePeriod: string; yearMonths?: string[]; year?: string[] }) => {
return request({
url: '/bill/manualGenerate',
method: 'POST',
data
});
};