2025-09-10 01:11:46 +08:00
|
|
|
|
import request from '@/utils/request';
|
2025-05-21 11:24:53 +08:00
|
|
|
|
import { AxiosPromise } from 'axios';
|
|
|
|
|
import {
|
|
|
|
|
ConstructionUserForm,
|
|
|
|
|
ConstructionUserQuery,
|
|
|
|
|
ConstructionUserVO,
|
|
|
|
|
skipType,
|
|
|
|
|
ConstructionUserStatusForm,
|
|
|
|
|
ConstructionUserPlayCardForm,
|
|
|
|
|
ConstructionUserSalaryForm,
|
|
|
|
|
ConstructionUserExitForm,
|
|
|
|
|
ConstructionUserTemplateForm,
|
|
|
|
|
ConstructionUserMembeForm,
|
|
|
|
|
ConstructionMonthQuery
|
|
|
|
|
} from '@/api/project/constructionUser/types';
|
|
|
|
|
import { AttendanceMonthVO } from '../attendance/types';
|
2025-09-04 11:06:45 +08:00
|
|
|
|
import requestGo from '@/utils/request-go';
|
2025-05-21 11:24:53 +08:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询施工人员月份考勤列表
|
|
|
|
|
* @param query
|
|
|
|
|
* @returns {*}
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
export const listConstructionMonth = (query?: ConstructionMonthQuery): AxiosPromise<AttendanceMonthVO[]> => {
|
2025-09-10 01:11:46 +08:00
|
|
|
|
return requestGo({
|
2025-09-04 11:06:45 +08:00
|
|
|
|
url: '/zm/api/wxApplet/wxApplet/busAttendance/byOpenId',
|
2025-05-21 11:24:53 +08:00
|
|
|
|
method: 'get',
|
|
|
|
|
params: query
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
/**
|
|
|
|
|
* 查询施工人员列表
|
|
|
|
|
* @param query
|
|
|
|
|
* @returns {*}
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
export const listConstructionUser = (query?: ConstructionUserQuery): AxiosPromise<ConstructionUserVO[]> => {
|
2025-09-04 11:06:45 +08:00
|
|
|
|
return requestGo({
|
|
|
|
|
url: '/zm/api/wxApplet/wxApplet/busConstructionUser/personnelInquiry',
|
|
|
|
|
method: 'get',
|
|
|
|
|
params: query
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询施工人员列表
|
|
|
|
|
* @param query
|
|
|
|
|
* @returns {*}
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
export const listConstructionUserInTeam = (query?: ConstructionUserQuery): AxiosPromise<ConstructionUserVO[]> => {
|
|
|
|
|
return requestGo({
|
|
|
|
|
url: '/zm/api/wxApplet/wxApplet/busConstructionUser/list',
|
2025-05-21 11:24:53 +08:00
|
|
|
|
method: 'get',
|
|
|
|
|
params: query
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询施工人员详细
|
|
|
|
|
* @param id
|
|
|
|
|
*/
|
|
|
|
|
export const getConstructionUser = (id: string | number): AxiosPromise<ConstructionUserVO> => {
|
2025-09-10 01:11:46 +08:00
|
|
|
|
return requestGo({
|
2025-09-04 11:06:45 +08:00
|
|
|
|
url: '/zm/api/wxApplet/wxApplet/busConstructionUser/getDetails?id=' + id,
|
2025-05-21 11:24:53 +08:00
|
|
|
|
method: 'get'
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 人员迁移
|
|
|
|
|
* @param data
|
|
|
|
|
*/
|
|
|
|
|
export const transferConstructionUser = (data: skipType) => {
|
2025-09-10 01:11:46 +08:00
|
|
|
|
return requestGo({
|
2025-09-04 11:06:45 +08:00
|
|
|
|
url: '/zm/api/wxApplet/wxApplet/busConstructionUser/changePay',
|
2025-05-21 11:24:53 +08:00
|
|
|
|
method: 'put',
|
|
|
|
|
data: data
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询项目以及项目下的分包公司列表
|
|
|
|
|
*/
|
|
|
|
|
export const getProjectContractorList = () => {
|
2025-09-10 01:11:46 +08:00
|
|
|
|
return requestGo({
|
2025-09-04 11:06:45 +08:00
|
|
|
|
url: '/zm/api/v1/system/sysProject/list?pageNum=1&pageSize=1000',
|
2025-05-21 11:24:53 +08:00
|
|
|
|
method: 'get'
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 新增施工人员
|
|
|
|
|
* @param data
|
|
|
|
|
*/
|
|
|
|
|
export const addConstructionUser = (data: ConstructionUserForm): AxiosPromise<string | number> => {
|
2025-09-10 01:11:46 +08:00
|
|
|
|
return requestGo({
|
2025-09-04 11:06:45 +08:00
|
|
|
|
url: '/zm/api/wxApplet/wxApplet/busConstructionUser/add',
|
2025-05-21 11:24:53 +08:00
|
|
|
|
method: 'post',
|
|
|
|
|
data: data
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 修改施工人员
|
|
|
|
|
* @param data
|
|
|
|
|
*/
|
|
|
|
|
export const updateConstructionUser = (data: ConstructionUserForm) => {
|
2025-09-10 01:11:46 +08:00
|
|
|
|
return requestGo({
|
2025-09-04 11:06:45 +08:00
|
|
|
|
url: '/zm/api/v1/system/busConstructionUser/pcEdit',
|
2025-05-21 11:24:53 +08:00
|
|
|
|
method: 'put',
|
|
|
|
|
data: data
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 删除施工人员
|
|
|
|
|
* @param id
|
|
|
|
|
*/
|
2025-09-04 11:06:45 +08:00
|
|
|
|
export const delConstructionUser = (data) => {
|
2025-09-10 01:11:46 +08:00
|
|
|
|
return requestGo({
|
2025-09-04 11:06:45 +08:00
|
|
|
|
url: '/zm/api/wxApplet/wxApplet/busConstructionUser/delete',
|
|
|
|
|
method: 'delete',
|
|
|
|
|
data
|
2025-05-21 11:24:53 +08:00
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 修改施工人员在职状态
|
|
|
|
|
* @param data
|
|
|
|
|
*/
|
|
|
|
|
export const updateConstructionUserStatus = (data: ConstructionUserStatusForm) => {
|
2025-09-10 01:11:46 +08:00
|
|
|
|
return requestGo({
|
2025-09-04 11:06:45 +08:00
|
|
|
|
url: '/zm/api/wxApplet/wxApplet/busConstructionUser/changeState',
|
|
|
|
|
method: 'delete',
|
2025-05-21 11:24:53 +08:00
|
|
|
|
data: data
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 根据项目id批量修改施工人员打卡状态
|
|
|
|
|
* @param data
|
|
|
|
|
*/
|
|
|
|
|
export const updateConstructionUserPlayCardStatus = (data: ConstructionUserPlayCardForm) => {
|
2025-09-10 01:11:46 +08:00
|
|
|
|
return requestGo({
|
2025-09-04 11:06:45 +08:00
|
|
|
|
url: '/zm/api/v1/system/busConstructionUser/oneClickOpen',
|
2025-05-21 11:24:53 +08:00
|
|
|
|
method: 'put',
|
|
|
|
|
data: data
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 修改施工人员打卡状态
|
|
|
|
|
* @param data
|
|
|
|
|
*/
|
|
|
|
|
export const updateConstructionUserPlayCardOneStatus = (data: ConstructionUserPlayCardForm) => {
|
2025-09-10 01:11:46 +08:00
|
|
|
|
return requestGo({
|
2025-09-04 11:06:45 +08:00
|
|
|
|
url: '/zm/api/v1/system/busConstructionUser/clockingCondition',
|
2025-05-21 11:24:53 +08:00
|
|
|
|
method: 'put',
|
|
|
|
|
data: data
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 修改施工人员工资
|
|
|
|
|
* @param data
|
|
|
|
|
*/
|
|
|
|
|
export const updateConstructionUserSalary = (data: ConstructionUserSalaryForm) => {
|
2025-09-10 01:11:46 +08:00
|
|
|
|
return requestGo({
|
2025-09-04 11:06:45 +08:00
|
|
|
|
url: '/zm/api/wxApplet/wxApplet/busConstructionUser/payEdit',
|
2025-05-21 11:24:53 +08:00
|
|
|
|
method: 'put',
|
|
|
|
|
data: data
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询施工人员入退场记录
|
|
|
|
|
* @param query
|
|
|
|
|
*/
|
|
|
|
|
export const getConstructionUserExit = (query: ConstructionUserExitForm) => {
|
2025-09-10 01:11:46 +08:00
|
|
|
|
return requestGo({
|
2025-09-04 11:06:45 +08:00
|
|
|
|
url: '/zm/api/v1/system/busConstructionUser/departureRecord',
|
|
|
|
|
method: 'post',
|
|
|
|
|
data: query
|
2025-05-21 11:24:53 +08:00
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 下载施工人员文件存储模板
|
|
|
|
|
* @param query
|
|
|
|
|
*/
|
|
|
|
|
export const dowloadConstructionUserTemplate = (query: ConstructionUserTemplateForm) => {
|
2025-09-10 01:11:46 +08:00
|
|
|
|
return requestGo({
|
2025-09-04 11:06:45 +08:00
|
|
|
|
url: '/zm/api/v1/system/busConstructionUser/templateExport',
|
|
|
|
|
method: 'get',
|
|
|
|
|
params: query
|
|
|
|
|
});
|
2025-05-21 11:24:53 +08:00
|
|
|
|
};
|
2025-09-04 11:06:45 +08:00
|
|
|
|
// export const dowloadConstructionUserTemplate = (query: ConstructionUserTemplateForm) => {
|
|
|
|
|
// let { projectId } = query;
|
|
|
|
|
// const fileName = projectId + '_project.zip';
|
|
|
|
|
// return request.download('/zm/api/v1/system/busConstructionUser/templateExport', query, fileName, 'get');
|
|
|
|
|
// };
|
2025-05-21 11:24:53 +08:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 施工人员退场
|
|
|
|
|
* @param data
|
|
|
|
|
*/
|
|
|
|
|
export const delConstructionUserMember = (data: ConstructionUserMembeForm) => {
|
2025-09-10 01:11:46 +08:00
|
|
|
|
return requestGo({
|
2025-07-30 16:25:45 +08:00
|
|
|
|
url: '/zm/api/v1/system/busConstructionUser/departure',
|
|
|
|
|
method: 'post',
|
2025-05-21 11:24:53 +08:00
|
|
|
|
data
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 上传施工人员文件压缩包,批量导入存储施工人员文件
|
|
|
|
|
* @param data
|
|
|
|
|
*/
|
|
|
|
|
export const importConstructionUserInfo = (file: string) => {
|
|
|
|
|
return request({
|
2025-07-18 19:22:36 +08:00
|
|
|
|
url: '/contractor/constructionUserFile/upload/zip',
|
2025-05-21 11:24:53 +08:00
|
|
|
|
method: 'post',
|
|
|
|
|
data: { file }
|
|
|
|
|
});
|
|
|
|
|
};
|
2025-09-05 21:36:48 +08:00
|
|
|
|
|
|
|
|
|
// 获取项目列表
|
|
|
|
|
export const ProjectList = (query) => {
|
|
|
|
|
return request({
|
|
|
|
|
url: '/contractor/constructionUser/projectList',
|
|
|
|
|
method: 'get',
|
|
|
|
|
params: query
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 获取班组列表
|
|
|
|
|
export const TeamList = (query) => {
|
2025-09-09 09:08:34 +08:00
|
|
|
|
return request({
|
2025-09-05 21:36:48 +08:00
|
|
|
|
url: '/contractor/constructionUser/teamList',
|
|
|
|
|
method: 'get',
|
|
|
|
|
params: query
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 班组分配
|
|
|
|
|
export const TeamDistribution = (data) => {
|
|
|
|
|
return request({
|
|
|
|
|
url: '/contractor/constructionUser/addTeam',
|
|
|
|
|
method: 'post',
|
|
|
|
|
data: data
|
|
|
|
|
});
|
2025-09-09 09:08:34 +08:00
|
|
|
|
};
|