|
@@ -1,7 +1,7 @@
|
|
|
import { Fragment, useEffect, useRef, useState, type FormEvent, type ReactNode } from "react";
|
|
import { Fragment, useEffect, useRef, useState, type FormEvent, type ReactNode } from "react";
|
|
|
import {
|
|
import {
|
|
|
ArrowLeft, ArrowRight, Check, ChevronDown, CircleAlert, ClipboardCheck, FolderOpen,
|
|
ArrowLeft, ArrowRight, Check, ChevronDown, CircleAlert, ClipboardCheck, FolderOpen,
|
|
|
- FileUp, Image, Info, Plus, RefreshCcw, ShieldAlert, Ticket, TriangleAlert, X,
|
|
|
|
|
|
|
+ FileUp, Image, Info, MapPin, Phone, Plus, RefreshCcw, ShieldAlert, Ticket, TriangleAlert, X,
|
|
|
} from "lucide-react";
|
|
} from "lucide-react";
|
|
|
import { Button } from "../components/ui/button";
|
|
import { Button } from "../components/ui/button";
|
|
|
import { Input } from "../components/ui/input";
|
|
import { Input } from "../components/ui/input";
|
|
@@ -33,6 +33,7 @@ import { uploadTicketMaterial } from "../lib/api/oss-upload";
|
|
|
import { classifyTicketError, fmtDate, fmtTime, numText, submitErrorText, useTicketDetail } from "../lib/ticket";
|
|
import { classifyTicketError, fmtDate, fmtTime, numText, submitErrorText, useTicketDetail } from "../lib/ticket";
|
|
|
import { missingGroupsOf } from "../lib/ticket-gaps";
|
|
import { missingGroupsOf } from "../lib/ticket-gaps";
|
|
|
import { workOrderSteps } from "../lib/work-order-steps";
|
|
import { workOrderSteps } from "../lib/work-order-steps";
|
|
|
|
|
+import { todoRowDeadline } from "../lib/work-order-todo-row";
|
|
|
import { ACCT_STATUS, label, PLAN_FAMILY, PLAN_KIND, ORDER_STATUS } from "../lib/api/labels";
|
|
import { ACCT_STATUS, label, PLAN_FAMILY, PLAN_KIND, ORDER_STATUS } from "../lib/api/labels";
|
|
|
import {
|
|
import {
|
|
|
BANDWIDTH_TIERS, IP_TYPES, PATH_CPE_FIELDS, PATH_TUNNEL_FIELDS,
|
|
BANDWIDTH_TIERS, IP_TYPES, PATH_CPE_FIELDS, PATH_TUNNEL_FIELDS,
|
|
@@ -206,7 +207,7 @@ function stripNoteDate(note: string): string {
|
|
|
* ⛔ 再给「展开更多」之类的截断:处理记录是运维盯单的专席,半年后回看的也是这几条,
|
|
* ⛔ 再给「展开更多」之类的截断:处理记录是运维盯单的专席,半年后回看的也是这几条,
|
|
|
* 面板高度随窗口自适应,滚动条由 CSS 处理(`.work-order-logs-scroll`)。
|
|
* 面板高度随窗口自适应,滚动条由 CSS 处理(`.work-order-logs-scroll`)。
|
|
|
*/
|
|
*/
|
|
|
-export function LogPanel({ logs }: { logs: TicketDetail["process_logs"] }) {
|
|
|
|
|
|
|
+function LogPanel({ logs }: { logs: TicketDetail["process_logs"] }) {
|
|
|
const railRef = useRef<HTMLOListElement>(null);
|
|
const railRef = useRef<HTMLOListElement>(null);
|
|
|
const flowRef = useRef<HTMLSpanElement>(null);
|
|
const flowRef = useRef<HTMLSpanElement>(null);
|
|
|
/**
|
|
/**
|
|
@@ -1153,8 +1154,24 @@ function WorkOrderPanel({ tab, active, className = "", children }: {
|
|
|
</section>;
|
|
</section>;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+function MobileSiteInfo({ customer, customerId }: { customer: TicketDetail["customer"]; customerId: string | null }) {
|
|
|
|
|
+ const phone = customer?.contact_mobile_full?.trim();
|
|
|
|
|
+ return <section className="field-panel field-site">
|
|
|
|
|
+ <h2><MapPin size={17} aria-hidden="true" />现场信息</h2>
|
|
|
|
|
+ <dl>
|
|
|
|
|
+ <div><dt>客户</dt><dd>{customer?.customer_name || customerId || "未登记"}</dd></div>
|
|
|
|
|
+ <div><dt>施工地址</dt><dd>{customer?.address || "未登记"}</dd></div>
|
|
|
|
|
+ <div><dt>联系人</dt><dd>{customer?.contact_name || "未登记"}
|
|
|
|
|
+ {phone && /^[+\d][\d ()-]+$/.test(phone)
|
|
|
|
|
+ ? <a className="field-phone" href={`tel:${phone.replace(/[ ()-]/g, "")}`}><Phone size={15} aria-hidden="true" />{phone}</a>
|
|
|
|
|
+ : customer?.contact_mobile && <span className="field-contact">{customer.contact_mobile}</span>}
|
|
|
|
|
+ </dd></div>
|
|
|
|
|
+ </dl>
|
|
|
|
|
+ </section>;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
/** 工单详情(`/ticket/detail@v1`)。 */
|
|
/** 工单详情(`/ticket/detail@v1`)。 */
|
|
|
-export function WorkOrderRecordPage() {
|
|
|
|
|
|
|
+export function WorkOrderRecordPage({ mobile = false }: { mobile?: boolean }) {
|
|
|
const { id } = useParams();
|
|
const { id } = useParams();
|
|
|
const navigate = useNavigate();
|
|
const navigate = useNavigate();
|
|
|
const location = useLocation();
|
|
const location = useLocation();
|
|
@@ -1164,7 +1181,7 @@ export function WorkOrderRecordPage() {
|
|
|
const [sheet, setSheet] = useState<string | null>(null);
|
|
const [sheet, setSheet] = useState<string | null>(null);
|
|
|
/** 缺口入口打开对话框时的定位目标。 */
|
|
/** 缺口入口打开对话框时的定位目标。 */
|
|
|
const [sheetFocus, setSheetFocus] = useState<GapFocus | undefined>(undefined);
|
|
const [sheetFocus, setSheetFocus] = useState<GapFocus | undefined>(undefined);
|
|
|
- const [notice, setNotice] = useState("");
|
|
|
|
|
|
|
+ const [notice, setNotice] = useState<string>(() => mobile && typeof location.state?.notice === "string" ? location.state.notice : "");
|
|
|
const [selectedTab, setSelectedTab] = useState<{ ticketId: string; tab: WorkOrderRecordTab } | null>(null);
|
|
const [selectedTab, setSelectedTab] = useState<{ ticketId: string; tab: WorkOrderRecordTab } | null>(null);
|
|
|
const [materialOpen, setMaterialOpen] = useState(false);
|
|
const [materialOpen, setMaterialOpen] = useState(false);
|
|
|
/** 关联资料对话框的浏览栈,栈顶为当前档案。 */
|
|
/** 关联资料对话框的浏览栈,栈顶为当前档案。 */
|
|
@@ -1173,6 +1190,19 @@ export function WorkOrderRecordPage() {
|
|
|
const detail = useTicketDetail(id ?? "", !clientView);
|
|
const detail = useTicketDetail(id ?? "", !clientView);
|
|
|
const submit = useSubmit();
|
|
const submit = useSubmit();
|
|
|
const openSheet = (action: string, focus?: GapFocus) => {
|
|
const openSheet = (action: string, focus?: GapFocus) => {
|
|
|
|
|
+ if (mobile && action === "backfill" && id) {
|
|
|
|
|
+ const params = new URLSearchParams(location.search);
|
|
|
|
|
+ const fromActionLink = params.has("act");
|
|
|
|
|
+ params.delete("act");
|
|
|
|
|
+ const query = params.toString();
|
|
|
|
|
+ const origin = location.pathname + (query ? `?${query}` : "") + location.hash;
|
|
|
|
|
+ const returnState = { ...location.state, notice: undefined, workOrderTab: selectedTab?.tab ?? location.state?.workOrderTab };
|
|
|
|
|
+ navigate(`/m/work-orders/${encodeURIComponent(id)}/backfill`, {
|
|
|
|
|
+ replace: fromActionLink,
|
|
|
|
|
+ state: { ...detailLinkState(origin, returnState), backfillFocus: focus },
|
|
|
|
|
+ });
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
setSheetFocus(focus);
|
|
setSheetFocus(focus);
|
|
|
if (action === "backfill") {
|
|
if (action === "backfill") {
|
|
|
// 缓存已有回填时立即打开表单,并在后台刷新。
|
|
// 缓存已有回填时立即打开表单,并在后台刷新。
|
|
@@ -1220,9 +1250,13 @@ export function WorkOrderRecordPage() {
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
|
if (!d || !actParam || autoAct.current === actParam) return;
|
|
if (!d || !actParam || autoAct.current === actParam) return;
|
|
|
autoAct.current = actParam;
|
|
autoAct.current = actParam;
|
|
|
- const action = actParam === "receipt" ? "confirm_receipt" : actParam;
|
|
|
|
|
- const allowed = (d.actions as Record<string, boolean>)[action];
|
|
|
|
|
- if (allowed) openSheet(action);
|
|
|
|
|
|
|
+ const mobileBackfill = mobile && (actParam === "backfill" || actParam === "check_and_backfill");
|
|
|
|
|
+ const action = mobileBackfill ? "backfill" : actParam === "receipt" ? "confirm_receipt" : actParam;
|
|
|
|
|
+ const allowed = mobileBackfill ? d.actions.backfill || d.actions.check_and_backfill : (d.actions as Record<string, boolean>)[action];
|
|
|
|
|
+ if (allowed) {
|
|
|
|
|
+ openSheet(action);
|
|
|
|
|
+ if (mobileBackfill) return;
|
|
|
|
|
+ }
|
|
|
// 深链动作不在服务端 `actions` 内(例如驳回态的 `backfill`):⛔ 静默吞掉参数,给一句为什么。
|
|
// 深链动作不在服务端 `actions` 内(例如驳回态的 `backfill`):⛔ 静默吞掉参数,给一句为什么。
|
|
|
else setNotice("该动作当前不可执行(服务端未开放),请按右栏「当前可执行」推进本单。");
|
|
else setNotice("该动作当前不可执行(服务端未开放),请按右栏「当前可执行」推进本单。");
|
|
|
const next = new URLSearchParams(searchParams);
|
|
const next = new URLSearchParams(searchParams);
|
|
@@ -1239,7 +1273,7 @@ export function WorkOrderRecordPage() {
|
|
|
else setNotice(submitErrorText(submit.errorRef.current, "操作失败"));
|
|
else setNotice(submitErrorText(submit.errorRef.current, "操作失败"));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- const backLink = <Link to={back.to} state={back.state} className="ops-back-link"><ArrowLeft size={16} />{back.label}</Link>;
|
|
|
|
|
|
|
+ const backLink = mobile ? null : <Link to={back.to} state={back.state} className="ops-back-link"><ArrowLeft size={16} />{back.label}</Link>;
|
|
|
if (!id) return <Navigate to={back.to} state={back.state} replace />;
|
|
if (!id) return <Navigate to={back.to} state={back.state} replace />;
|
|
|
if (detail.loading) return <section className="ops-record-page">{backLink}<div className="work-order-empty"><Info size={27} /><h3>正在读取工单详情…</h3></div></section>;
|
|
if (detail.loading) return <section className="ops-record-page">{backLink}<div className="work-order-empty"><Info size={27} /><h3>正在读取工单详情…</h3></div></section>;
|
|
|
if (fail || !d) return <section className="ops-record-page">{backLink}{fail && <TicketState fail={fail} onRetry={detail.reload} />}</section>;
|
|
if (fail || !d) return <section className="ops-record-page">{backLink}{fail && <TicketState fail={fail} onRetry={detail.reload} />}</section>;
|
|
@@ -1423,19 +1457,25 @@ export function WorkOrderRecordPage() {
|
|
|
* 客户既没有回填与竣工入口,也无从补齐这些组,面板只会误导成「我做错了什么」;
|
|
* 客户既没有回填与竣工入口,也无从补齐这些组,面板只会误导成「我做错了什么」;
|
|
|
* 门户口径是「等待运维处理/对方还在处理」(本册 §14.1.9)。⇒ `clientView` 整块不渲染。
|
|
* 门户口径是「等待运维处理/对方还在处理」(本册 §14.1.9)。⇒ `clientView` 整块不渲染。
|
|
|
*/
|
|
*/
|
|
|
- if (!clientView && d.gaps.length > 0) todoNodes.push(<div className="work-order-gaps" key="gaps">
|
|
|
|
|
- <div className="work-order-gaps-head"><strong>闭环还缺 {d.gaps.length} 项</strong><span>缺口由服务端判定,不可人工放行竣工</span></div>
|
|
|
|
|
- <ul>{d.gaps.map((g) => {
|
|
|
|
|
- const target = gapTarget(g, can);
|
|
|
|
|
- const usesSoftButton = target?.focus === "routes" || target?.focus === "conclusion";
|
|
|
|
|
- return <li key={g}><div><b>{groupLabel(g)}</b><p>{gapHint(g)}</p></div>
|
|
|
|
|
- {target && !viewerReadOnly && <Button size="sm" variant={usesSoftButton ? "ghost" : "outline"}
|
|
|
|
|
- className={usesSoftButton ? "org-button org-button-compact org-button-scope" : undefined}
|
|
|
|
|
- onClick={() => openSheet(target.action, target.focus)}>{target.label}<ArrowRight size={14} aria-hidden="true" /></Button>}
|
|
|
|
|
- </li>;
|
|
|
|
|
- })}</ul>
|
|
|
|
|
- <p className="work-order-detail-footnote"><Info size={15} />缺口清单由服务端判定,不得在此人工放行竣工;{can.generate_completion ? "可生成竣工" : "生成竣工入口保持关闭"}。</p>
|
|
|
|
|
- </div>);
|
|
|
|
|
|
|
+ if (!clientView && d.gaps.length > 0) {
|
|
|
|
|
+ const gapDetails = <div className="work-order-gaps" key="gaps">
|
|
|
|
|
+ <div className="work-order-gaps-head"><strong>闭环还缺 {d.gaps.length} 项</strong><span>缺口由服务端判定,不可人工放行竣工</span></div>
|
|
|
|
|
+ <ul>{d.gaps.map((g) => {
|
|
|
|
|
+ const target = gapTarget(g, can);
|
|
|
|
|
+ const usesSoftButton = target?.focus === "routes" || target?.focus === "conclusion";
|
|
|
|
|
+ return <li key={g}><div><b>{groupLabel(g)}</b><p>{gapHint(g)}</p></div>
|
|
|
|
|
+ {target && (!viewerReadOnly || (mobile && target.action === "backfill")) && <Button size="sm" variant={usesSoftButton ? "ghost" : "outline"}
|
|
|
|
|
+ className={usesSoftButton ? "org-button org-button-compact org-button-scope" : undefined}
|
|
|
|
|
+ onClick={() => openSheet(target.action, target.focus)}>{target.label}<ArrowRight size={14} aria-hidden="true" /></Button>}
|
|
|
|
|
+ </li>;
|
|
|
|
|
+ })}</ul>
|
|
|
|
|
+ <p className="work-order-detail-footnote"><Info size={15} />缺口清单由服务端判定,不得在此人工放行竣工;{can.generate_completion ? "可生成竣工" : "生成竣工入口保持关闭"}。</p>
|
|
|
|
|
+ </div>;
|
|
|
|
|
+ todoNodes.push(mobile ? <details key="gaps" className="field-ticket-gaps">
|
|
|
|
|
+ <summary>待补资料 <span>{d.gaps.length} 项</span><ChevronDown size={16} aria-hidden="true" /></summary>
|
|
|
|
|
+ {gapDetails}
|
|
|
|
|
+ </details> : gapDetails);
|
|
|
|
|
+ }
|
|
|
if (t.status === "terminated" && t.close_reason) todoNodes.push(<div className="work-order-void" key="void"><X size={18} /><div><strong>作废原因</strong><p>{t.close_reason}</p></div></div>);
|
|
if (t.status === "terminated" && t.close_reason) todoNodes.push(<div className="work-order-void" key="void"><X size={18} /><div><strong>作废原因</strong><p>{t.close_reason}</p></div></div>);
|
|
|
// 只读视图提示只给「运营侧但无动作权的身份」(运维人员只管本人单、运营商只读等):
|
|
// 只读视图提示只给「运营侧但无动作权的身份」(运维人员只管本人单、运营商只读等):
|
|
|
// ⚠️ 2026-11-18 客户侧改走下面那条门户口径进度条,⛔ 两条同时出现。
|
|
// ⚠️ 2026-11-18 客户侧改走下面那条门户口径进度条,⛔ 两条同时出现。
|
|
@@ -1485,6 +1525,28 @@ export function WorkOrderRecordPage() {
|
|
|
catch { setNotice("复制失败:浏览器拒绝了剪贴板访问。"); }
|
|
catch { setNotice("复制失败:浏览器拒绝了剪贴板访问。"); }
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+ const headerDetails = <>
|
|
|
|
|
+ <div className="work-order-head-meta">
|
|
|
|
|
+ <span>客户 <b>{refCustomer?.customer_name ?? "—"}</b></span><i>·</i>
|
|
|
|
|
+ <span>责任人 <b>{t.assignee_name ?? t.assignee_snapshot_name ?? "待分派"}</b></span><i>·</i>
|
|
|
|
|
+ <span>承接团队 <b>{t.assign_team_name ?? "未分派"}</b></span><i>·</i>
|
|
|
|
|
+ <span>建单人 <b>{t.creator_name ?? t.creator_user_id ?? "—"}</b></span><i>·</i>
|
|
|
|
|
+ <span>创建 <b className="mono">{fmtTime(t.created_at)}</b></span><i>·</i>
|
|
|
|
|
+ {/* 工单 ID=审计流水 `resource_id` 的原值(审计页对象列小字就是它),只给运营侧看:
|
|
|
|
|
+ 客户门户⛔ 出现内部主键(工单§10 负向登记:客户侧 URL/响应体只该有 `ticket_no`)。 */}
|
|
|
|
|
+ {!clientView && <><span>工单ID <b className="mono">{t.ticket_id}</b></span><i>·</i></>}
|
|
|
|
|
+ {finished
|
|
|
|
|
+ ? t.status === "completed" && t.completed_at
|
|
|
|
|
+ ? <span>完成 <b className="mono">{fmtTime(t.completed_at)}</b></span>
|
|
|
|
|
+ : null
|
|
|
|
|
+ : <span className={`work-order-head-due${t.overdue ? " overdue" : ""}`}>{showExecDate && execNotBefore ? `计划执行(服务开始日)` : "期限"} <b className="mono">{showExecDate && execNotBefore ? fmtDate(execNotBefore) : t.expected_done_date ? fmtDate(t.expected_done_date) : "按 SLA 计算"}</b>{dueNote ? `(${dueNote})` : ""}</span>}
|
|
|
|
|
+ {t.status === "settled" && t.settled_at && <span>办结 <b className="mono">{fmtTime(t.settled_at)}</b></span>}
|
|
|
|
|
+ {t.status === "terminated" && <span>作废 <b className="mono">{fmtTime(t.closed_at)}</b></span>}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ {nextHint && !viewerReadOnly && <div className="work-order-head-hint">{nextHint}</div>}
|
|
|
|
|
+ <div className="work-order-steps" aria-label="工单流转进度">{steps.map((step, index) => <Fragment key={step.label}>{index > 0 && <i aria-hidden="true" className={index <= reachedStepIndex ? "on" : undefined} />}<span className={`work-order-step ${step.state === "current" ? "cur" : step.state}`} aria-current={step.state === "current" ? "step" : undefined}><b>{index + 1}</b>{step.label}</span></Fragment>)}</div>
|
|
|
|
|
+ </>;
|
|
|
|
|
+ const deadline = mobile && !finished ? todoRowDeadline(t) : null;
|
|
|
return <section className={`ops-record-page${clientView ? " customer-record-view" : ""}`}>
|
|
return <section className={`ops-record-page${clientView ? " customer-record-view" : ""}`}>
|
|
|
{backLink}
|
|
{backLink}
|
|
|
{notice && <OpsNotice message={notice} onClose={() => setNotice("")} />}
|
|
{notice && <OpsNotice message={notice} onClose={() => setNotice("")} />}
|
|
@@ -1494,7 +1556,9 @@ export function WorkOrderRecordPage() {
|
|
|
<div className="work-order-head-icon" aria-hidden="true"><Ticket size={25} /></div>
|
|
<div className="work-order-head-icon" aria-hidden="true"><Ticket size={25} /></div>
|
|
|
<div className="work-order-head-copy">
|
|
<div className="work-order-head-copy">
|
|
|
<span className="work-order-head-no">{t.ticket_no}</span>
|
|
<span className="work-order-head-no">{t.ticket_no}</span>
|
|
|
- <h1 className="work-order-head-title">{t.title}</h1>
|
|
|
|
|
|
|
+ {mobile
|
|
|
|
|
+ ? <h2 className="work-order-head-title">{t.title || refCustomer?.customer_name || "工单详情"}</h2>
|
|
|
|
|
+ : <h1 className="work-order-head-title">{t.title}</h1>}
|
|
|
<div className="work-order-head-tags">
|
|
<div className="work-order-head-tags">
|
|
|
<TypeTag type={t.ticket_type} />
|
|
<TypeTag type={t.ticket_type} />
|
|
|
<StatusTag status={t.status} type={t.ticket_type} />
|
|
<StatusTag status={t.status} type={t.ticket_type} />
|
|
@@ -1502,7 +1566,7 @@ export function WorkOrderRecordPage() {
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div className="work-order-head-actions">
|
|
<div className="work-order-head-actions">
|
|
|
- {nextStep && !viewerReadOnly && <Button onClick={runNextStep}>{nextStep.label}<ArrowRight size={16} /></Button>}
|
|
|
|
|
|
|
+ {!mobile && nextStep && !viewerReadOnly && <Button onClick={runNextStep}>{nextStep.label}<ArrowRight size={16} /></Button>}
|
|
|
{/* 客户侧两个动作=列表行内同款(门户册 9 §7.5.1):撤回(填原因)/确认完成关闭。
|
|
{/* 客户侧两个动作=列表行内同款(门户册 9 §7.5.1):撤回(填原因)/确认完成关闭。
|
|
|
判据来自 `customerLiveTicketActions`,⛔ 在这里另写状态机。 */}
|
|
判据来自 `customerLiveTicketActions`,⛔ 在这里另写状态机。 */}
|
|
|
{clientView && canClientWithdraw && <Button variant="outline" onClick={() => openSheet("withdraw")}><X size={16} />撤回</Button>}
|
|
{clientView && canClientWithdraw && <Button variant="outline" onClick={() => openSheet("withdraw")}><X size={16} />撤回</Button>}
|
|
@@ -1518,25 +1582,13 @@ export function WorkOrderRecordPage() {
|
|
|
</details>}
|
|
</details>}
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <div className="work-order-head-meta">
|
|
|
|
|
- <span>客户 <b>{refCustomer?.customer_name ?? "—"}</b></span><i>·</i>
|
|
|
|
|
- <span>责任人 <b>{t.assignee_name ?? t.assignee_snapshot_name ?? "待分派"}</b></span><i>·</i>
|
|
|
|
|
- <span>承接团队 <b>{t.assign_team_name ?? "未分派"}</b></span><i>·</i>
|
|
|
|
|
- <span>建单人 <b>{t.creator_name ?? t.creator_user_id ?? "—"}</b></span><i>·</i>
|
|
|
|
|
- <span>创建 <b className="mono">{fmtTime(t.created_at)}</b></span><i>·</i>
|
|
|
|
|
- {/* 工单 ID=审计流水 `resource_id` 的原值(审计页对象列小字就是它),只给运营侧看:
|
|
|
|
|
- 客户门户⛔ 出现内部主键(工单§10 负向登记:客户侧 URL/响应体只该有 `ticket_no`)。 */}
|
|
|
|
|
- {!clientView && <><span>工单ID <b className="mono">{t.ticket_id}</b></span><i>·</i></>}
|
|
|
|
|
- {finished
|
|
|
|
|
- ? t.status === "completed" && t.completed_at
|
|
|
|
|
- ? <span>完成 <b className="mono">{fmtTime(t.completed_at)}</b></span>
|
|
|
|
|
- : null
|
|
|
|
|
- : <span className={`work-order-head-due${t.overdue ? " overdue" : ""}`}>{showExecDate && execNotBefore ? `计划执行(服务开始日)` : "期限"} <b className="mono">{showExecDate && execNotBefore ? fmtDate(execNotBefore) : t.expected_done_date ? fmtDate(t.expected_done_date) : "按 SLA 计算"}</b>{dueNote ? `(${dueNote})` : ""}</span>}
|
|
|
|
|
- {t.status === "settled" && t.settled_at && <span>办结 <b className="mono">{fmtTime(t.settled_at)}</b></span>}
|
|
|
|
|
- {t.status === "terminated" && <span>作废 <b className="mono">{fmtTime(t.closed_at)}</b></span>}
|
|
|
|
|
- </div>
|
|
|
|
|
- {nextHint && !viewerReadOnly && <div className="work-order-head-hint">{nextHint}</div>}
|
|
|
|
|
- <div className="work-order-steps" aria-label="工单流转进度">{steps.map((step, index) => <Fragment key={step.label}>{index > 0 && <i aria-hidden="true" className={index <= reachedStepIndex ? "on" : undefined} />}<span className={`work-order-step ${step.state === "current" ? "cur" : step.state}`} aria-current={step.state === "current" ? "step" : undefined}><b>{index + 1}</b>{step.label}</span></Fragment>)}</div>
|
|
|
|
|
|
|
+ {mobile ? <>
|
|
|
|
|
+ {deadline?.date && <div className="field-date"><span>{{ planned: "计划执行", deferred: "延期至", due: "截止日期" }[deadline.kind]}</span><time dateTime={deadline.date}>{fmtDate(deadline.date)}</time></div>}
|
|
|
|
|
+ <details className="field-ticket-meta">
|
|
|
|
|
+ <summary>流转进度与责任人<ChevronDown size={16} aria-hidden="true" /></summary>
|
|
|
|
|
+ {headerDetails}
|
|
|
|
|
+ </details>
|
|
|
|
|
+ </> : headerDetails}
|
|
|
</header>
|
|
</header>
|
|
|
{todoNodes.length > 0 && <div className="work-order-todo">{todoNodes}</div>}
|
|
{todoNodes.length > 0 && <div className="work-order-todo">{todoNodes}</div>}
|
|
|
<div className="work-order-layout"><div className="record-tabs-frame work-order-tabs-frame">
|
|
<div className="work-order-layout"><div className="record-tabs-frame work-order-tabs-frame">
|
|
@@ -1544,6 +1596,7 @@ export function WorkOrderRecordPage() {
|
|
|
onChange={(tab) => setSelectedTab({ ticketId: id, tab })} />
|
|
onChange={(tab) => setSelectedTab({ ticketId: id, tab })} />
|
|
|
<WorkOrderPanel tab="overview" active={activeTab}>
|
|
<WorkOrderPanel tab="overview" active={activeTab}>
|
|
|
<div className="work-order-overview-card">
|
|
<div className="work-order-overview-card">
|
|
|
|
|
+ {mobile && <MobileSiteInfo customer={refCustomer} customerId={t.customer_id} />}
|
|
|
<p className="work-order-ticket-lead" data-empty={!t.detail || undefined}>{t.detail || "建单时未填写详细描述。"}</p>
|
|
<p className="work-order-ticket-lead" data-empty={!t.detail || undefined}>{t.detail || "建单时未填写详细描述。"}</p>
|
|
|
<dl className="work-order-overview-fields work-order-overview-context">
|
|
<dl className="work-order-overview-fields work-order-overview-context">
|
|
|
<div><dt>建单来源</dt><dd>{submitterLabel}</dd></div>
|
|
<div><dt>建单来源</dt><dd>{submitterLabel}</dd></div>
|
|
@@ -1817,7 +1870,9 @@ export function WorkOrderRecordPage() {
|
|
|
</aside>
|
|
</aside>
|
|
|
</div>
|
|
</div>
|
|
|
{/* 窄屏(≤900px)底部固定条:主按钮与返回不随正文滚走。桌面隐藏,见 CSS。 */}
|
|
{/* 窄屏(≤900px)底部固定条:主按钮与返回不随正文滚走。桌面隐藏,见 CSS。 */}
|
|
|
- {nextStep && !viewerReadOnly && <div className="work-order-sticky-bar"><Button variant="outline" onClick={goBack}><ArrowLeft size={16} />返回</Button><Button className="work-order-sticky-next" onClick={runNextStep}><ArrowRight size={16} />{nextStep.label}</Button></div>}
|
|
|
|
|
|
|
+ {nextStep && (!viewerReadOnly || (mobile && nextStep.action === "backfill")) &&
|
|
|
|
|
+ (mobile ? <footer className="field-bar"><Button className="field-primary" onClick={runNextStep}>{nextStep.label}<ArrowRight size={17} /></Button></footer>
|
|
|
|
|
+ : <div className="work-order-sticky-bar"><Button variant="outline" onClick={goBack}><ArrowLeft size={16} />返回</Button><Button className="work-order-sticky-next" onClick={runNextStep}><ArrowRight size={16} />{nextStep.label}</Button></div>)}
|
|
|
{materialOpen && <MaterialDialog ticketId={t.ticket_id} ticketNo={t.ticket_no} onClose={() => setMaterialOpen(false)}
|
|
{materialOpen && <MaterialDialog ticketId={t.ticket_id} ticketNo={t.ticket_no} onClose={() => setMaterialOpen(false)}
|
|
|
onDone={(message) => { setMaterialOpen(false); setNotice(message); detail.reload(); }} />}
|
|
onDone={(message) => { setMaterialOpen(false); setNotice(message); detail.reload(); }} />}
|
|
|
{sheet && <TicketActionSheet key={sheet} action={sheet} detail={d} focus={sheetFocus}
|
|
{sheet && <TicketActionSheet key={sheet} action={sheet} detail={d} focus={sheetFocus}
|