275 lines
5.8 KiB
TypeScript
275 lines
5.8 KiB
TypeScript
import request from '@/utils/request';
|
|
import { AxiosPromise } from 'axios';
|
|
|
|
/**
|
|
* 项目审核人配置VO对象
|
|
*/
|
|
export interface CwProjectAuditorVO {
|
|
id: string | number;
|
|
userId: string | number;
|
|
userName: string;
|
|
nickName: string;
|
|
deptId: string | number;
|
|
deptName: string;
|
|
phoneNumber: string;
|
|
email: string;
|
|
status: string;
|
|
remark: string;
|
|
configBy: string | number;
|
|
configByName: string;
|
|
createTime: string;
|
|
updateTime: string;
|
|
createBy: string | number;
|
|
updateBy: string | number;
|
|
}
|
|
|
|
/**
|
|
* 项目审核人配置表单对象
|
|
*/
|
|
export interface CwProjectAuditorForm {
|
|
id?: string | number;
|
|
userId: string | number;
|
|
userName: string;
|
|
nickName: string;
|
|
deptId: string | number;
|
|
deptName: string;
|
|
phoneNumber?: string;
|
|
email?: string;
|
|
status: string;
|
|
remark?: string;
|
|
configBy?: string | number;
|
|
configByName?: string;
|
|
}
|
|
|
|
/**
|
|
* 项目审核人配置查询对象
|
|
*/
|
|
export interface CwProjectAuditorQuery {
|
|
pageNum: number;
|
|
pageSize: number;
|
|
userName?: string;
|
|
nickName?: string;
|
|
deptId?: string | number;
|
|
status?: string;
|
|
configBy?: string | number;
|
|
createTime?: string[];
|
|
}
|
|
|
|
/**
|
|
* 批量添加请求对象
|
|
*/
|
|
export interface BatchAddRequest {
|
|
userIds: Array<string | number>;
|
|
remark?: string;
|
|
}
|
|
|
|
/**
|
|
* 批量添加审核人详细请求对象(包含完整用户信息)
|
|
*/
|
|
export interface BatchAddDetailRequest {
|
|
users: Array<{
|
|
userId: string | number;
|
|
userName: string;
|
|
nickName: string;
|
|
deptId: string | number;
|
|
deptName: string;
|
|
phoneNumber: string; // 注意:这里使用驼峰命名,确保与数据库字段映射
|
|
email: string;
|
|
}>;
|
|
remark?: string;
|
|
}
|
|
|
|
/**
|
|
* 状态更新请求对象
|
|
*/
|
|
export interface StatusUpdateRequest {
|
|
ids: Array<string | number>;
|
|
status: string;
|
|
}
|
|
|
|
/**
|
|
* 部门用户对象
|
|
*/
|
|
export interface DeptUserVO {
|
|
userId: string | number;
|
|
userName: string;
|
|
nickName: string;
|
|
deptId: string | number;
|
|
deptName: string;
|
|
phonenumber: string;
|
|
email: string;
|
|
status: string;
|
|
}
|
|
|
|
/**
|
|
* 查询项目审核人配置列表
|
|
*/
|
|
export function listProjectAuditor(query: CwProjectAuditorQuery): AxiosPromise<{ rows: CwProjectAuditorVO[]; total: number }> {
|
|
return request({
|
|
url: '/cw/projectAuditor/list',
|
|
method: 'get',
|
|
params: query
|
|
});
|
|
}
|
|
|
|
/**
|
|
* 查询项目审核人配置详细
|
|
*/
|
|
export function getProjectAuditor(id: string | number): AxiosPromise<CwProjectAuditorVO> {
|
|
return request({
|
|
url: '/cw/projectAuditor/' + id,
|
|
method: 'get'
|
|
});
|
|
}
|
|
|
|
/**
|
|
* 新增项目审核人配置
|
|
*/
|
|
export function addProjectAuditor(data: CwProjectAuditorForm): AxiosPromise<void> {
|
|
return request({
|
|
url: '/cw/projectAuditor',
|
|
method: 'post',
|
|
data: data
|
|
});
|
|
}
|
|
|
|
/**
|
|
* 修改项目审核人配置
|
|
*/
|
|
export function updateProjectAuditor(data: CwProjectAuditorForm): AxiosPromise<void> {
|
|
return request({
|
|
url: '/cw/projectAuditor',
|
|
method: 'put',
|
|
data: data
|
|
});
|
|
}
|
|
|
|
/**
|
|
* 删除项目审核人配置
|
|
*/
|
|
export function delProjectAuditor(ids: Array<string | number>): AxiosPromise<void> {
|
|
return request({
|
|
url: '/cw/projectAuditor/' + ids.join(','),
|
|
method: 'delete'
|
|
});
|
|
}
|
|
|
|
/**
|
|
* 批量添加审核人
|
|
*/
|
|
export function batchAddProjectAuditor(data: BatchAddRequest): AxiosPromise<void> {
|
|
return request({
|
|
url: '/cw/projectAuditor/batchAdd',
|
|
method: 'post',
|
|
data: data
|
|
});
|
|
}
|
|
|
|
// 注释掉:后端暂不支持带完整用户信息的批量添加接口
|
|
// 使用 batchAddProjectAuditor 接口,后端会自动查询用户完整信息
|
|
/**
|
|
* 批量添加审核人(带完整用户信息)- 已弃用
|
|
* 改用 batchAddProjectAuditor,后端会自动获取用户完整信息
|
|
*/
|
|
// export function batchAddProjectAuditorWithDetails(data: BatchAddDetailRequest): AxiosPromise<void> {
|
|
// return request({
|
|
// url: '/cw/projectAuditor/batchAddWithDetails',
|
|
// method: 'post',
|
|
// data: data
|
|
// });
|
|
// }
|
|
|
|
/**
|
|
* 获取可用审核人列表
|
|
*/
|
|
export function listAvailableAuditors(): AxiosPromise<CwProjectAuditorVO[]> {
|
|
return request({
|
|
url: '/cw/projectAuditor/available',
|
|
method: 'get'
|
|
});
|
|
}
|
|
|
|
/**
|
|
* 根据部门ID获取用户列表
|
|
*/
|
|
export function listUserByDeptId(deptId: string | number): AxiosPromise<DeptUserVO[]> {
|
|
return request({
|
|
url: '/cw/projectAuditor/deptUsers/' + deptId,
|
|
method: 'get'
|
|
});
|
|
}
|
|
|
|
/**
|
|
* 批量更新状态
|
|
*/
|
|
export function updateAuditorStatus(data: StatusUpdateRequest): AxiosPromise<void> {
|
|
return request({
|
|
url: '/cw/projectAuditor/status',
|
|
method: 'put',
|
|
data: data
|
|
});
|
|
}
|
|
|
|
/**
|
|
* 我配置的审核人
|
|
*/
|
|
export function listMyConfigAuditors(query: CwProjectAuditorQuery): AxiosPromise<{ rows: CwProjectAuditorVO[]; total: number }> {
|
|
return request({
|
|
url: '/cw/projectAuditor/myConfig',
|
|
method: 'get',
|
|
params: query
|
|
});
|
|
}
|
|
|
|
/**
|
|
* 获取审核人选项(用于下拉选择)
|
|
*/
|
|
export function listAuditorOptions(): AxiosPromise<CwProjectAuditorVO[]> {
|
|
return request({
|
|
url: '/cw/projectAuditor/options',
|
|
method: 'get'
|
|
});
|
|
}
|
|
|
|
/**
|
|
* 批量启用
|
|
*/
|
|
export function enableAuditors(ids: Array<string | number>): AxiosPromise<void> {
|
|
return request({
|
|
url: '/cw/projectAuditor/enable/' + ids.join(','),
|
|
method: 'put'
|
|
});
|
|
}
|
|
|
|
/**
|
|
* 批量停用
|
|
*/
|
|
export function disableAuditors(ids: Array<string | number>): AxiosPromise<void> {
|
|
return request({
|
|
url: '/cw/projectAuditor/disable/' + ids.join(','),
|
|
method: 'put'
|
|
});
|
|
}
|
|
|
|
/**
|
|
* 导出项目审核人配置
|
|
*/
|
|
export function exportProjectAuditor(query: CwProjectAuditorQuery): AxiosPromise<void> {
|
|
return request({
|
|
url: '/cw/projectAuditor/export',
|
|
method: 'post',
|
|
data: query,
|
|
responseType: 'blob'
|
|
});
|
|
}
|
|
|
|
/**
|
|
* 获取审核人统计数据
|
|
*/
|
|
export function getAuditorStatistics(): AxiosPromise<any> {
|
|
return request({
|
|
url: '/cw/projectAuditor/statistics',
|
|
method: 'get'
|
|
});
|
|
}
|