feat: 补充公积金支持(员工级别可选)

上海等城市存在补充公积金账户,同一企业内高管可能有但普通员工
没有。新增员工级别补充公积金账户关联:

- Employee 表加 supplementaryHousingAccountId 字段
- BatchEntry 表加 supplementaryHousingEmp/Org 字段
- 薪资计算 calcBatchEntry 支持补充公积金(额外算一笔,纳入
  个税扣除、最低工资保护递延逻辑)
- 新增员工弹窗加补充公积金账户选择器(可选,仅显示
  accountType=SUPPLEMENTARY 的公积金账户)
- 员工档案编辑支持补充公积金账户

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-17 10:20:59 +08:00
parent 1e7932c36c
commit 16f38f3c36
7 changed files with 82 additions and 14 deletions
+19
View File
@@ -732,6 +732,7 @@ export function AddEmployeeModal({ onClose, onSubmit, loading, error }: {
const [autoAccounts, setAutoAccounts] = useState<{ socialAccount: any; housingAccount: any; socialStandard: any; housingStandard: any } | null>(null)
const [manualSocialAccountId, setManualSocialAccountId] = useState<string>('')
const [manualHousingAccountId, setManualHousingAccountId] = useState<string>('')
const [supplementaryHousingAccountId, setSupplementaryHousingAccountId] = useState<string>('')
// 部门变化时查询适用账户
useEffect(() => {
@@ -757,6 +758,8 @@ export function AddEmployeeModal({ onClose, onSubmit, loading, error }: {
queryFn: () => socialAccountApi.list('HOUSING'),
enabled: !!form.departmentId,
})
// 补充公积金账户(accountType=SUPPLEMENTARY
const supplementaryHousingAccounts = allHousingAccounts.filter((a: any) => a.accountType === 'SUPPLEMENTARY')
// 入职日期变更 → 同步合同开始日期 + 重算结束日期
const handleHireDateChange = (hireDate: string) => {
@@ -952,6 +955,7 @@ export function AddEmployeeModal({ onClose, onSubmit, loading, error }: {
housingFundStartMonth: form.housingFundStartMonth || undefined,
socialAccountId: manualSocialAccountId || undefined,
housingAccountId: manualHousingAccountId || undefined,
supplementaryHousingAccountId: supplementaryHousingAccountId || undefined,
}
if (form.contractType !== 'UNSIGNED' && form.startDate) {
data.contract = {
@@ -1050,6 +1054,7 @@ export function AddEmployeeModal({ onClose, onSubmit, loading, error }: {
</div>
{/* 账户选择(选部门后自动带出,可手动调整) */}
{!isNoSocialContract && (
<>
<div className="grid grid-cols-2 gap-4 mb-3">
<div>
<Label></Label>
@@ -1080,6 +1085,20 @@ export function AddEmployeeModal({ onClose, onSubmit, loading, error }: {
)}
</div>
</div>
{supplementaryHousingAccounts.length > 0 && (
<div className="grid grid-cols-2 gap-4 mb-3">
<div>
<Label></Label>
<Select value={supplementaryHousingAccountId} onChange={(e) => setSupplementaryHousingAccountId(e.target.value)} disabled={!form.departmentId || isNoSocialContract}>
<option value=""></option>
{supplementaryHousingAccounts.map((a: any) => (
<option key={a.id} value={a.id}>{a.name}{a.city}</option>
))}
</Select>
</div>
</div>
)}
</>
)}
<div className={`grid grid-cols-4 gap-4 ${isNoSocialContract ? 'opacity-50' : ''}`}>
<div>