2 lines
16 KiB
JavaScript
2 lines
16 KiB
JavaScript
import{D as Se,B as ke,C as Ce,P as xe,Q as Ee,i as Ue,J as Ne,M as De,N as Be,T as Te,L as qe,R as Fe,aa as He,G as Pe,F as Re,V as Ae}from"./element-plus-Bolc0EfP.js";import{_ as Ie}from"./index.vue_vue_type_script_setup_true_lang-EJPdzUeK.js";import{s as Le,w as J}from"./@vue/runtime-dom-DDAG46FW.js";import{_ as Me}from"./index.vue_vue_type_script_setup_true_lang-zwvapztR.js";import{i as v,m as $e}from"./index-CzSP4TPL.js";import{a as Oe,b as Ge,c as Ke}from"./doctor-CwO7n1kw.js";import{h as Qe}from"./tcm-B2eDN42y.js";import{u as Ye}from"./usePaging-VsbTxSU0.js";import{f as W,b as je,ac as ze,as as Je,ak as d,I as S,a as l,aN as o,F as N,ap as D,G as g,O as c,J as b,aP as L,H as F,A as H}from"./@vue/runtime-core-C6bnekPw.js";import{y as a,a as M,r as $,n as k}from"./@vue/reactivity-DiY1c2vO.js";import{Q as f}from"./@vue/shared-mAAVTE9n.js";import"./@element-plus/icons-vue-B0jSCQ-G.js";import"./lodash-es-C2A-Pj28.js";import"./@popperjs/core-C5az9QE8.js";import"./dayjs-DG77mNTn.js";import"./lodash-D3kF6u-c.js";import"./@ctrl/tinycolor-BuyEbX8F.js";import"./async-validator-CFA_igpM.js";import"./normalize-wheel-es-BQoi3Ox2.js";import"./jspdf-BsthCvR5.js";import"./@babel/runtime-BanGtE2-.js";import"./fflate-_ayOYiT1.js";import"./vue-router-QlpZ4wdW.js";import"./pinia-B8cvXbiZ.js";import"./axios-C80V62Fs.js";import"./@vueuse/core-1S4fJlii.js";import"./@vueuse/shared-Cl3lVqjz.js";import"./css-color-function-DI01JAaZ.js";import"./balanced-match-BdS7OldZ.js";import"./color-B2zxaWkI.js";import"./clone-DBZ6_OiU.js";import"./color-convert-OrFsTA_V.js";import"./color-name-Dju3oUBS.js";import"./color-string-pUQDDJII.js";import"./ms-CzQ2E3wO.js";import"./vue-clipboard3-DByT_rEQ.js";import"./clipboard-CHgxszqY.js";import"./echarts-CNLwa9wG.js";import"./tslib-BDyQ-Jie.js";import"./zrender-DRNXw7y3.js";import"./highlight.js-Bxt7hFFy.js";import"./@highlightjs/vue-plugin-C4onkBvW.js";const We={class:"guahao-list"},Xe={class:"flex flex-wrap items-center gap-3 mb-4"},Ze={key:0,class:"text-sm text-gray-500"},et={class:"text-sm"},tt={class:"font-medium"},lt={class:"text-gray-500"},at={class:"text-xs text-gray-400"},nt={class:"text-gray-500"},ot={class:"text-sm"},it={key:0,class:"text-xs text-gray-400 truncate"},st={class:"flex justify-end mt-4"},rt={class:"text-sm text-gray-600 mb-4"},ut=W({name:"consumerPrescriptionGuahao"}),el=W({...ut,setup(dt){const m=$({start_date:"",end_date:"",patient_name:"",doctor_name:"",assistant_id:void 0,status:"",channel_source:""}),X={start_date:"",end_date:"",patient_name:"",doctor_name:"",assistant_id:void 0,status:"",channel_source:""},{pager:E,getLists:U,resetPage:B}=Ye({fetchFun:Oe,params:m}),T=k([]),O=k(null),h=k([]);function Z(i){h.value=i}const ee=new Set(["自媒体4H","自媒体3Q","自媒体3H","自媒体2H","自媒体2Q"]);function q(i){return ee.has(String(i??"").trim())}const y=k([]),te=H(()=>{const i=n.channel_source;if(i===""||i==null)return"";const e=y.value.find(s=>String(s.value)===String(i));return e?String(e.name??"").trim():""}),G=H(()=>q(te.value)),le=H(()=>{const i=p.channel_source;if(i===""||i==null)return"";const e=y.value.find(s=>String(s.value)===String(i));return e?String(e.name??"").trim():""}),K=H(()=>q(le.value));function ae(i){const e=y.value.find(u=>String(u.value)===String(i)),s=e?String(e.name??"").trim():"";q(s)||(p.channel_source_detail="")}const C=k(!1),P=k(!1),p=$({channel_source:"",channel_source_detail:""});function ne(){if(h.value.length===0){v.msgWarning("请先勾选挂号记录");return}p.channel_source="",p.channel_source_detail="",C.value=!0}function oe(){p.channel_source="",p.channel_source_detail=""}async function ie(){var i,e;if(h.value.length===0){v.msgWarning("请先勾选挂号记录");return}if(!p.channel_source){v.msgError("请选择渠道来源");return}if(K.value&&!p.channel_source_detail.trim()){v.msgError("请填写自媒体补充说明");return}P.value=!0;try{const s=h.value.map(u=>Number(u.id));await Ge({ids:s,channel_source:p.channel_source,channel_source_detail:p.channel_source_detail.trim()}),v.msgSuccess("批量修改成功"),C.value=!1,(e=(i=O.value)==null?void 0:i.clearSelection)==null||e.call(i),h.value=[],U()}finally{P.value=!1}}function se(i){const e=y.value.find(u=>String(u.value)===String(i)),s=e?String(e.name??"").trim():"";q(s)||(n.channel_source_detail="")}const x=k(!1),R=k(!1),n=$({id:0,appointment_date:"",appointment_time:"",period:"morning",appointment_type:"video",status:1,remark:"",assistant_id:void 0,channel_source:"",channel_source_detail:""});function re(i){const e=String(i||"");return e.length>=11?e.slice(0,3)+"****"+e.slice(-4):e||"—"}function Q(i){const e=String(i||"");return e.length>=5?e.slice(0,5):e||"—"}function ue(){Object.assign(m,X),B()}function de(i){const e=String(i.period??i.type??"morning");return e==="afternoon"||e==="all"?e:"morning"}async function me(){try{const i=await Qe();T.value=(i==null?void 0:i.lists)??i??[]}catch{T.value=[]}}async function pe(){try{const i=await $e({type:"channels"}),e=((i==null?void 0:i.channels)||[]).filter(s=>s.status!==0);e.sort((s,u)=>{const r=Number((u==null?void 0:u.sort)??0)-Number((s==null?void 0:s.sort)??0);return r!==0?r:Number((u==null?void 0:u.id)??0)-Number((s==null?void 0:s.id)??0)}),y.value=e}catch{y.value=[]}}function ce(i){n.id=Number(i.id),n.appointment_date=String(i.appointment_date||""),n.appointment_time=Q(String(i.appointment_time||"")),n.period=de(i),n.appointment_type=String(i.appointment_type||"video"),n.status=Number(i.status),n.remark=String(i.remark||"");const e=i.appointment_assistant_id;n.assistant_id=e!=null&&e!==""?Number(e):void 0,n.channel_source=String(i.channel_source??i.channels??""),n.channel_source_detail=String(i.channel_source_detail??""),x.value=!0}function _e(){n.id=0,n.appointment_date="",n.appointment_time="",n.period="morning",n.appointment_type="video",n.status=1,n.remark="",n.assistant_id=void 0,n.channel_source="",n.channel_source_detail=""}async function fe(){if(!n.appointment_date){v.msgError("请选择预约日期");return}if(!n.appointment_time){v.msgError("请选择预约时间");return}if(!n.channel_source){v.msgError("请选择渠道来源");return}if(G.value&&!n.channel_source_detail.trim()){v.msgError("请填写自媒体补充说明");return}R.value=!0;try{const i={id:n.id,appointment_date:n.appointment_date,appointment_time:n.appointment_time,period:n.period,appointment_type:n.appointment_type,status:n.status,remark:n.remark,assistant_id:n.assistant_id??"",channel_source:n.channel_source,channel_source_detail:n.channel_source_detail.trim()};await Ke(i),v.msgSuccess("保存成功"),x.value=!1,U()}finally{R.value=!1}}return je(()=>{me(),pe()}),ze(()=>{U()}),U(),(i,e)=>{const s=ke,u=Ce,r=Ee,V=xe,w=Ue,A=Se,Y=Ne,_=Be,ve=Te,ge=De,be=Ie,he=Fe,ye=He,I=Re,Ve=Pe,j=Ae,z=Je("perms"),we=qe;return d(),S("div",We,[l(Y,{class:"!border-none",shadow:"never"},{default:o(()=>[l(A,{class:"mb-[-16px]",model:a(m),inline:!0,onSubmit:e[7]||(e[7]=Le(()=>{},["prevent"]))},{default:o(()=>[l(s,{label:"预约日期"},{default:o(()=>[l(Me,{startTime:a(m).start_date,"onUpdate:startTime":e[0]||(e[0]=t=>a(m).start_date=t),endTime:a(m).end_date,"onUpdate:endTime":e[1]||(e[1]=t=>a(m).end_date=t)},null,8,["startTime","endTime"])]),_:1}),l(s,{label:"患者姓名"},{default:o(()=>[l(u,{modelValue:a(m).patient_name,"onUpdate:modelValue":e[2]||(e[2]=t=>a(m).patient_name=t),placeholder:"模糊搜索",clearable:"",class:"!w-[160px]",onKeyup:J(a(B),["enter"])},null,8,["modelValue","onKeyup"])]),_:1}),l(s,{label:"医生"},{default:o(()=>[l(u,{modelValue:a(m).doctor_name,"onUpdate:modelValue":e[3]||(e[3]=t=>a(m).doctor_name=t),placeholder:"模糊搜索",clearable:"",class:"!w-[140px]",onKeyup:J(a(B),["enter"])},null,8,["modelValue","onKeyup"])]),_:1}),l(s,{label:"医助"},{default:o(()=>[l(V,{modelValue:a(m).assistant_id,"onUpdate:modelValue":e[4]||(e[4]=t=>a(m).assistant_id=t),placeholder:"全部",clearable:"",filterable:"",class:"!w-[180px]"},{default:o(()=>[(d(!0),S(N,null,D(a(T),t=>(d(),g(r,{key:t.id,label:t.name+(t.account?` (${t.account})`:""),value:t.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),l(s,{label:"状态"},{default:o(()=>[l(V,{modelValue:a(m).status,"onUpdate:modelValue":e[5]||(e[5]=t=>a(m).status=t),placeholder:"全部",clearable:"",class:"!w-[130px]"},{default:o(()=>[l(r,{label:"已预约",value:1}),l(r,{label:"已取消",value:2}),l(r,{label:"已完成",value:3}),l(r,{label:"已过号",value:4})]),_:1},8,["modelValue"])]),_:1}),l(s,{label:"渠道"},{default:o(()=>[l(V,{modelValue:a(m).channel_source,"onUpdate:modelValue":e[6]||(e[6]=t=>a(m).channel_source=t),placeholder:"全部",clearable:"",filterable:"",class:"!w-[200px]"},{default:o(()=>[(d(!0),S(N,null,D(a(y),t=>(d(),g(r,{key:String(t.value),label:t.name,value:t.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),l(s,null,{default:o(()=>[l(w,{type:"primary",onClick:a(B)},{default:o(()=>[...e[24]||(e[24]=[c("查询",-1)])]),_:1},8,["onClick"]),l(w,{onClick:ue},{default:o(()=>[...e[25]||(e[25]=[c("重置",-1)])]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),l(Y,{class:"!border-none mt-4",shadow:"never"},{default:o(()=>[b("div",Xe,[L((d(),g(w,{type:"primary",disabled:a(h).length===0,onClick:ne},{default:o(()=>[...e[26]||(e[26]=[c(" 批量修改渠道 ",-1)])]),_:1},8,["disabled"])),[[z,["doctor.appointment/edit"]]]),a(h).length>0?(d(),S("span",Ze," 已选 "+f(a(h).length)+" 条 ",1)):F("",!0)]),L((d(),g(ge,{ref_key:"tableRef",ref:O,"row-key":"id",data:a(E).lists,size:"large",stripe:"",onSelectionChange:Z},{default:o(()=>[l(_,{type:"selection",width:"48",align:"center","reserve-selection":""}),l(_,{label:"ID",prop:"id",width:"72",align:"center"}),l(_,{label:"诊单/患者","min-width":"140"},{default:o(({row:t})=>[b("div",et,[b("div",tt,f(t.patient_name||"—"),1),b("div",lt,f(re(t.patient_phone)),1),b("div",at,"诊单 #"+f(t.diagnosis_id??t.patient_id),1)])]),_:1}),l(_,{label:"医生",prop:"doctor_name",width:"100","show-overflow-tooltip":""}),l(_,{label:"医助",prop:"assistant_name",width:"100","show-overflow-tooltip":""}),l(_,{label:"预约时间","min-width":"128"},{default:o(({row:t})=>[b("div",null,f(t.appointment_date),1),b("div",nt,f(Q(t.appointment_time))+" · "+f(t.period_desc),1)]),_:1}),l(_,{label:"类型",prop:"appointment_type_desc",width:"100"}),l(_,{label:"渠道","min-width":"130","show-overflow-tooltip":""},{default:o(({row:t})=>[b("div",ot,f(t.channel_source_desc||"—"),1),t.channel_source_detail?(d(),S("div",it,f(t.channel_source_detail),1)):F("",!0)]),_:1}),l(_,{label:"状态",width:"96",align:"center"},{default:o(({row:t})=>[l(ve,{type:t.status===1?"success":t.status===2?"info":t.status===3?"primary":"danger",size:"small",effect:"light"},{default:o(()=>[c(f(t.status_desc),1)]),_:2},1032,["type"])]),_:1}),l(_,{label:"备注",prop:"remark","min-width":"120","show-overflow-tooltip":""}),l(_,{label:"操作",width:"100",fixed:"right",align:"center"},{default:o(({row:t})=>[L((d(),g(w,{type:"primary",link:"",onClick:mt=>ce(t)},{default:o(()=>[...e[27]||(e[27]=[c(" 编辑 ",-1)])]),_:1},8,["onClick"])),[[z,["doctor.appointment/edit"]]])]),_:1})]),_:1},8,["data"])),[[we,a(E).loading]]),b("div",st,[l(be,{modelValue:a(E),"onUpdate:modelValue":e[8]||(e[8]=t=>M(E)?E.value=t:null),onChange:a(U)},null,8,["modelValue","onChange"])])]),_:1}),l(j,{modelValue:a(x),"onUpdate:modelValue":e[19]||(e[19]=t=>M(x)?x.value=t:null),title:"编辑挂号",width:"560px","destroy-on-close":"",onClosed:_e},{footer:o(()=>[l(w,{onClick:e[18]||(e[18]=t=>x.value=!1)},{default:o(()=>[...e[31]||(e[31]=[c("取消",-1)])]),_:1}),l(w,{type:"primary",loading:a(R),onClick:fe},{default:o(()=>[...e[32]||(e[32]=[c("保存",-1)])]),_:1},8,["loading"])]),default:o(()=>[l(A,{model:a(n),"label-width":"96px"},{default:o(()=>[l(s,{label:"预约日期",required:""},{default:o(()=>[l(he,{modelValue:a(n).appointment_date,"onUpdate:modelValue":e[9]||(e[9]=t=>a(n).appointment_date=t),type:"date","value-format":"YYYY-MM-DD",placeholder:"选择日期",class:"!w-full"},null,8,["modelValue"])]),_:1}),l(s,{label:"预约时间",required:""},{default:o(()=>[l(ye,{modelValue:a(n).appointment_time,"onUpdate:modelValue":e[10]||(e[10]=t=>a(n).appointment_time=t),format:"HH:mm","value-format":"HH:mm",placeholder:"时间",class:"!w-full"},null,8,["modelValue"])]),_:1}),l(s,{label:"时段",required:""},{default:o(()=>[l(Ve,{modelValue:a(n).period,"onUpdate:modelValue":e[11]||(e[11]=t=>a(n).period=t)},{default:o(()=>[l(I,{label:"morning"},{default:o(()=>[...e[28]||(e[28]=[c("上午",-1)])]),_:1}),l(I,{label:"afternoon"},{default:o(()=>[...e[29]||(e[29]=[c("下午",-1)])]),_:1}),l(I,{label:"all"},{default:o(()=>[...e[30]||(e[30]=[c("全天",-1)])]),_:1})]),_:1},8,["modelValue"])]),_:1}),l(s,{label:"问诊类型",required:""},{default:o(()=>[l(V,{modelValue:a(n).appointment_type,"onUpdate:modelValue":e[12]||(e[12]=t=>a(n).appointment_type=t),class:"!w-full"},{default:o(()=>[l(r,{label:"视频问诊",value:"video"}),l(r,{label:"图文问诊",value:"text"}),l(r,{label:"电话问诊",value:"phone"})]),_:1},8,["modelValue"])]),_:1}),l(s,{label:"渠道来源",required:""},{default:o(()=>[l(V,{modelValue:a(n).channel_source,"onUpdate:modelValue":e[13]||(e[13]=t=>a(n).channel_source=t),placeholder:"请选择渠道来源",filterable:"",class:"!w-full",onChange:se},{default:o(()=>[(d(!0),S(N,null,D(a(y),t=>(d(),g(r,{key:String(t.value),label:t.name,value:t.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),a(G)?(d(),g(s,{key:0,label:"自媒体补充",required:""},{default:o(()=>[l(u,{modelValue:a(n).channel_source_detail,"onUpdate:modelValue":e[14]||(e[14]=t=>a(n).channel_source_detail=t),maxlength:"128","show-word-limit":"",placeholder:"请输入自媒体相关补充内容",clearable:"",class:"!w-full"},null,8,["modelValue"])]),_:1})):F("",!0),l(s,{label:"状态",required:""},{default:o(()=>[l(V,{modelValue:a(n).status,"onUpdate:modelValue":e[15]||(e[15]=t=>a(n).status=t),class:"!w-full"},{default:o(()=>[l(r,{label:"已预约",value:1}),l(r,{label:"已取消",value:2}),l(r,{label:"已完成",value:3}),l(r,{label:"已过号",value:4})]),_:1},8,["modelValue"])]),_:1}),l(s,{label:"挂号医助"},{default:o(()=>[l(V,{modelValue:a(n).assistant_id,"onUpdate:modelValue":e[16]||(e[16]=t=>a(n).assistant_id=t),placeholder:"不修改可留空",clearable:"",filterable:"",class:"!w-full"},{default:o(()=>[(d(!0),S(N,null,D(a(T),t=>(d(),g(r,{key:t.id,label:t.name+(t.account?` (${t.account})`:""),value:t.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),l(s,{label:"备注"},{default:o(()=>[l(u,{modelValue:a(n).remark,"onUpdate:modelValue":e[17]||(e[17]=t=>a(n).remark=t),type:"textarea",rows:3,maxlength:"500","show-word-limit":""},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue"]),l(j,{modelValue:a(C),"onUpdate:modelValue":e[23]||(e[23]=t=>M(C)?C.value=t:null),title:"批量修改渠道",width:"520px","destroy-on-close":"",onClosed:oe},{footer:o(()=>[l(w,{onClick:e[22]||(e[22]=t=>C.value=!1)},{default:o(()=>[...e[33]||(e[33]=[c("取消",-1)])]),_:1}),l(w,{type:"primary",loading:a(P),onClick:ie},{default:o(()=>[...e[34]||(e[34]=[c("确定",-1)])]),_:1},8,["loading"])]),default:o(()=>[b("p",rt,"将对已选 "+f(a(h).length)+" 条挂号写入同一渠道来源(仅改渠道,不改其它字段)。",1),l(A,{model:a(p),"label-width":"96px"},{default:o(()=>[l(s,{label:"渠道来源",required:""},{default:o(()=>[l(V,{modelValue:a(p).channel_source,"onUpdate:modelValue":e[20]||(e[20]=t=>a(p).channel_source=t),placeholder:"请选择渠道来源",filterable:"",class:"!w-full",onChange:ae},{default:o(()=>[(d(!0),S(N,null,D(a(y),t=>(d(),g(r,{key:String(t.value),label:t.name,value:t.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),a(K)?(d(),g(s,{key:0,label:"自媒体补充",required:""},{default:o(()=>[l(u,{modelValue:a(p).channel_source_detail,"onUpdate:modelValue":e[21]||(e[21]=t=>a(p).channel_source_detail=t),maxlength:"128","show-word-limit":"",placeholder:"请输入自媒体相关补充内容",clearable:"",class:"!w-full"},null,8,["modelValue"])]),_:1})):F("",!0)]),_:1},8,["model"])]),_:1},8,["modelValue"])])}}});export{el as default};
|