feat: 员工规避损失明细添加规避方式列

This commit is contained in:
selfrelease
2026-07-31 10:41:22 +08:00
parent 7d7f39fd30
commit abbba82f25
2 changed files with 29 additions and 3 deletions
+19 -1
View File
@@ -1657,9 +1657,26 @@ export async function getAnnualValueReport(orgId: string, year: number) {
riskCount: number
lossAvoided: number
adjustedLoss: number
details: Map<string, { title: string; estimatedLoss: number; legalBasis: string }>
details: Map<string, { title: string; estimatedLoss: number; legalBasis: string; resolutionMethod: string }>
}> = {}
// 辅助:根据风险标题推断规避方式
function getResolutionMethod(title: string): string {
if (title.includes('未签合同') && title.includes('无固定期限')) return '补签书面合同'
if (title.includes('未签合同')) return '签订书面合同'
if (title.includes('到期') && title.includes('未续签')) return '续签合同'
if (title.includes('即将到期')) return '续签或终止合同'
if (title.includes('试用期') && title.includes('不合法')) return '调整试用期条款'
if (title.includes('入职手续未完成')) return '完成入职手续'
if (title.includes('孕期') || title.includes('哺乳期')) return '调整岗位/安排哺乳期待遇'
if (title.includes('工伤')) return '申报工伤/安排适当工作'
if (title.includes('医疗期')) return '保障医疗期待遇'
if (title.includes('社保')) return '补缴社保'
if (title.includes('公积金')) return '补缴公积金'
if (title.includes('工资') || title.includes('个税')) return '发放工资/申报个税'
return '人工处理'
}
// 辅助:根据风险标题推断法律依据
function getLegalBasis(title: string): string {
if (title.includes('未签合同')) return '第82条 双倍工资≤11个月'
@@ -1713,6 +1730,7 @@ export async function getAnnualValueReport(orgId: string, year: number) {
title: r.title,
estimatedLoss: r.estimatedLoss || 0,
legalBasis: getLegalBasis(r.title || ''),
resolutionMethod: getResolutionMethod(r.title || ''),
})
}
}
+10 -2
View File
@@ -231,7 +231,8 @@ export default function AnnualValueReport() {
<th className="text-left py-2 px-2 font-medium"></th>
<th className="text-left py-2 px-2 font-medium"></th>
<th className="text-center py-2 px-2 font-medium"></th>
<th className="text-right py-2 px-2 font-medium"></th>
<th className="text-left py-2 px-2 font-medium"></th>
<th className="text-left py-2 px-2 font-medium"></th>
<th className="text-left py-2 px-2 font-medium"></th>
</tr>
</thead>
@@ -242,6 +243,13 @@ export default function AnnualValueReport() {
<td className="py-2 px-2 text-gray-600">{emp.department}</td>
<td className="py-2 px-2 text-center">{emp.riskCount}</td>
<td className="py-2 px-2 text-right font-bold text-safe">¥{emp.adjustedLoss.toLocaleString()}</td>
<td className="py-2 px-2">
<div className="space-y-0.5">
{emp.details.map((d: any, i: number) => (
<div key={i} className="text-safe font-medium">{d.resolutionMethod}</div>
))}
</div>
</td>
<td className="py-2 px-2">
<div className="space-y-0.5">
{emp.details.map((d: any, i: number) => (
@@ -260,7 +268,7 @@ export default function AnnualValueReport() {
</tbody>
<tfoot>
<tr className="border-t-2 border-gray-200 font-bold">
<td className="py-2 px-2" colSpan={2}></td>
<td className="py-2 px-2" colSpan={3}></td>
<td className="py-2 px-2 text-right text-safe">¥{(report.adjustedLossAvoided || 0).toLocaleString()}</td>
<td className="py-2 px-2"></td>
</tr>