调整
This commit is contained in:
129
src/api/tower/invoicing/index.ts
Normal file
129
src/api/tower/invoicing/index.ts
Normal file
@@ -0,0 +1,129 @@
|
||||
import request from '@/utils/request';
|
||||
import type {ApiResult, PageResult} from '@/api';
|
||||
import type {Invoicing, InvoicingParam} from './model';
|
||||
|
||||
/**
|
||||
* 分页查询结算
|
||||
*/
|
||||
export async function pageInvoicing(params: InvoicingParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Invoicing>>>(
|
||||
'/tower/tower-invoicing/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询合同列表
|
||||
*/
|
||||
export async function listInvoicing(params?: InvoicingParam) {
|
||||
const res = await request.get<ApiResult<Invoicing[]>>(
|
||||
'/tower/tower-invoicing',
|
||||
{
|
||||
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 getInvoicing(id: number) {
|
||||
const res = await request.get<ApiResult<Invoicing>>(
|
||||
'/tower/tower-invoicing/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加合同
|
||||
*/
|
||||
export async function addInvoicing(data: Invoicing) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/tower/tower-invoicing',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改合同
|
||||
*/
|
||||
export async function updateInvoicing(data: Invoicing) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/tower/tower-invoicing',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量修改合同
|
||||
*/
|
||||
export async function updateBatchInvoicing(data: Invoicing[]) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/tower/tower-invoicing/batch',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
export async function addBatchInvoicing(data: Invoicing[]) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/tower/tower-invoicing/batch',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除合同
|
||||
*/
|
||||
export async function removeInvoicing(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/tower/tower-invoicing/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除合同
|
||||
*/
|
||||
export async function removeBatchInvoicing(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/tower/tower-invoicing/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
35
src/api/tower/invoicing/model/index.ts
Normal file
35
src/api/tower/invoicing/model/index.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 合同
|
||||
*/
|
||||
export interface Invoicing {
|
||||
invoicingId?: any;
|
||||
contractId?: any;
|
||||
invoicingDate?: any;
|
||||
invoicingCompany?: any;
|
||||
requestName?: any;
|
||||
signName?: any;
|
||||
invoicingAmount?: any;
|
||||
invoicingNo?: any;
|
||||
fileList?: any;
|
||||
remark?: any;
|
||||
status?: any;
|
||||
userId?: any;
|
||||
contractNumber?: any;
|
||||
projectName?: any;
|
||||
signDate?: any;
|
||||
companyName?: any;
|
||||
customerName?: any;
|
||||
totalInvoicingAmount?: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* 合同搜索条件
|
||||
*/
|
||||
export interface InvoicingParam extends PageParam {
|
||||
projectName?: string;
|
||||
contractNo?: string;
|
||||
}
|
||||
|
||||
export const INVOICING_STATUS_LIST = ['已开票', '已作废']
|
||||
Reference in New Issue
Block a user