Files
Home-Care/hss-home-service/website/.nuxt/dist/client/_nuxt/CevuCUCa.js
comclib c02029a5f3 feat: 初始化居家上门服务系统完整项目代码
- Spring Boot 后端服务 (hss-home-service)
- delivery-miniapp 配送小程序
- website 官网 (Nuxt)
- docs 架构设计文档
- Docker 容器化部署配置

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-19 09:04:49 +08:00

2 lines
5.2 KiB
JavaScript

import{_ as v}from"./D6wjM-Aw.js";import{l as k,w as R,f as D,T as I,A as p,x as a,h as n,e as t,F as f,B as E,u as m,K as d,g as i}from"./4pHoJ_J-.js";const O={key:0,class:"min-h-screen bg-surface flex items-center justify-center"},w={key:1,class:"min-h-screen bg-surface flex"},T={class:"hidden lg:flex flex-col w-56 bg-white border-r shrink-0"},N={class:"p-3 space-y-1"},S=["onClick"],A={class:"flex-1 p-4 lg:p-8 overflow-auto"},$={class:"bg-white rounded-2xl shadow-sm border overflow-hidden"},P={key:0,class:"p-8 text-center text-text-secondary"},X={key:1,class:"w-full text-sm"},B={class:"px-4 py-3 font-mono text-xs"},F={class:"px-4 py-3 text-xs"},L={class:"px-4 py-3 text-xs"},M={class:"px-4 py-3"},V={class:"px-4 py-3 text-xs"},K={class:"px-4 py-3"},U={class:"flex gap-1 flex-wrap"},j=["onClick"],H=["onClick"],z=["onClick"],G=["onClick"],J=["onClick"],q=["onClick"],Z=k({__name:"work-orders",setup(Q){const _=p([]),g=p(!0),y=p(!1),u=p(""),x={ORDER_CREATED:{label:"待派单",cls:"bg-gray-100 text-gray-600"},ORDER_ASSIGNED:{label:"已派单",cls:"bg-blue-50 text-blue-600"},ORDER_ACCEPTED:{label:"已接单",cls:"bg-indigo-50 text-indigo-600"},ORDER_CHECKED_IN:{label:"已签到",cls:"bg-teal-50 text-teal-600"},ORDER_IN_SERVICE:{label:"服务中",cls:"bg-accent-50 text-accent-700"},ORDER_COMPLETED:{label:"已完成",cls:"bg-green-50 text-green-600"},ORDER_EXCEPTION:{label:"异常",cls:"bg-red-50 text-red-600"},ACCEPTED:{label:"已验收",cls:"bg-green-100 text-green-700"}};function C(){const o={"Content-Type":"application/json","X-Tenant-Id":"1","X-Org-Id":"1","X-User-Role":"ADMIN","X-User-Id":"1"};try{const s=JSON.parse(localStorage.getItem("hss_platform_user")||"{}");s.userRole&&(o["X-User-Role"]=s.userRole,o["X-User-Id"]=s.userId)}catch{}return o}async function b(o,s={}){const r={...C(),"Idempotency-Key":"web-"+Date.now()};return await $fetch("/api/hss"+o,{...s,headers:{...r,...s.headers||{}}})}async function h(){try{const o=await b("/admin/work-orders?page=1&size=30");_.value=o?.data||[]}catch{}}async function l(o,s,r){try{await b(`/work-orders/${o}/${s}`,{method:"POST",body:r?JSON.stringify(r):void 0}),await h()}catch(e){alert(e?.data?.message||e?.message||"操作失败")}}return R(()=>{y.value=!0,h().finally(()=>g.value=!1)}),(o,s)=>{const r=v;return a(),D(r,null,{default:I(()=>[y.value?(a(),n("div",w,[t("aside",T,[s[1]||(s[1]=t("div",{class:"p-4 border-b"},[t("a",{href:"/platform",class:"font-bold text-primary text-sm"},"← 返回工作台")],-1)),t("div",N,[(a(!0),n(f,null,E(["",...Object.keys(x)],e=>(a(),n("button",{key:e,onClick:c=>u.value=e,class:m(["block w-full text-left px-3 py-2 rounded-lg text-xs transition-colors",u.value===e?"bg-primary-50 text-primary font-medium":"text-text-secondary hover:bg-gray-50"])},d(e?x[e]?.label:"全部工单"),11,S))),128))])]),t("main",A,[s[3]||(s[3]=t("h2",{class:"text-xl font-bold mb-6"},"工单管理",-1)),t("div",$,[g.value?(a(),n("div",P,"加载中...")):(a(),n("table",X,[s[2]||(s[2]=t("thead",null,[t("tr",{class:"bg-gray-50 text-left text-xs text-text-secondary"},[t("th",{class:"px-4 py-3"},"ID"),t("th",{class:"px-4 py-3"},"服务日期"),t("th",{class:"px-4 py-3"},"服务对象"),t("th",{class:"px-4 py-3"},"状态"),t("th",{class:"px-4 py-3"},"人员"),t("th",{class:"px-4 py-3"},"操作")])],-1)),t("tbody",null,[(a(!0),n(f,null,E(_.value.filter(e=>!u.value||e.status===u.value),e=>(a(),n("tr",{key:e.id,class:"border-t border-gray-50 hover:bg-gray-50"},[t("td",B,"#"+d(e.id),1),t("td",F,d(e.serviceDate),1),t("td",L,d(e.patientId),1),t("td",M,[t("span",{class:m(["px-2 py-0.5 rounded-full text-xs font-medium",x[e.status]?.cls||"bg-gray-100"])},d(x[e.status]?.label||e.status),3)]),t("td",V,d(e.staffId||"-"),1),t("td",K,[t("div",U,[e.status==="ORDER_CREATED"?(a(),n("button",{key:0,onClick:c=>l(e.id,"assign",{staffId:1,reason:"派单"}),class:"px-2 py-1 bg-blue-50 text-blue-600 rounded text-xs hover:bg-blue-100"},"派单",8,j)):i("",!0),e.status==="ORDER_ASSIGNED"?(a(),n("button",{key:1,onClick:c=>l(e.id,"accept"),class:"px-2 py-1 bg-green-50 text-green-600 rounded text-xs hover:bg-green-100"},"接单",8,H)):i("",!0),e.status==="ORDER_ACCEPTED"?(a(),n("button",{key:2,onClick:c=>l(e.id,"check-in",{latitude:24.2878,longitude:116.1271,photoFileId:"test",patientConfirmed:!0}),class:"px-2 py-1 bg-teal-50 text-teal-600 rounded text-xs hover:bg-teal-100"},"签到",8,z)):i("",!0),e.status==="ORDER_CHECKED_IN"?(a(),n("button",{key:3,onClick:c=>l(e.id,"start-service"),class:"px-2 py-1 bg-accent-50 text-accent-600 rounded text-xs hover:bg-accent-100"},"开始",8,G)):i("",!0),e.status==="ORDER_IN_SERVICE"?(a(),n("button",{key:4,onClick:c=>l(e.id,"finish",{executionRecords:[{planItemId:1,status:"COMPLETED",notes:"完成"}],serviceSummary:"完成",signOffLatitude:24.2878,signOffLongitude:116.1271}),class:"px-2 py-1 bg-green-50 text-green-600 rounded text-xs hover:bg-green-100"},"完成",8,J)):i("",!0),e.status==="ORDER_IN_SERVICE"?(a(),n("button",{key:5,onClick:c=>l(e.id,"report-exception",{exceptionType:"PATIENT_ABSENT",description:"对象不在家"}),class:"px-2 py-1 bg-red-50 text-red-600 rounded text-xs hover:bg-red-100"},"异常",8,q)):i("",!0)])])]))),128))])]))])])])):(a(),n("div",O,[...s[0]||(s[0]=[t("p",{class:"text-text-secondary"},"加载中...",-1)])]))]),_:1})}}});export{Z as default};