소스 검색

style(web): 对齐本运营区域对账与本方对账布局

sy 3 일 전
부모
커밋
13eaa47d22
2개의 변경된 파일과 40개의 추가작업 그리고 87개의 파일을 삭제
  1. 36 86
      web-scaffold/src/pages/PartyViewPages.tsx
  2. 4 1
      web-scaffold/src/styles/settlement-records.css

+ 36 - 86
web-scaffold/src/pages/PartyViewPages.tsx

@@ -230,7 +230,7 @@ function PartyReconMergedPage({ kind }: { kind: "partner" | "team" }) {
   function drillBatch(batchNo: string) {
     setKeyword(batchNo);
     setPage(1);
-    if (teamView) detailRef.current?.focus({ preventScroll: true });
+    detailRef.current?.focus({ preventScroll: true });
     detailRef.current?.scrollIntoView({ behavior: "smooth", block: "start" });
   }
 
@@ -245,13 +245,12 @@ function PartyReconMergedPage({ kind }: { kind: "partner" | "team" }) {
   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 allShares = wiring ? "—" : `本方全部合计 ${moneyCell(data?.share_sum_all ?? null)}`;
   const showLedger = wiring || (data && !snapshotNotReady);
 
   const pageSize = 20;
 
   const filters = <>
-    <div className={teamView ? "ops-toolbar team-recon-toolbar" : "reconcile-filters"}>
+    <div className="ops-toolbar team-recon-toolbar">
       <label className="ops-search">
         <Search size={17} aria-hidden="true" />
         <Input
@@ -276,8 +275,8 @@ function PartyReconMergedPage({ kind }: { kind: "partner" | "team" }) {
         <option value="">{ALL_PERIODS_LABEL}</option>
         {(monthOptions ?? (month ? [{ period: month }] : [])).map((o) => <option key={o.period} value={o.period}>{o.period}</option>)}
       </FilterSelect>}
-      {(!teamView || month || keyword) && <Button variant="ghost" size="sm" onClick={resetFilter}>重置筛选</Button>}
-      {teamView && fetchState.loading && data && <span className="team-recon-filter-hint" role="status">
+      {(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>
@@ -288,10 +287,9 @@ function PartyReconMergedPage({ kind }: { kind: "partner" | "team" }) {
   </>;
 
   return (
-    <section className={`ops-page reconcile-index ${teamView ? "team-recon-view" : "page-fill"}`}>
-      <header className={teamView ? "ops-heading statement-heading" : "reconcile-page-heading"}>
+    <section className="ops-page reconcile-index team-recon-view">
+      <header className="ops-heading statement-heading">
         <div>
-          {!teamView && <p className="ops-eyebrow"><span /> READONLY / 只读视图</p>}
           <h1>{title}</h1>
           <PageIntro>{teamView ? "按账期查看团队的对账批次、已出账明细和分成金额。" : "从每个账期的对账批次查到本方参与的结算和分成。"}</PageIntro>
         </div>
@@ -299,7 +297,7 @@ function PartyReconMergedPage({ kind }: { kind: "partner" | "team" }) {
       {notice && <OpsNotice message={notice} onClose={() => setNotice("")} />}
       {wiring && <p className="ops-import-note" role="status">{VIEW_WIRING_NOTE}</p>}
 
-      {teamView ? <div className="ops-list-shell team-recon-filters">
+      <div className="ops-list-shell team-recon-filters">
         {showLedger && <div className="team-recon-overview">
           <section className="team-recon-snapshot" aria-labelledby="team-recon-snapshot-title">
             <header>
@@ -318,8 +316,8 @@ function PartyReconMergedPage({ kind }: { kind: "partner" | "team" }) {
           </dl>
         </div>}
         {filters}
-      </div> : filters}
-      {teamView && fetchState.loading && !data && !fail && <p className="ops-list-shell team-recon-loading" role="status">正在读取本方对账…</p>}
+      </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} />}
@@ -331,64 +329,15 @@ function PartyReconMergedPage({ kind }: { kind: "partner" | "team" }) {
 
       {showLedger && (
         <>
-          {!teamView && <>
-          {/* ① 页顶配置卡(V6,当前):两格都给**生效的具体取值**(✅ 2026-11-18:
-              付款周期不再渲染「留空=跟随默认」——那不是取值),对账日缺失才回落原标题。 */}
-          <div className="reconcile-totals" aria-label="本方对账配置">
-            <div>
-              <span>本方对账日</span>
-              <strong>{reconDay}</strong>
-              <small>当前生效配置</small>
-            </div>
-            <div>
-              <span>付款周期</span>
-              <strong>{payCycle}</strong>
-              <small>当前生效配置</small>
-            </div>
-          </div>
-
-          {/* ② 卡 1:标题固定(14.2②);未配 ⇒「未配置」,⛔ 显 0/空白。 */}
-          <div className="reconcile-totals" aria-label={CARD1_TITLE}>
-            <div>
-              <span>{CARD1_TITLE}</span>
-              <strong>{settlementRule}</strong>
-              <small>档案现值,不按客户配</small>
-            </div>
-          </div>
-
-          {/* ③ 卡 2/3:标题固定「本期按账期快照」+副标题账期(与②「(现行)」同屏共存=时点口径对外声明)。 */}
-          <p className="ops-eyebrow" style={{ marginTop: 8 }}>
-            {CARD_SNAPSHOT_TITLE}(账期 {month || ALL_PERIODS_LABEL})
-          </p>
-          <div className="reconcile-totals" aria-label={CARD_SNAPSHOT_TITLE}>
-            <div>
-              <span>本方对账清单</span>
-              <strong>{batchTotal}</strong>
-              <small>{wiring ? "—" : `当前显示 ${data?.batch_shown ?? 0} 批`}</small>
-            </div>
-            <div>
-              <span>本方账单明细</span>
-              <strong>{detailTotal}</strong>
-              <small>{wiring ? "—" : `当前显示 ${data?.detail_shown ?? 0} 条`}</small>
-            </div>
-            {/* ④ 卡 4:当前筛选合计+本方全部合计双值常驻(视图§4.2 条 7);null ⇒ 取数失败 ⛔ 显 ¥0。 */}
-            <div>
-              <span>本方分成合计</span>
-              <strong>{shareTotal}</strong>
-              <small>{allShares}</small>
-            </div>
-          </div>
-          </>}
-
           {/* ⑤ 表 1 本方对账清单(出账状态与批次状态两维度两列并排)。 */}
-          <div className={teamView ? "ops-list-shell team-recon-ledger" : "reconcile-ledger list-shell-fill"}>
-            {teamView && <header className="team-recon-ledger-heading">
-              <h2 id="team-recon-batches">对账清单</h2>
+          <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={teamView ? "region" : undefined} aria-labelledby={teamView ? "team-recon-batches" : undefined} tabIndex={teamView ? 0 : undefined}>
-              <table className="ops-table" aria-labelledby={teamView ? "team-recon-batches" : undefined} aria-busy={teamView ? fetchState.loading : undefined}>
-                {teamView && <OpsTableColumns widths={[210, 102, 112, 112, 100, 145, 286]} />}
+            </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 ? (
@@ -396,20 +345,20 @@ function PartyReconMergedPage({ kind }: { kind: "partner" | "team" }) {
                   ) : (
                     batches.map((row: ViewReconBatchRow) => (
                       <tr key={row.batch_no}>
-                        <td className="ops-mono" title={teamView ? row.batch_no : undefined}>{row.batch_no}</td>
+                        <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={teamView ? "reconcile-money table-number" : "table-number"}>{moneyFromCents(row.share_cents)}</strong></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" /> {teamView ? "导出明细" : "导出本批账单明细"}
+                              <Download size={14} aria-hidden="true" />导出明细
                             </button>
                           )}{" "}
-                          <button type="button" className="ops-table-action" onClick={() => drillBatch(row.batch_no)}>查看明细{teamView && <ArrowDown 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>
                         </td>
                       </tr>
                     ))
@@ -433,15 +382,16 @@ function PartyReconMergedPage({ kind }: { kind: "partner" | "team" }) {
             )}
           </div>
 
-          {/* ⑥ 表 2 本方账单明细(A18:只列已出账明细;灰底提示必显)。 */}
-          <div className={teamView ? "ops-list-shell team-recon-ledger team-recon-details" : "reconcile-ledger list-shell-fill"} ref={detailRef} tabIndex={teamView ? -1 : undefined}>
-            {teamView ? <header className="team-recon-ledger-heading">
-              <h2 id="team-recon-bills">账单明细</h2>
+          {/* 账单明细由接口按已出账口径返回。 */}
+          <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> : <p className="ops-import-note" role="note">{VIEW_DETAIL_ONLY_SETTLED}</p>}
-            <div className="ops-table-wrap" role={teamView ? "region" : undefined} aria-labelledby={teamView ? "team-recon-bills" : undefined} tabIndex={teamView ? 0 : undefined}>
-              <table className="ops-table" aria-labelledby={teamView ? "team-recon-bills" : undefined} aria-busy={teamView ? fetchState.loading : undefined}>
-                {teamView && <OpsTableColumns widths={[200, 210, 155, 102, 138, 170, 126]} />}
+            </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 ? (
@@ -449,23 +399,23 @@ function PartyReconMergedPage({ kind }: { kind: "partner" | "team" }) {
                   ) : (
                     details.map((row: ViewBillDetailRow) => (
                       <tr key={row.bill_detail_id}>
-                        <td className="ops-mono" title={teamView ? row.bill_detail_id : undefined}>{row.bill_detail_id}</td>
+                        <td className="ops-mono" title={row.bill_detail_id}>{row.bill_detail_id}</td>
                         <td>
                           {/* C76:当前归属≠我 ⇒ 纯文本无链接+「归属已变更」;teamLead 无客户详情页 ⇒ 恒纯文本。 */}
                           {kind === "partner" && row.customer_visible ? (
-                            <Link className="workspace-link" to={`${prefix}/customer/${encodeURIComponent(row.customer_id)}`} state={linkState}>{row.customer_name}</Link>
+                            <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={teamView ? "table-cell-title" : undefined} title={teamView ? row.customer_name : undefined}>
+                            <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={teamView ? row.receivable_no : undefined}>{row.receivable_no}</td>
+                        <td className="ops-mono" title={row.receivable_no}>{row.receivable_no}</td>
                         <td>{row.period}</td>
-                        <td><strong className={teamView ? "reconcile-money table-number" : "table-number"}>{moneyFromCents(row.receivable_cents)}</strong></td>
+                        <td><strong className="reconcile-money table-number">{moneyFromCents(row.receivable_cents)}</strong></td>
                         {/* 批次详情宿主路由未在 14.1 路由表声明(仅 14.6 返回链路提及)⇒ 纯文本,缺口已登记。 */}
-                        <td className="ops-mono" title={teamView ? row.batch_no : undefined}>{row.batch_no}</td>
-                        <td><Link className={teamView ? "ops-table-action" : "workspace-link"} to={`${prefix}/bill-detail/${encodeURIComponent(row.bill_detail_id)}`} state={linkState}>查看详情{teamView && <ArrowRight size={14} aria-hidden="true" />}</Link></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>
                     ))
                   )}

+ 4 - 1
web-scaffold/src/styles/settlement-records.css

@@ -60,6 +60,7 @@
 .team-recon-filters > .ops-import-note { margin: 0 24px 12px; }
 .team-recon-loading { display: block; margin: 0; padding: 38px 20px; color: var(--muted-foreground); text-align: center; font-size: var(--type-support); }
 .team-recon-ledger-heading { padding: 14px 24px; }
+.team-recon-ledger-note { margin: -5px 24px 12px; color: var(--muted-foreground); font-size: var(--type-meta); }
 .team-recon-details { scroll-margin-block-start: calc(4rem + 14px); }
 .team-recon-ledger > .ops-table-wrap { max-height: clamp(200px, 44dvh, 420px); overflow: auto; }
 .team-recon-ledger .ops-table { min-width: 900px; table-layout: fixed; }
@@ -68,6 +69,8 @@
 .team-recon-ledger .ops-table td:first-child:not([colspan]) { color: var(--text-secondary); font-size: var(--type-support); font-weight: 500; }
 .team-recon-ledger .ops-table td .reconcile-money { color: var(--primary); font-size: var(--type-comfort); font-weight: 500; }
 .team-recon-ledger .ops-table td .table-cell-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; white-space: normal; overflow-wrap: anywhere; }
+.team-recon-ledger .ops-table td .team-recon-customer-link { color: var(--primary); }
+.team-recon-ledger .ops-table td .team-recon-customer-link:is(:hover, :focus-visible) { text-decoration: underline; }
 .team-recon-ledger .ops-table :is(th:last-child, td:last-child:not([colspan])),
 .team-recon-ledger:not(.team-recon-details) .ops-table :is(th, td):is(:nth-child(5), :nth-child(6)),
 .team-recon-details .ops-table :is(th, td):nth-child(5) { text-align: end; }
@@ -78,7 +81,7 @@
   .team-recon-snapshot, .team-recon-config, .team-recon-ledger-heading { padding: 14px 18px; }
   .team-recon-config { border-inline-start: 0; border-block-start: 1px solid var(--border-subtle); }
   .team-recon-filter-hint { margin-inline-start: 0; }
-  .team-recon-filters > .ops-import-note { margin-inline: 18px; }
+  .team-recon-filters > .ops-import-note, .team-recon-ledger-note { margin-inline: 18px; }
 }
 
 .statement-progress { min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--card); }