2 lines
27 KiB
JavaScript
2 lines
27 KiB
JavaScript
import{a2 as nt,P as ot,Q as st,af as rt,W as it,L as dt,i as ut,d as ct,J as pt,K as _t,T as mt,C as ft,m as vt,l as gt,M as ht,N as bt,_ as wt,G as yt,F as kt,X as St,V as Ct,E as k,a as Vt}from"./element-plus-BhlMEThZ.js";import{N as Et,x as xt,m as Ot,g as zt,$ as Nt}from"./@element-plus/icons-vue-ouZ25BHH.js";import{c as Te,a as Dt,b as Mt,d as Tt,e as Lt,f as Rt}from"./stats-C1vM9P_l.js";import{f as Ft,b as Pt,ak as d,I as g,J as s,N as Bt,H as E,a as l,aN as o,F as A,ap as Le,G as b,aP as U,O as r,A as Q}from"./@vue/runtime-core-C6bnekPw.js";import{n as u,y as L,r as It}from"./@vue/reactivity-DiY1c2vO.js";import{Q as p,o as Re}from"./@vue/shared-mAAVTE9n.js";import{_ as Ut}from"./index-CiwCF9YP.js";import"./@vue/runtime-dom-DDAG46FW.js";import"./lodash-D3kF6u-c.js";import"./lodash-es-C2A-Pj28.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-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 $t={class:"cs-page"},Gt={class:"cs-masthead"},Yt={class:"cs-masthead__inner"},Wt={key:0,class:"cs-masthead__stats"},At={class:"cs-stat"},Qt={class:"cs-stat__value"},Ht={key:0,class:"cs-stat"},Jt={class:"cs-stat__value"},jt={key:1,class:"cs-stat"},qt={class:"cs-stat__value cs-stat__value--xs"},Xt={class:"filter-surface"},Zt={class:"filter-row filter-row--top"},Kt={class:"filter-field"},el={class:"filter-field"},tl={class:"filter-field filter-field--wide"},ll={class:"filter-select filter-select--dept filter-dept-tree-wrap"},al={class:"filter-actions"},nl={class:"cs-alert__body"},ol={key:0},sl={key:1},rl={key:2,class:"cs-alert__meta"},il={class:"cs-reconcile"},dl={class:"cs-reconcile__head"},ul={class:"cs-reconcile__tags"},cl={key:2,class:"cs-reconcile__meta"},pl={class:"cs-reconcile__toolbar"},_l={key:0,class:"cs-reconcile__carry"},ml={class:"cs-table-head"},fl={class:"cs-table-head__row"},vl={key:0,class:"cs-drill-state"},gl={class:"cs-dept-link__text"},hl={key:1,class:"cs-muted"},bl={class:"cs-dialog__bar"},wl={key:0},yl={key:1,class:"cs-muted"},kl={class:"cs-dialog__pager"},Sl={class:"cs-dialog__bar cs-dialog__bar--split"},Cl={class:"cs-dialog__hint"},Vl={key:0},El={key:1,class:"cs-muted"},xl={class:"cs-dialog__pager"},Ol=Ft({__name:"commission-settlement",setup(zl){const Fe={value:"id",label:"name",children:"children"};function Pe(a){if(!a.length)return[];const e=new Map;for(const c of a)e.set(c.id,{...c,children:[]});const t=[];for(const c of a){const f=e.get(c.id),v=Number(c.pid);v>0&&e.has(v)?e.get(v).children.push(f):t.push(f)}const _=c=>{var f;(f=c.children)!=null&&f.length?c.children.forEach(_):delete c.children};t.forEach(_);const y=c=>{var f;c.sort((v,S)=>{const O=v.name.includes("中心")?-1:1,N=S.name.includes("中心")?-1:1;return O!==N?O-N:v.id-S.id});for(const v of c)(f=v.children)!=null&&f.length&&y(v.children)};return y(t),t}function fe(){const a=new Date,e=a.getFullYear(),t=String(a.getMonth()+1).padStart(2,"0");return`${e}-${t}`}const w=u(fe()),D=u(!1),H=u([]),K=u(!1),Be=Q(()=>Pe(H.value)),C=u([]),ve=u([]),ee=u(!1),M=u(""),te=u([]),ge=u([]),he=u([]),J=u([]),j=u([]),be=u("dept"),R=u({}),m=It({settlement_month:"",order_month:"",cutoff_end:"",rule_note:"",channel_name:""}),V=u(null),$=u(""),le=u(!1),ae=u(!1),ne=u(!1),oe=u(!1),F=u("all"),se=u([]),re=u(0),we=u(1),ye=u(20),ie=u(!1),G=u(null),P=u("all"),q=u([]),X=u(0),de=u(1),ke=u(20),ue=u(!1),Ie=Q(()=>{const a=new Map;for(const e of H.value){const t=Number(e.pid),_=a.get(t)??[];_.push(e.id),a.set(t,_)}return a}),ce=Q(()=>{const a=new Map;for(const e of H.value)a.set(e.id,e);return a}),Y=Q(()=>{if(C.value.length!==1)return null;const a=C.value[0];return ce.value.get(a)??null}),Ue=Q(()=>{const a=Y.value;if(!a)return"返回顶层";const e=Number(a.pid),t=e>0?ce.value.get(e):null;return!t||Number(t.pid)<=0?"返回顶层":`返回上级 · ${t.name}`});function Se(a){if(!a||a<=0)return!1;const e=Ie.value.get(a);return!!(e&&e.length>0)}function $e(a){if(!(!a||!a.dept_id||a.dept_id<=0)){if(Se(a.dept_id)){C.value=[a.dept_id],x();return}Ye(a.dept_id,a.dept_name)}}function Ge(){const a=Y.value;if(!a){C.value=[],x();return}const e=Number(a.pid),t=e>0?ce.value.get(e):null;!t||Number(t.pid)<=0?C.value=[]:C.value=[e],x()}function Ye(a,e){if(!w.value){k.warning("请选择结算月");return}G.value={id:a,name:e},P.value="all",de.value=1,q.value=[],X.value=0,ie.value=!0,pe(1)}async function pe(a){if(!(!w.value||!G.value)){ue.value=!0,de.value=a;try{const e={settlement_month:w.value,dept_ids:String(G.value.id),page:a,page_size:ke.value};M.value&&(e.channel_code=M.value),P.value&&P.value!=="all"&&(e.bucket=P.value);const t=await Te(e);q.value=(t==null?void 0:t.list)||[],X.value=Number((t==null?void 0:t.count)??0)}catch(e){k.error((e==null?void 0:e.msg)||(e==null?void 0:e.message)||"加载明细失败"),q.value=[],X.value=0}finally{ue.value=!1}}}function h(a){return a==null||!Number.isFinite(Number(a))?"—":`¥ ${Number(a).toLocaleString("zh-CN",{minimumFractionDigits:2,maximumFractionDigits:2})}`}async function We(){K.value=!0;try{const a=await Dt();H.value=(a||[]).sort((e,t)=>{const _=e.name.includes("中心")?-1:1,y=t.name.includes("中心")?-1:1;return _!==y?_-y:e.id-t.id})}catch{}finally{K.value=!1}}async function Ae(){ee.value=!0;try{const a=await Mt();ve.value=(a==null?void 0:a.groups)||[]}catch{}finally{ee.value=!1}}async function x(){var e;const a=w.value;if(!a){k.warning("请选择结算月");return}D.value=!0;try{const t=await Tt(Z());te.value=(t==null?void 0:t.rows)||[],ge.value=(t==null?void 0:t.assistant_rows)||[],he.value=(t==null?void 0:t.doctor_rows)||[],J.value=(t==null?void 0:t.assistant_channel_rows)||[],j.value=(t==null?void 0:t.doctor_channel_rows)||[],R.value=(t==null?void 0:t.total)||{},m.settlement_month=(t==null?void 0:t.settlement_month)||a,m.order_month=(t==null?void 0:t.order_month)||"",m.cutoff_end=(t==null?void 0:t.cutoff_end)||"",m.rule_note=(t==null?void 0:t.rule_note)||"",m.channel_name=(t==null?void 0:t.channel_name)||"",V.value=(t==null?void 0:t.confirm)??null,$.value=((e=t==null?void 0:t.confirm)==null?void 0:e.reconcile_note)!=null?String(t.confirm.reconcile_note):""}catch(t){k.error((t==null?void 0:t.msg)||(t==null?void 0:t.message)||"加载失败"),te.value=[],ge.value=[],he.value=[],J.value=[],j.value=[],R.value={},V.value=null}finally{D.value=!1}}function Z(){const e={settlement_month:w.value};return C.value.length>0&&(e.dept_ids=C.value.join(",")),M.value&&(e.channel_code=M.value),e}function Qe(){if(!w.value){k.warning("请选择结算月");return}ne.value=!0}function He(){F.value="all",_e(1)}async function _e(a){if(w.value){oe.value=!0,we.value=a;try{const e={...Z(),page:a,page_size:ye.value};F.value&&F.value!=="all"&&(e.bucket=F.value);const t=await Te(e);se.value=(t==null?void 0:t.list)||[],re.value=Number((t==null?void 0:t.count)??0)}catch(e){k.error((e==null?void 0:e.msg)||(e==null?void 0:e.message)||"加载明细失败"),se.value=[],re.value=0}finally{oe.value=!1}}}async function Je(){var a;if(!w.value){k.warning("请选择结算月");return}if(((a=V.value)==null?void 0:a.status)===1){k.warning("已确定业绩不可修改备注");return}le.value=!0;try{await Lt({...Z(),reconcile_note:$.value}),k.success("已保存核对备注"),await x()}catch(e){k.error((e==null?void 0:e.msg)||(e==null?void 0:e.message)||"保存失败")}finally{le.value=!1}}async function je(){if(!w.value){k.warning("请选择结算月");return}try{await Vt.confirm("确定后将为「顺延下期」订单写入结转记录;下一结算月在相同渠道与部门筛选下自动并入统计。已确定后不可在线撤销,请与财务核对后再操作。","确定本期业绩",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"})}catch{return}ae.value=!0;try{const a=await Rt({...Z(),reconcile_note:$.value});k.success(`已确定本期业绩;结转 ${Number((a==null?void 0:a.deferred_carry_count)??0)} 单至 ${String((a==null?void 0:a.next_settlement_month)??"下期")}`),await x()}catch(a){k.error((a==null?void 0:a.msg)||(a==null?void 0:a.message)||"提交失败")}finally{ae.value=!1}}function qe(){w.value=fe(),C.value=[],M.value="",x()}function Ce(a){const{columns:e}=a,t=R.value,_=[];return e.forEach((y,c)=>{if(c===0){_[c]="合计";return}const f=y.property;if(!t||!f){_[c]="";return}if(f==="primary_dept_name"||f==="appt_channel_name"){_[c]="";return}if(f==="carry_in_order_count"){_[c]=String(t.carry_in_order_count??0);return}const v={completed_order_count:String(t.completed_order_count??0),completed_order_amount:h(t.completed_order_amount),current_period_count:String(t.current_period_count??0),current_period_amount:h(t.current_period_amount),deferred_period_count:String(t.deferred_period_count??0),deferred_period_amount:h(t.deferred_period_amount)};_[c]=v[String(f)]??""}),_}function Ve(a,e){return t=>{const{rowIndex:_,columnIndex:y}=t;if(y>1)return;const c=a.value;if(!c||c.length===0)return;const f=c[_];if(!f)return;const v=f[e],S=_>0?c[_-1]:null;if(S&&S[e]===v)return{rowspan:0,colspan:0};let O=1;for(let N=_+1;N<c.length&&c[N][e]===v;N++)O++;return{rowspan:O,colspan:1}}}const Xe=Ve(J,"assistant_id"),Ze=Ve(j,"doctor_id");function Ee(a){const e=(a||"").trim();return e?e.startsWith("复诊")?"cs-channel-tag--revisit":e.startsWith("自媒体")?"cs-channel-tag--media":e.includes("转介绍")?"cs-channel-tag--referral":e.startsWith("未匹配")?"cs-channel-tag--muted":"cs-channel-tag--neutral":"cs-channel-tag--muted"}function Ke(a){const{columns:e}=a,t=R.value,_=[];return e.forEach((y,c)=>{if(c===0){_[c]="合计";return}const f=y.property;if(!t||!f){_[c]="";return}const v={completed_order_count:String(t.completed_order_count??0),completed_order_amount:h(t.completed_order_amount),current_period_count:String(t.current_period_count??0),current_period_amount:h(t.current_period_amount),deferred_period_count:String(t.deferred_period_count??0),deferred_period_amount:h(t.deferred_period_amount)};_[c]=v[String(f)]??""}),_}return Pt(async()=>{await Promise.all([We(),Ae()]),await x()}),(a,e)=>{const t=nt,_=st,y=rt,c=ot,f=it,v=ct,S=ut,O=pt,N=_t,z=mt,et=ft,tt=wt,i=bt,W=ht,me=gt,lt=vt,B=kt,xe=yt,Oe=St,ze=Ct,I=dt;return d(),g("div",$t,[s("header",Gt,[s("div",Yt,[e[14]||(e[14]=Bt('<div class="cs-masthead__main" data-v-95ad97e4><span class="cs-masthead__eyebrow" data-v-95ad97e4><span class="cs-masthead__dot" data-v-95ad97e4></span> 财务结算 · 业绩台账 </span><h1 class="cs-masthead__title" data-v-95ad97e4>提成结算业绩</h1><p class="cs-masthead__desc" data-v-95ad97e4> 系统代开处方对应的已完成业务订单;按结算月 7 日截止拆分本期提成与顺延下期;可按部门汇总或下发至业绩归属医助与处方开方医生 </p></div>',1)),m.settlement_month||m.cutoff_end?(d(),g("dl",Wt,[s("div",At,[e[11]||(e[11]=s("dt",{class:"cs-stat__label"},"结算月",-1)),s("dd",Qt,p(m.settlement_month||w.value),1)]),m.order_month?(d(),g("div",Ht,[e[12]||(e[12]=s("dt",{class:"cs-stat__label"},"订单创建月",-1)),s("dd",Jt,p(m.order_month),1)])):E("",!0),m.cutoff_end?(d(),g("div",jt,[e[13]||(e[13]=s("dt",{class:"cs-stat__label"},"截止时刻",-1)),s("dd",qt,p(m.cutoff_end),1)])):E("",!0)])):E("",!0)])]),l(O,{class:"cs-panel filter-card",shadow:"never"},{default:o(()=>[s("div",Xt,[s("div",Zt,[s("div",Kt,[e[15]||(e[15]=s("span",{class:"lbl"},"结算月",-1)),l(t,{modelValue:w.value,"onUpdate:modelValue":e[0]||(e[0]=n=>w.value=n),type:"month","value-format":"YYYY-MM",placeholder:"选择结算月",class:"filter-month"},null,8,["modelValue"])]),s("div",el,[e[16]||(e[16]=s("span",{class:"lbl"},"渠道来源",-1)),l(c,{modelValue:M.value,"onUpdate:modelValue":e[1]||(e[1]=n=>M.value=n),filterable:"",clearable:"",placeholder:"全部",class:"filter-select filter-select--channel",loading:ee.value,onChange:x},{default:o(()=>[l(_,{label:"全部",value:""}),(d(!0),g(A,null,Le(ve.value,n=>(d(),b(y,{key:n.group_name,label:n.group_name},{default:o(()=>[(d(!0),g(A,null,Le(n.channels,T=>(d(),b(_,{key:T.channel_code,label:T.channel_name,value:T.channel_code},null,8,["label","value"]))),128))]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue","loading"])]),s("div",tl,[e[17]||(e[17]=s("span",{class:"lbl"},"展示部门",-1)),U((d(),g("div",ll,[l(f,{modelValue:C.value,"onUpdate:modelValue":e[2]||(e[2]=n=>C.value=n),data:Be.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:Fe},null,8,["modelValue","data"])])),[[I,K.value]])]),s("div",al,[l(S,{type:"primary",class:"filter-btn filter-btn--query",loading:D.value,onClick:x},{default:o(()=>[l(v,{class:"filter-btn__icon"},{default:o(()=>[l(L(Et))]),_:1}),e[18]||(e[18]=r(" 查询 ",-1))]),_:1},8,["loading"]),l(S,{class:"filter-btn filter-btn--reset",disabled:D.value,onClick:qe},{default:o(()=>[l(v,{class:"filter-btn__icon"},{default:o(()=>[l(L(xt))]),_:1}),e[19]||(e[19]=r(" 重置 ",-1))]),_:1},8,["disabled"])])])])]),_:1}),l(N,{type:"info",closable:!1,"show-icon":"",class:"cs-alert"},{title:o(()=>[...e[20]||(e[20]=[s("span",{class:"cs-alert__title"},"统计口径",-1)])]),default:o(()=>[s("div",nl,[m.rule_note?(d(),g("p",ol,p(m.rule_note),1)):(d(),g("p",sl,[...e[21]||(e[21]=[r(" 订单创建月为",-1),s("strong",null,"结算月的上一自然月",-1),r(";仅",-1),s("strong",null,"系统代开处方",-1),r("(完成挂号等自动生成)对应的",-1),s("strong",null,"履约已完成",-1),r("业务订单。 ",-1),s("strong",null,"签收",-1),r("时间取物流签收时间;",-1),s("strong",null,"尾款支付",-1),r("取关联支付单已支付时间(优先尾款/全部费用类型)。 签收与尾款均在",-1),s("strong",null,"结算月 7 日 24:00 前",-1),r("完成的计入「本期提成」,其余计入「顺延下期」。 ",-1)])])),m.cutoff_end?(d(),g("p",rl,[e[23]||(e[23]=r(" 当前结算月:",-1)),s("strong",null,p(m.settlement_month),1),e[24]||(e[24]=r(" · 订单创建月:",-1)),s("strong",null,p(m.order_month),1),e[25]||(e[25]=r(" · 截止时刻:",-1)),s("strong",null,p(m.cutoff_end),1),m.channel_name?(d(),g(A,{key:0},[e[22]||(e[22]=r(" · 渠道:",-1)),s("strong",null,p(m.channel_name),1)],64)):E("",!0)])):E("",!0)])]),_:1}),l(O,{class:"cs-panel cs-reconcile-card",shadow:"never"},{default:o(()=>{var n,T,Ne,De,Me;return[s("div",il,[s("div",dl,[s("div",ul,[((n=V.value)==null?void 0:n.status)===1?(d(),b(z,{key:0,type:"success",effect:"dark"},{default:o(()=>[...e[26]||(e[26]=[r("已确定业绩",-1)])]),_:1})):(d(),b(z,{key:1,type:"warning",effect:"plain"},{default:o(()=>[...e[27]||(e[27]=[r("待确定业绩",-1)])]),_:1})),((T=V.value)==null?void 0:T.status)===1&&V.value.confirmed_at_text?(d(),g("span",cl,p(V.value.confirmed_admin_name||"—")+" · "+p(V.value.confirmed_at_text),1)):E("",!0)]),s("div",pl,[l(S,{type:"primary",plain:"",onClick:Qe},{default:o(()=>[...e[28]||(e[28]=[r("业绩明细核对",-1)])]),_:1}),l(S,{disabled:((Ne=V.value)==null?void 0:Ne.status)===1||le.value,onClick:Je},{default:o(()=>[...e[29]||(e[29]=[r(" 保存核对备注 ",-1)])]),_:1},8,["disabled"]),l(S,{type:"warning",disabled:((De=V.value)==null?void 0:De.status)===1||ae.value,onClick:je},{default:o(()=>[...e[30]||(e[30]=[r(" 确定本期业绩 ",-1)])]),_:1},8,["disabled"])])]),l(et,{modelValue:$.value,"onUpdate:modelValue":e[3]||(e[3]=at=>$.value=at),type:"textarea",rows:2,maxlength:"500","show-word-limit":"",placeholder:"核对备注(可与财务线下对齐后填写;确定业绩前可反复保存)",disabled:((Me=V.value)==null?void 0:Me.status)===1,class:"cs-reconcile__note"},null,8,["modelValue","disabled"]),Number(R.value.carry_in_order_count)>0?(d(),g("p",_l,[e[31]||(e[31]=r(" 上期顺延汇入本期:",-1)),s("strong",null,p(R.value.carry_in_order_count),1),e[32]||(e[32]=r(" 单(已并入当前汇总) ",-1))])):E("",!0)])]}),_:1}),l(O,{class:"cs-panel cs-summary-card",shadow:"never"},{default:o(()=>[l(lt,{modelValue:be.value,"onUpdate:modelValue":e[4]||(e[4]=n=>be.value=n),class:"cs-summary-tabs"},{default:o(()=>[l(me,{label:"部门汇总",name:"dept"},{default:o(()=>[s("div",ml,[s("div",fl,[e[33]||(e[33]=s("span",{class:"cs-table-head__title"},"部门汇总",-1)),Y.value?(d(),g("div",vl,[l(z,{size:"small",type:"info",effect:"plain",class:"cs-drill-state__tag"},{default:o(()=>[r(" 当前下钻:"+p(Y.value.path||Y.value.name),1)]),_:1}),l(S,{link:"",type:"primary",class:"cs-drill-state__back",onClick:Ge},{default:o(()=>[l(v,null,{default:o(()=>[l(L(Ot))]),_:1}),r(" "+p(Ue.value),1)]),_:1})])):E("",!0)]),e[34]||(e[34]=s("span",{class:"cs-table-head__hint"},[r(" 金额单位:元;与业绩看板相同的部门摊列规则(业绩归属医助 → 展示「中心」)。 "),s("strong",null,"点击部门"),r(":若有子部门则下钻一层;末级部门弹出「已完成业绩订单」明细。 ")],-1))]),U((d(),b(W,{data:te.value,border:"",stripe:"",size:"small",class:"cs-table cs-table--clickable","show-summary":"","summary-method":Ke},{default:o(()=>[l(i,{prop:"dept_name",label:"部门","min-width":"220",fixed:""},{default:o(({row:n})=>[n.dept_id>0?(d(),b(tt,{key:0,type:"primary",underline:!1,class:"cs-dept-link",onClick:T=>$e(n)},{default:o(()=>[s("span",gl,p(n.dept_name),1),l(v,{class:"cs-dept-link__icon"},{default:o(()=>[Se(n.dept_id)?(d(),b(L(zt),{key:0})):(d(),b(L(Nt),{key:1}))]),_:2},1024)]),_:2},1032,["onClick"])):(d(),g("span",hl,p(n.dept_name),1))]),_:1}),l(i,{prop:"completed_order_count",label:"已完成单数","min-width":"104",align:"right"}),l(i,{prop:"completed_order_amount",label:"已完成金额","min-width":"112",align:"right"},{default:o(({row:n})=>[r(p(h(n.completed_order_amount)),1)]),_:1}),l(i,{prop:"current_period_count",label:"本期提成单数","min-width":"118",align:"right"}),l(i,{prop:"current_period_amount",label:"本期提成金额","min-width":"118",align:"right"},{default:o(({row:n})=>[r(p(h(n.current_period_amount)),1)]),_:1}),l(i,{prop:"deferred_period_count",label:"顺延下期单数","min-width":"118",align:"right"}),l(i,{prop:"deferred_period_amount",label:"顺延下期金额","min-width":"118",align:"right"},{default:o(({row:n})=>[r(p(h(n.deferred_period_amount)),1)]),_:1})]),_:1},8,["data"])),[[I,D.value]])]),_:1}),l(me,{label:"按医助下发",name:"assistant"},{default:o(()=>[e[35]||(e[35]=s("div",{class:"cs-table-head"},[s("span",{class:"cs-table-head__title"},"业绩归属医助 × 挂号渠道"),s("span",{class:"cs-table-head__hint"},[r(" 按诊单业绩归属医助 "),s("strong",null,"×"),r(" 挂号渠道(doctor_appointment.channels)拆分到行; "),s("strong",null,"「复诊2」「复诊3」「自媒体1」等保持各自独立"),r(",未关联挂号统一归到「未匹配挂号渠道」。 同一医助多行"),s("strong",null,"自动合并「医助 / 归属中心」单元格"),r(",「顺延汇入」为上期结转进入本期订单池的单数。 ")])],-1)),U((d(),b(W,{data:J.value,border:"",stripe:"",size:"small",class:"cs-table cs-table--grouped","show-summary":"","summary-method":Ce,"span-method":L(Xe)},{default:o(()=>[l(i,{prop:"assistant_name",label:"医助","min-width":"120",fixed:"","show-overflow-tooltip":""}),l(i,{prop:"primary_dept_name",label:"归属中心","min-width":"120","show-overflow-tooltip":""}),l(i,{prop:"appt_channel_name",label:"挂号渠道","min-width":"120","show-overflow-tooltip":""},{default:o(({row:n})=>[l(z,{size:"small",class:Re(["cs-channel-tag",Ee(n.appt_channel_name)]),effect:"plain"},{default:o(()=>[r(p(n.appt_channel_name),1)]),_:2},1032,["class"])]),_:1}),l(i,{prop:"carry_in_order_count",label:"顺延汇入单数","min-width":"112",align:"right"}),l(i,{prop:"completed_order_count",label:"已完成单数","min-width":"104",align:"right"}),l(i,{prop:"completed_order_amount",label:"已完成金额","min-width":"112",align:"right"},{default:o(({row:n})=>[r(p(h(n.completed_order_amount)),1)]),_:1}),l(i,{prop:"current_period_count",label:"本期提成单数","min-width":"118",align:"right"}),l(i,{prop:"current_period_amount",label:"本期提成金额","min-width":"118",align:"right"},{default:o(({row:n})=>[r(p(h(n.current_period_amount)),1)]),_:1}),l(i,{prop:"deferred_period_count",label:"顺延下期单数","min-width":"118",align:"right"}),l(i,{prop:"deferred_period_amount",label:"顺延下期金额","min-width":"118",align:"right"},{default:o(({row:n})=>[r(p(h(n.deferred_period_amount)),1)]),_:1})]),_:1},8,["data","span-method"])),[[I,D.value]])]),_:1}),l(me,{label:"按医生下发",name:"doctor"},{default:o(()=>[e[36]||(e[36]=s("div",{class:"cs-table-head"},[s("span",{class:"cs-table-head__title"},"处方开方医生 × 挂号渠道"),s("span",{class:"cs-table-head__hint"},[r(" 按处方创建账号(开方人) "),s("strong",null,"×"),r(" 挂号渠道拆分; 可与医助维度交叉核对;同一医生多行自动合并「医生 / 归属中心」单元格。 ")])],-1)),U((d(),b(W,{data:j.value,border:"",stripe:"",size:"small",class:"cs-table cs-table--grouped","show-summary":"","summary-method":Ce,"span-method":L(Ze)},{default:o(()=>[l(i,{prop:"doctor_name",label:"医生","min-width":"120",fixed:"","show-overflow-tooltip":""}),l(i,{prop:"primary_dept_name",label:"归属中心","min-width":"120","show-overflow-tooltip":""}),l(i,{prop:"appt_channel_name",label:"挂号渠道","min-width":"120","show-overflow-tooltip":""},{default:o(({row:n})=>[l(z,{size:"small",class:Re(["cs-channel-tag",Ee(n.appt_channel_name)]),effect:"plain"},{default:o(()=>[r(p(n.appt_channel_name),1)]),_:2},1032,["class"])]),_:1}),l(i,{prop:"carry_in_order_count",label:"顺延汇入单数","min-width":"112",align:"right"}),l(i,{prop:"completed_order_count",label:"已完成单数","min-width":"104",align:"right"}),l(i,{prop:"completed_order_amount",label:"已完成金额","min-width":"112",align:"right"},{default:o(({row:n})=>[r(p(h(n.completed_order_amount)),1)]),_:1}),l(i,{prop:"current_period_count",label:"本期提成单数","min-width":"118",align:"right"}),l(i,{prop:"current_period_amount",label:"本期提成金额","min-width":"118",align:"right"},{default:o(({row:n})=>[r(p(h(n.current_period_amount)),1)]),_:1}),l(i,{prop:"deferred_period_count",label:"顺延下期单数","min-width":"118",align:"right"}),l(i,{prop:"deferred_period_amount",label:"顺延下期金额","min-width":"118",align:"right"},{default:o(({row:n})=>[r(p(h(n.deferred_period_amount)),1)]),_:1})]),_:1},8,["data","span-method"])),[[I,D.value]])]),_:1})]),_:1},8,["modelValue"])]),_:1}),l(ze,{modelValue:ne.value,"onUpdate:modelValue":e[7]||(e[7]=n=>ne.value=n),title:"业绩明细核对",width:"1040px","destroy-on-close":"",class:"cs-dialog",onOpen:He},{default:o(()=>[s("div",bl,[l(xe,{modelValue:F.value,"onUpdate:modelValue":e[5]||(e[5]=n=>F.value=n),size:"small",onChange:e[6]||(e[6]=n=>_e(1))},{default:o(()=>[l(B,{label:"all"},{default:o(()=>[...e[37]||(e[37]=[r("全部",-1)])]),_:1}),l(B,{label:"current"},{default:o(()=>[...e[38]||(e[38]=[r("本期提成",-1)])]),_:1}),l(B,{label:"deferred"},{default:o(()=>[...e[39]||(e[39]=[r("顺延下期",-1)])]),_:1})]),_:1},8,["modelValue"])]),U((d(),b(W,{data:se.value,border:"",stripe:"",size:"small","max-height":"440"},{default:o(()=>[l(i,{prop:"order_no",label:"业务订单号","min-width":"116","show-overflow-tooltip":""}),l(i,{prop:"assistant_name",label:"业绩医助","min-width":"100","show-overflow-tooltip":""}),l(i,{prop:"doctor_name",label:"开方医生","min-width":"100","show-overflow-tooltip":""}),l(i,{prop:"primary_dept_name",label:"归属部门","min-width":"100","show-overflow-tooltip":""}),l(i,{prop:"amount",label:"金额",width:"108",align:"right"},{default:o(({row:n})=>[r(p(h(n.amount)),1)]),_:1}),l(i,{label:"分段",width:"88",align:"center"},{default:o(({row:n})=>[n.bucket==="current"?(d(),b(z,{key:0,type:"success",size:"small"},{default:o(()=>[...e[40]||(e[40]=[r("本期",-1)])]),_:1})):(d(),b(z,{key:1,type:"warning",size:"small"},{default:o(()=>[...e[41]||(e[41]=[r("顺延",-1)])]),_:1}))]),_:1}),l(i,{label:"结转",width:"72",align:"center"},{default:o(({row:n})=>[n.is_carry_in?(d(),g("span",wl,"是")):(d(),g("span",yl,"—"))]),_:1}),l(i,{prop:"sign_time_text",label:"签收时间","min-width":"152","show-overflow-tooltip":""}),l(i,{prop:"pay_time_text",label:"尾款支付","min-width":"152","show-overflow-tooltip":""}),l(i,{prop:"create_time_text",label:"订单创建",width:"152"})]),_:1},8,["data"])),[[I,oe.value]]),s("div",kl,[l(Oe,{layout:"total, prev, pager, next",total:re.value,"page-size":ye.value,"current-page":we.value,onCurrentChange:_e},null,8,["total","page-size","current-page"])])]),_:1},8,["modelValue"]),l(ze,{modelValue:ie.value,"onUpdate:modelValue":e[10]||(e[10]=n=>ie.value=n),title:G.value?`已完成业绩订单 · ${G.value.name}`:"已完成业绩订单",width:"1040px","destroy-on-close":"",class:"cs-dialog"},{default:o(()=>[s("div",Sl,[l(xe,{modelValue:P.value,"onUpdate:modelValue":e[8]||(e[8]=n=>P.value=n),size:"small",onChange:e[9]||(e[9]=n=>pe(1))},{default:o(()=>[l(B,{label:"all"},{default:o(()=>[...e[42]||(e[42]=[r("全部已完成",-1)])]),_:1}),l(B,{label:"current"},{default:o(()=>[...e[43]||(e[43]=[r("本期提成",-1)])]),_:1}),l(B,{label:"deferred"},{default:o(()=>[...e[44]||(e[44]=[r("顺延下期",-1)])]),_:1})]),_:1},8,["modelValue"]),s("span",Cl,[e[47]||(e[47]=r(" 结算月:",-1)),s("strong",null,p(m.settlement_month||w.value),1),m.order_month?(d(),g(A,{key:0},[e[45]||(e[45]=r(" · 订单创建月:",-1)),s("strong",null,p(m.order_month),1)],64)):E("",!0),m.channel_name?(d(),g(A,{key:1},[e[46]||(e[46]=r(" · 渠道:",-1)),s("strong",null,p(m.channel_name),1)],64)):E("",!0)])]),U((d(),b(W,{data:q.value,border:"",stripe:"",size:"small","max-height":"440"},{default:o(()=>[l(i,{prop:"order_no",label:"业务订单号","min-width":"116","show-overflow-tooltip":""}),l(i,{prop:"assistant_name",label:"业绩医助","min-width":"100","show-overflow-tooltip":""}),l(i,{prop:"doctor_name",label:"开方医生","min-width":"100","show-overflow-tooltip":""}),l(i,{prop:"primary_dept_name",label:"归属部门","min-width":"120","show-overflow-tooltip":""}),l(i,{prop:"amount",label:"金额",width:"108",align:"right"},{default:o(({row:n})=>[r(p(h(n.amount)),1)]),_:1}),l(i,{label:"分段",width:"88",align:"center"},{default:o(({row:n})=>[n.bucket==="current"?(d(),b(z,{key:0,type:"success",size:"small"},{default:o(()=>[...e[48]||(e[48]=[r("本期",-1)])]),_:1})):(d(),b(z,{key:1,type:"warning",size:"small"},{default:o(()=>[...e[49]||(e[49]=[r("顺延",-1)])]),_:1}))]),_:1}),l(i,{label:"结转",width:"72",align:"center"},{default:o(({row:n})=>[n.is_carry_in?(d(),g("span",Vl,"是")):(d(),g("span",El,"—"))]),_:1}),l(i,{prop:"sign_time_text",label:"签收时间","min-width":"152","show-overflow-tooltip":""}),l(i,{prop:"pay_time_text",label:"尾款支付","min-width":"152","show-overflow-tooltip":""}),l(i,{prop:"create_time_text",label:"订单创建",width:"152"})]),_:1},8,["data"])),[[I,ue.value]]),s("div",xl,[l(Oe,{layout:"total, prev, pager, next",total:X.value,"page-size":ke.value,"current-page":de.value,onCurrentChange:pe},null,8,["total","page-size","current-page"])])]),_:1},8,["modelValue","title"])])}}}),ma=Ut(Ol,[["__scopeId","data-v-95ad97e4"]]);export{ma as default};
|