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:
@@ -1,6 +1,7 @@
|
||||
import prisma from '../lib/prisma'
|
||||
import { RiskAssessment, TerminationReason } from '@prisma/client'
|
||||
import { autoCreateEsignRecord } from './esign.service'
|
||||
import { decrypt } from '../lib/crypto'
|
||||
|
||||
function dateToMonth(date: Date): string {
|
||||
const y = date.getFullYear()
|
||||
@@ -400,6 +401,7 @@ export function calculateCompensation(hireDate: Date, leaveDate: Date, monthlyWa
|
||||
export interface BatchTerminatePreview {
|
||||
employeeId: string
|
||||
employeeName: string
|
||||
employeeIdCardNumber: string | null
|
||||
department: string
|
||||
reason: string
|
||||
terminationDate: string
|
||||
@@ -423,6 +425,7 @@ export async function batchTerminatePreview(
|
||||
results.push({
|
||||
employeeId: item.employeeId,
|
||||
employeeName: '(未找到)',
|
||||
employeeIdCardNumber: null,
|
||||
department: '',
|
||||
reason: item.reason,
|
||||
terminationDate: item.terminationDate,
|
||||
@@ -437,6 +440,7 @@ export async function batchTerminatePreview(
|
||||
results.push({
|
||||
employeeId: item.employeeId,
|
||||
employeeName: employee.name,
|
||||
employeeIdCardNumber: (() => { try { const v = employee.idCardNumber; return v ? (v.includes(':') ? decrypt(v) : v) : null } catch { return null } })(),
|
||||
department: employee.department,
|
||||
reason: item.reason,
|
||||
terminationDate: item.terminationDate,
|
||||
|
||||
Reference in New Issue
Block a user