|
|
@@ -299,35 +299,8 @@ function LogPanel({ logs }: { logs: TicketDetail["process_logs"] }) {
|
|
|
</ol>;
|
|
|
}
|
|
|
|
|
|
-/**
|
|
|
- * 交付事实里的一段折叠(原型 v3 `details.seg`)。
|
|
|
- *
|
|
|
- * 摘要行给关键数字(结论/日期/条数),折叠也不丢信息;只有与本单当前状态相关的
|
|
|
- * 那一段默认展开,其余收起来,避免六张明细表把正文拉成几屏长。
|
|
|
- */
|
|
|
-function FactSeg({ title, summary, badge, tone, open, children }: {
|
|
|
- title: string; summary: string; badge: string; tone?: "ok" | "warn"; open: boolean; children: ReactNode;
|
|
|
-}) {
|
|
|
- /**
|
|
|
- * 展开态由本组件持有:`open` 只作为初值/本单状态变化后的落点。
|
|
|
- * ⛔ 直接把 `open` 绑到 `details`:页面因提示条、刷新等重渲染时会把用户手动展开的段收回,
|
|
|
- * 一次折叠就白点了。
|
|
|
- */
|
|
|
- const [expanded, setExpanded] = useState(open);
|
|
|
- useEffect(() => { setExpanded(open); }, [open]);
|
|
|
- return <details className="work-order-seg" open={expanded} onToggle={(e) => setExpanded(e.currentTarget.open)}>
|
|
|
- <summary>
|
|
|
- <span className="work-order-seg-title">{title}</span>
|
|
|
- <span className="work-order-seg-summary">{summary}</span>
|
|
|
- <span className="work-order-seg-badge"><OpsStatus tone={tone === "ok" ? "success" : tone === "warn" ? "warning" : "neutral"}>{badge}</OpsStatus></span>
|
|
|
- <ChevronDown className="work-order-seg-chev" size={16} />
|
|
|
- </summary>
|
|
|
- <div className="work-order-seg-body">{children}</div>
|
|
|
- </details>;
|
|
|
-}
|
|
|
-
|
|
|
-function recordValue(value: string | number | null | undefined, empty = "—") {
|
|
|
- return value == null || value === "" || value === "-" ? <span className="table-placeholder">{empty}</span> : value;
|
|
|
+function recordValue(value: string | number | null | undefined) {
|
|
|
+ return value == null || value === "" || value === "-" ? <span className="table-placeholder">—</span> : value;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -336,12 +309,11 @@ function recordValue(value: string | number | null | undefined, empty = "—") {
|
|
|
* 下载按 `material_id` 现签(`detail@v1` 刻意不下发对象键);`readonly` 只关下载按钮,
|
|
|
* 不影响清单本身——工单进终态后材料仍需可查。
|
|
|
*/
|
|
|
-function MaterialList({ ticketId, items, empty, allowDownload = true }: {
|
|
|
- ticketId: string; items: TicketMaterial[]; empty: string; allowDownload?: boolean;
|
|
|
+function MaterialList({ ticketId, items, label, allowDownload }: {
|
|
|
+ ticketId: string; items: TicketMaterial[]; label: string; allowDownload: boolean;
|
|
|
}) {
|
|
|
const [busy, setBusy] = useState<string | null>(null);
|
|
|
const [tip, setTip] = useState("");
|
|
|
- if (!items.length) return <p className="work-order-seg-foot">{empty}</p>;
|
|
|
const download = async (m: TicketMaterial) => {
|
|
|
setTip(""); setBusy(m.material_id);
|
|
|
try {
|
|
|
@@ -354,7 +326,7 @@ function MaterialList({ ticketId, items, empty, allowDownload = true }: {
|
|
|
}
|
|
|
};
|
|
|
return <>
|
|
|
- <div className="work-order-table-wrap compact" role="region" aria-label="工单材料清单" tabIndex={0}><table>
|
|
|
+ <div className="work-order-table-wrap compact" role="region" aria-label={label} tabIndex={0}><table>
|
|
|
<thead><tr><th>文件名</th><th>类型</th><th>大小</th><th>登记人</th><th>登记时间</th>{allowDownload && <th><span className="sr-only">操作</span></th>}</tr></thead>
|
|
|
<tbody>{items.map((m) => <tr key={m.material_id}>
|
|
|
<td className="table-wrap-text"><span className="table-cell-title">{m.file_name ?? m.material_id}</span></td>
|
|
|
@@ -1072,12 +1044,25 @@ const ActionSheet = TicketActionSheet;
|
|
|
const WORK_ORDER_RECORD_TABS = [
|
|
|
{ id: "overview", label: "工单概况" },
|
|
|
{ id: "guide", label: "施工指导" },
|
|
|
- { id: "delivery", label: "交付与回执" },
|
|
|
+ { id: "backfill", label: "施工回填" },
|
|
|
+ { id: "checklist", label: "交付清单" },
|
|
|
+ { id: "receipt", label: "竣工回执" },
|
|
|
+ { id: "materials", label: "工单材料" },
|
|
|
+ { id: "messages", label: "运营商报文" },
|
|
|
{ id: "references", label: "关联资料" },
|
|
|
] as const;
|
|
|
|
|
|
type WorkOrderRecordTab = (typeof WORK_ORDER_RECORD_TABS)[number]["id"];
|
|
|
|
|
|
+function WorkOrderPanel({ tab, active, className = "", children }: {
|
|
|
+ tab: WorkOrderRecordTab; active: WorkOrderRecordTab; className?: string; children: ReactNode;
|
|
|
+}) {
|
|
|
+ return <section className={`record-tab-panel work-order-record-panel ${className}`} id={`work-order-panel-${tab}`}
|
|
|
+ role="tabpanel" aria-labelledby={`work-order-tab-${tab}`} hidden={active !== tab} tabIndex={0}>
|
|
|
+ {children}
|
|
|
+ </section>;
|
|
|
+}
|
|
|
+
|
|
|
/** 工单详情(`/ticket/detail@v1`)。 */
|
|
|
export function WorkOrderRecordPage() {
|
|
|
const { id } = useParams();
|
|
|
@@ -1176,10 +1161,6 @@ export function WorkOrderRecordPage() {
|
|
|
|
|
|
const t = d.ticket;
|
|
|
const can = d.actions;
|
|
|
- const tabs = WORK_ORDER_RECORD_TABS.filter(({ id: tab }) => tab !== "guide" || d.construction_guide);
|
|
|
- const activeTab = selectedTab?.ticketId === id && tabs.some(({ id: tab }) => tab === selectedTab.tab)
|
|
|
- ? selectedTab.tab
|
|
|
- : "overview";
|
|
|
/**
|
|
|
* 流转阶段条:阶段派生收在 `lib/work-order-steps.ts`(纯函数,有测试兜)。
|
|
|
* 这里只负责把状态与类型喂进去,⛔ 在 JSX 里再手写一遍「哪段正在发生」。
|
|
|
@@ -1231,7 +1212,7 @@ export function WorkOrderRecordPage() {
|
|
|
const canClientConfirmClose = Boolean(customerGate?.confirmClose);
|
|
|
const hasCustomerActions = canClientWithdraw || canClientConfirmClose;
|
|
|
const hasActions = primaryActions.length + opsActions.length > 0 || hasCustomerActions;
|
|
|
- const showCompletion = d.completion || can.generate_completion || can.confirm_receipt;
|
|
|
+ const showCompletion = Boolean(d.completion || can.generate_completion || can.confirm_receipt);
|
|
|
/**
|
|
|
* 终态(与后端 `domain::TERMINAL` 同口径:`settled`/`terminated`)⇒ 材料登记口**收起**。
|
|
|
* 依据:工单§4.2 不可逆点②(已办结只读,点名禁止「补一张材料」)+ §14 页约「终态 ⇒ 60401 收起入口」。
|
|
|
@@ -1255,12 +1236,10 @@ export function WorkOrderRecordPage() {
|
|
|
* 因此这些类型只展示交付条目(数量、规格),⛔ 不渲染核对结果/核对时间两列,段头也不给告警色。
|
|
|
*/
|
|
|
const checklistNote = t.ticket_type === "updown"
|
|
|
- ? "变更协议单把「新档交付+原档回收」收在一张单里:完成条件包含清单核对(清单须无未核对条目)+执行结论与凭证,故此处计数应与工单终态一致。"
|
|
|
+ ? "交付新档、回收原档后,核对条目并在施工回填中登记结论与凭证。"
|
|
|
: checklistGated
|
|
|
- ? "服务开通单的完成条件包含清单核对:清单须非空且无未核对条目、实际开通日不晚于当天、处理记录非空,故此处计数应与工单终态一致。"
|
|
|
- : t.ticket_type === "open"
|
|
|
- ? "开户单的闭环必填组是回填组(线路/境外 IP/结论与凭证),不含清单核对:本段只列订阅带出的交付条目作参照,不设核对状态、也不阻断本单完成与闭环;核对由后续服务开通单或回访动作补齐。"
|
|
|
- : "本类型工单的闭环必填组不含清单核对:本段只列交付条目作参照,不设核对状态,也不阻断完成/闭环。";
|
|
|
+ ? "完成前需核对清单,填写实际开通日期和处理记录。"
|
|
|
+ : "此清单供交付查阅。";
|
|
|
/** 参考卡的弹窗入参(在 JSX 回调里仍要能拿到主键,先固化一次,⛔ 靠闭包里的可选链猜)。 */
|
|
|
const refCustomer = d.customer;
|
|
|
const refOrder = d.order;
|
|
|
@@ -1375,31 +1354,39 @@ export function WorkOrderRecordPage() {
|
|
|
if (!todoNodes.length && t.status === "settled") todoNodes.push(
|
|
|
<div className="work-order-done-strip" key="settled">本单已办结 · 全程 {d.process_logs.length} 条留痕、{d.materials.length} 份材料 · 只读可追溯</div>);
|
|
|
|
|
|
- /**
|
|
|
- * 「交付事实」默认展开的那一段=与本单当前状态最相关的一段(原型 v3:其余收起)。
|
|
|
- * 展开哪段只用已判定过的 `can.*`/驳回态,⛔ 前端再推一遍状态机。
|
|
|
- */
|
|
|
- const openSeg: string = lastReject || can.generate_completion || can.confirm_receipt ? "completion"
|
|
|
- : can.backfill ? "backfill"
|
|
|
- : can.check_done ? "checklist" : "";
|
|
|
- /**
|
|
|
- * 材料按 `kind` 归位(2026-11-17 原型 v3):五类材料各有唯一产出方,页面上就各自回到那一段。
|
|
|
- * ⛔ 再单开一张「过程材料」平表——那样用户看不出某一份材料属于哪一步。
|
|
|
- */
|
|
|
- const byKind = (kind: string) => d.materials.filter((m) => m.kind === kind);
|
|
|
- const submitMaterials = byKind("submit_evidence");
|
|
|
- /** 回填段:回填时自动归档的凭证 + 现场补传的过程材料(后者是这一段唯一的写入口)。 */
|
|
|
- const backfillMaterials = [...byKind("backfill_evidence"), ...byKind(MANUAL_MATERIAL_KIND)];
|
|
|
- const completionMaterials = byKind("completion_pdf");
|
|
|
- /** 非主线单(故障/售后)没有回填段 ⇒ 过程材料单独成段,否则这些单上看不到任何材料。 */
|
|
|
- const hasBackfillSeg = Boolean(d.backfill?.backfill_id || can.backfill || d.backfill?.ext);
|
|
|
+ const materialGroups = [
|
|
|
+ { kind: "submit_evidence", label: "客户提交材料" },
|
|
|
+ { kind: "backfill_evidence", label: "施工回填凭证" },
|
|
|
+ { kind: MANUAL_MATERIAL_KIND, label: "过程材料" },
|
|
|
+ { kind: "completion_pdf", label: "竣工文件" },
|
|
|
+ ].map((group) => ({ ...group, items: d.materials.filter((item) => item.kind === group.kind) }));
|
|
|
+ const materialCount = materialGroups.reduce((total, group) => total + group.items.length, 0);
|
|
|
+ const canAddMaterials = !clientView && !materialLocked;
|
|
|
/** 客户视角不放置下载入口:后端 `material_grant` 对客户身份只放行 `submit_evidence`。 */
|
|
|
const canDownloadMaterial = !clientView;
|
|
|
+ const accountRows = d.open_stop?.accounts ?? [];
|
|
|
+ const showBackfill = Boolean(d.backfill?.backfill_id || can.backfill || can.check_and_backfill || d.backfill?.ext);
|
|
|
+ const showChecklist = d.service_items.length > 0 || accountRows.length > 0;
|
|
|
+ const tabVisible = {
|
|
|
+ overview: true,
|
|
|
+ guide: Boolean(d.construction_guide),
|
|
|
+ backfill: showBackfill,
|
|
|
+ checklist: showChecklist,
|
|
|
+ receipt: showCompletion,
|
|
|
+ materials: materialCount > 0 || canAddMaterials,
|
|
|
+ messages: d.messages.length > 0,
|
|
|
+ references: true,
|
|
|
+ } satisfies Record<WorkOrderRecordTab, boolean>;
|
|
|
+ const tabs = WORK_ORDER_RECORD_TABS.filter(({ id: tab }) => tabVisible[tab]).map((tab) => ({
|
|
|
+ ...tab,
|
|
|
+ count: tab.id === "materials" ? materialCount || undefined : tab.id === "messages" ? d.messages.length : undefined,
|
|
|
+ }));
|
|
|
+ const activeTab = selectedTab?.ticketId === id && tabVisible[selectedTab.tab] ? selectedTab.tab : "overview";
|
|
|
const receiptState = d.completion
|
|
|
- ? d.completion.receipt_at && d.completion.receipt_valid !== "0" ? { text: "回执已确认", tone: "ok" as const }
|
|
|
- : d.completion.receipt_at ? { text: "回执已失效", tone: "warn" as const }
|
|
|
- : { text: "已回传待回执", tone: "warn" as const }
|
|
|
- : { text: "未生成", tone: "warn" as const };
|
|
|
+ ? d.completion.receipt_at && d.completion.receipt_valid !== "0" ? { text: "回执已确认", tone: "success" as const }
|
|
|
+ : d.completion.receipt_at ? { text: "回执已失效", tone: "warning" as const }
|
|
|
+ : { text: "已回传待回执", tone: "warning" as const }
|
|
|
+ : { text: "未生成", tone: "neutral" as const };
|
|
|
const copyLink = async () => {
|
|
|
try { await navigator.clipboard.writeText(window.location.href); setNotice("本单链接已复制。"); }
|
|
|
catch { setNotice("复制失败:浏览器拒绝了剪贴板访问。"); }
|
|
|
@@ -1460,49 +1447,50 @@ export function WorkOrderRecordPage() {
|
|
|
</header>
|
|
|
{todoNodes.length > 0 && <div className="work-order-todo">{todoNodes}</div>}
|
|
|
<div className="work-order-layout"><div className="record-tabs-frame work-order-tabs-frame">
|
|
|
- <RecordTabs prefix="work-order" label="工单详情视图" tabs={tabs} active={activeTab}
|
|
|
+ <RecordTabs prefix="work-order" className="work-order-record-tabs" label="工单详情视图" tabs={tabs} active={activeTab}
|
|
|
onChange={(tab) => setSelectedTab({ ticketId: id, tab })} />
|
|
|
- <section className="record-tab-panel work-order-record-panel work-order-overview-panel" id="work-order-panel-overview"
|
|
|
- role="tabpanel" aria-labelledby="work-order-tab-overview" hidden={activeTab !== "overview"} tabIndex={0}>
|
|
|
- <p className="work-order-ticket-lead" data-empty={!t.detail || undefined}>{t.detail || "建单时未填写详细描述。"}</p>
|
|
|
- <div className="work-order-summary-grid">
|
|
|
- <div><span>建单来源</span><strong>{t.submitter_type === "customer" ? "客户侧提交" : t.submitter_type === "reporter" ? "报障人提交" : "运营侧代报"}</strong></div>
|
|
|
- <div><span>外部单号</span><strong>{recordValue(t.carrier_order_no, "无")}</strong></div>
|
|
|
- <div><span>关联订阅</span><strong>{t.subscription_id ? <button type="button" className="work-order-trace-link" onClick={() => openRef({ kind: "order", id: t.subscription_id!, name: refOrder?.plan_name })}>{t.subscription_id}</button> : recordValue(null, "无")}{refOrder?.plan_name ? ` · ${refOrder.plan_name}` : ""}</strong></div>
|
|
|
- {t.deferred_until && <div><span>延期至</span><strong>{fmtDate(t.deferred_until)}</strong></div>}
|
|
|
- {t.confirm_deadline && <div><span>闭环确认期限</span><strong>{fmtDate(t.confirm_deadline)}</strong></div>}
|
|
|
- </div>
|
|
|
- {/* 客户建单时上传的图片/语音随建单同事务登记(`submit_evidence`),就放在建单来源这一屏。 */}
|
|
|
- {submitMaterials.length > 0 && <div className="work-order-submit-materials">
|
|
|
- <h4 className="work-order-subhead">客户提交材料</h4>
|
|
|
- <MaterialList ticketId={t.ticket_id} items={submitMaterials} empty="无" allowDownload={canDownloadMaterial} />
|
|
|
- </div>}
|
|
|
- </section>
|
|
|
+ <WorkOrderPanel tab="overview" active={activeTab} className="work-order-overview-panel">
|
|
|
+ <section className="work-order-description">
|
|
|
+ <h2 className="work-order-panel-title">工单描述</h2>
|
|
|
+ <p className="work-order-ticket-lead" data-empty={!t.detail || undefined}>{t.detail || "建单时未填写详细描述。"}</p>
|
|
|
+ </section>
|
|
|
+ <section className="work-order-overview-context">
|
|
|
+ <h2 className="work-order-panel-title">建单与关联</h2>
|
|
|
+ <div className="work-order-trace"><span>建单来源</span><strong>{t.submitter_type === "customer" ? "客户侧提交" : t.submitter_type === "reporter" ? "报障人提交" : "运营侧代报"}</strong></div>
|
|
|
+ <div className="work-order-trace"><span>外部单号</span><strong>{recordValue(t.carrier_order_no)}</strong></div>
|
|
|
+ <div className="work-order-trace"><span>关联订阅</span><strong>{t.subscription_id ? <button type="button" className="work-order-trace-link" onClick={() => openRef({ kind: "order", id: t.subscription_id!, name: refOrder?.plan_name })}>{t.subscription_id}</button> : recordValue(null)}</strong>{refOrder?.plan_name && <small>{refOrder.plan_name}</small>}</div>
|
|
|
+ {t.deferred_until && <div className="work-order-trace"><span>延期至</span><strong>{fmtDate(t.deferred_until)}</strong></div>}
|
|
|
+ {t.confirm_deadline && <div className="work-order-trace"><span>闭环确认期限</span><strong>{fmtDate(t.confirm_deadline)}</strong></div>}
|
|
|
+ </section>
|
|
|
+ </WorkOrderPanel>
|
|
|
|
|
|
{d.construction_guide && (
|
|
|
- <section className="record-tab-panel work-order-record-panel" id="work-order-panel-guide"
|
|
|
- role="tabpanel" aria-labelledby="work-order-tab-guide" hidden={activeTab !== "guide"} tabIndex={0}>
|
|
|
+ <WorkOrderPanel tab="guide" active={activeTab}>
|
|
|
<ConstructionGuidePanel guide={d.construction_guide} />
|
|
|
- </section>
|
|
|
+ </WorkOrderPanel>
|
|
|
)}
|
|
|
|
|
|
- <section className="record-tab-panel work-order-record-panel work-order-facts" id="work-order-panel-delivery"
|
|
|
- role="tabpanel" aria-labelledby="work-order-tab-delivery" hidden={activeTab !== "delivery"} tabIndex={0}>
|
|
|
- {hasBackfillSeg && <FactSeg title="施工回填" open={openSeg === "backfill"}
|
|
|
- summary={d.backfill?.backfill_id ? `${CONCLUSION_NAMES[d.backfill.exec_conclusion ?? ""] ?? d.backfill.exec_conclusion ?? "—"} · 实际开通 ${d.backfill.actual_opened_date ? fmtDate(d.backfill.actual_opened_date) : "—"} · 线路 ${d.backfill.routes?.length ?? 0} 条 / 境外 IP ${d.backfill.ips?.length ?? 0} 条` : "尚未回填 · 缺 线路与路由、执行结论与凭证"}
|
|
|
- badge={d.backfill?.backfill_id ? "已回填" : "待回填"} tone={d.backfill?.backfill_id ? "ok" : "warn"}>
|
|
|
+ {showBackfill && <WorkOrderPanel tab="backfill" active={activeTab} className="work-order-panel-stack">
|
|
|
{d.backfill?.backfill_id ? <>
|
|
|
- <div className="work-order-summary-grid">
|
|
|
- <div><span>执行结论</span><strong>{recordValue(CONCLUSION_NAMES[d.backfill.exec_conclusion ?? ""] ?? d.backfill.exec_conclusion)}</strong></div>
|
|
|
- <div><span>实际开通日期</span><strong>{recordValue(fmtDate(d.backfill.actual_opened_date))}</strong></div>
|
|
|
- <div><span>停机完成日期</span><strong>{recordValue(fmtDate(d.backfill.stop_done_date))}</strong></div>
|
|
|
- <div><span>回填次数</span><strong>{recordValue(numText(d.backfill.attempt_count, " 次"))}</strong></div>
|
|
|
- <div className="wide"><span>结论说明</span><strong>{recordValue(d.backfill.conclusion_note)}</strong></div>
|
|
|
- <div className="wide"><span>凭证与佐证</span><strong>{recordValue(d.backfill.evidence_text)}</strong></div>
|
|
|
- </div>
|
|
|
+ <section className="work-order-outcome">
|
|
|
+ <header className="work-order-content-heading">
|
|
|
+ <h2 className="work-order-panel-title">执行结论</h2>
|
|
|
+ <OpsStatus tone="success">已回填</OpsStatus>
|
|
|
+ </header>
|
|
|
+ <p className="work-order-outcome-value">{recordValue(CONCLUSION_NAMES[d.backfill.exec_conclusion ?? ""] ?? d.backfill.exec_conclusion)}</p>
|
|
|
+ <div className="work-order-summary-grid">
|
|
|
+ <div><span>实际开通日期</span><strong>{recordValue(fmtDate(d.backfill.actual_opened_date))}</strong></div>
|
|
|
+ <div><span>停机完成日期</span><strong>{recordValue(fmtDate(d.backfill.stop_done_date))}</strong></div>
|
|
|
+ <div><span>回填次数</span><strong>{recordValue(numText(d.backfill.attempt_count, " 次"))}</strong></div>
|
|
|
+ </div>
|
|
|
+ {(d.backfill.conclusion_note || d.backfill.evidence_text) && <dl className="work-order-narrative-fields">
|
|
|
+ {d.backfill.conclusion_note && <div><dt>结论说明</dt><dd>{d.backfill.conclusion_note}</dd></div>}
|
|
|
+ {d.backfill.evidence_text && <div><dt>凭证与佐证</dt><dd>{d.backfill.evidence_text}</dd></div>}
|
|
|
+ </dl>}
|
|
|
+ </section>
|
|
|
<TicketExtForm ext={d.backfill.ext} readOnly />
|
|
|
- {(d.backfill.routes?.length ?? 0) > 0 && <>
|
|
|
- <h4 className="work-order-subhead">网络线路</h4>
|
|
|
+ {(d.backfill.routes?.length ?? 0) > 0 && <section className="work-order-content-group">
|
|
|
+ <h2 className="work-order-panel-title">网络线路</h2>
|
|
|
<div className="work-order-table-wrap compact" role="region" aria-label="网络线路清单" tabIndex={0}><table>
|
|
|
<thead><tr><th>网络账户名</th><th>内网 IP / 掩码</th><th>端点(源 → 目的)</th><th>出口 PoP</th><th>带宽</th></tr></thead>
|
|
|
<tbody>{d.backfill.routes.map((r) => <tr key={r.id}>
|
|
|
@@ -1513,9 +1501,9 @@ export function WorkOrderRecordPage() {
|
|
|
<td>{recordValue([r.down_mbps && `↓${r.down_mbps}`, r.up_mbps && `↑${r.up_mbps}`].filter(Boolean).join(" / "))}</td>
|
|
|
</tr>)}</tbody>
|
|
|
</table></div>
|
|
|
- </>}
|
|
|
- {(d.backfill.ips?.length ?? 0) > 0 && <>
|
|
|
- <h4 className="work-order-subhead">境外出口 IP</h4>
|
|
|
+ </section>}
|
|
|
+ {(d.backfill.ips?.length ?? 0) > 0 && <section className="work-order-content-group">
|
|
|
+ <h2 className="work-order-panel-title">境外出口 IP</h2>
|
|
|
<div className="work-order-table-wrap compact" role="region" aria-label="境外出口 IP 清单" tabIndex={0}><table>
|
|
|
<thead><tr><th>出口</th><th>IP</th><th>类型</th><th>带宽</th><th>凭据</th></tr></thead>
|
|
|
<tbody>{d.backfill.ips.map((r) => <tr key={r.id}>
|
|
|
@@ -1526,23 +1514,25 @@ export function WorkOrderRecordPage() {
|
|
|
<td>PIN {recordValue(isYes(r.pin_registered) ? "✓" : null)} / CPID {recordValue(isYes(r.cpid_registered) ? "✓" : null)}</td>
|
|
|
</tr>)}</tbody>
|
|
|
</table></div>
|
|
|
- </>}
|
|
|
- <p className="work-order-seg-foot">库内仅存 PIN/CPID 密文,此处只显示「是否登记」;IP 规则 v{d.backfill.ip_rule_version}。</p>
|
|
|
+ <p className="work-order-panel-note">PIN/CPID 仅显示登记状态。IP 规则 v{d.backfill.ip_rule_version}。</p>
|
|
|
+ </section>}
|
|
|
</> : <>
|
|
|
- <p className="work-order-seg-foot">登记执行结论、实际开通日期、线路与境外 IP;保存即推进工单。</p>
|
|
|
- <p className="work-order-seg-foot">建单人取当前登录身份,无需手填。</p>
|
|
|
+ <div className="work-order-empty-panel">
|
|
|
+ <h2 className="work-order-panel-title">尚未回填</h2>
|
|
|
+ <p>施工完成后,在此查看执行结论、开通日期和线路参数。</p>
|
|
|
+ </div>
|
|
|
+ <TicketExtForm ext={d.backfill?.ext} readOnly />
|
|
|
</>}
|
|
|
- {/* 材料跟着这一段走:回填时自动归档的凭证 + 现场补传的过程材料(后者是本段唯一的写入口)。 */}
|
|
|
- <h4 className="work-order-subhead">凭证与过程材料({backfillMaterials.length} 份)</h4>
|
|
|
- <MaterialList ticketId={t.ticket_id} items={backfillMaterials} empty="暂无材料:回填保存时凭证清单里的文档名会自动归档到这里。" allowDownload={canDownloadMaterial} />
|
|
|
- {!clientView && (materialLocked
|
|
|
- ? <p className="work-order-seg-foot"><Info size={15} />工单已{t.status === "terminated" ? "作废" : "办结"},材料只读:终态不再提供任何追加入口(服务端同样拒绝,KLT-G20401)。</p>
|
|
|
- : <div className="work-order-materials-actions"><Button variant="outline" size="sm" type="button" onClick={() => setMaterialOpen(true)}><FolderOpen size={15} />补充过程材料</Button></div>)}
|
|
|
- </FactSeg>}
|
|
|
- {d.service_items.length > 0 && <FactSeg title="服务清单" open={openSeg === "checklist"}
|
|
|
- summary={checklistGated ? `${checkedItems} / ${d.service_items.length} 已核对` : `${d.service_items.length} 条交付项 · 仅供交付参照`}
|
|
|
- badge={checklistGated ? (checklistAllDone ? "已核对" : "待核对") : `${d.service_items.length} 条`}
|
|
|
- tone={checklistGated ? (checklistAllDone ? "ok" : "warn") : undefined}>
|
|
|
+ </WorkOrderPanel>}
|
|
|
+
|
|
|
+ {showChecklist && <WorkOrderPanel tab="checklist" active={activeTab} className="work-order-panel-stack">
|
|
|
+ {d.service_items.length > 0 && <section className="work-order-content-group">
|
|
|
+ <header className="work-order-content-heading">
|
|
|
+ <h2 className="work-order-panel-title">服务清单</h2>
|
|
|
+ {checklistGated
|
|
|
+ ? <OpsStatus tone={checklistAllDone ? "success" : "warning"}>{checkedItems} / {d.service_items.length} 已核对</OpsStatus>
|
|
|
+ : <small>{d.service_items.length} 条交付项</small>}
|
|
|
+ </header>
|
|
|
{/* 变更协议单的「原值 → 新值」并成一列(原型 v3),⛔ 再单独渲染一张参数对照表。
|
|
|
核对两列只对门槛类型渲染:非门槛类型没有核对动作,`pending` 不是缺口。 */}
|
|
|
<div className="work-order-table-wrap compact" role="region" aria-label="服务清单" tabIndex={0}><table>
|
|
|
@@ -1558,14 +1548,16 @@ export function WorkOrderRecordPage() {
|
|
|
</>}
|
|
|
</tr>)}</tbody>
|
|
|
</table></div>
|
|
|
- <p className="work-order-seg-foot">{checklistNote}</p>
|
|
|
- </FactSeg>}
|
|
|
- {(d.open_stop?.accounts.length ?? 0) > 0 && <FactSeg title="账号清单" open={openSeg === "accounts"}
|
|
|
- summary={`${d.open_stop!.accounts.length} 个账号 · ${d.open_stop!.preview ? "待停预览" : d.open_stop!.exec_status === "pending" ? "待生效" : "已生效"}`}
|
|
|
- badge={d.open_stop!.preview ? "预览" : d.open_stop!.exec_status === "pending" ? "待生效" : "已生效"} tone={d.open_stop!.preview || d.open_stop!.exec_status === "pending" ? "warn" : "ok"}>
|
|
|
+ <p className="work-order-panel-note">{checklistNote}</p>
|
|
|
+ </section>}
|
|
|
+ {d.open_stop && accountRows.length > 0 && <section className="work-order-content-group">
|
|
|
+ <header className="work-order-content-heading">
|
|
|
+ <h2 className="work-order-panel-title">账号清单 <small>{accountRows.length} 个</small></h2>
|
|
|
+ <OpsStatus tone={d.open_stop.preview || d.open_stop.exec_status === "pending" ? "warning" : "success"}>{d.open_stop.preview ? "待停预览" : d.open_stop.exec_status === "pending" ? "待生效" : "已生效"}</OpsStatus>
|
|
|
+ </header>
|
|
|
<div className="work-order-table-wrap compact" role="region" aria-label="账号清单" tabIndex={0}><table>
|
|
|
<thead><tr><th>显示名</th><th>网络账户名</th><th>停机前 → 生效后</th><th>生效日</th><th>来源</th></tr></thead>
|
|
|
- <tbody>{d.open_stop!.accounts.map((a) => <tr key={a.id ?? a.sub_account_id ?? `${a.display_name}-${a.net_account}`}>
|
|
|
+ <tbody>{accountRows.map((a) => <tr key={a.id ?? a.sub_account_id ?? `${a.display_name}-${a.net_account}`}>
|
|
|
<td><span className="table-cell-title">{recordValue(a.display_name)}</span></td>
|
|
|
<td>{recordValue(a.net_account)}</td>
|
|
|
<td>{recordValue(label(ACCT_STATUS, a.before_status))} → {recordValue(label(ACCT_STATUS, a.after_status) || (a.source === "preview" ? "待停" : null))}</td>
|
|
|
@@ -1573,28 +1565,39 @@ export function WorkOrderRecordPage() {
|
|
|
<td>{recordValue(a.source)}</td>
|
|
|
</tr>)}</tbody>
|
|
|
</table></div>
|
|
|
- {d.open_stop && <p className="work-order-seg-foot">{d.open_stop.preview ? `待停账号预览 ${numText(d.open_stop.effective_account_count)} 个(回填前供现场核对)。` : <>开停记录:{d.open_stop.action ? (OPEN_STOP_ACTION_NAMES[d.open_stop.action] ?? d.open_stop.action) : "-"} / {d.open_stop.exec_status ? (EXEC_STATUS_NAMES[d.open_stop.exec_status] ?? d.open_stop.exec_status) : "-"} / 生效账号 {numText(d.open_stop.effective_account_count)} 个{d.open_stop.exec_status === "pending" ? "(待生效)" : ""}{isYes(d.open_stop.closed_flag) ? " · 已随工单关闭" : ""}。</>}</p>}
|
|
|
- </FactSeg>}
|
|
|
- {showCompletion && <FactSeg title="竣工与回执" open={openSeg === "completion"}
|
|
|
- summary={d.completion ? `${d.completion.completion_no ?? "—"} · ${receiptState.text}` : "未生成 · 缺口齐备后可生成"}
|
|
|
- badge={receiptState.text} tone={receiptState.tone}>
|
|
|
- {d.completion ? <div className="work-order-summary-grid">
|
|
|
- <div><span>竣工单号</span><strong>{recordValue(d.completion.completion_no)}</strong></div>
|
|
|
- <div><span>动作</span><strong>{recordValue(OPEN_STOP_ACTION_NAMES[d.completion.action ?? ""] ?? d.completion.action)}</strong></div>
|
|
|
- <div><span>执行结论</span><strong>{recordValue(CONCLUSION_NAMES[d.completion.exec_conclusion ?? ""] ?? d.completion.exec_conclusion)}</strong></div>
|
|
|
- <div><span>回传方式</span><strong>{d.completion.mode === "auto" ? "自动" : "手工"}</strong></div>
|
|
|
- <div><span>回传时间</span><strong>{recordValue(fmtTime(d.completion.pushed_at))}</strong></div>
|
|
|
- <div><span>回执时间</span><strong>{recordValue(fmtTime(d.completion.receipt_at))}</strong></div>
|
|
|
- <div className="wide"><span>回执说明</span><strong>{recordValue(d.completion.receipt_remark)}</strong></div>
|
|
|
- </div> : <p className="work-order-seg-foot">{d.gaps.length ? `缺口未清,竣工暂不可生成:${d.gaps.map(groupLabel).join(" / ")}` : conclusionBlocksCompletion(d.backfill?.exec_conclusion) ? "回填结论为失败,须重新回填成功/部分成功后才可生成竣工并回传。" : "缺口已齐,可生成竣工并回传。"}</p>}
|
|
|
- {/* 等待回执:出口是回执确认;权限不足时说明谁可执行——⛔ 给一个点了会被服务端拒的按钮。 */}
|
|
|
- {d.completion && !d.completion.receipt_at && t.status !== "rejected" && (viewerReadOnly || !can.confirm_receipt
|
|
|
- ? <p className="work-order-seg-foot"><ShieldAlert size={15} />回执确认仅总运营与该团队主账号可执行。</p>
|
|
|
- : <div className="work-order-seg-actions"><Button onClick={() => void quick("confirm_receipt")}><Check size={15} />回执确认闭环</Button></div>)}
|
|
|
+ <p className="work-order-panel-note">{d.open_stop.preview ? "预览名单供回填前核对。" : <>开停记录:{d.open_stop.action ? (OPEN_STOP_ACTION_NAMES[d.open_stop.action] ?? d.open_stop.action) : "-"} / {d.open_stop.exec_status ? (EXEC_STATUS_NAMES[d.open_stop.exec_status] ?? d.open_stop.exec_status) : "-"} / 生效账号 {numText(d.open_stop.effective_account_count)} 个{d.open_stop.exec_status === "pending" ? "(待生效)" : ""}{isYes(d.open_stop.closed_flag) ? " · 已随工单关闭" : ""}。</>}</p>
|
|
|
+ </section>}
|
|
|
+ </WorkOrderPanel>}
|
|
|
+ {showCompletion && <WorkOrderPanel tab="receipt" active={activeTab} className="work-order-panel-stack">
|
|
|
+ <section className="work-order-outcome">
|
|
|
+ <header className="work-order-content-heading">
|
|
|
+ <h2 className="work-order-panel-title">竣工单</h2>
|
|
|
+ <OpsStatus tone={receiptState.tone}>{receiptState.text}</OpsStatus>
|
|
|
+ </header>
|
|
|
+ {d.completion ? <>
|
|
|
+ <p className="work-order-outcome-value work-order-document-number">{recordValue(d.completion.completion_no)}</p>
|
|
|
+ <div className="work-order-summary-grid">
|
|
|
+ <div><span>回传时间</span><strong>{recordValue(fmtTime(d.completion.pushed_at))}</strong></div>
|
|
|
+ <div><span>回执时间</span><strong>{recordValue(fmtTime(d.completion.receipt_at))}</strong></div>
|
|
|
+ <div><span>回传方式</span><strong>{d.completion.mode === "auto" ? "自动" : "手工"}</strong></div>
|
|
|
+ <div><span>动作</span><strong>{recordValue(OPEN_STOP_ACTION_NAMES[d.completion.action ?? ""] ?? d.completion.action)}</strong></div>
|
|
|
+ <div><span>执行结论</span><strong>{recordValue(CONCLUSION_NAMES[d.completion.exec_conclusion ?? ""] ?? d.completion.exec_conclusion)}</strong></div>
|
|
|
+ </div>
|
|
|
+ {d.completion.receipt_remark && <dl className="work-order-narrative-fields">
|
|
|
+ <div><dt>回执说明</dt><dd>{d.completion.receipt_remark}</dd></div>
|
|
|
+ </dl>}
|
|
|
+ {!d.completion.receipt_at && t.status !== "rejected" && (viewerReadOnly || !can.confirm_receipt
|
|
|
+ ? <p className="work-order-panel-note">回执由总运营或承接团队主账号确认。</p>
|
|
|
+ : <div><Button onClick={() => void quick("confirm_receipt")}><Check size={15} />确认回执</Button></div>)}
|
|
|
+ </> : <p className="work-order-panel-note">{d.gaps.length ? `待补齐:${d.gaps.map(groupLabel).join(" / ")}` : conclusionBlocksCompletion(d.backfill?.exec_conclusion) ? "请先重新回填成功或部分成功的执行结论。" : "已具备生成并回传竣工单的条件。"}</p>}
|
|
|
+ </section>
|
|
|
{/* 驳回历史(工单§5.5.3):⚠️ 只读运维视角——客户门户对驳回原因⛔ 展示(门户口径=
|
|
|
"待补充资料后重新提交"),且出参本身就没有 `external_reject_no` 这一列。 */}
|
|
|
- {!clientView && !!d.completion_rejects?.length && <>
|
|
|
- <h4 className="work-order-subhead">驳回历史({d.completion_rejects.length} 次{d.reject_pending ? " · 外部等待中" : ""})</h4>
|
|
|
+ {!clientView && !!d.completion_rejects?.length && <section className="work-order-content-group">
|
|
|
+ <header className="work-order-content-heading">
|
|
|
+ <h2 className="work-order-panel-title">驳回历史 <small>{d.completion_rejects.length} 次</small></h2>
|
|
|
+ {d.reject_pending && <OpsStatus tone="warning">外部等待中</OpsStatus>}
|
|
|
+ </header>
|
|
|
<div className="work-order-table-wrap compact" role="region" aria-label="驳回历史" tabIndex={0}><table>
|
|
|
<thead><tr><th>次数</th><th>件号</th><th>理由</th><th>时间</th></tr></thead>
|
|
|
<tbody>{d.completion_rejects.map((r) => <tr key={r.reject_seq}>
|
|
|
@@ -1604,16 +1607,27 @@ export function WorkOrderRecordPage() {
|
|
|
<td>{recordValue(fmtTime(r.rejected_at))}{r.channel ? ` · ${r.channel === "human" ? "人工登记" : r.channel}` : ""}{r.pushed_at && <small>回传于 {fmtDate(r.pushed_at)}</small>}</td>
|
|
|
</tr>)}</tbody>
|
|
|
</table></div>
|
|
|
- <p className="work-order-seg-foot">驳回期间期限日不重置,超期判定扣掉这段外部等待;出口=同号覆盖重推(驳回态即可执行)或退回重办(总运营/本团队主账号)后再改回填。</p>
|
|
|
- </>}
|
|
|
- <p className="work-order-seg-foot">回执确认后完成日改写为当天;开停记录的执行日不变。</p>
|
|
|
- {/* 竣工件=生成竣工时同事务归档的 PDF;终态后仍可下载(需求 §7.8 竣工材料事后仍可导出)。 */}
|
|
|
- <h4 className="work-order-subhead">竣工材料({completionMaterials.length} 份)</h4>
|
|
|
- <MaterialList ticketId={t.ticket_id} items={completionMaterials} empty="生成竣工单时自动归档,无需手工上传。" allowDownload={canDownloadMaterial} />
|
|
|
- </FactSeg>}
|
|
|
+ <p className="work-order-panel-note">驳回期间保留原期限日,超期计算扣除外部等待时间。</p>
|
|
|
+ </section>}
|
|
|
+ </WorkOrderPanel>}
|
|
|
|
|
|
- {d.messages.length > 0 && <FactSeg title="关联报文" open={openSeg === "messages"}
|
|
|
- summary={`${d.messages.length} 条 · 运营商报文与处置状态`} badge={`${d.messages.length} 条`}>
|
|
|
+ {tabVisible.materials && <WorkOrderPanel tab="materials" active={activeTab} className="work-order-panel-stack">
|
|
|
+ {materialGroups.map((group) => {
|
|
|
+ const showUpload = group.kind === MANUAL_MATERIAL_KIND && canAddMaterials;
|
|
|
+ if (!group.items.length && !showUpload) return null;
|
|
|
+ return <section key={group.kind} className="work-order-content-group">
|
|
|
+ <header className="work-order-content-heading">
|
|
|
+ <h2 className="work-order-panel-title">{group.label}{group.items.length > 0 && <small>{group.items.length} 份</small>}</h2>
|
|
|
+ {showUpload && <Button variant="outline" size="sm" type="button" onClick={() => setMaterialOpen(true)}><FolderOpen size={15} />补充过程材料</Button>}
|
|
|
+ </header>
|
|
|
+ {group.items.length > 0
|
|
|
+ ? <MaterialList ticketId={t.ticket_id} items={group.items} label={group.label} allowDownload={canDownloadMaterial} />
|
|
|
+ : <p className="work-order-empty-panel">暂无过程材料,可上传现场照片或处理截图。</p>}
|
|
|
+ </section>;
|
|
|
+ })}
|
|
|
+ </WorkOrderPanel>}
|
|
|
+
|
|
|
+ {tabVisible.messages && <WorkOrderPanel tab="messages" active={activeTab}>
|
|
|
<div className="work-order-table-wrap compact" role="region" aria-label="关联报文列表" tabIndex={0}><table>
|
|
|
<thead><tr><th>外部单号</th><th>动作</th><th>状态</th><th>接收时间</th><th>生效时间</th><th>说明</th><th><span className="sr-only">操作</span></th></tr></thead>
|
|
|
<tbody>{d.messages.map((m) => <tr key={m.message_id}>
|
|
|
@@ -1626,23 +1640,11 @@ export function WorkOrderRecordPage() {
|
|
|
<td>{m.status === "conflict" && !clientView && <Button variant="ghost" size="sm" onClick={() => void (async () => { const ok = await submit.run(() => messageConfirmConflict({ message_id: m.message_id, disposition: "as_is" })); if (ok) { setNotice("冲突已按现状归档。"); detail.reload(); } })()}>按现状归档</Button>}</td>
|
|
|
</tr>)}</tbody>
|
|
|
</table></div>
|
|
|
- </FactSeg>}
|
|
|
- {/* 非主线单(故障/售后)没有施工回填段 ⇒ 过程材料单独成段:这些单上它就是主证据,不是某段的补充。
|
|
|
- ⚠️ 空清单不给 warn 色调:照片明确定义为「不是完成门槛」(需求 §7.5),不能读成缺项。 */}
|
|
|
- {!hasBackfillSeg && <FactSeg title="过程材料" open={openSeg === "materials"}
|
|
|
- summary={backfillMaterials.length ? `${backfillMaterials.length} 份 · 现场照片与佐证` : "暂无材料 · 可补充现场照片"}
|
|
|
- badge={backfillMaterials.length ? `${backfillMaterials.length} 份` : "可补充"} tone={backfillMaterials.length ? "ok" : undefined}>
|
|
|
- <MaterialList ticketId={t.ticket_id} items={backfillMaterials} empty="暂无材料:可在此补充现场照片、处理截图等过程留痕。" allowDownload={canDownloadMaterial} />
|
|
|
- {!clientView && (materialLocked
|
|
|
- ? <p className="work-order-seg-foot"><Info size={15} />工单已{t.status === "terminated" ? "作废" : "办结"},材料只读:终态不再提供任何追加入口(服务端同样拒绝,KLT-G20401)。</p>
|
|
|
- : <div className="work-order-materials-actions"><Button variant="outline" size="sm" type="button" onClick={() => setMaterialOpen(true)}><FolderOpen size={15} />补充过程材料</Button></div>)}
|
|
|
- </FactSeg>}
|
|
|
- </section>
|
|
|
+ </WorkOrderPanel>}
|
|
|
|
|
|
- <div className="record-tab-panel work-order-record-panel work-order-refs" id="work-order-panel-references"
|
|
|
- role="tabpanel" aria-labelledby="work-order-tab-references" hidden={activeTab !== "references"} tabIndex={0}>
|
|
|
+ <WorkOrderPanel tab="references" active={activeTab} className="work-order-refs">
|
|
|
<section className="work-order-reference-group">
|
|
|
- <h2>客户与订阅</h2>
|
|
|
+ <h2 className="work-order-panel-title">客户与订阅</h2>
|
|
|
{refCustomer ? <>
|
|
|
<div className="work-order-trace"><span>客户名称</span><strong>{refCustomer.customer_name
|
|
|
? <button type="button" className="work-order-trace-link" onClick={() => openRef({ kind: "customer", id: refCustomer.customer_id, name: refCustomer.customer_name })}>{refCustomer.customer_name}</button>
|
|
|
@@ -1669,7 +1671,7 @@ export function WorkOrderRecordPage() {
|
|
|
{(d.subscriptions ?? []).length > 0 && <div className="work-order-trace"><span>并单成员订阅({(d.subscriptions ?? []).length})</span><div className="work-order-member-list">{(d.subscriptions ?? []).map((member) => <div key={member.subscription_id} className="work-order-member-row"><button type="button" className="work-order-trace-link" onClick={() => openRef({ kind: "order", id: member.subscription_id, name: member.plan_name ?? null })}>{member.plan_name ?? member.subscription_id}</button><small>{member.subscription_id}{member.plan_family ? ` · ${label(PLAN_FAMILY, member.plan_family)}` : ""}{member.status ? ` · ${label(ORDER_STATUS, member.status)}` : ""}</small>{member.parent_subscription_id && <small className="order-parent-mark">叠加于 {member.parent_subscription_id}</small>}</div>)}</div></div>}
|
|
|
</section>
|
|
|
<section className="work-order-reference-group">
|
|
|
- <h2>追溯与关联</h2>
|
|
|
+ <h2 className="work-order-panel-title">追溯与关联</h2>
|
|
|
{t.ticket_type === "renewal" && (t.renew_from_contract_id || t.renew_from_contract_no) && (
|
|
|
<div className="work-order-trace"><span>续签来源合同</span><strong>{t.renew_from_contract_no ?? t.renew_from_contract_id}</strong>
|
|
|
{t.renew_from_end_date ? <small>原到期 {fmtDate(t.renew_from_end_date)}</small> : null}
|
|
|
@@ -1681,7 +1683,7 @@ export function WorkOrderRecordPage() {
|
|
|
{t.source_message_id && <div className="work-order-trace"><span>来源报文</span><strong>{t.source_message_id}</strong></div>}
|
|
|
{t.subscription_id && <div className="work-order-trace"><span>关联订单号</span><strong><button type="button" className="work-order-trace-link" onClick={() => openRef({ kind: "order", id: t.subscription_id!, name: refOrder?.plan_name })}>{t.subscription_id}</button></strong></div>}
|
|
|
</section>
|
|
|
- </div>
|
|
|
+ </WorkOrderPanel>
|
|
|
</div>
|
|
|
<aside className="work-order-side">
|
|
|
{/* 右栏=处理记录专席:面板高度随窗口自适应、条数超出时面板内滚动,页面本身不变长。 */}
|