You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

4 lines
48 KiB
JavaScript

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

import{_ as bt,Y as ze,o as yt,r as J,c as vt,d as E,e as N,i as x,k as C,v as M,q as V,x as B,j as Q,w as h,h as Ge,f as b,F as De,t as Ie,Z as Ae,l as j,y as Te,g as k,$ as wt,E as $,a0 as St,a1 as kt,a2 as ce,N as se,a3 as Et,a4 as qe,a5 as Ct,a6 as Dt}from"./index-beddc4e2.js";const It={class:"YuYue202506"},Tt={key:0,class:"patientInfo"},Nt={class:"item"},Mt={class:"name"},Vt={class:"item"},Bt={class:"value"},Rt={class:"item"},Pt={class:"value"},zt={key:0,class:"item"},Yt={class:"value"},Ot={key:1,class:"item"},$t={class:"value"},Lt={key:2,class:"item"},Ut={class:"value"},jt={key:1},Ht={style:{"font-weight":"700",color:"#e6a23c"}},Jt={style:{"font-weight":"700",color:"#e6a23c"}},Ft={class:"entrustList"},Gt={key:0,style:{"font-size":"12px",color:"#909399"}},At={style:{"margin-right":"4px",color:"#999"}},qt={key:0,class:"errMsg"},Wt={key:1},Zt={key:0},Kt={key:1},Qt={key:0,style:{color:"orangered"}},Xt={key:1},ed={key:0},td={key:0},dd={key:1},nd={class:"planInfo"},sd={style:{display:"flex","justify-content":"space-between","align-items":"center","margin-top":"8px","margin-bottom":"8px"}},ad={style:{display:"flex","align-items":"center"}},id=["onClick"],ld={style:{display:"flex","flex-direction":"column","margin-left":"12px"}},od={style:{border:"1px solid #efefef"}},rd={class:"planTable"},ud={key:0,style:{"background-color":"#f1f1f1"}},pd={style:{"font-weight":"700"}},_d=["onClick"],md={key:0},cd={key:0},fd={key:1,style:{"background-color":"#fff"}},gd={class:"dialog-footer"},xd={style:{display:"flex","align-items":"flex-start",gap:"12px"}},hd=["innerHTML"],bd={style:{display:"flex","align-items":"flex-start",gap:"12px"}},yd=["innerHTML"],vd={style:{display:"flex","align-items":"flex-start",gap:"12px"}},wd=["innerHTML"],Sd={style:{display:"flex","align-items":"flex-start",gap:"12px"}},kd=["innerHTML"],Ed=`1.未预约状态,如果多个检查项目能在同一个检查室进行检查,系统会自动选中能一起预约的项目,只需要点击一次预约按钮即可完成预约
2.已预约状态,预约到同一个时段的同一个检查室的项目,系统会自动选中,更改预约或取消预约只需点击一次
3.不同状态的预约的预约项目无法一起选中`,Cd={__name:"YuYue202506",props:{reg_num:{type:String},entrust_ids:{type:String},episode_id:{type:String},appointment_type:{type:[String,Number]},dotype:{type:Number},do_user:{default:"",type:[String,Number]},special_privileges:{type:Array,default:()=>[]},scope:{type:String,default:"all"}},setup(We){const S=We;let L=k(null),Y=k(null),_=k([]);const le=s=>s?s.requestComment?`${s.entrust}${s.requestComment}`:s.entrust:"";let ae=k([]),X=k(!1),O=k(!1),ne=k(["1"]),Ne=k(!0),fe=k([]),R=k(""),P=k(0),z=k([]),U=k([]),y=k([]),A=k(!0),ge=k([]),q=k([]),xe=k("add"),ie=k(""),he=k([]),be=k([]),oe=k([]),Ze=k(0),Ye=k(!1),re=k(!0),Me=k(""),Ve=k(""),ee=k(!1),F=k(!1),ue=k(""),pe=k(null),_e=k(null),te=k(!1),Oe=k(""),de=k(!1),$e=k(""),W=k(!1),ye=k("");const Ke=s=>{let e=["周日","周一","周二","周三","周四","周五","周六"];const d=new Date(s).getDay();return e[d]},Le=ze(()=>{const s=y.value.map(d=>{var a;return(a=d.department_resources)==null?void 0:a.department_resources_name}).filter(Boolean),e=[...new Set(s)];if(e.length!==1)return 0;const t=e[0];return _.value.filter(d=>{var a;return((a=d.department_resources)==null?void 0:a.department_resources_name)===t}).length}),Ue=ze(()=>S.special_privileges.includes("emergency")),Qe=ze(()=>{const s=_.value.filter(t=>!!(t.list_status===1&&t.reservation_date||t.list_status===0&&t.temp_plan_id&&t.reservation_date));return s.length<2?!1:new Set(s.map(t=>t.reservation_date)).size>1});let ve=null;const Xe=()=>{ve&&clearTimeout(ve),ve=setTimeout(()=>{K(),ve=null},500)},et=s=>{var t,d,a,i,l,n,r,m,p,f;if(z.value=[],U.value=[],fe.value=[],ae.value=[],R.value="",y.value=s,console.log("11111",y.value),y.value.forEach((g,v)=>{z.value.push(g.id),U.value.push(g.entrust_id)}),y.value.every(g=>{var v;return g.roster_id===((v=y.value[0])==null?void 0:v.roster_id)}))P.value=(t=y.value[0])==null?void 0:t.roster_id,P.value!==0&&P.value&&(ie.value=(d=y.value[0])==null?void 0:d.reservation_date,xt(Je(),(a=y.value[0])==null?void 0:a.reservation_date)&&((i=y.value[0])!=null&&i.reservation_date)?Z.value=ke((l=y.value[0])==null?void 0:l.reservation_date):Z.value=ke(Je()),R.value=(r=(n=y.value[0])==null?void 0:n.department_resources)==null?void 0:r.department_resources_name);else if(P.value=0,y.value.length>0){const g=(p=(m=y.value[0])==null?void 0:m.department_resources)==null?void 0:p.execute_department_id;if(g&&y.value.every(c=>{var D;return((D=c.department_resources)==null?void 0:D.execute_department_id)===g})){const c=(f=y.value[0].department_resources)==null?void 0:f.department_resources_name;c&&(R.value=c)}}ge.value.forEach(g=>{y.value.find(v=>v===g)||(xe.value="cancel")}),y.value.length==0&&(xe.value="add",ge.value=[]),console.log(xe.value),U.value.length>0&&A.value&&(xe.value==="add"&&y.value[0].list_status==0?re.value?at():K():Xe()),pe.value&&_.value.findIndex(v=>z.value.includes(v.id))+1===pe.value.idx&&(ue.value=pe.value.html,F.value=!0,pe.value=null),_e.value&&_.value.findIndex(v=>z.value.includes(v.id))+1===_e.value.idx&&(ye.value=_e.value.html,W.value=!0,_e.value=null),tt()},tt=()=>{var t,d;if(y.value.length===0){Ne.value=!0;return}const s=(d=(t=y.value[0])==null?void 0:t.department_resources)==null?void 0:d.execute_department_id;if(s==null){Ne.value=!0;return}const e=y.value.every(a=>{var i;return((i=a.department_resources)==null?void 0:i.execute_department_id)===s});Ne.value=!e},dt=s=>y.value.findIndex(e=>e.id===s.id)>-1,nt=({row:s,rowIndex:e})=>{if(s.tishi_msg!="")return"disabled-row";if(dt(s))return"selected-row"},st=(s,e)=>s.tishi_msg=="";let we=k([]);const Se=(s,e)=>{let t=z.value;_.value=[],X.value=!0,wt({regnum:S.reg_num,entrustid:S.entrust_ids,episodeid:S.episode_id,appointment_type:S.appointment_type}).then(d=>{var a;if(X.value=!1,d.status){if(d.data.info.length>0){let i=d.data.info;if(Y.value=i[0].maininfo,i.forEach((l,n)=>{var m,p;let r=l.maininfo;r.tishi_msg=l.msg,r.limosis=(m=l.iteminfo[0])==null?void 0:m.limosis,_.value.push(r),l.msg!=""&&l.msg!=null&&we.value.push({msg:l.msg,item_name:(p=l.iteminfo[0])==null?void 0:p.item_name})}),d.data.no_appointment_dept&&d.data.no_appointment_dept.length>0){const l=[...new Set(d.data.no_appointment_dept.map(r=>r.resource_name))],n=[...new Set(d.data.no_appointment_dept.map(r=>r.item_name))];Me.value="注意:"+l.join("")+"下属的"+n.join("")+"项目属于不用预约项目!"}if(d.data.no_schedule&&d.data.no_schedule.length>0){const l=[...new Set(d.data.no_schedule.map(r=>r.resource_name))],n=[...new Set(d.data.no_schedule.map(r=>r.item_name))];Ve.value="注意:"+l.join("")+"下属的"+n.join("")+"项目未配置排班计划,请联系检查室!"}if(t.length>0&&!e)t.forEach((l,n)=>{_.value.forEach((r,m)=>{l==r.id&&L.value.toggleRowSelection(_.value[m],!0)})});else{for(let l=0;l<_.value.length;l++)if(_.value[l].tishi_msg==""&&_.value[l].list_status===0){L.value.toggleRowSelection(_.value[l],!0);const n=(a=_.value[l].department_resources)==null?void 0:a.department_resources_name;n&&_.value.forEach(r=>{var m;r.id!==_.value[l].id&&r.list_status===0&&r.tishi_msg===""&&((m=r.department_resources)==null?void 0:m.department_resources_name)===n&&L.value.toggleRowSelection(r,!0)}),_.value[l].roster_id!=null&&(P.value=_.value[l].roster_id,R.value=n);break}if(z.value.length===0){const l=_.value.find(n=>n.tishi_msg==="");l&&(A.value=!1,e&&t.length>0?t.forEach(n=>{const r=_.value.find(m=>m.id===n);r&&L.value.toggleRowSelection(r,!0)}):L.value.toggleRowSelection(l,!0),A.value=!0)}}Pe.value&&(Pe.value=!1,we.value.length>0&&(console.log("22222222222222",we.value),ee.value=!0)),be.value=JSON.parse(JSON.stringify(_.value)),s&&s()}}else $.error(d.msg)})},at=()=>{let s=[],e=y.value.length;if(y.value[e-1].list_status!=0)return!1;_.value.forEach((t,d)=>{t.list_status==0&&t.tishi_msg==""&&(t.id==y.value[e-1].id?s.push({name:t.entrust,rowid:d,first:1}):s.push({name:t.entrust,rowid:d,first:0}))}),s.length>=2?(X.value=!0,St({items:s}).then(t=>{X.value=!1,t.status?(s.forEach((a,i)=>{A.value=!1,L.value.toggleRowSelection(_.value[a.rowid],!1)}),t.data.rowids.forEach((a,i)=>{A.value=!1,L.value.toggleRowSelection(_.value[a],!0)}),ge.value=y.value,K()):$.error(t.msg),A.value=!0})):(ge.value=y.value,K())};let Z=k([]);const K=()=>{if(U.value.length==0)return $.error("请选择检查项目"),!1;O.value=!0,kt({regnum:S.reg_num,entrustid:U.value,episodeid:S.episode_id,appointment_type:S.appointment_type,date:Z.value,scope:S.scope,do_user:S.do_user}).then(s=>{if(O.value=!1,ae.value=[],fe.value=[],s.status){let e=s.data.plan_list,t=s.data.zhanWeiCount,d=s.data.is_emergency;if(oe.value=e,Ze.value=t,e.length>0){e.some(m=>m.department_resources_name===R.value)||(R.value=e[0].department_resources_name);const i=new Set,l=new Set;e.forEach(m=>{if(m.department_resources_name==R.value){const p=`${m.begin_time.substring(0,5)}-${m.end_time.substring(0,5)}`;i.add(p)}l.add(m.department_resources_name)}),fe.value=l,Array.from(i).sort().forEach(m=>{const p={time_range:m};Z.value.forEach(f=>{const g=e.find(c=>`${c.begin_time.substring(0,5)}-${c.end_time.substring(0,5)}`===m&&c.date===f&&c.department_resources_name==R.value);let v=!1;g?(g.plan_enable===!0&&(v=!0),d===!0&&g.plan_enable===!0&&Ue.value==!0&&(v=!0),p[f]={use_count:`${g.used_count}/${g.count}`,id:g.id,enable:v}):p[f]={use_count:"0/0",id:null,enable:v}}),ae.value.push(p)}),P.value=0;const r=je();if(r.length>0)q.value=r,P.value=r[0];else{q.value=[];const m=e.find(p=>p.department_resources_name==R.value&&p.plan_enable===!0);m&&(P.value=m.id)}if(!Ye.value){Ye.value=!0;const m=_.value.filter(p=>p.list_status===0);if(m.length>0){const p=m.map(f=>{var g;return{id:f.id,entrust_id:f.entrust_id,department_resources_name:((g=f.department_resources)==null?void 0:g.department_resources_name)||"",date:f.reservation_date||"",begin_time:f.period_begin_time||"",end_time:f.period_end_time||""}});ce({type:"optimal_time",regnum:S.reg_num,entrustid:U.value,episodeid:S.episode_id,appointment_type:S.appointment_type,items:p,scope:S.scope,do_user:S.do_user}).then(f=>{if(f.status){f.data.forEach(u=>{const w=_.value.find(T=>T.id===u.id);w&&(w.department_resources||(w.department_resources={}),w.department_resources.department_resources_name=u.department_resources_name,w.reservation_date=u.date,w.period_begin_time=u.begin_time,w.period_end_time=u.end_time,w.temp_plan_id=u.plan_id)});const g={};f.data.forEach(u=>{var T,H;const w=u.department_resources_name;g[w]||(g[w]={items:[],timeSlots:new Set,dates:new Set}),g[w].items.push(u),g[w].timeSlots.add(((T=u.begin_time)==null?void 0:T.substring(0,5))+"-"+((H=u.end_time)==null?void 0:H.substring(0,5))),g[w].dates.add(u.date)});const v=[];for(const[u,w]of Object.entries(g))(w.timeSlots.size>1||w.dates.size>1)&&w.items.forEach(T=>{var Ee,I;const H=_.value.findIndex(G=>G.id===T.id);v.push({idx:H!==-1?H+1:"",room:T.department_resources_name,date:T.date,timeSlot:((Ee=T.begin_time)==null?void 0:Ee.substring(0,5))+"-"+((I=T.end_time)==null?void 0:I.substring(0,5)),entrust:le(_.value.find(G=>G.id===T.id))})});if(v.length>0){let u='<table style="width:100%;border-collapse:collapse;font-size:14px;">';u+='<tr style="background:#d5dce6;"><td style="padding:4px 8px;border:1px solid #ddd;font-weight:700;">序号</td><td style="padding:4px 8px;border:1px solid #ddd;font-weight:700;">项目名称</td><td style="padding:4px 8px;border:1px solid #ddd;font-weight:700;">检查室</td><td style="padding:4px 8px;border:1px solid #ddd;font-weight:700;">日期</td><td style="padding:4px 8px;border:1px solid #ddd;font-weight:700;">时间段</td></tr>';let w="",T="#f5f5f5";v.sort((I,G)=>I.idx-G.idx).forEach(I=>{I.timeSlot!==w&&(T=T==="#fff"?"#d5dce6":"#fff",w=I.timeSlot),u+='<tr style="background:'+T+';"><td style="padding:4px 8px;border:1px solid #ddd;">'+I.idx+'</td><td style="padding:4px 8px;border:1px solid #ddd;">'+I.entrust+'</td><td style="padding:4px 8px;border:1px solid #ddd;">'+I.room+'</td><td style="padding:4px 8px;border:1px solid #ddd;">'+I.date+'</td><td style="padding:4px 8px;border:1px solid #ddd;">'+I.timeSlot+"</td></tr>"}),u+="</table>";const H=Math.min(...v.map(I=>I.idx));_.value.findIndex(I=>z.value.includes(I.id))+1===H?(ue.value=u,F.value=!0):pe.value={html:u,idx:H}}const c=new Set(f.data.map(u=>u.id)),D=p.filter(u=>!c.has(u.id));if(D.length>0){let u='<table style="width:100%;border-collapse:collapse;font-size:14px;">';u+='<tr style="background:#d5dce6;"><td style="padding:4px 8px;border:1px solid #ddd;font-weight:700;">序号</td><td style="padding:4px 8px;border:1px solid #ddd;font-weight:700;">项目名称</td><td style="padding:4px 8px;border:1px solid #ddd;font-weight:700;">排班资源</td><td style="padding:4px 8px;border:1px solid #ddd;font-weight:700;">日期</td><td style="padding:4px 8px;border:1px solid #ddd;font-weight:700;">时间段</td><td style="padding:4px 8px;border:1px solid #ddd;font-weight:700;">结果</td></tr>';let w=1;f.data.forEach(I=>{var me,Ce,Fe;const G=((me=_.value.find(ht=>ht.id===I.id))==null?void 0:me.entrust)||"";u+='<tr><td style="padding:4px 8px;border:1px solid #ddd;">'+w+++'</td><td style="padding:4px 8px;border:1px solid #ddd;">'+G+'</td><td style="padding:4px 8px;border:1px solid #ddd;">'+I.department_resources_name+'</td><td style="padding:4px 8px;border:1px solid #ddd;">'+I.date+'</td><td style="padding:4px 8px;border:1px solid #ddd;">'+((Ce=I.begin_time)==null?void 0:Ce.substring(0,5))+"-"+((Fe=I.end_time)==null?void 0:Fe.substring(0,5))+'</td><td style="padding:4px 8px;border:1px solid #ddd;color:green;">✅ 成功匹配</td></tr>'}),D.forEach(I=>{var me;const G=((me=_.value.find(Ce=>Ce.id===I.id))==null?void 0:me.entrust)||"";u+='<tr><td style="padding:4px 8px;border:1px solid #ddd;">'+w+++'</td><td style="padding:4px 8px;border:1px solid #ddd;">'+G+'</td><td style="padding:4px 8px;border:1px solid #ddd;" colspan="3">—</td><td style="padding:4px 8px;border:1px solid #ddd;color:red;">❌ 未找到合适号源</td></tr>'}),u+="</table>";const T=D.map(I=>_.value.findIndex(G=>G.id===I.id)+1).filter(I=>I>0),H=Math.min(...T);_.value.findIndex(I=>z.value.includes(I.id))+1===H?(ye.value=u,W.value=!0):_e.value={html:u,idx:H}}const o=je();o.length>0&&(q.value=o,P.value=o[0])}})}}}}else $.error(s.msg)})},it=s=>{R.value=s,P.value=0,q.value=[],K()},je=()=>{const s=[];for(const e of _.value)if(z.value.includes(e.id)&&e.list_status===0&&e.temp_plan_id){const t=oe.value.find(d=>d.id===e.temp_plan_id&&d.department_resources_name===R.value);t&&!s.includes(t.id)&&s.push(t.id)}for(const e of _.value)if(z.value.includes(e.id)&&e.list_status===1&&e.roster_id){const t=oe.value.find(d=>d.id===e.roster_id&&d.department_resources_name===R.value);t&&!s.includes(t.id)&&s.push(t.id)}return s},lt=s=>{if(console.log(s),s==null)return;const e=oe.value.find(t=>t.id===s);e&&(P.value=s,q.value=[s],pt(),y.value.forEach(t=>{const d=_.value.find(a=>a.id===t.id);d&&(d.department_resources||(d.department_resources={}),d.department_resources.department_resources_name=e.department_resources_name,d.reservation_date=e.date,d.period_begin_time=e.begin_time,d.period_end_time=e.end_time,d.temp_plan_id=s)}))},ot=()=>{if(U.value.length===0){$.error("请选择检查项目");return}O.value=!0,y.value.forEach(t=>{const d=be.value.find(i=>i.id===t.id);if(!d)return;const a=_.value.find(i=>i.id===t.id);a&&(a.department_resources=d.department_resources,a.reservation_date=d.reservation_date,a.period_begin_time=d.period_begin_time,a.period_end_time=d.period_end_time,a.temp_plan_id=void 0)});const s=y.value.filter(t=>t.list_status===0).map(t=>{var d;return{id:t.id,entrust_id:t.entrust_id,department_resources_name:((d=t.department_resources)==null?void 0:d.department_resources_name)||"",date:t.reservation_date||"",begin_time:t.period_begin_time||"",end_time:t.period_end_time||""}}),e=_.value.filter(t=>!z.value.includes(t.id)&&t.list_status===0&&t.temp_plan_id).map(t=>t.temp_plan_id);ce({type:"optimal_time",regnum:S.reg_num,entrustid:U.value,episodeid:S.episode_id,appointment_type:S.appointment_type,items:s,occupied_plan_ids:e,scope:S.scope,do_user:S.do_user}).then(t=>{if(O.value=!1,t.status){t.data.forEach(n=>{const r=_.value.find(m=>m.id===n.id);r&&(r.department_resources||(r.department_resources={}),r.department_resources.department_resources_name=n.department_resources_name,r.reservation_date=n.date,r.period_begin_time=n.begin_time,r.period_end_time=n.end_time,r.temp_plan_id=n.plan_id)});const d={};t.data.forEach(n=>{var m,p;const r=n.department_resources_name;d[r]||(d[r]={items:[],timeSlots:new Set,dates:new Set}),d[r].items.push(n),d[r].timeSlots.add(((m=n.begin_time)==null?void 0:m.substring(0,5))+"-"+((p=n.end_time)==null?void 0:p.substring(0,5))),d[r].dates.add(n.date)});const a=[];for(const[n,r]of Object.entries(d))(r.timeSlots.size>1||r.dates.size>1)&&r.items.forEach(m=>{var f,g;const p=_.value.findIndex(v=>v.id===m.id);a.push({idx:p!==-1?p+1:"",room:m.department_resources_name,date:m.date,timeSlot:((f=m.begin_time)==null?void 0:f.substring(0,5))+"-"+((g=m.end_time)==null?void 0:g.substring(0,5)),entrust:le(_.value.find(v=>v.id===m.id))})});if(a.length>0){let n='<table style="width:100%;border-collapse:collapse;font-size:14px;">';n+='<tr style="background:#d5dce6;"><td style="padding:4px 8px;border:1px solid #ddd;font-weight:700;">序号</td><td style="padding:4px 8px;border:1px solid #ddd;font-weight:700;">项目名称</td><td style="padding:4px 8px;border:1px solid #ddd;font-weight:700;">检查室</td><td style="padding:4px 8px;border:1px solid #ddd;font-weight:700;">日期</td><td style="padding:4px 8px;border:1px solid #ddd;font-weight:700;">时间段</td></tr>';let r="",m="#f5f5f5";a.sort((p,f)=>p.idx-f.idx).forEach(p=>{p.timeSlot!==r&&(m=m==="#fff"?"#d5dce6":"#fff",r=p.timeSlot),n+='<tr style="background:'+m+';"><td style="padding:4px 8px;border:1px solid #ddd;">'+p.idx+'</td><td style="padding:4px 8px;border:1px solid #ddd;">'+p.entrust+'</td><td style="padding:4px 8px;border:1px solid #ddd;">'+p.room+'</td><td style="padding:4px 8px;border:1px solid #ddd;">'+p.date+'</td><td style="padding:4px 8px;border:1px solid #ddd;">'+p.timeSlot+"</td></tr>"}),n+="</table>",ue.value=n,F.value=!0}const i=new Set(t.data.map(n=>n.id)),l=s.filter(n=>!i.has(n.id));if(l.length>0){let n='<table style="width:100%;border-collapse:collapse;font-size:14px;">';n+='<tr style="background:#d5dce6;"><td style="padding:4px 8px;border:1px solid #ddd;font-weight:700;">序号</td><td style="padding:4px 8px;border:1px solid #ddd;font-weight:700;">项目名称</td><td style="padding:4px 8px;border:1px solid #ddd;font-weight:700;">排班资源</td><td style="padding:4px 8px;border:1px solid #ddd;font-weight:700;">日期</td><td style="padding:4px 8px;border:1px solid #ddd;font-weight:700;">时间段</td><td style="padding:4px 8px;border:1px solid #ddd;font-weight:700;">结果</td></tr>';let r=1;t.data.forEach(m=>{var f,g;const p=le(_.value.find(v=>v.id===m.id));n+='<tr><td style="padding:4px 8px;border:1px solid #ddd;">'+r+++'</td><td style="padding:4px 8px;border:1px solid #ddd;">'+p+'</td><td style="padding:4px 8px;border:1px solid #ddd;">'+m.department_resources_name+'</td><td style="padding:4px 8px;border:1px solid #ddd;">'+m.date+'</td><td style="padding:4px 8px;border:1px solid #ddd;">'+((f=m.begin_time)==null?void 0:f.substring(0,5))+"-"+((g=m.end_time)==null?void 0:g.substring(0,5))+'</td><td style="padding:4px 8px;border:1px solid #ddd;color:green;">✅ 成功匹配</td></tr>'}),l.forEach(m=>{const p=le(_.value.find(f=>f.id===m.id));n+='<tr><td style="padding:4px 8px;border:1px solid #ddd;">'+r+++'</td><td style="padding:4px 8px;border:1px solid #ddd;">'+p+'</td><td style="padding:4px 8px;border:1px solid #ddd;" colspan="3">—</td><td style="padding:4px 8px;border:1px solid #ddd;color:red;">❌ 未找到合适号源</td></tr>'}),n+="</table>",ye.value=n,W.value=!0}else t.data.length===0&&se.confirm("所有项目均未匹配到合适号源,请重新选择号源","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"error",showCancelButton:!1});t.data.length>0&&(R.value=t.data[0].department_resources_name,q.value=t.data.map(n=>n.plan_id),P.value=t.data[0].plan_id)}else $.error(t.msg)})},rt=()=>{if(U.value.length===0){$.error("请选择检查项目");return}O.value=!0,y.value.forEach(t=>{const d=be.value.find(i=>i.id===t.id);if(!d)return;const a=_.value.find(i=>i.id===t.id);a&&(a.department_resources=d.department_resources,a.reservation_date=d.reservation_date,a.period_begin_time=d.period_begin_time,a.period_end_time=d.period_end_time,a.temp_plan_id=void 0)});const s=y.value.filter(t=>t.list_status===0).map(t=>{var d;return{id:t.id,entrust_id:t.entrust_id,department_resources_name:((d=t.department_resources)==null?void 0:d.department_resources_name)||"",date:t.reservation_date||"",begin_time:t.period_begin_time||"",end_time:t.period_end_time||""}}),e=_.value.filter(t=>!z.value.includes(t.id)&&t.list_status===0&&t.temp_plan_id).map(t=>t.temp_plan_id);ce({type:"full_day",regnum:S.reg_num,entrustid:U.value,episodeid:S.episode_id,appointment_type:S.appointment_type,items:s,occupied_plan_ids:e,scope:S.scope,do_user:S.do_user}).then(t=>{if(O.value=!1,t.status)if(t.data.forEach(d=>{const a=_.value.find(i=>i.id===d.id);a&&(a.department_resources||(a.department_resources={}),a.department_resources.department_resources_name=d.department_resources_name,a.reservation_date=d.date,a.period_begin_time=d.begin_time,a.period_end_time=d.end_time,a.temp_plan_id=d.plan_id)}),t.data.length>0){const d={};t.data.forEach(i=>{var n,r;const l=i.department_resources_name;d[l]||(d[l]={items:[],timeSlots:new Set,dates:new Set}),d[l].items.push(i),d[l].timeSlots.add(((n=i.begin_time)==null?void 0:n.substring(0,5))+"-"+((r=i.end_time)==null?void 0:r.substring(0,5))),d[l].dates.add(i.date)});const a=[];for(const[i,l]of Object.entries(d))(l.timeSlots.size>1||l.dates.size>1)&&l.items.forEach(n=>{var m,p;const r=_.value.findIndex(f=>f.id===n.id);a.push({idx:r!==-1?r+1:"",room:n.department_resources_name,date:n.date,timeSlot:((m=n.begin_time)==null?void 0:m.substring(0,5))+"-"+((p=n.end_time)==null?void 0:p.substring(0,5)),entrust:le(_.value.find(f=>f.id===n.id))})});if(a.length>0){let i='<table style="width:100%;border-collapse:collapse;font-size:14px;">';i+='<tr style="background:#d5dce6;"><td style="padding:4px 8px;border:1px solid #ddd;font-weight:700;">序号</td><td style="padding:4px 8px;border:1px solid #ddd;font-weight:700;">项目名称</td><td style="padding:4px 8px;border:1px solid #ddd;font-weight:700;">检查室</td><td style="padding:4px 8px;border:1px solid #ddd;font-weight:700;">日期</td><td style="padding:4px 8px;border:1px solid #ddd;font-weight:700;">时间段</td></tr>';let l="",n="#f5f5f5";a.sort((r,m)=>r.idx-m.idx).forEach(r=>{r.timeSlot!==l&&(n=n==="#fff"?"#d5dce6":"#fff",l=r.timeSlot),i+='<tr style="background:'+n+';"><td style="padding:4px 8px;border:1px solid #ddd;">'+r.idx+'</td><td style="padding:4px 8px;border:1px solid #ddd;">'+r.entrust+'</td><td style="padding:4px 8px;border:1px solid #ddd;">'+r.room+'</td><td style="padding:4px 8px;border:1px solid #ddd;">'+r.date+'</td><td style="padding:4px 8px;border:1px solid #ddd;">'+r.timeSlot+"</td></tr>"}),i+="</table>",ue.value=i,F.value=!0}R.value=t.data[0].department_resources_name,q.value=t.data.map(i=>i.plan_id),P.value=t.data[0].plan_id}else se.confirm("未找到任何一天可满足所有检查项目的号源","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning",showCancelButton:!1});else $.error(t.msg)})},ut=()=>{if(U.value.length===0){$.error("请选择检查项目");return}O.value=!0,y.value.forEach(t=>{const d=be.value.find(i=>i.id===t.id);if(!d)return;const a=_.value.find(i=>i.id===t.id);a&&(a.department_resources=d.department_resources,a.reservation_date=d.reservation_date,a.period_begin_time=d.period_begin_time,a.period_end_time=d.period_end_time,a.temp_plan_id=void 0)});const s=y.value.filter(t=>t.list_status===0).map(t=>{var d;return{id:t.id,entrust_id:t.entrust_id,department_resources_name:((d=t.department_resources)==null?void 0:d.department_resources_name)||"",date:t.reservation_date||"",begin_time:t.period_begin_time||"",end_time:t.period_end_time||""}}),e=_.value.filter(t=>!z.value.includes(t.id)&&t.list_status===0&&t.temp_plan_id).map(t=>t.temp_plan_id);ce({type:"same_day_slot",regnum:S.reg_num,entrustid:U.value,episodeid:S.episode_id,appointment_type:S.appointment_type,items:s,occupied_plan_ids:e,scope:S.scope,do_user:S.do_user}).then(t=>{if(O.value=!1,t.status)if(t.data.length>0){const d={};t.data.forEach(i=>{var n,r;const l=i.department_resources_name;d[l]||(d[l]={timeSlots:new Set}),d[l].timeSlots.add(((n=i.begin_time)==null?void 0:n.substring(0,5))+"-"+((r=i.end_time)==null?void 0:r.substring(0,5)))});let a=!1;for(const i of Object.values(d))if(i.timeSlots.size>1){a=!0;break}if(a){se.confirm("未找到同一时段号源,无法匹配","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning",showCancelButton:!1});return}t.data.forEach(i=>{const l=_.value.find(n=>n.id===i.id);l&&(l.department_resources||(l.department_resources={}),l.department_resources.department_resources_name=i.department_resources_name,l.reservation_date=i.date,l.period_begin_time=i.begin_time,l.period_end_time=i.end_time,l.temp_plan_id=i.plan_id)}),R.value=t.data[0].department_resources_name,q.value=t.data.map(i=>i.plan_id),P.value=t.data[0].plan_id}else se.confirm("未找到同一时段号源,无法匹配","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning",showCancelButton:!1});else $.error(t.msg)})},pt=()=>{O.value=!0;const s=oe.value.find(a=>a.id===P.value);if(!s){O.value=!1;return}const e=s.date+" "+s.begin_time,t=s.date+" "+s.end_time,d=s.department_resources_name;Et({reg_num:S.reg_num,planid:P.value}).then(a=>{var l;O.value=!1;let i=[];if(!a.status&&((l=a.data)!=null&&l.conflicts)&&(i=i.concat(a.data.conflicts.filter(n=>n.room_name!==d))),_.value.forEach(n=>{var f,g,v,c;if(n.list_status!==0||!n.temp_plan_id||!n.reservation_date||((f=n.department_resources)==null?void 0:f.department_resources_name)===d)return;const m=n.reservation_date+" "+n.period_begin_time,p=n.reservation_date+" "+n.period_end_time;m<=t&&e<=p&&(i.some(o=>o.entrust===n.entrust&&o.date===n.reservation_date)||i.push({entrust:n.entrust,date:n.reservation_date,begin_time:(g=n.period_begin_time)==null?void 0:g.substring(0,5),end_time:(v=n.period_end_time)==null?void 0:v.substring(0,5),room_name:((c=n.department_resources)==null?void 0:c.department_resources_name)||""}))}),i.length>0){let n='<table style="width:100%;border-collapse:collapse;font-size:14px;">';n+='<tr style="background:#f5f5f5;"><td style="padding:4px 8px;border:1px solid #ddd;font-weight:700;">序号</td><td style="padding:4px 8px;border:1px solid #ddd;font-weight:700;">项目名称</td><td style="padding:4px 8px;border:1px solid #ddd;font-weight:700;">检查室</td><td style="padding:4px 8px;border:1px solid #ddd;font-weight:700;">日期</td><td style="padding:4px 8px;border:1px solid #ddd;font-weight:700;">时间段</td></tr>',i.forEach((r,m)=>{n+='<tr><td style="padding:4px 8px;border:1px solid #ddd;">'+(m+1)+'</td><td style="padding:4px 8px;border:1px solid #ddd;">'+r.entrust+'</td><td style="padding:4px 8px;border:1px solid #ddd;">'+(r.room_name||"")+'</td><td style="padding:4px 8px;border:1px solid #ddd;">'+r.date+'</td><td style="padding:4px 8px;border:1px solid #ddd;">'+r.begin_time+"-"+r.end_time+"</td></tr>"}),n+="</table>",Oe.value=n,te.value=!0}})},Be=s=>{if(U.length==0)return $.error("请选择检查项目"),!1;if(P.value==0||P.value==""||P.value==null)return $.error("请选择号源"),!1;let e="确定预约此时间吗?";s==2&&(e="确定改约至此时间吗?"),se.confirm(e,"提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{_t(s)}).catch(()=>{})},_t=async s=>{O.value=!0;const e={};_.value.forEach(p=>{var f;!z.value.includes(p.id)&&p.temp_plan_id&&(e[p.id]={temp_plan_id:p.temp_plan_id,department_resources_name:(f=p.department_resources)==null?void 0:f.department_resources_name,reservation_date:p.reservation_date,period_begin_time:p.period_begin_time,period_end_time:p.period_end_time})}),console.log("tempPlanCache 缓存:",JSON.parse(JSON.stringify(e)));const t={};let d=!1;if(z.value.forEach(p=>{const f=_.value.find(v=>v.id===p),g=(f==null?void 0:f.temp_plan_id)||(f==null?void 0:f.roster_id);if(!g){d=!0;return}t[g]||(t[g]=[]),t[g].push(p)}),d){O.value=!1,$.error("存在未分配号源的项目,请先选择号源");return}const a=Object.keys(t);if(a.length===1){const p=Number(a[0]),f=t[p];qe({mainlistid:f,planid:p,appointment_type:S.appointment_type,dotype:s,do_user:S.do_user,is_emergency:s==111?1:null}).then(g=>{O.value=!1,g.status?(he.value.forEach((v,c)=>{v.label=="开启申请单pdf"&&v.value}),Se(()=>{var o;A.value=!1;const v=[...z.value],c=_.value.filter(u=>u.list_status===0&&u.tishi_msg==="");if(c.length===0)v.forEach(u=>{const w=_.value.find(T=>T.id===u);w&&L.value.toggleRowSelection(w,!0)});else{L.value.clearSelection();const u=new Set(c.map(w=>{var T;return(T=w.department_resources)==null?void 0:T.department_resources_name}).filter(Boolean));_.value.forEach(w=>{var T;w.tishi_msg===""&&(w.list_status===0||u.has((T=w.department_resources)==null?void 0:T.department_resources_name))&&L.value.toggleRowSelection(w,!0)})}if(A.value=!0,_.value.forEach(u=>{e[u.id]&&(console.log("回填 temp_plan_id:",u.id,e[u.id].temp_plan_id),u.temp_plan_id=e[u.id].temp_plan_id,u.department_resources||(u.department_resources={}),u.department_resources.department_resources_name=e[u.id].department_resources_name,u.reservation_date=e[u.id].reservation_date,u.period_begin_time=e[u.id].period_begin_time,u.period_end_time=e[u.id].period_end_time)}),console.log("回填后 entrustTableDate:",JSON.parse(JSON.stringify(_.value.map(u=>({id:u.id,temp_plan_id:u.temp_plan_id,list_status:u.list_status}))))),setTimeout(()=>{console.log("延迟检查 temp_plan_id:",JSON.parse(JSON.stringify(_.value.map(u=>({id:u.id,temp_plan_id:u.temp_plan_id,list_status:u.list_status})))))},2e3),y.value.length>0){const u=(o=y.value[0].department_resources)==null?void 0:o.department_resources_name;u&&(R.value=u)}if(y.value.some(u=>u.list_status===0)||K(),ne.value.length>0){const u=y.value.filter(w=>w.list_status===1).map(w=>w.entrust_id);u.length>0&&Re(u)}},!0)):se.confirm(g.msg,"提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"error",showCancelButton:!1}).then(()=>{}).catch(()=>{})});return}const i=[],l=[],n=[];for(const p of a){const f=Number(p),g=t[p];try{const v=await qe({mainlistid:g,planid:f,appointment_type:S.appointment_type,dotype:s,do_user:S.do_user,is_emergency:s==111?1:null});v.status?g.forEach(c=>{var o;const D=_.value.find(u=>u.id===c);if(D){const u=(D.period_begin_time?D.period_begin_time.substring(0,5):"")+"-"+(D.period_end_time?D.period_end_time.substring(0,5):"");i.push({name:D.entrust,room:((o=D.department_resources)==null?void 0:o.department_resources_name)||"",date:D.reservation_date||"",time:u}),n.push(D.entrust_id)}}):g.forEach(c=>{const D=_.value.find(o=>o.id===c);D&&l.push({name:D.entrust,msg:v.msg})})}catch{g.forEach(c=>{const D=_.value.find(o=>o.id===c);D&&l.push({name:D.entrust,msg:"请求异常"})})}}O.value=!1;let r='<table style="width:100%;border-collapse:collapse;font-size:14px;">';r+='<tr style="background:#f5f5f5;"><td style="padding:4px 8px;border:1px solid #ddd;font-weight:700;">序号</td><td style="padding:4px 8px;border:1px solid #ddd;font-weight:700;">项目名称</td><td style="padding:4px 8px;border:1px solid #ddd;font-weight:700;">检查室</td><td style="padding:4px 8px;border:1px solid #ddd;font-weight:700;">日期</td><td style="padding:4px 8px;border:1px solid #ddd;font-weight:700;">时间段</td><td style="padding:4px 8px;border:1px solid #ddd;font-weight:700;">结果</td></tr>';let m=1;i.forEach(p=>{r+='<tr><td style="padding:4px 8px;border:1px solid #ddd;">'+m+++'</td><td style="padding:4px 8px;border:1px solid #ddd;">'+p.name+'</td><td style="padding:4px 8px;border:1px solid #ddd;">'+p.room+'</td><td style="padding:4px 8px;border:1px solid #ddd;">'+p.date+'</td><td style="padding:4px 8px;border:1px solid #ddd;">'+p.time+'</td><td style="padding:4px 8px;border:1px solid #ddd;color:green;">预约成功</td></tr>'}),l.forEach(p=>{r+='<tr><td style="padding:4px 8px;border:1px solid #ddd;">'+m+++'</td><td style="padding:4px 8px;border:1px solid #ddd;">'+p.name+'</td><td style="padding:4px 8px;border:1px solid #ddd;" colspan="3">—</td><td style="padding:4px 8px;border:1px solid #ddd;color:red;">'+p.msg+"</td></tr>"}),r+="</table>",$e.value=r,de.value=!0,i.length>0&&(Se(()=>{var v;A.value=!1;const p=[...z.value],f=_.value.filter(c=>c.list_status===0&&c.tishi_msg==="");if(f.length===0)p.forEach(c=>{const D=_.value.find(o=>o.id===c);D&&L.value.toggleRowSelection(D,!0)});else{L.value.clearSelection();const c=new Set(f.map(D=>{var o;return(o=D.department_resources)==null?void 0:o.department_resources_name}).filter(Boolean));_.value.forEach(D=>{var o;D.tishi_msg===""&&(D.list_status===0||c.has((o=D.department_resources)==null?void 0:o.department_resources_name))&&L.value.toggleRowSelection(D,!0)})}if(A.value=!0,_.value.forEach(c=>{e[c.id]&&(console.log("回填 temp_plan_id:",c.id,e[c.id].temp_plan_id),c.temp_plan_id=e[c.id].temp_plan_id,c.department_resources||(c.department_resources={}),c.department_resources.department_resources_name=e[c.id].department_resources_name,c.reservation_date=e[c.id].reservation_date,c.period_begin_time=e[c.id].period_begin_time,c.period_end_time=e[c.id].period_end_time)}),console.log("回填后 entrustTableDate:",JSON.parse(JSON.stringify(_.value.map(c=>({id:c.id,temp_plan_id:c.temp_plan_id,list_status:c.list_status}))))),setTimeout(()=>{console.log("延迟检查 temp_plan_id:",JSON.parse(JSON.stringify(_.value.map(c=>({id:c.id,temp_plan_id:c.temp_plan_id,list_status:c.list_status})))))},2e3),y.value.length>0){const c=(v=y.value[0].department_resources)==null?void 0:v.department_resources_name;c&&(R.value=c)}y.value.some(c=>c.list_status===0)||K(),ne.value.length>0&&Re(n)},!0),he.value.forEach((p,f)=>{p.label=="开启申请单pdf"&&p.value}))},mt=()=>{se.confirm("确定取消预约吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(async()=>{const s={};_.value.forEach(d=>{var a;!z.value.includes(d.id)&&d.temp_plan_id&&(s[d.id]={temp_plan_id:d.temp_plan_id,department_resources_name:(a=d.department_resources)==null?void 0:a.department_resources_name,reservation_date:d.reservation_date,period_begin_time:d.period_begin_time,period_end_time:d.period_end_time})});const e=y.value.map(d=>{var a;return{id:d.id,entrust_id:d.entrust_id,department_resources_name:((a=d.department_resources)==null?void 0:a.department_resources_name)||"",date:d.reservation_date||"",begin_time:d.period_begin_time||"",end_time:d.period_end_time||""}});X.value=!0;const t=await Ct({ids:y.value.map(d=>d.id),reg_num:y.value[0].reg_num,do_user:S.do_user});t.status?($.success("取消成功"),X.value=!1,Se(()=>{_.value.forEach(a=>{s[a.id]&&(a.temp_plan_id=s[a.id].temp_plan_id,a.department_resources||(a.department_resources={}),a.department_resources.department_resources_name=s[a.id].department_resources_name,a.reservation_date=s[a.id].reservation_date,a.period_begin_time=s[a.id].period_begin_time,a.period_end_time=s[a.id].period_end_time)});const d=e;if(d.length>0){const a=_.value.filter(i=>!d.find(l=>l.id===i.id)&&i.list_status===0&&i.temp_plan_id).map(i=>i.temp_plan_id);ce({type:"optimal_time",regnum:S.reg_num,entrustid:d.map(i=>i.entrust_id),episodeid:S.episode_id,appointment_type:S.appointment_type,items:d,occupied_plan_ids:a,scope:S.scope,do_user:S.do_user}).then(i=>{i.status&&i.data.length>0&&(i.data.forEach(l=>{const n=_.value.find(r=>r.id===l.id);n&&(n.department_resources||(n.department_resources={}),n.department_resources.department_resources_name=l.department_resources_name,n.reservation_date=l.date,n.period_begin_time=l.begin_time,n.period_end_time=l.end_time,n.temp_plan_id=l.plan_id)}),R.value=i.data[0].department_resources_name,q.value=i.data.map(l=>l.plan_id),P.value=i.data[0].plan_id)})}},!0)):($.error(t.msg||"取消失败"),X.value=!1)})},ct=()=>{Dt({config_arrs:["开启申请单pdf","医生端打印"]}).then(s=>{s.status&&(he.value=s.data.list,he.value.forEach((e,t)=>{console.log(S.appointment_type),e.label=="医生端打印"&&e.value==="0"&&S.appointment_type==1&&(ne.value=[])}))})},Re=s=>{const e=s||U.value,t=y.value.filter(i=>e.includes(i.entrust_id)&&i.list_status!=1);if(t.length>0){$.error(t.map(i=>i.entrust).join("、")+" 不可打印,请重新选择");return}const a="https://yj.dev.cjy.net.cn/api/GetCheckPdf?Dev=1&Type=group&"+e.map(i=>"OrderNoList[]="+i).join("&");fetch(a).then(i=>i.blob()).then(i=>{const l=URL.createObjectURL(i),n=document.createElement("iframe");n.style.display="none",n.src=l,n.onload=()=>{n.contentWindow.print(),URL.revokeObjectURL(l)},document.body.appendChild(n)})},ft=()=>{R.value="",Z.value=ke(ie.value),console.log(Z.value),K()};function gt(s){const e=s.getFullYear(),t=String(s.getMonth()+1).padStart(2,"0"),d=String(s.getDate()).padStart(2,"0");return`${e}-${t}-${d}`}function ke(s=new Date,e=15){const t=new Date(s),d=[];if(isNaN(t.getTime()))throw new Error("无效的日期格式");for(let a=0;a<e;a++){const i=new Date(t);i.setDate(t.getDate()+a);const l=gt(i);d.push(l)}return d}function He(s){if(!/^\d{4}-\d{2}-\d{2}$/.test(s))return!1;const t=new Date(s);return t.toString()!=="Invalid Date"&&!isNaN(t.getTime())}function xt(s,e){if(!He(s)||!He(e))return console.error("日期格式不正确,请使用 YYYY-MM-DD"),!1;const t=new Date(s);return(new Date(e)-t)/(1e3*60*60*24)>15}function Je(){const s=new Date,e=s.getFullYear(),t=String(s.getMonth()+1).padStart(2,"0"),d=String(s.getDate()).padStart(2,"0");return`${e}-${t}-${d}`}let Pe=k(!1);return yt(()=>{Pe.value=!0,ct(),Z.value=ke(),Se(()=>{y.value.some(e=>e.list_status===0)||K()})}),(s,e)=>{var D;const t=J("el-alert"),d=J("el-table-column"),a=J("el-tag"),i=J("el-table"),l=J("el-button"),n=J("el-checkbox"),r=J("el-checkbox-group"),m=J("el-tooltip"),p=J("el-date-picker"),f=J("el-empty"),g=J("el-dialog"),v=J("el-icon"),c=vt("loading");return E(),N("div",It,[x(Y)?(E(),N("div",Tt,[C("div",Nt,[C("span",Mt,M(x(Y).user_name),1),V("("+M(x(Y).user_sex_label)+" "+M(x(Y).age)+"岁)",1)]),C("div",Vt,[V(M(x(Y).patient_type_label)+"号:",1),C("span",Bt,M(x(Y).patient_type==0?(D=x(Y).episodeid)==null?void 0:D.slice(-10):x(Y).reg_num),1)]),C("div",Rt,[e[19]||(e[19]=V("电话:",-1)),C("span",Pt,M(x(Y).user_phone),1)]),x(Y).warddesc?(E(),N("div",zt,[e[20]||(e[20]=V("病区:",-1)),C("span",Yt,M(x(Y).warddesc),1)])):B("",!0),x(Y).bedno?(E(),N("div",Ot,[e[21]||(e[21]=V("床号:",-1)),C("span",$t,M(x(Y).bedno),1)])):B("",!0),x(Y).diagnosisName?(E(),N("div",Lt,[e[22]||(e[22]=V("诊断:",-1)),C("span",Ut,M(x(Y).diagnosisName),1)])):B("",!0)])):(E(),N("div",jt," 获取患者信息失败 ")),Qe.value?(E(),Q(t,{key:2,type:"danger",closable:!1,"show-icon":"",style:{"margin-bottom":"8px"}},{title:h(()=>[...e[23]||(e[23]=[C("span",{style:{"font-weight":"700",color:"#f56c6c"}},"患者所有检查项目未预约至同一天,请注意是否需手动调整预约",-1)])]),_:1})):B("",!0),x(Me)?(E(),Q(t,{key:3,type:"warning",closable:!1,"show-icon":"",style:{"margin-bottom":"8px"}},{title:h(()=>[C("span",Ht,M(x(Me)),1)]),_:1})):B("",!0),x(Ve)?(E(),Q(t,{key:4,type:"warning",closable:!1,"show-icon":"",style:{"margin-bottom":"8px"}},{title:h(()=>[C("span",Jt,M(x(Ve)),1)]),_:1})):B("",!0),C("div",Ft,[Ge((E(),Q(i,{data:x(_),style:{width:"100%"},"row-key":"id",ref_key:"entrustTableRef",ref:L,"row-class-name":nt,onSelectionChange:et},{default:h(()=>[b(d,{type:"selection",width:"36",selectable:st}),b(d,{prop:"tishi_msg",width:"200"},{header:h(()=>[C("div",null,[C("div",null,"共 "+M(x(_).length)+" 项,已选 "+M(x(z).length)+" 项",1),Le.value>0?(E(),N("div",Gt,"同检查室项目 "+M(Le.value)+" 项",1)):B("",!0)])]),default:h(o=>[C("span",At,M(o.$index+1),1),o.row.tishi_msg!=""?(E(),N("span",qt,M(o.row.tishi_msg),1)):(E(),N("span",Wt,"正常"))]),_:1}),b(d,{prop:"list_status",label:"预约状态",width:"80"},{default:h(o=>[o.row.list_status===0?(E(),Q(a,{key:0,class:"ml-2",type:"info"},{default:h(()=>[...e[24]||(e[24]=[V("未预约",-1)])]),_:1})):B("",!0),o.row.list_status===1?(E(),Q(a,{key:1,class:"ml-2",type:"success"},{default:h(()=>[...e[25]||(e[25]=[V("已预约",-1)])]),_:1})):B("",!0),o.row.list_status===2?(E(),Q(a,{key:2,class:"ml-2"},{default:h(()=>[...e[26]||(e[26]=[V("登记",-1)])]),_:1})):B("",!0),o.row.list_status===3?(E(),Q(a,{key:3,class:"ml-2",type:"warning"},{default:h(()=>[...e[27]||(e[27]=[V("完成",-1)])]),_:1})):B("",!0)]),_:1}),b(d,{label:"项目","show-overflow-tooltip":""},{default:h(o=>[V(M(o.row.entrust)+M(o.row.requestComment?""+o.row.requestComment+"":""),1)]),_:1}),b(d,{prop:"is_pay",label:"是否交费",width:"60",align:"center"},{default:h(o=>[o.row.is_pay==1?(E(),N("span",Zt,"是")):B("",!0),o.row.is_pay==0?(E(),N("span",Kt,"否")):B("",!0)]),_:1}),b(d,{prop:"his_is_emergency",label:"是否加急",width:"60",align:"center"},{default:h(o=>[o.row.his_is_emergency==1?(E(),N("span",Qt,"是")):B("",!0),o.row.his_is_emergency==0?(E(),N("span",Xt,"否")):B("",!0)]),_:1}),b(d,{prop:"department_resources.department_resources_name",label:"排班",width:"220"}),b(d,{prop:"reservation_date",label:"预约日期",width:"120"}),b(d,{prop:"check_begin_time",label:"预约时间",width:"120"},{default:h(o=>[o.row.period_begin_time&&o.row.period_end_time?(E(),N("span",ed,M(o.row.period_begin_time.substring(0,5))+"~"+M(o.row.period_end_time.substring(0,5)),1)):B("",!0)]),_:1}),b(d,{prop:"limosis",label:"是否空腹",width:"60",align:"center"},{default:h(o=>[o.row.limosis==0?(E(),N("span",td,"否")):(E(),N("span",dd,"是"))]),_:1}),b(d,{prop:"reservation_department",label:"申请科室",width:"150"}),b(d,{prop:"",label:"医嘱时间",width:"200"},{default:h(o=>[V(M(o.row.entrust_date)+" "+M(o.row.entrust_time),1)]),_:1}),b(d,{prop:"docotr",label:"申请医生",width:"80"})]),_:1},8,["data"])),[[c,x(X)]])]),C("div",nd,[C("div",sd,[C("div",ad,[(E(!0),N(De,null,Ie(x(fe),(o,u)=>(E(),N("div",{key:u,class:Ae({"ZhenShiButton zhenshiButton_active":x(R)===o,ZhenShiButton:x(R)!==o}),onClick:w=>it(o)},M(o),11,id))),128)),e[38]||(e[38]=C("div",{class:"shuxian"},null,-1)),Ue.value?(E(),Q(l,{key:0,class:"do_button",type:"danger",onClick:e[0]||(e[0]=o=>Be(111))},{default:h(()=>[...e[28]||(e[28]=[V("加急预约",-1)])]),_:1})):B("",!0),b(l,{class:"do_button",type:"success",onClick:e[1]||(e[1]=o=>Be(1))},{default:h(()=>[...e[29]||(e[29]=[V("预约",-1)])]),_:1}),b(l,{class:"do_button",type:"warning",onClick:e[2]||(e[2]=o=>Be(2))},{default:h(()=>[...e[30]||(e[30]=[V("更改预约时间",-1)])]),_:1}),b(l,{class:"do_button",type:"danger",onClick:e[3]||(e[3]=o=>mt())},{default:h(()=>[...e[31]||(e[31]=[V("取消预约",-1)])]),_:1}),b(l,{onClick:e[4]||(e[4]=o=>Re())},{default:h(()=>[...e[32]||(e[32]=[V("打印申请单",-1)])]),_:1}),C("div",ld,[b(r,{modelValue:x(ne),"onUpdate:modelValue":e[5]||(e[5]=o=>j(ne)?ne.value=o:ne=o)},{default:h(()=>[b(n,{label:"1"},{default:h(()=>[...e[33]||(e[33]=[V("预约完成后打印申请单",-1)])]),_:1})]),_:1},8,["modelValue"]),b(m,{placement:"top",content:Ed,"popper-class":"tip-pre-line"},{default:h(()=>[b(n,{modelValue:x(re),"onUpdate:modelValue":e[6]||(e[6]=o=>j(re)?re.value=o:re=o)},{default:h(()=>[...e[34]||(e[34]=[V("自动选中能一起预约的检查项目",-1)])]),_:1},8,["modelValue"])]),_:1})]),b(m,{placement:"top",content:"点击此按钮,系统会推荐最近能用的时间段号源,多个检查项目可能会跨天跨时间段","popper-class":"tip-pre-line"},{default:h(()=>[b(l,{class:"do_button_recommend",type:"primary",style:{"margin-left":"20px",width:"120px"},onClick:ot},{default:h(()=>[...e[35]||(e[35]=[V("推荐最近时间号源",-1)])]),_:1})]),_:1}),b(m,{placement:"top",content:"点击此按钮,系统会推荐最近的能在同一天完成检查的号源","popper-class":"tip-pre-line"},{default:h(()=>[b(l,{class:"do_button_recommend",type:"primary",style:{width:"120px"},onClick:rt},{default:h(()=>[...e[36]||(e[36]=[V("推荐同一天号源",-1)])]),_:1})]),_:1}),b(m,{placement:"top",content:"点击此按钮,系统会推荐最近的能在同一天同一时间段完成检查的号源","popper-class":"tip-pre-line"},{default:h(()=>[b(l,{class:"do_button_recommend",type:"primary",onClick:ut},{default:h(()=>[...e[37]||(e[37]=[V("推荐同一天同一时间段号源",-1)])]),_:1})]),_:1})]),C("div",null,[b(p,{modelValue:x(ie),"onUpdate:modelValue":e[7]||(e[7]=o=>j(ie)?ie.value=o:ie=o),type:"date",placeholder:"跳转日期",onChange:e[8]||(e[8]=o=>ft())},null,8,["modelValue"])])]),Ge((E(),N("div",od,[C("table",rd,[x(y).length>0?(E(),N("tr",ud,[e[39]||(e[39]=C("td",{style:{width:"120px"}},null,-1)),(E(!0),N(De,null,Ie(x(Z),(o,u)=>(E(),N("td",pd,M(o.substring(5,10))+" "+M(Ke(o)),1))),256))])):B("",!0),x(Z).length>0&&x(ae).length>0?(E(!0),N(De,{key:1},Ie(x(ae),(o,u)=>(E(),N("tr",{key:u,class:"table_plan_row"},[(E(!0),N(De,null,Ie(o,(w,T)=>(E(),N("td",{key:T,class:Ae({planActive:x(q).includes(w.id)&&w.id!==0&&w.id,plandisable:!w.enable&&T!=="time_range"}),onClick:H=>lt(w.id)},[T=="time_range"?(E(),N("span",md,M(w),1)):B("",!0),C("span",null,M(w.use_count),1)],10,_d))),128))]))),128)):B("",!0)]),x(y).length==0?(E(),N("div",cd,[b(f,{description:"请选择项目"})])):B("",!0),x(y).length>0&&x(ae).length==0?(E(),N("div",fd,[b(f,{description:"暂无号源"})])):B("",!0)])),[[c,x(O)]])]),b(g,{modelValue:x(ee),"onUpdate:modelValue":e[10]||(e[10]=o=>j(ee)?ee.value=o:ee=o),title:"提示",width:"500"},{footer:h(()=>[C("div",gd,[b(l,{type:"primary",onClick:e[9]||(e[9]=o=>j(ee)?ee.value=!1:ee=!1)},{default:h(()=>[...e[40]||(e[40]=[V(" 确定 ",-1)])]),_:1})])]),default:h(()=>[b(i,{data:x(we),style:{width:"100%"},"row-key":"id"},{default:h(()=>[b(d,{prop:"item_name",label:"项目名称"}),b(d,{prop:"msg",label:"异常提示"})]),_:1},8,["data"])]),_:1},8,["modelValue"]),b(g,{modelValue:x(F),"onUpdate:modelValue":e[12]||(e[12]=o=>j(F)?F.value=o:F=o),title:"提示",width:"800"},{footer:h(()=>[b(l,{type:"primary",onClick:e[11]||(e[11]=o=>j(F)?F.value=!1:F=!1)},{default:h(()=>[...e[42]||(e[42]=[V("确定",-1)])]),_:1})]),default:h(()=>[C("div",xd,[b(v,{class:"el-icon-warning",style:{color:"#e6a23c","font-size":"24px","flex-shrink":"0","margin-top":"2px"}},{default:h(()=>[b(x(Te))]),_:1}),C("div",null,[e[41]||(e[41]=C("p",{style:{margin:"0 0 12px 0","font-weight":"700"}},"最近可用的同一时间段号源数量不足,无法把当前全部检查项目预约在同一时间段,系统已经自动拆分。",-1)),C("div",{innerHTML:x(ue)},null,8,hd)])])]),_:1},8,["modelValue"]),b(g,{modelValue:x(te),"onUpdate:modelValue":e[14]||(e[14]=o=>j(te)?te.value=o:te=o),title:"时段冲突",width:"800"},{footer:h(()=>[b(l,{type:"primary",onClick:e[13]||(e[13]=o=>j(te)?te.value=!1:te=!1)},{default:h(()=>[...e[44]||(e[44]=[V("我知道了",-1)])]),_:1})]),default:h(()=>[C("div",bd,[b(v,{style:{color:"#F56C6C","font-size":"24px","flex-shrink":"0","margin-top":"2px"}},{default:h(()=>[b(x(Te))]),_:1}),C("div",null,[e[43]||(e[43]=C("p",{style:{margin:"0 0 12px 0","font-weight":"700"}}," 以下项目与当前选择的时间段存在冲突,请确认是否继续预约: ",-1)),C("div",{innerHTML:x(Oe)},null,8,yd)])])]),_:1},8,["modelValue"]),b(g,{modelValue:x(de),"onUpdate:modelValue":e[16]||(e[16]=o=>j(de)?de.value=o:de=o),title:"预约结果",width:"800"},{footer:h(()=>[b(l,{type:"primary",onClick:e[15]||(e[15]=o=>j(de)?de.value=!1:de=!1)},{default:h(()=>[...e[45]||(e[45]=[V("确定",-1)])]),_:1})]),default:h(()=>[C("div",vd,[b(v,{style:{color:"#e6a23c","font-size":"24px","flex-shrink":"0","margin-top":"2px"}},{default:h(()=>[b(x(Te))]),_:1}),C("div",{innerHTML:x($e)},null,8,wd)])]),_:1},8,["modelValue"]),b(g,{modelValue:x(W),"onUpdate:modelValue":e[18]||(e[18]=o=>j(W)?W.value=o:W=o),title:"预约推荐结果",width:"800"},{footer:h(()=>[b(l,{type:"primary",onClick:e[17]||(e[17]=o=>j(W)?W.value=!1:W=!1)},{default:h(()=>[...e[46]||(e[46]=[V("确定",-1)])]),_:1})]),default:h(()=>[C("div",Sd,[b(v,{style:{color:"#e6a23c","font-size":"24px","flex-shrink":"0","margin-top":"2px"}},{default:h(()=>[b(x(Te))]),_:1}),C("div",{innerHTML:x(ye)},null,8,kd)])]),_:1},8,["modelValue"])])}}},Id=bt(Cd,[["__scopeId","data-v-92d4e7d1"]]);export{Id as Y};