206 lines
4.5 KiB
TypeScript
206 lines
4.5 KiB
TypeScript
import request from '@/utils/request-go';
|
|
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';
|
|
|
|
/**
|
|
* 查询施工人员月份考勤列表
|
|
* @param query
|
|
* @returns {*}
|
|
*/
|
|
|
|
export const listConstructionMonth = (query?: ConstructionMonthQuery): AxiosPromise<AttendanceMonthVO[]> => {
|
|
return request({
|
|
url: '/contractor/constructionUser/list/attendance/month',
|
|
method: 'get',
|
|
params: query
|
|
});
|
|
};
|
|
/**
|
|
* 查询施工人员列表
|
|
* @param query
|
|
* @returns {*}
|
|
*/
|
|
|
|
export const listConstructionUser = (query?: ConstructionUserQuery): AxiosPromise<ConstructionUserVO[]> => {
|
|
return request({
|
|
url: '/contractor/constructionUser/list',
|
|
method: 'get',
|
|
params: query
|
|
});
|
|
};
|
|
|
|
/**
|
|
* 查询施工人员详细
|
|
* @param id
|
|
*/
|
|
export const getConstructionUser = (id: string | number): AxiosPromise<ConstructionUserVO> => {
|
|
return request({
|
|
url: '/contractor/constructionUser/' + id,
|
|
method: 'get'
|
|
});
|
|
};
|
|
|
|
/**
|
|
* 人员迁移
|
|
* @param data
|
|
*/
|
|
export const transferConstructionUser = (data: skipType) => {
|
|
return request({
|
|
url: '/contractor/constructionUser/change/project',
|
|
method: 'put',
|
|
data: data
|
|
});
|
|
};
|
|
|
|
/**
|
|
* 查询项目以及项目下的分包公司列表
|
|
*/
|
|
export const getProjectContractorList = () => {
|
|
return request({
|
|
url: '/project/project/list/project/contractorList',
|
|
method: 'get'
|
|
});
|
|
};
|
|
|
|
/**
|
|
* 新增施工人员
|
|
* @param data
|
|
*/
|
|
export const addConstructionUser = (data: ConstructionUserForm): AxiosPromise<string | number> => {
|
|
return request({
|
|
url: '/contractor/constructionUser',
|
|
method: 'post',
|
|
data: data
|
|
});
|
|
};
|
|
|
|
/**
|
|
* 修改施工人员
|
|
* @param data
|
|
*/
|
|
export const updateConstructionUser = (data: ConstructionUserForm) => {
|
|
return request({
|
|
url: '/contractor/constructionUser',
|
|
method: 'put',
|
|
data: data
|
|
});
|
|
};
|
|
|
|
/**
|
|
* 删除施工人员
|
|
* @param id
|
|
*/
|
|
export const delConstructionUser = (id: string | number | Array<string | number>) => {
|
|
return request({
|
|
url: '/contractor/constructionUser/' + id,
|
|
method: 'delete'
|
|
});
|
|
};
|
|
|
|
/**
|
|
* 修改施工人员在职状态
|
|
* @param data
|
|
*/
|
|
export const updateConstructionUserStatus = (data: ConstructionUserStatusForm) => {
|
|
return request({
|
|
url: '/contractor/constructionUser/batch/status',
|
|
method: 'put',
|
|
data: data
|
|
});
|
|
};
|
|
|
|
/**
|
|
* 根据项目id批量修改施工人员打卡状态
|
|
* @param data
|
|
*/
|
|
export const updateConstructionUserPlayCardStatus = (data: ConstructionUserPlayCardForm) => {
|
|
return request({
|
|
url: '/contractor/constructionUser/batch/clock',
|
|
method: 'put',
|
|
data: data
|
|
});
|
|
};
|
|
|
|
/**
|
|
* 修改施工人员打卡状态
|
|
* @param data
|
|
*/
|
|
export const updateConstructionUserPlayCardOneStatus = (data: ConstructionUserPlayCardForm) => {
|
|
return request({
|
|
url: '/contractor/constructionUser/clock',
|
|
method: 'put',
|
|
data: data
|
|
});
|
|
};
|
|
|
|
/**
|
|
* 修改施工人员工资
|
|
* @param data
|
|
*/
|
|
export const updateConstructionUserSalary = (data: ConstructionUserSalaryForm) => {
|
|
return request({
|
|
url: '/contractor/constructionUser/salary',
|
|
method: 'put',
|
|
data: data
|
|
});
|
|
};
|
|
|
|
/**
|
|
* 查询施工人员入退场记录
|
|
* @param query
|
|
*/
|
|
export const getConstructionUserExit = (query: ConstructionUserExitForm) => {
|
|
return request({
|
|
url: '/contractor/constructionUserExit/list',
|
|
method: 'get',
|
|
params: query
|
|
});
|
|
};
|
|
|
|
/**
|
|
* 下载施工人员文件存储模板
|
|
* @param query
|
|
*/
|
|
export const dowloadConstructionUserTemplate = (query: ConstructionUserTemplateForm) => {
|
|
let { projectId } = query;
|
|
const fileName = projectId + '_project.zip';
|
|
return request.download('/contractor/constructionUserFile/exportFileTemplate', query, fileName);
|
|
};
|
|
|
|
/**
|
|
* 施工人员退场
|
|
* @param data
|
|
*/
|
|
export const delConstructionUserMember = (data: ConstructionUserMembeForm) => {
|
|
return request({
|
|
url: '/zm/api/v1/system/busConstructionUser/departure',
|
|
method: 'post',
|
|
data
|
|
});
|
|
};
|
|
|
|
/**
|
|
* 上传施工人员文件压缩包,批量导入存储施工人员文件
|
|
* @param data
|
|
*/
|
|
export const importConstructionUserInfo = (file: string) => {
|
|
return request({
|
|
url: '/contractor/constructionUserFile/upload/zip',
|
|
method: 'post',
|
|
data: { file }
|
|
});
|
|
};
|