Files
zyt/server/public/admin/assets/index-DOSOzn1u.js
T
Your NameandClaude Opus 5 (1M context) 630318b9ca 处方笺天数取订单用药天数或处方服用天数,不再用剂数顶替
剂数多为默认 1,「查看处方」不带订单时原先回退到剂数,显示成「1 天」(如 RX202611279682 实际服用 14 天)。
现按 订单用药天数 → 处方服用天数 取值,均未填写显示「—」。管理后台与桌面端一致,重新构建管理后台。

Co-Authored-By: Claude Opus 5 (1M context) <[EMAIL]>
2026-11-27 18:33:37 +08:00

2 lines
10 KiB
JavaScript

import{o as K,W as he,a0 as L,br as we,q as s,r as v,v as o,D as n,be as Ce,u as l,bc as Ee,bi as Ve,bh as xe,L as d,O as u,aC as Se,C as A,P as R,c1 as je,K as De,bg as We,s as c,F as U,G as q,T as g,ai as Oe,ag as w,bn as Re,bo as Te,a5 as Fe,bq as Ye,ac as $e,M as T,aD as z,p as C,E as Me,n as G}from"./.pnpm-DnXobOVo.js";import{_ as Ne}from"./index.vue_vue_type_script_setup_true_lang-GSVwwezT.js";import{c as Pe,m as Be,f as Ie,_ as Le}from"./index-B5yNocKV.js";import{d as Ae,e as Ue}from"./self_input_stats-TssI1Yng.js";import{d as qe}from"./department-CL8mSBNU.js";import{u as ze}from"./usePaging-DdtNlhkl.js";import{_ as Ge}from"./MediaSourceSelect.vue_vue_type_script_setup_true_lang-CuabPUpv.js";import{_ as Ke}from"./yeji-edit.vue_vue_type_script_setup_true_lang-M9384EXk.js";import{u as Qe}from"./useMediaSourceOptions-CBhDIJuL.js";import"./index-DR8bxDFy.js";const He={class:"self-input-stats-page"},Je={class:"stats-kpi-grid"},Xe={class:"stats-kpi-label"},Ze={class:"card-header"},et={class:"card-header-main"},tt={class:"card-hint"},at={class:"card-header-actions"},nt={class:"dept-cell"},ot={key:1},lt={key:2,class:"text-gray-400"},st={class:"flex justify-end mt-4"},it=K({name:"selfInputStats"}),rt=K({...it,setup(dt){const Q=he(),E=$e(),V=T(!1),_=T([]),S=T([]),{mediaSourceOptions:F,mediaSourceLoading:Y,loadMediaSourceOptions:H,refreshMediaSourceOptions:j}=Qe(),J={value:"id",label:"name",children:"children"},f=z({date_range:[],summary:{},can_view_finance:!1}),$=new Set(["account_cost","cash_cost","roi"]),M=C(()=>!!f.can_view_finance),i=z({media_source:"",dept_id:void 0,time_type:"today",start_date:"",end_date:""}),D=C(()=>Be("stats.personal_account_cost/lists")||""),X=()=>{D.value&&Q.push(D.value)},Z=async t=>{i.time_type==="custom"&&(t.start_date=_.value[0]||"",t.end_date=_.value[1]||"");const e=await Ae(t);return Object.assign(f,(e==null?void 0:e.extend)||{}),e},ee=async()=>{try{const t=await qe({apply_data_scope:1});Array.isArray(t)&&(S.value=t)}catch{S.value=[]}},te=t=>{t&&j()},ae=async()=>{await j(),await m()};L(()=>{ee(),H()});const{pager:p,getLists:ne}=ze({fetchFun:Z,params:i,firstLoading:!0}),N=[{key:"add_fans_count",label:"加粉数",type:"count"},{key:"total_open_count",label:"总开口",type:"count"},{key:"unreplied_count",label:"未回复",type:"count"},{key:"paid_appointment_count",label:"付费挂号",type:"count"},{key:"free_appointment_count",label:"免费挂号",type:"count"},{key:"interview_count",label:"面诊",type:"count"},{key:"order_amount",label:"订单金额",type:"money"},{key:"account_cost",label:"账户消耗",type:"money"},{key:"total_open_rate",label:"总开口率",type:"percent"},{key:"paid_appointment_rate",label:"付费挂号率",type:"percent"},{key:"open_appointment_rate",label:"开口挂号率",type:"percent"},{key:"interview_rate",label:"面诊率",type:"percent"},{key:"receive_rate",label:"接诊率",type:"percent"},{key:"open_receive_rate",label:"开口接诊率",type:"percent"},{key:"interview_receive_rate",label:"面诊接诊率",type:"percent"},{key:"avg_unit_price",label:"平均单价",type:"money"},{key:"cash_cost",label:"现金成本",type:"money"},{key:"roi",label:"ROI",type:"ratio"}],P=[{key:"add_fans_count",label:"加粉数",type:"count"},{key:"total_open_count",label:"总开口",type:"count"},{key:"unreplied_count",label:"未回复",type:"count"},{key:"paid_appointment_count",label:"付费挂号",type:"count"},{key:"free_appointment_count",label:"免费挂号",type:"count"},{key:"appointment_total_count",label:"挂号总数",type:"count"},{key:"interview_count",label:"面诊",type:"count"},{key:"completed_order_count",label:"接诊诊单",type:"count"},{key:"order_amount",label:"订单金额",type:"money",minWidth:110},{key:"account_cost",label:"账户消耗",type:"money",minWidth:110},{key:"total_open_rate",label:"总开口率",type:"percent",minWidth:100},{key:"paid_appointment_rate",label:"付费挂号率",type:"percent",minWidth:110},{key:"open_appointment_rate",label:"开口挂号率",type:"percent",minWidth:110},{key:"interview_rate",label:"面诊率",type:"percent",minWidth:100},{key:"receive_rate",label:"接诊率",type:"percent",minWidth:100},{key:"interview_receive_rate",label:"面诊接诊率",type:"percent",minWidth:120},{key:"open_receive_rate",label:"开口接诊率",type:"percent",minWidth:110},{key:"avg_unit_price",label:"平均单价",type:"money",minWidth:100},{key:"cash_cost",label:"现金成本",type:"money",minWidth:100},{key:"roi",label:"ROI",type:"ratio",minWidth:80}],oe=C(()=>M.value?N:N.filter(t=>!$.has(t.key))),le=C(()=>M.value?P:P.filter(t=>!$.has(t.key))),se=C(()=>{var t;return(t=f.date_range)!=null&&t.length?`${f.date_range[0]} 至 ${f.date_range[1]}`:"未选择"}),m=async()=>{try{await ne()}catch(t){console.error("获取自录转化统计失败:",t),Me.error((t==null?void 0:t.msg)||"获取统计数据失败")}},ie=()=>{i.time_type!=="custom"&&(_.value=[],p.page=1,m())},re=()=>{_.value.length===2&&(p.page=1,m())},W=()=>{p.page=1,m()},de=()=>{i.media_source="",i.dept_id=void 0,i.time_type="today",_.value=[],p.page=1,p.size=15,m()},B=(t,e,r="count")=>{const b=(e==null?void 0:e[t])??0;return r==="money"?`¥${Number(b||0).toFixed(2)}`:r==="percent"?`${Number(b||0).toFixed(2)}%`:r==="ratio"?Number(b||0).toFixed(2):String(b??0)},pe=async()=>{var t;await j(),V.value=!0,await G(),(t=E.value)==null||t.open("add")},ce=async t=>{var e,r;V.value=!0,await G(),(e=E.value)==null||e.open("edit"),(r=E.value)==null||r.setFormData(t)},ue=async t=>{await Ie.confirm("确定删除该业绩记录?"),await Ue({id:t}),m()};return L(async()=>{await m()}),(t,e)=>{const r=xe,b=Ve,h=Ee,_e=Se,me=je,k=De,ye=Ce,I=We,fe=Pe,y=Te,be=Fe,ke=Re,ve=Ne,x=we("perms"),ge=Ye;return s(),v("div",He,[o(I,{class:"!border-none",shadow:"never"},{default:n(()=>[o(ye,{inline:!0,model:l(i),class:"stats-filter-form"},{default:n(()=>[o(h,{label:"时间范围"},{default:n(()=>[o(b,{modelValue:l(i).time_type,"onUpdate:modelValue":e[0]||(e[0]=a=>l(i).time_type=a),onChange:ie},{default:n(()=>[o(r,{label:"today"},{default:n(()=>[...e[6]||(e[6]=[d("今天",-1)])]),_:1}),o(r,{label:"yesterday"},{default:n(()=>[...e[7]||(e[7]=[d("昨天",-1)])]),_:1}),o(r,{label:"week"},{default:n(()=>[...e[8]||(e[8]=[d("最近7天",-1)])]),_:1}),o(r,{label:"month"},{default:n(()=>[...e[9]||(e[9]=[d("最近30天",-1)])]),_:1}),o(r,{label:"custom"},{default:n(()=>[...e[10]||(e[10]=[d("自定义",-1)])]),_:1})]),_:1},8,["modelValue"])]),_:1}),l(i).time_type==="custom"?(s(),u(h,{key:0},{default:n(()=>[o(_e,{modelValue:l(_),"onUpdate:modelValue":e[1]||(e[1]=a=>A(_)?_.value=a:null),type:"daterange","value-format":"YYYY-MM-DD","range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期",style:{width:"260px"},onChange:re},null,8,["modelValue"])]),_:1})):R("",!0),o(h,{label:"部门"},{default:n(()=>[o(me,{modelValue:l(i).dept_id,"onUpdate:modelValue":e[2]||(e[2]=a=>l(i).dept_id=a),data:l(S),"node-key":"id",props:J,"default-expand-all":!0,"check-strictly":"",placeholder:"全部部门",clearable:"",filterable:"",style:{width:"220px"},onChange:W},null,8,["modelValue","data"])]),_:1}),o(h,{label:"自媒体来源"},{default:n(()=>[o(Ge,{modelValue:l(i).media_source,"onUpdate:modelValue":e[3]||(e[3]=a=>l(i).media_source=a),options:l(F),loading:l(Y),placeholder:"全部来源","allow-create":!1,"select-style":"width: 220px",onChange:W,onVisibleChange:te},null,8,["modelValue","options","loading"])]),_:1}),o(h,null,{default:n(()=>[o(k,{type:"primary",loading:l(p).loading,onClick:W},{default:n(()=>[...e[11]||(e[11]=[d("查询",-1)])]),_:1},8,["loading"]),o(k,{onClick:de},{default:n(()=>[...e[12]||(e[12]=[d("重置",-1)])]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),c("div",Je,[(s(!0),v(U,null,q(l(oe),a=>(s(),v("div",{key:a.key,class:"stats-kpi-card"},[c("div",Xe,g(a.label),1),c("div",{class:Oe(["stats-kpi-value",{"is-money":a.type==="money"}])},g(B(a.key,l(f).summary,a.type)),3)]))),128))]),o(I,{class:"!border-none mt-4 stats-detail-card",shadow:"never"},{header:n(()=>[c("div",Ze,[c("div",et,[e[13]||(e[13]=c("span",{class:"card-title"},"业绩明细",-1)),c("span",tt,g(l(se)),1)]),c("div",at,[w((s(),u(k,{type:"primary",onClick:pe},{icon:n(()=>[o(fe,{name:"el-icon-Plus"})]),default:n(()=>[e[14]||(e[14]=d(" 新增业绩 ",-1))]),_:1})),[[x,["stats.personal_yeji/add"]]]),l(D)?w((s(),u(k,{key:0,onClick:X},{default:n(()=>[...e[15]||(e[15]=[d(" 账户消耗录入 ",-1)])]),_:1})),[[x,["stats.personal_account_cost/lists"]]]):R("",!0)])])]),default:n(()=>[w((s(),u(ke,{data:l(p).lists,border:"",size:"large","max-height":"640"},{default:n(()=>[o(y,{label:"日期",prop:"yeji_date","min-width":"110",fixed:"left"}),o(y,{label:"自媒体来源",prop:"media_source","min-width":"140","show-overflow-tooltip":""}),o(y,{label:"录入人",prop:"creator_name","min-width":"100"}),o(y,{label:"部门",prop:"dept_name","min-width":"140"},{default:n(({row:a})=>[a.dept_path?(s(),u(be,{key:0,content:a.dept_path,placement:"top",effect:"dark"},{default:n(()=>[c("span",nt,g(a.dept_name||"未分配"),1)]),_:2},1032,["content"])):a.dept_name?(s(),v("span",ot,g(a.dept_name),1)):(s(),v("span",lt,"未分配"))]),_:1}),(s(!0),v(U,null,q(l(le),a=>(s(),u(y,{key:a.key,label:a.label,"min-width":a.minWidth||100,align:"right"},{default:n(({row:O})=>[d(g(B(a.key,O,a.type)),1)]),_:2},1032,["label","min-width"]))),128)),o(y,{label:"备注",prop:"remark","min-width":"160","show-overflow-tooltip":""}),o(y,{label:"操作",width:"140",fixed:"right"},{default:n(({row:a})=>[w((s(),u(k,{type:"primary",link:"",onClick:O=>ce(a)},{default:n(()=>[...e[16]||(e[16]=[d(" 编辑 ",-1)])]),_:1},8,["onClick"])),[[x,["stats.personal_yeji/edit"]]]),w((s(),u(k,{type:"danger",link:"",onClick:O=>ue(a.id)},{default:n(()=>[...e[17]||(e[17]=[d(" 删除 ",-1)])]),_:1},8,["onClick"])),[[x,["stats.personal_yeji/delete"]]])]),_:1})]),_:1},8,["data"])),[[ge,l(p).loading]]),c("div",st,[o(ve,{modelValue:l(p),"onUpdate:modelValue":e[4]||(e[4]=a=>A(p)?p.value=a:null),onChange:m},null,8,["modelValue"])])]),_:1}),l(V)?(s(),u(Ke,{key:0,ref_key:"yejiEditRef",ref:E,"media-source-options":l(F),"media-source-loading":l(Y),onSuccess:ae,onClose:e[5]||(e[5]=a=>V.value=!1)},null,8,["media-source-options","media-source-loading"])):R("",!0)])}}}),gt=Le(rt,[["__scopeId","data-v-2bc87824"]]);export{gt as default};