init:first commit of plus-ui
This commit is contained in:
206
src/api/project/constructionUser/index.ts
Normal file
206
src/api/project/constructionUser/index.ts
Normal file
@ -0,0 +1,206 @@
|
||||
import request, { download } from '@/utils/request';
|
||||
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: '/project/constructionUser/list/attendance/month',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询施工人员列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listConstructionUser = (query?: ConstructionUserQuery): AxiosPromise<ConstructionUserVO[]> => {
|
||||
return request({
|
||||
url: '/project/constructionUser/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询施工人员详细
|
||||
* @param id
|
||||
*/
|
||||
export const getConstructionUser = (id: string | number): AxiosPromise<ConstructionUserVO> => {
|
||||
return request({
|
||||
url: '/project/constructionUser/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 人员迁移
|
||||
* @param data
|
||||
*/
|
||||
export const transferConstructionUser = (data: skipType) => {
|
||||
return request({
|
||||
url: '/project/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: '/project/constructionUser',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改施工人员
|
||||
* @param data
|
||||
*/
|
||||
export const updateConstructionUser = (data: ConstructionUserForm) => {
|
||||
return request({
|
||||
url: '/project/constructionUser',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除施工人员
|
||||
* @param id
|
||||
*/
|
||||
export const delConstructionUser = (id: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/project/constructionUser/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改施工人员在职状态
|
||||
* @param data
|
||||
*/
|
||||
export const updateConstructionUserStatus = (data: ConstructionUserStatusForm) => {
|
||||
return request({
|
||||
url: '/project/constructionUser/batch/status',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 根据项目id批量修改施工人员打卡状态
|
||||
* @param data
|
||||
*/
|
||||
export const updateConstructionUserPlayCardStatus = (data: ConstructionUserPlayCardForm) => {
|
||||
return request({
|
||||
url: '/project/constructionUser/batch/clock',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改施工人员打卡状态
|
||||
* @param data
|
||||
*/
|
||||
export const updateConstructionUserPlayCardOneStatus = (data: ConstructionUserPlayCardForm) => {
|
||||
return request({
|
||||
url: '/project/constructionUser/clock',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改施工人员工资
|
||||
* @param data
|
||||
*/
|
||||
export const updateConstructionUserSalary = (data: ConstructionUserSalaryForm) => {
|
||||
return request({
|
||||
url: '/project/constructionUser/salary',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询施工人员入退场记录
|
||||
* @param query
|
||||
*/
|
||||
export const getConstructionUserExit = (query: ConstructionUserExitForm) => {
|
||||
return request({
|
||||
url: '/project/constructionUserExit/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 下载施工人员文件存储模板
|
||||
* @param query
|
||||
*/
|
||||
export const dowloadConstructionUserTemplate = (query: ConstructionUserTemplateForm) => {
|
||||
let { projectId } = query;
|
||||
const fileName = projectId + '_project.zip';
|
||||
return download('/project/constructionUserFile/exportFileTemplate', query, fileName);
|
||||
};
|
||||
|
||||
/**
|
||||
* 施工人员退场
|
||||
* @param data
|
||||
*/
|
||||
export const delConstructionUserMember = (data: ConstructionUserMembeForm) => {
|
||||
return request({
|
||||
url: '/project/projectTeamMember/',
|
||||
method: 'delete',
|
||||
data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 上传施工人员文件压缩包,批量导入存储施工人员文件
|
||||
* @param data
|
||||
*/
|
||||
export const importConstructionUserInfo = (file: string) => {
|
||||
return request({
|
||||
url: '/project/constructionUserFile/upload/zip',
|
||||
method: 'post',
|
||||
data: { file }
|
||||
});
|
||||
};
|
Reference in New Issue
Block a user