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