From c5f4731d5cb7f8bd5a11716c7b33f2c0e7b4d27b Mon Sep 17 00:00:00 2001 From: selfrelease Date: Mon, 17 Aug 2026 06:46:19 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=88=9B=E5=BB=BA=E6=89=B9=E6=AC=A1?= =?UTF-8?q?=E5=90=8E=E8=87=AA=E5=8A=A8=E5=88=87=E6=8D=A2=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E7=AD=9B=E9=80=89=E5=88=B0=E6=89=B9=E6=AC=A1=E6=89=80=E5=B1=9E?= =?UTF-8?q?=E6=9C=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 问题:批次列表默认按当前月筛选,创建其他月份的批次后列表 不显示新批次,用户以为创建失败。 修复:创建成功后自动将列表月份筛选切换到批次所属月。 Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- frontend/src/pages/money/BatchTab.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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)