2 lines
7.3 KiB
JavaScript
2 lines
7.3 KiB
JavaScript
import{D as Q,B as q,P as H,Q as W,G as X,F as A,X as K,i as Z,J as $,M as tt,N as et,U as at,r as ot,T as lt,L as st,E as nt}from"./element-plus-D_tJqBgC.js";import{d as rt,f as it}from"./doctor-ERC0u9ds.js";import{f as dt,b as pt,ak as i,I as _,a,aN as e,F as E,ap as x,G as u,O as r,H as k,aP as mt,J as c}from"./@vue/runtime-core-C0pg79pw.js";import{Q as d,o as L}from"./@vue/shared-mAAVTE9n.js";import{o as b,r as _t}from"./@vue/reactivity-BIbyPIZJ.js";import{_ as ct}from"./index-CLJhkNLF.js";import"./@vue/runtime-dom-iFk_KP8y.js";import"./lodash-D3kF6u-c.js";import"./@element-plus/icons-vue-CmwKjXis.js";import"./lodash-es-BADexyn7.js";import"./@popperjs/core-C5az9QE8.js";import"./dayjs-DG77mNTn.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-CYz6RFzi.js";import"./pinia-Ba_jX6-d.js";import"./axios-C80V62Fs.js";import"./@vueuse/core-DIKi2bJB.js";import"./@vueuse/shared-D8934tfB.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-DYKKs4Al.js";import"./tslib-BDyQ-Jie.js";import"./zrender-CTTuYiLF.js";import"./highlight.js-Bxt7hFFy.js";import"./@highlightjs/vue-plugin-BVMzZUvF.js";const ut={class:"statistics-page"},ft={class:"dept-stats"},gt={key:0,class:"text-gray-400"},yt={class:"channel-stats"},bt={key:0,class:"text-gray-400"},vt={class:"font-semibold text-blue-600"},ht={class:"text-gray-700"},wt=dt({__name:"tongji",setup(Et){const f=b(!1),C=b([]),V=b([]),p=b([]),s=_t({doctor_id:"",time_type:"today",start_date:"",end_date:""}),N=async()=>{try{const o=await rt({role_id:1});C.value=o.lists||[]}catch(o){console.error("获取医生列表失败:",o)}},v=async()=>{f.value=!0;try{const o={time_type:s.time_type};s.doctor_id&&(o.doctor_id=s.doctor_id),s.time_type==="custom"&&p.value&&p.value.length===2&&(o.start_date=p.value[0],o.end_date=p.value[1]);const l=await it(o);V.value=l.lists||[]}catch(o){console.error("获取统计数据错误:",o),nt.error(o.msg||"获取统计数据失败")}finally{f.value=!1}},S=()=>{s.time_type!=="custom"&&(p.value=[])},F=()=>{s.doctor_id="",s.time_type="today",p.value=[],v()},D=o=>o>=80?"text-green-600 font-semibold":o>=60?"text-blue-600 font-semibold":o>=40?"text-orange-600 font-semibold":"text-red-600 font-semibold",M=o=>!o||o==="未分配"?[]:o.split(" ").filter(l=>l.trim()),R=o=>!o||o==="未设置"?[]:o.split(" ").filter(l=>l.trim());return pt(()=>{N(),v()}),(o,l)=>{const P=W,U=H,g=q,y=A,Y=X,G=K,z=Z,I=Q,T=$,n=et,m=at,B=ot,j=lt,J=tt,O=st;return i(),_("div",ut,[a(T,{shadow:"never",class:"!border-none"},{default:e(()=>[a(I,{inline:!0,model:s,class:"filter-form"},{default:e(()=>[a(g,{label:"医生"},{default:e(()=>[a(U,{modelValue:s.doctor_id,"onUpdate:modelValue":l[0]||(l[0]=t=>s.doctor_id=t),placeholder:"全部医生",clearable:"",filterable:"",style:{width:"200px"}},{default:e(()=>[(i(!0),_(E,null,x(C.value,t=>(i(),u(P,{key:t.id,label:t.name,value:t.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),a(g,{label:"时间范围"},{default:e(()=>[a(Y,{modelValue:s.time_type,"onUpdate:modelValue":l[1]||(l[1]=t=>s.time_type=t),onChange:S},{default:e(()=>[a(y,{label:"today"},{default:e(()=>[...l[3]||(l[3]=[r("今天",-1)])]),_:1}),a(y,{label:"week"},{default:e(()=>[...l[4]||(l[4]=[r("最近7天",-1)])]),_:1}),a(y,{label:"month"},{default:e(()=>[...l[5]||(l[5]=[r("最近30天",-1)])]),_:1}),a(y,{label:"custom"},{default:e(()=>[...l[6]||(l[6]=[r("自定义",-1)])]),_:1})]),_:1},8,["modelValue"])]),_:1}),s.time_type==="custom"?(i(),u(g,{key:0},{default:e(()=>[a(G,{modelValue:p.value,"onUpdate:modelValue":l[2]||(l[2]=t=>p.value=t),type:"daterange","range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期","value-format":"YYYY-MM-DD",style:{width:"260px"}},null,8,["modelValue"])]),_:1})):k("",!0),a(g,null,{default:e(()=>[a(z,{type:"primary",onClick:v,loading:f.value},{default:e(()=>[...l[7]||(l[7]=[r("查询",-1)])]),_:1},8,["loading"]),a(z,{onClick:F},{default:e(()=>[...l[8]||(l[8]=[r("重置",-1)])]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),a(T,{shadow:"never",class:"!border-none mt-4"},{default:e(()=>[mt((i(),u(J,{data:V.value,border:"",stripe:"",style:{width:"100%"},"header-cell-style":{background:"#f5f7fa",color:"#606266",fontWeight:"600"}},{empty:e(()=>[a(j,{description:"暂无统计数据"})]),default:e(()=>[a(n,{prop:"doctor_name",label:"医生姓名",width:"120",fixed:""}),a(n,{label:"部门统计","min-width":"250",fixed:""},{default:e(({row:t})=>[c("div",ft,[(i(!0),_(E,null,x(M(t.dept_stats),(h,w)=>(i(),u(m,{key:w,type:"primary",size:"small",class:"stat-tag"},{default:e(()=>[r(d(h),1)]),_:2},1024))),128)),!t.dept_stats||t.dept_stats==="未分配"?(i(),_("span",gt,"未分配")):k("",!0)])]),_:1}),a(n,{label:"渠道统计","min-width":"250"},{default:e(({row:t})=>[c("div",yt,[(i(!0),_(E,null,x(R(t.channel_stats),(h,w)=>(i(),u(m,{key:w,type:"success",size:"small",class:"stat-tag"},{default:e(()=>[r(d(h),1)]),_:2},1024))),128)),!t.channel_stats||t.channel_stats==="未设置"?(i(),_("span",bt,"未设置")):k("",!0)])]),_:1}),a(n,{prop:"total_count",label:"总诊单",width:"90",align:"center"},{default:e(({row:t})=>[c("span",vt,d(t.total_count),1)]),_:1}),a(n,{prop:"diagnosis_count",label:"诊单数",width:"90",align:"center"},{default:e(({row:t})=>[a(B,{content:"统计期内该医生挂号涉及的去重诊单数,用于计算成交率",placement:"top"},{default:e(()=>[c("span",ht,d(t.diagnosis_count??0),1)]),_:2},1024)]),_:1}),a(n,{prop:"deal_count",label:"成交单",width:"90",align:"center"},{default:e(({row:t})=>[a(B,{content:"上述诊单中已开有效处方(未删除、未作废)的数量",placement:"top"},{default:e(()=>[a(m,{type:"primary",size:"small"},{default:e(()=>[r(d(t.deal_count??0),1)]),_:2},1024)]),_:2},1024)]),_:1}),a(n,{prop:"deal_rate",label:"成交率",width:"100",align:"center"},{default:e(({row:t})=>[c("span",{class:L(D(Number(t.deal_rate??0)))},d(t.deal_rate??0)+"% ",3)]),_:1}),a(n,{prop:"registered_count",label:"已挂号",width:"90",align:"center"},{default:e(({row:t})=>[a(m,{type:"info",size:"small"},{default:e(()=>[r(d(t.registered_count),1)]),_:2},1024)]),_:1}),a(n,{prop:"completed_count",label:"已完成",width:"90",align:"center"},{default:e(({row:t})=>[a(m,{type:"success",size:"small"},{default:e(()=>[r(d(t.completed_count),1)]),_:2},1024)]),_:1}),a(n,{prop:"missed_count",label:"已过号",width:"90",align:"center"},{default:e(({row:t})=>[a(m,{type:"warning",size:"small"},{default:e(()=>[r(d(t.missed_count),1)]),_:2},1024)]),_:1}),a(n,{prop:"cancelled_count",label:"已取消",width:"90",align:"center"},{default:e(({row:t})=>[a(m,{type:"danger",size:"small"},{default:e(()=>[r(d(t.cancelled_count),1)]),_:2},1024)]),_:1}),a(n,{prop:"completion_rate",label:"完成率",width:"100",align:"center"},{default:e(({row:t})=>[c("span",{class:L(D(t.completion_rate))},d(t.completion_rate)+"% ",3)]),_:1}),a(n,{prop:"time_range",label:"统计时间","min-width":"200"})]),_:1},8,["data"])),[[O,f.value]])]),_:1})])}}}),re=ct(wt,[["__scopeId","data-v-8127dd72"]]);export{re as default};
|