|
|
@@ -8,9 +8,9 @@
|
|
|
* 「分成方式与取值」列走 ../lib/settle-text 单源(册 4 settle_text,⛔ 本册自造分成取值文案)。
|
|
|
* 禁项:⛔「按金额分成本期不计算」「未对账」「已打回」字样;⛔ 出账状态与批次状态混列;⛔ history.back()。
|
|
|
*/
|
|
|
-import { useEffect, useId, useState, type FormEvent } from "react";
|
|
|
+import { useEffect, useId, useState, type FormEvent, type ReactNode } from "react";
|
|
|
import { PageIntro } from "../components/PageIntro";
|
|
|
-import { ArrowLeft, ArrowRight, CalendarClock, ChevronDown, Download, FileSpreadsheet, ListFilter, RefreshCw, Search, TriangleAlert, X } from "lucide-react";
|
|
|
+import { ArrowLeft, ArrowRight, Building2, Calculator, CalendarClock, CalendarDays, ChevronDown, CircleDollarSign, Download, FileSpreadsheet, ListFilter, Receipt, RefreshCw, ScrollText, Search, TriangleAlert, X } from "lucide-react";
|
|
|
import { Link, useLocation, useNavigate, useParams, useSearchParams } from "react-router";
|
|
|
import { Button } from "../components/ui/button";
|
|
|
import { SearchInput } from "../components/ui/search-input";
|
|
|
@@ -18,9 +18,10 @@ import { FilterSelect } from "../components/ui/filter-select";
|
|
|
import { MonthFilter } from "../components/ui/month-filter";
|
|
|
import { ServerListPager } from "../components/ListPager";
|
|
|
import { OpsDialog, OpsNotice, OpsStatus, OpsTableColumns, OpsTableEmpty, OpsTag, type OpsTone } from "../components/OperationsKit";
|
|
|
+import { RecordTabs } from "../components/RecordTabs";
|
|
|
import { useDemoIdentity } from "../lib/demo-session";
|
|
|
import { entTeamGetList, operatorGetList, partnerGetList, reconExportDetail, reconExportList } from "../lib/api/bos";
|
|
|
-import type { HolderType, ReconBatchStatus, ReconcileStatus, ReconDetailResult } from "../lib/api/types";
|
|
|
+import type { BillDetailResult, HolderType, ReconBatchStatus, ReconcileStatus, ReconDetailResult } from "../lib/api/types";
|
|
|
import type { StatusTone } from "../domain/statuses";
|
|
|
import { WORD_FETCH_FAILED } from "../lib/api/lockedCopy";
|
|
|
import { settleTextFromSnapshot } from "../lib/settle-text";
|
|
|
@@ -877,13 +878,153 @@ export function SettlementBillListPage() {
|
|
|
);
|
|
|
}
|
|
|
|
|
|
-/* ── FN-08 明细详情(14.3 七段;字段按「钱是怎么来的」排序) ────────── */
|
|
|
+/* ── FN-08 明细详情(14.3) ──────────────────────────────────────── */
|
|
|
+
|
|
|
+const billRecordTabs = [
|
|
|
+ { id: "billing", label: "计费概况" },
|
|
|
+ { id: "costs", label: "成本明细" },
|
|
|
+ { id: "reconciliation", label: "分成与对账" },
|
|
|
+ { id: "accounts", label: "分账号计费" },
|
|
|
+] as const;
|
|
|
+type BillRecordTab = typeof billRecordTabs[number]["id"];
|
|
|
+
|
|
|
+function BillRecordPanel({ tab, active, children }: { tab: BillRecordTab; active: BillRecordTab; children: ReactNode }) {
|
|
|
+ return <section className="ops-record-card record-tab-panel bill-record-panel" id={`bill-record-panel-${tab}`}
|
|
|
+ role="tabpanel" aria-labelledby={`bill-record-tab-${tab}`} tabIndex={0} hidden={active !== tab}>
|
|
|
+ {children}
|
|
|
+ </section>;
|
|
|
+}
|
|
|
+
|
|
|
+function BillBatchLink({ holderId, number, from }: { holderId: string; number: string; from: string }) {
|
|
|
+ return <Link className="ops-table-action bill-record-batch-link" to={batchPath(holderId, number)} state={{ from }}>
|
|
|
+ <span>{number}</span><ArrowRight size={14} aria-hidden="true" />
|
|
|
+ </Link>;
|
|
|
+}
|
|
|
+
|
|
|
+function BillRecordContent({ bill, from }: { bill: BillDetailResult; from: string }) {
|
|
|
+ const [tab, setTab] = useState<BillRecordTab>("billing");
|
|
|
+ const actualCost = bill.cost_deduct_cents ?? (bill.receivable_cents - bill.share_base_cents);
|
|
|
+ const costCapped = bill.base_floor_protected || (
|
|
|
+ bill.cost_should_deduct_cents != null && bill.cost_deduct_cents != null && bill.cost_should_deduct_cents > bill.cost_deduct_cents
|
|
|
+ );
|
|
|
+ const missing = <span className="table-placeholder">—</span>;
|
|
|
+
|
|
|
+ return <>
|
|
|
+ {/* 尾月对齐前后的应收放在同一摘要内,切换页签时仍可对照。 */}
|
|
|
+ <dl className="customer-record-metrics bill-record-metrics" aria-label="账单金额摘要">
|
|
|
+ <div>
|
|
|
+ <dt><Calculator size={16} aria-hidden="true" />尾月对齐前应收</dt>
|
|
|
+ <dd><strong>{moneyFromCents(bill.pre_align_cents)}</strong></dd>
|
|
|
+ </div>
|
|
|
+ <div className="bill-record-metric-primary">
|
|
|
+ <dt><Receipt size={16} aria-hidden="true" />本期应收(对齐后)</dt>
|
|
|
+ <dd><strong>{moneyFromCents(bill.receivable_cents)}</strong></dd>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <dt><Calculator size={16} aria-hidden="true" />分成基数</dt>
|
|
|
+ <dd><strong>{moneyFromCents(bill.share_base_cents)}</strong></dd>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <dt><CircleDollarSign size={16} aria-hidden="true" />本方分成金额</dt>
|
|
|
+ <dd><strong className="bill-record-share">{moneyFromCents(bill.share_amount_cents)}</strong>
|
|
|
+ {bill.zero_note && <small>{ZERO_NOTE_TEXT[bill.zero_note]}</small>}
|
|
|
+ </dd>
|
|
|
+ </div>
|
|
|
+ </dl>
|
|
|
+
|
|
|
+ <div className="record-tabs-frame">
|
|
|
+ <RecordTabs prefix="bill-record" label="账单明细详情视图" tabs={billRecordTabs} active={tab} onChange={setTab} />
|
|
|
+
|
|
|
+ <BillRecordPanel tab="billing" active={tab}>
|
|
|
+ {bill.receivable_calc && <div className="bill-record-calculation">
|
|
|
+ <Calculator size={17} aria-hidden="true" />
|
|
|
+ <div><h2>应收计算</h2><p>{bill.receivable_calc}</p></div>
|
|
|
+ </div>}
|
|
|
+ <dl className="ops-record-summary bill-record-facts">
|
|
|
+ <div><dt>计费区间</dt><dd>{(bill.bill_from || bill.bill_to) ? `${bill.bill_from || "—"} ~ ${bill.bill_to || "—"}` : missing}</dd></div>
|
|
|
+ <div><dt>计费天数</dt><dd>{bill.billing_days} 天</dd></div>
|
|
|
+ <div><dt>当月天数</dt><dd>{bill.month_days == null ? missing : `${bill.month_days} 天`}</dd></div>
|
|
|
+ <div><dt>是否不满月</dt><dd>{bill.partial_month ? "是" : "否"}</dd></div>
|
|
|
+ <div><dt>计费标准单价</dt><dd>{bill.settle_std_cents == null ? missing : moneyFromCents(bill.settle_std_cents)}</dd></div>
|
|
|
+ <div><dt>订阅份数</dt><dd>{bill.quantity == null ? missing : `${bill.quantity} 份`}</dd></div>
|
|
|
+ </dl>
|
|
|
+ </BillRecordPanel>
|
|
|
+
|
|
|
+ <BillRecordPanel tab="costs" active={tab}>
|
|
|
+ <dl className="ops-record-summary bill-record-facts">
|
|
|
+ <div><dt>成本实扣</dt><dd>{moneyFromCents(actualCost)}</dd></div>
|
|
|
+ {bill.cost_should_deduct_cents != null && <div><dt>成本应扣(封顶前)</dt><dd>{moneyFromCents(bill.cost_should_deduct_cents)}</dd></div>}
|
|
|
+ </dl>
|
|
|
+ {costCapped && <p className="bill-record-note" role="note">成本已按应收封顶(应扣大于实扣时,分成基数按 0 保护)。</p>}
|
|
|
+ <div className="ops-table-wrap bill-record-table">
|
|
|
+ <table className="ops-table" aria-label="成本快照">
|
|
|
+ <OpsTableColumns widths={[40, 22, 14, 24]} />
|
|
|
+ <thead><tr><th scope="col">成本项</th><th scope="col" className="bill-record-number">单价</th><th scope="col" className="bill-record-number">倍率</th><th scope="col" className="bill-record-number">应扣</th></tr></thead>
|
|
|
+ <tbody>
|
|
|
+ {bill.costs.map((cost, i) => {
|
|
|
+ const price = cost.price_cents ?? cost.amount_cents;
|
|
|
+ const should = cost.cost_cents ?? cost.fold;
|
|
|
+ return <tr key={`${cost.item_id ?? cost.item_name}-${i}`}>
|
|
|
+ <td><div className="bill-record-table-title"><strong className="table-cell-title">{cost.item_name}</strong>{!cost.configured && <OpsTag tone="warning">未配置</OpsTag>}</div></td>
|
|
|
+ <td className="bill-record-number">{price == null ? missing : <span className="table-number">{moneyFromCents(price)}</span>}</td>
|
|
|
+ <td className="bill-record-number">{cost.multiplier == null ? missing : <span className="table-number">{cost.multiplier}</span>}</td>
|
|
|
+ <td className="bill-record-number">{should == null ? missing : <span className="table-number">{moneyFromCents(should)}</span>}</td>
|
|
|
+ </tr>;
|
|
|
+ })}
|
|
|
+ {!bill.costs.length && <OpsTableEmpty colSpan={4}>本行无成本快照。</OpsTableEmpty>}
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
+ </BillRecordPanel>
|
|
|
+
|
|
|
+ <BillRecordPanel tab="reconciliation" active={tab}>
|
|
|
+ <dl className="ops-record-summary bill-record-facts">
|
|
|
+ <div><dt>分成方</dt><dd>{bill.holder_name || missing}</dd></div>
|
|
|
+ <div><dt>分成方式与取值</dt><dd>{settleTextFromSnapshot(bill.share_mode, bill.share_value)}</dd></div>
|
|
|
+ <div><dt>所属对账单号</dt><dd><BillBatchLink holderId={bill.holder_id} number={bill.batch_no} from={from} /></dd></div>
|
|
|
+ </dl>
|
|
|
+ {bill.base_floor_protected && <p className="bill-record-note" role="note">{BASE_FLOOR_NOTE}</p>}
|
|
|
+ {/* 仅在服务端下发其他分成方时展示。 */}
|
|
|
+ {bill.other_parties != null && bill.other_parties.length > 0 && <div className="ops-table-wrap bill-record-table">
|
|
|
+ <table className="ops-table" aria-label="其他分成方">
|
|
|
+ <OpsTableColumns widths={[40, 23, 37]} />
|
|
|
+ <thead><tr><th scope="col">其他分成方</th><th scope="col" className="bill-record-number">分成金额</th><th scope="col">对账单号</th></tr></thead>
|
|
|
+ <tbody>
|
|
|
+ {bill.other_parties.map((party, i) => <tr key={`${party.holder_type}-${party.holder_name}-${i}`}>
|
|
|
+ <td><div className="bill-record-table-title"><strong className="table-cell-title">{party.holder_name}</strong><OpsTag tone={holderTone[party.holder_type]}>{HOLDER_TYPE_TEXT[party.holder_type]}</OpsTag></div></td>
|
|
|
+ <td className="bill-record-number"><span className="table-number">{moneyFromCents(party.share_amount_cents)}</span></td>
|
|
|
+ <td>{party.batch_no && party.holder_id ? <BillBatchLink holderId={party.holder_id} number={party.batch_no} from={from} /> : party.batch_no ?? missing}</td>
|
|
|
+ </tr>)}
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+ </div>}
|
|
|
+ </BillRecordPanel>
|
|
|
+
|
|
|
+ <BillRecordPanel tab="accounts" active={tab}>
|
|
|
+ {bill.account_days_failed ? <p className="bill-record-note bill-record-error" role="alert">{WORD_FETCH_FAILED}</p>
|
|
|
+ : bill.account_days == null ? <p className="bill-record-placeholder">{BACKEND_NOT_WIRED}</p>
|
|
|
+ : <div className="ops-table-wrap bill-record-table">
|
|
|
+ <table className="ops-table" aria-label="逐账号在期天数">
|
|
|
+ <OpsTableColumns widths={[70, 30]} />
|
|
|
+ <thead><tr><th scope="col">分账号</th><th scope="col" className="bill-record-number">在期天数</th></tr></thead>
|
|
|
+ <tbody>
|
|
|
+ {bill.account_days.map((row, i) => <tr key={`${row.sub_account_label}-${i}`}>
|
|
|
+ <td><strong className="table-cell-title">{row.sub_account_label}</strong></td>
|
|
|
+ <td className="bill-record-number"><span className="table-number">{row.in_period_days}</span> 天</td>
|
|
|
+ </tr>)}
|
|
|
+ {!bill.account_days.length && <OpsTableEmpty colSpan={2}>本期无在期分账号。</OpsTableEmpty>}
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+ </div>}
|
|
|
+ </BillRecordPanel>
|
|
|
+ </div>
|
|
|
+ </>;
|
|
|
+}
|
|
|
|
|
|
export function SettlementBillRecordPage() {
|
|
|
const { index } = useParams();
|
|
|
const location = useLocation();
|
|
|
const state = (location.state ?? {}) as { from?: string; listSearch?: string };
|
|
|
- // 来自列表时拼回 listSearch,保留筛选(D-2);其它来路仍回进来那一页。
|
|
|
const back = state.from === "/correction-notes"
|
|
|
? { to: "/correction-notes", label: BACK_TO_CORRECTIONS }
|
|
|
: state.from?.startsWith("/settlement-batches/")
|
|
|
@@ -891,183 +1032,34 @@ export function SettlementBillRecordPage() {
|
|
|
: { to: `/settlement-bills${state.from === "/settlement-bills" ? (state.listSearch ?? "") : ""}`, label: BACK_TO_BILL_LIST };
|
|
|
|
|
|
const detail = useBillDetail(index ?? null);
|
|
|
- const d = detail.data;
|
|
|
+ const bill = detail.data;
|
|
|
const wiring = detail.fail?.kind === "wiring";
|
|
|
|
|
|
return (
|
|
|
- <article className="ops-page reconcile-record">
|
|
|
- <Link className="ops-back-link" to={back.to}><ArrowLeft size={16} />{back.label}</Link>
|
|
|
+ <article className="ops-page ops-record-page record-detail bill-record">
|
|
|
+ <Link className="ops-back-link" to={back.to}><ArrowLeft size={16} aria-hidden="true" />{back.label.replace(/^←\s*/, "")}</Link>
|
|
|
+ <header className="customer-record-masthead bill-record-masthead">
|
|
|
+ <div className="customer-hero-symbol" aria-hidden="true"><FileSpreadsheet size={26} /></div>
|
|
|
+ <div className="customer-hero-copy">
|
|
|
+ <p className="customer-record-id">BILLING LINE <span aria-hidden="true">·</span> <span>{bill?.bill_detail_id ?? index}</span></p>
|
|
|
+ <h1 className="customer-record-title">账单明细详情</h1>
|
|
|
+ {bill && <div className="customer-record-tags bill-record-context">
|
|
|
+ <span className="customer-record-meta">
|
|
|
+ <OpsTag tone={holderTone[bill.holder_type]}>{HOLDER_TYPE_TEXT[bill.holder_type]}</OpsTag>
|
|
|
+ {bill.holder_name && <strong>{bill.holder_name}</strong>}
|
|
|
+ </span>
|
|
|
+ <span className="customer-record-meta"><CalendarDays size={14} aria-hidden="true" /><span>自然月 {bill.period}</span></span>
|
|
|
+ {bill.customer_name && <span className="customer-record-meta"><Building2 size={14} aria-hidden="true" /><span>{bill.customer_name}</span></span>}
|
|
|
+ {bill.subscription_label && <span className="customer-record-meta"><ScrollText size={14} aria-hidden="true" /><span>{bill.subscription_label}</span></span>}
|
|
|
+ </div>}
|
|
|
+ </div>
|
|
|
+ </header>
|
|
|
{wiring && <p className="ops-import-note" role="status">{BILL_WIRING_NOTE}</p>}
|
|
|
- {detail.fail && !wiring && (
|
|
|
- <p className="ops-form-error" role="alert">{detail.fail.message} <Button variant="ghost" size="sm" onClick={detail.reload}>重试</Button></p>
|
|
|
- )}
|
|
|
- {(wiring || (!d && detail.loading)) && (
|
|
|
- <header className="reconcile-record-hero">
|
|
|
- <div className="reconcile-record-symbol"><FileSpreadsheet size={27} /></div>
|
|
|
- <div>
|
|
|
- <span className="reconcile-record-eyebrow">BILLING LINE / {index}</span>
|
|
|
- <h1>明细详情</h1>
|
|
|
- <p>{detail.loading && !wiring ? "加载中…" : BACKEND_NOT_WIRED}</p>
|
|
|
- </div>
|
|
|
- </header>
|
|
|
- )}
|
|
|
-
|
|
|
- {d && (
|
|
|
- <>
|
|
|
- <header className="reconcile-record-hero">
|
|
|
- <div className="reconcile-record-symbol"><FileSpreadsheet size={27} /></div>
|
|
|
- <div>
|
|
|
- <span className="reconcile-record-eyebrow">BILLING LINE / {d.bill_detail_id}</span>
|
|
|
- <h1>明细详情</h1>
|
|
|
- <p><strong>{d.holder_name}</strong><span>{HOLDER_TYPE_TEXT[d.holder_type]}</span><span>自然月 {d.period}</span><span>{d.customer_name} · {d.subscription_label}</span></p>
|
|
|
- </div>
|
|
|
- </header>
|
|
|
-
|
|
|
- {/* ① 本期应收口径:pre_align_cents 与 receivable_cents 同屏(缺一=页面缺字段)。 */}
|
|
|
- <section className="reconcile-record-section">
|
|
|
- <div className="reconcile-record-section-head"><span>01</span><div><h2>本期应收口径</h2><p>尾月对齐前两值必须同屏。</p></div></div>
|
|
|
- <dl className="reconcile-record-facts">
|
|
|
- <div><dt>计费标准单价</dt><dd>{d.settle_std_cents == null ? "—" : moneyFromCents(d.settle_std_cents)}</dd></div>
|
|
|
- <div><dt>订阅份数</dt><dd>{d.quantity == null ? "—" : d.quantity}</dd></div>
|
|
|
- <div><dt>尾月对齐前应收</dt><dd>{moneyFromCents(d.pre_align_cents)}</dd></div>
|
|
|
- <div><dt>本期应收(对齐后)</dt><dd>{moneyFromCents(d.receivable_cents)}</dd></div>
|
|
|
- </dl>
|
|
|
- {d.receivable_calc && <p className="reconcile-footnote">{d.receivable_calc}</p>}
|
|
|
- </section>
|
|
|
-
|
|
|
- {/* ② 计费区间与天数、是否不满月。 */}
|
|
|
- <section className="reconcile-record-section">
|
|
|
- <div className="reconcile-record-section-head"><span>02</span><div><h2>计费依据</h2><p>本期计费区间与天数。</p></div></div>
|
|
|
- <dl className="reconcile-record-facts">
|
|
|
- <div><dt>计费区间</dt><dd>{(d.bill_from || d.bill_to) ? `${d.bill_from || "—"} ~ ${d.bill_to || "—"}` : "—"}</dd></div>
|
|
|
- <div><dt>计费天数</dt><dd>{d.billing_days} 天</dd></div>
|
|
|
- <div><dt>当月天数</dt><dd>{d.month_days == null ? "—" : `${d.month_days} 天`}</dd></div>
|
|
|
- <div><dt>是否不满月</dt><dd>{d.partial_month ? "是" : "否"}</dd></div>
|
|
|
- </dl>
|
|
|
- </section>
|
|
|
-
|
|
|
- {/* ③ 成本:合计取实扣;明细列为应扣;封顶时提示。 */}
|
|
|
- <section className="reconcile-record-section">
|
|
|
- <div className="reconcile-record-section-head"><span>03</span><div><h2>成本快照</h2><p>合计为实扣;明细行为应扣(封顶前)。</p></div></div>
|
|
|
- <dl className="reconcile-record-facts">
|
|
|
- <div><dt>成本实扣</dt><dd>{moneyFromCents(d.cost_deduct_cents ?? (d.receivable_cents - d.share_base_cents))}</dd></div>
|
|
|
- {d.cost_should_deduct_cents != null && (
|
|
|
- <div><dt>成本应扣</dt><dd>{moneyFromCents(d.cost_should_deduct_cents)}</dd></div>
|
|
|
- )}
|
|
|
- </dl>
|
|
|
- {(d.cost_should_deduct_cents != null
|
|
|
- && d.cost_deduct_cents != null
|
|
|
- && d.cost_should_deduct_cents > d.cost_deduct_cents)
|
|
|
- || d.base_floor_protected
|
|
|
- ? <p className="reconcile-footnote">成本已按应收封顶(应扣大于实扣时,分成基数按 0 保护)。</p>
|
|
|
- : null}
|
|
|
- {d.costs.length ? (
|
|
|
- <div className="ops-table-wrap">
|
|
|
- <table className="ops-table">
|
|
|
- <thead><tr><th>成本项</th><th>单价</th><th>倍率</th><th>应扣</th></tr></thead>
|
|
|
- <tbody>
|
|
|
- {d.costs.map((cost, i) => {
|
|
|
- const price = cost.price_cents ?? cost.amount_cents;
|
|
|
- const should = cost.cost_cents ?? cost.fold ?? null;
|
|
|
- return (
|
|
|
- <tr key={`${cost.item_name}-${i}`}>
|
|
|
- <td>{cost.item_name}{!cost.configured && <OpsTag tone="warning">未配置</OpsTag>}</td>
|
|
|
- <td><span className="ops-money table-number">{price == null ? <span className="table-placeholder">—</span> : moneyFromCents(price)}</span></td>
|
|
|
- <td>{cost.multiplier == null ? <span className="table-placeholder">—</span> : <span className="table-number">{cost.multiplier}</span>}</td>
|
|
|
- <td><span className="ops-money table-number">{should == null ? <span className="table-placeholder">—</span> : moneyFromCents(should)}</span></td>
|
|
|
- </tr>
|
|
|
- );
|
|
|
- })}
|
|
|
- </tbody>
|
|
|
- </table>
|
|
|
- </div>
|
|
|
- ) : (
|
|
|
- <p className="reconcile-empty-line">本行无成本快照。</p>
|
|
|
- )}
|
|
|
- </section>
|
|
|
-
|
|
|
- {/* ④ 分成基数;floor 到 0 ⇒ 显式标下限保护(floor 是静默的,不写=藏起一次配置错误)。 */}
|
|
|
- <section className="reconcile-record-section">
|
|
|
- <div className="reconcile-record-section-head"><span>04</span><div><h2>实际出账口径</h2><p>分成基数与下限保护。</p></div></div>
|
|
|
- <dl className="reconcile-record-facts">
|
|
|
- <div><dt>分成基数</dt><dd>{moneyFromCents(d.share_base_cents)}</dd></div>
|
|
|
- </dl>
|
|
|
- {d.base_floor_protected && <p className="reconcile-footnote">{BASE_FLOOR_NOTE}</p>}
|
|
|
- </section>
|
|
|
-
|
|
|
- {/* ⑤ 分成方式与取值=当时冻结在明细行上的值(⛔ 读档案现值,I22);文案走册 4 settle_text 单源。 */}
|
|
|
- <section className="reconcile-record-section">
|
|
|
- <div className="reconcile-record-section-head"><span>05</span><div><h2>分成方式与取值</h2><p>当时冻结在明细行上的值。</p></div></div>
|
|
|
- <dl className="reconcile-record-facts">
|
|
|
- <div><dt>分成方式与取值</dt><dd>{settleTextFromSnapshot(d.share_mode, d.share_value)}</dd></div>
|
|
|
- </dl>
|
|
|
- </section>
|
|
|
-
|
|
|
- {/* ⑥ 本方分成金额+恒 0 标注+所属对账单号。 */}
|
|
|
- <section className="reconcile-record-section">
|
|
|
- <div className="reconcile-record-section-head"><span>06</span><div><h2>对账归属</h2><p>本方分成金额与所属批次。</p></div></div>
|
|
|
- <dl className="reconcile-record-facts">
|
|
|
- <div><dt>本方分成金额</dt><dd>{moneyFromCents(d.share_amount_cents)}{d.zero_note ? ` · ${ZERO_NOTE_TEXT[d.zero_note]}` : ""}</dd></div>
|
|
|
- <div>
|
|
|
- <dt>所属对账单号</dt>
|
|
|
- <dd>
|
|
|
- <Link className="ops-table-action" to={batchPath(d.holder_id, d.batch_no)} state={{ from: location.pathname }}>
|
|
|
- {d.batch_no} <ArrowRight size={14} />
|
|
|
- </Link>
|
|
|
- </dd>
|
|
|
- </div>
|
|
|
- </dl>
|
|
|
- {/* 其他分成方面板:三类只读身份响应体不出现该字段(⛔ 值为空)。 */}
|
|
|
- {d.other_parties != null && d.other_parties.length > 0 && (
|
|
|
- <div className="ops-table-wrap" style={{ marginTop: 12 }}>
|
|
|
- <table className="ops-table">
|
|
|
- <thead><tr><th>其他分成方</th><th>分成金额</th><th>对账单号</th></tr></thead>
|
|
|
- <tbody>
|
|
|
- {d.other_parties.map((p, i) => (
|
|
|
- <tr key={`${p.holder_type}-${p.holder_name}-${i}`}>
|
|
|
- <td><OpsTag tone={holderTone[p.holder_type]}>{HOLDER_TYPE_TEXT[p.holder_type]}</OpsTag> {p.holder_name}</td>
|
|
|
- <td><span className="ops-money">{moneyFromCents(p.share_amount_cents)}</span></td>
|
|
|
- <td>
|
|
|
- {p.batch_no && p.holder_id ? (
|
|
|
- <Link className="ops-table-action" to={batchPath(p.holder_id, p.batch_no)} state={{ from: location.pathname }}>
|
|
|
- {p.batch_no} <ArrowRight size={14} />
|
|
|
- </Link>
|
|
|
- ) : (
|
|
|
- <span className="ops-mono">{p.batch_no ?? <span className="table-placeholder">—</span>}</span>
|
|
|
- )}
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- ))}
|
|
|
- </tbody>
|
|
|
- </table>
|
|
|
- </div>
|
|
|
- )}
|
|
|
- </section>
|
|
|
-
|
|
|
- {/* ⑦ 逐账号在期天数;KLT-S406 ⇒ 该块「取数失败」(⛔ 回落「无开停记录」);未下发 ⇒「后端未下发」。 */}
|
|
|
- <section className="reconcile-record-section">
|
|
|
- <div className="reconcile-record-section-head"><span>07</span><div><h2>逐账号在期天数</h2><p>按订阅逐分账号统计。</p></div></div>
|
|
|
- {d.account_days_failed ? (
|
|
|
- <p className="ops-form-error" role="alert">{WORD_FETCH_FAILED}</p>
|
|
|
- ) : d.account_days == null ? (
|
|
|
- <p className="reconcile-footnote">{BACKEND_NOT_WIRED}</p>
|
|
|
- ) : d.account_days.length ? (
|
|
|
- <div className="ops-table-wrap">
|
|
|
- <table className="ops-table">
|
|
|
- <thead><tr><th>分账号</th><th>在期天数</th></tr></thead>
|
|
|
- <tbody>
|
|
|
- {d.account_days.map((row, i) => (
|
|
|
- <tr key={`${row.sub_account_label}-${i}`}><td>{row.sub_account_label}</td><td className="table-number">{row.in_period_days} 天</td></tr>
|
|
|
- ))}
|
|
|
- </tbody>
|
|
|
- </table>
|
|
|
- </div>
|
|
|
- ) : (
|
|
|
- <p className="reconcile-empty-line">本期无在期分账号。</p>
|
|
|
- )}
|
|
|
- </section>
|
|
|
- </>
|
|
|
- )}
|
|
|
+ {detail.fail && !wiring && <p className="ops-form-error" role="alert">
|
|
|
+ {detail.fail.message} <Button variant="ghost" size="sm" onClick={detail.reload}>重试</Button>
|
|
|
+ </p>}
|
|
|
+ {!bill && detail.loading && <p className="bill-record-placeholder" role="status">正在读取账单明细…</p>}
|
|
|
+ {bill && <BillRecordContent key={bill.bill_detail_id} bill={bill} from={location.pathname} />}
|
|
|
</article>
|
|
|
);
|
|
|
}
|