6 lines
79 KiB
JavaScript
6 lines
79 KiB
JavaScript
import{P as Ln,Q as zn,ag as $n,W as An,L as Pn,a2 as Rn,i as On,d as Mn,J as In,m as Tn,l as Vn,M as Fn,N as En,R as Bn,r as Yn,a4 as Un,a5 as Hn,X as Wn,e as qn,V as Gn,E as Re}from"./element-plus-DFTWCWyi.js";import{s as J,w as Jn}from"./@vue/runtime-dom-DDAG46FW.js";import{a as ie}from"./axios-C80V62Fs.js";import{N as Kn,x as Xn,i as E}from"./@element-plus/icons-vue-HOEUG8sr.js";import{H as Z}from"./vue-echarts-BNtg2q_G.js";import{h as Qn,y as He,i as Zn,j as el,k as tl,l as al,m as nl,n as ll,o as ol,p as sl}from"./stats-CcpXNN76.js";import{d as il}from"./finance-DU7ki2Gw.js";import{k as ua}from"./tcm-B5X1iJji.js";import{u as rl,_ as dl}from"./index-BOT-n-x_.js";import{f as ul,b as cl,ak as o,I as c,J as a,a as r,aN as _,F as w,ap as V,G as j,aP as K,O as u,H as y,A as z}from"./@vue/runtime-core-C6bnekPw.js";import{Q as d,o as lt}from"./@vue/shared-mAAVTE9n.js";import{y as C,n as v}from"./@vue/reactivity-DiY1c2vO.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"./resize-detector-G6vbKCU7.js";import"./echarts-CNLwa9wG.js";import"./tslib-BDyQ-Jie.js";import"./zrender-DRNXw7y3.js";import"./jspdf-BsthCvR5.js";import"./@babel/runtime-BanGtE2-.js";import"./fflate-_ayOYiT1.js";import"./vue-router-QlpZ4wdW.js";import"./pinia-B8cvXbiZ.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"./highlight.js-Bxt7hFFy.js";import"./@highlightjs/vue-plugin-C4onkBvW.js";const _l={class:"yeji-page"},pl={class:"filter-surface"},ml={class:"filter-row filter-row--top"},vl={class:"filter-field"},fl={class:"channel-opt-row"},yl={class:"opt-name"},hl={class:"opt-count"},bl={class:"filter-field filter-field--wide"},gl={class:"filter-select filter-select--dept filter-dept-tree-wrap"},wl={class:"filter-field filter-field--date-top"},kl={class:"filter-actions"},jl={class:"filter-quick"},xl={class:"date-pills",role:"group","aria-label":"快捷日期"},Nl=["onClick"],Sl={class:"doctor-daily-card__head"},Cl={class:"doctor-daily-card__title-block"},Dl={key:0,class:"doctor-daily-card__range"},Ll={class:"doctor-daily-card__tools"},zl={key:0,class:"leaderboards-wrap"},$l={class:"leaderboard-hint"},Al={class:"muted"},Pl={class:"tables-wrap"},Rl={key:0,class:"yeji-table leaderboard-table"},Ol={class:"yeji-table__header"},Ml={key:0,class:"leaderboard-sub"},Il={class:"yeji-table__scroll",tabindex:"0",role:"region","aria-label":"排行榜,可横向滚动"},Tl={class:"yeji-table__body yeji-table__body--leaderboard"},Vl=["onClick"],Fl={class:"col-rank"},El={class:"col-abbr"},Bl={class:"col-name"},Yl={class:"col-consult"},Ul={class:"col-deal"},Hl={class:"col-assign"},Wl=["onClick"],ql={key:0,class:"yeji-lead-cell--link"},Gl=["onClick"],Jl={key:0,class:"yeji-lead-cell--link"},Kl=["onClick"],Xl={key:0,class:"yeji-lead-cell--link"},Ql={class:"yeji-table__foot yeji-table__foot--left"},Zl={key:0},eo={key:0,class:"empty-tip leaderboard-empty"},to={class:"tables-wrap"},ao={key:0,class:"empty-tip"},no={class:"yeji-table__header"},lo={class:"yeji-table__scroll",tabindex:"0",role:"region","aria-label":"业绩数据表,可横向滚动"},oo={class:"yeji-table__body yeji-table__body--data"},so={style:{"max-width":"320px","line-height":"1.7","font-size":"12px"}},io={style:{"max-width":"320px","line-height":"1.7","font-size":"12px"}},ro={style:{"max-width":"280px","line-height":"1.7","font-size":"12px"}},uo={key:0,class:"col-completed col-narrow-head"},co={class:"yeji-th-label"},_o={style:{"max-width":"340px","line-height":"1.7","font-size":"12px"}},po={key:1,class:"col-completed col-narrow-head"},mo={class:"yeji-th-label"},vo={style:{"max-width":"320px","line-height":"1.7","font-size":"12px"}},fo={key:2,class:"col-completed col-narrow-head"},yo={class:"yeji-th-label"},ho={style:{"max-width":"280px","line-height":"1.7","font-size":"12px"}},bo={style:{"max-width":"320px","line-height":"1.7","font-size":"12px"}},go=["onClick"],wo={class:"col-dept"},ko=["onClick"],jo={key:0,class:"yeji-lead-cell--link"},xo=["onClick"],No={key:0,class:"yeji-lead-cell--link"},So=["onClick"],Co={key:0,class:"yeji-lead-cell--link"},Do=["onClick"],Lo={key:0,class:"col-completed"},zo=["onClick"],$o=["onClick"],Ao={key:0,class:"yeji-lead-cell--link"},Po={key:1,class:"col-completed"},Ro={key:2,class:"col-completed"},Oo={class:"total-row"},Mo=["onClick"],Io={key:0,class:"col-completed"},To=["onClick"],Vo={key:1,class:"col-completed"},Fo={key:2,class:"col-completed"},Eo={class:"yeji-table__foot"},Bo={key:0},Yo={key:1},Uo={class:"tp-matrix-wrap"},Ho={class:"tp-matrix__title"},Wo={class:"tp-matrix",role:"list"},qo={class:"tp-matrix-card__head"},Go={class:"tp-matrix-card__titles"},Jo={key:0,class:"tp-matrix-card__parent"},Ko={class:"tp-matrix-card__name"},Xo={class:"tp-matrix-card__target"},Qo={class:"tp-matrix-card__table"},Zo={class:"tp-matrix-card__num"},es={key:0},ts={class:"tp-matrix-card__num"},as={key:1},ns={class:"tp-matrix-card__num"},ls={class:"tp-matrix-card__num tp-matrix-card__num--hot"},os={class:"tp-matrix-card__num"},ss={class:"yeji-charts-stack"},is={key:0,class:"yeji-chart-block"},rs={class:"yeji-chart-block__title"},ds={key:0,class:"yeji-chart-block__sub"},us={class:"yeji-chart-panel"},cs={class:"yeji-chart-panel"},_s={class:"yeji-chart-panel"},ps={class:"yeji-chart-panel"},ms={class:"yeji-chart-panel"},vs={key:0,class:"yeji-chart-block"},fs={class:"yeji-chart-block__title"},ys={class:"yeji-chart-panel"},hs={class:"yeji-chart-panel"},bs={class:"yeji-chart-block__title"},gs={key:0,class:"yeji-chart-block__sub"},ws={class:"yeji-chart-block__sub yeji-chart-block__sub--muted"},ks={class:"yeji-chart-panel"},js={class:"yeji-order-drawer__header"},xs={class:"yeji-order-drawer__heading"},Ns={class:"yeji-order-drawer__sub"},Ss={class:"yeji-order-drawer__shell"},Cs={class:"yeji-order-drawer__stats",role:"region","aria-label":"订单汇总"},Ds={class:"yeji-order-drawer__stat-card"},Ls={class:"yeji-order-drawer__stat-value"},zs={class:"yeji-order-drawer__stat-card"},$s={class:"yeji-order-drawer__stat-value"},As={class:"yeji-order-drawer__stat-card yeji-order-drawer__stat-card--total"},Ps={class:"yeji-order-drawer__stat-label"},Rs={class:"yeji-order-drawer__stat-note"},Os={class:"yeji-order-drawer__stat-value yeji-order-drawer__stat-value--money"},Ms={class:"yeji-order-drawer__stat-card yeji-order-drawer__stat-card--accent"},Is={class:"yeji-order-drawer__stat-label"},Ts={class:"yeji-order-drawer__stat-note"},Vs={class:"yeji-order-drawer__stat-value yeji-order-drawer__stat-value--money"},Fs={key:1,class:"yeji-order-drawer__stat-card yeji-order-drawer__stat-card--accent"},Es={class:"yeji-order-drawer__stat-value yeji-order-drawer__stat-value--money"},Bs={key:2,class:"yeji-order-drawer__stat-card yeji-order-drawer__stat-card--muted"},Ys={class:"yeji-order-drawer__stat-value"},Us={class:"yeji-order-drawer__body"},Hs={key:0,class:"yeji-order-appt-lines"},Ws={class:"yeji-order-appt-line"},qs={class:"yeji-order-appt-line"},Gs={key:0,class:"yeji-order-appt-sub"},Js={class:"yeji-order-appt-line"},Ks={class:"yeji-order-appt-line yeji-order-appt-line--channel"},Xs={class:"yeji-order-appt-channel-text"},Qs={key:0,class:"yeji-order-appt-sub"},Zs={key:1,class:"yeji-order-appt-empty"},ei={class:"yeji-order-amt"},ti={class:"yeji-order-drawer__pager"},ai={class:"yeji-unassigned-dialog__head"},ni={class:"yeji-unassigned-dialog__sub"},li={key:0,class:"yeji-unassigned-dialog__note"},oi={class:"yeji-unassigned-dialog__body"},si={class:"yeji-unassigned-dialog__head"},ii={class:"yeji-unassigned-dialog__sub"},ri={key:0,class:"yeji-unassigned-dialog__note"},di={class:"yeji-unassigned-dialog__body"},ui={key:2,class:"yeji-leadlines-dialog__pager"},ci={class:"yeji-unassigned-dialog__head"},_i={class:"yeji-unassigned-dialog__sub"},pi={key:0,class:"yeji-unassigned-dialog__note"},mi={class:"yeji-unassigned-dialog__body"},vi={key:2,class:"yeji-leadlines-dialog__pager"},fi={class:"yeji-unassigned-dialog__head"},yi={class:"yeji-unassigned-dialog__sub"},hi={key:0,class:"yeji-unassigned-dialog__note"},bi={class:"yeji-unassigned-dialog__body"},gi=["onClick","onKeydown"],ca=30,wi="stats.doctorDailyStats/overview",ki=ul({__name:"yeji",setup(ji){const _a={value:"id",label:"name",children:"children"};function pa(t){if(!t.length)return[];const e=new Map;for(const h of t)e.set(h.id,{...h,children:[]});const n=[];for(const h of t){const g=e.get(h.id),k=Number(h.pid);k>0&&e.has(k)?e.get(k).children.push(g):n.push(g)}const s=h=>{var g;(g=h.children)!=null&&g.length?h.children.forEach(s):delete h.children};n.forEach(s);const i=h=>{var g;h.sort((k,B)=>{const I=k.name.includes("中心")?-1:1,p=B.name.includes("中心")?-1:1;return I!==p?I-p:k.id-B.id});for(const k of h)(g=k.children)!=null&&g.length&&i(k.children)};return i(n),n}const le=v(!1),he=v([]),ot=v(!1),ma=z(()=>pa(he.value)),A=v([]),We=v([]),st=v(!1),x=v(""),Y=v(null),re=v([]);function it(t,e){if(!t||typeof t!="object")return e;for(const n of Object.keys(t)){const s=parseInt(n,10);!Number.isNaN(s)&&s>=2&&(e=Math.max(e,s))}return e}function va(t){var n;let e=0;for(const s of t){for(const i of s.rows)e=it(i.revisit_slots,e);e=it((n=s.total)==null?void 0:n.revisit_slots,e)}return e}const rt=z(()=>{const t=Math.min(va(re.value),ca);return t<2?[]:Array.from({length:t-1},(e,n)=>n+2)});function fa(t){if(!t.er_center_subtree)return 0;let e=0;for(const n of t.rows)e=it(n.revisit_slots,e);return e}function Ct(t){const e=Math.min(fa(t),ca);return e<2?[]:Array.from({length:e-1},(n,s)=>s+2)}function qe(t){if(t===2)return"复诊2";const e=["三","四","五","六","七","八","九","十"];return t>=3&&t<=10?`复诊${e[t-3]}`:`复诊${t}`}function ee(t,e){const n=t==null?void 0:t.revisit_slots;if(!n||typeof n!="object")return 0;const s=n[e]??n[String(e)],i=Number(s);return Number.isFinite(i)?i:0}const N=v(null),oe=v(!1),dt=v(!1),be=v(!1),Dt=v(""),Oe=v(""),ge=v([]),ut=v(!1),we=v(!1),Lt=v(""),Me=v(""),ke=v([]),zt=v(null),ct=v(!1),de=v(!1),$t=v(""),Ie=v(""),je=v([]),Te=v(0),Ve=v(1),Ge=v(20),At=v(null),Je=v(!1),ue=v(!1),_t=v(""),xe=v(""),se=v([]),Ne=v(0),ce=v(1),Se=v(20),pt=v(null),ya=z(()=>se.value.some(t=>String(t.channel_source??"")!=="")),Pt=v("zyyt"),ha=rl(),Ce=z(()=>(ha.perms||[]).some(e=>e==="*"||e===wi)),Rt=z(()=>{var t;return(((t=N.value)==null?void 0:t.leaderboards)??[]).filter(e=>e.rows.length>0)});function Ot(t){return t.rows.some(e=>e.dept_id>0&&(Number(e.lead_count)>0||Number(e.consult_count)>0||Number(e.deal_order_count)>0||Number(e.performance_amount)>0||Number(e.completed_performance_amount)>0))}const De=v(!1),U=v([]),Le=v({}),Ke=v(null),Xe=z(()=>{const t=Ke.value;return!(t!=null&&t.start)||!(t!=null&&t.end)?"":t.start===t.end?`区间 ${t.start}`:`区间 ${t.start} ~ ${t.end}`}),mt=z(()=>U.value.some(t=>Number(t.deal_amount??0)>0)),vt=z(()=>U.value.some(t=>Number(t.system_prescription_count??0)>0||Number(t.manual_prescription_count??0)>0)),ba=z(()=>Ce.value?mt.value||vt.value||ft.value||yt.value||ht.value:!1),ga=z(()=>{if(ba.value)return!0;for(const t of re.value)if(Ot(t))return!0;return Rt.value.length>0}),ft=z(()=>{const t=Le.value;return Number(t.appointment_completed??0)+Number(t.appointment_missed??0)+Number(t.appointment_cancelled??0)>0}),wa=z(()=>{const t=Le.value,e=[{value:Number(t.appointment_completed??0),name:"挂号完成"},{value:Number(t.appointment_missed??0),name:"过号"},{value:Number(t.appointment_cancelled??0),name:"取消"}].filter(n=>n.value>0);return{color:["#0d9488","#d97706","#94a3b8"],tooltip:{trigger:"item",formatter:"{b}: {c} ({d}%)"},legend:{bottom:0,type:"scroll",textStyle:{fontSize:10}},series:[{name:"挂号",type:"pie",radius:["42%","68%"],center:["50%","46%"],avoidLabelOverlap:!0,itemStyle:{borderRadius:6,borderColor:"#fff",borderWidth:2},label:{formatter:`{b}
|
||
{c}`,fontSize:11},data:e}]}}),yt=z(()=>U.value.filter(t=>Number(t.deal_order_count??0)>0&&Number(t.deal_amount??0)>0).length>=2),ka=z(()=>{const t=U.value.filter(s=>Number(s.deal_order_count??0)>0&&Number(s.deal_amount??0)>0),e=Math.max(...t.map(s=>Number(s.deal_amount)),1),n=t.map(s=>{const i=Number(s.deal_amount);return{name:String(s.doctor_name||"—"),value:[Number(s.deal_order_count),i],symbolSize:12+Math.sqrt(i/e)*26}});return{color:["#2563eb"],tooltip:{trigger:"item",formatter:s=>{var h;const i=(h=s.data)==null?void 0:h.value;return Array.isArray(i)?`${s.data.name}<br/>接诊诊单:${i[0]}<br/>金额:${Number(i[1]).toLocaleString("zh-CN",{minimumFractionDigits:2,maximumFractionDigits:2})} 元`:""}},grid:{left:48,right:24,top:28,bottom:32,containLabel:!0},xAxis:{type:"value",name:"接诊诊单",nameLocation:"middle",nameGap:28,splitLine:{lineStyle:{type:"dashed",opacity:.55}}},yAxis:{type:"value",name:"成交金额",nameLocation:"middle",nameGap:40,splitLine:{lineStyle:{type:"dashed",opacity:.55}}},series:[{type:"scatter",data:n}]}}),ht=z(()=>U.value.filter(e=>Number(e.deal_amount??0)+Number(e.deal_order_count??0)+Number(e.system_prescription_count??0)+Number(e.manual_prescription_count??0)>0).length>=2),ja=z(()=>{const t=[...U.value].filter(p=>Number(p.deal_amount??0)+Number(p.deal_order_count??0)+Number(p.system_prescription_count??0)+Number(p.manual_prescription_count??0)>0).sort((p,R)=>Number(R.deal_amount)-Number(p.deal_amount)).slice(0,5);if(t.length<2)return{radar:{indicator:[]},series:[{type:"radar",data:[]}]};const e=p=>{const R=String(p.doctor_name||"—");return R.length>7?`${R.slice(0,7)}…`:R},n=p=>Number(p.system_prescription_count??0)+Number(p.manual_prescription_count??0),s=p=>{const R=Number(p.avg_deal_amount);if(Number.isFinite(R)&&R>0)return R;const P=Number(p.deal_order_count);return P>0?Number(p.deal_amount)/P:0},i=Math.max(...t.map(p=>Number(p.deal_amount)),1e-9),h=Math.max(...t.map(p=>Number(p.deal_order_count)),1e-9),g=Math.max(...t.map(n),1e-9),k=Math.max(...t.map(p=>Number(p.appointment_completed??0)),1e-9),B=Math.max(...t.map(s),1e-9),I=t.map(p=>({name:e(p),value:[Number(p.deal_amount)/i*100,Number(p.deal_order_count)/h*100,n(p)/g*100,Number(p.appointment_completed??0)/k*100,s(p)/B*100]}));return{color:["#2563eb","#0d9488","#d97706","#7c3aed","#64748b"],tooltip:{trigger:"item"},legend:{bottom:0,type:"scroll",textStyle:{fontSize:10}},radar:{indicator:[{name:"成交金额",max:100},{name:"接诊诊单",max:100},{name:"开方量",max:100},{name:"挂号完成",max:100},{name:"客单价",max:100}],radius:"58%",center:["50%","48%"],splitNumber:4,axisName:{fontSize:10,color:"#64748b"}},series:[{type:"radar",data:I,emphasis:{lineStyle:{width:3}}}]}}),xa=z(()=>{const t=[...U.value].filter(s=>Number(s.deal_amount??0)>0).sort((s,i)=>Number(i.deal_amount)-Number(s.deal_amount)).slice(0,20),e=t.map(s=>{const i=String(s.doctor_name||"—");return i.length>10?`${i.slice(0,10)}…`:i}),n=t.map(s=>Number(s.deal_amount??0));return{color:["#2563eb"],tooltip:{trigger:"axis",axisPointer:{type:"shadow"},valueFormatter:s=>`${s.toLocaleString("zh-CN",{minimumFractionDigits:2,maximumFractionDigits:2})} 元`},grid:{left:8,right:16,top:28,bottom:8,containLabel:!0},xAxis:{type:"value",axisLabel:{fontSize:11},splitLine:{lineStyle:{type:"dashed",opacity:.6}}},yAxis:{type:"category",data:[...e].reverse(),axisLabel:{fontSize:11}},series:[{name:"成交金额",type:"bar",data:[...n].reverse(),barMaxWidth:22,itemStyle:{borderRadius:[0,6,6,0]}}]}}),Na=z(()=>{const t=[...U.value].filter(n=>Number(n.system_prescription_count??0)+Number(n.manual_prescription_count??0)>0).sort((n,s)=>Number(s.system_prescription_count??0)+Number(s.manual_prescription_count??0)-(Number(n.system_prescription_count??0)+Number(n.manual_prescription_count??0))).slice(0,14),e=t.map(n=>{const s=String(n.doctor_name||"—");return s.length>6?`${s.slice(0,6)}…`:s});return{tooltip:{trigger:"axis",axisPointer:{type:"shadow"}},legend:{top:0,textStyle:{fontSize:11}},grid:{left:44,right:16,top:32,bottom:e.length>10?72:28},xAxis:{type:"category",data:e,axisLabel:{rotate:e.length>8?32:0,fontSize:10}},yAxis:{type:"value",splitLine:{lineStyle:{type:"dashed",opacity:.6}}},series:[{name:"系统开方",type:"bar",stack:"rx",barMaxWidth:18,data:t.map(n=>Number(n.system_prescription_count??0)),itemStyle:{color:"#2563eb"}},{name:"手动开方",type:"bar",stack:"rx",barMaxWidth:18,data:t.map(n=>Number(n.manual_prescription_count??0)),itemStyle:{color:"#d97706"}}]}});function Sa(){var e,n;const t={};if(x.value&&(t.channel_code=x.value),(e=Y.value)!=null&&e[0]&&((n=Y.value)!=null&&n[1]))t.start_date=Y.value[0],t.end_date=Y.value[1];else{const s=nt(new Date);t.start_date=s,t.end_date=s}return t}function Mt(t){return Number(t??0).toLocaleString("zh-CN",{minimumFractionDigits:2,maximumFractionDigits:2})}function Ca(t){const e=Le.value,n=[];return t.columns.forEach((s,i)=>{if(i===0){n[i]="合计";return}switch(s.property){case"system_prescription_count":n[i]=String(e.system_prescription_count??0);break;case"manual_prescription_count":n[i]=String(e.manual_prescription_count??0);break;case"deal_amount":n[i]=`¥ ${Mt(e.deal_amount)}`;break;case"deal_order_count":n[i]=String(e.deal_order_count??0);break;case"appointment_completed":n[i]=String(e.appointment_completed??0);break;case"appointment_missed":n[i]=String(e.appointment_missed??0);break;case"appointment_cancelled":n[i]=String(e.appointment_cancelled??0);break;default:n[i]=""}}),n}async function It(){De.value=!0;try{const t=await Qn(Sa());U.value=(t==null?void 0:t.rows)??[],Le.value=(t==null?void 0:t.total)??{},t!=null&&t.start_date&&(t!=null&&t.end_date)&&(Ke.value={start:t.start_date,end:t.end_date})}catch(t){if(ie.isCancel(t))return;U.value=[],Le.value={},Ke.value=null}finally{De.value=!1}}const te=v(!1),_e=v(!1),Fe=v(""),Ee=v(""),pe=v([]),Qe=v(0),X=v(1),Ze=v(15),G=v("channel"),H=v(null),Be=v(null),ae=v(null),Tt=z(()=>{const t=ae.value;if(!t)return null;const e=t.stats_order_amount_performance??t.stats_order_amount_not_cancelled;if(e==null||e==="")return null;const n=Number(e);return Number.isFinite(n)?n:null}),Vt=z(()=>{const t=ae.value;if(!t||t.stats_yeji_consult_count===void 0||t.stats_yeji_consult_count===null)return null;const e=Number(t.stats_yeji_consult_count);return Number.isFinite(e)?e:null}),Da=z(()=>pe.value.reduce((t,e)=>t+Number(e.amount??0),0)),Ft=z(()=>!!x.value&&te.value),bt=z(()=>{var e;const t=x.value;if(!t)return"";for(const n of We.value){const s=(e=n.channels)==null?void 0:e.find(i=>i.channel_code===t);if(s!=null&&s.channel_name)return String(s.channel_name)}return t}),La=z(()=>{const t=H.value;return t&&G.value==="total"?Number.isFinite(t.channelAmount)?t.channelAmount:null:Tt.value}),Ye=v(null),et=v(!1);function za(){const t=new Date;return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}`}function $a(t){const[e,n]=t.split("-").map(Number);return new Date(e,n,0).getDate()}async function Aa(){var t,e,n,s;et.value=!0,Ye.value=null;try{let i=function(f,D=0){const L=[];for(const $ of f??[])L.push({node:$,depth:D}),L.push(...i($.children??[],D+1));return L},h=function(f){const D=he.value.find(q=>Number(q.id)===f);if(!D)return"";const L=Number(D.pid);if(!L)return"";const $=he.value.find(q=>Number(q.id)===L);return $!=null&&$.name?String($.name):""},g=function(f){const D=[],L=[f];for(;L.length;){const $=L.shift();for(const q of he.value)Number(q.pid)===$&&(D.push(q.id),L.push(q.id))}return D},k=function(f,D){const L=new Map;for(const $ of(f==null?void 0:f.rows)??[])L.set(Number($.dept_id),Number($[D]??0));return L};const B=za(),I=await il({year_month:B}),p=(I==null?void 0:I.rows)??[];if(!p.length)return;const P=i(p).filter(f=>f.depth>=1&&Number(f.node.target_amount)>0).map(f=>f.node);if(!P.length)return;const Q=new Set,O=P.map(f=>{const D=Number(f.dept_id),L=g(D),$=L.length?L:[D];return $.forEach(q=>Q.add(q)),{dept_id:D,dept_name:String(f.dept_name),target_amount:Number(f.target_amount),totalIds:$}});if(!Q.size)return;const $e=We.value.flatMap(f=>f.channels),W=(t=$e.find(f=>f.channel_name.includes("自媒体1")))==null?void 0:t.channel_code,fe=(e=$e.find(f=>f.channel_name.includes("自媒体3")))==null?void 0:e.channel_code,Ae=(n=$e.find(f=>f.channel_name.includes("自媒体4")))==null?void 0:n.channel_code,Pe=Array.from(Q).join(","),[ye,F,l,b]=await Promise.all([He({dept_ids:Pe}),W?He({dept_ids:Pe,channel_code:W}):Promise.resolve(null),fe?He({dept_ids:Pe,channel_code:fe}):Promise.resolve(null),Ae?He({dept_ids:Pe,channel_code:Ae}):Promise.resolve(null)]),m=f=>{var D;return((f==null?void 0:f.tables)??[]).find(L=>String(L.label).includes("月"))??((D=f==null?void 0:f.tables)==null?void 0:D[0])},T=f=>{var D,L;return((f==null?void 0:f.tables)??[]).find($=>String($.label).includes("昨"))??((L=f==null?void 0:f.tables)==null?void 0:L[((D=f==null?void 0:f.tables)==null?void 0:D.length)-1])},oa=k(m(ye),"performance_amount"),gn=k(T(ye),"performance_amount"),sa=F?k(m(F),"completed_performance_amount"):null,ia=l?k(m(l),"completed_performance_amount"):null,ra=b?k(m(b),"completed_performance_amount"):null,Ue=(f,D)=>D.reduce((L,$)=>L+(f.get($)??0),0),Nt=new Date,wn=$a(B),kn=Nt.getDate(),jn=O.map(f=>{const D=Ue(oa,f.totalIds),L=Ue(gn,f.totalIds),$=sa?Ue(sa,f.totalIds):null,q=ia?Ue(ia,f.totalIds):null,da=ra?Ue(ra,f.totalIds):null,St=q!==null||da!==null?(q??0)+(da??0):null,Cn=Math.round(f.target_amount*(kn/wn)*100)/100,Dn=f.target_amount>0?D/f.target_amount:null;return{dept_id:f.dept_id,dept_name:f.dept_name,parent_dept_name:h(f.dept_id),target_amount:f.target_amount,total_amount:D,yesterday_amount:L,douyin_amount:$&&$>0?$:null,tuifen_amount:St&&St>0?St:null,target_progress:Cn,completion_rate:Dn}}),xn=((s=p[0])==null?void 0:s.dept_name)??"",Nn=Nt.getMonth()+1,Sn=Nt.getDate();Ye.value={title:`${xn}诊金-${Nn}.${Sn}`,sections:jn}}catch{}finally{et.value=!1}}const Pa=z(()=>{var e;const t=(e=N.value)==null?void 0:e.leaderboards;return t?t.filter(n=>n.rows.length>0).length:0}),Et=[{text:"昨天",value:()=>{const t=new Date;return t.setDate(t.getDate()-1),[t,t]}},{text:"最近七天",value:()=>{const t=new Date,e=new Date;return e.setDate(e.getDate()-6),[e,t]}},{text:"本月",value:()=>{const t=new Date;return[new Date(t.getFullYear(),t.getMonth(),1),t]}},{text:"今日",value:()=>{const t=new Date;return[t,t]}},{text:"本周",value:()=>{const t=new Date,e=new Date,n=e.getDay()||7;return e.setDate(e.getDate()-(n-1)),[e,t]}},{text:"上月",value:()=>{const t=new Date,e=new Date(t.getFullYear(),t.getMonth()-1,1),n=new Date(t.getFullYear(),t.getMonth(),0);return[e,n]}}];function Ra(t){const e=t.value();Y.value=[nt(e[0]),nt(e[1])],ze()}async function Oa(){ot.value=!0;try{const t=await Zn();he.value=(t||[]).sort((e,n)=>{const s=e.name.includes("中心")?-1:1,i=n.name.includes("中心")?-1:1;return s!==i?s-i:e.id-n.id})}catch{}finally{ot.value=!1}}async function Ma(){st.value=!0;try{const t=await el(),e=(t==null?void 0:t.groups)||[];We.value=e}catch{}finally{st.value=!1}}async function Bt(t){oe.value=!0;try{const e={start_date:t.start,end_date:t.end};A.value.length>0&&(e.dept_ids=A.value.join(",")),x.value&&(e.channel_code=x.value);const n=await nl(e);N.value={start_date:n.start_date,end_date:n.end_date,channel_code:n.channel_code||"",channel_name:n.channel_name||"",channel_filter_note:n.channel_filter_note||"",range_note:n.range_note||"",leaderboards:n.leaderboards||[]}}catch(e){if(ie.isCancel(e))return;N.value=null}finally{oe.value=!1}}async function ze(){le.value=!0,N.value=null;try{const t={};if(A.value.length>0&&(t.dept_ids=A.value.join(",")),x.value&&(t.channel_code=x.value),Y.value&&Y.value[0]&&Y.value[1]){const[s,i]=Y.value,h={...t,start_date:s,end_date:i},g=await tl(h);re.value=[{label:s===i?s:`${s} ~ ${i}`,start_date:g.start_date,end_date:g.end_date,channel_code:g.channel_code||"",channel_name:g.channel_name||"",channel_group:g.channel_group||"",channel_filter_note:g.channel_filter_note||"",rows:g.rows||[],total:g.total}],await Bt({start:g.start_date,end:g.end_date});return}const e=await He(t);re.value=((e==null?void 0:e.tables)||[]).map(s=>({label:s.label,start_date:s.start_date,end_date:s.end_date,channel_code:s.channel_code||"",channel_name:s.channel_name||"",channel_group:s.channel_group||"",channel_filter_note:s.channel_filter_note||"",rows:s.rows||[],total:s.total}));const n=nt(new Date);await Bt({start:n,end:n})}catch(t){if(ie.isCancel(t))return;const e=t;Re.error((e==null?void 0:e.msg)||(e==null?void 0:e.message)||"加载失败")}finally{le.value=!1,Ce.value?It():(U.value=[],Le.value={},Ke.value=null)}}function Ia(){A.value=[],Y.value=null,x.value="",ze()}function Ta(t){return t<=0?!1:he.value.some(e=>Number(e.pid)===t)}function Va(t){return{1:"待双审通过",2:"待发货",3:"已完成",4:"已取消",5:"已发货",6:"已签收",7:"进行中",8:"暂不制药",9:"拒收",10:"退款",11:"保留药方",12:"制药缓发"}[Number(t)]??"—"}function tt(t){return t==null||!Number.isFinite(Number(t))?"—":Number(t).toLocaleString("zh-CN",{minimumFractionDigits:2,maximumFractionDigits:2})}function Fa(t){return(X.value-1)*Ze.value+t+1}function Ea(t){const e=(t==null?void 0:t.appointment_date)!=null&&String(t.appointment_date)!==""?String(t.appointment_date):"",n=(t==null?void 0:t.period)!=null&&String(t.period)!==""?String(t.period):"",s=(t==null?void 0:t.appointment_time)!=null&&String(t.appointment_time)!==""?String(t.appointment_time):"",i=[n,s].filter(Boolean).join(" ");return e&&i?`${e} ${i}`:e||i||"—"}function Yt(t){if(!t)return"";const e=t.channel_dict_value;if(e!=null&&e!==""){const i=Number(e);if(Number.isFinite(i))return String(Math.trunc(i))}const n=t.channel_source;if(n==null)return"";const s=String(n).trim();return s===""||!/^\d+$/.test(s)?"":String(parseInt(s,10))}function Ba(t){if(t==null||t==="")return"—";const e=Number(t);if(Number.isFinite(e)&&e>=1e9&&e<1e15){const s=e<1e12?e*1e3:e,i=new Date(s);if(!Number.isNaN(i.getTime())){const h=i.getFullYear(),g=String(i.getMonth()+1).padStart(2,"0"),k=String(i.getDate()).padStart(2,"0"),B=String(i.getHours()).padStart(2,"0"),I=String(i.getMinutes()).padStart(2,"0");return`${h}-${g}-${k} ${B}:${I}`}}const n=String(t);return n.length>=16?n.slice(0,16):n}function Ut(){const t=Be.value;if(!t)return null;const e={start_time:`${t.start} 00:00:00`,end_time:`${t.end} 23:59:59`,exclude_fulfillment_cancelled:1,yeji_order_drawer:1};return t.mode==="dept"?(e.assistant_dept_id=t.deptId,A.value.length>0&&(e.dept_ids=A.value.join(","))):(e.assistant_id=t.assistantId,t.erCenterRevisitSlot!==void 0&&(e.yeji_er_center_revisit_only=1,e.yeji_er_center_revisit_slot=t.erCenterRevisitSlot)),x.value&&te.value&&G.value==="channel"&&(e.channel_code=x.value),e}async function Ya(){const t=Ut();if(!t||!x.value)return;const e={...t,channel_code:x.value,page_no:1,page_size:1};try{const n=await ua(e),s=n!=null&&n.extend&&typeof n.extend=="object"?n.extend:null;s&&s.stats_yeji_drawer_total_performance_amount!=null&&(H.value={totalAmount:Number(s.stats_yeji_drawer_total_performance_amount),totalOrderCount:Number(s.stats_yeji_drawer_total_performance_order_count??0),channelAmount:Number(s.stats_order_amount_performance??0),channelOrderCount:Number((n==null?void 0:n.count)??0)})}catch{}}async function me(){const t=Ut();if(t){x.value&&G.value==="total"&&(H.value=null),_e.value=!0;try{const e={...t,page_no:X.value,page_size:Ze.value},n=await ua(e);pe.value=Array.isArray(n==null?void 0:n.lists)?n.lists:[],Qe.value=Number((n==null?void 0:n.count)??0),ae.value=n!=null&&n.extend&&typeof n.extend=="object"?n.extend:null,x.value&&G.value==="channel"&&ae.value&&ae.value.stats_yeji_drawer_total_performance_amount!=null&&(H.value={totalAmount:Number(ae.value.stats_yeji_drawer_total_performance_amount),totalOrderCount:Number(ae.value.stats_yeji_drawer_total_performance_order_count??0),channelAmount:Number(ae.value.stats_order_amount_performance??0),channelOrderCount:Number((n==null?void 0:n.count)??0)}),x.value&&te.value&&G.value==="total"&&await Ya()}catch(e){if(ie.isCancel(e))return;const n=e;Re.error((n==null?void 0:n.msg)||(n==null?void 0:n.message)||"加载业务订单失败"),pe.value=[],Qe.value=0,ae.value=null}finally{_e.value=!1}}}function Ht(t,e,n){const s=!!(x.value&&t.channel_name);G.value=s?(n==null?void 0:n.listTab)??"channel":"channel",H.value=null,Be.value={mode:"dept",deptId:e.dept_id,deptName:e.dept_name,start:t.start_date,end:t.end_date,yejiTableRowDeptIds:t.rows.map(i=>i.dept_id).filter(i=>typeof i=="number"&&i>0)},Fe.value=`业务订单 · ${e.dept_name}`,Ee.value=`创建时间:${t.start_date} ~ ${t.end_date} · 与「合计业绩 / 接诊诊单」同口径:订单创建人人事部门 ∈ 本部门子树 · 不含履约 4/9/10`,X.value=1,te.value=!0,me()}function Ua(t,e,n){const s=!!(x.value&&t.channel_name);G.value=s?n:"channel",H.value=null,Be.value={mode:"dept",deptId:e,deptName:"当前展示合计",start:t.start_date,end:t.end_date,yejiTableRowDeptIds:t.rows.map(i=>i.dept_id).filter(i=>typeof i=="number"&&i>0)},Fe.value="业务订单 · 当前展示合计",Ee.value=`创建时间:${t.start_date} ~ ${t.end_date} · 已选展示部门 1 个根节点(含其下全部展示行)· 不含履约 4/9/10`,X.value=1,te.value=!0,me()}function gt(t,e,n){return!(ve(e)||e.dept_id<=0||n==="channel"&&!t.channel_name)}function wt(t,e){return!(A.value.length!==1||e==="channel"&&!t.channel_name)}function Wt(t,e,n){if(!gt(t,e,n))return;Ht(t,e,{listTab:n==="total"?"total":"channel"})}function qt(t,e){if(!wt(t,e))return;const n=A.value[0];if(!n)return;Ua(t,n,e==="total"?"total":"channel")}function Ha(t,e,n){G.value="channel",H.value=null,Be.value={mode:"assistant",assistantId:t.admin_id,assistantName:t.name,start:e,end:n},Fe.value=`业务订单 · ${t.name}`,Ee.value=`创建时间:${e} ~ ${n} · 创建人=${t.name}(与排行榜诊金同口径)· 不含履约 4/9/10`,X.value=1,te.value=!0,me()}function kt(t,e,n,s){G.value="channel",H.value=null,Be.value={mode:"assistant",assistantId:t.admin_id,assistantName:t.name,start:e,end:n,erCenterRevisitSlot:s};const i=s===0?"复诊合计":qe(s);Fe.value=`业务订单 · ${t.name} · ${i}`,Ee.value=`创建时间:${e} ~ ${n} · 创建人=${t.name}(与部门表 / 排行榜复诊同口径)· 仅二中心复诊口径 · ${i} · 不含履约 4/9/10`,X.value=1,te.value=!0,me()}function Wa(t){if(!t||t.admin_id<=0||!N.value||Number(t.revisit_count??0)<=0)return;const{start_date:e,end_date:n}=N.value;kt({admin_id:t.admin_id,name:t.name},e,n,0)}function qa(t,e){if(!t||t.admin_id<=0||!N.value||ee(t,e)<=0)return;const{start_date:n,end_date:s}=N.value;kt({admin_id:t.admin_id,name:t.name},n,s,e)}function Ga(){X.value=1,me()}function Ja(t){X.value=t,me()}function Ka(t){Ze.value=t,X.value=1,me()}function ve(t){return t.dept_id<=0&&t.dept_name==="未归属中心"}function Xa(t,e){e.dept_id<=0||ve(e)||Number(e.revisit_count??0)<=0||Jt(t,e,0)}function Qa(t,e,n){e.dept_id<=0||ve(e)||ee(e,n)<=0||Jt(t,e,n)}function Gt(t){const e=zt.value;!e||Number(t.order_count)<=0||kt({admin_id:t.admin_id,name:t.name},e.start,e.end,e.revisitSlot)}async function Jt(t,e,n){const s=n===0?"复诊合计":qe(n);Lt.value=`${e.dept_name} · ${s} · ${t.start_date} ~ ${t.end_date}`,zt.value={start:t.start_date,end:t.end_date,revisitSlot:n},Me.value="",ke.value=[],ut.value=!0,we.value=!0;try{const i={start_date:t.start_date,end_date:t.end_date,dept_id:e.dept_id,revisit_slot:n};A.value.length>0&&(i.dept_ids=A.value.join(",")),x.value&&(i.channel_code=x.value);const h=await al(i);ke.value=Array.isArray(h==null?void 0:h.rows)?h.rows:[],Me.value=typeof(h==null?void 0:h.note)=="string"?h.note:""}catch(i){if(ie.isCancel(i))return;const h=i;Re.error((h==null?void 0:h.msg)||(h==null?void 0:h.message)||"加载复诊拆解失败"),ke.value=[],Me.value=""}finally{we.value=!1}}function Kt(t){const e=[`区间:${t.start_date} ~ ${t.end_date}`];return x.value&&e.push(`渠道:${t.channel_name||x.value}`),A.value.length>0&&e.push(`已选展示部门 ${A.value.length} 个`),e.join(" · ")}async function Za(t){Dt.value=Kt(t),Oe.value="",ge.value=[],dt.value=!0,be.value=!0;try{const e={start_date:t.start_date,end_date:t.end_date};A.value.length>0&&(e.dept_ids=A.value.join(",")),x.value&&(e.channel_code=x.value);const n=await ll(e);ge.value=Array.isArray(n==null?void 0:n.rows)?n.rows:[],Oe.value=typeof(n==null?void 0:n.note)=="string"?n.note:""}catch(e){if(ie.isCancel(e))return;const n=e;Re.error((n==null?void 0:n.msg)||(n==null?void 0:n.message)||"加载未归属拆解失败"),ge.value=[],Oe.value=""}finally{be.value=!1}}function en(t,e,n){n.dept_id<=0||Number(n.lead_count)<=0||(t.stopPropagation(),tn(e,n))}async function jt(){const t=At.value;if(!t)return;const{tb:e,row:n}=t;de.value=!0;try{const s={start_date:e.start_date,end_date:e.end_date,dept_id:n.dept_id,page:Ve.value,page_size:Ge.value};A.value.length>0&&(s.dept_ids=A.value.join(",")),x.value&&(s.channel_code=x.value);const i=await ol(s);je.value=Array.isArray(i==null?void 0:i.lists)?i.lists:[],Te.value=Number((i==null?void 0:i.count)??0),Ie.value=typeof(i==null?void 0:i.note)=="string"?i.note:""}catch(s){if(ie.isCancel(s))return;const i=s;Re.error((i==null?void 0:i.msg)||(i==null?void 0:i.message)||"加载进线明细失败"),je.value=[],Te.value=0,Ie.value=""}finally{de.value=!1}}async function tn(t,e){At.value={tb:t,row:e},$t.value=`${e.dept_name} · ${Kt(t)}`,Ie.value="",je.value=[],Te.value=0,Ve.value=1,Ge.value=20,ct.value=!0,await jt()}function an(t){Ve.value=t,jt()}function nn(t){Ge.value=t,Ve.value=1,jt()}function ln(t){return(ce.value-1)*Se.value+t+1}function Xt(t){return ve(t)?!0:t.dept_id>0}async function at(){const t=pt.value;if(t){ue.value=!0;try{const e={start_date:t.start_date,end_date:t.end_date,page:ce.value,page_size:Se.value};t.mode==="dept"?e.dept_id=t.dept_id:e.assistant_id=t.assistant_id,A.value.length>0&&(e.dept_ids=A.value.join(",")),x.value&&(e.channel_code=x.value);const n=await sl(e);se.value=Array.isArray(n==null?void 0:n.lists)?n.lists:[],Ne.value=Number((n==null?void 0:n.count)??0),xe.value=typeof(n==null?void 0:n.note)=="string"?n.note:""}catch(e){if(ie.isCancel(e))return;const n=e;Re.error((n==null?void 0:n.msg)||(n==null?void 0:n.message)||"加载挂号明细失败"),se.value=[],Ne.value=0,xe.value=""}finally{ue.value=!1}}}function on(t){if(!t||t.admin_id<=0||!N.value||Number(t.appointment_count??0)<=0)return;const e=N.value;pt.value={mode:"assistant",assistant_id:t.admin_id,name:t.name,start_date:e.start_date,end_date:e.end_date},_t.value=`${t.name} · 医助 · ${e.start_date} ~ ${e.end_date}`,xe.value="",se.value=[],Ne.value=0,ce.value=1,Se.value=20,Je.value=!0,at()}function sn(t,e){!Xt(e)||Number(e.appointment_booked_count??0)<=0||(pt.value={mode:"dept",dept_id:e.dept_id,dept_name:e.dept_name,start_date:t.start_date,end_date:t.end_date},_t.value=`${e.dept_name} · ${t.start_date} ~ ${t.end_date}`,xe.value="",se.value=[],Ne.value=0,ce.value=1,Se.value=20,Je.value=!0,at())}function rn(t){ce.value=t,at()}function dn(t){Se.value=t,ce.value=1,at()}function un(t,e){if(ve(e)){Za(t);return}if(!(e.dept_id<=0)){if(Ta(e.dept_id)){A.value=[e.dept_id],ze();return}Ht(t,e)}}function cn(t){if(!t||t.admin_id<=0||!N.value)return;const{start_date:e,end_date:n}=N.value;Ha(t,e,n)}function Qt(t){const e=t.channel_name?` · ${t.channel_name}`:"";return`${t.label}${e}`}function _n(t){const e=t.rows.filter(g=>g.dept_id>0),n=e.map(g=>g.dept_name.length>10?`${g.dept_name.slice(0,10)}…`:g.dept_name),s=["#64748b","#38bdf8","#6366f1"],i=[{name:"进线",type:"bar",data:e.map(g=>g.lead_count),yAxisIndex:0,barMaxWidth:16},{name:"接诊",type:"bar",data:e.map(g=>g.consult_count),yAxisIndex:0,barMaxWidth:16},{name:"成交单",type:"bar",data:e.map(g=>g.deal_order_count),yAxisIndex:0,barMaxWidth:16},{name:"合计业绩",type:"bar",data:e.map(g=>g.performance_amount),yAxisIndex:1,barMaxWidth:14,itemStyle:{color:"#d97706"}}];t.channel_name&&i.push({name:`${t.channel_name}业绩`,type:"bar",data:e.map(g=>g.completed_performance_amount),yAxisIndex:1,barMaxWidth:14,itemStyle:{color:"#0d9488"}});const h=e.length>10;return{color:[...s,"#d97706","#0d9488"],tooltip:{trigger:"axis",axisPointer:{type:"cross"}},legend:{top:8,type:"scroll",textStyle:{fontSize:11}},grid:{left:52,right:52,top:48,bottom:h?56:28,containLabel:!1},dataZoom:h?[{type:"slider",bottom:4,start:0,end:Math.min(100,Math.ceil(12/Math.max(e.length,1)*100))}]:[],xAxis:{type:"category",data:n,axisLabel:{rotate:n.length>8?28:0,fontSize:10}},yAxis:[{type:"value",name:"数量",splitLine:{lineStyle:{type:"dashed",opacity:.55}}},{type:"value",name:"金额",splitLine:{show:!1}}],series:i}}function pn(t,e){const n=[...t.rows].sort((s,i)=>Number(i.fee_amount)-Number(s.fee_amount)).slice(0,15);return{color:["#2563eb"],tooltip:{trigger:"axis",axisPointer:{type:"shadow"},valueFormatter:s=>`${Number(s).toLocaleString("zh-CN")} 元`},grid:{left:8,right:20,top:12,bottom:8,containLabel:!0},xAxis:{type:"value",splitLine:{lineStyle:{type:"dashed",opacity:.6}}},yAxis:{type:"category",data:n.map(s=>s.name.length>8?`${s.name.slice(0,8)}…`:s.name).reverse(),axisLabel:{fontSize:11}},series:[{name:"诊金",type:"bar",data:n.map(s=>Number(s.fee_amount??0)).reverse(),barMaxWidth:20,itemStyle:{borderRadius:[0,6,6,0]}}]}}function Zt(t){return t.rows.some(e=>Number(e.fee_amount)>0)}function mn(t,e){const s=[...t.rows].filter(i=>Number(i.fee_amount)>0).sort((i,h)=>Number(h.fee_amount)-Number(i.fee_amount)).slice(0,10).map(i=>({name:i.name.length>6?`${i.name.slice(0,6)}…`:i.name,value:Number(i.fee_amount)}));return{color:["#2563eb","#0d9488","#d97706","#7c3aed","#64748b","#0891b2","#65a30d","#c026d3","#ea580c","#4f46e5"],tooltip:{trigger:"item",formatter:"{b}: {c} 元 ({d}%)"},legend:{type:"scroll",bottom:0,textStyle:{fontSize:9}},series:[{name:"诊金",type:"pie",radius:["38%","64%"],center:["50%","42%"],data:s,itemStyle:{borderRadius:5,borderColor:"#fff",borderWidth:2},label:{formatter:`{b}
|
||
{d}%`,fontSize:10}}]}}function ea(t){return Number(t.total.lead_count)+Number(t.total.consult_count)+Number(t.total.deal_order_count)>0}function vn(t){const e=Number(t.total.lead_count??0),n=Number(t.total.consult_count??0),s=Number(t.total.deal_order_count??0);return{tooltip:{trigger:"item",formatter:"{b}: {c}"},color:["#2563eb","#38bdf8","#0d9488"],series:[{type:"funnel",left:"8%",width:"84%",minSize:"12%",sort:"none",gap:6,label:{show:!0,position:"inside",formatter:`{b}
|
||
{c}`,fontSize:11},data:[{value:e,name:"进线"},{value:n,name:"接诊"},{value:s,name:"成交单"}]}]}}function ta(t){return t.rows.some(e=>e.dept_id>0&&Number(e.performance_amount)>0)}function fn(t){const e=t.rows.filter(i=>i.dept_id>0&&Number(i.performance_amount)>0).sort((i,h)=>Number(h.performance_amount)-Number(i.performance_amount));if(!e.length)return{series:[{type:"pie",data:[]}]};const s=e.slice(0,10).map(i=>({name:i.dept_name.length>8?`${i.dept_name.slice(0,8)}…`:i.dept_name,value:Number(i.performance_amount)}));if(e.length>10){const i=e.slice(10).reduce((h,g)=>h+Number(g.performance_amount),0);i>0&&s.push({name:"其它",value:i})}return{color:["#2563eb","#0d9488","#d97706","#7c3aed","#64748b","#0891b2","#65a30d","#c026d3","#ea580c","#4f46e5","#94a3b8"],tooltip:{trigger:"item",formatter:"{b}<br/>{c} 元({d}%)"},legend:{type:"scroll",bottom:0,textStyle:{fontSize:10}},series:[{type:"pie",radius:["36%","62%"],center:["50%","44%"],data:s,itemStyle:{borderRadius:5,borderColor:"#fff",borderWidth:2},label:{formatter:`{b}
|
||
{d}%`,fontSize:10}}]}}function xt(t){return{perf:"渠道业绩",deal:"渠道成交",aov:"渠道客单"}[t]??t}function S(t){return t==null||t===""?"0":Number(t).toLocaleString("en-US")}function M(t){return t==null||t===""?"0.0":Number(t).toLocaleString("en-US",{minimumFractionDigits:1,maximumFractionDigits:1})}function ne(t){if(t==null||t==="")return"0";const e=Number(t);return Number.isFinite(e)?Math.round(e).toLocaleString("zh-CN"):"0"}function aa(t){return t==null||t===""?"—":Number(t).toLocaleString("en-US",{minimumFractionDigits:1,maximumFractionDigits:1})}function na(t){return t==null||t===""?"—":Number(t).toFixed(1)}function la(t){if(t==null||t==="")return"";const e=Number(t);return e>=1?"roi-good":e>=.8?"roi-mid":"roi-bad"}function yn(t){return t===null?"—":(t*100).toFixed(2)+"%"}function hn(t){return t===null?"":t>=1?"tp-good":t>=.8?"tp-mid":"tp-bad"}function bn(t){return t>=1e4?(t/1e4).toFixed(1)+"万":String(t)}function nt(t){const e=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),s=String(t.getDate()).padStart(2,"0");return`${e}-${n}-${s}`}return cl(async()=>{await Promise.all([Oa(),Ma()]),ze(),Aa()}),(t,e)=>{const n=zn,s=$n,i=Ln,h=An,g=Rn,k=Mn,B=On,I=In,p=En,R=Fn,P=Bn,Q=Vn,O=Yn,$e=Tn,W=Hn,fe=Un,Ae=Wn,Pe=qn,ye=Gn,F=Pn;return o(),c("div",_l,[e[140]||(e[140]=a("header",{class:"yeji-masthead"},[a("div",{class:"yeji-masthead__inner"},[a("h1",{class:"yeji-masthead__title"},"业绩看板"),a("p",{class:"yeji-masthead__desc"},"渠道 · 部门 · 日期维度的业绩分析")])],-1)),r(I,{class:"yeji-panel filter-card",shadow:"never"},{default:_(()=>[a("div",pl,[a("div",ml,[a("div",vl,[e[10]||(e[10]=a("span",{class:"lbl"},"渠道来源",-1)),r(i,{modelValue:x.value,"onUpdate:modelValue":e[0]||(e[0]=l=>x.value=l),filterable:"",placeholder:"渠道筛选",class:"filter-select filter-select--channel",loading:st.value,onChange:ze},{default:_(()=>[r(n,{label:"全部",value:""}),(o(!0),c(w,null,V(We.value,l=>(o(),j(s,{key:l.group_name,label:l.group_name},{default:_(()=>[(o(!0),c(w,null,V(l.channels,b=>(o(),j(n,{key:b.channel_code,label:b.channel_name,value:b.channel_code},{default:_(()=>[a("div",fl,[a("span",yl,d(b.channel_name),1),a("span",hl,d(b.customer_count>0?b.customer_count:""),1)])]),_:2},1032,["label","value"]))),128))]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue","loading"])]),a("div",bl,[e[11]||(e[11]=a("span",{class:"lbl"},"展示部门",-1)),K((o(),c("div",gl,[r(h,{modelValue:A.value,"onUpdate:modelValue":e[1]||(e[1]=l=>A.value=l),data:ma.value,multiple:"","collapse-tags":"","collapse-tags-tooltip":"",filterable:"","check-strictly":"","render-after-expand":!1,"default-expand-all":!0,placeholder:"默认:所有「中心」部门",class:"filter-dept-tree-select","node-key":"id",props:_a},null,8,["modelValue","data"])])),[[F,ot.value]])]),a("div",wl,[e[12]||(e[12]=a("span",{class:"lbl"},"日期范围",-1)),r(g,{modelValue:Y.value,"onUpdate:modelValue":e[2]||(e[2]=l=>Y.value=l),type:"daterange","value-format":"YYYY-MM-DD","start-placeholder":"开始","end-placeholder":"结束",clearable:!0,shortcuts:Et,class:"filter-date-picker"},null,8,["modelValue"])]),a("div",kl,[r(B,{type:"primary",class:"filter-btn filter-btn--query",loading:le.value,onClick:ze},{default:_(()=>[r(k,{class:"filter-btn__icon"},{default:_(()=>[r(C(Kn))]),_:1}),e[13]||(e[13]=u(" 查询 ",-1))]),_:1},8,["loading"]),r(B,{class:"filter-btn filter-btn--reset",disabled:le.value,onClick:Ia},{default:_(()=>[r(k,{class:"filter-btn__icon"},{default:_(()=>[r(C(Xn))]),_:1}),e[14]||(e[14]=u(" 重置 ",-1))]),_:1},8,["disabled"])])]),a("div",jl,[e[15]||(e[15]=a("span",{class:"filter-quick__title"},"快捷日期",-1)),a("div",xl,[(o(),c(w,null,V(Et,l=>a("button",{key:l.text,type:"button",class:"date-pill",onClick:b=>Ra(l)},d(l.text),9,Nl)),64))])])])]),_:1}),r(I,{class:"yeji-panel yeji-main-tabs-card",shadow:"never"},{default:_(()=>[e[115]||(e[115]=a("div",{class:"yeji-table-tabs-head"},[a("span",{class:"yeji-table-tabs-head__title"},"表格统计"),a("span",{class:"yeji-table-tabs-head__hint"},"列较多时可横向滚动浏览;「部门 / 排名」列在滚动时保持固定。")],-1)),r($e,{modelValue:Pt.value,"onUpdate:modelValue":e[3]||(e[3]=l=>Pt.value=l),class:"yeji-view-tabs"},{default:_(()=>[r(Q,{label:"医生统计",name:"doctor",lazy:""},{default:_(()=>[Ce.value?(o(),j(I,{key:0,class:"yeji-panel doctor-daily-card doctor-daily-card--nested",shadow:"never"},{header:_(()=>[a("div",Sl,[a("div",Cl,[e[16]||(e[16]=a("span",{class:"doctor-daily-card__title"},"医生明细",-1)),Xe.value?(o(),c("span",Dl,d(Xe.value),1)):y("",!0)]),a("div",Ll,[r(B,{type:"primary",size:"small",loading:De.value,onClick:It},{default:_(()=>[...e[17]||(e[17]=[u(" 刷新 ",-1)])]),_:1},8,["loading"])])])]),default:_(()=>[K((o(),j(R,{data:U.value,size:"small",border:"",stripe:"",class:"doctor-daily-table","show-summary":"","summary-method":Ca},{default:_(()=>[r(p,{prop:"doctor_name",label:"医生","min-width":"100",fixed:""}),r(p,{prop:"system_prescription_count",label:"系统开方","min-width":"88",align:"right"}),r(p,{prop:"manual_prescription_count",label:"手动开方","min-width":"88",align:"right"}),r(p,{prop:"deal_amount",label:"成交金额","min-width":"110",align:"right"},{default:_(({row:l})=>[u("¥ "+d(Mt(l.deal_amount)),1)]),_:1}),r(p,{prop:"deal_order_count",label:"接诊诊单","min-width":"88",align:"right"}),r(p,{prop:"appointment_completed",label:"挂号完成","min-width":"88",align:"right"}),r(p,{prop:"appointment_missed",label:"过号","min-width":"72",align:"right"}),r(p,{prop:"appointment_cancelled",label:"取消","min-width":"72",align:"right"})]),_:1},8,["data"])),[[F,De.value]])]),_:1})):(o(),j(P,{key:1,description:"当前账号无医生统计权限"}))]),_:1}),r(Q,{label:"医助排行榜",name:"leaderboard",lazy:""},{default:_(()=>[N.value||oe.value?K((o(),c("div",zl,[N.value?(o(),c(w,{key:0},[a("p",$l,[u(d(N.value.range_note)+" ",1),a("span",Al,d(N.value.start_date)+" ~ "+d(N.value.end_date),1)]),a("div",Pl,[(o(!0),c(w,null,V(N.value.leaderboards,l=>(o(),c(w,{key:l.dept_id},[l.rows.length>0?(o(),c("div",Rl,[a("div",Ol,[u(d(l.dept_name)+" · 医助排行榜 ",1),N.value.channel_name?(o(),c("span",Ml," ("+d(N.value.channel_name)+") ",1)):y("",!0)]),a("div",Il,[a("table",Tl,[a("thead",null,[a("tr",null,[e[19]||(e[19]=a("th",{class:"col-rank"},"排名",-1)),e[20]||(e[20]=a("th",{class:"col-abbr"},"部门",-1)),e[21]||(e[21]=a("th",{class:"col-name"},"姓名",-1)),e[22]||(e[22]=a("th",{class:"col-consult"},"接诊单数",-1)),e[23]||(e[23]=a("th",{class:"col-deal"},"接诊诊单",-1)),e[24]||(e[24]=a("th",{class:"col-assign"},"被指派数",-1)),e[25]||(e[25]=a("th",{class:"col-appointment"},"预约诊单",-1)),l.er_center_subtree?(o(),c(w,{key:0},[e[18]||(e[18]=a("th",{class:"col-revisit"},"复诊合计",-1)),(o(!0),c(w,null,V(Ct(l),b=>(o(),c("th",{key:"lbh-"+l.dept_id+"-"+b,class:"col-revisit-slot"},d(qe(b)),1))),128))],64)):y("",!0),e[26]||(e[26]=a("th",null,"诊金",-1)),e[27]||(e[27]=a("th",null,[u("接诊率"),a("br"),a("span",{class:"th-sub"},"(元/进线)")],-1))])]),a("tbody",null,[(o(!0),c(w,null,V(l.rows,b=>(o(),c("tr",{key:b.admin_id,class:"yeji-row--action",onClick:m=>cn(b)},[a("td",Fl,d(b.rank),1),a("td",El,d(b.dept_abbr),1),a("td",Bl,d(b.name),1),a("td",Yl,d(ne(b.consult_count)),1),a("td",Ul,d(ne(b.deal_order_count)),1),a("td",Hl,d(ne(b.assign_count??0)),1),a("td",{class:"col-appointment",onClick:J(m=>on(b),["stop"])},[Number(b.appointment_count??0)>0?(o(),c("span",ql,d(ne(b.appointment_count??0)),1)):(o(),c(w,{key:1},[u(d(ne(b.appointment_count??0)),1)],64))],8,Wl),l.er_center_subtree?(o(),c(w,{key:0},[a("td",{class:"col-revisit",onClick:J(m=>Wa(b),["stop"])},[Number(b.revisit_count??0)>0?(o(),c("span",Jl,d(ne(b.revisit_count??0)),1)):(o(),c(w,{key:1},[u(d(ne(b.revisit_count??0)),1)],64))],8,Gl),(o(!0),c(w,null,V(Ct(l),m=>(o(),c("td",{key:"lbc-"+b.admin_id+"-"+m,class:"col-revisit-slot",onClick:J(T=>qa(b,m),["stop"])},[ee(b,m)>0?(o(),c("span",Xl,d(ne(ee(b,m))),1)):(o(),c(w,{key:1},[u(d(ne(ee(b,m))),1)],64))],8,Kl))),128))],64)):y("",!0),a("td",null,d(M(b.fee_amount)),1),a("td",null,d(M(b.consult_rate)),1)],8,Vl))),128))])])]),a("div",Ql,[e[28]||(e[28]=a("span",null,"诊金单位:元 · 诊金/接诊诊单/复诊均按「订单创建人 = 该医助」归属,与部门「合计业绩 / 接诊诊单 / 复诊」同口径 · 被指派数与部门业绩表同口径 · 接诊率 = 诊金 ÷ 进线(元/进线)",-1)),l.er_center_subtree?(o(),c("span",Zl," · 复诊列为二中心口径(同一诊单业务单序列第 2 笔起),点击数字查看对应业务订单 ")):y("",!0),e[29]||(e[29]=a("span",null," · 预约诊单:预约日期在统计区间内,状态含已预约/已完成/已过号(不含已取消),医助归属与接诊单数一致(按挂号 assistant_id 优先,否则诊单 assistant_id);各科组展示全部医助。 ",-1))])])):y("",!0)],64))),128))]),!oe.value&&Pa.value===0?(o(),c("div",eo,[r(P,{description:"当前筛选下暂无医助排行数据"})])):y("",!0)],64)):y("",!0)])),[[F,oe.value]]):oe.value?y("",!0):(o(),j(P,{key:1,class:"yeji-charts-empty",description:"当前筛选下暂无医助排行数据"}))]),_:1}),r(Q,{label:"甄养堂互联网医院诊金",name:"zyyt",lazy:""},{default:_(()=>[K((o(),c("div",to,[!le.value&&re.value.length===0?(o(),c("div",ao,[r(P,{description:"暂无数据"})])):y("",!0),(o(!0),c(w,null,V(re.value,(l,b)=>(o(),c("div",{key:b,class:"yeji-table"},[a("div",no,d(Qt(l)),1),a("div",lo,[a("table",oo,[a("thead",null,[a("tr",null,[e[107]||(e[107]=a("th",{class:"col-dept"},"部门",-1)),a("th",null,[e[36]||(e[36]=a("span",null,"进线数据",-1)),r(O,{placement:"top",effect:"dark","show-after":200},{content:_(()=>[a("div",so,[e[34]||(e[34]=u(" add_external_contact 事件数,按接待企微成员归属部门;定渠道时须客户带对应企微标签。",-1)),e[35]||(e[35]=a("br",null,null,-1)),l.channel_name?(o(),c(w,{key:0},[e[30]||(e[30]=a("b",null,"二中心及其组织下级",-1)),e[31]||(e[31]=u("(与部门 ErCenter 子树一致)在选定渠道下进线计 ",-1)),e[32]||(e[32]=a("b",null,"0",-1)),e[33]||(e[33]=u("。 ",-1))],64)):y("",!0)])]),default:_(()=>[r(k,{class:"col-info"},{default:_(()=>[r(C(E))]),_:1})]),_:2},1024)]),a("th",null,[e[52]||(e[52]=a("span",null,"被指派数",-1)),r(O,{placement:"top",effect:"dark","show-after":200},{content:_(()=>[a("div",io,[e[44]||(e[44]=a("b",null,"tcm_diagnosis_assign_log",-1)),e[45]||(e[45]=u(" 行数(成功指派:",-1)),e[46]||(e[46]=a("b",null,"to_assistant_id > 0",-1)),e[47]||(e[47]=u("),**仅按 ",-1)),e[48]||(e[48]=a("b",null,"related_po_create_time",-1)),e[49]||(e[49]=u("** 落在所选区间内(与日志表快照一致;诊单手动指派已写入该字段)。按",-1)),e[50]||(e[50]=a("b",null,"被指派医助",-1)),e[51]||(e[51]=u("归属展示部门。",-1)),l.channel_name?(o(),c(w,{key:0},[u(" 选定渠道时收窄与「"+d(l.channel_name)+"」业绩同口径(标签诊单或 channels EXISTS)。",1),e[37]||(e[37]=a("br",null,null,-1)),e[38]||(e[38]=a("b",null,"二中心及其组织下级",-1)),e[39]||(e[39]=u("在选定渠道下本列计 ",-1)),e[40]||(e[40]=a("b",null,"0",-1)),e[41]||(e[41]=u("。 ",-1))],64)):(o(),c(w,{key:1},[e[42]||(e[42]=a("br",null,null,-1)),e[43]||(e[43]=u("未选渠道时不限客户来源,与「合计业绩」列渠道无关。",-1))],64))])]),default:_(()=>[r(k,{class:"col-info"},{default:_(()=>[r(C(E))]),_:1})]),_:2},1024)]),a("th",null,[e[54]||(e[54]=a("span",null,"复诊合计",-1)),r(O,{placement:"top",effect:"dark","show-after":200},{content:_(()=>[...e[53]||(e[53]=[a("div",{style:{"max-width":"320px","line-height":"1.7","font-size":"12px"}},[u(" 仅"),a("b",null,"名称含「二中心」"),u("的部门及其组织下级:候选订单为有诊单医助、且 "),a("b",null,"fulfillment_status"),u(" 非 4/9/10("),a("b",null,"NULL 计入"),u(")的业务单,按患者 "),a("b",null,"create_time"),u(" 排序,"),a("b",null,"第 1 笔不计"),u(";第 2 笔起计入合计,分列复诊2、复诊三…。"),a("b",null,"归属"),u("按订单创建人的人事部门,与"),a("b",null,"合计业绩"),u("列同口径。非二中心子树部门为 0。 ")],-1)])]),default:_(()=>[r(k,{class:"col-info"},{default:_(()=>[r(C(E))]),_:1})]),_:1})]),(o(!0),c(w,null,V(rt.value,m=>(o(),c("th",{key:"yjv-h-"+m},[a("span",null,d(qe(m)),1),r(O,{placement:"top",effect:"dark","show-after":200},{content:_(()=>[a("div",ro,[e[55]||(e[55]=u(" 该列统计区间内患者第 ",-1)),a("b",null,d(m),1),e[56]||(e[56]=u(" 笔业务单条数(第 1 笔初诊单列不计);归属与合计列相同。 ",-1))])]),default:_(()=>[r(k,{class:"col-info"},{default:_(()=>[r(C(E))]),_:1})]),_:2},1024)]))),128)),a("th",null,[e[58]||(e[58]=a("span",null,"合计业绩",-1)),r(O,{placement:"top",effect:"dark","show-after":200},{content:_(()=>[...e[57]||(e[57]=[a("div",{style:{"max-width":"300px","line-height":"1.7","font-size":"12px"}},[u(" 按订单"),a("b",null,"创建时间"),u("统计(剔除履约已取消/拒收/退款 4·9·10),金额与"),a("b",null,"接诊诊单"),u("列一致:仅按"),a("b",null,"订单创建人"),u("的人事部门落在本展示行(含下级)计入,多行命中时取最深的展示部门。与"),a("b",null,"医助排行榜诊金"),u("同口径。"),a("br"),a("b",null,"不受渠道筛选影响"),u("。与侧栏按部门打开的业务订单列表对齐。"),a("br"),u(" 点击金额可查看对应业务订单明细(侧栏默认「合计业绩」全量列表)。 ")],-1)])]),default:_(()=>[r(k,{class:"col-info"},{default:_(()=>[r(C(E))]),_:1})]),_:1})]),l.channel_name?(o(),c("th",uo,[a("span",co,d(xt("perf")),1),r(O,{placement:"top",effect:"dark","show-after":200},{content:_(()=>[a("div",_o,[u(" 「"+d(l.channel_name)+"」渠道业绩(与卡片标题渠道一致)。与「处方订单列表」业绩",1),e[59]||(e[59]=a("b",null,"同口径",-1)),e[60]||(e[60]=u(":按订单 ",-1)),e[61]||(e[61]=a("b",null,"create_time",-1)),e[62]||(e[62]=u(" 归日,剔除履约状态 4(已取消)/9(拒收)/10(退款)。",-1)),e[63]||(e[63]=a("br",null,null,-1)),e[64]||(e[64]=u(" 渠道判定用 EXISTS:该患者有任一挂号 ",-1)),e[65]||(e[65]=a("b",null,"channels 命中字典 + status=3",-1)),e[66]||(e[66]=u("(不限挂号时点)。",-1)),e[67]||(e[67]=a("br",null,null,-1)),e[68]||(e[68]=u(" 点击金额可查看该部门本渠道订单明细(侧栏「渠道筛选」列表)。 ",-1))])]),default:_(()=>[r(k,{class:"col-info","aria-label":"说明"},{default:_(()=>[r(C(E))]),_:1})]),_:2},1024)])):y("",!0),a("th",null,[e[70]||(e[70]=a("span",null,"预约诊单",-1)),r(O,{placement:"top",effect:"dark","show-after":200},{content:_(()=>[...e[69]||(e[69]=[a("div",{style:{"max-width":"320px","line-height":"1.7","font-size":"12px"}},[u(" 已预约 / 已完成 / 已过号(不含已取消),按"),a("b",null,"预约日期"),u("落在区间内统计;部门归属医助优先,否则接诊医生;与"),a("b",null,"医助排行榜 · 预约诊单"),u("及明细弹窗同口径。"),a("br"),u(" 点击数字可查看每条挂号记录。 ")],-1)])]),default:_(()=>[r(k,{class:"col-info"},{default:_(()=>[r(C(E))]),_:1})]),_:1})]),a("th",null,[e[72]||(e[72]=a("span",null,"已完成挂号",-1)),r(O,{placement:"top",effect:"dark","show-after":200},{content:_(()=>[...e[71]||(e[71]=[a("div",{style:{"max-width":"320px","line-height":"1.7","font-size":"12px"}},[u(" 仅"),a("b",null,"已完成"),u("(status=3),与 admin「医生预约 / 已完成」列表计数条件一致(appointment_date、诊单未软删);部门归属医助优先,否则接诊医生。 ")],-1)])]),default:_(()=>[r(k,{class:"col-info"},{default:_(()=>[r(C(E))]),_:1})]),_:1})]),a("th",null,[e[74]||(e[74]=a("span",null,"接诊诊单",-1)),r(O,{placement:"top",effect:"dark","show-after":200},{content:_(()=>[...e[73]||(e[73]=[a("div",{style:{"max-width":"320px","line-height":"1.7","font-size":"12px"}},[u(" <<<<<<< HEAD "),a("b",null,"业务订单条数"),u("(计业绩):订单 "),a("b",null,"create_time"),u(" 落入区间、"),a("b",null,"fulfillment_status ∉ {4,9,10}"),u("("),a("b",null,"NULL 计入"),u(");按"),a("b",null,"订单创建人"),u("的人事部门落在该部门子树即计入(表格多行命中时取最深的展示部门)。与"),a("b",null,"合计业绩 / 医助排行榜接诊诊单"),u("同口径。选定渠道时本列仍为全量。 ======= "),a("b",null,"业务订单条数"),u("(计业绩):订单 "),a("b",null,"create_time"),u(" 落入区间、"),a("b",null,"fulfillment_status ∉ {4,9,10}"),u(";与列表筛选 "),a("b",null,"assistant_dept_id"),u(" 时一致——"),a("b",null,"创建人"),u("人事部门优先,无创建人则诊单 "),a("b",null,"医助"),u(";落在该部门子树即计入(表格多行命中时取最深的展示部门)。与侧栏勾选「与表格业绩对齐」时的集合可能略有差异。选定渠道时本列仍为全量。 >>>>>>> master ")],-1)])]),default:_(()=>[r(k,{class:"col-info"},{default:_(()=>[r(C(E))]),_:1})]),_:1})]),l.channel_name?(o(),c("th",po,[a("span",mo,d(xt("deal")),1),r(O,{placement:"top",effect:"dark","show-after":200},{content:_(()=>[a("div",vo,[u(" 「"+d(l.channel_name)+"」渠道成交单数;与渠道业绩同源:区间内 ",1),e[75]||(e[75]=a("b",null,"计业绩的业务订单",-1)),e[76]||(e[76]=u(" 条数(剔除 4/9/10),按订单 ",-1)),e[77]||(e[77]=a("b",null,"create_time",-1)),e[78]||(e[78]=u(" 归日;渠道判定同业绩列。 ",-1))])]),default:_(()=>[r(k,{class:"col-info","aria-label":"说明"},{default:_(()=>[r(C(E))]),_:1})]),_:2},1024)])):y("",!0),l.channel_name?(o(),c("th",fo,[a("span",yo,d(xt("aov")),1),r(O,{placement:"top",effect:"dark","show-after":200},{content:_(()=>[a("div",ho," 「"+d(l.channel_name)+"」渠道客单价 ≈ 渠道业绩 ÷ 渠道成交单。 ",1)]),default:_(()=>[r(k,{class:"col-info","aria-label":"说明"},{default:_(()=>[r(C(E))]),_:1})]),_:2},1024)])):y("",!0),a("th",null,[e[104]||(e[104]=a("span",null,"ROI",-1)),r(O,{placement:"top",effect:"dark","show-after":200},{content:_(()=>[a("div",bo,[l.channel_name?(o(),c(w,{key:0},[e[79]||(e[79]=u(" 有渠道时:",-1)),e[80]||(e[80]=a("b",null,"合计行 ROI",-1)),e[81]||(e[81]=u(" = ",-1)),a("b",null,d(l.channel_name)+"业绩合计",1),e[82]||(e[82]=u("(与上表该渠道业绩列合计一致,",-1)),e[83]||(e[83]=a("b",null,"不含二中心及其组织下级",-1)),e[84]||(e[84]=u(")÷ ",-1)),e[85]||(e[85]=a("b",null,"投放成本合计",-1)),e[86]||(e[86]=u("。",-1)),e[87]||(e[87]=a("br",null,null,-1)),e[88]||(e[88]=u(" 部门行 ROI = 该部门 ",-1)),a("b",null,d(l.channel_name)+"业绩",1),e[89]||(e[89]=u(" ÷ 该部门 ",-1)),e[90]||(e[90]=a("b",null,"投放成本",-1)),e[91]||(e[91]=u(";",-1)),e[92]||(e[92]=a("b",null,"二中心子树",-1)),e[93]||(e[93]=u("部门该渠道业绩与进线为 0、投放成本分摊进线计 0,故无 ROI。与「合计业绩」列无关。 ",-1))],64)):(o(),c(w,{key:1},[e[94]||(e[94]=a("b",null,"合计行 ROI",-1)),e[95]||(e[95]=u(" = 全表业绩合计(",-1)),e[96]||(e[96]=a("b",null,"不含二中心子树",-1)),e[97]||(e[97]=u("各部门行业绩)÷ ",-1)),e[98]||(e[98]=a("b",null,"投放成本合计",-1)),e[99]||(e[99]=u(";",-1)),e[100]||(e[100]=a("br",null,null,-1)),e[101]||(e[101]=u(" 部门行 = 该部门「合计业绩」口径业绩 ÷ 该部门均摊投放成本;",-1)),e[102]||(e[102]=a("b",null,"二中心子树",-1)),e[103]||(e[103]=u("部门不参与成本分摊(进线占比计 0),故无 ROI。 ",-1))],64))])]),default:_(()=>[r(k,{class:"col-info"},{default:_(()=>[r(C(E))]),_:1})]),_:2},1024)]),a("th",null,[e[106]||(e[106]=a("span",null,"投放成本",-1)),r(O,{placement:"top",effect:"dark","show-after":200},{content:_(()=>[...e[105]||(e[105]=[a("div",{style:{"max-width":"320px","line-height":"1.7","font-size":"12px"}},[u(" 区间与渠道与账务表一致后得到"),a("b",null,"总投放成本"),u(";"),a("b",null,"单进线成本"),u(" = 总成本 ÷ 各展示部门"),a("b",null,"进线合计"),u(";"),a("br"),u(" 各部门行投放成本 = 单进线成本 × 该部门进线(四舍五入尾差并入进线最多的部门)。"),a("b",null,"二中心及其组织下级"),u("进线在分摊中计 "),a("b",null,"0"),u("(与 ROI 分子扣除范围一致)。 ")],-1)])]),default:_(()=>[r(k,{class:"col-info"},{default:_(()=>[r(C(E))]),_:1})]),_:1})])])]),a("tbody",null,[(o(!0),c(w,null,V(l.rows,m=>(o(),c("tr",{key:`${b}-${m.dept_id}-${m.dept_name}`,class:lt(["yeji-row--action",{"yeji-row--unassigned":ve(m),"yeji-row--idle":m.dept_id<=0&&!ve(m)}]),onClick:T=>un(l,m)},[a("td",wo,d(m.dept_name),1),a("td",{onClick:T=>en(T,l,m)},[m.dept_id>0&&Number(m.lead_count)>0?(o(),c("span",jo,d(S(m.lead_count)),1)):(o(),c(w,{key:1},[u(d(S(m.lead_count)),1)],64))],8,ko),a("td",null,d(S(m.assign_count??0)),1),a("td",{onClick:J(T=>Xa(l,m),["stop"])},[m.dept_id>0&&Number(m.revisit_count??0)>0?(o(),c("span",No,d(S(m.revisit_count??0)),1)):(o(),c(w,{key:1},[u(d(S(m.revisit_count??0)),1)],64))],8,xo),(o(!0),c(w,null,V(rt.value,T=>(o(),c("td",{key:"yjv-"+b+"-"+m.dept_id+"-"+T,onClick:J(oa=>Qa(l,m,T),["stop"])},[m.dept_id>0&&ee(m,T)>0?(o(),c("span",Co,d(S(ee(m,T))),1)):(o(),c(w,{key:1},[u(d(S(ee(m,T))),1)],64))],8,So))),128)),a("td",null,[gt(l,m,"total")?(o(),c("span",{key:0,class:"yeji-lead-cell--link",onClick:J(T=>Wt(l,m,"total"),["stop"])},d(M(m.performance_amount)),9,Do)):(o(),c(w,{key:1},[u(d(M(m.performance_amount)),1)],64))]),l.channel_name?(o(),c("td",Lo,[gt(l,m,"channel")?(o(),c("span",{key:0,class:"yeji-lead-cell--link",onClick:J(T=>Wt(l,m,"channel"),["stop"])},d(M(m.completed_performance_amount)),9,zo)):(o(),c(w,{key:1},[u(d(M(m.completed_performance_amount)),1)],64))])):y("",!0),a("td",{onClick:J(T=>sn(l,m),["stop"])},[Xt(m)&&Number(m.appointment_booked_count??0)>0?(o(),c("span",Ao,d(S(m.appointment_booked_count??0)),1)):(o(),c(w,{key:1},[u(d(S(m.appointment_booked_count??0)),1)],64))],8,$o),a("td",null,d(S(m.consult_count)),1),a("td",null,d(S(m.deal_order_count)),1),l.channel_name?(o(),c("td",Po,d(S(m.channel_consult_count)),1)):y("",!0),l.channel_name?(o(),c("td",Ro,d(aa(m.channel_avg_price)),1)):y("",!0),a("td",{class:lt(la(m.roi))},d(na(m.roi)),3),a("td",null,d(M(m.cost_amount)),1)],10,go))),128)),a("tr",Oo,[e[108]||(e[108]=a("td",{class:"col-dept"},"合计",-1)),a("td",null,d(S(l.total.lead_count)),1),a("td",null,d(S(l.total.assign_count??0)),1),a("td",null,d(S(l.total.revisit_count??0)),1),(o(!0),c(w,null,V(rt.value,m=>(o(),c("td",{key:"yjvt-"+b+"-"+m},d(S(ee(l.total,m))),1))),128)),a("td",null,[wt(l,"total")?(o(),c("span",{key:0,class:"yeji-lead-cell--link",onClick:J(m=>qt(l,"total"),["stop"])},d(M(l.total.performance_amount)),9,Mo)):(o(),c(w,{key:1},[u(d(M(l.total.performance_amount)),1)],64))]),l.channel_name?(o(),c("td",Io,[wt(l,"channel")?(o(),c("span",{key:0,class:"yeji-lead-cell--link",onClick:J(m=>qt(l,"channel"),["stop"])},d(M(l.total.completed_performance_amount)),9,To)):(o(),c(w,{key:1},[u(d(M(l.total.completed_performance_amount)),1)],64))])):y("",!0),a("td",null,d(S(l.total.appointment_booked_count??0)),1),a("td",null,d(S(l.total.consult_count)),1),a("td",null,d(S(l.total.deal_order_count)),1),l.channel_name?(o(),c("td",Vo,d(S(l.total.channel_consult_count)),1)):y("",!0),l.channel_name?(o(),c("td",Fo,d(aa(l.total.channel_avg_price)),1)):y("",!0),a("td",{class:lt(la(l.total.roi))},d(na(l.total.roi)),3),a("td",null,d(M(l.total.cost_amount)),1)])])])]),a("div",Eo,[a("span",null,"区间:"+d(l.start_date)+" ~ "+d(l.end_date),1),l.channel_name?(o(),c("span",Bo," · 渠道:"+d(l.channel_name),1)):y("",!0),l.total.cost_per_lead!=null&&l.total.cost_per_lead>0?(o(),c("span",Yo," · 单进线成本:"+d(M(l.total.cost_per_lead))+" 元 ",1)):y("",!0)])]))),128))])),[[F,le.value]])]),_:1}),r(Q,{label:"目标看板(卡片)",name:"zyyt_matrix",lazy:""},{default:_(()=>[K((o(),c("div",Uo,[Ye.value?(o(),c(w,{key:0},[a("h2",Ho,d(Ye.value.title),1),a("div",Wo,[(o(!0),c(w,null,V(Ye.value.sections,l=>(o(),c("div",{key:"tm-"+l.dept_id,class:"tp-matrix-card",role:"listitem"},[a("div",qo,[a("div",Go,[l.parent_dept_name?(o(),c("span",Jo,d(l.parent_dept_name),1)):y("",!0),a("span",Ko,d(l.dept_name)+"目标",1)]),a("span",Xo,d(bn(l.target_amount)),1)]),a("table",Qo,[a("tbody",null,[a("tr",null,[e[109]||(e[109]=a("td",{class:"tp-matrix-card__lbl"},"昨日诊金",-1)),a("td",Zo,d(S(l.yesterday_amount)),1)]),l.douyin_amount!==null?(o(),c("tr",es,[e[110]||(e[110]=a("td",{class:"tp-matrix-card__lbl"},"抖音总诊金",-1)),a("td",ts,d(S(l.douyin_amount)),1)])):y("",!0),l.tuifen_amount!==null?(o(),c("tr",as,[e[111]||(e[111]=a("td",{class:"tp-matrix-card__lbl"},"推粉总诊金",-1)),a("td",ns,d(S(l.tuifen_amount)),1)])):y("",!0),a("tr",null,[e[112]||(e[112]=a("td",{class:"tp-matrix-card__lbl"},"总诊金",-1)),a("td",ls,d(S(l.total_amount)),1)]),a("tr",null,[e[113]||(e[113]=a("td",{class:"tp-matrix-card__lbl"},"目标进度",-1)),a("td",os,d(M(l.target_progress)),1)]),a("tr",null,[e[114]||(e[114]=a("td",{class:"tp-matrix-card__lbl"},"完成进度",-1)),a("td",{class:lt(["tp-matrix-card__num tp-matrix-card__num--hot",hn(l.completion_rate)])},d(yn(l.completion_rate)),3)])])])]))),128))])],64)):et.value?y("",!0):(o(),j(P,{key:1,class:"tp-matrix-empty",description:"暂无目标数据,请先配置当月部门目标或为部门设置诊金目标后刷新页面"}))])),[[F,et.value]])]),_:1})]),_:1},8,["modelValue"])]),_:1}),r(I,{class:"yeji-panel yeji-charts-only-card",shadow:"never"},{default:_(()=>[e[125]||(e[125]=a("div",{class:"yeji-charts-only-head"},"统计图",-1)),K((o(),c("div",ss,[ga.value?(o(),c(w,{key:0},[Ce.value&&(mt.value||vt.value||ft.value||yt.value||ht.value)?(o(),c("section",is,[a("h3",rs,[e[116]||(e[116]=u(" 医生统计 ",-1)),Xe.value?(o(),c("span",ds,d(Xe.value),1)):y("",!0)]),r(fe,{gutter:16},{default:_(()=>[r(W,{xs:24,lg:9},{default:_(()=>[a("div",us,[e[117]||(e[117]=a("div",{class:"yeji-chart-panel__label"},"成交金额 TOP(条形)",-1)),mt.value?(o(),j(C(Z),{key:0,class:"yeji-echart",option:xa.value,autoresize:""},null,8,["option"])):(o(),j(P,{key:1,description:"暂无成交金额数据","image-size":72}))])]),_:1}),r(W,{xs:24,lg:8},{default:_(()=>[a("div",cs,[e[118]||(e[118]=a("div",{class:"yeji-chart-panel__label"},"开方构成(堆叠柱)",-1)),vt.value?(o(),j(C(Z),{key:0,class:"yeji-echart yeji-echart--short",option:Na.value,autoresize:""},null,8,["option"])):(o(),j(P,{key:1,description:"暂无开方数据","image-size":72}))])]),_:1}),r(W,{xs:24,lg:7},{default:_(()=>[a("div",_s,[e[119]||(e[119]=a("div",{class:"yeji-chart-panel__label"},"挂号结果(环形 · 表尾合计)",-1)),ft.value?(o(),j(C(Z),{key:0,class:"yeji-echart yeji-echart--short",option:wa.value,autoresize:""},null,8,["option"])):(o(),j(P,{key:1,description:"暂无挂号汇总","image-size":72}))])]),_:1})]),_:1}),r(fe,{gutter:16,class:"yeji-chart-subrow"},{default:_(()=>[r(W,{xs:24,lg:12},{default:_(()=>[a("div",ps,[e[120]||(e[120]=a("div",{class:"yeji-chart-panel__label"},"接诊诊单 × 金额(散点)",-1)),yt.value?(o(),j(C(Z),{key:0,class:"yeji-echart yeji-echart--compact",option:ka.value,autoresize:""},null,8,["option"])):(o(),j(P,{key:1,description:"至少两名医生同时有接诊诊单与金额时可展示","image-size":72}))])]),_:1}),r(W,{xs:24,lg:12},{default:_(()=>[a("div",ms,[e[121]||(e[121]=a("div",{class:"yeji-chart-panel__label"},"TOP 医生雷达(相对最高值归一)",-1)),ht.value?(o(),j(C(Z),{key:0,class:"yeji-echart yeji-echart--compact",option:ja.value,autoresize:""},null,8,["option"])):(o(),j(P,{key:1,description:"至少两名医生有数据时可展示","image-size":72}))])]),_:1})]),_:1})])):y("",!0),(o(!0),c(w,null,V(re.value,(l,b)=>(o(),c(w,{key:"dept-chart-"+b},[Ot(l)?(o(),c("section",vs,[a("h3",fs,d(Qt(l)),1),r(C(Z),{class:"yeji-echart yeji-echart--tall",option:_n(l),autoresize:""},null,8,["option"]),ea(l)||ta(l)?(o(),j(fe,{key:0,gutter:16,class:"yeji-chart-subrow"},{default:_(()=>[ea(l)?(o(),j(W,{key:0,xs:24,md:12},{default:_(()=>[a("div",ys,[e[122]||(e[122]=a("div",{class:"yeji-chart-panel__label"}," 进线 → 接诊 → 成交(汇总漏斗) ",-1)),r(C(Z),{class:"yeji-echart yeji-echart--compact",option:vn(l),autoresize:""},null,8,["option"])])]),_:2},1024)):y("",!0),ta(l)?(o(),j(W,{key:1,xs:24,md:12},{default:_(()=>[a("div",hs,[e[123]||(e[123]=a("div",{class:"yeji-chart-panel__label"}," 部门合计业绩占比(TOP10 + 其它) ",-1)),r(C(Z),{class:"yeji-echart yeji-echart--compact",option:fn(l),autoresize:""},null,8,["option"])])]),_:2},1024)):y("",!0)]),_:2},1024)):y("",!0)])):y("",!0)],64))),128)),N.value?(o(!0),c(w,{key:1},V(Rt.value,l=>(o(),c("section",{key:"lb-chart-"+l.dept_id,class:"yeji-chart-block"},[a("h3",bs,[u(d(l.dept_name)+" · 医助 ",1),N.value.channel_name?(o(),c("span",gs," ("+d(N.value.channel_name)+") ",1)):y("",!0),a("span",ws,d(N.value.start_date)+"~"+d(N.value.end_date),1)]),r(fe,{gutter:16},{default:_(()=>[r(W,{xs:24,lg:Zt(l)?14:24},{default:_(()=>[r(C(Z),{class:"yeji-echart",option:pn(l,N.value),autoresize:""},null,8,["option"])]),_:2},1032,["lg"]),Zt(l)?(o(),j(W,{key:0,xs:24,lg:10},{default:_(()=>[a("div",ks,[e[124]||(e[124]=a("div",{class:"yeji-chart-panel__label"},"诊金占比",-1)),r(C(Z),{class:"yeji-echart yeji-echart--compact",option:mn(l,N.value),autoresize:""},null,8,["option"])])]),_:2},1024)):y("",!0)]),_:2},1024)]))),128)):y("",!0)],64)):!le.value&&(!Ce.value||!De.value)&&!oe.value?(o(),j(P,{key:1,class:"yeji-charts-empty",description:"当前筛选下暂无图表数据,请调整条件后查询"})):y("",!0)])),[[F,le.value||Ce.value&&De.value||oe.value]])]),_:1}),r(Pe,{modelValue:te.value,"onUpdate:modelValue":e[5]||(e[5]=l=>te.value=l),direction:"rtl",size:"min(1120px, 98vw)","destroy-on-close":"",class:"yeji-order-drawer","show-close":!0},{header:_(()=>[a("div",js,[a("h3",xs,d(Fe.value),1),a("p",Ns,d(Ee.value),1)])]),default:_(()=>[a("div",Ss,[a("section",Cs,[a("div",Ds,[e[126]||(e[126]=a("span",{class:"yeji-order-drawer__stat-label"},"符合条件的订单",-1)),a("span",Ls,d(Qe.value.toLocaleString("zh-CN"))+" 笔",1)]),a("div",zs,[e[127]||(e[127]=a("span",{class:"yeji-order-drawer__stat-label"},[u(" 约诊 "),a("span",{class:"yeji-order-drawer__stat-note"},"(已完成挂号;日期按挂号 appointment_date;医助=挂号或诊单,与看板接诊一致)")],-1)),a("span",$s,d(Vt.value===null?"—":Vt.value.toLocaleString("zh-CN"))+" 次",1)]),Ft.value&&H.value?(o(),c(w,{key:0},[a("div",As,[a("span",Ps,[e[128]||(e[128]=u(" 合计业绩 ",-1)),a("span",Rs,"(与看板「合计业绩」列同口径,不限渠道;"+d(H.value.totalOrderCount.toLocaleString("zh-CN"))+" 笔)",1)]),a("span",Os," ¥"+d(tt(H.value.totalAmount)),1)]),a("div",Ms,[a("span",Is,[u(d(bt.value)+"业绩 ",1),a("span",Ts,"(与看板「"+d(bt.value)+"业绩」同口径;"+d(H.value.channelOrderCount.toLocaleString("zh-CN"))+" 笔)",1)]),a("span",Vs," ¥"+d(tt(La.value)),1)])],64)):(o(),c("div",Fs,[e[129]||(e[129]=a("span",{class:"yeji-order-drawer__stat-label"},[u(" 业务订单金额合计 "),a("span",{class:"yeji-order-drawer__stat-note"},"(不含履约 4·9·10,与上方业绩口径一致)")],-1)),a("span",Es," ¥"+d(tt(Tt.value)),1)])),pe.value.length>0?(o(),c("div",Bs,[e[130]||(e[130]=a("span",{class:"yeji-order-drawer__stat-label"},"本页小计",-1)),a("span",Ys,"¥"+d(tt(Da.value)),1)])):y("",!0)]),Ft.value?(o(),j($e,{key:0,modelValue:G.value,"onUpdate:modelValue":e[4]||(e[4]=l=>G.value=l),class:"yeji-order-drawer__list-tabs",onTabChange:Ga},{default:_(()=>[r(Q,{label:"合计业绩(全量订单)",name:"total"}),r(Q,{label:`渠道筛选(${bt.value})`,name:"channel"},null,8,["label"])]),_:1},8,["modelValue"])):y("",!0),K((o(),c("div",Us,[pe.value.length>0||_e.value?(o(),j(R,{key:0,data:pe.value,size:"small",stripe:"",border:"","max-height":"58vh",class:"yeji-order-drawer__table","empty-text":_e.value?"加载中…":"暂无数据"},{default:_(()=>[r(p,{type:"index",label:"#",width:"46",index:Fa}),r(p,{prop:"order_no",label:"订单号","min-width":"152","show-overflow-tooltip":""}),r(p,{label:"关联挂号","min-width":"218"},{default:_(({row:l})=>[l.linked_appointment?(o(),c("div",Hs,[a("div",Ws,[e[131]||(e[131]=a("span",{class:"yeji-order-appt-k"},"日期",-1)),u(" "+d(Ea(l.linked_appointment)),1)]),a("div",qs,[e[132]||(e[132]=a("span",{class:"yeji-order-appt-k"},"状态",-1)),u(" "+d(l.linked_appointment.status_desc||"—")+" ",1),l.linked_appointment.doctor_name?(o(),c("span",Gs," · "+d(l.linked_appointment.doctor_name),1)):y("",!0)]),a("div",Js,[e[133]||(e[133]=a("span",{class:"yeji-order-appt-k"},"类型",-1)),u(" "+d(l.linked_appointment.appointment_type_desc||"—"),1)]),a("div",Ks,[e[135]||(e[135]=a("span",{class:"yeji-order-appt-k"},"渠道",-1)),a("span",Xs,[u(d(l.linked_appointment.channel_source_desc||l.linked_appointment.channel_source||"—")+" ",1),Yt(l.linked_appointment)!==""?(o(),c("span",Qs," (字典 value "+d(Yt(l.linked_appointment))+" ) ",1)):y("",!0)]),r(O,{placement:"top",effect:"dark","show-after":200},{content:_(()=>[...e[134]||(e[134]=[a("div",{style:{"max-width":"280px","line-height":"1.65","font-size":"12px"}},[u(" 「字典 value」= 系统字典 "),a("b",null,"channels"),u(" 的 value,与业绩表里按渠道收窄时所用"),a("b",null,"挂号 channels"),u("一致;便于和进线列所选渠道对照,"),a("b",null,"不是"),u("企微 add_external_contact 单上的独立编号。 ")],-1)])]),default:_(()=>[r(k,{class:"yeji-order-appt-info","aria-label":"说明"},{default:_(()=>[r(C(E))]),_:1})]),_:1})])])):(o(),c("span",Zs,"—"))]),_:1}),r(p,{label:"金额",width:"108",align:"right"},{default:_(({row:l})=>[a("span",ei,"¥"+d(l.amount??"—"),1)]),_:1}),r(p,{prop:"recipient_name",label:"收货人",width:"96","show-overflow-tooltip":""}),r(p,{label:"履约",width:"104","show-overflow-tooltip":""},{default:_(({row:l})=>[u(d(Va(l.fulfillment_status)),1)]),_:1}),r(p,{label:"创建时间","min-width":"148"},{default:_(({row:l})=>[u(d(Ba(l.create_time)),1)]),_:1}),r(p,{prop:"doctor_name",label:"开方人",width:"88","show-overflow-tooltip":""}),r(p,{prop:"assistant_name",label:"诊单医助",width:"88","show-overflow-tooltip":""}),r(p,{prop:"creator_name",label:"创建人",width:"88","show-overflow-tooltip":""})]),_:1},8,["data","empty-text"])):y("",!0),!_e.value&&pe.value.length===0?(o(),j(P,{key:1,description:"暂无业务订单"})):y("",!0),a("div",ti,[r(Ae,{"current-page":X.value,"page-size":Ze.value,background:"",layout:"total, sizes, prev, pager, next, jumper",total:Qe.value,"page-sizes":[10,15,20,50],disabled:_e.value,"hide-on-single-page":!1,onCurrentChange:Ja,onSizeChange:Ka},null,8,["current-page","page-size","total","disabled"])])])),[[F,_e.value]])])]),_:1},8,["modelValue"]),r(ye,{modelValue:dt.value,"onUpdate:modelValue":e[6]||(e[6]=l=>dt.value=l),width:"min(680px, 94vw)","destroy-on-close":"",class:"yeji-unassigned-dialog"},{header:_(()=>[a("div",ai,[e[136]||(e[136]=a("span",{class:"yeji-unassigned-dialog__title"},"「未归属中心」业绩拆解",-1)),a("p",ni,d(Dt.value),1)])]),default:_(()=>[Oe.value?(o(),c("p",li,d(Oe.value),1)):y("",!0),K((o(),c("div",oi,[ge.value.length>0||be.value?(o(),j(R,{key:0,data:ge.value,size:"small",stripe:"",border:"","max-height":"440",class:"yeji-unassigned-dialog__table","empty-text":be.value?"加载中…":"暂无数据"},{default:_(()=>[r(p,{prop:"name",label:"诊单医助","min-width":"120","show-overflow-tooltip":""}),r(p,{label:"账号",width:"88",align:"right"},{default:_(({row:l})=>[u(d(l.admin_id>0?l.admin_id:"—"),1)]),_:1}),r(p,{label:"订单数",width:"88",align:"right"},{default:_(({row:l})=>[u(d(S(l.order_count)),1)]),_:1}),r(p,{label:"业绩金额","min-width":"112",align:"right"},{default:_(({row:l})=>[u(d(M(l.amount)),1)]),_:1})]),_:1},8,["data","empty-text"])):y("",!0),!be.value&&ge.value.length===0?(o(),j(P,{key:1,description:"暂无拆解数据"})):y("",!0)])),[[F,be.value]])]),_:1},8,["modelValue"]),r(ye,{modelValue:ct.value,"onUpdate:modelValue":e[7]||(e[7]=l=>ct.value=l),width:"min(920px, 96vw)","destroy-on-close":"",class:"yeji-leadlines-dialog"},{header:_(()=>[a("div",si,[e[137]||(e[137]=a("span",{class:"yeji-unassigned-dialog__title"},"进线数据明细",-1)),a("p",ii,d($t.value),1)])]),default:_(()=>[Ie.value?(o(),c("p",ri,d(Ie.value),1)):y("",!0),K((o(),c("div",di,[je.value.length>0||de.value?(o(),j(R,{key:0,data:je.value,size:"small",stripe:"",border:"","max-height":"440",class:"yeji-unassigned-dialog__table","empty-text":de.value?"加载中…":"暂无数据"},{default:_(()=>[r(p,{prop:"event_time_text",label:"进线时间","min-width":"156","show-overflow-tooltip":""}),r(p,{prop:"reception_admin_name",label:"接待",width:"88","show-overflow-tooltip":""}),r(p,{prop:"external_contact_name",label:"客户","min-width":"100","show-overflow-tooltip":""}),r(p,{prop:"external_userid",label:"外部联系人ID","min-width":"140","show-overflow-tooltip":""}),r(p,{prop:"user_id",label:"企微成员ID","min-width":"120","show-overflow-tooltip":""}),r(p,{prop:"state",label:"渠道参数",width:"96","show-overflow-tooltip":""})]),_:1},8,["data","empty-text"])):y("",!0),!de.value&&je.value.length===0?(o(),j(P,{key:1,description:"暂无进线明细"})):y("",!0),Te.value>0?(o(),c("div",ui,[r(Ae,{"current-page":Ve.value,"page-size":Ge.value,background:"",layout:"total, sizes, prev, pager, next, jumper",total:Te.value,"page-sizes":[10,20,50,100],disabled:de.value,"hide-on-single-page":!1,onCurrentChange:an,onSizeChange:nn},null,8,["current-page","page-size","total","disabled"])])):y("",!0)])),[[F,de.value]])]),_:1},8,["modelValue"]),r(ye,{modelValue:Je.value,"onUpdate:modelValue":e[8]||(e[8]=l=>Je.value=l),width:"min(960px, 96vw)","destroy-on-close":"",class:"yeji-leadlines-dialog"},{header:_(()=>[a("div",ci,[e[138]||(e[138]=a("span",{class:"yeji-unassigned-dialog__title"},"预约诊单 · 挂号明细",-1)),a("p",_i,d(_t.value),1)])]),default:_(()=>[xe.value?(o(),c("p",pi,d(xe.value),1)):y("",!0),K((o(),c("div",mi,[se.value.length>0||ue.value?(o(),j(R,{key:0,data:se.value,size:"small",stripe:"",border:"","max-height":"440",class:"yeji-unassigned-dialog__table","empty-text":ue.value?"加载中…":"暂无数据"},{default:_(()=>[r(p,{type:"index",label:"#",width:"46",index:ln}),r(p,{prop:"appointment_date",label:"预约日期",width:"108"}),r(p,{prop:"appointment_time",label:"时段","min-width":"96","show-overflow-tooltip":""}),r(p,{prop:"status_desc",label:"状态",width:"84"}),r(p,{prop:"appointment_type_desc",label:"类型",width:"92"}),r(p,{prop:"patient_name",label:"患者","min-width":"92","show-overflow-tooltip":""}),r(p,{prop:"patient_phone",label:"手机","min-width":"116","show-overflow-tooltip":""}),r(p,{prop:"doctor_name",label:"接诊医生",width:"92","show-overflow-tooltip":""}),r(p,{prop:"assistant_name",label:"医助",width:"88","show-overflow-tooltip":""}),r(p,{label:"诊单ID",width:"84",align:"right"},{default:_(({row:l})=>[u(d(S(l.diagnosis_id??0)),1)]),_:1}),ya.value?(o(),j(p,{key:0,prop:"channel_source",label:"渠道来源",width:"96","show-overflow-tooltip":""})):y("",!0)]),_:1},8,["data","empty-text"])):y("",!0),!ue.value&&se.value.length===0?(o(),j(P,{key:1,description:"暂无挂号记录"})):y("",!0),Ne.value>0?(o(),c("div",vi,[r(Ae,{"current-page":ce.value,"page-size":Se.value,background:"",layout:"total, sizes, prev, pager, next, jumper",total:Ne.value,"page-sizes":[10,20,50,100],disabled:ue.value,"hide-on-single-page":!1,onCurrentChange:rn,onSizeChange:dn},null,8,["current-page","page-size","total","disabled"])])):y("",!0)])),[[F,ue.value]])]),_:1},8,["modelValue"]),r(ye,{modelValue:ut.value,"onUpdate:modelValue":e[9]||(e[9]=l=>ut.value=l),width:"min(560px, 94vw)","destroy-on-close":"",class:"yeji-unassigned-dialog"},{header:_(()=>[a("div",fi,[e[139]||(e[139]=a("span",{class:"yeji-unassigned-dialog__title"},"复诊 · 医助拆解",-1)),a("p",yi,d(Lt.value),1)])]),default:_(()=>[Me.value?(o(),c("p",hi,d(Me.value),1)):y("",!0),K((o(),c("div",bi,[ke.value.length>0||we.value?(o(),j(R,{key:0,data:ke.value,size:"small",stripe:"",border:"","max-height":"440",class:"yeji-unassigned-dialog__table","empty-text":we.value?"加载中…":"暂无数据"},{default:_(()=>[r(p,{prop:"name",label:"医助","min-width":"120","show-overflow-tooltip":""}),r(p,{label:"业务订单",width:"108",align:"right"},{default:_(({row:l})=>[Number(l.order_count)>0?(o(),c("span",{key:0,class:"yeji-lead-cell--link",role:"button",tabindex:"0",onClick:b=>Gt(l),onKeydown:Jn(J(b=>Gt(l),["prevent"]),["enter"])},d(S(l.order_count))+" 笔",41,gi)):(o(),c(w,{key:1},[u(d(S(l.order_count)),1)],64))]),_:1})]),_:1},8,["data","empty-text"])):y("",!0),!we.value&&ke.value.length===0?(o(),j(P,{key:1,description:"暂无拆解数据"})):y("",!0)])),[[F,we.value]])]),_:1},8,["modelValue"])])}}}),_r=dl(ki,[["__scopeId","data-v-e3825025"]]);export{_r as default};
|