|
|
@@ -1050,6 +1050,7 @@ const WORK_ORDER_RECORD_TABS = [
|
|
|
{ id: "materials", label: "工单材料" },
|
|
|
{ id: "messages", label: "运营商报文" },
|
|
|
{ id: "references", label: "客户与订阅" },
|
|
|
+ { id: "trace", label: "追溯与关联" },
|
|
|
] as const;
|
|
|
|
|
|
type WorkOrderRecordTab = (typeof WORK_ORDER_RECORD_TABS)[number]["id"];
|
|
|
@@ -1245,6 +1246,7 @@ export function WorkOrderRecordPage() {
|
|
|
const refOrder = d.order;
|
|
|
const refSubscriptionId = refOrder?.subscription_id ?? t.subscription_id;
|
|
|
const memberSubscriptions = d.subscriptions ?? [];
|
|
|
+ const submitterLabel = t.submitter_type === "customer" ? "客户侧提交" : t.submitter_type === "reporter" ? "报障人提交" : "运营侧代报";
|
|
|
|
|
|
/**
|
|
|
* 「下一步」=详情页唯一的主动作。
|
|
|
@@ -1378,6 +1380,7 @@ export function WorkOrderRecordPage() {
|
|
|
materials: materialCount > 0 || canAddMaterials,
|
|
|
messages: d.messages.length > 0,
|
|
|
references: true,
|
|
|
+ trace: true,
|
|
|
} satisfies Record<WorkOrderRecordTab, boolean>;
|
|
|
const tabs = WORK_ORDER_RECORD_TABS.filter(({ id: tab }) => tabVisible[tab]).map((tab) => ({
|
|
|
...tab,
|
|
|
@@ -1458,7 +1461,7 @@ export function WorkOrderRecordPage() {
|
|
|
</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>{submitterLabel}</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>}
|
|
|
@@ -1696,7 +1699,21 @@ export function WorkOrderRecordPage() {
|
|
|
</div>}
|
|
|
</dl>
|
|
|
</section>}
|
|
|
+ </WorkOrderPanel>
|
|
|
|
|
|
+ <WorkOrderPanel tab="trace" active={activeTab} className="work-order-refs">
|
|
|
+ <section className="record-summary-panel">
|
|
|
+ <dl className="ops-record-summary">
|
|
|
+ <div><dt>本单来源</dt><dd>{t.source_message_id ? "运营商报文触发" : submitterLabel}</dd></div>
|
|
|
+ {t.source_message_id && <div><dt>来源报文</dt><dd>{t.source_message_id}</dd></div>}
|
|
|
+ {t.ticket_type === "renewal" && (t.renew_from_contract_id || t.renew_from_contract_no) && <>
|
|
|
+ <div><dt>续签来源合同</dt><dd>{t.renew_from_contract_no ?? t.renew_from_contract_id}</dd></div>
|
|
|
+ {t.renew_from_end_date && <div><dt>原合同到期日</dt><dd>{fmtDate(t.renew_from_end_date)}</dd></div>}
|
|
|
+ {(t.renew_contract_no || t.renew_contract_id) && <div><dt>新合同</dt><dd>{t.renew_contract_no ?? t.renew_contract_id}</dd></div>}
|
|
|
+ </>}
|
|
|
+ {d.messages.length > 0 && <div className="work-order-reference-wide"><dt>关联报文</dt><dd>{d.messages.map((m) => m.carrier_order_no ?? m.message_id).join("、")}</dd></div>}
|
|
|
+ </dl>
|
|
|
+ </section>
|
|
|
</WorkOrderPanel>
|
|
|
</div>
|
|
|
<aside className="work-order-side">
|