liu
3 天以前 91eff4781fa4142d1f62d30a0fa1de5cae424eaf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import type { PageParam, PageResult } from '#/packages/effects/request/src';
 
import { requestClient } from '#/api/request';
import type { SystemStorageApi } from '#/api/system/storage';
 
export namespace HrmAttendanceExceptionApi {
  /** 考勤异常申请 */
  export interface AttendanceException {
    id?: number;
    userId?: number;
    userName?: string;
    deptName?: string;
    date?: string;
    exceptionType?: number;
    exceptionTypeName?: string;
    reason?: string;
    blobIds?: number[];
    attachmentList?: SystemStorageApi.StorageBlob[];
    status?: number;
    exceptionDate?: string;
    // 以下为审核派生字段,由后端在审核时写入,前端只读展示
    reviewerId?: number; // 审核人ID(实际执行审核的用户)
    reviewerName?: string; // 审核人姓名
    reviewTime?: string; // 审核时间
    reviewRemark?: string; // 审核意见(审核通过时的意见 / 审核不通过时的原因)
    remark?: string;
    createTime?: string;
  }
}
 
/** 查询考勤异常申请分页列表 */
export function getAttendanceExceptionPage(params: PageParam) {
  return requestClient.get<PageResult<HrmAttendanceExceptionApi.AttendanceException>>(
    '/hrm/attendance/exception/page',
    { params },
  );
}
 
/** 查询考勤异常申请详情 */
export function getAttendanceException(id: number) {
  return requestClient.get<HrmAttendanceExceptionApi.AttendanceException>(
    `/hrm/attendance/exception/get?id=${id}`,
  );
}
 
/** 新增考勤异常申请 */
export function createAttendanceException(
  data: HrmAttendanceExceptionApi.AttendanceException,
) {
  return requestClient.post('/hrm/attendance/exception/create', data);
}
 
/**
 * 提交考勤异常申请审批(草稿 / 审核不通过 → 审批中)
 *
 * 审批人由「系统管理 - 审批配置」按业务类型(hrm_attendance_approve)统一配置,提交时无需指定。
 */
export function submitAttendanceException(id: number) {
  return requestClient.put('/hrm/attendance/exception/submit', null, {
    params: { id },
  });
}
 
/** 获得考勤异常申请的审批人编号集合,供列表页判断是否展示审核按钮 */
export function getAttendanceExceptionApproverIds() {
  return requestClient.get<number[]>(
    '/hrm/attendance/exception/approver-ids',
  );
}
 
/**
 * 审核考勤异常申请(审批中 → 审核通过 / 审核不通过)
 *
 * 仅审批配置中的审批人可调用(多人时或签);pass=false 时 reviewRemark(不通过原因)必填。
 */
export function auditAttendanceException(
  id: number,
  pass: boolean,
  reviewRemark?: string,
) {
  return requestClient.put('/hrm/attendance/exception/audit', {
    id,
    pass,
    reviewRemark,
  });
}