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