feat: 商业保险/员工福利独立页面+易签宝电子签署框架

- 商业保险:从社公商保中拆出为独立页面,侧边栏新增「福利保障」分组
- 员工福利:新建完整模块(方案管理+批量参保+员工汇总),Prisma模型+后端路由+前端页面
- 电子签署:搭建易签宝对接框架(ESignRecord模型+创建/查询/取消/回调接口+前端签署管理页面)
- 侧边栏新增「福利保障」分组:商业保险、员工福利、电子签署
- Prisma schema 新增6个模型:CommercialInsurancePlan/Enrollment, EmployeeBenefitPlan/Enrollment, ESignRecord
This commit is contained in:
freedakgmail
2026-08-04 23:08:49 +08:00
parent 5604d02de9
commit c328172e7d
12 changed files with 1348 additions and 9 deletions
+36
View File
@@ -572,6 +572,42 @@ export const commercialInsuranceApi = {
/** 删除方案 */
removePlan: (id: string) =>
del(`/commercial-insurance/plans/${id}`),
/** 批量参保 */
enroll: (planId: string, data: { employeeIds: string[]; premium?: number; effectiveFrom?: string }) =>
post(`/commercial-insurance/plans/${planId}/enroll`, data),
/** 退保 */
terminateEnrollment: (enrollmentId: string, effectiveTo?: string) =>
post(`/commercial-insurance/enrollments/${enrollmentId}/terminate`, { effectiveTo }),
}
// ========== 员工福利 ==========
export const benefitApi = {
plans: () =>
get('/benefits/plans').then(unwrap<any[]>()),
savePlan: (data: Record<string, unknown>, editId?: string) =>
editId ? put(`/benefits/plans/${editId}`, data) : post('/benefits/plans', data),
removePlan: (id: string) =>
del(`/benefits/plans/${id}`),
enrollments: (planId: string) =>
get(`/benefits/plans/${planId}/enrollments`).then(unwrap<any[]>()),
enroll: (planId: string, data: { employeeIds: string[]; effectiveFrom?: string }) =>
post(`/benefits/plans/${planId}/enroll`, data),
terminateEnrollment: (enrollmentId: string, effectiveTo?: string) =>
post(`/benefits/enrollments/${enrollmentId}/terminate`, { effectiveTo }),
employeeSummary: () =>
get('/benefits/employee-summary').then(unwrap<any[]>()),
}
// ========== 电子签署(易签宝) ==========
export const esignApi = {
list: (status?: string) =>
get('/esign', { params: status ? { status } : {} }).then(unwrap<any[]>()),
create: (data: { contractId?: string; employeeId: string; documentTitle: string; documentContent?: string; remark?: string }) =>
post('/esign/create', data),
status: (id: string) =>
get(`/esign/${id}/status`).then(unwrap<any>()),
cancel: (id: string) =>
post(`/esign/${id}/cancel`),
}
// ========== 离职相关 ==========