feat: 完成23项系统优化 - 花名册社保状态列/身份证复制/附件类型扩展, 用工办理姓名检索/直接提交/文书查看/批量证明, 风险中心跳转筛选+批量处理, 日历7/15/35天分组+逾期统计, 考勤单条编辑+按人导出, 工资条查看状态+工资流水导出, 辞职申请附件上传, 交接清单PDF下载, 操作完成下一步引导, 休假审批入口, 人效成本分部门
This commit is contained in:
@@ -115,7 +115,11 @@ router.get('/payslip', portalAuth, async (req: any, res, next) => {
|
||||
if (!payslip) {
|
||||
return res.json({ success: true, data: null })
|
||||
}
|
||||
res.json({ success: true, data: payslip })
|
||||
// 记录查看时间
|
||||
if (!payslip.viewedAt) {
|
||||
await prisma.payslip.update({ where: { id: payslip.id }, data: { viewedAt: new Date() } })
|
||||
}
|
||||
res.json({ success: true, data: { ...payslip, viewedAt: payslip.viewedAt || new Date() } })
|
||||
} catch (err) {
|
||||
next(err)
|
||||
}
|
||||
@@ -773,7 +777,7 @@ router.get('/onboarding/progress', portalAuth, async (req: any, res, next) => {
|
||||
router.post('/resignation/submit', portalAuth, async (req: any, res, next) => {
|
||||
try {
|
||||
const { id: employeeId, orgId } = req.employee
|
||||
const { reason, expectedDate, remark } = req.body
|
||||
const { reason, expectedDate, remark, attachments } = req.body
|
||||
if (!reason || !expectedDate) {
|
||||
return res.status(400).json({ success: false, error: { code: 'BAD_REQUEST', message: '请填写离职原因和预计离职日期' } })
|
||||
}
|
||||
@@ -789,6 +793,7 @@ router.post('/resignation/submit', portalAuth, async (req: any, res, next) => {
|
||||
if (existing) {
|
||||
return res.status(400).json({ success: false, error: { code: 'DUPLICATE', message: '您已有一个待处理的离职申请' } })
|
||||
}
|
||||
const remarkText = `员工自主申请:${reason}${remark ? ';备注:' + remark : ''}${attachments && attachments.length > 0 ? `;附件:${attachments.length}张辞职信照片` : ''}`
|
||||
const record = await (prisma as any).terminationRecord.create({
|
||||
data: {
|
||||
employeeId, orgId,
|
||||
@@ -797,8 +802,8 @@ router.post('/resignation/submit', portalAuth, async (req: any, res, next) => {
|
||||
resignationReason: reason,
|
||||
terminationDate: new Date(expectedDate),
|
||||
status: 'PENDING_APPROVAL',
|
||||
checklist: [],
|
||||
remark: `员工自主申请:${reason}${remark ? ';备注:' + remark : ''}`,
|
||||
checklist: attachments && attachments.length > 0 ? attachments : [],
|
||||
remark: remarkText,
|
||||
createdBy: employeeId,
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user