PageSourceSearch

https://zahit-pro-v2.pages.dev/assets/store.assignments-BEO-DuHd.js

js zahit-pro-v2.pages.dev collected 2026-10-03 06:03:10 UTC 6,935 bytes, 1 lines download raw bytes

1import{j as e}from"./jsx-runtime-0DLF9kdB.js";import{G as x}from"./GlassCard-QGEypy6d.js";import{P as f}from"./PageTransition-d4Dnod-f.js";import{u as w,L as o,F as j}from"./components-C61DWoh4.js";import{u as E}from"./index-DM-Ysix_.js";import"./cn-fNskMoFt.js";import"./use-combine-values-xozz9E_C.js";import"./proxy-TcOPxGtH.js";function G(){const{assignments:i,status:N,summary:a}=w(),l=E().state==="submitting",v=[["ACTIVE","待處理"],["PENDING","待確認"],["ACCEPTED","已接受"],["COMPLETED","已完成"],["REJECTED","已退回"],["ALL","全部"]],y={PENDING:{label:"待接案",className:"bg-amber-500/15 text-amber-300 border border-amber-500/30",hint:"等待店家確認是否承接"},ACCEPTED:{label:"施工中",className:"bg-blue-500/15 text-blue-300 border border-blue-500/30",hint:"已接受,完工後請建立回報"},COMPLETED:{label:"已完工待審",className:"bg-emerald-500/15 text-emerald-300 border border-emerald-500/30",hint:"店家已完工,等待總部審核回報"},REJECTED:{label:"已退回",className:"bg-red-500/15 text-red-300 border border-red-500/30",hint:"店家已退回總部派案"},CANCELLED:{label:"已取消",className:"bg-white/10 text-gray-400 border border-white/10",hint:"總部已取消或重新派案"}};return e.jsxs(f,{children:[e.jsxs("div",{className:"mb-8 flex items-end justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-bold uppercase tracking-[0.25em] text-blue-300",children:"Assignments"}),e.jsx("h1",{className:"text-3xl font-black italic tracking-tighter text-white",children:"總部派案"}),e.jsx("p",{className:"mt-2 text-sm text-gray-400",children:"接受派案後,可再進入完工回報建立施工與請款資料。"})]}),e.jsx(o,{to:"/store/report",className:"rounded-xl bg-blue-500 px-4 py-2 text-sm font-bold text-white hover:bg-blue-400",children:"完工回報"})]}),e.jsx("div",{className:"mb-6 grid gap-3 sm:grid-cols-2 lg:grid-cols-4",children:[["待接案",a.pendingAssignments,"總部派來、尚未確認"],["施工中",a.activeAssignments,"已接受、尚未回報"],["待補件",a.rejectedReports,"總部退回的回報"],["待審核",a.pendingReports,"已送出、等總部審"]].map(([t,s,r])=>e.jsxs(x,{className:"p-4",children:[e.jsx("div",{className:"text-[10px] font-bold uppercase tracking-[0.2em] text-gray-500",children:t}),e.jsx("div",{className:"mt-2 text-2xl font-black text-white",children:s}),e.jsx("div",{className:"mt-1 text-xs text-gray-500",children:r})]},String(t)))}),e.jsx("div",{className:"mb-6 flex flex-wrap gap-2",children:v.map(([t,s])=>e.jsx(o,{to:`/store/assignments?status=${t}`,className:`rounded-xl px-4 py-2 text-xs font-bold transition ${N===t?"bg-blue-500 text-white":"border border-white/10 text-gray-400 hover:bg-white/5"}`,children:s},t))}),e.jsx("div",{className:"space-y-4",children:i.length===0?e.jsx(x,{className:"p-10 text-center text-gray-500",children:"目前沒有派案。"}):i.map(t=>{var n,m,b,h,p,g,u;const s=t.intake,r=s==null?void 0:s.items[0],d=y[t.status]||{label:t.status,className:"bg-white/10 text-gray-300 border border-white/10",hint:"目前狀態"},c=new URLSearchParams;return c.set("assignmentId",t.id),t.orderId&&c.set("orderId",t.orderId),e.jsx(x,{className:"p-5",children:e.jsxs("div",{className:"grid gap-5 lg:grid-cols-[1fr_260px]",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-3",children:[e.jsx("span",{className:"font-mono text-xs text-blue-300",children:(s==null?void 0:s.intakeNumber)||t.id}),e.jsx("span",{className:`rounded-full px-2 py-1 text-[10px] font-bold ${d.className}`,children:d.label}),e.jsx("span",{className:"text-[10px] text-gray-500",children:d.hint})]}),e.jsxs("h2",{className:"text-lg font-bold text-white",children:[(r==null?void 0:r.serviceName)||"服務派案",s!=null&&s.colorCard?e.jsxs("span",{className:"ml-2 text-sm text-blue-300",children:["/ ",s.colorCard.name]}):null]}),e.jsxs("div",{className:"mt-3 grid gap-2 text-sm text-gray-400 md:grid-cols-2",children:[e.jsxs("div",{children:["會員:",e.jsx("span",{className:"text-gray-200",children:((n=s==null?void 0:s.member)==null?void 0:n.name)||(s==null?void 0:s.contactName)||"未提供"})]}),e.jsxs("div",{children:["電話:",e.jsx("span",{className:"text-gray-200",children:(s==null?void 0:s.contactPhone)||((m=s==null?void 0:s.member)==null?void 0:m.ph
1one)||"-"})]}),e.jsxs("div",{children:["車輛:",e.jsxs("span",{className:"text-gray-200",children:[((b=s==null?void 0:s.member)==null?void 0:b.carBrand)||"-"," ",((h=s==null?void 0:s.member)==null?void 0:h.carModel)||""," ",((p=s==null?void 0:s.member)==null?void 0:p.carPlate)||""]})]}),e.jsxs("div",{children:["業務:",e.jsx("span",{className:"text-gray-200",children:((g=s==null?void 0:s.salesAgent)==null?void 0:g.name)||"未綁定"})]}),e.jsxs("div",{children:["偏好地區:",e.jsx("span",{className:"text-gray-200",children:(s==null?void 0:s.preferredArea)||"-"})]}),e.jsxs("div",{children:["派案時間:",e.jsx("span",{className:"text-gray-200",children:new Date(t.assignedAt).toLocaleString("zh-TW")})]}),e.jsxs("div",{children:["關聯訂單:",e.jsx("span",{className:"font-mono text-gray-200",children:((u=t.order)==null?void 0:u.orderNumber)||t.orderId||"-"})]})]}),(s==null?void 0:s.message)&&e.jsx("div",{className:"mt-4 rounded-xl border border-white/10 bg-black/20 p-3 text-sm text-gray-300",children:s.message}),t.note&&e.jsxs("div",{className:"mt-3 text-xs text-gray-500",children:["派案備註:",t.note]})]}),e.jsxs("div",{className:"space-y-3",children:[t.status==="PENDING"&&e.jsx(e.Fragment,{children:e.jsxs(j,{method:"post",className:"space-y-3",children:[e.jsx("input",{type:"hidden",name:"assignmentId",value:t.id}),e.jsx("textarea",{name:"note",rows:2,placeholder:"回覆總部備註",className:"w-full rounded-xl border border-white/10 bg-black/50 px-3 py-2 text-sm text-white"}),e.jsx("button",{name:"intent",value:"accept",disabled:l,className:"w-full rounded-xl bg-blue-500 px-4 py-2 text-sm font-bold text-white hover:bg-blue-400 disabled:opacity-60",children:"接受派案"}),e.jsx("button",{name:"intent",value:"reject",disabled:l,className:"w-full rounded-xl border border-red-500/30 px-4 py-2 text-sm font-bold text-red-300 hover:bg-red-500/10 disabled:opacity-60",children:"退回"})]})}),t.status==="ACCEPTED"&&e.jsxs(e.Fragment,{children:[e.jsx(o,{to:`/store/report?${c.toString()}`,className:"block w-full rounded-xl bg-white px-4 py-2 text-center text-sm font-black text-black hover:bg-blue-100",children:"建立完工回報 / 請款"}),e.jsxs(j,{method:"post",children:[e.jsx("input",{type:"hidden",name:"assignmentId",value:t.id}),e.jsx("button",{name:"intent",value:"complete",disabled:l,className:"w-full rounded-xl border border-white/10 px-4 py-2 text-sm text-gray-400 hover:bg-white/5 disabled:opacity-60",children:"僅標記完工"})]})]})]})]})},t.id)})})]})}export{G as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.