fix: 统一风险中心及全应用身份证号显示
后端: - employee.routes.ts: all-lite 接口加上 idCardNumber 并解密 - special-status.routes.ts: 列表和详情查询加上 idCardNumber 并解密 - esign.routes.ts: 列表/pending/detail/remind 接口加上 idCardNumber 并解密 - risk.service.ts: getMonthlyCalendar 所有事件加上 employeeIdCardNumber - termination.service.ts: batchTerminatePreview 加上 employeeIdCardNumber - employee.routes.ts: preview-renew 加上 employeeIdCardNumber 前端: - Roster.tsx: 批量续签/解聘预检结果加上身份证号 - SpecialStatus.tsx: 列表/下拉/删除确认加上身份证号 - Calendar.tsx: 日历事件姓名后显示身份证号 - ESign.tsx: 签署列表/详情/员工列表/提醒弹窗/下拉加上身份证号 - CommercialInsuranceTab.tsx: 参保选择列表加上身份证号 - OvertimeTab.tsx: 导入预览加上身份证号
This commit is contained in:
@@ -1072,6 +1072,7 @@ export async function getMonthlyCalendar(orgId: string, month: string) {
|
||||
type: string
|
||||
title: string
|
||||
employeeName?: string
|
||||
employeeIdCardNumber?: string | null
|
||||
employeeId?: string
|
||||
actionUrl?: string
|
||||
priority: 'high' | 'medium' | 'low'
|
||||
@@ -1091,6 +1092,7 @@ export async function getMonthlyCalendar(orgId: string, month: string) {
|
||||
type: 'CONTRACT_EXPIRY',
|
||||
title: `${c.employee.name} 合同到期`,
|
||||
employeeName: c.employee.name,
|
||||
employeeIdCardNumber: (() => { try { const v = c.employee.idCardNumber; return v ? (v.includes(':') ? decrypt(v) : v) : null } catch { return null } })(),
|
||||
employeeId: c.employeeId,
|
||||
actionUrl: '/contracts',
|
||||
priority: 'high',
|
||||
@@ -1114,6 +1116,7 @@ export async function getMonthlyCalendar(orgId: string, month: string) {
|
||||
type: 'PROBATION_END',
|
||||
title: `${c.employee.name} 试用期到期`,
|
||||
employeeName: c.employee.name,
|
||||
employeeIdCardNumber: (() => { try { const v = c.employee.idCardNumber; return v ? (v.includes(':') ? decrypt(v) : v) : null } catch { return null } })(),
|
||||
employeeId: c.employeeId,
|
||||
actionUrl: '/roster',
|
||||
priority: 'medium',
|
||||
@@ -1136,6 +1139,7 @@ export async function getMonthlyCalendar(orgId: string, month: string) {
|
||||
type: 'TERMINATION',
|
||||
title: `${t.employee.name} 离职/解聘日`,
|
||||
employeeName: t.employee.name,
|
||||
employeeIdCardNumber: (() => { try { const v = t.employee.idCardNumber; return v ? (v.includes(':') ? decrypt(v) : v) : null } catch { return null } })(),
|
||||
employeeId: t.employeeId,
|
||||
actionUrl: '/termination',
|
||||
priority: 'high',
|
||||
@@ -1162,6 +1166,7 @@ export async function getMonthlyCalendar(orgId: string, month: string) {
|
||||
type: 'ANNIVERSARY',
|
||||
title: `${emp.name} 入职${years}周年`,
|
||||
employeeName: emp.name,
|
||||
employeeIdCardNumber: (() => { try { const v = emp.idCardNumber; return v ? (v.includes(':') ? decrypt(v) : v) : null } catch { return null } })(),
|
||||
employeeId: emp.id,
|
||||
actionUrl: '/roster',
|
||||
priority: 'low',
|
||||
@@ -1189,6 +1194,7 @@ export async function getMonthlyCalendar(orgId: string, month: string) {
|
||||
type: 'RISK_DEADLINE',
|
||||
title: `${r.title} 处理截止日`,
|
||||
employeeName: r.employee?.name,
|
||||
employeeIdCardNumber: (() => { try { const v = r.employee?.idCardNumber; return v ? (v.includes(':') ? decrypt(v) : v) : null } catch { return null } })(),
|
||||
employeeId: r.employeeId || undefined,
|
||||
actionUrl: r.actionUrl || '/',
|
||||
priority: r.level === 'HIGH' ? 'high' : 'medium',
|
||||
@@ -1217,6 +1223,7 @@ export async function getMonthlyCalendar(orgId: string, month: string) {
|
||||
type: 'RETIREMENT',
|
||||
title: `${emp.name} 达到法定退休年龄`,
|
||||
employeeName: emp.name,
|
||||
employeeIdCardNumber: (() => { try { const v = emp.idCardNumber; return v ? (v.includes(':') ? decrypt(v) : v) : null } catch { return null } })(),
|
||||
employeeId: emp.id,
|
||||
actionUrl: '/roster',
|
||||
priority: 'high',
|
||||
@@ -1251,7 +1258,7 @@ export async function getMonthlyCalendar(orgId: string, month: string) {
|
||||
orgId,
|
||||
date: { gte: monthStart, lte: monthEnd },
|
||||
},
|
||||
include: { employee: { select: { name: true } } },
|
||||
include: { employee: { select: { name: true, idCardNumber: true } } },
|
||||
})
|
||||
for (const ev of customEvents) {
|
||||
events.push({
|
||||
@@ -1259,6 +1266,7 @@ export async function getMonthlyCalendar(orgId: string, month: string) {
|
||||
type: ev.type,
|
||||
title: ev.title + (ev.employee ? ` — ${ev.employee.name}` : ''),
|
||||
employeeName: ev.employee?.name,
|
||||
employeeIdCardNumber: (() => { try { const v = ev.employee?.idCardNumber; return v ? (v.includes(':') ? decrypt(v) : v) : null } catch { return null } })(),
|
||||
actionUrl: '/dashboard',
|
||||
priority: ev.priority as 'high' | 'medium' | 'low',
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user