feat: 转正弹窗显示原薪资 + 薪资变化时联动签署
- ConfirmModal 显示原薪资(¥xxx),转正薪资默认填入原薪资 - 转正薪资与原薪资不同时,提示"将发起薪酬调整确认书签署" - confirmMutation onSuccess:薪资变化时弹出签署方式选择弹窗 - scene=POLICY,文件标题为"转正薪酬调整确认书" - 备注记录薪资变化:¥原薪资 → ¥新薪资 Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
@@ -281,13 +281,28 @@ export default function Roster() {
|
||||
const confirmMutation = useMutation({
|
||||
mutationFn: (data: { employeeId: string; confirmDate: string; regularSalary?: number }) =>
|
||||
workProcessApi.create({ type: 'CONFIRM', title: '转正', employeeId: data.employeeId, formData: { employeeId: data.employeeId, confirmDate: data.confirmDate, regularSalary: data.regularSalary }, status: 'DRAFT' }),
|
||||
onSuccess: () => {
|
||||
onSuccess: (_data, variables) => {
|
||||
queryClient.invalidateQueries({ queryKey: ['roster'] })
|
||||
queryClient.invalidateQueries({ queryKey: ['dashboard'] })
|
||||
queryClient.invalidateQueries({ queryKey: ['roster-profile'] })
|
||||
setShowConfirmModal(false)
|
||||
const originalSalary = confirmEmployee?.monthlySalary ? Number(confirmEmployee.monthlySalary) : null
|
||||
const newSalary = variables.regularSalary
|
||||
// 薪资有变化时弹出签署方式选择
|
||||
if (newSalary && newSalary !== originalSalary) {
|
||||
setSignChoice({
|
||||
open: true,
|
||||
employeeId: variables.employeeId,
|
||||
employeeName: confirmEmployee?.name || '',
|
||||
scene: 'POLICY',
|
||||
documentTitle: `${confirmEmployee?.name || ''}的转正薪酬调整确认书`,
|
||||
remark: `转正薪资调整:¥${originalSalary || 0} → ¥${newSalary}`,
|
||||
actionName: '转正调薪',
|
||||
})
|
||||
} else {
|
||||
toast.success('转正已提交')
|
||||
}
|
||||
setConfirmEmployee(null)
|
||||
toast.success('转正已提交')
|
||||
},
|
||||
onError: (err: any) => toast.error(err?.response?.data?.error?.message || '转正失败'),
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user