|
@@ -26,7 +26,7 @@ import type { StatusTone } from "../domain/statuses";
|
|
|
import { WORD_FETCH_FAILED } from "../lib/api/lockedCopy";
|
|
import { WORD_FETCH_FAILED } from "../lib/api/lockedCopy";
|
|
|
import { settleTextFromSnapshot } from "../lib/settle-text";
|
|
import { settleTextFromSnapshot } from "../lib/settle-text";
|
|
|
import { useHorizontalOverflow } from "../lib/use-horizontal-overflow";
|
|
import { useHorizontalOverflow } from "../lib/use-horizontal-overflow";
|
|
|
-import { detailBack, detailLinkState, useDetailLinkState, type DetailLinkState } from "../lib/detail-navigation";
|
|
|
|
|
|
|
+import { detailBack, detailLinkState, partnerReconDetailPath, useDetailLinkState, type DetailLinkState } from "../lib/detail-navigation";
|
|
|
import {
|
|
import {
|
|
|
lastClosedMonth, submitReconRerun,
|
|
lastClosedMonth, submitReconRerun,
|
|
|
useBillDetail, useBillList, useReconDetail, useReconList,
|
|
useBillDetail, useBillList, useReconDetail, useReconList,
|
|
@@ -63,6 +63,7 @@ import {
|
|
|
VOIDED_BY_PREFIX,
|
|
VOIDED_BY_PREFIX,
|
|
|
ZERO_NOTE_TEXT,
|
|
ZERO_NOTE_TEXT,
|
|
|
} from "../lib/copy-billing";
|
|
} from "../lib/copy-billing";
|
|
|
|
|
+import { BACK_TO_REGION_RECON } from "../lib/copy-views";
|
|
|
import "../styles/operations.css";
|
|
import "../styles/operations.css";
|
|
|
import "../styles/settlement-records.css";
|
|
import "../styles/settlement-records.css";
|
|
|
|
|
|
|
@@ -552,16 +553,18 @@ const batchRecordTabs = [
|
|
|
] as const;
|
|
] as const;
|
|
|
type BatchRecordTab = typeof batchRecordTabs[number]["id"];
|
|
type BatchRecordTab = typeof batchRecordTabs[number]["id"];
|
|
|
|
|
|
|
|
-export function SettlementStatementRecordPage() {
|
|
|
|
|
|
|
+export function SettlementStatementRecordPage({ partnerView = false }: { partnerView?: boolean }) {
|
|
|
const { no } = useParams();
|
|
const { no } = useParams();
|
|
|
- return <BatchRecordPage key={no} no={no} />;
|
|
|
|
|
|
|
+ return <BatchRecordPage key={no} no={no} partnerView={partnerView} />;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-function BatchRecordPage({ no }: { no?: string }) {
|
|
|
|
|
|
|
+function BatchRecordPage({ no, partnerView }: { no?: string; partnerView: boolean }) {
|
|
|
const identity = useDemoIdentity();
|
|
const identity = useDemoIdentity();
|
|
|
const navigate = useNavigate();
|
|
const navigate = useNavigate();
|
|
|
const location = useLocation();
|
|
const location = useLocation();
|
|
|
- const back = detailBack(location.state, "/settlement-batches", BACK_TO_RECON_LIST);
|
|
|
|
|
|
|
+ const back = partnerView
|
|
|
|
|
+ ? detailBack(location.state, "/bos/pv/recon", BACK_TO_REGION_RECON)
|
|
|
|
|
+ : detailBack(location.state, "/settlement-batches", BACK_TO_RECON_LIST);
|
|
|
const [tab, setTab] = useState<BatchRecordTab>(() =>
|
|
const [tab, setTab] = useState<BatchRecordTab>(() =>
|
|
|
batchRecordTabs.find(({ id }) => id === location.state?.statementTab)?.id ?? "overview");
|
|
batchRecordTabs.find(({ id }) => id === location.state?.statementTab)?.id ?? "overview");
|
|
|
const outgoingState = detailLinkState(location.pathname + location.search + location.hash, { ...location.state, statementTab: tab });
|
|
const outgoingState = detailLinkState(location.pathname + location.search + location.hash, { ...location.state, statementTab: tab });
|
|
@@ -569,8 +572,9 @@ function BatchRecordPage({ no }: { no?: string }) {
|
|
|
const detail = useReconDetail(no ?? null);
|
|
const detail = useReconDetail(no ?? null);
|
|
|
const batch = detail.data;
|
|
const batch = detail.data;
|
|
|
const wiring = detail.fail?.kind === "wiring";
|
|
const wiring = detail.fail?.kind === "wiring";
|
|
|
- const isAdmin = !identity || identity.role === "admin";
|
|
|
|
|
- const flagsPending = batch != null && (batch.can_export == null || (isAdmin && (batch.can_rerun == null || batch.can_correct == null)));
|
|
|
|
|
|
|
+ const isAdmin = !partnerView && (!identity || identity.role === "admin");
|
|
|
|
|
+ const flagsPending = !partnerView && batch != null && (batch.can_export == null || (isAdmin && (batch.can_rerun == null || batch.can_correct == null)));
|
|
|
|
|
+ const showExport = batch != null && (!partnerView || batch.can_export === true);
|
|
|
|
|
|
|
|
const [confirmRerun, setConfirmRerun] = useState(false);
|
|
const [confirmRerun, setConfirmRerun] = useState(false);
|
|
|
const [rerunError, setRerunError] = useState("");
|
|
const [rerunError, setRerunError] = useState("");
|
|
@@ -629,11 +633,11 @@ function BatchRecordPage({ no }: { no?: string }) {
|
|
|
<span className="customer-record-meta"><CalendarDays size={14} aria-hidden="true" /><span>自然月 {batch.period}</span></span>
|
|
<span className="customer-record-meta"><CalendarDays size={14} aria-hidden="true" /><span>自然月 {batch.period}</span></span>
|
|
|
</div>}
|
|
</div>}
|
|
|
</div>
|
|
</div>
|
|
|
- {batch && <div className="batch-record-actions">
|
|
|
|
|
- <Button variant="outline" className="batch-record-export" onClick={exportDetail} disabled={batch.can_export !== true || exporting}
|
|
|
|
|
|
|
+ {batch && (showExport || isAdmin) && <div className="batch-record-actions">
|
|
|
|
|
+ {showExport && <Button variant="outline" className="batch-record-export" onClick={exportDetail} disabled={batch.can_export !== true || exporting}
|
|
|
title={batch.can_export == null ? ACTION_FLAG_PENDING_NOTE : undefined}>
|
|
title={batch.can_export == null ? ACTION_FLAG_PENDING_NOTE : undefined}>
|
|
|
<Download size={15} aria-hidden="true" />{exporting ? "正在导出…" : "导出本批账单明细"}
|
|
<Download size={15} aria-hidden="true" />{exporting ? "正在导出…" : "导出本批账单明细"}
|
|
|
- </Button>
|
|
|
|
|
|
|
+ </Button>}
|
|
|
{isAdmin && <>
|
|
{isAdmin && <>
|
|
|
<Button disabled={batch.can_rerun !== true}
|
|
<Button disabled={batch.can_rerun !== true}
|
|
|
title={batch.can_rerun == null ? ACTION_FLAG_PENDING_NOTE : undefined}
|
|
title={batch.can_rerun == null ? ACTION_FLAG_PENDING_NOTE : undefined}
|
|
@@ -654,7 +658,7 @@ function BatchRecordPage({ no }: { no?: string }) {
|
|
|
{detail.fail.message} <Button variant="ghost" size="sm" onClick={detail.reload}>重试</Button>
|
|
{detail.fail.message} <Button variant="ghost" size="sm" onClick={detail.reload}>重试</Button>
|
|
|
</p>}
|
|
</p>}
|
|
|
{!batch && detail.loading && !wiring && <p className="batch-record-note" role="status">正在读取对账批次…</p>}
|
|
{!batch && detail.loading && !wiring && <p className="batch-record-note" role="status">正在读取对账批次…</p>}
|
|
|
- {batch && <BatchRecordContent batch={batch} tab={tab} onTabChange={setTab} linkState={outgoingState} flagsPending={flagsPending} />}
|
|
|
|
|
|
|
+ {batch && <BatchRecordContent batch={batch} tab={tab} onTabChange={setTab} linkState={outgoingState} flagsPending={flagsPending} partnerView={partnerView} />}
|
|
|
|
|
|
|
|
{confirmRerun && batch && <OpsDialog title={RERUN_DIALOG_TITLE} className="statement-run-dialog" onClose={closeRerun}>
|
|
{confirmRerun && batch && <OpsDialog title={RERUN_DIALOG_TITLE} className="statement-run-dialog" onClose={closeRerun}>
|
|
|
<form onSubmit={runRerun} aria-busy={rerunning}>
|
|
<form onSubmit={runRerun} aria-busy={rerunning}>
|
|
@@ -686,19 +690,20 @@ function BatchRecordPanel({ tab, active, children }: { tab: BatchRecordTab; acti
|
|
|
</section>;
|
|
</section>;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-function BatchRecordContent({ batch, tab, onTabChange, linkState, flagsPending }: {
|
|
|
|
|
|
|
+function BatchRecordContent({ batch, tab, onTabChange, linkState, flagsPending, partnerView }: {
|
|
|
batch: ReconDetailResult;
|
|
batch: ReconDetailResult;
|
|
|
tab: BatchRecordTab;
|
|
tab: BatchRecordTab;
|
|
|
onTabChange: (tab: BatchRecordTab) => void;
|
|
onTabChange: (tab: BatchRecordTab) => void;
|
|
|
linkState: DetailLinkState;
|
|
linkState: DetailLinkState;
|
|
|
flagsPending: boolean;
|
|
flagsPending: boolean;
|
|
|
|
|
+ partnerView: boolean;
|
|
|
}) {
|
|
}) {
|
|
|
const missing = <span className="table-placeholder">—</span>;
|
|
const missing = <span className="table-placeholder">—</span>;
|
|
|
const gapText = batch.ticket_gap_failed ? WORD_FETCH_FAILED : BACKEND_NOT_WIRED;
|
|
const gapText = batch.ticket_gap_failed ? WORD_FETCH_FAILED : BACKEND_NOT_WIRED;
|
|
|
const gapCount = batch.ticket_gap_failed ? null : batch.ticket_gap_count;
|
|
const gapCount = batch.ticket_gap_failed ? null : batch.ticket_gap_count;
|
|
|
const tabs = batchRecordTabs.map((item) => ({ ...item, count: item.id === "bills" ? batch.detail_count : undefined }));
|
|
const tabs = batchRecordTabs.map((item) => ({ ...item, count: item.id === "bills" ? batch.detail_count : undefined }));
|
|
|
return <>
|
|
return <>
|
|
|
- <dl className="customer-record-metrics batch-record-metrics" aria-label="批次统计">
|
|
|
|
|
|
|
+ <dl className={`customer-record-metrics batch-record-metrics${partnerView ? " partner-record-metrics" : ""}`} aria-label="批次统计">
|
|
|
<div>
|
|
<div>
|
|
|
<dt><ClipboardList size={16} aria-hidden="true" />明细条数</dt>
|
|
<dt><ClipboardList size={16} aria-hidden="true" />明细条数</dt>
|
|
|
<dd><strong>{batch.detail_count}</strong><span className="batch-record-unit">条</span></dd>
|
|
<dd><strong>{batch.detail_count}</strong><span className="batch-record-unit">条</span></dd>
|
|
@@ -708,14 +713,14 @@ function BatchRecordContent({ batch, tab, onTabChange, linkState, flagsPending }
|
|
|
<dd><strong>{moneyFromCents(batch.base_cents)}</strong><small>本批有效账单的分成基数合计</small></dd>
|
|
<dd><strong>{moneyFromCents(batch.base_cents)}</strong><small>本批有效账单的分成基数合计</small></dd>
|
|
|
</div>
|
|
</div>
|
|
|
<div className="batch-record-metric-primary">
|
|
<div className="batch-record-metric-primary">
|
|
|
- <dt><CircleDollarSign size={16} aria-hidden="true" />分成金额</dt>
|
|
|
|
|
|
|
+ <dt><CircleDollarSign size={16} aria-hidden="true" />{partnerView ? "本方分成金额" : "分成金额"}</dt>
|
|
|
<dd><strong>{moneyFromCents(batch.share_cents)}</strong></dd>
|
|
<dd><strong>{moneyFromCents(batch.share_cents)}</strong></dd>
|
|
|
</div>
|
|
</div>
|
|
|
- <div>
|
|
|
|
|
|
|
+ {!partnerView && <div>
|
|
|
<dt><ScrollText size={16} aria-hidden="true" />{TICKET_GAP_LABEL}</dt>
|
|
<dt><ScrollText size={16} aria-hidden="true" />{TICKET_GAP_LABEL}</dt>
|
|
|
<dd>{gapCount == null ? <span className="batch-record-unavailable">{gapText}</span>
|
|
<dd>{gapCount == null ? <span className="batch-record-unavailable">{gapText}</span>
|
|
|
: <><strong>{gapCount}</strong><span className="batch-record-unit">个</span></>}</dd>
|
|
: <><strong>{gapCount}</strong><span className="batch-record-unit">个</span></>}</dd>
|
|
|
- </div>
|
|
|
|
|
|
|
+ </div>}
|
|
|
</dl>
|
|
</dl>
|
|
|
|
|
|
|
|
<div className="record-tabs-frame">
|
|
<div className="record-tabs-frame">
|
|
@@ -734,21 +739,21 @@ function BatchRecordContent({ batch, tab, onTabChange, linkState, flagsPending }
|
|
|
</BatchRecordPanel>
|
|
</BatchRecordPanel>
|
|
|
|
|
|
|
|
<BatchRecordPanel tab="bills" active={tab}>
|
|
<BatchRecordPanel tab="bills" active={tab}>
|
|
|
- <BatchBillingTable items={batch.items} linkState={linkState} />
|
|
|
|
|
|
|
+ <BatchBillingTable items={batch.items} linkState={linkState} billListPath={partnerView ? "/bos/pv/bill-detail" : "/settlement-bills"} />
|
|
|
</BatchRecordPanel>
|
|
</BatchRecordPanel>
|
|
|
|
|
|
|
|
<BatchRecordPanel tab="execution" active={tab}>
|
|
<BatchRecordPanel tab="execution" active={tab}>
|
|
|
<dl className="ops-record-summary batch-record-facts">
|
|
<dl className="ops-record-summary batch-record-facts">
|
|
|
<div><dt>批次状态</dt><dd><OpsStatus tone={batchTone[batch.status]}>{BATCH_STATUS_TEXT[batch.status]}</OpsStatus></dd></div>
|
|
<div><dt>批次状态</dt><dd><OpsStatus tone={batchTone[batch.status]}>{BATCH_STATUS_TEXT[batch.status]}</OpsStatus></dd></div>
|
|
|
<div><dt>触发方式</dt><dd>{TRIGGER_TYPE_TEXT[batch.trigger_type]}</dd></div>
|
|
<div><dt>触发方式</dt><dd>{TRIGGER_TYPE_TEXT[batch.trigger_type]}</dd></div>
|
|
|
- <div><dt>执行人</dt><dd title={batch.operator_user_id ?? undefined}>{executorText(batch)}</dd></div>
|
|
|
|
|
|
|
+ {!partnerView && <div><dt>执行人</dt><dd title={batch.operator_user_id ?? undefined}>{executorText(batch)}</dd></div>}
|
|
|
<div><dt>执行时间</dt><dd title={batch.executed_at ?? undefined}>{batch.executed_at ? localTime(batch.executed_at) : missing}</dd></div>
|
|
<div><dt>执行时间</dt><dd title={batch.executed_at ?? undefined}>{batch.executed_at ? localTime(batch.executed_at) : missing}</dd></div>
|
|
|
</dl>
|
|
</dl>
|
|
|
- {(batch.status === "failed" || batch.status === "voided") && batch.fail_reason && <div className="batch-record-note batch-record-note-error" role="alert">
|
|
|
|
|
|
|
+ {!partnerView && (batch.status === "failed" || batch.status === "voided") && batch.fail_reason && <div className="batch-record-note batch-record-note-error" role="alert">
|
|
|
<TriangleAlert size={16} aria-hidden="true" /><p>{batch.fail_reason}</p>
|
|
<TriangleAlert size={16} aria-hidden="true" /><p>{batch.fail_reason}</p>
|
|
|
</div>}
|
|
</div>}
|
|
|
{batch.status === "voided" && batch.voided_by_batch_no && <div className="batch-record-note" role="note">
|
|
{batch.status === "voided" && batch.voided_by_batch_no && <div className="batch-record-note" role="note">
|
|
|
- <p>{VOIDED_BY_PREFIX} <Link className="ops-table-action" to={batchPath(batch.holder_id, batch.voided_by_batch_no)} state={linkState}>
|
|
|
|
|
|
|
+ <p>{VOIDED_BY_PREFIX} <Link className="ops-table-action" to={partnerView ? partnerReconDetailPath(batch.voided_by_batch_no) : batchPath(batch.holder_id, batch.voided_by_batch_no)} state={linkState}>
|
|
|
{batch.voided_by_batch_no}<ArrowRight size={14} aria-hidden="true" />
|
|
{batch.voided_by_batch_no}<ArrowRight size={14} aria-hidden="true" />
|
|
|
</Link> 作废。</p>
|
|
</Link> 作废。</p>
|
|
|
</div>}
|
|
</div>}
|
|
@@ -768,7 +773,7 @@ const batchBillColumns: readonly SettlementLedgerColumn[] = [
|
|
|
{ label: "恒 0 说明", width: 132 },
|
|
{ label: "恒 0 说明", width: 132 },
|
|
|
];
|
|
];
|
|
|
|
|
|
|
|
-function BatchBillingTable({ items, linkState }: { items: ReconDetailResult["items"]; linkState: DetailLinkState }) {
|
|
|
|
|
|
|
+function BatchBillingTable({ items, linkState, billListPath }: { items: ReconDetailResult["items"]; linkState: DetailLinkState; billListPath: string }) {
|
|
|
const table = useSettlementLedgerTable(batchBillColumns);
|
|
const table = useSettlementLedgerTable(batchBillColumns);
|
|
|
return <div className={`${table.className} batch-record-table`} role="region" aria-label="本批账单明细,可横向滚动查看字段" tabIndex={0} ref={table.ref}>
|
|
return <div className={`${table.className} batch-record-table`} role="region" aria-label="本批账单明细,可横向滚动查看字段" tabIndex={0} ref={table.ref}>
|
|
|
<table className="ops-table settlement-ledger" style={{ minWidth: table.minWidth }} aria-label="本批账单明细">
|
|
<table className="ops-table settlement-ledger" style={{ minWidth: table.minWidth }} aria-label="本批账单明细">
|
|
@@ -787,7 +792,7 @@ function BatchBillingTable({ items, linkState }: { items: ReconDetailResult["ite
|
|
|
<td className="settlement-ledger-number"><span className="ops-money settlement-ledger-share">{moneyFromCents(line.share_amount_cents)}</span></td>
|
|
<td className="settlement-ledger-number"><span className="ops-money settlement-ledger-share">{moneyFromCents(line.share_amount_cents)}</span></td>
|
|
|
<td title={zeroNote}>{zeroNote ?? <span className="table-placeholder">—</span>}</td>
|
|
<td title={zeroNote}>{zeroNote ?? <span className="table-placeholder">—</span>}</td>
|
|
|
<td className="settlement-ledger-action">
|
|
<td className="settlement-ledger-action">
|
|
|
- <Link className="ops-table-action" to={`/settlement-bills/${encodeURIComponent(line.bill_detail_id)}`} state={linkState}>
|
|
|
|
|
|
|
+ <Link className="ops-table-action" to={`${billListPath}/${encodeURIComponent(line.bill_detail_id)}`} state={linkState}>
|
|
|
详情<ArrowRight size={14} aria-hidden="true" />
|
|
详情<ArrowRight size={14} aria-hidden="true" />
|
|
|
</Link>
|
|
</Link>
|
|
|
</td>
|
|
</td>
|
|
@@ -912,13 +917,13 @@ function BillRecordPanel({ tab, active, children }: { tab: BillRecordTab; active
|
|
|
</section>;
|
|
</section>;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-function BillBatchLink({ holderId, number, linkState }: { holderId: string; number: string; linkState: DetailLinkState }) {
|
|
|
|
|
- return <Link className="ops-table-action bill-record-batch-link" to={batchPath(holderId, number)} state={linkState}>
|
|
|
|
|
|
|
+function BillBatchLink({ to, number, linkState }: { to: string; number: string; linkState: DetailLinkState }) {
|
|
|
|
|
+ return <Link className="ops-table-action bill-record-batch-link" to={to} state={linkState}>
|
|
|
<span>{number}</span><ArrowRight size={14} aria-hidden="true" />
|
|
<span>{number}</span><ArrowRight size={14} aria-hidden="true" />
|
|
|
</Link>;
|
|
</Link>;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-function BillRecordContent({ bill }: { bill: BillDetailResult }) {
|
|
|
|
|
|
|
+function BillRecordContent({ bill, partnerView }: { bill: BillDetailResult; partnerView: boolean }) {
|
|
|
const location = useLocation();
|
|
const location = useLocation();
|
|
|
const [tab, setTab] = useState<BillRecordTab>(() => billRecordTabs.find(({ id }) => id === location.state?.billTab)?.id ?? "billing");
|
|
const [tab, setTab] = useState<BillRecordTab>(() => billRecordTabs.find(({ id }) => id === location.state?.billTab)?.id ?? "billing");
|
|
|
const outgoingState = detailLinkState(location.pathname + location.search + location.hash, { ...location.state, billTab: tab });
|
|
const outgoingState = detailLinkState(location.pathname + location.search + location.hash, { ...location.state, billTab: tab });
|
|
@@ -1000,11 +1005,10 @@ function BillRecordContent({ bill }: { bill: BillDetailResult }) {
|
|
|
<dl className="ops-record-summary bill-record-facts">
|
|
<dl className="ops-record-summary bill-record-facts">
|
|
|
<div><dt>分成方</dt><dd>{bill.holder_name || missing}</dd></div>
|
|
<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>{settleTextFromSnapshot(bill.share_mode, bill.share_value)}</dd></div>
|
|
|
- <div><dt>所属对账单号</dt><dd><BillBatchLink holderId={bill.holder_id} number={bill.batch_no} linkState={outgoingState} /></dd></div>
|
|
|
|
|
|
|
+ <div><dt>所属对账单号</dt><dd><BillBatchLink to={partnerView ? partnerReconDetailPath(bill.batch_no) : batchPath(bill.holder_id, bill.batch_no)} number={bill.batch_no} linkState={outgoingState} /></dd></div>
|
|
|
</dl>
|
|
</dl>
|
|
|
{bill.base_floor_protected && <p className="bill-record-note" role="note">{BASE_FLOOR_NOTE}</p>}
|
|
{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">
|
|
|
|
|
|
|
+ {!partnerView && bill.other_parties != null && bill.other_parties.length > 0 && <div className="ops-table-wrap bill-record-table">
|
|
|
<table className="ops-table" aria-label="其他分成方">
|
|
<table className="ops-table" aria-label="其他分成方">
|
|
|
<OpsTableColumns widths={[40, 23, 37]} />
|
|
<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>
|
|
<thead><tr><th scope="col">其他分成方</th><th scope="col" className="bill-record-number">分成金额</th><th scope="col">对账单号</th></tr></thead>
|
|
@@ -1012,7 +1016,7 @@ function BillRecordContent({ bill }: { bill: BillDetailResult }) {
|
|
|
{bill.other_parties.map((party, i) => <tr key={`${party.holder_type}-${party.holder_name}-${i}`}>
|
|
{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><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 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} linkState={outgoingState} /> : party.batch_no ?? missing}</td>
|
|
|
|
|
|
|
+ <td>{party.batch_no && party.holder_id ? <BillBatchLink to={batchPath(party.holder_id, party.batch_no)} number={party.batch_no} linkState={outgoingState} /> : party.batch_no ?? missing}</td>
|
|
|
</tr>)}
|
|
</tr>)}
|
|
|
</tbody>
|
|
</tbody>
|
|
|
</table>
|
|
</table>
|
|
@@ -1040,10 +1044,16 @@ function BillRecordContent({ bill }: { bill: BillDetailResult }) {
|
|
|
</>;
|
|
</>;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-export function SettlementBillRecordPage() {
|
|
|
|
|
|
|
+export function SettlementBillRecordPage({ partnerView = false }: { partnerView?: boolean }) {
|
|
|
const { index } = useParams();
|
|
const { index } = useParams();
|
|
|
|
|
+ return <BillRecordPage key={index} index={index} partnerView={partnerView} />;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+function BillRecordPage({ index, partnerView }: { index?: string; partnerView: boolean }) {
|
|
|
const location = useLocation();
|
|
const location = useLocation();
|
|
|
- const back = detailBack(location.state, "/settlement-bills", BACK_TO_BILL_LIST);
|
|
|
|
|
|
|
+ const back = partnerView
|
|
|
|
|
+ ? detailBack(location.state, "/bos/pv/recon", BACK_TO_REGION_RECON)
|
|
|
|
|
+ : detailBack(location.state, "/settlement-bills", BACK_TO_BILL_LIST);
|
|
|
|
|
|
|
|
const detail = useBillDetail(index ?? null);
|
|
const detail = useBillDetail(index ?? null);
|
|
|
const bill = detail.data;
|
|
const bill = detail.data;
|
|
@@ -1073,7 +1083,7 @@ export function SettlementBillRecordPage() {
|
|
|
{detail.fail.message} <Button variant="ghost" size="sm" onClick={detail.reload}>重试</Button>
|
|
{detail.fail.message} <Button variant="ghost" size="sm" onClick={detail.reload}>重试</Button>
|
|
|
</p>}
|
|
</p>}
|
|
|
{!bill && detail.loading && <p className="bill-record-placeholder" role="status">正在读取账单明细…</p>}
|
|
{!bill && detail.loading && <p className="bill-record-placeholder" role="status">正在读取账单明细…</p>}
|
|
|
- {bill && <BillRecordContent key={bill.bill_detail_id} bill={bill} />}
|
|
|
|
|
|
|
+ {bill && <BillRecordContent key={bill.bill_detail_id} bill={bill} partnerView={partnerView} />}
|
|
|
</article>
|
|
</article>
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|