import type { PageParam, PageResult } from '#/packages/effects/request/src';
|
|
import { requestClient } from '#/api/request';
|
|
export namespace HrmOvertimeApi {
|
/** 加班申请 */
|
export interface Overtime {
|
id?: number;
|
employeeId?: number;
|
employeeName?: string;
|
employeeNo?: string;
|
deptName?: string;
|
postName?: string;
|
overtimeDate?: string;
|
startTime?: string;
|
endTime?: string;
|
duration?: number;
|
overtimeType?: number;
|
crossDay?: boolean;
|
mealDeduction?: boolean;
|
mealDeductionHours?: number;
|
reason?: string;
|
relatedType?: number;
|
relatedCode?: string;
|
workContent?: string;
|
status?: number;
|
processInstanceId?: string;
|
createTime?: string;
|
}
|
|
export interface ApproveProcess {
|
key: string;
|
name: string;
|
}
|
}
|
|
/** 查询加班申请分页列表 */
|
export function getOvertimePage(params: PageParam) {
|
return requestClient.get<PageResult<HrmOvertimeApi.Overtime>>(
|
'/hrm/overtime/page',
|
{ params },
|
);
|
}
|
|
/** 查询加班申请详情 */
|
export function getOvertime(id: number) {
|
return requestClient.get<HrmOvertimeApi.Overtime>(
|
`/hrm/overtime/get?id=${id}`,
|
);
|
}
|
|
/** 获取当前申请人关联的员工档案 */
|
export function getCurrentOvertimeApplicant() {
|
return requestClient.get<HrmOvertimeApi.Overtime>('/hrm/overtime/current-applicant');
|
}
|
|
/** 新增加班申请(草稿) */
|
export function createOvertime(data: HrmOvertimeApi.Overtime) {
|
return requestClient.post('/hrm/overtime/create', data);
|
}
|
|
/** 更新加班申请 */
|
export function updateOvertime(data: HrmOvertimeApi.Overtime) {
|
return requestClient.put('/hrm/overtime/update', data);
|
}
|
|
/** 删除加班申请 */
|
export function deleteOvertime(id: number) {
|
return requestClient.delete(`/hrm/overtime/delete?id=${id}`);
|
}
|
|
/** 提交加班申请(发起审批) */
|
export function submitOvertime(id: number, processDefinitionKey: string) {
|
return requestClient.post('/hrm/overtime/submit', null, {
|
params: { id, processDefinitionKey },
|
});
|
}
|
|
/** 撤销加班申请 */
|
export function cancelOvertime(id: number) {
|
return requestClient.post(`/hrm/overtime/cancel?id=${id}`);
|
}
|
|
/** 获取协同办公中的可用加班审批流程 */
|
export function getOvertimeApproveProcessDefinitionList() {
|
return requestClient.get<HrmOvertimeApi.ApproveProcess[]>(
|
'/hrm/overtime/approve-process-definition-list',
|
);
|
}
|