feat: 个人资料补充工号、女性岗位类型、专项附加扣除字段

- 后端 GET /profile 返回 employeeNo/femaleWorkerType/specialDeduction
- 后端 PUT /profile 支持更新 specialDeduction(员工自行填报)
- 前端只读区补充:工号、女性岗位类型(仅女性显示)
- 前端可编辑区补充:专项附加扣除(元/月)
This commit is contained in:
freedakgmail
2026-08-17 19:09:28 +08:00
parent 4eb882b1e2
commit 88b0fcdc7d
2 changed files with 27 additions and 5 deletions
+8
View File
@@ -922,6 +922,9 @@ router.get('/profile', portalAuth, async (req: any, res, next) => {
education: emp.education || '',
city: emp.city || '',
birthDate,
employeeNo: emp.employeeNo || '',
femaleWorkerType: emp.femaleWorkerType || '',
specialDeduction: emp.specialDeduction ?? 0,
},
})
} catch (err) { next(err) }
@@ -937,6 +940,7 @@ router.put('/profile', portalAuth, async (req: any, res, next) => {
const {
emergencyContact, emergencyPhone, address,
bankAccount, bankName, education, city,
specialDeduction,
} = req.body
// 构建更新数据(仅允许员工自行编辑的字段)
@@ -951,6 +955,10 @@ router.put('/profile', portalAuth, async (req: any, res, next) => {
if (bankAccount !== undefined && bankAccount) {
updateData.bankAccount = encrypt(bankAccount)
}
// 专项附加扣除(子女教育、赡养老人等,员工自行填报)
if (specialDeduction !== undefined) {
updateData.specialDeduction = Number(specialDeduction) || 0
}
await prisma.employee.update({ where: { id: employeeId }, data: updateData })