feat: 20260805 系统优化 - 身份证复制fallback/薪税日期筛选/社保版本修复/证据链导出/违纪证明/医疗期政策/绩效类型评级/合同作废/帮助更新
This commit is contained in:
@@ -185,6 +185,24 @@ router.post('/:id/approve', authMiddleware, async (req: AuthRequest, res: Respon
|
||||
}
|
||||
}
|
||||
|
||||
// 离职证明/收入证明审批通过后,如果有关联员工,创建电子签记录
|
||||
if (execResult.employeeId && (process.type === 'LEAVING_CERT' || process.type === 'INCOME_CERT')) {
|
||||
const docTitle = process.type === 'LEAVING_CERT' ? '离职证明签署' : '收入证明签署'
|
||||
await prisma.eSignRecord.create({
|
||||
data: {
|
||||
orgId: req.user!.orgId,
|
||||
employeeId: execResult.employeeId,
|
||||
scene: process.type === 'LEAVING_CERT' ? 'RESIGNATION' : 'OTHER',
|
||||
documentTitle: docTitle,
|
||||
status: 'PENDING',
|
||||
initiatedBy: req.user!.id,
|
||||
createdBy: req.user!.id,
|
||||
remark: '文书审批通过后自动发起',
|
||||
expiredAt: new Date(Date.now() + 30 * 24 * 60 * 60 * 1000),
|
||||
},
|
||||
}).catch(() => {})
|
||||
}
|
||||
|
||||
res.json({ success: true, data: updated })
|
||||
} catch (err) {
|
||||
next(err)
|
||||
|
||||
Reference in New Issue
Block a user