feat(员工管理): 新增员工转正、转岗和离职功能

- 添加员工转正API和页面
- 新增员工转岗功能及相关API和页面
- 实现员工离职功能及相关API和页面
- 在员工信息页面添加在职天数显示
- 调整接收报表页面分页大小
- 完善员工入职补录表单
This commit is contained in:
砂糖
2026-03-18 13:09:40 +08:00
parent 8fe459dae5
commit 49331dcc24
8 changed files with 1117 additions and 1 deletions

View File

@@ -69,6 +69,13 @@
<span>{{ parseTime(scope.row.entryTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="在职天数" align="center">
<template slot-scope="scope">
<el-tag :type="getRegularStatus(scope.row.entryTime, scope.row.isRegular).type">
{{ getRegularStatus(scope.row.entryTime, scope.row.isRegular).days }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="紧急联系人" align="center" prop="emergencyContact" />
<el-table-column label="关系" align="center" prop="relationship" />
<el-table-column label="紧急联系电话" align="center" prop="emergencyContactPhone" />
@@ -545,6 +552,37 @@ export default {
});
}
});
},
/** 计算入职天数和转正状态 */
getRegularStatus(entryTime, isRegular) {
if (!entryTime) return { days: 0, type: '', status: 0 };
const entryDate = new Date(entryTime);
const now = new Date();
const diffTime = now - entryDate;
const diffDays = Math.floor(diffTime / (1000 * 60 * 60 * 24));
let type = '';
let status = isRegular || 0;
if (status === 0) {
// 未转正
if (diffDays < 60) {
// 2个月内未转正
type = 'warning';
} else if (diffDays < 90) {
// 3个月内未转正
type = 'info';
} else if (diffDays >= 90) {
// 3个月以上未转正
type = 'warning';
}
} else {
// 已转正
type = 'success';
}
return { days: diffDays, type, status };
}
}
};