|
@@ -652,7 +652,7 @@ export function OperatorBillDetailPage() {
|
|
|
|
|
|
|
|
/* ── V-P2/V-P7 本方客户清单(同组件两路由;形态 D 列待客户§登记) ────────────── */
|
|
/* ── V-P2/V-P7 本方客户清单(同组件两路由;形态 D 列待客户§登记) ────────────── */
|
|
|
|
|
|
|
|
-const partnerCustomerColumns = [
|
|
|
|
|
|
|
+const partyCustomerColumns = [
|
|
|
{ label: "客户名称", width: 185 },
|
|
{ label: "客户名称", width: 185 },
|
|
|
{ label: "主体 / 识别号", width: 140 },
|
|
{ label: "主体 / 识别号", width: 140 },
|
|
|
{ label: "所属区域", width: 168 },
|
|
{ label: "所属区域", width: 168 },
|
|
@@ -675,110 +675,48 @@ export function PartyCustomerListPage({ kind }: { kind: "partner" | "operator" }
|
|
|
subject_type: subject || undefined, status: status || undefined }),
|
|
subject_type: subject || undefined, status: status || undefined }),
|
|
|
[keyword, page, subject, status],
|
|
[keyword, page, subject, status],
|
|
|
);
|
|
);
|
|
|
- const { data, fail } = fetchState;
|
|
|
|
|
|
|
+ const { data } = fetchState;
|
|
|
const rows = data?.items ?? [];
|
|
const rows = data?.items ?? [];
|
|
|
const total = data?.total ?? 0;
|
|
const total = data?.total ?? 0;
|
|
|
- const pageSize = PARTY_PAGE_SIZE;
|
|
|
|
|
|
|
|
|
|
- if (kind === "partner") {
|
|
|
|
|
- const filtered = !!(keyword || subject || status);
|
|
|
|
|
- const filters = <>
|
|
|
|
|
- <PartySearch label="搜索客户" placeholder="搜索客户名称或主体号" value={keyword} onChange={(value) => { setKeyword(value); setPage(1); }} />
|
|
|
|
|
- <FilterSelect icon="type" aria-label="主体类型筛选" value={subject} onChange={(event) => { setSubject(event.target.value); setPage(1); }}>
|
|
|
|
|
- <option value="">全部主体类型</option>
|
|
|
|
|
- {["enterprise", "individual", "sole_proprietor"].map((code) => <option value={code} key={code}>{SUBJECT_TYPE[code]}</option>)}
|
|
|
|
|
- </FilterSelect>
|
|
|
|
|
- <FilterSelect icon="status" aria-label="客户状态筛选" value={status} onChange={(event) => { setStatus(event.target.value); setPage(1); }}>
|
|
|
|
|
- <option value="">全部状态</option>
|
|
|
|
|
- {["not_opened", "in_use", "stopped"].map((code) => <option value={code} key={code}>{ACCT_STATUS[code]}</option>)}
|
|
|
|
|
- </FilterSelect>
|
|
|
|
|
- {filtered && <Button variant="ghost" size="sm" onClick={() => { setKeyword(""); setSubject(""); setStatus(""); setPage(1); }}>重置筛选</Button>}
|
|
|
|
|
- </>;
|
|
|
|
|
-
|
|
|
|
|
- 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>
|
|
|
|
|
- <PartyLedger title="客户清单" columns={partnerCustomerColumns} filters={filters} dataState={fetchState}
|
|
|
|
|
- total={total} page={page} setPage={setPage} unit="家" empty={filtered ? "没有符合筛选条件的客户。" : "暂无客户。"}>
|
|
|
|
|
- {rows.map((row) => {
|
|
|
|
|
- const planNames = row.plan_names?.join("、");
|
|
|
|
|
- const accountStatus = label(ACCT_STATUS, row.acct_status);
|
|
|
|
|
- const tone = accountStatus === "已停用" ? "danger" : accountStatus === "正常" || accountStatus === "使用中" ? "success" : "neutral";
|
|
|
|
|
- return <tr key={row.customer_id}>
|
|
|
|
|
- <td><span className="table-cell-title" title={row.customer_name}>{row.customer_name}</span><small title={row.customer_id}>{row.customer_id}</small></td>
|
|
|
|
|
- <td>{label(SUBJECT_TYPE, row.subject_type)}<small title={row.identity_no_masked || undefined}>
|
|
|
|
|
- {row.identity_no_masked === undefined ? <Tri tone="fail" text={WORD_NOT_PROVIDED} /> : row.identity_no_masked || <span className="table-placeholder">未登记识别号</span>}
|
|
|
|
|
- </small></td>
|
|
|
|
|
- <td title={row.region_path || undefined}>{row.region_path === undefined ? <Tri tone="fail" text={WORD_NOT_PROVIDED} /> : row.region_path || <span className="table-placeholder">未挂载区域</span>}</td>
|
|
|
|
|
- <td title={planNames}>{row.plan_names === undefined ? <Tri tone="fail" text={WORD_NOT_PROVIDED} /> : planNames || <span className="table-placeholder">无在用订阅</span>}</td>
|
|
|
|
|
- <td>{accountStatus ? <OpsStatus tone={tone}>{accountStatus}</OpsStatus> : <span className="table-placeholder">—</span>}</td>
|
|
|
|
|
- <td className="settlement-ledger-action"><Link className="ops-table-action" to={`${prefix}/customer/${encodeURIComponent(row.customer_id)}`} state={linkState}>详情<ArrowRight size={14} aria-hidden="true" /></Link></td>
|
|
|
|
|
- </tr>;
|
|
|
|
|
- })}
|
|
|
|
|
- </PartyLedger>
|
|
|
|
|
- </section>;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- return (
|
|
|
|
|
- <section className="ops-page reconcile-index page-fill">
|
|
|
|
|
- <header className="reconcile-page-heading">
|
|
|
|
|
- <div>
|
|
|
|
|
- <p className="ops-eyebrow"><span /> READONLY / 只读视图</p>
|
|
|
|
|
- <h1>客户清单</h1>
|
|
|
|
|
- <PageIntro>查找与本方业务相关的客户,确认客户归属和服务情况。</PageIntro>
|
|
|
|
|
- </div>
|
|
|
|
|
- </header>
|
|
|
|
|
- <div className="reconcile-filters">
|
|
|
|
|
- <label className="ops-search">
|
|
|
|
|
- <Search size={17} />
|
|
|
|
|
- <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} /></button>}
|
|
|
|
|
- </label>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- {fail?.kind === "fail" && <FullPageState text={fail.message} retry={fetchState.reload} />}
|
|
|
|
|
- {fail && fail.kind !== "fail" && <FullPageState text={fail.kind === "forbidden" ? VIEW_ROLE_FORBIDDEN : fail.kind === "wiring" ? VIEW_WIRING_NOTE : VIEW_LIST_EMPTY} />}
|
|
|
|
|
|
|
+ const filtered = !!(keyword || subject || status);
|
|
|
|
|
+ const filters = <>
|
|
|
|
|
+ <PartySearch label="搜索客户" placeholder="搜索客户名称或主体号" value={keyword} onChange={(value) => { setKeyword(value); setPage(1); }} />
|
|
|
|
|
+ <FilterSelect icon="type" aria-label="主体类型筛选" value={subject} onChange={(event) => { setSubject(event.target.value); setPage(1); }}>
|
|
|
|
|
+ <option value="">全部主体类型</option>
|
|
|
|
|
+ {["enterprise", "individual", "sole_proprietor"].map((code) => <option value={code} key={code}>{SUBJECT_TYPE[code]}</option>)}
|
|
|
|
|
+ </FilterSelect>
|
|
|
|
|
+ <FilterSelect icon="status" aria-label="客户状态筛选" value={status} onChange={(event) => { setStatus(event.target.value); setPage(1); }}>
|
|
|
|
|
+ <option value="">全部状态</option>
|
|
|
|
|
+ {["not_opened", "in_use", "stopped"].map((code) => <option value={code} key={code}>{ACCT_STATUS[code]}</option>)}
|
|
|
|
|
+ </FilterSelect>
|
|
|
|
|
+ {filtered && <Button variant="ghost" size="sm" onClick={() => { setKeyword(""); setSubject(""); setStatus(""); setPage(1); }}>重置筛选</Button>}
|
|
|
|
|
+ </>;
|
|
|
|
|
|
|
|
- {!fail && (
|
|
|
|
|
- <div className="reconcile-ledger list-shell-fill">
|
|
|
|
|
- <div className="ops-table-wrap">
|
|
|
|
|
- <table className="ops-table">
|
|
|
|
|
- {/* 形态 D 列=客户名称/识别号/服务开通状态/所属区域/生效套餐摘要(视图§5.1);
|
|
|
|
|
- 识别号│区域路径│套餐名均随 `/customer/get_list@v1` 下发(D-71 三态:键缺失=未下发,
|
|
|
|
|
- `null`/空=未登记│未挂载│无在用订阅)。 */}
|
|
|
|
|
- <thead><tr><th>客户名称</th><th>客户识别号</th><th>服务开通状态</th><th>所属区域</th><th>生效套餐摘要</th><th>操作</th></tr></thead>
|
|
|
|
|
- <tbody>
|
|
|
|
|
- {rows.map((row) => (
|
|
|
|
|
- <tr key={row.customer_id}>
|
|
|
|
|
- <td>{row.customer_name}</td>
|
|
|
|
|
- {/* 识别号:列表口下发 `identity_no_masked`(keybox 解密后脱敏);`null`=未登记,键缺失才标未下发。 */}
|
|
|
|
|
- <td>{row.identity_no_masked === undefined ? <Tri tone="fail" text={WORD_NOT_PROVIDED} title="客户列表口未下发 identity_no_masked" /> : row.identity_no_masked ? <span className="ops-mono">{row.identity_no_masked}</span> : <Tri tone="missing" text="未登记" />}</td>
|
|
|
|
|
- {/* 三态原样渲染(客户§2 acct_status,库内英文码 ⇒ 按字典转中文),⛔ 重算/派生第四态。 */}
|
|
|
|
|
- <td><OpsTag tone={row.acct_status === "in_use" || row.acct_status === "在用" ? "success" : row.acct_status === "stopped" || row.acct_status === "停用" ? "warning" : "neutral"}>{label(ACCT_STATUS, row.acct_status)}</OpsTag></td>
|
|
|
|
|
- {/* 所属区域:后端 `region_path` 取层级真源 `bos_region_meta.path_name`(未定级回落节点 ID);
|
|
|
|
|
- 键缺失=未下发,空=未挂载(⛔ 把「无挂载」说成「未下发」)。 */}
|
|
|
|
|
- <td>{row.region_path === undefined ? <Tri tone="fail" text={WORD_NOT_PROVIDED} title="客户列表口未下发 region_path" /> : row.region_path ? row.region_path : <Tri tone="missing" text="未挂载区域" />}</td>
|
|
|
|
|
- {/* 生效套餐摘要:后端 `plan_names`(在用订阅的套餐名,status ∈ pending/active)。 */}
|
|
|
|
|
- <td>{row.plan_names === undefined ? <Tri tone="fail" text={WORD_NOT_PROVIDED} title="客户列表口未下发 plan_names" /> : row.plan_names.length ? row.plan_names.join("、") : <Tri tone="missing" text="无在用订阅" />}</td>
|
|
|
|
|
- <td><Link className="workspace-link" to={`${prefix}/customer/${encodeURIComponent(row.customer_id)}`} state={linkState}>查看</Link></td>
|
|
|
|
|
- </tr>
|
|
|
|
|
- ))}
|
|
|
|
|
- {!rows.length && <OpsTableEmpty colSpan={6}>{VIEW_LIST_EMPTY}</OpsTableEmpty>}
|
|
|
|
|
- </tbody>
|
|
|
|
|
- </table>
|
|
|
|
|
- </div>
|
|
|
|
|
- <ServerListPager total={total} page={page} pageSize={pageSize} onPageChange={setPage} unit="家" />
|
|
|
|
|
- </div>
|
|
|
|
|
- )}
|
|
|
|
|
- </section>
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ 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>
|
|
|
|
|
+ <PartyLedger title="客户清单" columns={partyCustomerColumns} filters={filters} dataState={fetchState}
|
|
|
|
|
+ total={total} page={page} setPage={setPage} unit="家" empty={filtered ? "没有符合筛选条件的客户。" : "暂无客户。"}>
|
|
|
|
|
+ {rows.map((row) => {
|
|
|
|
|
+ const planNames = row.plan_names?.join("、");
|
|
|
|
|
+ const accountStatus = label(ACCT_STATUS, row.acct_status);
|
|
|
|
|
+ const tone = accountStatus === "已停用" ? "danger" : accountStatus === "正常" || accountStatus === "使用中" ? "success" : "neutral";
|
|
|
|
|
+ return <tr key={row.customer_id}>
|
|
|
|
|
+ <td><span className="table-cell-title" title={row.customer_name}>{row.customer_name}</span><small title={row.customer_id}>{row.customer_id}</small></td>
|
|
|
|
|
+ <td>{label(SUBJECT_TYPE, row.subject_type)}<small title={row.identity_no_masked || undefined}>
|
|
|
|
|
+ {row.identity_no_masked === undefined ? <Tri tone="fail" text={WORD_NOT_PROVIDED} /> : row.identity_no_masked || <span className="table-placeholder">未登记识别号</span>}
|
|
|
|
|
+ </small></td>
|
|
|
|
|
+ <td title={row.region_path || undefined}>{row.region_path === undefined ? <Tri tone="fail" text={WORD_NOT_PROVIDED} /> : row.region_path || <span className="table-placeholder">未挂载区域</span>}</td>
|
|
|
|
|
+ <td title={planNames}>{row.plan_names === undefined ? <Tri tone="fail" text={WORD_NOT_PROVIDED} /> : planNames || <span className="table-placeholder">无在用订阅</span>}</td>
|
|
|
|
|
+ <td>{accountStatus ? <OpsStatus tone={tone}>{accountStatus}</OpsStatus> : <span className="table-placeholder">—</span>}</td>
|
|
|
|
|
+ <td className="settlement-ledger-action"><Link className="ops-table-action" to={`${prefix}/customer/${encodeURIComponent(row.customer_id)}`} state={linkState}>详情<ArrowRight size={14} aria-hidden="true" /></Link></td>
|
|
|
|
|
+ </tr>;
|
|
|
|
|
+ })}
|
|
|
|
|
+ </PartyLedger>
|
|
|
|
|
+ </section>;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/* ── V-P3/V-P8 本方合同清单(行末只有查看) ─────────────────────────────── */
|
|
/* ── V-P3/V-P8 本方合同清单(行末只有查看) ─────────────────────────────── */
|
|
@@ -795,7 +733,7 @@ function contractPlanNames(row: ContractRow) {
|
|
|
return [...new Set(names)].join("、");
|
|
return [...new Set(names)].join("、");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-const partnerContractColumns = [
|
|
|
|
|
|
|
+const partyContractColumns = [
|
|
|
{ label: "合同 / 客户", width: 182 },
|
|
{ label: "合同 / 客户", width: 182 },
|
|
|
{ label: "外部单号", width: 115 },
|
|
{ label: "外部单号", width: 115 },
|
|
|
{ label: "套餐", width: 146 },
|
|
{ label: "套餐", width: 146 },
|
|
@@ -819,111 +757,53 @@ export function PartyContractListPage({ kind }: { kind: "partner" | "operator" }
|
|
|
status: status || undefined, expiring_within_days: expiring ? EXPIRING_SOON_DAYS : undefined }),
|
|
status: status || undefined, expiring_within_days: expiring ? EXPIRING_SOON_DAYS : undefined }),
|
|
|
[keyword, page, status, expiring],
|
|
[keyword, page, status, expiring],
|
|
|
);
|
|
);
|
|
|
- const { data, fail } = fetchState;
|
|
|
|
|
|
|
+ const { data } = fetchState;
|
|
|
const rows = data?.items ?? [];
|
|
const rows = data?.items ?? [];
|
|
|
const total = data?.total ?? rows.length;
|
|
const total = data?.total ?? rows.length;
|
|
|
- const pageSize = PARTY_PAGE_SIZE;
|
|
|
|
|
|
|
|
|
|
- if (kind === "partner") {
|
|
|
|
|
- const filtered = !!(keyword || status || expiring);
|
|
|
|
|
- const filters = <>
|
|
|
|
|
- <PartySearch label="搜索合同" placeholder="搜索合同编号、客户或外部单号" value={keyword} onChange={(value) => { setKeyword(value); setPage(1); }} />
|
|
|
|
|
- <FilterSelect icon="status" aria-label="合同状态筛选" value={status} onChange={(event) => { setStatus(event.target.value); setPage(1); }}>
|
|
|
|
|
- <option value="">全部状态</option>
|
|
|
|
|
- <option value="not_effective">待生效</option><option value="effective">生效中</option>
|
|
|
|
|
- <option value="expired">已到期</option><option value="undetermined">不可判(缺起止日)</option>
|
|
|
|
|
- </FilterSelect>
|
|
|
|
|
- <Button variant={expiring ? "default" : "outline"} size="sm" aria-pressed={expiring} onClick={() => { setExpiring(!expiring); setPage(1); }}>
|
|
|
|
|
- <CalendarClock size={15} aria-hidden="true" />快到期 {EXPIRING_SOON_DAYS} 天内
|
|
|
|
|
- </Button>
|
|
|
|
|
- {filtered && <Button variant="ghost" size="sm" onClick={() => { setKeyword(""); setStatus(""); setExpiring(false); setPage(1); }}>重置筛选</Button>}
|
|
|
|
|
- </>;
|
|
|
|
|
-
|
|
|
|
|
- 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>
|
|
|
|
|
- <PartyLedger title="合同清单" columns={partnerContractColumns} filters={filters} dataState={fetchState}
|
|
|
|
|
- total={total} page={page} setPage={setPage} unit="份" empty={filtered ? "没有符合筛选条件的合同。" : "暂无合同。"}>
|
|
|
|
|
- {rows.map((row) => {
|
|
|
|
|
- const start = row.start_date?.slice(0, 10);
|
|
|
|
|
- const end = row.end_date?.slice(0, 10);
|
|
|
|
|
- const lifecycle = start && end ? contractStatusOf(start, end) : null;
|
|
|
|
|
- const planNames = contractPlanNames(row);
|
|
|
|
|
- const amount = row.contract_amount_cents ?? row.amount_cents;
|
|
|
|
|
- return <tr key={row.contract_id}>
|
|
|
|
|
- <td><span className="table-cell-title" title={row.contract_no}>{row.contract_no}</span><small title={row.customer_name}>{row.customer_name || <span className="table-placeholder">—</span>}</small></td>
|
|
|
|
|
- <td className="ops-mono" title={row.external_no || undefined}>{row.external_no || <span className="table-placeholder">—</span>}</td>
|
|
|
|
|
- <td title={planNames || undefined}>{planNames || <span className="table-placeholder">{WORD_UNCONFIGURED}</span>}</td>
|
|
|
|
|
- <td>{lifecycle ? <OpsStatus tone={lifecycle === "已到期" ? "warning" : contractStatusTone[lifecycle]}>{lifecycle}</OpsStatus> : <span className="table-placeholder">{WORD_UNCONFIGURED}</span>}
|
|
|
|
|
- <small>{start || end ? `${start || "—"} 至 ${end || "—"}` : <span className="table-placeholder">—</span>}</small></td>
|
|
|
|
|
- <td>{row.opened == null
|
|
|
|
|
- ? row.opened_state === "error" || row.opened_state === "failed" ? <Tri tone="fail" text={WORD_FETCH_FAILED} /> : <span className="table-placeholder">—</span>
|
|
|
|
|
- : <OpsStatus tone={row.opened ? "success" : "warning"}>{row.opened ? "已开通" : "未开通"}</OpsStatus>}</td>
|
|
|
|
|
- <td className="settlement-ledger-number">{amount == null ? <span className="table-placeholder">—</span> : <span className="ops-money">{moneyFromCents(amount)}</span>}
|
|
|
|
|
- <small>{row.service_months == null ? <span className="table-placeholder">—</span> : `服务期 ${row.service_months} 个月`}</small></td>
|
|
|
|
|
- <td className="settlement-ledger-action"><Link className="ops-table-action" to={`${prefix}/contract/${encodeURIComponent(row.contract_id)}`} state={linkState}>详情<ArrowRight size={14} aria-hidden="true" /></Link></td>
|
|
|
|
|
- </tr>;
|
|
|
|
|
- })}
|
|
|
|
|
- </PartyLedger>
|
|
|
|
|
- </section>;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- return (
|
|
|
|
|
- <section className="ops-page reconcile-index page-fill">
|
|
|
|
|
- <header className="reconcile-page-heading">
|
|
|
|
|
- <div>
|
|
|
|
|
- <p className="ops-eyebrow"><span /> READONLY / 只读视图</p>
|
|
|
|
|
- <h1>合同清单</h1>
|
|
|
|
|
- <PageIntro>按客户查找与本方业务相关的合同,核对服务期限和开通情况。</PageIntro>
|
|
|
|
|
- </div>
|
|
|
|
|
- </header>
|
|
|
|
|
- <div className="reconcile-filters">
|
|
|
|
|
- <label className="ops-search">
|
|
|
|
|
- <Search size={17} />
|
|
|
|
|
- <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} /></button>}
|
|
|
|
|
- </label>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- {fail?.kind === "fail" && <FullPageState text={fail.message} retry={fetchState.reload} />}
|
|
|
|
|
- {fail && fail.kind !== "fail" && <FullPageState text={fail.kind === "forbidden" ? VIEW_ROLE_FORBIDDEN : fail.kind === "wiring" ? VIEW_WIRING_NOTE : VIEW_LIST_EMPTY} />}
|
|
|
|
|
|
|
+ const filtered = !!(keyword || status || expiring);
|
|
|
|
|
+ const filters = <>
|
|
|
|
|
+ <PartySearch label="搜索合同" placeholder="搜索合同编号、客户或外部单号" value={keyword} onChange={(value) => { setKeyword(value); setPage(1); }} />
|
|
|
|
|
+ <FilterSelect icon="status" aria-label="合同状态筛选" value={status} onChange={(event) => { setStatus(event.target.value); setPage(1); }}>
|
|
|
|
|
+ <option value="">全部状态</option>
|
|
|
|
|
+ <option value="not_effective">待生效</option><option value="effective">生效中</option>
|
|
|
|
|
+ <option value="expired">已到期</option><option value="undetermined">不可判(缺起止日)</option>
|
|
|
|
|
+ </FilterSelect>
|
|
|
|
|
+ <Button variant={expiring ? "default" : "outline"} size="sm" aria-pressed={expiring} onClick={() => { setExpiring(!expiring); setPage(1); }}>
|
|
|
|
|
+ <CalendarClock size={15} aria-hidden="true" />快到期 {EXPIRING_SOON_DAYS} 天内
|
|
|
|
|
+ </Button>
|
|
|
|
|
+ {filtered && <Button variant="ghost" size="sm" onClick={() => { setKeyword(""); setStatus(""); setExpiring(false); setPage(1); }}>重置筛选</Button>}
|
|
|
|
|
+ </>;
|
|
|
|
|
|
|
|
- {!fail && (
|
|
|
|
|
- <div className="reconcile-ledger list-shell-fill">
|
|
|
|
|
- <div className="ops-table-wrap">
|
|
|
|
|
- <table className="ops-table">
|
|
|
|
|
- {/*
|
|
|
|
|
- 合同名称列:合同数据模型**不存名称列**(第 3 册「合同条目不存名」)⇒ 按本合同
|
|
|
|
|
- 服务条目的套餐现名汇总显示(真值派生,⛔ 造名)。无条目时标「未配置」,⛔ 标「后端未下发」。
|
|
|
|
|
- */}
|
|
|
|
|
- <thead><tr><th>合同编号</th><th>合同名称</th><th>客户名称</th><th>合同期间</th><th>状态</th><th>操作</th></tr></thead>
|
|
|
|
|
- <tbody>
|
|
|
|
|
- {rows.map((row) => (
|
|
|
|
|
- <tr key={row.contract_id}>
|
|
|
|
|
- <td className="ops-mono">{row.contract_no}</td>
|
|
|
|
|
- <td>{contractPlanNames(row) || <Tri tone="missing" text={WORD_UNCONFIGURED} />}</td>
|
|
|
|
|
- <td>{row.customer_name ?? <Tri tone="missing" text={WORD_NOT_PROVIDED} />}</td>
|
|
|
|
|
- <td>{row.start_date ?? <span className="table-placeholder">—</span>} ~ {row.end_date ?? <span className="table-placeholder">—</span>}</td>
|
|
|
|
|
- <td><OpsTag tone="neutral">{row.status}</OpsTag></td>
|
|
|
|
|
- <td><Link className="workspace-link" to={`${prefix}/contract/${encodeURIComponent(row.contract_id)}`} state={linkState}>查看</Link></td>
|
|
|
|
|
- </tr>
|
|
|
|
|
- ))}
|
|
|
|
|
- {!rows.length && <OpsTableEmpty colSpan={6}>{VIEW_LIST_EMPTY}</OpsTableEmpty>}
|
|
|
|
|
- </tbody>
|
|
|
|
|
- </table>
|
|
|
|
|
- </div>
|
|
|
|
|
- <ServerListPager total={total} page={page} pageSize={pageSize} onPageChange={setPage} unit="份" />
|
|
|
|
|
- </div>
|
|
|
|
|
- )}
|
|
|
|
|
- </section>
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ 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>
|
|
|
|
|
+ <PartyLedger title="合同清单" columns={partyContractColumns} filters={filters} dataState={fetchState}
|
|
|
|
|
+ total={total} page={page} setPage={setPage} unit="份" empty={filtered ? "没有符合筛选条件的合同。" : "暂无合同。"}>
|
|
|
|
|
+ {rows.map((row) => {
|
|
|
|
|
+ const start = row.start_date?.slice(0, 10);
|
|
|
|
|
+ const end = row.end_date?.slice(0, 10);
|
|
|
|
|
+ const lifecycle = start && end ? contractStatusOf(start, end) : null;
|
|
|
|
|
+ const planNames = contractPlanNames(row);
|
|
|
|
|
+ const amount = row.contract_amount_cents ?? row.amount_cents;
|
|
|
|
|
+ return <tr key={row.contract_id}>
|
|
|
|
|
+ <td><span className="table-cell-title" title={row.contract_no}>{row.contract_no}</span><small title={row.customer_name}>{row.customer_name || <span className="table-placeholder">—</span>}</small></td>
|
|
|
|
|
+ <td className="ops-mono" title={row.external_no || undefined}>{row.external_no || <span className="table-placeholder">—</span>}</td>
|
|
|
|
|
+ <td title={planNames || undefined}>{planNames || <span className="table-placeholder">{WORD_UNCONFIGURED}</span>}</td>
|
|
|
|
|
+ <td>{lifecycle ? <OpsStatus tone={lifecycle === "已到期" ? "warning" : contractStatusTone[lifecycle]}>{lifecycle}</OpsStatus> : <span className="table-placeholder">{WORD_UNCONFIGURED}</span>}
|
|
|
|
|
+ <small>{start || end ? `${start || "—"} 至 ${end || "—"}` : <span className="table-placeholder">—</span>}</small></td>
|
|
|
|
|
+ <td>{row.opened == null
|
|
|
|
|
+ ? row.opened_state === "error" || row.opened_state === "failed" ? <Tri tone="fail" text={WORD_FETCH_FAILED} /> : <span className="table-placeholder">—</span>
|
|
|
|
|
+ : <OpsStatus tone={row.opened ? "success" : "warning"}>{row.opened ? "已开通" : "未开通"}</OpsStatus>}</td>
|
|
|
|
|
+ <td className="settlement-ledger-number">{amount == null ? <span className="table-placeholder">—</span> : <span className="ops-money">{moneyFromCents(amount)}</span>}
|
|
|
|
|
+ <small>{row.service_months == null ? <span className="table-placeholder">—</span> : `服务期 ${row.service_months} 个月`}</small></td>
|
|
|
|
|
+ <td className="settlement-ledger-action"><Link className="ops-table-action" to={`${prefix}/contract/${encodeURIComponent(row.contract_id)}`} state={linkState}>详情<ArrowRight size={14} aria-hidden="true" /></Link></td>
|
|
|
|
|
+ </tr>;
|
|
|
|
|
+ })}
|
|
|
|
|
+ </PartyLedger>
|
|
|
|
|
+ </section>;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/* ── V-D1 详情宿主层(返回链路固定文案+显式路由,⛔ history.back()) ────────── */
|
|
/* ── V-D1 详情宿主层(返回链路固定文案+显式路由,⛔ history.back()) ────────── */
|