2 lines
36 KiB
JavaScript
2 lines
36 KiB
JavaScript
import{R as gt,H as ht,P as bt,Q as wt,ag as yt,Z as kt,L as xt,i as Ct,d as St,J as Vt,K as Ot,T as Nt,C as Et,m as Dt,l as zt,M as Mt,N as $t,S as Tt,G as Rt,F as Ft,U as Lt,V as Ut,E as w,a as Be}from"./element-plus-lurTijPg.js";import{s as Ie}from"./@vue/runtime-dom-DDAG46FW.js";import{N as Bt,x as It,m as Pt,g as Yt,a0 as qt}from"./@element-plus/icons-vue-HOEUG8sr.js";import{c as Pe,a as Gt,b as Ht,d as At,e as Wt,f as jt,g as Qt}from"./stats-QZfSY69c.js";import{f as Jt,w as Zt,b as Xt,ak as u,I as m,J as r,N as Kt,H as v,a as n,aN as o,O as s,F as S,ap as Ye,G as b,aP as W,A as T}from"./@vue/runtime-core-C6bnekPw.js";import{n as p,y as U,r as el}from"./@vue/reactivity-DiY1c2vO.js";import{Q as _,o as qe}from"./@vue/shared-mAAVTE9n.js";import{_ as tl}from"./index-FimllnSe.js";import"./lodash-es-C2A-Pj28.js";import"./@popperjs/core-C5az9QE8.js";import"./dayjs-DG77mNTn.js";import"./lodash-D3kF6u-c.js";import"./@ctrl/tinycolor-BuyEbX8F.js";import"./async-validator-CFA_igpM.js";import"./normalize-wheel-es-BQoi3Ox2.js";import"./jspdf-BsthCvR5.js";import"./@babel/runtime-BanGtE2-.js";import"./fflate-_ayOYiT1.js";import"./vue-router-QlpZ4wdW.js";import"./pinia-B8cvXbiZ.js";import"./axios-C80V62Fs.js";import"./@vueuse/core-1S4fJlii.js";import"./@vueuse/shared-Cl3lVqjz.js";import"./css-color-function-DI01JAaZ.js";import"./balanced-match-BdS7OldZ.js";import"./color-B2zxaWkI.js";import"./clone-DBZ6_OiU.js";import"./color-convert-OrFsTA_V.js";import"./color-name-Dju3oUBS.js";import"./color-string-pUQDDJII.js";import"./ms-CzQ2E3wO.js";import"./vue-clipboard3-DByT_rEQ.js";import"./clipboard-CHgxszqY.js";import"./echarts-CNLwa9wG.js";import"./tslib-BDyQ-Jie.js";import"./zrender-DRNXw7y3.js";import"./highlight.js-Bxt7hFFy.js";import"./@highlightjs/vue-plugin-C4onkBvW.js";const ll={class:"cs-page"},al={class:"cs-masthead"},nl={class:"cs-masthead__inner"},ol={key:0,class:"cs-masthead__stats"},sl={class:"cs-stat"},rl={class:"cs-stat__value"},il={key:0,class:"cs-stat"},dl={class:"cs-stat__value cs-stat__value--xs"},ul={key:1,class:"cs-stat"},_l={class:"cs-stat__value cs-stat__value--xs"},cl={class:"filter-surface"},pl={class:"filter-row filter-row--top"},ml={class:"filter-field"},fl={class:"filter-field filter-field--rangewrap"},vl={class:"filter-field"},gl={class:"filter-field filter-field--wide"},hl={class:"filter-select filter-select--dept filter-dept-tree-wrap"},bl={class:"filter-actions"},wl={class:"cs-alert__body"},yl={key:0},kl={key:1},xl={key:2,class:"cs-alert__meta"},Cl={class:"cs-reconcile"},Sl={class:"cs-reconcile__head"},Vl={class:"cs-reconcile__tags"},Ol={key:3,class:"cs-reconcile__meta"},Nl={key:4,class:"cs-reconcile__meta"},El={class:"cs-reconcile__toolbar"},Dl={key:0,class:"cs-reconcile__carry"},zl={class:"cs-table-head"},Ml={class:"cs-table-head__row"},$l={key:0,class:"cs-drill-state"},Tl={class:"cs-dept-link__text"},Rl={key:1,class:"cs-muted"},Fl={class:"cs-dialog__bar"},Ll={class:"cs-patient-cell"},Ul={class:"cs-patient-cell__name"},Bl={key:0,class:"cs-patient-cell__meta cs-muted"},Il={key:0},Pl={key:1,class:"cs-muted"},Yl={key:0,class:"cs-muted"},ql={key:1,class:"cs-muted"},Gl={class:"cs-dialog__pager"},Hl={class:"cs-dialog__bar cs-dialog__bar--split"},Al={class:"cs-dialog__hint"},Wl={class:"cs-patient-cell"},jl={class:"cs-patient-cell__name"},Ql={key:0,class:"cs-patient-cell__meta cs-muted"},Jl={key:0},Zl={key:1,class:"cs-muted"},Xl={key:0,class:"cs-muted"},Kl={key:1,class:"cs-muted"},ea={class:"cs-dialog__pager"},ta=Jt({__name:"commission-settlement",setup(la){const Ge={value:"id",label:"name",children:"children"};function He(t){if(!t.length)return[];const e=new Map;for(const f of t)e.set(f.id,{...f,children:[]});const i=[];for(const f of t){const g=e.get(f.id),y=Number(f.pid);y>0&&e.has(y)?e.get(y).children.push(g):i.push(g)}const a=f=>{var g;(g=f.children)!=null&&g.length?f.children.forEach(a):delete f.children};i.forEach(a);const x=f=>{var g;f.sort((y,D)=>{const C=y.name.includes("中心")?-1:1,z=D.name.includes("中心")?-1:1;return C!==z?C-z:y.id-D.id});for(const y of f)(g=y.children)!=null&&g.length&&x(y.children)};return x(i),i}function ke(){const t=new Date,e=t.getFullYear(),i=String(t.getMonth()+1).padStart(2,"0");return`${e}-${i}`}function j(t){return String(t).padStart(2,"0")}function xe(t){return`${t.getFullYear()}-${j(t.getMonth()+1)}-${j(t.getDate())} ${j(t.getHours())}:${j(t.getMinutes())}:${j(t.getSeconds())}`}function re(t){const e=/^(\d{4})-(\d{2})$/.exec(t),i=e?parseInt(e[1],10):new Date().getFullYear(),a=e?parseInt(e[2],10):new Date().getMonth()+1,x=new Date(i,a-2,1,0,0,0),f=new Date(i,a-1,0,23,59,59);return[xe(x),xe(f)]}const h=p(ke()),B=p(re(h.value)),ae=p(!1),R=p(!1),ne=p([]),ie=p(!1),Ae=T(()=>He(ne.value)),O=p([]),Ce=p([]),de=p(!1),Q=p(""),ue=p([]),Se=p([]),Ve=p([]),oe=p([]),se=p([]),Oe=p("dept"),I=p({}),c=el({settlement_month:"",order_month:"",order_start_time:"",order_end_time:"",fulfillment_status:3,explicit_order_time_window:!1,cutoff_end:"",rule_note:"",channel_name:"",require_system_auto_prescription:!1}),N=p(null),J=p(""),_e=p(!1),ce=p(!1),pe=p(!1),F=T(()=>{var t;return Number((t=N.value)==null?void 0:t.status)===1}),me=p(!1),fe=p(!1),P=p("all"),ve=p([]),ge=p(0),Ne=p(1),Ee=p(20),Z=p(!1),Y=p(null),$=p("all"),q=p([]),G=p(0),X=p(1),De=p(20),he=p(!1),We=T(()=>{const t=Y.value;return t?t.mode==="dept"?`已完成业绩订单 · ${t.dept_name}`:t.title:"已完成业绩订单"}),K=T(()=>c.order_start_time&&c.order_end_time?`${c.order_start_time}~${c.order_end_time}`:c.order_month||"—"),je=T(()=>{const t=new Map;for(const e of ne.value){const i=Number(e.pid),a=t.get(i)??[];a.push(e.id),t.set(i,a)}return t}),be=T(()=>{const t=new Map;for(const e of ne.value)t.set(e.id,e);return t}),ee=T(()=>{if(O.value.length!==1)return null;const t=O.value[0];return be.value.get(t)??null}),Qe=T(()=>{const t=ee.value;if(!t)return"返回顶层";const e=Number(t.pid),i=e>0?be.value.get(e):null;return!i||Number(i.pid)<=0?"返回顶层":`返回上级 · ${i.name}`});function ze(t){if(!t||t<=0)return!1;const e=je.value.get(t);return!!(e&&e.length>0)}function Je(t){if(!(!t||!t.dept_id||t.dept_id<=0)){if(ze(t.dept_id)){O.value=[t.dept_id],E();return}Xe(t.dept_id,t.dept_name)}}function Ze(){const t=ee.value;if(!t){O.value=[],E();return}const e=Number(t.pid),i=e>0?be.value.get(e):null;!i||Number(i.pid)<=0?O.value=[]:O.value=[e],E()}function Xe(t,e){if(!h.value){w.warning("请选择结算月");return}Y.value={mode:"dept",dept_id:t,dept_name:e},$.value="all",X.value=1,q.value=[],G.value=0,Z.value=!0,te(1)}function Ke(t){if(!h.value){w.warning("请选择结算月");return}Y.value={mode:"channel",title:`业务订单 · ${t.appt_channel_name} · 医助 ${t.assistant_name}`,assistant_id:t.assistant_id,appt_channel_value:Number(t.appt_channel_value??0)},$.value="all",X.value=1,q.value=[],G.value=0,Z.value=!0,te(1)}function et(t){if(!h.value){w.warning("请选择结算月");return}Y.value={mode:"channel",title:`业务订单 · ${t.appt_channel_name} · 医生 ${t.doctor_name}`,doctor_id:t.doctor_id,appt_channel_value:Number(t.appt_channel_value??0)},$.value="all",X.value=1,q.value=[],G.value=0,Z.value=!0,te(1)}async function te(t){if(!(!h.value||!Y.value)){he.value=!0,X.value=t;try{const e=Y.value,i={settlement_month:h.value,page:t,page_size:De.value};e.mode==="dept"?(Object.assign(i,L()),i.table_row_dept_id=e.dept_id):(Object.assign(i,L()),i.appt_channel_value=e.appt_channel_value,e.assistant_id!=null&&(i.assistant_id=e.assistant_id),e.doctor_id!=null&&(i.doctor_id=e.doctor_id)),$.value&&$.value!=="all"&&(i.bucket=$.value);const a=await Pe(i);q.value=(a==null?void 0:a.list)||[],G.value=Number((a==null?void 0:a.count)??0)}catch(e){w.error((e==null?void 0:e.msg)||(e==null?void 0:e.message)||"加载明细失败"),q.value=[],G.value=0}finally{he.value=!1}}}function k(t){return t==null||!Number.isFinite(Number(t))?"—":`¥ ${Number(t).toLocaleString("zh-CN",{minimumFractionDigits:2,maximumFractionDigits:2})}`}async function tt(){ie.value=!0;try{const t=await Gt();ne.value=(t||[]).sort((e,i)=>{const a=e.name.includes("中心")?-1:1,x=i.name.includes("中心")?-1:1;return a!==x?a-x:e.id-i.id})}catch{}finally{ie.value=!1}}async function lt(){de.value=!0;try{const t=await Ht();Ce.value=(t==null?void 0:t.groups)||[]}catch{}finally{de.value=!1}}async function E(){var i;const t=h.value;if(!t){w.warning("请选择结算月");return}const e=B.value;if(!e||!e[0]||!e[1]){w.warning("请设置订单创建时间范围");return}R.value=!0;try{const a=await At(L());ue.value=(a==null?void 0:a.rows)||[],Se.value=(a==null?void 0:a.assistant_rows)||[],Ve.value=(a==null?void 0:a.doctor_rows)||[],oe.value=(a==null?void 0:a.assistant_channel_rows)||[],se.value=(a==null?void 0:a.doctor_channel_rows)||[],I.value=(a==null?void 0:a.total)||{},c.settlement_month=(a==null?void 0:a.settlement_month)||t,c.order_month=(a==null?void 0:a.order_month)||"",c.order_start_time=a!=null&&a.order_start_time?String(a.order_start_time):"",c.order_end_time=a!=null&&a.order_end_time?String(a.order_end_time):"",c.fulfillment_status=(a==null?void 0:a.fulfillment_status)!=null?Number(a.fulfillment_status):3,c.explicit_order_time_window=typeof(a==null?void 0:a.explicit_order_time_window)=="boolean"?a.explicit_order_time_window:!!(c.order_start_time&&c.order_end_time),c.cutoff_end=(a==null?void 0:a.cutoff_end)||"",c.rule_note=(a==null?void 0:a.rule_note)||"",c.channel_name=(a==null?void 0:a.channel_name)||"",c.require_system_auto_prescription=typeof(a==null?void 0:a.require_system_auto_prescription)=="boolean"?a.require_system_auto_prescription:!1,N.value=(a==null?void 0:a.confirm)??null,J.value=((i=a==null?void 0:a.confirm)==null?void 0:i.reconcile_note)!=null?String(a.confirm.reconcile_note):""}catch(a){w.error((a==null?void 0:a.msg)||(a==null?void 0:a.message)||"加载失败"),ue.value=[],Se.value=[],Ve.value=[],oe.value=[],se.value=[],I.value={},N.value=null}finally{R.value=!1}}function L(){const e={settlement_month:h.value,fulfillment_status:3},i=B.value;return i&&i[0]&&i[1]&&(e.start_time=i[0],e.end_time=i[1]),ae.value&&(e.require_system_auto_prescription=1),O.value.length>0&&(e.dept_ids=O.value.join(",")),Q.value&&(e.channel_code=Q.value),e}function at(){if(!h.value){w.warning("请选择结算月");return}me.value=!0}function nt(){P.value="all",we(1)}async function we(t){if(h.value){fe.value=!0,Ne.value=t;try{const e={...L(),page:t,page_size:Ee.value};P.value&&P.value!=="all"&&(e.bucket=P.value);const i=await Pe(e);ve.value=(i==null?void 0:i.list)||[],ge.value=Number((i==null?void 0:i.count)??0)}catch(e){w.error((e==null?void 0:e.msg)||(e==null?void 0:e.message)||"加载明细失败"),ve.value=[],ge.value=0}finally{fe.value=!1}}}async function ot(){if(!h.value){w.warning("请选择结算月");return}if(F.value){w.warning("已确定业绩不可修改备注;请先撤回确定");return}_e.value=!0;try{await Wt({...L(),reconcile_note:J.value}),w.success("已保存核对备注"),await E()}catch(t){w.error((t==null?void 0:t.msg)||(t==null?void 0:t.message)||"保存失败")}finally{_e.value=!1}}async function st(){if(!h.value){w.warning("请选择结算月");return}try{await Be.confirm("确定后将为「顺延下期」订单写入结转记录,下一结算月在相同渠道与部门筛选下自动并入统计。确定后仍可「撤回确定」以清除结转并重新核对(与财务对齐后再操作)。","确定本期业绩",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"})}catch{return}ce.value=!0;try{const t=await jt({...L(),reconcile_note:J.value});w.success(`已确定本期业绩;结转 ${Number((t==null?void 0:t.deferred_carry_count)??0)} 单至 ${String((t==null?void 0:t.next_settlement_month)??"下期")}`),await E()}catch(t){w.error((t==null?void 0:t.msg)||(t==null?void 0:t.message)||"提交失败")}finally{ce.value=!1}}async function rt(){if(!h.value){w.warning("请选择结算月");return}try{await Be.confirm("将撤回本次「确定业绩」状态,并删除已写入的顺延结转记录(下期将不再汇入这些单)。确定后继续?","撤回确定业绩",{confirmButtonText:"撤回",cancelButtonText:"取消",type:"warning"})}catch{return}pe.value=!0;try{await Qt(L()),w.success("已撤回确定;可重新保存备注并再次确定本期业绩"),await E()}catch(t){w.error((t==null?void 0:t.msg)||(t==null?void 0:t.message)||"撤回失败")}finally{pe.value=!1}}function it(){h.value=ke(),B.value=re(h.value),ae.value=!1,O.value=[],Q.value="",E()}function Me(t){const{columns:e}=t,i=I.value,a=[];return e.forEach((x,f)=>{if(f===0){a[f]="合计";return}const g=x.property;if(!i||!g){a[f]="";return}if(g==="primary_dept_name"||g==="appt_channel_name"){a[f]="";return}if(g==="carry_in_order_count"){a[f]=String(i.carry_in_order_count??0);return}const y={completed_order_count:String(i.completed_order_count??0),completed_order_amount:k(i.completed_order_amount),current_period_count:String(i.current_period_count??0),current_period_amount:k(i.current_period_amount),deferred_period_count:String(i.deferred_period_count??0),deferred_period_amount:k(i.deferred_period_amount)};a[f]=y[String(g)]??""}),a}function $e(t,e){return i=>{const{rowIndex:a,columnIndex:x}=i;if(x>1)return;const f=t.value;if(!f||f.length===0)return;const g=f[a];if(!g)return;const y=g[e],D=a>0?f[a-1]:null;if(D&&D[e]===y)return{rowspan:0,colspan:0};let C=1;for(let z=a+1;z<f.length&&f[z][e]===y;z++)C++;return{rowspan:C,colspan:1}}}const dt=$e(oe,"assistant_id"),ut=$e(se,"doctor_id");function Te(t){const e=(t||"").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 _t(t){const{columns:e}=t,i=I.value,a=[];return e.forEach((x,f)=>{if(f===0){a[f]="合计";return}const g=x.property;if(!i||!g){a[f]="";return}const y={completed_order_count:String(i.completed_order_count??0),completed_order_amount:k(i.completed_order_amount),current_period_count:String(i.current_period_count??0),current_period_amount:k(i.current_period_amount),deferred_period_count:String(i.deferred_period_count??0),deferred_period_amount:k(i.deferred_period_amount)};a[f]=y[String(g)]??""}),a}return Zt(h,t=>{t&&(B.value=re(t))}),Xt(async()=>{await Promise.all([tt(),lt()]),await E()}),(t,e)=>{const i=gt,a=ht,x=wt,f=yt,g=bt,y=kt,D=St,C=Ct,z=Vt,ct=Ot,V=Nt,pt=Et,mt=Tt,d=$t,le=Mt,ye=zt,ft=Dt,H=Ft,Re=Rt,Fe=Lt,Le=Ut,A=xt;return u(),m("div",ll,[r("header",al,[r("div",nl,[e[16]||(e[16]=Kt('<div class="cs-masthead__main" data-v-a7de712c><span class="cs-masthead__eyebrow" data-v-a7de712c><span class="cs-masthead__dot" data-v-a7de712c></span> 财务结算 · 业绩台账 </span><h1 class="cs-masthead__title" data-v-a7de712c>提成结算业绩</h1><p class="cs-masthead__desc" data-v-a7de712c> 订单池默认与<strong data-v-a7de712c>处方订单列表</strong>同源:<strong data-v-a7de712c>创建时间 start_time~end_time</strong> + <strong data-v-a7de712c>fulfillment_status</strong>(默认完成态 3),账号<strong data-v-a7de712c>列表可见性/数据域</strong>一并生效。 选结算月<strong data-v-a7de712c>仍可</strong>套用「物流签收<strong data-v-a7de712c>与</strong>尾款支付<strong data-v-a7de712c>均须在</strong><strong data-v-a7de712c>结算月 7 日 24 点</strong>前」拆分「本期提成 / 顺延下期」 (仅有签收在范围内、尾款晚于截止仍会顺延); 展示部门/渠道下拉与列表不同,勾选后会与列表<strong data-v-a7de712c>计数不同</strong>。 </p></div>',1)),c.settlement_month||c.cutoff_end?(u(),m("dl",ol,[r("div",sl,[e[13]||(e[13]=r("dt",{class:"cs-stat__label"},"结算月",-1)),r("dd",rl,_(c.settlement_month||h.value),1)]),c.order_month||c.order_start_time?(u(),m("div",il,[e[14]||(e[14]=r("dt",{class:"cs-stat__label"},"订单时间窗",-1)),r("dd",dl,_(K.value),1)])):v("",!0),c.cutoff_end?(u(),m("div",ul,[e[15]||(e[15]=r("dt",{class:"cs-stat__label"},"截止时刻",-1)),r("dd",_l,_(c.cutoff_end),1)])):v("",!0)])):v("",!0)])]),n(z,{class:"cs-panel filter-card",shadow:"never"},{default:o(()=>[r("div",cl,[r("div",pl,[r("div",ml,[e[17]||(e[17]=r("span",{class:"lbl"},"结算月",-1)),n(i,{modelValue:h.value,"onUpdate:modelValue":e[0]||(e[0]=l=>h.value=l),type:"month","value-format":"YYYY-MM",placeholder:"选择结算月",class:"filter-month"},null,8,["modelValue"])]),r("div",fl,[e[19]||(e[19]=r("span",{class:"lbl"},"订单创建",-1)),n(i,{modelValue:B.value,"onUpdate:modelValue":e[1]||(e[1]=l=>B.value=l),type:"datetimerange","value-format":"YYYY-MM-DD HH:mm:ss","range-separator":"至","start-placeholder":"列表 start_time","end-placeholder":"列表 end_time",class:"filter-datetimerange"},null,8,["modelValue"]),n(a,{modelValue:ae.value,"onUpdate:modelValue":e[2]||(e[2]=l=>ae.value=l),class:"filter-sa-check"},{default:o(()=>[...e[18]||(e[18]=[s(" 仅系统代开处方 ",-1)])]),_:1},8,["modelValue"])]),r("div",vl,[e[20]||(e[20]=r("span",{class:"lbl"},"渠道来源",-1)),n(g,{modelValue:Q.value,"onUpdate:modelValue":e[3]||(e[3]=l=>Q.value=l),filterable:"",clearable:"",placeholder:"全部",class:"filter-select filter-select--channel",loading:de.value,onChange:E},{default:o(()=>[n(x,{label:"全部",value:""}),(u(!0),m(S,null,Ye(Ce.value,l=>(u(),b(f,{key:l.group_name,label:l.group_name},{default:o(()=>[(u(!0),m(S,null,Ye(l.channels,M=>(u(),b(x,{key:M.channel_code,label:M.channel_name,value:M.channel_code},null,8,["label","value"]))),128))]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue","loading"])]),r("div",gl,[e[21]||(e[21]=r("span",{class:"lbl"},"展示部门",-1)),W((u(),m("div",hl,[n(y,{modelValue:O.value,"onUpdate:modelValue":e[4]||(e[4]=l=>O.value=l),data:Ae.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:Ge},null,8,["modelValue","data"])])),[[A,ie.value]])]),r("div",bl,[n(C,{type:"primary",class:"filter-btn filter-btn--query",loading:R.value,onClick:E},{default:o(()=>[n(D,{class:"filter-btn__icon"},{default:o(()=>[n(U(Bt))]),_:1}),e[22]||(e[22]=s(" 查询 ",-1))]),_:1},8,["loading"]),n(C,{class:"filter-btn filter-btn--reset",disabled:R.value,onClick:it},{default:o(()=>[n(D,{class:"filter-btn__icon"},{default:o(()=>[n(U(It))]),_:1}),e[23]||(e[23]=s(" 重置 ",-1))]),_:1},8,["disabled"])])])])]),_:1}),n(ct,{type:"info",closable:!1,"show-icon":"",class:"cs-alert"},{title:o(()=>[...e[24]||(e[24]=[r("span",{class:"cs-alert__title"},"统计口径",-1)])]),default:o(()=>[r("div",wl,[c.rule_note?(u(),m("p",yl,_(c.rule_note),1)):(u(),m("p",kl,[...e[25]||(e[25]=[s(" 请选择结算月并设置",-1),r("strong",null,"订单创建时间范围",-1),s("(与处方订单列表 URL 参数 ",-1),r("code",null,"start_time",-1),s("/",-1),r("code",null,"end_time",-1),s("/",-1),r("code",null,"fulfillment_status",-1),s(" 一致);切换结算月会自动带出",-1),r("strong",null,"上一自然月整段",-1),s("作为默认时段,可按业务修改(例如 2026-04-02~04-30)。 「仅系统代开处方」勾选后与列表在未限制开方类型时的条数会不一致。 ",-1)])])),c.cutoff_end?(u(),m("p",xl,[e[30]||(e[30]=s(" 当前结算月:",-1)),r("strong",null,_(c.settlement_month),1),e[31]||(e[31]=s(" · 订单时间:",-1)),r("strong",null,_(K.value),1),e[32]||(e[32]=s(" · 履约状态:",-1)),r("strong",null,_(c.fulfillment_status??3),1),e[33]||(e[33]=s(" · 截止时刻:",-1)),r("strong",null,_(c.cutoff_end),1),c.channel_name?(u(),m(S,{key:0},[e[26]||(e[26]=s(" · 渠道:",-1)),r("strong",null,_(c.channel_name),1)],64)):v("",!0),c.settlement_month?(u(),m(S,{key:1},[e[29]||(e[29]=s(" · 处方池:",-1)),r("strong",null,_(c.require_system_auto_prescription?"仅系统代开":"含手动与系统"),1),c.explicit_order_time_window?(u(),m(S,{key:0},[e[27]||(e[27]=s(" · 列表对齐:",-1)),e[28]||(e[28]=r("strong",null,"是",-1))],64)):v("",!0)],64)):v("",!0)])):v("",!0)])]),_:1}),n(z,{class:"cs-panel cs-reconcile-card",shadow:"never"},{default:o(()=>{var l,M,Ue;return[r("div",Cl,[r("div",Sl,[r("div",Vl,[F.value?(u(),b(V,{key:0,type:"success",effect:"dark"},{default:o(()=>[...e[34]||(e[34]=[s("已确定业绩",-1)])]),_:1})):((l=N.value)==null?void 0:l.status)===2?(u(),b(V,{key:1,type:"warning",effect:"plain"},{default:o(()=>[...e[35]||(e[35]=[s("已撤回确定",-1)])]),_:1})):(u(),b(V,{key:2,type:"info",effect:"plain"},{default:o(()=>[...e[36]||(e[36]=[s("待确定业绩",-1)])]),_:1})),F.value&&((M=N.value)!=null&&M.confirmed_at_text)?(u(),m("span",Ol,_(N.value.confirmed_admin_name||"—")+" · "+_(N.value.confirmed_at_text),1)):((Ue=N.value)==null?void 0:Ue.status)===2&&N.value.revoked_at_text?(u(),m("span",Nl," 撤回:"+_(N.value.revoked_admin_name||"—")+" · "+_(N.value.revoked_at_text),1)):v("",!0)]),r("div",El,[n(C,{type:"primary",plain:"",onClick:at},{default:o(()=>[...e[37]||(e[37]=[s("业绩明细核对",-1)])]),_:1}),n(C,{disabled:F.value||_e.value,onClick:ot},{default:o(()=>[...e[38]||(e[38]=[s(" 保存核对备注 ",-1)])]),_:1},8,["disabled"]),n(C,{type:"warning",disabled:F.value||ce.value,onClick:st},{default:o(()=>[...e[39]||(e[39]=[s(" 确定本期业绩 ",-1)])]),_:1},8,["disabled"]),F.value?(u(),b(C,{key:0,type:"danger",plain:"",loading:pe.value,onClick:rt},{default:o(()=>[...e[40]||(e[40]=[s(" 撤回确定 ",-1)])]),_:1},8,["loading"])):v("",!0)])]),n(pt,{modelValue:J.value,"onUpdate:modelValue":e[5]||(e[5]=vt=>J.value=vt),type:"textarea",rows:2,maxlength:"500","show-word-limit":"",placeholder:"核对备注(可与财务线下对齐后填写;确定业绩前可反复保存)",disabled:F.value,class:"cs-reconcile__note"},null,8,["modelValue","disabled"]),Number(I.value.carry_in_order_count)>0?(u(),m("p",Dl,[e[41]||(e[41]=s(" 上期顺延汇入本期:",-1)),r("strong",null,_(I.value.carry_in_order_count),1),e[42]||(e[42]=s(" 单(已并入当前汇总) ",-1))])):v("",!0)])]}),_:1}),n(z,{class:"cs-panel cs-summary-card",shadow:"never"},{default:o(()=>[n(ft,{modelValue:Oe.value,"onUpdate:modelValue":e[6]||(e[6]=l=>Oe.value=l),class:"cs-summary-tabs"},{default:o(()=>[n(ye,{label:"部门汇总",name:"dept"},{default:o(()=>[r("div",zl,[r("div",Ml,[e[43]||(e[43]=r("span",{class:"cs-table-head__title"},"部门汇总",-1)),ee.value?(u(),m("div",$l,[n(V,{size:"small",type:"info",effect:"plain",class:"cs-drill-state__tag"},{default:o(()=>[s(" 当前下钻:"+_(ee.value.path||ee.value.name),1)]),_:1}),n(C,{link:"",type:"primary",class:"cs-drill-state__back",onClick:Ze},{default:o(()=>[n(D,null,{default:o(()=>[n(U(Pt))]),_:1}),s(" "+_(Qe.value),1)]),_:1})])):v("",!0)]),e[44]||(e[44]=r("span",{class:"cs-table-head__hint"},[s(" 金额单位:元;与业绩看板相同的部门摊列规则(业绩归属医助 → 展示「中心」)。 "),r("strong",null,"点击部门"),s(":若有子部门则下钻一层;末级部门弹出「已完成业绩订单」明细。 ")],-1))]),W((u(),b(le,{data:ue.value,border:"",stripe:"",size:"small",class:"cs-table cs-table--clickable","show-summary":"","summary-method":_t},{default:o(()=>[n(d,{prop:"dept_name",label:"部门","min-width":"220",fixed:""},{default:o(({row:l})=>[l.dept_id>0?(u(),b(mt,{key:0,type:"primary",underline:!1,class:"cs-dept-link",onClick:M=>Je(l)},{default:o(()=>[r("span",Tl,_(l.dept_name),1),n(D,{class:"cs-dept-link__icon"},{default:o(()=>[ze(l.dept_id)?(u(),b(U(Yt),{key:0})):(u(),b(U(qt),{key:1}))]),_:2},1024)]),_:2},1032,["onClick"])):(u(),m("span",Rl,_(l.dept_name),1))]),_:1}),n(d,{prop:"completed_order_count",label:"已完成单数","min-width":"104",align:"right"}),n(d,{prop:"completed_order_amount",label:"已完成金额","min-width":"112",align:"right"},{default:o(({row:l})=>[s(_(k(l.completed_order_amount)),1)]),_:1}),n(d,{prop:"current_period_count",label:"本期提成单数","min-width":"118",align:"right"}),n(d,{prop:"current_period_amount",label:"本期提成金额","min-width":"118",align:"right"},{default:o(({row:l})=>[s(_(k(l.current_period_amount)),1)]),_:1}),n(d,{prop:"deferred_period_count",label:"顺延下期单数","min-width":"118",align:"right"}),n(d,{prop:"deferred_period_amount",label:"顺延下期金额","min-width":"118",align:"right"},{default:o(({row:l})=>[s(_(k(l.deferred_period_amount)),1)]),_:1})]),_:1},8,["data"])),[[A,R.value]])]),_:1}),n(ye,{label:"按医助下发",name:"assistant"},{default:o(()=>[e[45]||(e[45]=r("div",{class:"cs-table-head"},[r("span",{class:"cs-table-head__title"},"业绩归属医助 × 挂号渠道"),r("span",{class:"cs-table-head__hint"},[s(" 按诊单业绩归属医助 "),r("strong",null,"×"),s(" 挂号渠道(doctor_appointment.channels)拆分到行; "),r("strong",null,"「复诊2」「复诊3」「自媒体1」等保持各自独立"),s(",未关联挂号统一归到「未匹配挂号渠道」。 同一医助多行"),r("strong",null,"自动合并「医助 / 归属中心」单元格"),s(",「顺延汇入」为上期结转进入本期订单池的单数。 "),r("strong",null,"展示部门"),s("有勾选时,本表仅列出"),r("strong",null,"可归入该部门上下文"),s("的业绩医助(与人事部门落在所选部门范围内的账号一致)。 "),r("strong",null,"点击挂号渠道"),s(":查看该行对应的业务订单明细(与上方部门筛选一致)。 ")])],-1)),W((u(),b(le,{data:oe.value,border:"",stripe:"",size:"small",class:"cs-table cs-table--grouped","show-summary":"","summary-method":Me,"span-method":U(dt)},{default:o(()=>[n(d,{prop:"assistant_name",label:"医助","min-width":"120",fixed:"","show-overflow-tooltip":""}),n(d,{prop:"primary_dept_name",label:"归属中心","min-width":"120","show-overflow-tooltip":""}),n(d,{prop:"appt_channel_name",label:"挂号渠道","min-width":"120","show-overflow-tooltip":""},{default:o(({row:l})=>[n(V,{size:"small",class:qe(["cs-channel-tag cs-channel-tag--clickable",Te(l.appt_channel_name)]),effect:"plain",onClick:Ie(M=>Ke(l),["stop"])},{default:o(()=>[s(_(l.appt_channel_name),1)]),_:2},1032,["class","onClick"])]),_:1}),n(d,{prop:"carry_in_order_count",label:"顺延汇入单数","min-width":"112",align:"right"}),n(d,{prop:"completed_order_count",label:"已完成单数","min-width":"104",align:"right"}),n(d,{prop:"completed_order_amount",label:"已完成金额","min-width":"112",align:"right"},{default:o(({row:l})=>[s(_(k(l.completed_order_amount)),1)]),_:1}),n(d,{prop:"current_period_count",label:"本期提成单数","min-width":"118",align:"right"}),n(d,{prop:"current_period_amount",label:"本期提成金额","min-width":"118",align:"right"},{default:o(({row:l})=>[s(_(k(l.current_period_amount)),1)]),_:1}),n(d,{prop:"deferred_period_count",label:"顺延下期单数","min-width":"118",align:"right"}),n(d,{prop:"deferred_period_amount",label:"顺延下期金额","min-width":"118",align:"right"},{default:o(({row:l})=>[s(_(k(l.deferred_period_amount)),1)]),_:1})]),_:1},8,["data","span-method"])),[[A,R.value]])]),_:1}),n(ye,{label:"按医生下发",name:"doctor"},{default:o(()=>[e[46]||(e[46]=r("div",{class:"cs-table-head"},[r("span",{class:"cs-table-head__title"},"处方开方医生 × 挂号渠道"),r("span",{class:"cs-table-head__hint"},[s(" 按处方创建账号(开方人) "),r("strong",null,"×"),s(" 挂号渠道拆分; 可与医助维度交叉核对;同一医生多行自动合并「医生 / 归属中心」单元格。 "),r("strong",null,"展示部门"),s("有勾选时,与医助表相同,仅统计"),r("strong",null,"该部门上下文内"),s("订单对应的开方医生。 "),r("strong",null,"点击挂号渠道"),s(":查看该行对应的业务订单明细。 ")])],-1)),W((u(),b(le,{data:se.value,border:"",stripe:"",size:"small",class:"cs-table cs-table--grouped","show-summary":"","summary-method":Me,"span-method":U(ut)},{default:o(()=>[n(d,{prop:"doctor_name",label:"医生","min-width":"120",fixed:"","show-overflow-tooltip":""}),n(d,{prop:"primary_dept_name",label:"归属中心","min-width":"120","show-overflow-tooltip":""}),n(d,{prop:"appt_channel_name",label:"挂号渠道","min-width":"120","show-overflow-tooltip":""},{default:o(({row:l})=>[n(V,{size:"small",class:qe(["cs-channel-tag cs-channel-tag--clickable",Te(l.appt_channel_name)]),effect:"plain",onClick:Ie(M=>et(l),["stop"])},{default:o(()=>[s(_(l.appt_channel_name),1)]),_:2},1032,["class","onClick"])]),_:1}),n(d,{prop:"carry_in_order_count",label:"顺延汇入单数","min-width":"112",align:"right"}),n(d,{prop:"completed_order_count",label:"已完成单数","min-width":"104",align:"right"}),n(d,{prop:"completed_order_amount",label:"已完成金额","min-width":"112",align:"right"},{default:o(({row:l})=>[s(_(k(l.completed_order_amount)),1)]),_:1}),n(d,{prop:"current_period_count",label:"本期提成单数","min-width":"118",align:"right"}),n(d,{prop:"current_period_amount",label:"本期提成金额","min-width":"118",align:"right"},{default:o(({row:l})=>[s(_(k(l.current_period_amount)),1)]),_:1}),n(d,{prop:"deferred_period_count",label:"顺延下期单数","min-width":"118",align:"right"}),n(d,{prop:"deferred_period_amount",label:"顺延下期金额","min-width":"118",align:"right"},{default:o(({row:l})=>[s(_(k(l.deferred_period_amount)),1)]),_:1})]),_:1},8,["data","span-method"])),[[A,R.value]])]),_:1})]),_:1},8,["modelValue"])]),_:1}),n(Le,{modelValue:me.value,"onUpdate:modelValue":e[9]||(e[9]=l=>me.value=l),title:"业绩明细核对",width:"1280px","destroy-on-close":"",class:"cs-dialog",onOpen:nt},{default:o(()=>[r("div",Fl,[n(Re,{modelValue:P.value,"onUpdate:modelValue":e[7]||(e[7]=l=>P.value=l),size:"small",onChange:e[8]||(e[8]=l=>we(1))},{default:o(()=>[n(H,{label:"all"},{default:o(()=>[...e[47]||(e[47]=[s("全部",-1)])]),_:1}),n(H,{label:"current"},{default:o(()=>[...e[48]||(e[48]=[s("本期提成",-1)])]),_:1}),n(H,{label:"deferred"},{default:o(()=>[...e[49]||(e[49]=[s("顺延下期",-1)])]),_:1})]),_:1},8,["modelValue"])]),W((u(),b(le,{data:ve.value,border:"",stripe:"",size:"small","max-height":"440"},{default:o(()=>[n(d,{prop:"order_no",label:"业务订单号","min-width":"128","show-overflow-tooltip":""}),n(d,{label:"患者","min-width":"112","show-overflow-tooltip":""},{default:o(({row:l})=>[r("div",Ll,[r("span",Ul,_(l.patient_name||"—"),1),l.patient_phone||l.patient_gender_text?(u(),m("span",Bl,[l.patient_gender_text?(u(),m(S,{key:0},[s(_(l.patient_gender_text),1)],64)):v("",!0),l.patient_gender_text&&l.patient_phone?(u(),m(S,{key:1},[s(" · ")],64)):v("",!0),l.patient_phone?(u(),m(S,{key:2},[s(_(l.patient_phone),1)],64)):v("",!0)])):v("",!0)])]),_:1}),n(d,{label:"快递单号","min-width":"132","show-overflow-tooltip":""},{default:o(({row:l})=>[s(_(l.tracking_number||"—"),1)]),_:1}),n(d,{label:"挂号日期","min-width":"124","show-overflow-tooltip":""},{default:o(({row:l})=>[r("span",null,_(l.appointment_date_text||"—"),1),l.appointment_status&&Number(l.appointment_status)!==3?(u(),b(V,{key:0,class:"cs-tag-appt-muted",type:"info",size:"small",effect:"plain"},{default:o(()=>[...e[50]||(e[50]=[s("未完结挂号",-1)])]),_:1})):v("",!0)]),_:1}),n(d,{label:"挂号渠道","min-width":"124","show-overflow-tooltip":""},{default:o(({row:l})=>[s(_(l.appt_channel_name||"—"),1)]),_:1}),n(d,{prop:"assistant_name",label:"业绩医助","min-width":"100","show-overflow-tooltip":""}),n(d,{prop:"doctor_name",label:"开方医生","min-width":"100","show-overflow-tooltip":""}),n(d,{prop:"primary_dept_name",label:"归属部门","min-width":"100","show-overflow-tooltip":""}),n(d,{prop:"amount",label:"金额",width:"108",align:"right"},{default:o(({row:l})=>[s(_(k(l.amount)),1)]),_:1}),n(d,{label:"分段",width:"88",align:"center"},{default:o(({row:l})=>[l.bucket==="current"?(u(),b(V,{key:0,type:"success",size:"small"},{default:o(()=>[...e[51]||(e[51]=[s("本期",-1)])]),_:1})):(u(),b(V,{key:1,type:"warning",size:"small"},{default:o(()=>[...e[52]||(e[52]=[s("顺延",-1)])]),_:1}))]),_:1}),n(d,{label:"结转",width:"72",align:"center"},{default:o(({row:l})=>[l.is_carry_in?(u(),m("span",Il,"是")):(u(),m("span",Pl,"—"))]),_:1}),n(d,{label:"顺延说明","min-width":"200","show-overflow-tooltip":""},{default:o(({row:l})=>[l.bucket==="deferred"&&l.bucket_defer_text?(u(),m("span",Yl,_(l.bucket_defer_text),1)):(u(),m("span",ql,"—"))]),_:1}),n(d,{label:"物流签收","min-width":"152","show-overflow-tooltip":""},{default:o(({row:l})=>[s(_(l.sign_time_text||"—"),1)]),_:1}),n(d,{prop:"pay_time_text",label:"尾款支付","min-width":"152","show-overflow-tooltip":""},{default:o(({row:l})=>[s(_(l.pay_time_text||"—"),1)]),_:1}),n(d,{prop:"create_time_text",label:"订单创建",width:"152"})]),_:1},8,["data"])),[[A,fe.value]]),r("div",Gl,[n(Fe,{layout:"total, prev, pager, next",total:ge.value,"page-size":Ee.value,"current-page":Ne.value,onCurrentChange:we},null,8,["total","page-size","current-page"])])]),_:1},8,["modelValue"]),n(Le,{modelValue:Z.value,"onUpdate:modelValue":e[12]||(e[12]=l=>Z.value=l),title:We.value,width:"1280px","destroy-on-close":"",class:"cs-dialog"},{default:o(()=>[r("div",Hl,[n(Re,{modelValue:$.value,"onUpdate:modelValue":e[10]||(e[10]=l=>$.value=l),size:"small",onChange:e[11]||(e[11]=l=>te(1))},{default:o(()=>[n(H,{label:"all"},{default:o(()=>[...e[53]||(e[53]=[s("全部已完成",-1)])]),_:1}),n(H,{label:"current"},{default:o(()=>[...e[54]||(e[54]=[s("本期提成",-1)])]),_:1}),n(H,{label:"deferred"},{default:o(()=>[...e[55]||(e[55]=[s("顺延下期",-1)])]),_:1})]),_:1},8,["modelValue"]),r("span",Al,[e[58]||(e[58]=s(" 结算月:",-1)),r("strong",null,_(c.settlement_month||h.value),1),K.value&&K.value!=="—"?(u(),m(S,{key:0},[e[56]||(e[56]=s(" · 订单创建:",-1)),r("strong",null,_(K.value),1)],64)):v("",!0),c.channel_name?(u(),m(S,{key:1},[e[57]||(e[57]=s(" · 渠道:",-1)),r("strong",null,_(c.channel_name),1)],64)):v("",!0)])]),W((u(),b(le,{data:q.value,border:"",stripe:"",size:"small","max-height":"440"},{default:o(()=>[n(d,{prop:"order_no",label:"业务订单号","min-width":"128","show-overflow-tooltip":""}),n(d,{label:"患者","min-width":"112","show-overflow-tooltip":""},{default:o(({row:l})=>[r("div",Wl,[r("span",jl,_(l.patient_name||"—"),1),l.patient_phone||l.patient_gender_text?(u(),m("span",Ql,[l.patient_gender_text?(u(),m(S,{key:0},[s(_(l.patient_gender_text),1)],64)):v("",!0),l.patient_gender_text&&l.patient_phone?(u(),m(S,{key:1},[s(" · ")],64)):v("",!0),l.patient_phone?(u(),m(S,{key:2},[s(_(l.patient_phone),1)],64)):v("",!0)])):v("",!0)])]),_:1}),n(d,{label:"快递单号","min-width":"132","show-overflow-tooltip":""},{default:o(({row:l})=>[s(_(l.tracking_number||"—"),1)]),_:1}),n(d,{label:"挂号日期","min-width":"124","show-overflow-tooltip":""},{default:o(({row:l})=>[r("span",null,_(l.appointment_date_text||"—"),1),l.appointment_status&&Number(l.appointment_status)!==3?(u(),b(V,{key:0,class:"cs-tag-appt-muted",type:"info",size:"small",effect:"plain"},{default:o(()=>[...e[59]||(e[59]=[s("未完结挂号",-1)])]),_:1})):v("",!0)]),_:1}),n(d,{label:"挂号渠道","min-width":"124","show-overflow-tooltip":""},{default:o(({row:l})=>[s(_(l.appt_channel_name||"—"),1)]),_:1}),n(d,{prop:"assistant_name",label:"业绩医助","min-width":"100","show-overflow-tooltip":""}),n(d,{prop:"doctor_name",label:"开方医生","min-width":"100","show-overflow-tooltip":""}),n(d,{prop:"primary_dept_name",label:"归属部门","min-width":"120","show-overflow-tooltip":""}),n(d,{prop:"amount",label:"金额",width:"108",align:"right"},{default:o(({row:l})=>[s(_(k(l.amount)),1)]),_:1}),n(d,{label:"分段",width:"88",align:"center"},{default:o(({row:l})=>[l.bucket==="current"?(u(),b(V,{key:0,type:"success",size:"small"},{default:o(()=>[...e[60]||(e[60]=[s("本期",-1)])]),_:1})):(u(),b(V,{key:1,type:"warning",size:"small"},{default:o(()=>[...e[61]||(e[61]=[s("顺延",-1)])]),_:1}))]),_:1}),n(d,{label:"结转",width:"72",align:"center"},{default:o(({row:l})=>[l.is_carry_in?(u(),m("span",Jl,"是")):(u(),m("span",Zl,"—"))]),_:1}),n(d,{label:"顺延说明","min-width":"200","show-overflow-tooltip":""},{default:o(({row:l})=>[l.bucket==="deferred"&&l.bucket_defer_text?(u(),m("span",Xl,_(l.bucket_defer_text),1)):(u(),m("span",Kl,"—"))]),_:1}),n(d,{label:"物流签收","min-width":"152","show-overflow-tooltip":""},{default:o(({row:l})=>[s(_(l.sign_time_text||"—"),1)]),_:1}),n(d,{prop:"pay_time_text",label:"尾款支付","min-width":"152","show-overflow-tooltip":""},{default:o(({row:l})=>[s(_(l.pay_time_text||"—"),1)]),_:1}),n(d,{prop:"create_time_text",label:"订单创建",width:"152"})]),_:1},8,["data"])),[[A,he.value]]),r("div",ea,[n(Fe,{layout:"total, prev, pager, next",total:G.value,"page-size":De.value,"current-page":X.value,onCurrentChange:te},null,8,["total","page-size","current-page"])])]),_:1},8,["modelValue","title"])])}}}),Pa=tl(ta,[["__scopeId","data-v-a7de712c"]]);export{Pa as default};
|