feat: 离职/解聘完整功能

1. 已有离职/解聘记录的员工不能再次解聘(后端校验+前端提示)
2. 员工主动离职功能:花名册列表增加「离职」操作按钮和弹窗
3. 离职也按离职日期动态判断在职/离职状态,支持提前办理
4. 员工档案「解聘记录」tab改为「离职/解聘记录」,区分类型显示
5. Schema: TerminationRecord 增加 type、resignationReason 字段
6. 后端新增 POST /termination/resignation 接口
7. 花名册列表返回 hasTermination 标记
This commit is contained in:
freedakgmail
2026-07-23 17:31:27 +08:00
parent e6b5ac5989
commit 29ba3a98bc
6 changed files with 234 additions and 19 deletions
+5 -1
View File
@@ -26,6 +26,7 @@ interface RosterEmployee {
name: string
department: string
status: string
hasTermination?: boolean
hireDate: string
monthlySalary: number
latestContract: any
@@ -276,7 +277,7 @@ export default function Termination() {
}, [selectedEmployee, terminationDate, socialAvgWage, reason])
const canProceed = () => {
if (step === 0) return !!employeeId
if (step === 0) return !!employeeId && !selectedEmployee?.hasTermination
if (step === 1) return !!reason && !!terminationDate && (!riskAssessment?.warnings.length || acknowledgeRisk)
if (step === 2) return true
if (step === 3) return true
@@ -440,6 +441,9 @@ 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 && (
<div className="text-danger font-medium mt-1"> /</div>
)}
{selectedEmployee.latestContract ? (
<div>{selectedEmployee.latestContract.contractType === 'UNSIGNED' ? '未签订' : `签订于 ${selectedEmployee.latestContract.signDate?.slice(0, 10) || '未知'}`}</div>
) : (