feat: 社保公积金账户化重构

新增 SocialAccount(账户)+ SocialYearStandard(年度标准)两层实体,
替代原 SocialInsuranceConfig/HousingFundConfig 按城市管理的方式。

- DB: 新增 SocialAccount、SocialYearStandard 表,Department 加账户关联
- 迁移: 旧 Config 表数据迁移到 Account + YearStandard
- 后端: 新增账户 CRUD + 年度标准 API,薪资计算适配 accountId
- 前端: 设置页新增账户管理 Tab,组织架构提示 level=0 可关联账户
- 前端: SocialInsurance.tsx 城市选择器改为账户选择器
- 兼容: 旧 Config 表保留,薪资计算回退旧表

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:50:15 +08:00
parent 454b3d4b05
commit 63b6c9dcc7
8 changed files with 674 additions and 81 deletions
+34
View File
@@ -515,6 +515,40 @@ export const salaryDashboardApi = {
// ========== 社保公积金相关 ==========
// 账户管理(新)
export const socialAccountApi = {
/** 账户列表 */
list: (type?: string) =>
get('/social/accounts', { params: type ? { type } : {} }).then(unwrap<any[]>()),
/** 新建账户 */
create: (data: { type: string; name: string; city: string; accountNo?: string; bankName?: string; bankAccount?: string; orgName?: string; orgCode?: string; accountType?: string; isDefault?: boolean; remark?: string }) =>
post('/social/accounts', data).then(unwrap<any>()),
/** 编辑账户 */
update: (id: string, data: Partial<{ type: string; name: string; city: string; accountNo: string; bankName: string; bankAccount: string; orgName: string; orgCode: string; accountType: string; isDefault: boolean; remark: string; status: string }>) =>
put(`/social/accounts/${id}`, data).then(unwrap<any>()),
/** 删除账户 */
remove: (id: string) =>
del(`/social/accounts/${id}`).then(unwrap<any>()),
/** 设为默认 */
setDefault: (id: string) =>
put(`/social/accounts/${id}/default`).then(unwrap<any>()),
/** 按账户获取年度标准列表 */
standards: (accountId: string) =>
get(`/social/accounts/${accountId}/standards`).then(unwrap<any[]>()),
/** 按账户获取当前生效标准 */
currentStandard: (accountId: string) =>
get(`/social/accounts/${accountId}/current-standard`).then(unwrap<any>()),
/** 按账户+月份获取适用标准 */
standardByMonth: (accountId: string, month: string) =>
get(`/social/accounts/${accountId}/standard-by-month/${month}`).then(unwrap<any>()),
/** 新建年度标准 */
createStandard: (accountId: string, data: any) =>
post(`/social/accounts/${accountId}/standards`, data).then(unwrap<any>()),
/** 按员工获取适用账户 */
employeeAccount: (employeeId: string) =>
get(`/social/employee-account/${employeeId}`).then(unwrap<any>()),
}
export const socialInsuranceApi = {
/** 城市列表 */
cities: () =>