| | |
| | | userId?: number; |
| | | deptId?: number; |
| | | deptName?: string; |
| | | postId?: number; |
| | | postName?: string; |
| | | postIds?: number[]; |
| | | postNames?: string; |
| | | employeeNo?: string; |
| | | name?: string; |
| | | gender?: number; |
| | |
| | | phone?: string; |
| | | email?: string; |
| | | idCard?: string; |
| | | nation?: string; |
| | | marriageStatus?: string; |
| | | age?: number; |
| | | education?: string; |
| | | politicalStatus?: string; |
| | | hireDate?: string; |
| | | regularDate?: string; |
| | | leaveDate?: string; |
| | | employeeStatus?: number; |
| | | /** 员工类别:1-普通员工,2-技工,3-管理 */ |
| | | employeeCategory?: number; |
| | | annualLeaveBalance?: number; |
| | | sickLeaveBalance?: number; |
| | | salaryStructureId?: number; |
| | | baseSalary?: number; |
| | | roleIds?: number[]; |
| | | roleNames?: string[]; |
| | |
| | | workHistories?: WorkHistory[]; |
| | | /** 紧急联系人列表 */ |
| | | emergencyContacts?: EmergencyContact[]; |
| | | /** 附件 blobId 列表(保存时传入) */ |
| | | blobIds?: number[]; |
| | | /** 附件列表(详情时返回) */ |
| | | attachmentList?: { id: number; name?: string; url?: string }[]; |
| | | } |
| | | |
| | | /** 教育经历 */ |
| | |
| | | name: string; |
| | | deptName?: string; |
| | | postName?: string; |
| | | } |
| | | |
| | | /** 员工导入结果 */ |
| | | export interface ImportResult { |
| | | /** 创建成功的员工名数组 */ |
| | | createNames?: string[]; |
| | | /** 更新成功的员工名数组 */ |
| | | updateNames?: string[]; |
| | | /** 导入失败集合,key 为员工名,value 为失败原因 */ |
| | | failureNames?: Record<string, string>; |
| | | } |
| | | } |
| | | |
| | |
| | | return requestClient.download('/hrm/employee/export-excel', { params }); |
| | | } |
| | | |
| | | /** 下载员工导入模板 */ |
| | | export function importEmployeeTemplate() { |
| | | return requestClient.download('/hrm/employee/import-template'); |
| | | } |
| | | |
| | | /** 导入员工 */ |
| | | export function importEmployee(file: File, updateSupport: boolean) { |
| | | return requestClient.upload<HrmEmployeeApi.ImportResult>( |
| | | '/hrm/employee/import', |
| | | { file, updateSupport }, |
| | | ); |
| | | } |
| | | |
| | | /** 删除教育经历 */ |
| | | export function deleteEducation(id: number) { |
| | | return requestClient.delete(`/hrm/employee/education/delete?id=${id}`); |
| | |
| | | /** 删除紧急联系人 */ |
| | | export function deleteEmergencyContact(id: number) { |
| | | return requestClient.delete(`/hrm/employee/emergency-contact/delete?id=${id}`); |
| | | } |
| | | } |
| | | |
| | | /** 员工转正(仅劳动合同可转正) */ |
| | | export function regularizeEmployee(id: number) { |
| | | return requestClient.put(`/hrm/employee/regular?id=${id}`); |
| | | } |
| | | |
| | | /** 待转正提醒列表(试用中、劳动合同、试用期即将到期) */ |
| | | export function getRegularizeReminders(days = 7) { |
| | | return requestClient.get<HrmEmployeeApi.Employee[]>( |
| | | `/hrm/employee/regularize-reminders?days=${days}`, |
| | | ); |
| | | } |