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.

2 lines
29 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 ht,Y as Re,o as wt,aZ as Vt,r as L,c as Ct,d as r,e as p,k as d,f as a,w as s,F as D,t as S,i as n,h as _e,Z as se,j as T,x,a_ as It,l as z,g as _,J as Dt,E as k,aV as Bt,O as Lt,q as m,v,bd as Ue,be as St,bf as Et,p as Mt,bg as Nt,bh as $e,bi as Tt,N as me,bj as zt,bk as Pt,bl as Rt,bm as Ut,bn as $t,bo as At,bp as Ot}from"./index-a8f3756b.js";const Yt={class:"head"},qt={style:{display:"flex"},class:"planInfo"},Ft={style:{"border-right":"1px solid #dadada","padding-right":"4px"}},Gt=["onClick"],Zt={style:{flex:"1","min-width":"0"}},Xt={key:0,class:"planTable"},jt={style:{"background-color":"#f1f1f1",position:"relative"}},Wt={style:{width:"120px",display:"flex","font-size":"12px","justify-content":"center","align-items":"center"}},Ht={style:{"min-width":"150px","font-size":"14px"}},Kt=["data-row","data-col","onMouseover","onMouseleave","onMousedown"],Jt={key:0},Qt={key:0,class:"hoverTools"},el=["onClick"],tl=["onClick"],ll=["onClick"],nl=["onClick"],ol={key:1,class:"qudao_count_row qudao_count_row_simple"},al={style:{display:"flex",gap:"12px","justify-content":"center"}},sl={class:"card_locked"},ul={class:"font_color"},il={style:{display:"flex","justify-content":"center",width:"100%","margin-top":"4px"}},rl={class:"card_total"},dl={class:"zong_row"},cl={class:"qudao_title_zong"},fl={class:"qudao_count_row"},pl={key:0},_l={class:"font_color"},ml={class:"patient_type_row"},vl={class:"tps"},yl={key:2,style:{width:"100%","background-color":"#fff"}},gl={style:{"font-weight":"700",display:"inline-block","margin-right":"8px"}},bl={style:{"font-weight":"700",display:"inline-block","margin-right":"8px"}},kl={key:0,class:"qudao_k"},xl={key:0,style:{width:"50px"}},hl={class:"qudao_k_input"},wl={class:"dialog-footer"},Vl={style:{"text-align":"center","font-size":"16px","margin-top":"-30px","margin-bottom":"10px"}},Cl={key:1,style:{"margin-left":"4px",color:"#e6a23c","font-weight":"700"}},Il={style:{"font-weight":"700",display:"inline-block","margin-right":"8px"}},Dl={style:{"font-weight":"700"}},Bl={style:{display:"flex","flex-direction":"column",gap:"10px",width:"100%"}},Ll={key:0,style:{display:"flex","align-items":"center",gap:"10px"}},Sl={key:0,style:{width:"80px"}},El={style:{flex:"1"}},Ml={style:{color:"#999","font-size":"12px"}},Nl={key:1,style:{color:"#999"}},Tl={class:"dialog-footer"},zl={style:{"margin-bottom":"16px",color:"#666"}},Pl={style:{display:"flex","flex-direction":"column",gap:"10px"}},Rl={key:0,style:{display:"flex","align-items":"center",gap:"8px","margin-bottom":"10px"}},Ul={key:0,style:{width:"60px",color:"#666"}},$l={key:0,style:{"margin-top":"16px","padding-top":"12px","border-top":"1px solid #eee"}},Al={style:{display:"flex",gap:"12px","flex-wrap":"wrap"}},Ol={style:{display:"flex","align-items":"center"}},Yl={style:{"margin-bottom":"16px",color:"#666"}},ql={style:{display:"flex","flex-direction":"column",gap:"10px"}},Fl={key:0,style:{display:"flex","align-items":"center",gap:"8px","margin-bottom":"10px"}},Gl={key:0,style:{width:"60px",color:"#666"}},Zl={style:{color:"#999","font-size":"12px"}},Xl={style:{"margin-bottom":"10px"}},jl={style:{color:"#67c23a","font-weight":"600"}},Wl={style:{color:"#f56c6c","font-weight":"600"}},Hl={key:0},Kl={__name:"PlanList",setup(Jl){let $=_([]),w=_(!1),Ae=_(1),Oe=_(9999),h=_([]),de=_([]),A=_(0),Z=_({department_id:null,resources_id:null,device_id:null,xingqi:null,status:null,dateRange:[]}),O=_(!1),ve=_(new Set);const P=()=>{Z.value.resources_id=X.value,de.value=kt(Z.value.dateRange),w.value=!0,Nt({page:Ae.value,pageSize:Oe.value,searchInfo:Z.value}).then(t=>{if(w.value=!1,t.status){$.value=[],h.value=[];let e=t.data.list;if(e.length>0){const o=new Set;e.forEach(i=>{if(i.resources_id==X.value){const c=`${i.begin_time.substring(0,5)}-${i.end_time.substring(0,5)}`;o.add(c)}}),Array.from(o).sort().forEach(i=>{const c={time_range:i};de.value.forEach(f=>{const b=e.find(B=>`${B.begin_time.substring(0,5)}-${B.end_time.substring(0,5)}`===i&&B.date===f&&B.resources_id==X.value);b?c[f]={countsInfo:b.countsInfo,patient_type_label:b.patient_type_label,status:b.status,id:b.id,resources_id:b.resources_id,begin_time:b.begin_time,end_time:b.end_time,end_reservation_time:b.end_reservation_time}:c[f]={countsInfo:null,patient_type_label:null,status:null,id:null,resources_id:null}}),$.value.push(c)})}}else k.error(t.msg)})},Ye=()=>{A.value=A.value===0?1:0,A.value===0&&(h.value=[]),A.value===1&&$.value.forEach((t,e)=>{console.log(t);for(let o in t)o!="time_range"&&h.value.push(t[o].id)})},qe=t=>{h.value.indexOf(t)===-1?h.value.push(t):h.value=h.value.filter(o=>o!==t)};let ye=_(null),K=_(!1),J=_({row:0,col:0,x:0,y:0}),ge=_({}),be=_(null);const Fe=t=>{ye.value=t},Ge=t=>{ye.value=null},Ze=(t,e,o,u)=>{K.value||Fe(e==null?void 0:e.id)},Xe=t=>{K.value||Ge()},je=(t,e,o,u)=>{if(t.target.closest(".plan_checkbox")||u==="time_range"||!e||!e.id)return;const i=t.currentTarget,c=i.closest("tr");if(!c)return;const f=be.value;if(!f)return;const b=f.getBoundingClientRect();K.value=!0,J.value={row:c.rowIndex,col:i.cellIndex,x:t.clientX-b.left+f.scrollLeft,y:t.clientY-b.top+f.scrollTop},h.value=[e.id],A.value=0},De=t=>{var pe;if(!K.value)return;const e=be.value;if(!e)return;const o=e.getBoundingClientRect(),u=t.clientX-o.left+e.scrollLeft,i=t.clientY-o.top+e.scrollTop;ge.value={left:Math.min(J.value.x,u)+"px",top:Math.min(J.value.y,i)+"px",width:Math.abs(u-J.value.x)+"px",height:Math.abs(i-J.value.y)+"px"};const c=document.elementFromPoint(t.clientX,t.clientY);if(!c)return;const f=c.closest("td");if(!f)return;const b=f.closest("tr");if(!b||((pe=b.parentElement)==null?void 0:pe.tagName)==="THEAD")return;const B=b.rowIndex,E=f.cellIndex;if(E===0)return;const M=J.value.row,U=J.value.col,Ie=Math.min(M,B),ae=Math.max(M,B),W=Math.min(U,E),G=Math.max(U,E);h.value=[];for(let H=Ie;H<=ae;H++){const l=$.value[H-1];if(l)for(let g=W;g<=G;g++){if(g===0)continue;const y=de.value[g-1];if(!y)continue;const N=l[y];N&&N.id&&h.value.push(N.id)}}},Be=()=>{K.value&&(K.value=!1,ge.value={})},We=t=>{X.value=t,A.value=0,h.value=[],P()},ue=t=>h.value.includes(t);let He=_([]);const Ke=()=>{w.value=!0,Dt().then(t=>{w.value=!1,t.status?He.value=t.data:k.error(t.msg)})};let Je=_([]);const Qe=()=>{w.value=!0,Bt({}).then(t=>{w.value=!1,t.status?Je.value=t.data.list:k.error(t.msg)})};let ce=_([]),X=_(0);const et=()=>{w.value=!0,Lt().then(t=>{w.value=!1,t.status?(ce.value=t.data,ce.value.length>0&&X.value==""&&(X.value=ce.value[0].id,P())):k.error(t.msg)})};let V=_("");const tt=t=>{O.value=!0,w.value=!0,$e({id:t}).then(e=>{w.value=!1,e.status?(V.value=e.data,ve.value=new Set(V.value.coutsInfo.filter(o=>o.appointment_type_id===1||o.id===1||Number(o.count)>0||Number(o.locked_count)>0).map(o=>o.appointment_type_id||o.id))):k.error(e.msg)})},lt=()=>{let t=0;V.value.coutsInfo.forEach(e=>{t=t+Number(e.count)}),V.value.max_total=t,w.value=!0,Tt({PlanDetaiInfo:V.value}).then(e=>{w.value=!1,e.status?(O.value=!1,k.success("保存成功"),P()):k.error(e.msg)})},nt=()=>{if(h.value.length==0)return k.error("请至少勾选1条记录"),!1;me.confirm("确定删除吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{w.value=!0,zt({ids:h.value}).then(t=>{w.value=!1,t.status?(k({message:t.msg,type:"success"}),P()):k.error(t.msg)})})},ot=()=>{if(h.value.length==0)return k.error("请至少勾选1条记录"),!1;me.confirm("确定批量禁用勾选的号源吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{w.value=!0,Pt({ids:h.value}).then(t=>{w.value=!1,t.status?(k({message:"批量禁用成功",type:"success"}),P()):k.error(t.msg)})})},at=()=>{if(h.value.length==0)return k.error("请至少勾选1条记录"),!1;me.confirm("确定批量启用勾选的号源吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{w.value=!0,Rt({ids:h.value}).then(t=>{w.value=!1,t.status?(k({message:"批量启用成功",type:"success"}),P()):k.error(t.msg)})})};let Y=_(!1),Q=_(!1),Le=_(0),Se=_(0),st=_(0),ke=_(0),ee=_(!1),ie=_([]);const R=[{name:"医生",id:1},{name:"护士站",id:4},{name:"微信",id:2},{name:"自助机",id:3}];let j=_([]),fe=_(!1),ne=_({begin_time:"",end_time:"",end_reservation_time:""}),xe=_(new Set),he=_(new Set);const Ee=()=>{j.value=R.map(t=>({appointment_type_id:t.id,count:""}))};Ee();const ut=Re(()=>j.value.reduce((t,e)=>t+(Number(e.count)||0),0)),it=()=>{if(h.value.length==0){k.error("请至少勾选1条记录");return}Ee();const t=new Set(h.value),e={};R.forEach(u=>{e[u.id]={count:[],locked_count:[]}});const o=[];if($.value.forEach(u=>{for(const i in u){if(i==="time_range")continue;const c=u[i];c&&c.id&&t.has(c.id)&&(o.push(c),c.countsInfo&&c.countsInfo.forEach(f=>{e[f.appointment_type_id]&&(e[f.appointment_type_id].count.push(f.count),e[f.appointment_type_id].locked_count.push(Number(f.locked_count)||0))}))}}),j.value=R.map(u=>{const i=e[u.id],c=f=>f.length>0&&f.every(b=>b===f[0]);return{appointment_type_id:u.id,count:i.count.length>0&&c(i.count)?i.count[0]:""}}),xe.value=new Set(R.filter(u=>{if(u.id===1)return!0;const i=e[u.id];return!!(i.count.some(c=>c>0)||i.locked_count.some(c=>c>0))}).map(u=>u.id)),o.length>0){const u=o[0].begin_time,i=o[0].end_time,c=o.every(f=>f.begin_time===u&&f.end_time===i);if(fe.value=c,c){const f={};o.forEach(E=>{const M=E.end_reservation_time;M!=null&&(f[M]=(f[M]||0)+1)});let b=o[0].end_reservation_time,B=0;for(const[E,M]of Object.entries(f))M>B&&(B=M,b=E);ne.value={begin_time:u,end_time:i,end_reservation_time:b}}else ne.value={begin_time:"",end_time:"",end_reservation_time:""}}else fe.value=!1,ne.value={begin_time:"",end_time:"",end_reservation_time:""};Le.value=0,Se.value=0,st.value=h.value.length,ke.value=0,ie.value=[],Q.value=!1,Y.value=!0},rt=async()=>{for(const c of j.value)if(Number(c.count)<0){k.error("数量不能为负数");return}if(j.value.every(c=>Number(c.count)===0)&&!await me.confirm("所有渠道数量均为0确定继续修改吗","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>!0).catch(()=>!1))return;const e=ut.value;Q.value=!0,Le.value=0,Se.value=0,ie.value=[],ke.value=0;const o=[...h.value],u=j.value.map(c=>({appointment_type_id:c.appointment_type_id,count:Number(c.count)||0})),i={ids:o,max_total:e,coutsInfo:u};fe.value&&(i.end_reservation_time=ne.value.end_reservation_time);try{const c=await Ut(i);Q.value=!1,c&&c.status?(Y.value=!1,k.success("批量修改完成"),P()):(k.error((c==null?void 0:c.msg)||"批量修改失败"),Q.value=!1)}catch{Q.value=!1,k.error("请求异常")}};let q=_(!1),te=_(!1),le=_([]),we=_({}),oe=_("");const Me=()=>{le.value=R.map(t=>({appointment_type_id:t.id,locked_count:""}))};Me(),Re(()=>le.value.reduce((t,e)=>t+(Number(e.locked_count)||0),0));const dt=(t,e)=>{const o=R[t],u=we.value[o.id];u!=null&&u.limited&&Number(e)>u.maxValue&&(le.value[t].locked_count=u.maxValue)},ct=()=>{if(h.value.length==0){k.error("请至少勾选1条记录");return}Me(),oe.value="";const t=new Set(h.value),e={},o={};R.forEach(i=>{e[i.id]=[],o[i.id]=[]}),$.value.forEach(i=>{for(const c in i){if(c==="time_range")continue;const f=i[c];f&&f.id&&t.has(f.id)&&f.countsInfo&&f.countsInfo.forEach(b=>{e[b.appointment_type_id]&&(e[b.appointment_type_id].push(b.count-b.used_count),o[b.appointment_type_id].push(Number(b.locked_count)||0))})}});const u={};R.forEach(i=>{const c=e[i.id];if(c.length>0){const f=Math.min(...c);u[i.id]={limited:!0,maxValue:f}}else u[i.id]={limited:!1,maxValue:null}}),we.value=u,he.value=new Set(R.filter(i=>{var f;return i.id===1||((f=u[i.id])==null?void 0:f.maxValue)>0||Math.max(...o[i.id]||[0])>0}).map(i=>i.id)),te.value=!1,q.value=!0},ft=async()=>{for(const o of le.value)if(Number(o.locked_count)<0){k.error("占用数量不能为负数");return}te.value=!0;const t=[...h.value],e=le.value.map(o=>({appointment_type_id:o.appointment_type_id,locked_count:Number(o.locked_count)||0}));try{const o=await $t({ids:t,coutsInfo:e,locked_remark:oe.value});te.value=!1,o&&o.status?(q.value=!1,k.success("批量占位完成"),P()):(k.error((o==null?void 0:o.msg)||"批量占位失败"),te.value=!1)}catch{te.value=!1,k.error("请求异常")}};let re=_(!1),Ve=_(!1),Ne=_(null),Ce=_(null),pt=_(null);const _t=(t,e)=>{pt.value=e,Ce.value=t,re.value=!0,Ve.value=!0,At({planid:t.id,qudaoid:e}).then(o=>{Ve.value=!1,o.status?Ne.value=o.data:k.error(o.msg)})};let F=_(!1),Te=_(new Set),C=_(null);const mt=t=>{F.value=!0,w.value=!0,$e({id:t.id}).then(e=>{w.value=!1,e.status?(C.value=e.data,C.value.coutsInfo.forEach(o=>{o.locked_count===null&&(o.locked_count=0)}),Te.value=new Set(C.value.coutsInfo.filter(o=>o.appointment_type_id===1||o.id===1||Number(o.count)>0||Number(o.locked_count)>0).map(o=>o.appointment_type_id||o.id))):k.error(e.msg)})},vt=()=>{let t=[],e=!1;C.value.coutsInfo.forEach(o=>{if(e)return;const u=o.count-o.used_count;if(Number(o.locked_count)>u){k.error(`${o.name} 的占位数量不能大于剩余可用数量,最多${u}`),e=!0;return}if(Number(o.locked_count)<0){k.error(`${o.name} 的占位数量不能为负数`),e=!0;return}t.push({appointment_type_id:o.appointment_type_id,locked_count:o.locked_count||0})}),!e&&(w.value=!0,Ot({roster_detail_id:C.value.id,locked_counts:t,locked_remark:C.value.locked_remark||""}).then(o=>{w.value=!1,o.status?(F.value=!1,P(),k.success("占位设置保存成功")):k.error(o.msg)}))},yt=t=>!t||!Array.isArray(t)?0:t.reduce((e,o)=>e+(Number(o.locked_count)||0),0),gt=t=>!t||!Array.isArray(t)?0:t.reduce((e,o)=>e+(Number(o.used_count)||0),0),bt=t=>!t||!Array.isArray(t)?!1:t.some(e=>e.appointment_type_id!==1&&(Number(e.count)>0||Number(e.locked_count)>0));function ze(t){const e=t.getFullYear(),o=String(t.getMonth()+1).padStart(2,"0"),u=String(t.getDate()).padStart(2,"0");return`${e}-${o}-${u}`}function kt(t){const e=t.map(f=>new Date(f)).sort((f,b)=>f-b),o=e[0],u=e[e.length-1],i=[];let c=new Date(o);for(;c<=u;)i.push(c.toISOString().split("T")[0]),c.setDate(c.getDate()+1);return i}function xt(t){const e=new Date(t);return isNaN(e)?"无效日期":["周日","周一","周二","周三","周四","周五","周六"][e.getDay()]}return wt(()=>{const t=new Date,e=ze(t),o=new Date(t);o.setDate(t.getDate()+14);const u=ze(o);Z.value.dateRange=[e,u],Qe(),et(),Ke(),document.addEventListener("mousemove",De),document.addEventListener("mouseup",Be)}),Vt(()=>{document.removeEventListener("mousemove",De),document.removeEventListener("mouseup",Be)}),(t,e)=>{const o=L("el-date-picker"),u=L("el-form-item"),i=L("el-button"),c=L("el-row"),f=L("el-icon"),b=L("el-empty"),B=L("el-tag"),E=L("el-checkbox"),M=L("el-checkbox-group"),U=L("el-input"),Ie=L("el-switch"),ae=L("el-form"),W=L("el-dialog"),G=L("el-table-column"),pe=L("el-table"),H=Ct("loading");return r(),p("div",null,[d("div",Yt,[a(c,null,{default:s(()=>[a(u,null,{default:s(()=>[a(o,{style:{"margin-left":"8px",width:"150px"},modelValue:n(Z).dateRange[0],"onUpdate:modelValue":e[0]||(e[0]=l=>n(Z).dateRange[0]=l),type:"date",placeholder:"开始时间","value-format":"YYYY-MM-DD"},null,8,["modelValue"]),e[28]||(e[28]=d("span",{style:{margin:"0 4px"}},"至",-1)),a(o,{style:{width:"150px"},modelValue:n(Z).dateRange[1],"onUpdate:modelValue":e[1]||(e[1]=l=>n(Z).dateRange[1]=l),type:"date",placeholder:"结束时间","value-format":"YYYY-MM-DD"},null,8,["modelValue"])]),_:1}),a(i,{onClick:e[2]||(e[2]=l=>P()),style:{"margin-left":"10px"}},{default:s(()=>[...e[29]||(e[29]=[m("搜索",-1)])]),_:1}),a(i,{type:"danger",onClick:e[3]||(e[3]=l=>nt()),style:{"margin-left":"10px"}},{default:s(()=>[...e[30]||(e[30]=[m("删除",-1)])]),_:1}),a(i,{type:"warning",onClick:e[4]||(e[4]=l=>ot()),style:{"margin-left":"10px"}},{default:s(()=>[...e[31]||(e[31]=[m("批量禁用",-1)])]),_:1}),a(i,{type:"success",onClick:e[5]||(e[5]=l=>at()),style:{"margin-left":"10px"}},{default:s(()=>[...e[32]||(e[32]=[m("批量启用",-1)])]),_:1}),a(i,{type:"primary",onClick:e[6]||(e[6]=l=>it()),style:{"margin-left":"10px"}},{default:s(()=>[...e[33]||(e[33]=[m("批量修改",-1)])]),_:1}),a(i,{type:"warning",onClick:e[7]||(e[7]=l=>ct()),style:{"margin-left":"10px"}},{default:s(()=>[...e[34]||(e[34]=[m("批量占位",-1)])]),_:1})]),_:1})]),d("div",qt,[d("div",Ft,[(r(!0),p(D,null,S(n(ce),(l,g)=>(r(),p("div",{key:g,onClick:y=>We(l.id),class:se({"zhenshiButton zhenshiButtonActive":l.id===n(X),zhenshiButton:l.id!==n(X)})},v(l.department_resources_name),11,Gt))),128))]),d("div",Zt,[e[41]||(e[41]=d("div",{style:{"text-align":"right",padding:"4px 8px","font-size":"12px",color:"#999"}},"数据格式:占位/已用/总数",-1)),_e((r(),p("div",{ref_key:"scrollContainer",ref:be,style:{border:"1px solid #efefef","overflow-x":"auto",position:"relative"}},[n($).length>0?(r(),p("table",Xt,[d("tr",jt,[d("td",null,[d("div",Wt,[e[35]||(e[35]=d("div",{style:{"margin-left":"30px","margin-right":"6px"}},"全选",-1)),d("div",{class:se({"plan_checkAllbox plan_checkAllbox_active":n(A)===1,"plan_checkAllbox ":n(A)===0}),onClick:e[8]||(e[8]=l=>Ye())},[n(A)===1?(r(),T(f,{key:0,color:"#ffffff"},{default:s(()=>[a(n(Ue))]),_:1})):x("",!0)],2)])]),(r(!0),p(D,null,S(n(de),(l,g)=>(r(),p("td",Ht,v(l.substring(5,10))+" "+v(xt(l)),1))),256))]),(r(!0),p(D,null,S(n($),(l,g)=>(r(),p("tr",{key:g},[(r(!0),p(D,null,S(l,(y,N)=>(r(),p("td",{key:N,"data-row":g,"data-col":N,onMouseover:I=>Ze(I,y),onMouseleave:I=>Xe(y.id),onMousedown:I=>je(I,y,g,N)},[d("div",null,[N=="time_range"?(r(),p("span",Jt,v(y),1)):x("",!0),y.countsInfo&&y.countsInfo.length>0?(r(),p("div",{key:1,class:se({planInfo_k:y.status==1,"planInfo_k planInfo_k_disabled":y.status==0,planInfo_k_selected:ue(y.id)&&y.status==1,planInfo_k_disabled_selected:ue(y.id)&&y.status==0})},[n(ye)==y.id?(r(),p("div",Qt,[d("div",{class:"icon_k",onClick:I=>tt(y.id)},[a(f,{color:"#409eff",size:"20"},{default:s(()=>[a(n(St))]),_:1}),e[36]||(e[36]=d("span",{class:"icon_text"},"编辑",-1))],8,el),d("div",{class:"icon_k",onClick:I=>_t(y,0)},[a(f,{color:"#409eff",size:"20"},{default:s(()=>[a(n(Et))]),_:1}),e[37]||(e[37]=d("span",{class:"icon_text"},"明细",-1))],8,tl),d("div",{class:"icon_k",onClick:I=>mt(y)},[a(f,{color:"#409eff",size:"20"},{default:s(()=>[a(n(Mt))]),_:1}),e[38]||(e[38]=d("span",{class:"icon_text"},"占位",-1))],8,ll)])):x("",!0),d("div",{class:se({"plan_checkbox plan_checkbox_active":ue(y.id),plan_checkbox:!ue(y.id)}),onClick:I=>qe(y.id)},[ue(y.id)?(r(),T(f,{key:0,color:"#ffffff"},{default:s(()=>[a(n(Ue))]),_:1})):x("",!0)],10,nl),bt(y.countsInfo)?(r(),p(D,{key:2},[d("div",dl,[d("div",cl,[e[39]||(e[39]=d("span",null,"总数:",-1)),m(v(y.countsInfo[0].max_total),1)])]),d("div",fl,[(r(!0),p(D,null,S(y.countsInfo,(I,Pe)=>(r(),p(D,{key:Pe},[I&&!(I.count===0&&I.used_count===0&&I.locked_count===0)?(r(),p("div",pl,[d("span",null,v(I.jiancheng),1),d("span",null,[d("span",{class:se({"yellow bold-text":I.locked_count>0})},v(I.locked_count!=null?I.locked_count:0),3),e[40]||(e[40]=d("span",null,"/",-1)),d("span",_l,v(I.used_count),1),m("/"+v(I.count),1)])])):x("",!0)],64))),128))])],64)):(r(),p("div",ol,[d("div",al,[d("span",sl,"占 "+v(yt(y.countsInfo)),1),d("span",ul,"用 "+v(gt(y.countsInfo)),1)]),d("div",il,[d("span",rl,"总 "+v(y.countsInfo[0].max_total),1)])])),d("div",ml,[(r(!0),p(D,null,S(y.patient_type_label,(I,Pe)=>(r(),p("div",vl,v(I),1))),256))])],2)):x("",!0)])],40,Kt))),128))]))),128))])):x("",!0),n(K)?(r(),p("div",{key:1,class:"drag-selection-overlay",style:It(n(ge))},null,4)):x("",!0),n($).length==0?(r(),p("div",yl,[a(b,{description:"暂无号源"})])):x("",!0)])),[[H,n(w)]])])]),a(W,{modelValue:n(O),"onUpdate:modelValue":e[13]||(e[13]=l=>z(O)?O.value=l:O=l),title:"修改",width:"40%"},{footer:s(()=>[d("span",wl,[a(i,{onClick:e[12]||(e[12]=l=>z(O)?O.value=!1:O=!1)},{default:s(()=>[...e[49]||(e[49]=[m("取消",-1)])]),_:1}),a(i,{type:"primary",onClick:lt},{default:s(()=>[...e[50]||(e[50]=[m(" 确定 ",-1)])]),_:1})])]),default:s(()=>[_e((r(),p("div",null,[n(V)?(r(),T(ae,{key:0,"label-width":"100px",style:{"padding-right":"40px"}},{default:s(()=>[a(u,{label:"日期:"},{default:s(()=>[m(v(n(V).date),1)]),_:1}),a(u,{label:"星期:"},{default:s(()=>[m(v(n(V).weekname),1)]),_:1}),a(u,{label:"科室:"},{default:s(()=>[m(v(n(V).department_name),1)]),_:1}),x("",!0),x("",!0),a(u,{label:"病人类型:"},{default:s(()=>[a(M,{disabled:"",modelValue:n(V).patientType,"onUpdate:modelValue":e[9]||(e[9]=l=>n(V).patientType=l)},{default:s(()=>[a(E,{label:"0"},{default:s(()=>[...e[42]||(e[42]=[m("住院",-1)])]),_:1}),a(E,{label:"1"},{default:s(()=>[...e[43]||(e[43]=[m("门诊",-1)])]),_:1}),a(E,{label:"2"},{default:s(()=>[...e[44]||(e[44]=[m("急诊",-1)])]),_:1}),a(E,{label:"3"},{default:s(()=>[...e[45]||(e[45]=[m("体检",-1)])]),_:1})]),_:1},8,["modelValue"])]),_:1}),a(u,{label:"时间段:"},{default:s(()=>[e[46]||(e[46]=m(" 开始时间:",-1)),d("span",gl,v(n(V).begin_time),1),e[47]||(e[47]=m(" 结束时间:",-1)),d("span",bl,v(n(V).end_time),1),e[48]||(e[48]=m(" 停止预约时间:",-1)),a(U,{modelValue:n(V).end_reservation_time,"onUpdate:modelValue":e[10]||(e[10]=l=>n(V).end_reservation_time=l),placeholder:"停止预约时间",style:{width:"120px",display:"inline-block"}},null,8,["modelValue"])]),_:1}),n(V).coutsInfo?(r(),T(u,{key:2,label:"号源数量:"},{default:s(()=>[d("div",null,[(r(!0),p(D,null,S(n(V).coutsInfo,(l,g)=>(r(),p(D,{key:g},[n(ve).has(l.appointment_type_id||l.id)?(r(),p("div",kl,[n(ve).size>1?(r(),p("div",xl,v(l.name),1)):x("",!0),d("div",hl,[a(U,{type:"number",modelValue:n(V).coutsInfo[g].count,"onUpdate:modelValue":y=>n(V).coutsInfo[g].count=y,min:1,placeholder:"0",oninput:"value=value.replace(/^0|[^0-9]/g, '')"},null,8,["modelValue","onUpdate:modelValue"])])])):x("",!0)],64))),128))])]),_:1})):x("",!0),a(u,{label:"状态:"},{default:s(()=>[a(Ie,{modelValue:n(V).status,"onUpdate:modelValue":e[11]||(e[11]=l=>n(V).status=l),size:"large","active-text":"正常","inactive-text":"关闭","active-value":1,"inactive-value":0},null,8,["modelValue"])]),_:1}),a(u,{label:"添加时间:"},{default:s(()=>[m(v(n(V).created_at),1)]),_:1})]),_:1})):x("",!0)])),[[H,n(w)]])]),_:1},8,["modelValue"]),a(W,{modelValue:n(re),"onUpdate:modelValue":e[14]||(e[14]=l=>z(re)?re.value=l:re=l),title:"预约明细",width:"75%"},{default:s(()=>[d("div",null,[d("div",Vl,[m(v(n(Ce).department_resources_name)+" ",1),(r(!0),p(D,null,S(n(Ce).devices,(l,g)=>(r(),p("span",{key:g,class:se(l.status==1&&l.is_del==0?"":"hongzi")},v(l.device_name),3))),128))]),_e((r(),T(pe,{data:n(Ne),style:{width:"100%"},"row-key":"id"},{default:s(()=>[a(G,{prop:"list_status",label:"状态",width:"100"},{default:s(l=>[l.row.list_status===0?(r(),T(B,{key:0,class:"ml-2",type:"info"},{default:s(()=>[...e[51]||(e[51]=[m("申请中",-1)])]),_:1})):x("",!0),l.row.list_status===1?(r(),T(B,{key:1,class:"ml-2",type:"success"},{default:s(()=>[...e[52]||(e[52]=[m("已预约",-1)])]),_:1})):x("",!0),l.row.list_status===2?(r(),T(B,{key:2,class:"ml-2"},{default:s(()=>[...e[53]||(e[53]=[m("登记",-1)])]),_:1})):x("",!0),l.row.list_status===3?(r(),T(B,{key:3,class:"ml-2",type:"warning"},{default:s(()=>[...e[54]||(e[54]=[m("完成",-1)])]),_:1})):x("",!0)]),_:1}),a(G,{prop:"user_name",label:"姓名"}),a(G,{prop:"user_phone",label:"电话"}),a(G,{prop:"reg_num",label:"登记号"}),a(G,{prop:"reservation_department",label:"申请科室"}),a(G,{label:"项目","show-overflow-tooltip":"","min-width":"220"},{default:s(l=>[l.row.is_share_slot==1?(r(),T(B,{key:0,size:"small",type:"warning",style:{"margin-right":"4px"}},{default:s(()=>[...e[55]||(e[55]=[m("人",-1)])]),_:1})):x("",!0),m(v(l.row.entrust)+v(l.row.requestComment?""+l.row.requestComment+"":"")+" ",1),l.row.use_seats&&l.row.use_seats>1?(r(),p("span",Cl,"×"+v(l.row.use_seats),1)):x("",!0)]),_:1}),a(G,{prop:"docotr",label:"开单医生"})]),_:1},8,["data"])),[[H,n(Ve)]])])]),_:1},8,["modelValue"]),a(W,{modelValue:n(F),"onUpdate:modelValue":e[17]||(e[17]=l=>z(F)?F.value=l:F=l),title:"占位设置",width:"40%"},{footer:s(()=>[d("span",Tl,[a(i,{onClick:e[16]||(e[16]=l=>z(F)?F.value=!1:F=!1)},{default:s(()=>[...e[58]||(e[58]=[m("取消",-1)])]),_:1}),a(i,{type:"primary",onClick:vt},{default:s(()=>[...e[59]||(e[59]=[m(" 确定 ",-1)])]),_:1})])]),default:s(()=>[_e((r(),p("div",null,[n(C)?(r(),T(ae,{key:0,"label-width":"120px",style:{"padding-right":"40px"}},{default:s(()=>[a(u,{label:"日期:"},{default:s(()=>[m(v(n(C).date),1)]),_:1}),a(u,{label:"星期:"},{default:s(()=>[m(v(n(C).weekname),1)]),_:1}),a(u,{label:"科室:"},{default:s(()=>[m(v(n(C).department_name),1)]),_:1}),a(u,{label:"资源:"},{default:s(()=>[m(v(n(C).resources_name),1)]),_:1}),a(u,{label:"服务组:"},{default:s(()=>[(r(!0),p(D,null,S(n(C).devices,(l,g)=>(r(),T(B,{key:g,type:l.status===1&&l.is_del===0?"":"danger",style:{"margin-left":"8px"}},{default:s(()=>[m(v(l.device_name),1)]),_:2},1032,["type"]))),128))]),_:1}),a(u,{label:"时间段:"},{default:s(()=>[e[56]||(e[56]=m(" 开始时间:",-1)),d("span",Il,v(n(C).begin_time),1),e[57]||(e[57]=m(" 结束时间:",-1)),d("span",Dl,v(n(C).end_time),1)]),_:1}),a(u,{label:"渠道占位:"},{default:s(()=>[d("div",Bl,[n(C).coutsInfo&&n(C).coutsInfo.length>0?(r(!0),p(D,{key:0},S(n(C).coutsInfo,(l,g)=>(r(),p(D,{key:g},[l&&!(l.count===0&&l.used_count===0&&l.locked_count===0)?(r(),p("div",Ll,[n(Te).size>1?(r(),p("div",Sl,v(l.name),1)):x("",!0),d("div",El,[a(U,{type:"number",modelValue:n(C).coutsInfo[g].locked_count,"onUpdate:modelValue":y=>n(C).coutsInfo[g].locked_count=y,placeholder:"占位数量",min:"0",oninput:"value=value.replace(/[^0-9]/g,'')"},null,8,["modelValue","onUpdate:modelValue"])]),d("div",Ml," 剩余可用: "+v(l.count-l.used_count),1)])):x("",!0)],64))),128)):(r(),p("div",Nl," 暂无渠道数据 "))])]),_:1}),a(u,{label:"占位备注:"},{default:s(()=>[a(U,{type:"textarea",modelValue:n(C).locked_remark,"onUpdate:modelValue":e[15]||(e[15]=l=>n(C).locked_remark=l),rows:3,placeholder:"选填,填写占位原因",maxlength:"200","show-word-limit":""},null,8,["modelValue"])]),_:1})]),_:1})):x("",!0)])),[[H,n(w)]])]),_:1},8,["modelValue"]),a(W,{modelValue:n(Y),"onUpdate:modelValue":e[21]||(e[21]=l=>z(Y)?Y.value=l:Y=l),title:"批量修改",width:"45%","close-on-click-modal":!1},{footer:s(()=>[a(i,{onClick:e[19]||(e[19]=l=>z(Y)?Y.value=!1:Y=!1),disabled:n(Q)},{default:s(()=>[...e[62]||(e[62]=[m("取消",-1)])]),_:1},8,["disabled"]),a(i,{type:"primary",onClick:e[20]||(e[20]=l=>rt()),disabled:n(Q)},{default:s(()=>[...e[63]||(e[63]=[m("确定修改",-1)])]),_:1},8,["disabled"])]),default:s(()=>[d("div",null,[d("div",zl,"已选 "+v(n(h).length)+" 条号源明细",1),a(ae,{"label-width":"100px"},{default:s(()=>[a(u,{label:"号源数量:"},{default:s(()=>[d("div",Pl,[(r(),p(D,null,S(R,(l,g)=>(r(),p(D,{key:g},[l.id===1||n(xe).has(l.id)?(r(),p("div",Rl,[n(xe).size>1?(r(),p("span",Ul,v(l.name),1)):x("",!0),a(U,{modelValue:n(j)[g].count,"onUpdate:modelValue":y=>n(j)[g].count=y,modelModifiers:{number:!0},placeholder:"数量",size:"default",style:{width:"220px"},oninput:"value=value.replace(/[^0-9]/g,'')"},null,8,["modelValue","onUpdate:modelValue"])])):x("",!0)],64))),64))])]),_:1})]),_:1}),n(fe)?(r(),p("div",$l,[e[61]||(e[61]=d("div",{style:{"margin-bottom":"8px","font-weight":"600",color:"#333","font-size":"13px"}},"时间段设置",-1)),d("div",Al,[d("div",Ol,[e[60]||(e[60]=d("div",{style:{width:"90px"}},"停止预约时间:",-1)),a(U,{modelValue:n(ne).end_reservation_time,"onUpdate:modelValue":e[18]||(e[18]=l=>n(ne).end_reservation_time=l),placeholder:"停止预约时间",style:{width:"120px"}},null,8,["modelValue"])])])])):x("",!0)])]),_:1},8,["modelValue"]),a(W,{modelValue:n(q),"onUpdate:modelValue":e[25]||(e[25]=l=>z(q)?q.value=l:q=l),title:"批量占位",width:"45%","close-on-click-modal":!1},{footer:s(()=>[a(i,{onClick:e[23]||(e[23]=l=>z(q)?q.value=!1:q=!1),disabled:n(te)},{default:s(()=>[...e[64]||(e[64]=[m("取消",-1)])]),_:1},8,["disabled"]),a(i,{type:"warning",onClick:e[24]||(e[24]=l=>ft()),disabled:n(te)},{default:s(()=>[...e[65]||(e[65]=[m("确定占位",-1)])]),_:1},8,["disabled"])]),default:s(()=>[d("div",null,[d("div",Yl,"已选 "+v(n(h).length)+" 条号源明细",1),a(ae,{"label-width":"100px"},{default:s(()=>[a(u,{label:"号源占位:"},{default:s(()=>[d("div",ql,[(r(),p(D,null,S(R,(l,g)=>{var y;return r(),p(D,{key:g},[n(he).has(l.id)?(r(),p("div",Fl,[n(he).size>1?(r(),p("span",Gl,v(l.name),1)):x("",!0),a(U,{modelValue:n(le)[g].locked_count,"onUpdate:modelValue":N=>n(le)[g].locked_count=N,modelModifiers:{number:!0},placeholder:"占用数量",size:"default",style:{width:"220px"},oninput:"value=value.replace(/[^0-9]/g,'')",onInput:N=>dt(g,N)},null,8,["modelValue","onUpdate:modelValue","onInput"]),d("span",Zl," 最大可占: "+v((y=n(we)[l.id])==null?void 0:y.maxValue),1)])):x("",!0)],64)}),64))])]),_:1}),a(u,{label:"占位备注:",style:{"margin-top":"10px"}},{default:s(()=>[a(U,{type:"textarea",modelValue:n(oe),"onUpdate:modelValue":e[22]||(e[22]=l=>z(oe)?oe.value=l:oe=l),rows:3,placeholder:"选填,填写占位原因",maxlength:"200","show-word-limit":""},null,8,["modelValue"])]),_:1})]),_:1})])]),_:1},8,["modelValue"]),a(W,{modelValue:n(ee),"onUpdate:modelValue":e[27]||(e[27]=l=>z(ee)?ee.value=l:ee=l),title:"修改结果",width:"40%"},{footer:s(()=>[a(i,{type:"primary",onClick:e[26]||(e[26]=l=>{z(ee)?ee.value=!1:ee=!1,P()})},{default:s(()=>[...e[69]||(e[69]=[m("确定",-1)])]),_:1})]),default:s(()=>[d("div",null,[d("div",Xl,[e[66]||(e[66]=m(" 成功: ",-1)),d("span",jl,v(n(ke)),1),e[67]||(e[67]=m(" 条 失败: ",-1)),d("span",Wl,v(n(ie).length),1),e[68]||(e[68]=m(" 条 ",-1))]),n(ie).length>0?(r(),p("div",Hl,[(r(!0),p(D,null,S(n(ie),(l,g)=>(r(),p("div",{key:g,style:{padding:"4px 0","font-size":"13px",color:"#f56c6c"}}," 第 "+v(l.index+1)+" 条(ID: "+v(l.id)+") → "+v(l.msg),1))),128))])):x("",!0)])]),_:1},8,["modelValue"])])}}},en=ht(Kl,[["__scopeId","data-v-f68da1bc"]]);export{en as default};