feat: 账户关联根部门 + 员工新增自动带出账户

1. 账户管理:新建/编辑时可勾选关联 level=0 根部门(公司/分公司/子公司)
2. 后端新增 API:
   - PUT /social/accounts/:id/departments 批量关联根部门
   - GET /social/accounts/:id/departments 查询已关联部门
   - GET /social/department-account/:departmentId 按部门带出适用账户+标准
3. 部门更新 API 支持 socialAccountId/housingAccountId 字段
4. 员工新增表单:选定部门后自动带出社保公积金账户,可手动调整
5. 参保记录创建时写入 accountId

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 13:59:06 +08:00
parent 63b6c9dcc7
commit 014c94e482
7 changed files with 799 additions and 10 deletions
+2
View File
@@ -396,6 +396,7 @@ export async function createEmployee(orgId: string, userId: string, data: any) {
changeType: 'ONBOARDING',
createdBy: userId,
city: data.city || '北京',
accountId: data.socialAccountId || null,
},
})
@@ -409,6 +410,7 @@ export async function createEmployee(orgId: string, userId: string, data: any) {
changeType: 'ONBOARDING',
createdBy: userId,
city: data.city || '北京',
accountId: data.housingAccountId || null,
},
})