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
+3
View File
@@ -83,6 +83,7 @@ enum TerminationReason {
NONFAULT
LAYOFF
EXPIRED
RESIGNATION
}
enum RiskAssessment {
@@ -249,8 +250,10 @@ model TerminationRecord {
org Organization @relation(fields: [orgId], references: [id], onDelete: Cascade)
employeeId String
employee Employee @relation(fields: [employeeId], references: [id], onDelete: Cascade)
type String @default("TERMINATION") // TERMINATION=公司解聘, RESIGNATION=员工主动离职
reason TerminationReason
terminationDate DateTime
resignationReason String? // 主动离职原因(type=RESIGNATION时使用)
compensation Float @default(0)
riskLevel RiskAssessment @default(SAFE)
checklist Json