5 天以前 91c82965b2d987452ca276e3a03b48c8dcda2ae9
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
import type { PageParam, PageResult } from '#/packages/effects/request/src';
 
import { requestClient } from '#/api/request';
 
export namespace HrmEmployeeContractApi {
  /** 员工合同 */
  export interface EmployeeContract {
    id?: number;
    /** 续签上一份合同ID */
    parentId?: number;
    /** 续签上一份合同编号 */
    parentNo?: string;
    /** 是否当前生效合同 */
    isCurrent?: boolean;
    /** 合同编号(后端自动生成) */
    contractNo?: string;
    /** 员工ID */
    employeeId?: number;
    /** 员工姓名 */
    employeeName?: string;
    /** 员工工号 */
    employeeNo?: string;
    /** 部门名称 */
    deptName?: string;
    /** 合同类型:1-劳动合同 2-劳务合同 3-实习协议 4-劳务派遣 5-其他 */
    contractType?: number;
    /** 合同期限类型:1-固定期限 2-无固定期限 3-以完成一定工作任务为期限 */
    contractTermType?: number;
    /** 签约主体 */
    signCompany?: string;
    /** 签订日期 */
    signDate?: string;
    /** 合同开始日期 */
    startDate?: string;
    /** 合同结束日期 */
    endDate?: string;
    /** 试用期开始日期 */
    probationStartDate?: string;
    /** 试用期结束日期 */
    probationEndDate?: string;
    /** 试用期工资 */
    probationSalary?: number;
    /** 转正工资 */
    regularSalary?: number;
    /** 解除终止状态:0-正常 1-已解除 2-已终止 */
    terminateStatus?: number;
    /** 解除/终止日期 */
    terminateDate?: string;
    /** 解除/终止原因 */
    terminateReason?: string;
    /** 合同状态(动态计算):1-待生效 2-生效中 3-即将到期 4-已到期 5-已解除 6-已终止 */
    status?: number;
    /** 附件 */
    attachmentList?: AttachmentItem[];
    /** 附件 blobId 列表 */
    blobIds?: number[];
    remark?: string;
    createTime?: string;
  }
 
  /** 附件项 */
  export interface AttachmentItem {
    id: number;
    name?: string;
    url?: string;
    uid?: string;
  }
 
  /** 员工合同查询参数 */
  export interface EmployeeContractPageParam extends PageParam {
    contractNo?: string;
    employeeId?: number;
    contractType?: number;
    contractTermType?: number;
    terminateStatus?: number;
    status?: number;
    /** 到期类型:1-即将到期 2-已到期 */
    expiryType?: number;
  }
 
  /** 解除/终止合同请求 */
  export interface TerminateReq {
    id: number;
    terminateStatus: number;
    terminateDate: string;
    terminateReason: string;
  }
}
 
/** 获取员工合同分页列表 */
export function getEmployeeContractPage(
  params: HrmEmployeeContractApi.EmployeeContractPageParam,
) {
  return requestClient.get<PageResult<HrmEmployeeContractApi.EmployeeContract>>(
    '/hrm/employee-contract/page',
    { params },
  );
}
 
/** 获取员工合同详情 */
export function getEmployeeContract(id: number) {
  return requestClient.get<HrmEmployeeContractApi.EmployeeContract>(
    `/hrm/employee-contract/get?id=${id}`,
  );
}
 
/** 创建员工合同 */
export function createEmployeeContract(data: HrmEmployeeContractApi.EmployeeContract) {
  return requestClient.post('/hrm/employee-contract/create', data);
}
 
/** 更新员工合同 */
export function updateEmployeeContract(data: HrmEmployeeContractApi.EmployeeContract) {
  return requestClient.put('/hrm/employee-contract/update', data);
}
 
/** 解除/终止员工合同 */
export function terminateEmployeeContract(data: HrmEmployeeContractApi.TerminateReq) {
  return requestClient.put('/hrm/employee-contract/terminate', data);
}
 
/** 删除员工合同 */
export function deleteEmployeeContract(id: number) {
  return requestClient.delete(`/hrm/employee-contract/delete?id=${id}`);
}
 
/** 获取即将到期合同数量 */
export function getExpiringContractCount() {
  return requestClient.get<number>('/hrm/employee-contract/expiring-count');
}