Pārlūkot izejas kodu

fix(web): 移除工单施工指导中的待开通账号

sy 3 dienas atpakaļ
vecāks
revīzija
b0952a51ad

+ 5 - 2
web-scaffold/src/components/work-order/ConstructionGuidePanel.tsx

@@ -101,7 +101,10 @@ function PriorBlock({ prior }: { prior: PriorActivation }) {
   );
 }
 
-export function ConstructionGuidePanel({ guide }: { guide: ConstructionGuide | null | undefined }) {
+export function ConstructionGuidePanel({ guide, showPendingAccounts = true }: {
+  guide: ConstructionGuide | null | undefined;
+  showPendingAccounts?: boolean;
+}) {
   if (!guide || typeof guide !== "object") return null;
   const t = guide.ticket_type ?? "";
   const isStop = t === "expiry_stop" || t === "service_stop";
@@ -134,7 +137,7 @@ export function ConstructionGuidePanel({ guide }: { guide: ConstructionGuide | n
           </ul>
         </div>
       )}
-      {pending.length > 0 && (
+      {showPendingAccounts && pending.length > 0 && (
         <div className="wo-guide-card">
           <h4 className="work-order-subhead">待开通账号({pending.length})</h4>
           <div className="work-order-table-wrap compact" role="region" aria-label="待开通账号" tabIndex={0}>

+ 1 - 1
web-scaffold/src/pages/WorkOrderRecordPage.tsx

@@ -1471,7 +1471,7 @@ export function WorkOrderRecordPage() {
 
       {d.construction_guide && (
         <WorkOrderPanel tab="guide" active={activeTab}>
-          <ConstructionGuidePanel guide={d.construction_guide} />
+          <ConstructionGuidePanel guide={d.construction_guide} showPendingAccounts={false} />
         </WorkOrderPanel>
       )}
 

+ 4 - 2
web-scaffold/src/pages/__tests__/work-order-record-tabs.test.tsx

@@ -23,7 +23,7 @@ const detail = {
     title: "开通办公线路",
     detail: "请完成办公线路核对后回传。",
   },
-  construction_guide: { hint: "核对客户侧接入参数。" },
+  construction_guide: { hint: "核对客户侧接入参数。", pending_accounts: [{ sub_account_id: "ACC-1", display_name: "待开通测试账号" }] },
   actions: { check_done: true },
   service_items: [{ item_id: "item-1", seq_no: "1", item_name: "办公专线", expect_qty: "0", check_result: "pending" }],
   materials: [], messages: [], process_logs: [], gaps: [],
@@ -47,7 +47,9 @@ it("概况默认显示,支持键盘切换,各页签共用处理入口和处
   overview.focus();
   fireEvent.keyDown(overview, { key: "ArrowRight" });
   expect(document.activeElement).toBe(guide);
-  expect(within(screen.getByRole("tabpanel", { name: "施工指导" })).getByText(detail.construction_guide.hint)).toBeTruthy();
+  const guidePanel = within(screen.getByRole("tabpanel", { name: "施工指导" }));
+  expect(guidePanel.getByText(detail.construction_guide.hint)).toBeTruthy();
+  expect(guidePanel.queryByRole("region", { name: "待开通账号" })).toBeNull();
 
   fireEvent.keyDown(guide, { key: "End" });
   expect(screen.getAllByRole("tabpanel")).toEqual([screen.getByRole("tabpanel", { name: "追溯与关联" })]);