From 0476339ec4af0335a06914c630bee47d251f8d23 Mon Sep 17 00:00:00 2001 From: yml2213 Date: Thu, 17 Sep 2026 12:27:58 +0800 Subject: [PATCH] =?UTF-8?q?fix(consignment):=20=E6=89=8B=E5=8A=A8=E5=8C=B9?= =?UTF-8?q?=E9=85=8D=E8=AE=A2=E5=8D=95=E6=8C=89=E9=92=AE=E7=82=B9=E4=BA=86?= =?UTF-8?q?=E4=B8=8D=E5=BC=B9=E7=AA=97=EF=BC=88=E5=BC=B9=E7=AA=97=E6=8C=82?= =?UTF-8?q?=E9=94=99=E4=BA=86=E4=BD=8D=E7=BD=AE=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 用户反馈:在库待匹配列表点「手动匹配订单」没有反应。 根因:上一批把手动匹配弹窗挂到了「编辑寄售物品」弹窗**内部**,外层弹窗未打开时 该组件根本没被挂载,点击只改状态、界面无变化。 - 弹窗移到面板顶层(与其它弹窗同级),点击即弹 - 新增静态守卫测试:断言手动匹配弹窗前面不能有未闭合的 Modal(即不能嵌在别的弹窗里)、 按钮必须真的 setState、open 由该状态驱动;已验证该守卫能拦下错误写法 - 顺带补入口缺口:订单侧原先只在"检测到系统候选"的提醒弹窗里给入口,订单没有任何候选时 反而进不去手动匹配 —— 工单行内新增常驻「手动匹配现货」(仅待指派/待补资料, 与后端前置校验同口径) - 已暂停匹配的现货点按钮会直接 409,改为按钮禁用并提示先打开「允许匹配」开关 - destroyOnClose → antd 6 的 destroyOnHidden(前者已废弃) 验证:前端 typecheck/lint/format/48 例测试/build 全过。 --- .../admin/ConsignmentManualMatchModal.tsx | 2 +- .../panels/ConsignmentInventoryPanel.tsx | 48 ++++++++++++------- .../pages/admin/panels/WorkOrdersPanel.tsx | 15 ++++++ .../src/utils/consignment-manual-match.ts | 10 ++++ .../consignment-manual-match-mount.test.ts | 46 ++++++++++++++++++ .../tests/consignment-manual-match.test.ts | 10 ++++ docs/寄卖系统优化方案.md | 18 +++++++ 7 files changed, 131 insertions(+), 18 deletions(-) create mode 100644 apps/frontend/tests/consignment-manual-match-mount.test.ts diff --git a/apps/frontend/src/components/admin/ConsignmentManualMatchModal.tsx b/apps/frontend/src/components/admin/ConsignmentManualMatchModal.tsx index ebf5d81a..fbbf6f5b 100644 --- a/apps/frontend/src/components/admin/ConsignmentManualMatchModal.tsx +++ b/apps/frontend/src/components/admin/ConsignmentManualMatchModal.tsx @@ -221,7 +221,7 @@ export default function ConsignmentManualMatchModal({ } - destroyOnClose + destroyOnHidden > {record.status === 'in_stock' && canManageConsignment ? ( <> - + + + ) : null} + {/* + 手动指定现货必须**常驻**:只在"检测到候选"的提醒弹窗里给入口, + 订单没有任何系统候选时客服反而进不去——而那正是最需要人工指定的时候。 + */} + {canFulfillConsignment && isManuallyMatchableOrderStatus(row.status) ? ( + + ) : null} {row.capabilities?.canCancel && (canReturnToHall || canCancelOrder) ? (