import{h as a,o as e,d as s,w as t,e as l,f as u,u as n,a as d,t as i,l as c,c as o,j as _,F as r,g as f,k as m,s as p,x as v,y as g}from"./index-4574ca9e.js";import{_ as b}from"./uni-datetime-picker.1dd0594b.js";import{_ as h,o as k,r as w}from"./uni-app.es.952bcabe.js";import{G as x,a as j}from"./index.eefdbc54.js";const y=h({__name:"PlanList",setup(h){let y=a({date:""}),C=a([]),I=a(null);const L=()=>{x({...y.value}).then((a=>{a.status&&(C.value=a.data.plan_list,I.value=a.data.mainInfo,y.value.mainlistid=[I.value.id])}))},M=a=>{y.value.date=a,L()};return k((a=>{y.value=JSON.parse(decodeURIComponent(a.data));var e,s=new Date;y.value.date=(e=s).getFullYear()+"-"+("0"+(e.getMonth()+1)).slice(-2)+"-"+("0"+e.getDate()).slice(-2),L()})),(a,h)=>{const k=l,x=w(f("uni-datetime-picker"),b);return e(),s(k,{class:"PlanListMain"},{default:t((()=>[u(k,{class:"head"}),n(I)?(e(),s(k,{key:0,class:"userInfo"},{default:t((()=>[u(k,{class:"title"},{default:t((()=>[d("选择预约日期及时段")])),_:1}),u(k,{class:"row"},{default:t((()=>[u(k,{class:"label"},{default:t((()=>[d("登记号：")])),_:1}),u(k,{class:"value"},{default:t((()=>[d(i(n(I).reg_num),1)])),_:1})])),_:1}),u(k,{class:"row"},{default:t((()=>[u(k,{class:"label"},{default:t((()=>[d("医嘱：")])),_:1}),u(k,{class:"value"},{default:t((()=>[d(i(n(I).entrust),1)])),_:1})])),_:1}),u(k,{class:"date"},{default:t((()=>[u(k,{class:"datetime"},{default:t((()=>[u(x,{modelValue:n(y).date,"onUpdate:modelValue":h[0]||(h[0]=a=>n(y).date=a),"clear-icon":!1,type:"date",onChange:M},null,8,["modelValue"])])),_:1})])),_:1})])),_:1})):c("",!0),u(k,{class:"list"},{default:t((()=>[(e(!0),o(r,null,_(n(C),((a,l)=>(e(),s(k,{class:"info"},{default:t((()=>[u(k,null,{default:t((()=>[u(k,{class:"row"},{default:t((()=>[u(k,{class:"label"},{default:t((()=>[d("执行科室：")])),_:1}),u(k,{class:"value"},{default:t((()=>[d(i(n(I).implement_department),1)])),_:1})])),_:1}),u(k,{class:"row"},{default:t((()=>[u(k,{class:"label"},{default:t((()=>[d("资源：")])),_:1}),u(k,{class:"value"},{default:t((()=>[d(i(a.department_resources_name),1)])),_:2},1024)])),_:2},1024),u(k,{class:"row"},{default:t((()=>[u(k,{class:"label"},{default:t((()=>[d("时间段：")])),_:1}),a.begin_time?(e(),s(k,{key:0,class:"value"},{default:t((()=>[d(i(a.begin_time.substring(0,5))+"~"+i(a.end_time.substring(0,5)),1)])),_:2},1024)):c("",!0)])),_:2},1024)])),_:2},1024),u(k,{class:"right"},{default:t((()=>[u(k,{class:"right_top"},{default:t((()=>[u(k,{class:"button",onClick:e=>(a=>{p({cancelText:"取消",confirmText:"确定",title:"提示",content:"确定预约 "+y.value.date+" "+a.begin_time.substring(0,5)+"~"+a.end_time.substring(0,5)+" 时段吗？",success:function(e){e.confirm&&(y.value.planid=a.id,j({...y.value}).then((a=>{a.status&&(v({title:"预约成功"}),setTimeout((function(){g({url:"/pages/CheckItemMainList"})}),1e3))})))}})})(a)},{default:t((()=>[d("确认")])),_:2},1032,["onClick"])])),_:2},1024),u(k,{class:"right_bottom"},{default:t((()=>[d("已约/总数："),m("span",{style:{color:"darkturquoise"}},i(a.used_count),1),d("/"+i(a.count),1)])),_:2},1024)])),_:2},1024)])),_:2},1024)))),256))])),_:1})])),_:1})}}},[["__scopeId","data-v-e1ec9a04"]]);export{y as default};
