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