index.3d568543.js 12 KB

1
  1. import{_ as j,d as O,cl as q,m as P,a8 as $,w as H,r as k,o as G,A as I,x as _,b as R,h as m,G as F,u as b,H as g,c as J,F as K,y as Q}from"./index.56449854.js";import{h as L,b as z}from"./index.6fac7be7.js";import{s as v,a as C,m as A,d as B,u as y}from"./calc.f00124e1.js";const W={\u6CD3\u6E90:"\u6CD3\u6E90\u5E7F\u8BDA",\u767E\u8FB0:"\u767E\u8FB0\u8363\u8FBE",\u666E\u6DA6:"\u666E\u6DA6\u5FC3\u5802&\u9526\u5174\u5F18\u660C"},X=[{label:"\u90E8\u95E8",prop:"depart",cellRenderer({row:t}){const n=W[t.depart];return n||t.depart}},{label:"\u672C\u65E5\u9500\u552E\u989D",prop:"sale_total",cellRenderer({row:t}){return y(t.dayinfo.sale_total)}},{label:"\u672C\u6708\u91D1\u989D",prop:"total_tips",align:"center",children:[{label:"\u9500\u552E\u6307\u6807",prop:"total_tips",cellRenderer({row:t}){return y(t.total_tips)}},{label:"\u51C0\u9500\u552E",prop:"monthNetSales",cellRenderer({row:t}){return y(t.monthinfo.monthNetSales)}},{label:"\u51C0\u9500\u552E\u5B8C\u6210\u7387",prop:"pure_month_sale",cellRenderer({row:t}){return t.monthinfo.monthProportion+"%"}}]}],Z={responseCode:0,superUserNoAction:!1,handleData(t=[],n={}){return new Promise(c=>{L({daytime:n.daytime}).then(i=>{if(Number(i.code)===0){const e=i.data.reduce((u,a)=>({...u,[a.companyName]:v(a.monthinfo[2].msale_total,a.monthinfo[2].mth_total)}),{});let s=t.map(({depart:u,msale_total:a,mth_total:o,sale_total:f,th_total:r,total_tips:d})=>({depart:u,total_tips:d,dayinfo:{sale_total:f,th_total:r},monthinfo:{msale_total:a,mth_total:o}}));s=["\u767E\u8FB0","\u6CD3\u6E90","\u666E\u6DA6","\u5E73\u53F0"].map(u=>s.find(({depart:a})=>a===u)),this.total=s.reduce((u,a)=>{const{total_tips:o=0,day:f=0,month:r=0}=a;return{total_tips:C(o,u.total_tips),month:C(r,u.month),day:C(f,u.day)}},{total_tips:0,month:0,day:0}),s=s.map(({depart:u,total_tips:a,dayinfo:o,monthinfo:f})=>{let r=v(f.msale_total,f.mth_total);const d=Object.keys(e).find(h=>h.includes(u));d&&(r=C(r,e[d])),d==="\u5317\u4EAC\u666E\u6DA6\u5FC3\u5802\u5546\u8D38\u6709\u9650\u516C\u53F8"&&(r=C(r,e.\u5317\u4EAC\u9526\u5174\u5F18\u660C\u79D1\u6280\u6709\u9650\u516C\u53F8));const w=A(B(r,a),100).toFixed(2);return{depart:u,total_tips:a,dayinfo:{...o,sale_total:v(o.sale_total,o.th_total)},monthinfo:{monthNetSales:r,monthProportion:w},proportion:A(B(f.msale_total,this.total.month)||0,100)||0}}),c(s)}})})},columns:X,apis:{httpList:z}},M={1:"\u81EA\u8425",2:"\u6E20\u9053",3:"\u4F9B\u5E94\u5546\u7AEF"},tt=[{label:"\u4E1A\u7EE9\u7C7B\u578B",prop:"type",cellRenderer({row:t}){return M[t.type]||"--"}},{label:"\u672C\u65E5\u9500\u552E\u989D",prop:"sale_total",cellRenderer({row:t}){return y(t.dayinfo.sale_total)}},{label:"\u672C\u6708\u9500\u552E\u989D",prop:"month",cellRenderer({row:t}){return y(t.monthinfo.msale_total)}},{label:"\u6708\u5360\u6BD4",prop:"proportion",cellRenderer({row:t}){return Number(t.proportion||0).toFixed(2)+"%"}}],et=function(t){let n,c;const i=Date.parse(t),e=Date.parse("2023-04-17 00:00:00");return c=i-e,n=Math.floor(c/(1e3*3600*24)),n},ot=t=>({responseCode:0,superUserNoAction:!1,handleData(n=[],c={}){const i=c.daytime?et(c.daytime)<0&&c.companyNo==="GS2302231323386950":!1,{monthinfo:e=[],dayinfo:s=[],total_tips:u=0}=n[0]||[];e[1]={...i?{msale_total:C(e[1].msale_total,e[2].msale_total),mth_total:C(e[1].mth_total,e[2].mth_total),type:"2"}:e[1]},e[0]={...i?{msale_total:0,mth_total:0,type:"1"}:e[0]},e[2]={...i?{msale_total:0,mth_total:0,type:"3"}:e[2]};const a=Object.keys(M),o={total_tips:Number(u),day:s.reduce((r,{sale_total:d="0"})=>C(r,d),0),month:e.reduce((r,{msale_total:d="0"})=>C(r,d),0),monthReturn:e.reduce((r,{mth_total:d="0"})=>C(r,d),0)};return a.map(r=>{const d=e.find(E=>String(E.type)===r)||{},w=s.find(E=>String(E.type)===r)||{},h=v(d.msale_total,d.mth_total)||0,D=v(o.month,o.monthReturn);return{type:r,total_tips:o.total_tips,dayinfo:{...w,sale_total:v(w.sale_total,w.th_total)||0},monthinfo:{...d,msale_total:h},proportion:A(B(h,Number(D).toFixed(2))||0,100).toFixed(2)}})},columns:tt,apis:{httpList:(n={})=>L({...n,companyNo:t})}}),ut={\u6CD3\u6E90:"\u6CD3\u6E90\u5E7F\u8BDA",\u767E\u8FB0:"\u767E\u8FB0\u8363\u8FBE",\u666E\u6DA6:"\u666E\u6DA6\u5FC3\u5802&\u9526\u5174\u5F18\u660C"},at=[{label:"\u4E1A\u52A1\u516C\u53F8",prop:"depart",cellRenderer({row:t}){const n=ut[t.depart];return n||t.depart}},{label:"\u4E1A\u7EE9\u7C7B\u578B",prop:"type"},{label:"\u65E5\u51C0\u9500\u552E\u989D",prop:"day",cellRenderer({row:t}){return y(t.day)}},{label:"\u6708\u51C0\u9500\u552E\u989D",prop:"month",cellRenderer({row:t}){return y(t.month)}},{label:"\u672C\u6708\u6BDB\u5229\u7387",prop:"proportion",cellRenderer({row:t}){return Number(t.proportion||0).toFixed(2)+"%"}}],nt={responseCode:0,superUserNoAction:!1,handleData(t=[]){return t.reduce((n,c)=>{const{mzy_sale_total:i,zy_sale_total:e,mchannel_sale_total:s,channel_sale_total:u}=c,a=C(s,i)||0,o=A(B(i,a)||0,100).toFixed(2);let f;return Number(o)===0?f=A(B(s,a)||0,100)!==0?Number(100-Number(o)).toFixed(2):0:f=Number(100-Number(o)).toFixed(2),[...n,{depart:c.depart,type:"\u76F4\u8425",month:i,day:e,proportion:o},{depart:c.depart,type:"\u6E20\u9053",month:s,day:u,proportion:f}]},[])},columns:at,apis:{httpList:z}},lt={\u6CD3\u6E90:"\u6CD3\u6E90\u5E7F\u8BDA",\u767E\u8FB0:"\u767E\u8FB0\u8363\u8FBE",\u666E\u6DA6:"\u666E\u6DA6\u5FC3\u5802&\u9526\u5174\u5F18\u660C"},st=[{label:"\u90E8\u95E8",prop:"depart",cellRenderer({row:t}){const n=lt[t.depart];return n||t.depart}},{label:"\u672C\u65E5\u9500\u552E\u989D",prop:"sale_total",cellRenderer({row:t}){return y(t.dayinfo.sale_total)}},{label:"\u672C\u6708\u91D1\u989D",prop:"total_tips",align:"center",children:[{label:"\u9500\u552E\u6307\u6807",prop:"total_tips",cellRenderer({row:t}){return y(t.total_tips)}},{label:"\u51C0\u9500\u552E",prop:"monthNetSales",cellRenderer({row:t}){return y(t.monthinfo.monthNetSales)}},{label:"\u51C0\u9500\u552E\u5B8C\u6210\u7387",prop:"pure_month_sale",cellRenderer({row:t}){return t.monthinfo.monthProportion+"%"}}]}],rt={responseCode:0,superUserNoAction:!1,handleData(t=[]){const n=t.map(({depart:i,msale_total:e,mth_total:s,sale_total:u,th_total:a,total_tips:o})=>({depart:i,total_tips:o,dayinfo:{sale_total:u,th_total:a},monthinfo:{msale_total:e,mth_total:s}})),c=n.reduce(({total_tips:i,day:e,month:s},{total_tips:u=0,month:a=0,day:o=0})=>({total_tips:C(i,u),month:C(s,a),day:C(e,o)}),{total_tips:0,month:0,day:0});return n.map(({depart:i,total_tips:e,dayinfo:s,monthinfo:u})=>{const a=v(u.msale_total,u.mth_total),o=A(B(a,e),100).toFixed(2);return{depart:i,total_tips:e,dayinfo:{...s,sale_total:v(s.sale_total,s.th_total)},monthinfo:{monthNetSales:a,monthProportion:o},proportion:A(B(u.msale_total,c.month)||0,100)||0}})},columns:st,apis:{httpList:z}},pt={class:"bg-white"},mt={"w-full":"",flex:"","justify-end":"","p-2":""},it={class:"ml-[15px]"},ct={style:{"font-size":"20px","font-weight":"700","margin-bottom":"10px"}},dt={class:"mx-[12px] mb-[-15px]"},_t=R("h2",{style:{"font-size":"20px","font-weight":"700","margin-bottom":"10px","margin-left":"15px"}}," \u5E73\u53F0\u7EF4\u5EA6 ",-1),ft=R("p",{class:"ml-[15px]",style:{"line-height":"42px"}}," \u5317\u4EAC\u4E07\u5B87\u6052\u901A\u56FD\u9645\u79D1\u8D38\u6709\u9650\u516C\u53F8 ",-1),ht={class:"mx-[12px] mb-[-15px]"},Et=R("h2",{style:{"font-size":"20px","font-weight":"700","margin-bottom":"10px","margin-left":"15px"}}," \u516C\u53F8\u7EF4\u5EA6 ",-1),yt={class:"ml-15px",style:{"line-height":"32px"}},Ct={class:"mx-[12px] mb-[-15px]"},Dt="performanceReport",Ft=O({__name:"index",setup(t){const n=[{companyNo:"GS2302231125079621",companyName:"\u5317\u4EAC\u767E\u8FB0\u8363\u8FBE\u56FD\u9645\u79D1\u8D38\u6709\u9650\u516C\u53F8"},{companyNo:"GS2302231323386950",companyName:"\u5317\u4EAC\u6CD3\u6E90\u5E7F\u8BDA\u56FD\u9645\u5546\u8D38\u6709\u9650\u516C\u53F8"},{companyNo:"GS2304031312553746",companyName:"\u5317\u4EAC\u9526\u5174\u5F18\u660C\u79D1\u6280\u6709\u9650\u516C\u53F8"},{companyNo:"GS2302231124114965",companyName:"\u5317\u4EAC\u666E\u6DA6\u5FC3\u5802\u5546\u8D38\u6709\u9650\u516C\u53F8"},{companyNo:"GS2203161855277894",companyName:"\u5317\u4EAC\u4E07\u5B87\u6052\u901A\u56FD\u9645\u79D1\u8D38\u6709\u9650\u516C\u53F8"}],c=q(""),i=P(null),e=P(null),s=P(null),u=P([]),a=function(){let h=new Date,D=h.getFullYear(),E=h.getMonth()+1,p=h.getDate();return D+"-"+(E<10?"0"+E:E)+"-"+(p<10?"0"+p:p)},o={total_tips:0,sale_total:0,completionRate:0},f=$({wanyu:{...o},wanyuCompletion:{...o}}),r=$(n.reduce((h,{companyNo:D})=>({...h,[D]:{...o}}),{})),d=function(h=[],D){f[D]=h.reduce((E,p)=>{const x=C(E.total_tips,p.total_tips),N=C(E.sale_total,p.monthinfo.monthNetSales),S=A(B(N,x),100);return{total_tips:x,sale_total:N,completionRate:S}},o)},w=function(h=[],D){r[D]=h.reduce((E,p)=>{const x=Number(p.total_tips),N=C(E.sale_total,p.monthinfo.msale_total),S=A(B(N,x)||0,100);return{total_tips:x,sale_total:N,completionRate:S}},o)};return H(()=>c.value,h=>{[s.value,i.value,e.value,...u.value].forEach(E=>{if(!E)return;const p=E.getContent();!p||p.value.getPageData({daytime:h})})}),c.value=a(),(h,D)=>{const E=k("ElDatePicker"),p=k("ElTableColumn"),x=k("ElTable"),N=k("PageContainer"),S=k("ElCol"),Y=k("ElRow"),U=k("PageAuth");return G(),I(U,{pageName:Dt},{default:_(()=>[R("div",pt,[R("div",mt,[m(E,{modelValue:c.value,"onUpdate:modelValue":D[0]||(D[0]=l=>c.value=l),"value-format":"YYYY-MM-DD",format:"YYYY-MM-DD",type:"date",placeholder:"\u9009\u62E9\u65E5\u671F",disabledDate:l=>l.getTime()>Date.now()},null,8,["modelValue","disabledDate"])]),R("div",it,[R("h2",ct," \u6574\u4F53\u641E\u4E86 "+F(b(y)(f.wanyuCompletion.sale_total))+" \u5143\uFF08\u4E07\u5B87\u5E73\u53F0+\u4E1A\u52A1\u516C\u53F8\u4F9B\u5E94\u5546\u7AEF\uFF09 ",1)]),R("div",dt,[m(x,{border:"",size:"small",data:[f.wanyuCompletion]},{default:_(()=>[m(p,{label:"\u6708\u6307\u6807"},{default:_(({row:l})=>[g(F(b(y)(l.total_tips)),1)]),_:1}),m(p,{label:"\u5B8C\u6210\u989D"},{default:_(({row:l})=>[g(F(b(y)(l.sale_total)),1)]),_:1}),m(p,{label:"\u5B8C\u6210\u7387"},{default:_(({row:l})=>[g(F(Number(l.completionRate).toFixed(2)+"%"),1)]),_:1})]),_:1},8,["data"])]),m(N,{ref_key:"wanyuCompletionReportRef",ref:i,contentConfig:b(Z),events:{content:{handleResult:l=>d(l,"wanyuCompletion")}}},null,8,["contentConfig","events"]),_t,m(Y,{style:{overflow:"hidden"}},{default:_(()=>[m(S,{xs:24,sm:24,md:12,lg:12,xl:12},{default:_(()=>[ft,R("div",ht,[m(x,{border:"",size:"small",data:[f.wanyu]},{default:_(()=>[m(p,{label:"\u6708\u6307\u6807"},{default:_(({row:l})=>[g(F(b(y)(l.total_tips)),1)]),_:1}),m(p,{label:"\u5B8C\u6210\u989D"},{default:_(({row:l})=>[g(F(b(y)(l.sale_total)),1)]),_:1}),m(p,{label:"\u5B8C\u6210\u7387"},{default:_(({row:l})=>[g(F(Number(l.completionRate).toFixed(2)+"%"),1)]),_:1})]),_:1},8,["data"])]),m(N,{ref_key:"wanyuReportRef",ref:s,contentConfig:b(rt),events:{content:{handleResult:l=>d(l,"wanyu")}}},null,8,["contentConfig","events"])]),_:1}),m(S,{xs:24,sm:24,md:12,lg:12,xl:12},{default:_(()=>[m(N,{ref_key:"wanyuTypeReportRef",ref:e,contentConfig:b(nt)},null,8,["contentConfig"])]),_:1})]),_:1}),Et,m(Y,{style:{overflow:"hidden"}},{default:_(()=>[(G(),J(K,null,Q(n,(l,V)=>m(S,{xs:24,sm:24,md:12,lg:12,xl:12,key:l.companyNo},{default:_(()=>[R("div",yt,F(V+1)+"."+F(l.companyName||"--"),1),R("div",Ct,[m(x,{border:"",size:"small",data:[r[l.companyNo]]},{default:_(()=>[m(p,{label:"\u6708\u6307\u6807"},{default:_(({row:T})=>[g(F(b(y)(T.total_tips)),1)]),_:1}),m(p,{label:"\u5B8C\u6210\u989D"},{default:_(({row:T})=>[g(F(b(y)(T.sale_total)),1)]),_:1}),m(p,{label:"\u5B8C\u6210\u7387"},{default:_(({row:T})=>[g(F(Number(T.completionRate).toFixed(2)+"%"),1)]),_:1})]),_:2},1032,["data"])]),m(N,{ref_for:!0,ref_key:"dashboardRef",ref:u,contentConfig:b(ot)(l.companyNo),events:{content:{handleResult:T=>w(T,l.companyNo)}}},null,8,["contentConfig","events"])]),_:2},1024)),64))]),_:1})])]),_:1})}}});var xt=j(Ft,[["__file","C:/Users/89793/Desktop/projects/report-v3/src/views/dashboard/performanceReport/index.vue"]]);export{xt as default};