import{h as e,o as a,d as t,w as s,e as l,f as n,u,a as i,t as o,c as d,j as _,k as c,F as r,g as f,l as m,p,s as g}from"./index-efa985d2.js";import{_ as k}from"./uni-datetime-picker.aa655e0f.js";import{_ as v,o as h,r as y}from"./uni-app.es.b82cb7d4.js";import{E as b,H as w}from"./index.61e14a97.js";const C=v({__name:"CheckItemMainList",setup(v){let C=e({dateRange:["2021-05-01","2049-01-01"]}),M=e([]);const x=()=>{b({searchInfo:C.value}).then((e=>{console.log(e),e.status&&(M.value=e.data.list)}))},D=e=>{C.value.dateRange=e,x()},I=(e,a)=>{let t={do_type:e,appointment_type:2,regnum:a.reg_num,entrustid:[a.entrust_id],episodeid:a.episodeid};p({url:"/pages/PlanList?data="+encodeURIComponent(JSON.stringify(t))})};return h((()=>{var e=function(){var e=new Date;function a(e){return e.getFullYear()+"-"+("0"+(e.getMonth()+1)).slice(-2)+"-"+("0"+e.getDate()).slice(-2)}var t,s=a(e),l=a((t=e,new Date(t.getFullYear(),t.getMonth()-1,t.getDate()))),n=a(function(e){return new Date(e.getFullYear(),e.getMonth()+1,e.getDate())}(e));return{currentDate:s,previousMonth:l,nextMonth:n}}();C.value.dateRange=[e.previousMonth,e.nextMonth],x()})),(e,p)=>{const v=l,h=y(f("uni-datetime-picker"),k);return a(),t(v,{class:"CheckItemMain"},{default:s((()=>[n(v,{class:"head"}),u(M).length>0?(a(),t(v,{key:0,class:"userInfo"},{default:s((()=>[n(v,{class:"title"},{default:s((()=>[i("患者信息")])),_:1}),n(v,{class:"row"},{default:s((()=>[n(v,{class:"label"},{default:s((()=>[i("姓名：")])),_:1}),n(v,{class:"value"},{default:s((()=>[i(o(u(M)[0].user_name),1)])),_:1})])),_:1}),n(v,{class:"row"},{default:s((()=>[n(v,{class:"label"},{default:s((()=>[i("性别：")])),_:1}),n(v,{class:"value"},{default:s((()=>[1==u(M)[0].user_sex?(a(),d("span",{key:0},"男")):_("",!0),2==u(M)[0].user_sex?(a(),d("span",{key:1},"女")):_("",!0)])),_:1})])),_:1}),n(v,{class:"row"},{default:s((()=>[n(v,{class:"label"},{default:s((()=>[i("手机号：")])),_:1}),n(v,{class:"value"},{default:s((()=>[i(o(u(M)[0].user_phone),1)])),_:1})])),_:1}),n(v,{class:"row"},{default:s((()=>[n(v,{class:"label"},{default:s((()=>[i("注册号：")])),_:1}),n(v,{class:"value"},{default:s((()=>[i(o(u(M)[0].reg_num),1)])),_:1})])),_:1}),n(v,{class:"date"},{default:s((()=>[n(v,{class:"datetime"},{default:s((()=>[n(h,{modelValue:u(C).dateRange,"onUpdate:modelValue":p[0]||(p[0]=e=>u(C).dateRange=e),type:"daterange",onChange:D},null,8,["modelValue"])])),_:1})])),_:1})])),_:1})):_("",!0),u(M).length>0?(a(),t(v,{key:1,class:"list"},{default:s((()=>[(a(!0),d(r,null,c(u(M),((e,l)=>(a(),t(v,{class:"info"},{default:s((()=>[n(v,{class:"item_title"},{default:s((()=>[i("检查项目："+o(e.entrust),1)])),_:2},1024),n(v,{class:"item_info"},{default:s((()=>[n(v,null,{default:s((()=>[i("医嘱时间："),m("span",{class:"item_value"},o(e.entrust_date),1)])),_:2},1024),n(v,null,{default:s((()=>[i("申请科室："),m("span",{class:"item_value"},o(e.reservation_department),1)])),_:2},1024),n(v,null,{default:s((()=>[i("状态： "),0==e.list_status?(a(),d("span",{key:0,class:"item_value"},"待申请")):_("",!0),1==e.list_status?(a(),d("span",{key:1,class:"item_value"},"已预约")):_("",!0),2==e.list_status?(a(),d("span",{key:2,class:"item_value"},"已登记")):_("",!0),3==e.list_status?(a(),d("span",{key:3,class:"item_value"},"已完成")):_("",!0)])),_:2},1024),1==e.list_status?(a(),t(v,{key:0},{default:s((()=>[i("预约时段："),m("span",{class:"item_value"},o(e.reservation_date)+" "+o(e.period_begin_time.substring(0,5))+"~"+o(e.period_end_time.substring(0,5)),1)])),_:2},1024)):_("",!0),0==e.list_status?(a(),t(v,{key:1,class:"button_row"},{default:s((()=>[n(v,{class:"button",onClick:a=>I(1,e)},{default:s((()=>[i("预 约")])),_:2},1032,["onClick"])])),_:2},1024)):_("",!0),1==e.list_status?(a(),t(v,{key:2,class:"button_row"},{default:s((()=>[n(v,{class:"button red",onClick:a=>(e=>{g({cancelText:"取消",confirmText:"确定",title:"提示",content:"确定取消预约吗？",success:function(a){a.confirm&&w({MainListId:e.id}).then((e=>{console.log(e),e.status&&x()}))}})})(e)},{default:s((()=>[i("取 消")])),_:2},1032,["onClick"]),n(v,{class:"button blue",onClick:a=>I(2,e)},{default:s((()=>[i("改 约")])),_:2},1032,["onClick"])])),_:2},1024)):_("",!0)])),_:2},1024)])),_:2},1024)))),256))])),_:1})):(a(),t(v,{key:2,class:"nodata"},{default:s((()=>[i(" 暂无记录 ")])),_:1}))])),_:1})}}},[["__scopeId","data-v-765acc77"]]);export{C as default};
