|
@@ -29,7 +29,7 @@ import { useHorizontalOverflow } from "../lib/use-horizontal-overflow";
|
|
|
import { detailBack, detailLinkState, useDetailLinkState, type DetailLinkState } from "../lib/detail-navigation";
|
|
import { detailBack, detailLinkState, useDetailLinkState, type DetailLinkState } from "../lib/detail-navigation";
|
|
|
import {
|
|
import {
|
|
|
lastClosedMonth, submitReconRerun,
|
|
lastClosedMonth, submitReconRerun,
|
|
|
- useBillDetail, useBillList, useReconDetail, useReconList, useReconPeriods,
|
|
|
|
|
|
|
+ useBillDetail, useBillList, useReconDetail, useReconList,
|
|
|
} from "../lib/recon";
|
|
} from "../lib/recon";
|
|
|
import {
|
|
import {
|
|
|
ACTION_FLAG_PENDING_NOTE,
|
|
ACTION_FLAG_PENDING_NOTE,
|
|
@@ -44,8 +44,6 @@ import {
|
|
|
EXPORT_EMPTY_NOTE,
|
|
EXPORT_EMPTY_NOTE,
|
|
|
exportResultNote,
|
|
exportResultNote,
|
|
|
HOLDER_TYPE_TEXT,
|
|
HOLDER_TYPE_TEXT,
|
|
|
- MONTH_NO_BATCH_NOTE,
|
|
|
|
|
- PERIODS_UNAVAILABLE,
|
|
|
|
|
periodProgressLine,
|
|
periodProgressLine,
|
|
|
PROGRESS_COLLAPSE,
|
|
PROGRESS_COLLAPSE,
|
|
|
PROGRESS_EXPAND,
|
|
PROGRESS_EXPAND,
|
|
@@ -315,7 +313,6 @@ export function SettlementStatementListPage() {
|
|
|
const canExportAll = !identity || identity.role === "admin" || identity.role === "regAdmin";
|
|
const canExportAll = !identity || identity.role === "admin" || identity.role === "regAdmin";
|
|
|
const isAdmin = !identity || identity.role === "admin";
|
|
const isAdmin = !identity || identity.role === "admin";
|
|
|
|
|
|
|
|
- const lastClosedPeriod = lastClosedMonth();
|
|
|
|
|
const monthParam = filters.get("month");
|
|
const monthParam = filters.get("month");
|
|
|
// 无参数时显示全部自然月,同时兼容旧链接的 month=all。
|
|
// 无参数时显示全部自然月,同时兼容旧链接的 month=all。
|
|
|
const month = monthParam === "all" ? "" : monthParam;
|
|
const month = monthParam === "all" ? "" : monthParam;
|
|
@@ -329,28 +326,6 @@ export function SettlementStatementListPage() {
|
|
|
const page = Number(filters.get("page") || "1") || 1;
|
|
const page = Number(filters.get("page") || "1") || 1;
|
|
|
const hasFilter = Boolean(month || type || party || reconcile || status || trigger || zero || q);
|
|
const hasFilter = Boolean(month || type || party || reconcile || status || trigger || zero || q);
|
|
|
|
|
|
|
|
- const periodsFetch = useReconPeriods();
|
|
|
|
|
- // D-19:下拉选项=接口期次 ∪ 上一个已结束自然月(与人工补跑弹窗 `lastClosedMonth()` 同基准)。
|
|
|
|
|
- // 仅有历史批、尚无「上月」批时,仍须能选上月(可能空表),⛔ 静默退到更早月造成「弹窗说 10 月、清单只到 9 月」。
|
|
|
|
|
- const periods = (() => {
|
|
|
|
|
- const raw = periodsFetch.data?.periods ?? null;
|
|
|
|
|
- if (!raw) return null;
|
|
|
|
|
- if (raw.includes(lastClosedPeriod)) return raw;
|
|
|
|
|
- return [lastClosedPeriod, ...raw];
|
|
|
|
|
- })();
|
|
|
|
|
- // 仅纠正不在选项内的显式月份(例如旧书签中的月份)。
|
|
|
|
|
- const [monthFallback, setMonthFallback] = useState(false);
|
|
|
|
|
- useEffect(() => {
|
|
|
|
|
- if (!periods?.length) return;
|
|
|
|
|
- if (!month || periods.includes(month)) {
|
|
|
|
|
- setMonthFallback(false);
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- filters.set("month", periods[0], true);
|
|
|
|
|
- setMonthFallback(true);
|
|
|
|
|
- // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
|
|
|
- }, [periods, month]);
|
|
|
|
|
-
|
|
|
|
|
const list = useReconList({
|
|
const list = useReconList({
|
|
|
period: month,
|
|
period: month,
|
|
|
holderType: type,
|
|
holderType: type,
|
|
@@ -411,8 +386,6 @@ export function SettlementStatementListPage() {
|
|
|
|
|
|
|
|
{/* 接线占位横幅(klt-bos recon/* 未交付;交付后本分支自然失效) */}
|
|
{/* 接线占位横幅(klt-bos recon/* 未交付;交付后本分支自然失效) */}
|
|
|
{wiring && <p className="ops-import-note" role="status">{RECON_WIRING_NOTE}</p>}
|
|
{wiring && <p className="ops-import-note" role="status">{RECON_WIRING_NOTE}</p>}
|
|
|
- {periodsFetch.fail && !wiring && <p className="ops-import-note" role="status">{PERIODS_UNAVAILABLE}</p>}
|
|
|
|
|
- {monthFallback && !rows.length && <p className="ops-import-note" role="status">{MONTH_NO_BATCH_NOTE}</p>}
|
|
|
|
|
|
|
|
|
|
{/* ② 三统计卡:与列表同一响应同一行集;S404 ⇒ 整体不渲染(不是显示 0);单格 null ⇒「取数失败」。 */}
|
|
{/* ② 三统计卡:与列表同一响应同一行集;S404 ⇒ 整体不渲染(不是显示 0);单格 null ⇒「取数失败」。 */}
|
|
|
{!s404 && (wiring || data) && (
|
|
{!s404 && (wiring || data) && (
|
|
@@ -466,7 +439,7 @@ export function SettlementStatementListPage() {
|
|
|
|
|
|
|
|
{/* ④ 批次清单 */}
|
|
{/* ④ 批次清单 */}
|
|
|
<div className="reconcile-ledger list-shell-fill">
|
|
<div className="reconcile-ledger list-shell-fill">
|
|
|
- {/* ③ 筛选条:自然月(periods 口)/分成方类型/分成方(可搜)/出账状态/批次状态/对账单号关键字/零明细开关/重置筛选。 */}
|
|
|
|
|
|
|
+ {/* ③ 筛选条:自然月/分成方类型/分成方(可搜)/出账状态/批次状态/对账单号关键字/零明细开关/重置筛选。 */}
|
|
|
<div className="ops-toolbar reconcile-filters statement-filters" role="group" aria-label="对账清单筛选">
|
|
<div className="ops-toolbar reconcile-filters statement-filters" role="group" aria-label="对账清单筛选">
|
|
|
<label className="ops-search">
|
|
<label className="ops-search">
|
|
|
<Search size={17} aria-hidden="true" />
|
|
<Search size={17} aria-hidden="true" />
|
|
@@ -480,7 +453,7 @@ export function SettlementStatementListPage() {
|
|
|
onCommit={(value) => filters.set("party", value, true)} />
|
|
onCommit={(value) => filters.set("party", value, true)} />
|
|
|
{party && <button type="button" aria-label="清空分成方" onClick={() => filters.set("party", "", true)}><X size={15} aria-hidden="true" /></button>}
|
|
{party && <button type="button" aria-label="清空分成方" onClick={() => filters.set("party", "", true)}><X size={15} aria-hidden="true" /></button>}
|
|
|
</label>
|
|
</label>
|
|
|
- <MonthFilter value={month} availableMonths={periods ?? (month ? [month] : [])} onChange={(value) => filters.set("month", value, true)} />
|
|
|
|
|
|
|
+ <MonthFilter value={month} onChange={(value) => filters.set("month", value, true)} />
|
|
|
<FilterSelect icon="type" aria-label="分成方类型" value={type} onChange={(event) => filters.set("type", event.target.value, true)}>
|
|
<FilterSelect icon="type" aria-label="分成方类型" value={type} onChange={(event) => filters.set("type", event.target.value, true)}>
|
|
|
<option value="">全部类型</option>
|
|
<option value="">全部类型</option>
|
|
|
<option value="operator">{HOLDER_TYPE_TEXT.operator}</option>
|
|
<option value="operator">{HOLDER_TYPE_TEXT.operator}</option>
|
|
@@ -508,7 +481,7 @@ export function SettlementStatementListPage() {
|
|
|
</FilterSelect>
|
|
</FilterSelect>
|
|
|
<Button variant={zero ? "default" : "outline"} size="sm" className="h-[38px] shrink-0" aria-pressed={zero}
|
|
<Button variant={zero ? "default" : "outline"} size="sm" className="h-[38px] shrink-0" aria-pressed={zero}
|
|
|
onClick={() => filters.set("zero", zero ? "" : "1", true)}><ListFilter size={15} aria-hidden="true" />零明细批次</Button>
|
|
onClick={() => filters.set("zero", zero ? "" : "1", true)}><ListFilter size={15} aria-hidden="true" />零明细批次</Button>
|
|
|
- {hasFilter && <Button variant="ghost" size="sm" onClick={() => { filters.reset(); setMonthFallback(false); }}>重置筛选</Button>}
|
|
|
|
|
|
|
+ {hasFilter && <Button variant="ghost" size="sm" onClick={filters.reset}>重置筛选</Button>}
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
{/* S404 触顶 ⇒ 不渲染三卡与列表(⚠️ 禁止静默截断)。 */}
|
|
{/* S404 触顶 ⇒ 不渲染三卡与列表(⚠️ 禁止静默截断)。 */}
|
|
@@ -806,8 +779,6 @@ export function SettlementBillListPage() {
|
|
|
const page = Number(filters.get("page") || "1") || 1;
|
|
const page = Number(filters.get("page") || "1") || 1;
|
|
|
const hasFilter = Boolean(q || type || month);
|
|
const hasFilter = Boolean(q || type || month);
|
|
|
|
|
|
|
|
- const periodsFetch = useReconPeriods();
|
|
|
|
|
- const periods = periodsFetch.data?.periods ?? null;
|
|
|
|
|
const list = useBillList({ period: month, holderType: type, keyword: q, page });
|
|
const list = useBillList({ period: month, holderType: type, keyword: q, page });
|
|
|
const wiring = list.fail?.kind === "wiring";
|
|
const wiring = list.fail?.kind === "wiring";
|
|
|
const rows = list.data?.items ?? [];
|
|
const rows = list.data?.items ?? [];
|
|
@@ -839,7 +810,7 @@ export function SettlementBillListPage() {
|
|
|
<option value="partner">{HOLDER_TYPE_TEXT.partner}</option>
|
|
<option value="partner">{HOLDER_TYPE_TEXT.partner}</option>
|
|
|
<option value="ops_team">{HOLDER_TYPE_TEXT.ops_team}</option>
|
|
<option value="ops_team">{HOLDER_TYPE_TEXT.ops_team}</option>
|
|
|
</FilterSelect>
|
|
</FilterSelect>
|
|
|
- <MonthFilter value={month} availableMonths={periods ?? (month ? [month] : [])} onChange={(value) => filters.set("month", value, true)} />
|
|
|
|
|
|
|
+ <MonthFilter value={month} onChange={(value) => filters.set("month", value, true)} />
|
|
|
{hasFilter && <Button variant="ghost" size="sm" onClick={filters.reset}>重置筛选</Button>}
|
|
{hasFilter && <Button variant="ghost" size="sm" onClick={filters.reset}>重置筛选</Button>}
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|