From aa39b37f7ba1307a93ae20371668a01513a32873 Mon Sep 17 00:00:00 2001 From: freedakgmail Date: Wed, 19 Aug 2026 07:24:09 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=96=AA=E7=A8=8E=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E6=89=B9=E6=AC=A1=E8=A1=A8=E6=A0=BC=E5=A2=9E=E5=8A=A0=E7=BB=A9?= =?UTF-8?q?=E6=95=88=E5=B7=A5=E8=B5=84=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 前端 BatchTab.tsx: - 表头增加绩效工资列 - 表体渲染 performanceSalary 单元格 - 绩效工资加入可编辑字段列表 后端 payroll2.routes.ts: - updateEntrySchema 增加 performanceSalary 字段 - 更新 entry 时接受前端传来的 performanceSalary 值 --- backend/src/routes/payroll2.routes.ts | 7 ++++--- frontend/src/pages/money/BatchTab.tsx | 6 ++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/backend/src/routes/payroll2.routes.ts b/backend/src/routes/payroll2.routes.ts index 34ba9a5..e478101 100644 --- a/backend/src/routes/payroll2.routes.ts +++ b/backend/src/routes/payroll2.routes.ts @@ -575,6 +575,7 @@ router.post('/batches', async (req: AuthRequest, res: Response, next: NextFuncti // 编辑批次条目(计算依据项 + 社保公积金手动覆盖) const updateEntrySchema = z.object({ baseSalary: z.number().optional(), + performanceSalary: z.number().optional(), overtimePay: z.number().optional(), allowance: z.number().optional(), deduction: z.number().optional(), @@ -607,9 +608,9 @@ router.put('/batches/:batchId/entries/:employeeId', async (req: AuthRequest, res allowance: data.allowance ?? entry.allowance, deduction: data.deduction ?? entry.deduction, bonus: data.bonus ?? entry.bonus, - positionSalary: entry.positionSalary || undefined, - performanceSalary: entry.performanceSalary || undefined, - senioritySalary: entry.senioritySalary || undefined, + positionSalary: (data as any).positionSalary ?? entry.positionSalary ?? undefined, + performanceSalary: data.performanceSalary ?? entry.performanceSalary ?? undefined, + senioritySalary: (data as any).senioritySalary ?? entry.senioritySalary ?? undefined, transportAllowance: entry.transportAllowance || undefined, mealAllowance: entry.mealAllowance || undefined, housingAllowance: entry.housingAllowance || undefined, diff --git a/frontend/src/pages/money/BatchTab.tsx b/frontend/src/pages/money/BatchTab.tsx index 6227941..0d6a35d 100644 --- a/frontend/src/pages/money/BatchTab.tsx +++ b/frontend/src/pages/money/BatchTab.tsx @@ -702,7 +702,7 @@ function BatchDetail({ batchId, onBack }: { batchId: string; onBack: () => void // 可编辑的输入项字段 const editableFields = isBonus ? ['bonus'] - : ['baseSalary', 'overtimePay', 'allowance', 'deduction', 'bonus', 'socialEmp', 'housingEmp', 'socialOrg', 'housingOrg'] + : ['baseSalary', 'performanceSalary', 'overtimePay', 'allowance', 'deduction', 'bonus', 'socialEmp', 'housingEmp', 'socialOrg', 'housingOrg'] // 点击单元格进入编辑 const startEdit = (employeeId: string, field: string, currentValue: number) => { @@ -720,7 +720,7 @@ function BatchDetail({ batchId, onBack }: { batchId: string; onBack: () => void if (!entry) { setEditCell(null); return } const data: any = {} // 输入项字段一起提交 - const inputFields = isBonus ? ['bonus'] : ['baseSalary', 'overtimePay', 'allowance', 'deduction', 'bonus'] + const inputFields = isBonus ? ['bonus'] : ['baseSalary', 'performanceSalary', 'overtimePay', 'allowance', 'deduction', 'bonus'] inputFields.forEach(f => { data[f] = f === field ? numValue : entry[f] }) @@ -1176,6 +1176,7 @@ function BatchDetail({ batchId, onBack }: { batchId: string; onBack: () => void 员工 合同类型 基本工资 + 绩效工资 加班费 津贴 {isBonus && 奖金} @@ -1228,6 +1229,7 @@ function BatchDetail({ batchId, onBack }: { batchId: string; onBack: () => void })()} {renderCell(entry, 'baseSalary')} + {renderCell(entry, 'performanceSalary')} {renderCell(entry, 'overtimePay')} {renderCell(entry, 'allowance')} {renderCell(entry, 'bonus')}