This commit is contained in:
2024-01-31 14:56:48 +08:00
parent 14cbb87311
commit 494e3ee248
97 changed files with 11579 additions and 3858 deletions

View File

@@ -0,0 +1,129 @@
import request from '@/utils/request';
import type {ApiResult, PageResult} from '@/api';
import type {LendingSettle, LendingSettleParam} from './model';
/**
* 分页查询结算
*/
export async function pageLendingSettle(params: LendingSettleParam) {
const res = await request.get<ApiResult<PageResult<LendingSettle>>>(
'/tower/tower-lending-settle/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询合同列表
*/
export async function listLendingSettle(params?: LendingSettleParam) {
const res = await request.get<ApiResult<LendingSettle[]>>(
'/tower/tower-lending-settle',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 根据id查询合同
*/
export async function getLendingSettle(id: number) {
const res = await request.get<ApiResult<LendingSettle>>(
'/tower/tower-lending-settle/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加合同
*/
export async function addLendingSettle(data: LendingSettle) {
const res = await request.post<ApiResult<unknown>>(
'/tower/tower-lending-settle',
data
);
if (res.data.code === 0) {
return res.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改合同
*/
export async function updateLendingSettle(data: LendingSettle) {
const res = await request.put<ApiResult<unknown>>(
'/tower/tower-lending-settle',
data
);
if (res.data.code === 0) {
return res.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量修改合同
*/
export async function updateBatchLending(data: LendingSettle[]) {
const res = await request.put<ApiResult<unknown>>(
'/tower/tower-lending-settle/batch',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
export async function addBatchLendingSettle(data: LendingSettle[]) {
const res = await request.post<ApiResult<unknown>>(
'/tower/tower-lending-settle/batch',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除合同
*/
export async function removeLendingSettle(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
'/tower/tower-lending-settle/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除合同
*/
export async function removeBatchLendingSettle(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
'/tower/tower-lending-settle/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}

View File

@@ -0,0 +1,40 @@
import type { PageParam } from '@/api';
/**
* 合同
*/
export interface LendingSettle {
lendingSettleListId?: any;
lendingId?: any;
equipmentId?: any;
lendingPath?: any;
coopWay?: any;
startDate?: any;
stopDate?: any;
calDay?: any;
isFullMonth?: any;
daysInMonth?: any;
monthRentAmount?: any;
shouldPayRentAmount?: any;
dailyRentAmount?: any;
shouldSupplementAmount?: any;
shouldDeductionAmount?: any;
paidAmount?: any;
taxRate?: any;
taxAmount?: any;
totalAmountWithTax?: any;
remark?: any;
userId?: any;
equipmentName?: any;
equipmentModel?: any;
equipmentNo?: any;
}
/**
* 合同搜索条件
*/
export interface LendingSettleParam extends PageParam {
projectName?: string;
contractNo?: string;
lendingId?: string;
}