feat: 薪税管理批次表格增加绩效工资列
前端 BatchTab.tsx: - 表头增加绩效工资列 - 表体渲染 performanceSalary 单元格 - 绩效工资加入可编辑字段列表 后端 payroll2.routes.ts: - updateEntrySchema 增加 performanceSalary 字段 - 更新 entry 时接受前端传来的 performanceSalary 值
This commit is contained in:
@@ -575,6 +575,7 @@ router.post('/batches', async (req: AuthRequest, res: Response, next: NextFuncti
|
|||||||
// 编辑批次条目(计算依据项 + 社保公积金手动覆盖)
|
// 编辑批次条目(计算依据项 + 社保公积金手动覆盖)
|
||||||
const updateEntrySchema = z.object({
|
const updateEntrySchema = z.object({
|
||||||
baseSalary: z.number().optional(),
|
baseSalary: z.number().optional(),
|
||||||
|
performanceSalary: z.number().optional(),
|
||||||
overtimePay: z.number().optional(),
|
overtimePay: z.number().optional(),
|
||||||
allowance: z.number().optional(),
|
allowance: z.number().optional(),
|
||||||
deduction: 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,
|
allowance: data.allowance ?? entry.allowance,
|
||||||
deduction: data.deduction ?? entry.deduction,
|
deduction: data.deduction ?? entry.deduction,
|
||||||
bonus: data.bonus ?? entry.bonus,
|
bonus: data.bonus ?? entry.bonus,
|
||||||
positionSalary: entry.positionSalary || undefined,
|
positionSalary: (data as any).positionSalary ?? entry.positionSalary ?? undefined,
|
||||||
performanceSalary: entry.performanceSalary || undefined,
|
performanceSalary: data.performanceSalary ?? entry.performanceSalary ?? undefined,
|
||||||
senioritySalary: entry.senioritySalary || undefined,
|
senioritySalary: (data as any).senioritySalary ?? entry.senioritySalary ?? undefined,
|
||||||
transportAllowance: entry.transportAllowance || undefined,
|
transportAllowance: entry.transportAllowance || undefined,
|
||||||
mealAllowance: entry.mealAllowance || undefined,
|
mealAllowance: entry.mealAllowance || undefined,
|
||||||
housingAllowance: entry.housingAllowance || undefined,
|
housingAllowance: entry.housingAllowance || undefined,
|
||||||
|
|||||||
@@ -702,7 +702,7 @@ function BatchDetail({ batchId, onBack }: { batchId: string; onBack: () => void
|
|||||||
// 可编辑的输入项字段
|
// 可编辑的输入项字段
|
||||||
const editableFields = isBonus
|
const editableFields = isBonus
|
||||||
? ['bonus']
|
? ['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) => {
|
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 }
|
if (!entry) { setEditCell(null); return }
|
||||||
const data: any = {}
|
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 => {
|
inputFields.forEach(f => {
|
||||||
data[f] = f === field ? numValue : entry[f]
|
data[f] = f === field ? numValue : entry[f]
|
||||||
})
|
})
|
||||||
@@ -1176,6 +1176,7 @@ function BatchDetail({ batchId, onBack }: { batchId: string; onBack: () => void
|
|||||||
<th className="py-2 px-2">员工</th>
|
<th className="py-2 px-2">员工</th>
|
||||||
<th className="py-2 px-2">合同类型</th>
|
<th className="py-2 px-2">合同类型</th>
|
||||||
<th className="py-2 px-2 text-right">基本工资</th>
|
<th className="py-2 px-2 text-right">基本工资</th>
|
||||||
|
<th className="py-2 px-2 text-right">绩效工资</th>
|
||||||
<th className="py-2 px-2 text-right">加班费</th>
|
<th className="py-2 px-2 text-right">加班费</th>
|
||||||
<th className="py-2 px-2 text-right">津贴</th>
|
<th className="py-2 px-2 text-right">津贴</th>
|
||||||
{isBonus && <th className="py-2 px-2 text-right">奖金</th>}
|
{isBonus && <th className="py-2 px-2 text-right">奖金</th>}
|
||||||
@@ -1228,6 +1229,7 @@ function BatchDetail({ batchId, onBack }: { batchId: string; onBack: () => void
|
|||||||
})()}
|
})()}
|
||||||
</td>
|
</td>
|
||||||
{renderCell(entry, 'baseSalary')}
|
{renderCell(entry, 'baseSalary')}
|
||||||
|
{renderCell(entry, 'performanceSalary')}
|
||||||
{renderCell(entry, 'overtimePay')}
|
{renderCell(entry, 'overtimePay')}
|
||||||
{renderCell(entry, 'allowance')}
|
{renderCell(entry, 'allowance')}
|
||||||
{renderCell(entry, 'bonus')}
|
{renderCell(entry, 'bonus')}
|
||||||
|
|||||||
Reference in New Issue
Block a user