fix: 登记线下签署日期时同步创建 EsignRecord

登记签署日期后,签署记录 Tab 中也能看到这条记录。
创建一条 status=COMPLETED 的线下手签 EsignRecord,
避免已签合同在签署记录中无痕可查。

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
selfrelease
2026-08-16 12:17:39 +08:00
parent 040c5a3ab9
commit ef6d4591be
5 changed files with 174 additions and 34 deletions
+7 -1
View File
@@ -242,7 +242,13 @@ router.get('/', authMiddleware, async (req: AuthRequest, res, next) => {
riskLevel: contractInfo.riskLevel,
socialInsuranceStatus: (() => {
const sr = (e as any).socialInsRecords?.[0]
if (!sr) return null
// 劳务协议/实习协议:不缴纳社保,返回 null(前端显示"—"
const isNoSocialContract = latestContract && ['LABOR', 'INTERNSHIP'].includes(latestContract.contractType)
if (isNoSocialContract) return null
if (!sr) {
// 在职且应缴社保但无社保记录 → 待办理
return 'PENDING'
}
// endMonth 为 null 表示在保,否则已停保
if (sr.endMonth) return 'SUSPENDED'
return 'ACTIVE'