Ver Fonte

feat(web): 拆分合伙人与运维团队的对账清单和账单明细

sy há 3 dias atrás
pai
commit
5eaff884b1

+ 4 - 6
web-scaffold/src/access/demo-navigation.ts

@@ -35,9 +35,8 @@ const teamNavigation: readonly DemoNavigationItem[] = [
   { id: "enterprises", title: "团队客户", path: "/customers", section: "团队管理", icon: "customers" },
   { id: "members", title: "成员与负责范围", path: "/workspace/members", section: "团队管理", icon: "operationsTeams", workspace: true },
   { id: "mode", title: "分派方式", path: "/workspace/dispatch-mode", section: "团队管理", icon: "reconcileSettings", workspace: true },
-  // 册 8(视图§3.4):本方对账=/bos/tv/recon(V-P1b 合并页);「本方变更记录」/bos/tv/n
-  // 入口按第 10 册读口就绪位渲染(`audit_read_ready` 现由 `/audit/get_list@v1` 下发 true ⇒ 渲染)。
-  { id: "rules", title: "本方对账", path: "/bos/tv/recon", section: "对账与分成", icon: "settlementBatches", activePaths: ["/bos/tv/bill-detail"] },
+  { id: "statements", title: "对账清单", path: "/bos/tv/recon", section: "对账与分成", icon: "settlementBatches" },
+  { id: "bills", title: "账单明细", path: "/bos/tv/bill-detail", section: "对账与分成", icon: "settlementBills" },
   { id: "changeLog", title: "本方变更记录", path: "/bos/tv/n", section: "变更与范围", icon: "auditLogs" },
 ];
 /**
@@ -54,10 +53,9 @@ const customerNavigation: readonly DemoNavigationItem[] = [
   { id: "submit", title: "提交故障或售后", path: "/workspace/submit", section: "工单", icon: "correctionNotes", workspace: true },
   { id: "progress", title: "工单进度", path: "/workspace/progress", section: "工单", icon: "workOrders", workspace: true, activePaths: ["/work-orders"] },
 ];
-// 册 8 菜单契约(视图§3.4):本运营区域对账(2026-11-21 业主定案名,原名「本区域对账」;⛔ 改「本方对账」)+客户清单+合同清单;
-// 第 4 项「本方变更记录」/bos/pv/n 按第 10 册读口就绪位渲染(`audit_read_ready=true` ⇒ 渲染)。
 const partnerNavigation: readonly DemoNavigationItem[] = [
-  { id: "region", title: "本运营区域对账", path: "/bos/pv/recon", section: "对账与分成", icon: "settlementBatches", activePaths: ["/bos/pv/bill-detail"] },
+  { id: "statements", title: "对账清单", path: "/bos/pv/recon", section: "对账与分成", icon: "settlementBatches" },
+  { id: "bills", title: "账单明细", path: "/bos/pv/bill-detail", section: "对账与分成", icon: "settlementBills" },
   { id: "enterprises", title: "客户清单", path: "/bos/pv/customer", section: "客户与合同", icon: "customers" },
   { id: "contracts", title: "合同清单", path: "/bos/pv/contract", section: "客户与合同", icon: "contracts" },
   { id: "changeLog", title: "本方变更记录", path: "/bos/pv/n", section: "变更与范围", icon: "auditLogs" },

+ 6 - 12
web-scaffold/src/app/App.tsx

@@ -17,8 +17,8 @@ import {
   PartyContractListPage,
   PartyCustomerDetailPage,
   PartyCustomerListPage,
-  PartnerReconPage,
-  TeamReconPage,
+  ScopedBillListPage,
+  ScopedReconPage,
 } from "../pages/PartyViewPages";
 import { IllustratedLoginPage } from "../pages/IllustratedLoginPage";
 import { AccountActivationPage } from "../pages/AccountActivationPage";
@@ -78,8 +78,6 @@ const workspacePages: Record<string, ComponentType> = {
    * 改挂客户侧列表(⛔ 在运营台账页里塞 `if (客户)` 分支:那会让一页同时背两套口径,
    * 台账已有的告警卡/待办队列/分派操作对客户全是噪声)。 */
   progress: CustomerTicketProgressPage,
