feat: 离职/解聘完整功能
1. 已有离职/解聘记录的员工不能再次解聘(后端校验+前端提示) 2. 员工主动离职功能:花名册列表增加「离职」操作按钮和弹窗 3. 离职也按离职日期动态判断在职/离职状态,支持提前办理 4. 员工档案「解聘记录」tab改为「离职/解聘记录」,区分类型显示 5. Schema: TerminationRecord 增加 type、resignationReason 字段 6. 后端新增 POST /termination/resignation 接口 7. 花名册列表返回 hasTermination 标记
This commit is contained in:
@@ -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>
|
||||
) : (
|
||||
|
||||
Reference in New Issue
Block a user