- Spring Boot 后端服务 (hss-home-service) - delivery-miniapp 配送小程序 - website 官网 (Nuxt) - docs 架构设计文档 - Docker 容器化部署配置 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2 lines
8.0 KiB
JavaScript
2 lines
8.0 KiB
JavaScript
import{_ as D}from"./D6wjM-Aw.js";import{l as P,w as R,f as U,T as M,A as u,x as n,h as a,e,K as r,U as d,R as p,F as f,B as h,Q as N,g as x,u as O}from"./4pHoJ_J-.js";const V={key:0,class:"min-h-screen bg-surface flex items-center justify-center"},G={key:1,class:"min-h-screen bg-surface flex"},H={class:"hidden lg:flex flex-col w-56 bg-white border-r shrink-0"},$={class:"p-3"},B={class:"text-xs text-text-secondary"},L={class:"flex-1 p-4 lg:p-8 overflow-auto"},X={class:"flex items-center justify-between mb-6"},F={key:0,class:"bg-white rounded-2xl shadow-sm border p-6 mb-6 space-y-4"},j={class:"grid md:grid-cols-2 gap-4"},J=["value"],W=["value"],z={class:"md:col-span-2"},K={class:"flex gap-3"},Q=["disabled"],Y={class:"bg-white rounded-2xl shadow-sm border overflow-hidden"},q={key:0,class:"p-8 text-center text-text-secondary"},Z={key:1,class:"w-full text-sm"},ee={class:"px-4 py-3 font-mono text-xs"},te={class:"px-4 py-3"},se={class:"px-4 py-3 text-xs"},le={class:"px-4 py-3"},oe={class:"px-4 py-3 text-xs"},ne={class:"px-4 py-3 text-xs text-text-secondary"},ae={class:"px-4 py-3"},re={class:"flex gap-1 flex-wrap"},de=["onClick"],ie=["onClick"],ue=["onClick"],ce=["onClick"],be=P({__name:"applications",setup(pe){const E=u([]),S=u(!0),_=u(!1),c=u(!1),y=u(!1),l=u({patientId:"",serviceType:"HOME_CARE",channel:"WECHAT",contactName:"",contactPhone:"",address:"",regionCode:"441402001",notes:""}),A=[{v:"HOME_CARE",label:"居家护理"},{v:"REHABILITATION",label:"康复训练"},{v:"BATH_ASSIST",label:"助浴服务"},{v:"ASSESSMENT",label:"能力评估"}],k=["WECHAT","APP","PHONE","COMMUNITY","HOSPITAL"],w={DRAFT:"草稿",PENDING_ACCEPTANCE:"待受理",PENDING_ASSESSMENT:"待评估",ASSESSING:"评估中",ASSESSMENT_PASSED:"已评估",RETURNED:"已退回",CANCELLED:"已取消",REVIEWING:"复核中"},T={DRAFT:"bg-gray-100",PENDING_ACCEPTANCE:"bg-yellow-50 text-yellow-700",PENDING_ASSESSMENT:"bg-blue-50 text-blue-600",ASSESSING:"bg-indigo-50 text-indigo-600",ASSESSMENT_PASSED:"bg-green-50 text-green-600",RETURNED:"bg-red-50 text-red-600"};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 t=JSON.parse(localStorage.getItem("hss_platform_user")||"{}");t.userRole&&(o["X-User-Role"]=t.userRole,o["X-User-Id"]=t.userId)}catch{}return o}async function m(o,t={}){const i={...C(),"Idempotency-Key":"web-"+Date.now()+"-"+Math.random().toString(36).slice(2,6)};return await $fetch("/api/hss"+o,{...t,headers:{...i,...t.headers||{}}})}async function v(){try{const o=await m("/applications?page=1&size=30");E.value=o?.data?.records||o?.data||[]}catch{}}async function I(){y.value=!0;try{await m("/applications",{method:"POST",body:JSON.stringify(l.value)}),c.value=!1,await v()}catch(o){alert(o?.data?.message||o?.message||"创建失败")}finally{y.value=!1}}async function b(o,t,i){try{await m(`/applications/${o}/${t}`,{method:"POST",body:i?JSON.stringify(i):void 0}),await v()}catch(s){alert(s?.data?.message||s?.message||"操作失败")}}return R(()=>{_.value=!0,v().finally(()=>S.value=!1)}),(o,t)=>{const i=D;return n(),U(i,null,{default:M(()=>[_.value?(n(),a("div",G,[e("aside",H,[t[10]||(t[10]=e("div",{class:"p-4 border-b"},[e("a",{href:"/platform",class:"font-bold text-primary text-sm"},"← 返回工作台")],-1)),e("div",$,[e("div",B,"角色: "+r(C()["X-User-Role"]),1)])]),e("main",L,[e("div",X,[t[11]||(t[11]=e("h2",{class:"text-xl font-bold"},"服务申请管理",-1)),e("button",{onClick:t[0]||(t[0]=s=>c.value=!c.value),class:"px-4 py-2 bg-primary text-white rounded-lg text-sm font-medium hover:bg-primary-700"},"+ 新建申请")]),c.value?(n(),a("div",F,[t[19]||(t[19]=e("h3",{class:"font-bold"},"新建服务申请",-1)),e("div",j,[e("div",null,[t[12]||(t[12]=e("label",{class:"text-xs text-text-secondary block mb-1"},"服务对象ID",-1)),d(e("input",{"onUpdate:modelValue":t[1]||(t[1]=s=>l.value.patientId=s),class:"w-full px-3 py-2 border rounded-lg text-sm outline-none focus:border-primary",placeholder:"如 2001"},null,512),[[p,l.value.patientId]])]),e("div",null,[t[13]||(t[13]=e("label",{class:"text-xs text-text-secondary block mb-1"},"服务类型",-1)),d(e("select",{"onUpdate:modelValue":t[2]||(t[2]=s=>l.value.serviceType=s),class:"w-full px-3 py-2 border rounded-lg text-sm outline-none focus:border-primary"},[(n(),a(f,null,h(A,s=>e("option",{key:s.v,value:s.v},r(s.label),9,J)),64))],512),[[N,l.value.serviceType]])]),e("div",null,[t[14]||(t[14]=e("label",{class:"text-xs text-text-secondary block mb-1"},"渠道",-1)),d(e("select",{"onUpdate:modelValue":t[3]||(t[3]=s=>l.value.channel=s),class:"w-full px-3 py-2 border rounded-lg text-sm outline-none focus:border-primary"},[(n(),a(f,null,h(k,s=>e("option",{key:s,value:s},r(s),9,W)),64))],512),[[N,l.value.channel]])]),e("div",null,[t[15]||(t[15]=e("label",{class:"text-xs text-text-secondary block mb-1"},"联系人",-1)),d(e("input",{"onUpdate:modelValue":t[4]||(t[4]=s=>l.value.contactName=s),class:"w-full px-3 py-2 border rounded-lg text-sm outline-none focus:border-primary",placeholder:"姓名"},null,512),[[p,l.value.contactName]])]),e("div",null,[t[16]||(t[16]=e("label",{class:"text-xs text-text-secondary block mb-1"},"电话",-1)),d(e("input",{"onUpdate:modelValue":t[5]||(t[5]=s=>l.value.contactPhone=s),class:"w-full px-3 py-2 border rounded-lg text-sm outline-none focus:border-primary",placeholder:"手机号"},null,512),[[p,l.value.contactPhone]])]),e("div",null,[t[17]||(t[17]=e("label",{class:"text-xs text-text-secondary block mb-1"},"区域",-1)),d(e("input",{"onUpdate:modelValue":t[6]||(t[6]=s=>l.value.regionCode=s),class:"w-full px-3 py-2 border rounded-lg text-sm outline-none focus:border-primary",placeholder:"441402001"},null,512),[[p,l.value.regionCode]])]),e("div",z,[t[18]||(t[18]=e("label",{class:"text-xs text-text-secondary block mb-1"},"地址",-1)),d(e("input",{"onUpdate:modelValue":t[7]||(t[7]=s=>l.value.address=s),class:"w-full px-3 py-2 border rounded-lg text-sm outline-none focus:border-primary",placeholder:"详细地址"},null,512),[[p,l.value.address]])])]),e("div",K,[e("button",{onClick:I,disabled:y.value,class:"px-6 py-2 bg-primary text-white rounded-lg text-sm font-medium disabled:opacity-50"},r(y.value?"提交中...":"提交申请"),9,Q),e("button",{onClick:t[8]||(t[8]=s=>c.value=!1),class:"px-6 py-2 border rounded-lg text-sm"},"取消")])])):x("",!0),e("div",Y,[S.value?(n(),a("div",q,"加载中...")):(n(),a("table",Z,[t[20]||(t[20]=e("thead",null,[e("tr",{class:"bg-gray-50 text-left text-xs text-text-secondary"},[e("th",{class:"px-4 py-3"},"ID"),e("th",{class:"px-4 py-3"},"对象"),e("th",{class:"px-4 py-3"},"类型"),e("th",{class:"px-4 py-3"},"状态"),e("th",{class:"px-4 py-3"},"联系人"),e("th",{class:"px-4 py-3"},"时间"),e("th",{class:"px-4 py-3"},"操作")])],-1)),e("tbody",null,[(n(!0),a(f,null,h(E.value,s=>(n(),a("tr",{key:s.id,class:"border-t border-gray-50 hover:bg-gray-50"},[e("td",ee,"#"+r(s.id),1),e("td",te,r(s.patientId),1),e("td",se,r(s.serviceType),1),e("td",le,[e("span",{class:O(["px-2 py-0.5 rounded-full text-xs font-medium",T[s.status]||"bg-gray-100"])},r(w[s.status]||s.status),3)]),e("td",oe,r(s.contactName||"-"),1),e("td",ne,r(s.createdAt?.substring(0,16)||"-"),1),e("td",ae,[e("div",re,[s.status==="DRAFT"?(n(),a("button",{key:0,onClick:g=>b(s.id,"submit"),class:"px-2 py-1 bg-blue-50 text-blue-600 rounded text-xs hover:bg-blue-100"},"提交",8,de)):x("",!0),s.status==="PENDING_ACCEPTANCE"?(n(),a("button",{key:1,onClick:g=>b(s.id,"accept"),class:"px-2 py-1 bg-green-50 text-green-600 rounded text-xs hover:bg-green-100"},"受理",8,ie)):x("",!0),s.status==="PENDING_ACCEPTANCE"?(n(),a("button",{key:2,onClick:g=>b(s.id,"return",{reason:"退回原因"}),class:"px-2 py-1 bg-red-50 text-red-600 rounded text-xs hover:bg-red-100"},"退回",8,ue)):x("",!0),["CANCELLED","RETURNED"].includes(s.status)?x("",!0):(n(),a("button",{key:3,onClick:g=>b(s.id,"cancel"),class:"px-2 py-1 bg-gray-50 text-gray-500 rounded text-xs hover:bg-gray-100"},"取消",8,ce))])])]))),128))])]))])])])):(n(),a("div",V,[...t[9]||(t[9]=[e("p",{class:"text-text-secondary"},"加载中...",-1)])]))]),_:1})}}});export{be as default};
|