fix: 身份证号必填+去重+报告按姓名兜底
- 后端 createEmployeeSchema 加 idCardNumber 必填18位校验 - 后端 updateEmployeeSchema 加 idCardNumber 可选编辑 - updateEmployee 支持编辑身份证号,自动生成 hash/生日/性别 - Excel 导入时身份证号必填,为空跳过 - 年度价值报告去重 key 改为 idCardHash > name > employeeId 兜底
This commit is contained in:
@@ -260,6 +260,7 @@ router.post('/excel', authMiddleware, requireAdmin, upload.single('file'), async
|
||||
if (salary === '0') { result.skipped++; result.errors.push(`员工第${i + 2}行:月工资为空`); result.details.push({ sheet: '员工信息', row: i + 2, name, status: 'skipped', message: '月工资为空' }); continue }
|
||||
|
||||
let idCard = val(getField(r, '身份证号'))
|
||||
if (!idCard) { result.skipped++; result.errors.push(`员工第${i + 2}行:身份证号为空,跳过`); result.details.push({ sheet: '员工信息', row: i + 2, name, status: 'skipped', message: '身份证号为空' }); continue }
|
||||
if (idCard) {
|
||||
const idCheck = validateIdCard(idCard)
|
||||
if (!idCheck.valid) { result.skipped++; result.errors.push(`员工第${i + 2}行:${idCheck.error}`); result.details.push({ sheet: '员工信息', row: i + 2, name, status: 'skipped', message: idCheck.error }); continue }
|
||||
|
||||
Reference in New Issue
Block a user