import type { PageParam, PageResult } from '#/packages/effects/request/src';
|
|
import { requestClient } from '#/api/request';
|
|
export namespace HrmEmployeeApi {
|
/** 员工信息 */
|
export interface Employee {
|
id?: number;
|
userId?: number;
|
deptId?: number;
|
deptName?: string;
|
postId?: number;
|
postName?: string;
|
employeeNo?: string;
|
name?: string;
|
gender?: number;
|
birthday?: string;
|
phone?: string;
|
email?: string;
|
idCard?: string;
|
hireDate?: string;
|
regularDate?: string;
|
leaveDate?: string;
|
employeeStatus?: number;
|
annualLeaveBalance?: number;
|
sickLeaveBalance?: number;
|
baseSalary?: number;
|
roleIds?: number[];
|
roleNames?: string[];
|
bankName?: string;
|
bankAccount?: string;
|
address?: string;
|
remark?: string;
|
createTime?: string;
|
/** 教育经历列表 */
|
educations?: Education[];
|
/** 工作经历列表 */
|
workHistories?: WorkHistory[];
|
/** 紧急联系人列表 */
|
emergencyContacts?: EmergencyContact[];
|
}
|
|
/** 教育经历 */
|
export interface Education {
|
id?: number;
|
employeeId?: number;
|
schoolName?: string;
|
major?: string;
|
degree?: number;
|
startDate?: string;
|
endDate?: string;
|
certificateNo?: string;
|
}
|
|
/** 工作经历 */
|
export interface WorkHistory {
|
id?: number;
|
employeeId?: number;
|
companyName?: string;
|
position?: string;
|
startDate?: string;
|
endDate?: string;
|
workContent?: string;
|
leaveReason?: string;
|
}
|
|
/** 紧急联系人 */
|
export interface EmergencyContact {
|
id?: number;
|
employeeId?: number;
|
contactName?: string;
|
relationship?: string;
|
phone?: string;
|
address?: string;
|
}
|
|
/** 员工精简信息 */
|
export interface EmployeeSimple {
|
id: number;
|
employeeNo: string;
|
name: string;
|
deptName?: string;
|
postName?: string;
|
}
|
}
|
|
/** 查询员工分页列表 */
|
export function getEmployeePage(params: PageParam) {
|
return requestClient.get<PageResult<HrmEmployeeApi.Employee>>(
|
'/hrm/employee/page',
|
{ params },
|
);
|
}
|
|
/** 查询员工详情 */
|
export function getEmployee(id: number) {
|
return requestClient.get<HrmEmployeeApi.Employee>(
|
`/hrm/employee/get?id=${id}`,
|
);
|
}
|
|
/** 查询员工精简列表 */
|
export function getEmployeeSimpleList() {
|
return requestClient.get<HrmEmployeeApi.EmployeeSimple[]>(
|
'/hrm/employee/simple-list',
|
);
|
}
|
|
/** 新增员工 */
|
export function createEmployee(data: HrmEmployeeApi.Employee) {
|
return requestClient.post('/hrm/employee/create', data);
|
}
|
|
/** 更新员工 */
|
export function updateEmployee(data: HrmEmployeeApi.Employee) {
|
return requestClient.put('/hrm/employee/update', data);
|
}
|
|
/** 删除员工 */
|
export function deleteEmployee(id: number) {
|
return requestClient.delete(`/hrm/employee/delete?id=${id}`);
|
}
|
|
/** 导出员工 */
|
export function exportEmployee(params: any) {
|
return requestClient.download('/hrm/employee/export-excel', { params });
|
}
|
|
/** 删除教育经历 */
|
export function deleteEducation(id: number) {
|
return requestClient.delete(`/hrm/employee/education/delete?id=${id}`);
|
}
|
|
/** 删除工作经历 */
|
export function deleteWorkHistory(id: number) {
|
return requestClient.delete(`/hrm/employee/work-history/delete?id=${id}`);
|
}
|
|
/** 删除紧急联系人 */
|
export function deleteEmergencyContact(id: number) {
|
return requestClient.delete(`/hrm/employee/emergency-contact/delete?id=${id}`);
|
}
|