fix: 身份证号必填+去重+报告按姓名兜底

- 后端 createEmployeeSchema 加 idCardNumber 必填18位校验
- 后端 updateEmployeeSchema 加 idCardNumber 可选编辑
- updateEmployee 支持编辑身份证号,自动生成 hash/生日/性别
- Excel 导入时身份证号必填,为空跳过
- 年度价值报告去重 key 改为 idCardHash > name > employeeId 兜底
This commit is contained in:
selfrelease
2026-07-31 09:24:44 +08:00
parent 57587dd5ed
commit f5a03f82bc
4 changed files with 15 additions and 2 deletions
+2
View File
@@ -5,6 +5,7 @@ export const createEmployeeSchema = z.object({
department: z.string().min(1, '部门不能为空').max(50, '部门最多50个字'),
hireDate: z.string().datetime(),
monthlySalary: z.string().min(1, '月薪不能为空'),
idCardNumber: z.string().min(18, '身份证号不能为空且必须18位').max(18, '身份证号必须18位'),
gender: z.enum(['男', '女']).optional(),
femaleWorkerType: z.enum(['CADRE', 'WORKER']).optional(),
phone: z.string().regex(/^1[3-9]\d{9}$/).optional(),
@@ -30,6 +31,7 @@ export const updateEmployeeSchema = z.object({
department: z.string().min(1).max(50).optional(),
hireDate: z.string().datetime().optional(),
monthlySalary: z.string().min(1).optional(),
idCardNumber: z.string().min(18).max(18).optional(),
gender: z.enum(['男', '女']).optional(),
femaleWorkerType: z.enum(['CADRE', 'WORKER']).optional(),
phone: z.string().regex(/^1[3-9]\d{9}$/).optional(),