-  // 册 8:rules(teamLead 本方对账)/region(partner 本运营区域对账,2026-11-21 业主定案改名)已迁 /bos/tv|pv/recon 契约页,
-  // demo 台账 PartyReconciliationPage 已删除。
 };
 
 function RoleWorkspacePage() {
@@ -305,8 +303,7 @@ function Workspace() {
         <Route path="/bos/pv/n" element={<AppShell pageTitle="本方变更记录"><AuditLogPage pageTitle="本方变更记录" partyView /></AppShell>} />
         <Route path="/bos/ov/n" element={<AppShell pageTitle="本方变更记录"><AuditLogPage pageTitle="本方变更记录" partyView /></AppShell>} />
         <Route path="/bos/tv/n" element={<AppShell pageTitle="本方变更记录"><AuditLogPage pageTitle="本方变更记录" partyView /></AppShell>} />
-        {/* V-P1 合伙人本运营区域对账(合并页) */}
-        <Route path="/bos/pv/recon" element={<AppShell pageTitle="本运营区域对账"><PartnerReconPage /></AppShell>} />
+        <Route path="/bos/pv/recon" element={<NavAllowed><AppShell pageTitle="对账清单"><ScopedReconPage key="partner" kind="partner" /></AppShell></NavAllowed>} />
         <Route path="/bos/pv/recon/:no" element={<NavAllowed><AppShell pageTitle="对账清单详情"><SettlementStatementRecordPage partnerView /></AppShell></NavAllowed>} />
         {/* V-P2 合伙人客户清单 */}
         <Route path="/bos/pv/customer" element={<AppShell pageTitle="客户清单"><PartyCustomerListPage kind="partner" /></AppShell>} />
@@ -316,8 +313,7 @@ function Workspace() {
         <Route path="/bos/pv/contract" element={<AppShell pageTitle="合同清单"><PartyContractListPage kind="partner" /></AppShell>} />
         <Route path="/bos/pv/contract/:id" element={<NavAllowed><AppShell pageTitle="合同详情"><PartyContractDetailPage kind="partner" /></AppShell></NavAllowed>} />
         {/* V-D1 账单明细详情宿主 */}
-        {/* 裸路径兜底:明细列表并进「本运营区域对账」合并页,没有独立列表页 ⇒ 重定向,⛔ 落到 404。 */}
-        <Route path="/bos/pv/bill-detail" element={<Navigate to="/bos/pv/recon" replace />} />
+        <Route path="/bos/pv/bill-detail" element={<NavAllowed><AppShell pageTitle="账单明细"><ScopedBillListPage key="partner" kind="partner" /></AppShell></NavAllowed>} />
         <Route path="/bos/pv/bill-detail/:index" element={<NavAllowed><AppShell pageTitle="账单明细详情"><SettlementBillRecordPage partnerView /></AppShell></NavAllowed>} />
         {/* V-P5 运营商对账清单 */}
         <Route path="/bos/ov/recon" element={<AppShell pageTitle="对账清单"><OperatorReconPage /></AppShell>} />
@@ -330,11 +326,9 @@ function Workspace() {
         {/* V-P8 运营商合同清单 */}
         <Route path="/bos/ov/contract" element={<AppShell pageTitle="合同清单"><PartyContractListPage kind="operator" /></AppShell>} />
         <Route path="/bos/ov/contract/:id" element={<AppShell pageTitle="合同详情"><PartyContractDetailPage kind="operator" /></AppShell>} />
-        {/* V-P1b 运维团队本方对账(复用 V-P1 合并页组件,⚠️ 仅此两页允许共用,A51) */}
-        <Route path="/bos/tv/recon" element={<AppShell pageTitle="本方对账"><TeamReconPage /></AppShell>} />
+        <Route path="/bos/tv/recon" element={<NavAllowed><AppShell pageTitle="对账清单"><ScopedReconPage key="team" kind="team" /></AppShell></NavAllowed>} />
         {/* V-D1 明细详情 teamLead 宿主(14.1 未列 tv 段,14.6 返回链路表含 teamLead 明细详情 ⇒ 按 14.6 补注册,分歧已登记) */}
-        {/* 裸路径兜底:同 pv 段,明细列表在「本方对账」合并页内。 */}
-        <Route path="/bos/tv/bill-detail" element={<Navigate to="/bos/tv/recon" replace />} />
+        <Route path="/bos/tv/bill-detail" element={<NavAllowed><AppShell pageTitle="账单明细"><ScopedBillListPage key="team" kind="team" /></AppShell></NavAllowed>} />
         <Route path="/bos/tv/bill-detail/:id" element={<AppShell pageTitle="账单明细详情"><PartyBillDetailPage kind="team" /></AppShell>} />
         {/* D-21:旧菜单地址迁到 /bos/pv/recon,⛔ 再落 404 开发口吻页。 */}
         <Route path="/regional-reconciliation" element={<Navigate to="/bos/pv/recon" replace />} />

+ 4 - 2
web-scaffold/src/lib/detail-navigation.ts

@@ -41,9 +41,11 @@ const pageLabels: Record<string, string> = {
   "/workspace/customer-changes": "返回归属变更",
   "/daily-tasks": "返回定时任务",
   "/audit-logs": "返回审计日志",
-  "/bos/pv/recon": "返回本运营区域对账",
+  "/bos/pv/recon": "返回对账清单",
   "/bos/ov/recon": "返回对账清单",
-  "/bos/tv/recon": "返回本方对账",
+  "/bos/tv/recon": "返回对账清单",
+  "/bos/pv/bill-detail": "返回账单明细",
+  "/bos/tv/bill-detail": "返回账单明细",
   "/bos/ov/bill-detail": "返回账单明细",
 };
 

+ 124 - 293
web-scaffold/src/pages/PartyViewPages.tsx

@@ -1,33 +1,13 @@
-/**
- * 册 8《合伙人与运营商只读视图》页面族(视图§14 页面契约逐页)。
- *
- * 路由与菜单契约(视图§3.4/§14.1,⛔ 三身份路由前缀不同、组件不复用路由):
- *   partnerAcct ⇒ /bos/pv/*(V-P1 合并页/V-P2 客户/V-P3 合同);
- *   opAcct      ⇒ /bos/ov/*(V-P5 对账清单/V-P6 账单明细/V-P7 客户/V-P8 合同);
- *   teamLead    ⇒ /bos/tv/recon(V-P1b,复用 V-P1 合并页组件——⚠️ 仅此两页允许共用;
- *                 V-P5/V-P6 与合并页内两表「同名不同路由」,⛔ 合并组件靠 props 抹平差异,A51)。
- *   变更记录 V-P4/V-P9 三条路由 /bos/{pv,ov,tv}/n 建在册 10:读口就绪位 `audit_read_ready=true` ⇒ 入口渲染(视图§3.4 纪律 1)。
- *
- * 接线状态(2026-11-18):bos.view/partner_recon@v1 已在 openapi.yaml 声明并由
- * billing::view_partner_recon 实现(六段一次返回)⇒ 合并页走真数据;
- * 11001 占位分支仅作契约兜底保留。opAcct 两页复用对账§同名口(R1/R2,reconGetList/billGetList);
- * 单批导出复用对账§ reconExportDetail(R4,本册⛔ 自立导出口)。
- *
- * 硬纪律:⛔「无权限」字样(U-68/总则§16.4);⛔ history.back()(14.6);
- * ⛔ 列表级导出/批量操作/人工补跑/已读异议按钮(14.5 白名单);
- * ⛔「涉及分成方」卡与「同一张应收上其他分成方」面板(14.5,服务端亦不返回);
- * 金额整数分传输、前端不做浮点运算;本方对账默认全部自然月,其余只读台账默认预选 lastClosedMonth()。
- */
-import { Children, useCallback, useEffect, useRef, useState, type ReactNode } from "react";
+/** 各身份的只读台账。合伙人与团队使用本方快照,运营商使用对账和账单列表接口。 */
+import { Children, useCallback, useEffect, useState, type ReactNode } from "react";
 import { PageIntro } from "../components/PageIntro";
 import { ContractLedgerAmountCell } from "../components/ContractLedgerAmountCell";
 import { SettlementLedgerHead, useSettlementLedgerTable, type SettlementLedgerColumn } from "../components/SettlementLedger";
-import { ArrowDown, ArrowLeft, ArrowRight, CalendarClock, CalendarDays, Download, Info, Search, X } from "lucide-react";
+import { ArrowLeft, ArrowRight, CalendarClock, CalendarDays, Download, Search, X } from "lucide-react";
 import { Link, useLocation, useParams, useSearchParams } from "react-router";
 import { detailBack, detailLinkState, partnerReconDetailPath } from "../lib/detail-navigation";
-import { ListPager, ServerListPager } from "../components/ListPager";
+import { ListPager } from "../components/ListPager";
 import { Button } from "../components/ui/button";
-import { Input } from "../components/ui/input";
 import { SearchInput } from "../components/ui/search-input";
 import { FilterSelect } from "../components/ui/filter-select";
 import { MonthFilter } from "../components/ui/month-filter";
@@ -48,41 +28,30 @@ import {
 import type {
   BillDetailResult,
   ContractRow,
-  ViewBillDetailRow,
-  ViewPartnerReconResult,
-  ViewReconBatchRow,
 } from "../lib/api/types";
 import { WORD_FETCH_FAILED, WORD_NOT_PROVIDED, WORD_UNCONFIGURED } from "../lib/api/lockedCopy";
 import { ACCT_STATUS, PAY_CYCLE, SUBJECT_TYPE, label } from "../lib/api/labels";
 import { contractFromRow, contractStatusOf, contractStatusTone } from "../lib/contract-demo";
 import { EXPIRING_SOON_DAYS } from "../lib/expiring-soon";
 import { settleTextFromSnapshot } from "../lib/settle-text";
-import { lastClosedMonth } from "../lib/recon";
 import { ALL_PERIODS_LABEL, BACKEND_NOT_WIRED, BATCH_STATUS_TEXT, EXPORT_EMPTY_NOTE, RECONCILE_STATUS_TEXT, TRIGGER_TYPE_TEXT, exportResultNote, saveReconExportCsv } from "../lib/copy-billing";
 import {
   BACK_TO_BILL_DETAIL_LIST,
   BACK_TO_CONTRACT_LIST,
   BACK_TO_CUSTOMER_LIST,
-  BACK_TO_SELF_RECON,
   CARD1_TITLE,
-  CARD_SNAPSHOT_TITLE,
   OWNERSHIP_CHANGED,
-  VIEW_ALL_PERIODS_NOTE,
   VIEW_BINDING_FAILED,
   VIEW_CONFIG_UNSET,
   VIEW_DEFAULT_PAY_CYCLE,
-  VIEW_DETAIL_ONLY_SETTLED,
   VIEW_EXPORT_EXPIRED,
   VIEW_FILTER_INCOMPLETE,
-  VIEW_KEYWORD_FILTER_NOTE,
   VIEW_LIST_EMPTY,
-  VIEW_MONTH_NO_BATCH,
   VIEW_NOT_FOUND,
   VIEW_ROLE_FORBIDDEN,
   VIEW_SNAPSHOT_NOT_READY,
   VIEW_WIRING_NOTE,
   viewExportOverLimit,
-  viewMonthTruncated,
 } from "../lib/copy-views";
 import { PartyContractRecord, PartyCustomerRecord } from "./PartyReadOnlyRecords";
 import "../styles/operations.css";
@@ -180,8 +149,6 @@ function FullPageState({ text, retry }: { text: string; retry?: () => void }) {
   );
 }
 
-/* ── V-P1/V-P1b 合并页(六段一次请求,⛔ 分段懒加载) ────────────────────── */
-
 type PartyListView = { page: number; month?: string; keyword?: string; subject?: string; status?: string; expiring?: boolean };
 
 function usePartyListReturn() {
@@ -215,252 +182,132 @@ function ReconOverview({ title, month, reconDay, payCycle, settlementRule, child
   </div>;
 }
 
-function PartyReconMergedPage({ kind }: { kind: "partner" | "team" }) {
-  const teamView = kind === "team";
-  const title = kind === "partner" ? "本运营区域对账" : "本方对账";
-  const prefix = kindPrefix(kind);
-  const { saved, stateFor } = usePartyListReturn();
-  const defaultMonth = teamView ? "" : lastClosedMonth();
-  const [month, setMonth] = useState(saved?.month ?? defaultMonth);
-  const [keyword, setKeyword] = useState(saved?.keyword ?? "");
-  const [page, setPage] = useState(saved?.page ?? 1);
-  const linkState = stateFor({ month, keyword, page });
-  const [notice, setNotice] = useState("");
-  const detailRef = useRef<HTMLDivElement>(null);
-  const exportBatch = useExportBatch(setNotice);
+type ScopedReconKind = "partner" | "team";
 
-  const fetchState = useViewFetch<ViewPartnerReconResult>(
-    // 对外分页 0 基(总则§16.5;组件页码 1 基,只在请求边界换算)。
-    () => viewPartnerRecon({ month: month || undefined, keyword, page: Math.max(0, page - 1), page_size: 20 }),
-    [month, keyword, page],
-  );
-  const { data, fail } = fetchState;
-  const wiring = fail?.kind === "wiring";
-  // 快照未建立=整页态(KLT-O20703):200 响应仍带数据骨架,⛔ 渲染成空表或 0。
-  const snapshotNotReady = data?.snapshot_state === "not_ready";
-  const monthOptions = data && data.month_options !== "failed" ? data.month_options : null;
-  const monthOptionsFailed = data?.month_options === "failed";
+function useLedgerQuery() {
+  const location = useLocation();
+  const [params, setParams] = useSearchParams();
+  const pageParam = Number(params.get("page"));
+  const page = Number.isSafeInteger(pageParam) && pageParam > 0 ? pageParam : 1;
+  const options = { replace: true, state: location.state };
 
-  // C35:预选月不在 month_options 内 ⇒ 退回首项 month_options[0](⛔ 停在空月份静默成「筛选无结果」)。
-  useEffect(() => {
-    if (teamView || !monthOptions?.length || !month) return;
-    if (!monthOptions.some((o) => o.period === month)) setMonth(monthOptions[0].period);
-  }, [teamView, monthOptions, month]);
-  const monthFallback = !teamView && Boolean(monthOptions?.length && month && !monthOptions.some((o) => o.period === month));
-
-  function resetFilter() {
-    setKeyword("");
-    setMonth(defaultMonth);
-    setPage(1);
-  }
-  /** 表 1「查看明细」=页内锚点定位表 2 并自动填筛选(不跳页,视图§4.1.2)。 */
-  function drillBatch(batchNo: string) {
-    setKeyword(batchNo);
-    setPage(1);
-    detailRef.current?.focus({ preventScroll: true });
-    detailRef.current?.scrollIntoView({ behavior: "smooth", block: "start" });
+  function setFilter(key: "month" | "batch" | "customer" | "page", value: string) {
+    const next = new URLSearchParams(params);
+    if (value) next.set(key, value); else next.delete(key);
+    if (key !== "page") next.delete("page");
+    setParams(next, options);
   }
 
-  const config = data?.config ?? null;
-  const settle = data?.settle ?? null;
-  const batches = data?.batches ?? [];
-  const details = data?.details ?? [];
-  const reconDay = !wiring && config ? (config.recon_day == null ? VIEW_CONFIG_UNSET : `每月 ${config.recon_day} 日`) : BACKEND_NOT_WIRED;
-  const payCycle = !wiring && config ? (config.pay_cycle ?? VIEW_DEFAULT_PAY_CYCLE) : BACKEND_NOT_WIRED;
-  const settlementRule = wiring ? <Tri tone="missing" text={BACKEND_NOT_WIRED} />
-    : settle && (settle.mode != null || settle.value != null) ? settleTextFromSnapshot(settle.mode, settle.value) : WORD_UNCONFIGURED;
-  const batchTotal = wiring ? BACKEND_NOT_WIRED : `${data?.batch_total ?? 0} 批`;
-  const detailTotal = wiring ? BACKEND_NOT_WIRED : `${data?.detail_total ?? 0} 条`;
-  const shareTotal = wiring ? BACKEND_NOT_WIRED : moneyCell(data?.share_sum ?? null);
-  const showLedger = wiring || (data && !snapshotNotReady);
-
-  const pageSize = 20;
+  return {
+    location, params, month: params.get("month") ?? "", batch: params.get("batch") ?? "", page,
+    linkState: detailLinkState(location.pathname + location.search + location.hash, location.state),
+    setFilter, setPage: (next: number) => setFilter("page", next > 1 ? String(next) : ""),
+    reset: () => setParams({}, options),
+  };
+}
 
+/** 合伙人和运维团队使用本方快照接口。两张表分别使用当前筛选命中的总数分页。 */
+function useScopedLedger(kind: ScopedReconKind) {
+  const query = useLedgerQuery();
+  const { month, batch, page } = query;
+  const response = useViewFetch(
+    () => viewPartnerRecon({ month: month || undefined, keyword: batch || undefined, page: page - 1, page_size: PARTY_PAGE_SIZE }),
+    [kind, month, batch, page],
+  );
+  const fail: ViewFail | null = response.data?.snapshot_state === "not_ready" ? { kind: "snapshot" } : response.fail;
   const filters = <>
-    <div className="ops-toolbar team-recon-toolbar">
-      <label className="ops-search">
-        <Search size={17} aria-hidden="true" />
-        <Input
-          aria-label="搜索对账单号或明细号"
-          placeholder="搜索对账单号/明细号"
-          value={keyword}
-          onChange={(event) => { setKeyword(event.target.value); setPage(1); }}
-        />
-        {keyword && <button type="button" aria-label="清空搜索" onClick={() => { setKeyword(""); setPage(1); }}><X size={15} aria-hidden="true" /></button>}
-      </label>
-      {/* 合伙人视图的月份选项取接口返回的两表并集。 */}
-      {teamView ? <MonthFilter
-        value={month}
-        onChange={(value) => { setMonth(value); setPage(1); }}
-      /> : <FilterSelect
-        icon="month"
-        aria-label="自然月"
-        value={month}
-        disabled={!monthOptions}
-        onChange={(event) => { setMonth(event.target.value); setPage(1); }}
-      >
-        <option value="">{ALL_PERIODS_LABEL}</option>
-        {(monthOptions ?? (month ? [{ period: month }] : [])).map((o) => <option key={o.period} value={o.period}>{o.period}</option>)}
-      </FilterSelect>}
-      {(month !== defaultMonth || keyword) && <Button variant="ghost" size="sm" onClick={resetFilter}>重置筛选</Button>}
-      {fetchState.loading && data && <span className="team-recon-filter-hint" role="status">
-        <Info size={14} aria-hidden="true" />正在更新筛选结果…
-      </span>}
-    </div>
-    {!teamView && <p className="ops-import-note" role="note">{VIEW_KEYWORD_FILTER_NOTE}</p>}
-    {monthFallback && <p className="ops-import-note" role="status">{VIEW_MONTH_NO_BATCH}</p>}
-    {!teamView && data?.month_options_truncated && <p className="ops-import-note" role="status">{viewMonthTruncated(monthOptions?.length ?? 0)}</p>}
-    {!teamView && monthOptionsFailed && <p className="ops-import-note" role="status">{WORD_FETCH_FAILED}:月份选项暂不可用。</p>}
+    <PartySearch label="搜索对账单号或明细号" placeholder="搜索对账单号或明细号" value={batch} onChange={(value) => query.setFilter("batch", value)} />
+    <MonthFilter value={month} onChange={(value) => query.setFilter("month", value)} />
+    {(month || batch) && <Button variant="ghost" size="sm" onClick={query.reset}>重置筛选</Button>}
   </>;
-
-  return (
-    <section className="ops-page reconcile-index team-recon-view">
-      <header className="ops-heading statement-heading">
-        <div>
-          <h1>{title}</h1>
-          <PageIntro>{teamView ? "按账期查看团队的对账批次、已出账明细和分成金额。" : "从每个账期的对账批次查到本方参与的结算和分成。"}</PageIntro>
-        </div>
-      </header>
-      {notice && <OpsNotice message={notice} onClose={() => setNotice("")} />}
-      {wiring && <p className="ops-import-note" role="status">{VIEW_WIRING_NOTE}</p>}
-
-      <div className="ops-list-shell team-recon-filters">
-        {showLedger && <ReconOverview title={CARD_SNAPSHOT_TITLE} month={month} reconDay={reconDay} payCycle={payCycle} settlementRule={settlementRule}>
-          <div><dt>当前筛选分成合计</dt><dd className={wiring || data?.share_sum == null ? "is-unavailable" : undefined}>{shareTotal}</dd></div>
-          <div><dt>本方全部分成合计</dt><dd className={wiring || data?.share_sum_all == null ? "is-unavailable" : undefined}>{wiring ? BACKEND_NOT_WIRED : moneyCell(data?.share_sum_all ?? null)}</dd></div>
-        </ReconOverview>}
-        {filters}
-      </div>
-      {fetchState.loading && !data && !fail && <p className="ops-list-shell team-recon-loading" role="status">正在读取对账数据…</p>}
-
-      {/* 整页态:KLT-O20701(⛔ 重试)/KLT-O20703(筛选条保留,①—⑥ 全替换,⛔ 渲染空表)/KLT-P301。 */}
-      {fail?.kind === "binding" && <FullPageState text={VIEW_BINDING_FAILED} />}
-      {fail?.kind === "snapshot" && <FullPageState text={VIEW_SNAPSHOT_NOT_READY} retry={fetchState.reload} />}
-      {snapshotNotReady && <FullPageState text={VIEW_SNAPSHOT_NOT_READY} retry={fetchState.reload} />}
-      {fail?.kind === "forbidden" && <FullPageState text={VIEW_ROLE_FORBIDDEN} />}
-      {fail?.kind === "param" && <FullPageState text={VIEW_FILTER_INCOMPLETE} />}
-      {fail?.kind === "fail" && <FullPageState text={fail.message} retry={fetchState.reload} />}
-
-      {showLedger && (
-        <>
-          {/* ⑤ 表 1 本方对账清单(出账状态与批次状态两维度两列并排)。 */}
-          <div className="ops-list-shell team-recon-ledger">
-            <header className="team-recon-ledger-heading">
-              <h2 id="party-recon-batches">对账清单</h2>
-              {!wiring && <span>共 {batchTotal},当前显示 {data?.batch_shown} 批</span>}
-            </header>
-            <div className="ops-table-wrap" role="region" aria-labelledby="party-recon-batches" tabIndex={0}>
-              <table className="ops-table" aria-labelledby="party-recon-batches" aria-busy={fetchState.loading}>
-                <OpsTableColumns widths={[210, 102, 112, 112, 100, 145, 286]} />
-                <thead><tr><th scope="col">对账单号</th><th scope="col">自然月</th><th scope="col">出账状态</th><th scope="col">批次状态</th><th scope="col">明细条数</th><th scope="col">本方分成金额</th><th scope="col">操作</th></tr></thead>
-                <tbody>
-                  {wiring ? (
-                    <tr><td colSpan={7}><Tri tone="missing" text={BACKEND_NOT_WIRED} /></td></tr>
-                  ) : (
-                    batches.map((row: ViewReconBatchRow) => (
-                      <tr key={row.batch_no}>
-                        <td className="ops-mono" title={row.batch_no}>{row.batch_no}</td>
-                        <td>{row.period}</td>
-                        <td><OpsStatus tone={row.reconcile_status === "settled" ? "success" : row.reconcile_status === "abnormal" ? "danger" : "neutral"}>{RECONCILE_STATUS_TEXT[row.reconcile_status]}</OpsStatus></td>
-                        <td><OpsStatus tone={row.status === "executed" ? "success" : row.status === "failed" ? "danger" : "neutral"}>{BATCH_STATUS_TEXT[row.status]}</OpsStatus></td>
-                        <td className="table-number">{row.detail_count}</td>
-                        <td><strong className="reconcile-money table-number">{moneyFromCents(row.share_cents)}</strong></td>
-                        <td>
-                          {/* 无明细 ⇒ 导出按钮整块不渲染(⚠️ 不是禁用,总则§16.9;KLT-H205xx 仅直调防护)。 */}
-                          {row.has_detail && (
-                            <button type="button" className="ops-table-action" onClick={() => exportBatch(row.batch_no)}>
-                              <Download size={14} aria-hidden="true" />导出明细
-                            </button>
-                          )}{" "}
-                          <button type="button" className="ops-table-action" onClick={() => drillBatch(row.batch_no)}>查看明细<ArrowDown size={14} aria-hidden="true" /></button>
-                          {kind === "partner" && <>{" "}<Link className="ops-table-action" to={partnerReconDetailPath(row.batch_no)} state={linkState}>查看详情<ArrowRight size={14} aria-hidden="true" /></Link></>}
-                        </td>
-                      </tr>
-                    ))
-                  )}
-                  {!wiring && !batches.length && (
-                    <OpsTableEmpty colSpan={7}>
-                      {VIEW_LIST_EMPTY}{!month && `;${VIEW_ALL_PERIODS_NOTE}`}
-                    </OpsTableEmpty>
-                  )}
-                </tbody>
-              </table>
-            </div>
-            {!wiring && (
-              <ServerListPager
-                total={data?.batch_total ?? 0}
-                page={page}
-                pageSize={pageSize}
-                onPageChange={setPage}
-                unit="批"
-              />
-            )}
-          </div>
-
-          {/* 账单明细由接口按已出账口径返回。 */}
-          <div className="ops-list-shell team-recon-ledger team-recon-details" ref={detailRef} tabIndex={-1}>
-            <header className="team-recon-ledger-heading">
-              <h2 id="party-recon-bills">账单明细</h2>
-              {!wiring && <span>共 {detailTotal},当前显示 {data?.detail_shown} 条</span>}
-            </header>
-            {!teamView && <p className="team-recon-ledger-note" role="note">{VIEW_DETAIL_ONLY_SETTLED}</p>}
-            <div className="ops-table-wrap" role="region" aria-labelledby="party-recon-bills" tabIndex={0}>
-              <table className="ops-table" aria-labelledby="party-recon-bills" aria-busy={fetchState.loading}>
-                <OpsTableColumns widths={[200, 210, 155, 102, 138, 170, 126]} />
-                <thead><tr><th scope="col">账单明细号</th><th scope="col">客户名称</th><th scope="col">应收单号</th><th scope="col">自然月</th><th scope="col">应结金额</th><th scope="col">对账单号</th><th scope="col">操作</th></tr></thead>
-                <tbody>
-                  {wiring ? (
-                    <tr><td colSpan={7}><Tri tone="missing" text={BACKEND_NOT_WIRED} /></td></tr>
-                  ) : (
-                    details.map((row: ViewBillDetailRow) => (
-                      <tr key={row.bill_detail_id}>
-                        <td className="ops-mono" title={row.bill_detail_id}>{row.bill_detail_id}</td>
-                        <td>
-                          {/* C76:当前归属≠我 ⇒ 纯文本无链接+「归属已变更」;teamLead 无客户详情页 ⇒ 恒纯文本。 */}
-                          {kind === "partner" && row.customer_visible ? (
-                            <Link className="table-cell-title team-recon-customer-link" to={`${prefix}/customer/${encodeURIComponent(row.customer_id)}`} state={linkState} title={row.customer_name}>{row.customer_name}</Link>
-                          ) : (
-                            <span className="table-cell-title" title={row.customer_name}>
-                              {row.customer_name}{!row.customer_visible && <OpsTag tone="neutral">{OWNERSHIP_CHANGED}</OpsTag>}
-                            </span>
-                          )}
-                        </td>
-                        <td className="ops-mono" title={row.receivable_no}>{row.receivable_no}</td>
-                        <td>{row.period}</td>
-                        <td><strong className="reconcile-money table-number">{moneyFromCents(row.receivable_cents)}</strong></td>
-                        <td className="ops-mono" title={row.batch_no}>{row.batch_no}</td>
-                        <td><Link className="ops-table-action" to={`${prefix}/bill-detail/${encodeURIComponent(row.bill_detail_id)}`} state={linkState}>查看详情<ArrowRight size={14} aria-hidden="true" /></Link></td>
-                      </tr>
-                    ))
-                  )}
-                  {!wiring && !details.length && (
-                    <OpsTableEmpty colSpan={7}>
-                      {VIEW_LIST_EMPTY}{!month && `;${VIEW_ALL_PERIODS_NOTE}`}
-                    </OpsTableEmpty>
-                  )}
-                </tbody>
-              </table>
-            </div>
-            {!wiring && (
-              <ServerListPager
-                total={data?.detail_total ?? 0}
-                page={page}
-                pageSize={pageSize}
-                onPageChange={setPage}
-              />
-            )}
-          </div>
-        </>
-      )}
-    </section>
-  );
+  return { ...query, data: fail ? null : response.data, state: { ...response, fail }, filters };
 }
 
-export function PartnerReconPage() {
-  return <PartyReconMergedPage kind="partner" />;
+const scopedReconColumns = [
+  { label: "对账单号 / 自然月", width: 200 },
+  { label: "出账状态", width: 100 },
+  { label: "批次状态", width: 100 },
+  { label: "明细条数", width: 85, numeric: true },
+  { label: "本方分成金额", width: 126, numeric: true },
+] as const;
+
+export function ScopedReconPage({ kind }: { kind: ScopedReconKind }) {
+  const { data, state, filters, month, batch, page, setPage, linkState } = useScopedLedger(kind);
+  const [notice, setNotice] = useState("");
+  const exportBatch = useExportBatch(setNotice);
+  const config = data?.config;
+  const rule = data?.settle;
+  const prefix = kindPrefix(kind);
+
+  return <section className="ops-page reconcile-index page-fill page-fill-window">
+    <header className="ops-heading statement-heading"><div>
+      <h1>对账清单</h1>
+      <PageIntro>按账期核对本方分成金额,从对账批次查看对应的账单明细。</PageIntro>
+    </div></header>
+    {!state.fail && <div className="ops-list-shell" aria-busy={state.loading}>
+      <ReconOverview title="本方对账概况" month={month}
+        reconDay={!data ? "—" : !config ? BACKEND_NOT_WIRED : config.recon_day == null ? VIEW_CONFIG_UNSET : `每月 ${config.recon_day} 日`}
+        payCycle={!data ? "—" : config ? label(PAY_CYCLE, config.pay_cycle) || VIEW_DEFAULT_PAY_CYCLE : BACKEND_NOT_WIRED}
+        settlementRule={!data ? "—" : rule && (rule.mode != null || rule.value != null) ? settleTextFromSnapshot(rule.mode, rule.value) : WORD_UNCONFIGURED}>
+        <div><dt>当前筛选分成合计</dt><dd className={state.loading || data?.share_sum == null ? "is-unavailable" : undefined}>{state.loading ? "—" : moneyCell(data?.share_sum ?? null)}</dd></div>
+        <div><dt>本方全部分成合计</dt><dd className={data?.share_sum_all == null ? "is-unavailable" : undefined}>{!data ? "—" : moneyCell(data.share_sum_all)}</dd></div>
+      </ReconOverview>
+    </div>}
+    <PartyLedger title="对账清单" columns={scopedReconColumns} actionWidth={kind === "partner" ? 260 : 192} filters={filters} dataState={state}
+      total={data?.batch_shown ?? 0} page={page} setPage={setPage} unit="批" empty={month || batch ? "没有符合筛选条件的对账批次。" : "暂无对账批次。"}>
+      {data?.batches.map((row) => <tr key={row.batch_no}>
+        <td><span className="table-cell-title" title={row.batch_no}>{row.batch_no}</span><small>{row.period}</small></td>
+        <td><OpsStatus tone={row.reconcile_status === "settled" ? "success" : row.reconcile_status === "abnormal" ? "danger" : "neutral"}>{RECONCILE_STATUS_TEXT[row.reconcile_status]}</OpsStatus></td>
+        <td><OpsStatus tone={row.status === "executed" ? "success" : row.status === "failed" ? "danger" : "neutral"}>{BATCH_STATUS_TEXT[row.status]}</OpsStatus></td>
+        <td className="settlement-ledger-number"><span className="table-number">{row.detail_count}</span><span className="settlement-ledger-unit"> 条</span></td>
+        <td className="settlement-ledger-number"><span className="ops-money settlement-ledger-share">{moneyFromCents(row.share_cents)}</span></td>
+        <td className="settlement-ledger-action">
+          {row.has_detail && <button type="button" className="ops-table-action" onClick={() => exportBatch(row.batch_no)}><Download size={14} aria-hidden="true" />导出明细</button>}
+          <Link className="ops-table-action" to={`${prefix}/bill-detail?${new URLSearchParams({ batch: row.batch_no, month: row.period })}`} state={linkState}>查看明细<ArrowRight size={14} aria-hidden="true" /></Link>
+          {kind === "partner" && <Link className="ops-table-action" to={partnerReconDetailPath(row.batch_no)} state={linkState}>查看详情<ArrowRight size={14} aria-hidden="true" /></Link>}
+        </td>
+      </tr>)}
+    </PartyLedger>
+    {notice && <OpsNotice message={notice} onClose={() => setNotice("")} />}
+  </section>;
 }
-export function TeamReconPage() {
-  return <PartyReconMergedPage kind="team" />;
+
+const scopedBillColumns = [
+  { label: "客户 / 账单明细号", width: 205 },
+  { label: "应收单号", width: 160 },
+  { label: "自然月", width: 88 },
+  { label: "应结金额", width: 122, numeric: true },
+  { label: "对账单号", width: 170 },
+] as const;
+
+export function ScopedBillListPage({ kind }: { kind: ScopedReconKind }) {
+  const { data, state, filters, location, month, batch, page, setPage, linkState } = useScopedLedger(kind);
+  const prefix = kindPrefix(kind);
+  const listPath = `${prefix}/bill-detail`;
+  const back = detailBack(location.state, listPath, BACK_TO_BILL_DETAIL_LIST);
+  return <section className="ops-page reconcile-index page-fill page-fill-window">
+    {back.to !== listPath && <Link className="ops-back-link self-start" to={back.to} state={back.state}><ArrowLeft size={16} aria-hidden="true" />{back.label.replace(/^←\s*/, "")}</Link>}
+    <header className="ops-heading statement-heading"><div>
+      <h1>账单明细</h1>
+      <PageIntro>按账期查看本方已出账的应结金额,核对每笔明细对应的客户和对账单。</PageIntro>
+    </div></header>
+    <PartyLedger title="账单明细" columns={scopedBillColumns} filters={filters} dataState={state}
+      total={data?.detail_shown ?? 0} page={page} setPage={setPage} unit="条" empty={month || batch ? "没有符合筛选条件的账单明细。" : "暂无已出账的账单明细。"}>
+      {data?.details.map((row) => <tr key={row.bill_detail_id}>
+        <td>
+          {kind === "partner" && row.customer_visible
+            ? <Link className="table-cell-title text-primary" to={`${prefix}/customer/${encodeURIComponent(row.customer_id)}`} state={linkState} title={row.customer_name}>{row.customer_name}</Link>
+            : <span className="table-cell-title" title={row.customer_name}>{row.customer_name}{!row.customer_visible && <OpsTag tone="neutral">{OWNERSHIP_CHANGED}</OpsTag>}</span>}
+          <small title={row.bill_detail_id}>{row.bill_detail_id}</small>
+        </td>
+        <td className="ops-mono" title={row.receivable_no}>{row.receivable_no}</td>
+        <td>{row.period}</td>
+        <td className="settlement-ledger-number"><span className="ops-money settlement-ledger-share">{moneyFromCents(row.receivable_cents)}</span></td>
+        <td className="ops-mono" title={row.batch_no}>{row.batch_no}</td>
+        <td className="settlement-ledger-action"><Link className="ops-table-action" to={`${listPath}/${encodeURIComponent(row.bill_detail_id)}`} state={linkState}>详情<ArrowRight size={14} aria-hidden="true" /></Link></td>
+      </tr>)}
+    </PartyLedger>
+  </section>;
 }
 
 /* ── V-P5 运营商「对账清单」 ── */
@@ -601,21 +448,9 @@ const operatorBillColumns = [
 ] as const;
 
 export function OperatorBillDetailPage() {
-  const location = useLocation();
-  const [params, setParams] = useSearchParams();
-  const month = params.get("month") ?? "";
-  const batch = params.get("batch") ?? "";
+  const { location, params, month, batch, page, setFilter, setPage, reset, linkState } = useLedgerQuery();
   const customer = params.get("customer") ?? "";
-  const page = Math.max(1, Number.parseInt(params.get("page") ?? "", 10) || 1);
   const back = detailBack(location.state, "/bos/ov/bill-detail", BACK_TO_BILL_DETAIL_LIST);
-  const linkState = detailLinkState(location.pathname + location.search + location.hash, location.state);
-
-  function setFilter(key: "month" | "batch" | "customer" | "page", value: string) {
-    const next = new URLSearchParams(params);
-    if (value) next.set(key, value); else next.delete(key);
-    if (key !== "page") next.delete("page");
-    setParams(next, { replace: true, state: location.state });
-  }
 
   const fetchState = useViewFetch(
     () => billGetList({ page: page - 1, page_size: PARTY_PAGE_SIZE, period: month || undefined, keyword: batch.trim() || undefined, customer_kw: customer.trim() || undefined }),
@@ -626,7 +461,7 @@ export function OperatorBillDetailPage() {
     <PartySearch label="搜索对账单号" placeholder="搜索对账单号" value={batch} onChange={(value) => setFilter("batch", value)} />
     <PartySearch label="搜索客户" placeholder="搜索客户名称" value={customer} onChange={(value) => setFilter("customer", value)} />
     <MonthFilter value={month} onChange={(value) => setFilter("month", value)} />
-    {filtered && <Button variant="ghost" size="sm" onClick={() => setParams({}, { replace: true, state: location.state })}>重置筛选</Button>}
+    {filtered && <Button variant="ghost" size="sm" onClick={reset}>重置筛选</Button>}
   </>;
 
   return <section className="ops-page reconcile-index page-fill page-fill-window">
@@ -636,7 +471,7 @@ export function OperatorBillDetailPage() {
       <PageIntro>按客户和订阅核对已出账的计费天数、分成基数及本方分成。</PageIntro>
     </div></header>
     <PartyLedger title="账单明细" columns={operatorBillColumns} filters={filters} dataState={fetchState} total={fetchState.data?.total ?? 0}
-      page={page} setPage={(next) => setFilter("page", next > 1 ? String(next) : "")} unit="条" empty={filtered ? "没有符合筛选条件的账单明细。" : "暂无已出账的账单明细。"}>
+      page={page} setPage={setPage} unit="条" empty={filtered ? "没有符合筛选条件的账单明细。" : "暂无已出账的账单明细。"}>
       {fetchState.data?.items.map((row) => <tr key={row.bill_detail_id}>
         <td><span className="table-cell-title" title={row.customer_name}>{row.customer_name}</span><small title={row.bill_detail_id}>{row.bill_detail_id}</small></td>
         <td title={row.subscription_label}>{row.subscription_label || <span className="table-placeholder">—</span>}</td>
@@ -874,11 +709,7 @@ function PartyContractDetail({ kind, id }: { kind: "partner" | "operator"; id: s
 export function PartyBillDetailPage({ kind }: { kind: "operator" | "team" }) {
   const { id = "" } = useParams();
   const location = useLocation();
-  const fallback =
-    kind === "team"
-      ? { to: "/bos/tv/recon", text: BACK_TO_SELF_RECON }
-      : { to: "/bos/ov/bill-detail", text: BACK_TO_BILL_DETAIL_LIST };
-  const back = detailBack(location.state, fallback.to, fallback.text);
+  const back = detailBack(location.state, `${kindPrefix(kind)}/bill-detail`, BACK_TO_BILL_DETAIL_LIST);
   const fetchState = useViewFetch<BillDetailResult>(() => billGetDetail(id), [id]);
   const { data, fail } = fetchState;
   return (

+ 3 - 3
web-scaffold/src/pages/SettlementRecordPages.tsx

@@ -63,7 +63,7 @@ import {
   VOIDED_BY_PREFIX,
   ZERO_NOTE_TEXT,
 } from "../lib/copy-billing";
-import { BACK_TO_REGION_RECON } from "../lib/copy-views";
+import { BACK_TO_BILL_DETAIL_LIST } from "../lib/copy-views";
 import "../styles/operations.css";
 import "../styles/settlement-records.css";
 
@@ -539,7 +539,7 @@ function BatchRecordPage({ no, partnerView }: { no?: string; partnerView: boolea
   const navigate = useNavigate();
   const location = useLocation();
   const back = partnerView
-    ? detailBack(location.state, "/bos/pv/recon", BACK_TO_REGION_RECON)
+    ? detailBack(location.state, "/bos/pv/recon", BACK_TO_RECON_LIST)
     : detailBack(location.state, "/settlement-batches", BACK_TO_RECON_LIST);
   const [tab, setTab] = useState<BatchRecordTab>(() =>
     batchRecordTabs.find(({ id }) => id === location.state?.statementTab)?.id ?? "overview");
@@ -1028,7 +1028,7 @@ export function SettlementBillRecordPage({ partnerView = false }: { partnerView?
 function BillRecordPage({ index, partnerView }: { index?: string; partnerView: boolean }) {
   const location = useLocation();
   const back = partnerView
-    ? detailBack(location.state, "/bos/pv/recon", BACK_TO_REGION_RECON)
+    ? detailBack(location.state, "/bos/pv/bill-detail", BACK_TO_BILL_DETAIL_LIST)
     : detailBack(location.state, "/settlement-bills", BACK_TO_BILL_LIST);
 
   const detail = useBillDetail(index ?? null);

+ 38 - 2
web-scaffold/src/pages/__tests__/party-ledger-navigation.test.tsx

@@ -1,8 +1,8 @@
 import { cleanup, fireEvent, render, screen, waitFor } from "@testing-library/react";
 import { MemoryRouter, Route, Routes } from "react-router";
 import { afterEach, beforeEach, expect, it, vi } from "vitest";
-import { billGetList, contractGet, contractGetList, customerGet, customerGetList, reconGetList } from "../../lib/api/bos";
-import { OperatorBillDetailPage, OperatorReconPage, PartyContractDetailPage, PartyContractListPage, PartyCustomerDetailPage, PartyCustomerListPage } from "../PartyViewPages";
+import { billGetList, contractGet, contractGetList, customerGet, customerGetList, reconGetList, viewPartnerRecon } from "../../lib/api/bos";
+import { OperatorBillDetailPage, OperatorReconPage, PartyContractDetailPage, PartyContractListPage, PartyCustomerDetailPage, PartyCustomerListPage, ScopedBillListPage, ScopedReconPage } from "../PartyViewPages";
 
 vi.mock("../../lib/api/bos", async (load) => ({
   ...await load<typeof import("../../lib/api/bos")>(),
@@ -12,6 +12,7 @@ vi.mock("../../lib/api/bos", async (load) => ({
   customerGet: vi.fn(),
   customerGetList: vi.fn(),
   reconGetList: vi.fn(),
+  viewPartnerRecon: vi.fn(),
 }));
 
 beforeEach(() => {
@@ -24,6 +25,41 @@ afterEach(() => {
   vi.unstubAllGlobals();
 });
 
+it.each([
+  { kind: "partner", prefix: "/bos/pv" },
+  { kind: "team", prefix: "/bos/tv" },
+] as const)("$kind 的两张台账独立分页,按批次查看明细后可返回原筛选", async ({ kind, prefix }) => {
+  vi.mocked(viewPartnerRecon).mockResolvedValue({
+    settle: { mode: null, value: null }, config: { recon_day: 8, pay_cycle: "monthly" },
+    share_sum: 9000, share_sum_all: 80000, month_options: [], snapshot_state: "ok",
+    batch_total: 140, batch_shown: 21, detail_total: 320, detail_shown: 1,
+    batches: [{ batch_no: "B-21", period: "2026-09", reconcile_status: "settled", status: "executed", detail_count: 1, share_cents: 9000, has_detail: true }],
+    details: [{ bill_detail_id: "D-1", customer_id: "C-1", customer_name: "客户甲", customer_visible: true, receivable_no: "R-1", period: "2026-09", batch_no: "B-21", receivable_cents: 18000 }],
+  });
+  const entry = `${prefix}/recon?month=2026-09&page=2`;
+  render(<MemoryRouter initialEntries={[entry]}><Routes>
+    <Route path={`${prefix}/recon`} element={<ScopedReconPage kind={kind} />} />
+    <Route path={`${prefix}/bill-detail`} element={<ScopedBillListPage kind={kind} />} />
+  </Routes></MemoryRouter>);
+
+  expect(await screen.findByText("共 21 批 · 第 21–21 条")).toBeTruthy();
+  expect(screen.getAllByRole("table")).toHaveLength(1);
+  fireEvent.click(screen.getByRole("link", { name: "查看明细" }));
+  expect(await screen.findByText("共 1 条 · 第 1–1 条")).toBeTruthy();
+  expect(screen.getAllByRole("table")).toHaveLength(1);
+  expect(viewPartnerRecon).toHaveBeenLastCalledWith({ month: "2026-09", keyword: "B-21", page: 0, page_size: 20 });
+  expect(screen.getByRole("link", { name: "详情" }).getAttribute("href")).toBe(`${prefix}/bill-detail/D-1`);
+  const customerLink = screen.queryByRole("link", { name: "客户甲" });
+  if (kind === "partner") expect(customerLink?.getAttribute("href")).toBe(`${prefix}/customer/C-1`);
+  else expect(customerLink).toBeNull();
+  fireEvent.click(screen.getByRole("button", { name: "重置筛选" }));
+  const back = screen.getByRole("link", { name: "返回对账清单" });
+  expect(back.getAttribute("href")).toBe(entry);
+  fireEvent.click(back);
+  expect(await screen.findByText("共 21 批 · 第 21–21 条")).toBeTruthy();
+  expect(viewPartnerRecon).toHaveBeenLastCalledWith({ month: "2026-09", keyword: undefined, page: 1, page_size: 20 });
+});
+
 it("运营商从批次打开同月账单,重置后仍能返回原对账清单", async () => {
   vi.mocked(reconGetList).mockResolvedValue({
     total: 1,

+ 1 - 1
web-scaffold/src/pages/__tests__/settlement-bill-record.test.tsx

@@ -134,5 +134,5 @@ it("合伙人账单只显示本方分成,并链接到本方对账批次", asyn
   fireEvent.click(await screen.findByRole("tab", { name: "分成与对账" }));
   expect(screen.queryByText("渠道伙伴")).toBeNull();
   expect(screen.getByRole("link", { name: "RECON-001" }).getAttribute("href")).toBe("/bos/pv/recon/RECON-001");
-  expect(screen.getByRole("link", { name: "返回本运营区域对账" }).getAttribute("href")).toBe("/bos/pv/recon");
+  expect(screen.getByRole("link", { name: "返回账单明细" }).getAttribute("href")).toBe("/bos/pv/bill-detail");
 });

+ 1 - 1
web-scaffold/src/pages/__tests__/settlement-statement-record.test.tsx

@@ -129,6 +129,6 @@ it("合伙人批次只读,账单下钻和返回保留原批次页签和列表
   fireEvent.click(link);
   fireEvent.click(await screen.findByRole("link", { name: "返回对账清单详情" }));
   expect(await screen.findByRole("tabpanel", { name: /账单明细/ })).toBeTruthy();
-  fireEvent.click(screen.getByRole("link", { name: "返回本运营区域对账" }));
+  fireEvent.click(screen.getByRole("link", { name: "返回对账清单" }));
   expect(screen.getByLabelText("对账清单筛选").textContent).toBe(JSON.stringify({ month: "2026-10", page: 3 }));
 });

+ 6 - 4
web-scaffold/tests/demo-navigation.test.mjs

@@ -52,7 +52,8 @@ function prototypeMenu(identity) {
     { title: "团队客户", section: "团队管理" },
     { title: "成员与负责范围", section: "团队管理" },
     { title: "分派方式", section: "团队管理" },
-    { title: "本方对账", section: "对账与分成" },
+    { title: "对账清单", section: "对账与分成" },
+    { title: "账单明细", section: "对账与分成" },
     // 2026-11-18:第 10 册读口就绪位已下发 true ⇒ 变更记录入口渲染(`/bos/tv/n`)。
     { title: "本方变更记录", section: "变更与范围" },
   ];
@@ -61,7 +62,8 @@ function prototypeMenu(identity) {
     { title: "全部工单", section: "" },
   ];
   if (identity.role === "partner") return [
-    { title: "本运营区域对账", section: "对账与分成" },
+    { title: "对账清单", section: "对账与分成" },
+    { title: "账单明细", section: "对账与分成" },
     { title: "客户清单", section: "客户与合同" },
     { title: "合同清单", section: "客户与合同" },
     { title: "本方变更记录", section: "变更与范围" },
@@ -104,8 +106,8 @@ test("主子账号差异及角色首屏遵循原型,不落到总运营概览",
 
 test("第 8 册详情路由可高亮正确菜单,旧运营侧路由不越权高亮", () => {
   const partner = getDemoNavigation(findDemoIdentity("邹合"));
-  assert.equal(getActiveDemoNavigation(partner, "/bos/pv/recon/recon-1").id, "region");
-  assert.equal(getActiveDemoNavigation(partner, "/bos/pv/bill-detail/bill-1").id, "region");
+  assert.equal(getActiveDemoNavigation(partner, "/bos/pv/recon/recon-1").id, "statements");
+  assert.equal(getActiveDemoNavigation(partner, "/bos/pv/bill-detail/bill-1").id, "bills");
   assert.equal(getActiveDemoNavigation(partner, "/bos/pv/customer/KL-2026-0001").id, "enterprises");
   assert.equal(getActiveDemoNavigation(partner, "/bos/pv/n").id, "changeLog");
   assert.equal(getActiveDemoNavigation(partner, "/settlement-batches/pt-0/2026-10"), undefined);

+ 1 - 1
web-scaffold/tests/detail-navigation.test.mjs

@@ -47,7 +47,7 @@ test("团队账号、只读台账和移动端支持返回各自的入口", () =>
   for (const [from, label] of [
     ["/organization/maintenance-teams?region=R-1", "返回运维团队"],
     ["/organization/operations-teams/T-1/accounts", "返回运营团队账号"],
-    ["/bos/pv/recon", "返回本运营区域对账"],
+    ["/bos/pv/recon", "返回对账清单"],
     ["/bos/ov/bill-detail?batch=B-2", "返回账单明细"],
     ["/m/work-orders/T-1", "返回移动端工单详情"],
     ["/workspace/submit", "返回提交工单"],