feat: 个人资料补充工号、女性岗位类型、专项附加扣除字段
- 后端 GET /profile 返回 employeeNo/femaleWorkerType/specialDeduction - 后端 PUT /profile 支持更新 specialDeduction(员工自行填报) - 前端只读区补充:工号、女性岗位类型(仅女性显示) - 前端可编辑区补充:专项附加扣除(元/月)
This commit is contained in:
@@ -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 })
|
||||
|
||||
|
||||
Reference in New Issue
Block a user