fix: 修复已撤销解聘记录(CANCELLED)在各模块中未正确过滤的问题

- 花名册API新增latestTerminationStatus字段,前端列表/操作按钮/离职日期列过滤CANCELLED/COMPLETED
- 证据链后端过滤CANCELLED状态的解聘记录,不再产生无效证据和风险提醒
- 重新入职判断增加status=COMPLETED条件,避免已撤销记录被误判为已离职
- 薪酬警告过滤CANCELLED状态,不再对已撤销记录触发结算提醒
- 风险扫描查询条件增加status=COMPLETED,避免已撤销记录导致员工被跳过
- 解聘向导canProceed和警告提示过滤CANCELLED/COMPLETED状态
- 档案解聘记录列表过滤CANCELLED状态,新增流程状态标签
- 重新生成Prisma Client以同步femaleWorkerType字段
This commit is contained in:
selfrelease
2026-07-25 20:10:42 +08:00
parent 41a2c665ed
commit 7ca2ada0d4
6 changed files with 20 additions and 12 deletions
+3 -2
View File
@@ -49,6 +49,7 @@ interface RosterEmployee {
department: string
status: string
hasTermination?: boolean
latestTerminationStatus?: string
hireDate: string
monthlySalary: number
latestContract: any
@@ -417,7 +418,7 @@ export default function Termination() {
}, [selectedEmployee, terminationDate, socialAvgWage, reason])
const canProceed = () => {
if (step === 0) return !!employeeId && (!!draftId || !selectedEmployee?.hasTermination)
if (step === 0) return !!employeeId && (!!draftId || !selectedEmployee?.hasTermination || selectedEmployee?.latestTerminationStatus === 'CANCELLED' || selectedEmployee?.latestTerminationStatus === 'COMPLETED')
if (step === 1) return !!reason && !!terminationDate && (!riskAssessment?.warnings.length || acknowledgeRisk)
if (step === 2) return true
if (step === 3) return true
@@ -921,7 +922,7 @@ export default function Termination() {
<div className="font-medium">{selectedEmployee.name}{selectedEmployee.department}</div>
<div>{selectedEmployee.hireDate?.toString().slice(0, 10)}</div>
<div>¥{fmt(selectedEmployee.monthlySalary)}</div>
{selectedEmployee.hasTermination && (
{selectedEmployee.hasTermination && selectedEmployee.latestTerminationStatus !== 'CANCELLED' && selectedEmployee.latestTerminationStatus !== 'COMPLETED' && (
<div className="text-danger font-medium mt-1"> /</div>
)}
{selectedEmployee.latestContract ? (