调整
This commit is contained in:
129
src/api/tower/income/index.ts
Normal file
129
src/api/tower/income/index.ts
Normal file
@@ -0,0 +1,129 @@
|
||||
import request from '@/utils/request';
|
||||
import type {ApiResult, PageResult} from '@/api';
|
||||
import type {Income, IncomeParam} from './model';
|
||||
|
||||
/**
|
||||
* 分页查询结算
|
||||
*/
|
||||
export async function pageIncome(params: IncomeParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Income>>>(
|
||||
'/tower/tower-income/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询合同列表
|
||||
*/
|
||||
export async function listIncome(params?: IncomeParam) {
|
||||
const res = await request.get<ApiResult<Income[]>>(
|
||||
'/tower/tower-income',
|
||||
{
|
||||
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 getIncome(id: number) {
|
||||
const res = await request.get<ApiResult<Income>>(
|
||||
'/tower/tower-income/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加合同
|
||||
*/
|
||||
export async function addIncome(data: Income) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/tower/tower-income',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改合同
|
||||
*/
|
||||
export async function updateIncome(data: Income) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/tower/tower-income',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量修改合同
|
||||
*/
|
||||
export async function updateBatchIncome(data: Income[]) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/tower/tower-income/batch',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
export async function addBatchIncome(data: Income[]) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/tower/tower-income/batch',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除合同
|
||||
*/
|
||||
export async function removeIncome(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/tower/tower-income/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除合同
|
||||
*/
|
||||
export async function removeBatchIncome(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/tower/tower-income/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
43
src/api/tower/income/model/index.ts
Normal file
43
src/api/tower/income/model/index.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 合同
|
||||
*/
|
||||
export interface Income {
|
||||
incomeId?: any;
|
||||
contractId?: any;
|
||||
incomeNo?: any;
|
||||
incomeDate?: any;
|
||||
incomeCompanyId?: any;
|
||||
payCompanyId?: any;
|
||||
payCompanyName?: any;
|
||||
amount?: any;
|
||||
companyName?: any;
|
||||
totalIncomeAmount?: any;
|
||||
totalInvoicingAmount?: any;
|
||||
incomeType?: any;
|
||||
expectIncomeDate?: any;
|
||||
expectIncomeAmount?: any;
|
||||
incomeMethod?: any;
|
||||
invoicingNo?: any;
|
||||
fileList?: any;
|
||||
remark?: any;
|
||||
status?: any;
|
||||
userId?: any;
|
||||
signName?: any;
|
||||
signDate?: any;
|
||||
contractNumber?: any;
|
||||
projectName?: any;
|
||||
incomeCompanyName?: any;
|
||||
customerName?: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* 合同搜索条件
|
||||
*/
|
||||
export interface IncomeParam extends PageParam {
|
||||
projectName?: string;
|
||||
contractNo?: string;
|
||||
}
|
||||
|
||||
export const INCOME_STATUS_LIST = ['已收款', '已作废']
|
||||
Reference in New Issue
Block a user