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