feat(attendance): 优化考勤记录导出功能支持部门选择
- 修改后端接口参数名称从 deptname 改为 enames - 实现前端多员工选择下拉框组件 - 添加部门联动员工动态加载功能 - 重构导出逻辑支持按员工列表精确过滤 - 修复数组参数序列化导致的逗号编码问题 - 新增获取部门列表和按部门查询员工的API接口 - 实现导出表单验证和异步处理机制
This commit is contained in:
@@ -63,6 +63,19 @@ export function exportAttendanceReport(params) {
|
||||
url: '/wms/attendanceRecords/exportReport',
|
||||
method: 'post',
|
||||
params: params,
|
||||
responseType: 'blob'
|
||||
responseType: 'blob',
|
||||
// enames 是数组,需要特殊序列化避免逗号被二次编码
|
||||
paramsSerializer: params => {
|
||||
const searchParams = new URLSearchParams();
|
||||
Object.keys(params).forEach(key => {
|
||||
const val = params[key];
|
||||
if (Array.isArray(val)) {
|
||||
searchParams.append(key, val.join(','));
|
||||
} else if (val !== undefined && val !== null && val !== '') {
|
||||
searchParams.append(key, val);
|
||||
}
|
||||
});
|
||||
return searchParams.toString();
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -42,3 +42,20 @@ export function delEmployeeInfo(infoId) {
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 获取所有不重复的部门名称
|
||||
export function getDepts() {
|
||||
return request({
|
||||
url: '/wms/employeeInfo/depts',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 根据部门查询在职员工
|
||||
export function getEmployeesByDept(dept) {
|
||||
return request({
|
||||
url: '/wms/employeeInfo/employeesByDept',
|
||||
method: 'get',
|
||||
params: { dept }
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user