diff --git a/frontend/src/pages/money/BatchTab.tsx b/frontend/src/pages/money/BatchTab.tsx index bf82fdb..72391e2 100644 --- a/frontend/src/pages/money/BatchTab.tsx +++ b/frontend/src/pages/money/BatchTab.tsx @@ -148,7 +148,11 @@ export function BatchManager() { const createMutation = useMutation({ mutationFn: (data: any) => payrollApi.createBatch(data), - onSuccess: () => { + onSuccess: (_data: any, vars: any) => { + // 自动切换列表筛选到批次所属月,确保新批次可见 + if (vars.month && vars.month !== month) { + setMonth(vars.month) + } queryClient.invalidateQueries({ queryKey: ['batches'] }) queryClient.invalidateQueries({ queryKey: ['batch-check'] }) setShowCreateModal(false)