1 |
- import{_ as j,d as O,ci as q,m as P,a6 as $,w as H,r as k,o as G,A as I,x as f,b,h as m,G as F,u as R,H as g,c as J,F as K,y as Q}from"./index.bf41a5b5.js";import{h as L,b as z}from"./index.9e3c038c.js";import{s as v,a as D,m as A,d as B,u as C}from"./calc.0cdee66c.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 C(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 C(t.total_tips)}},{label:"\u51C0\u9500\u552E",prop:"monthNetSales",cellRenderer({row:t}){return C(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:h,th_total:r,total_tips:_})=>({depart:u,total_tips:_,dayinfo:{sale_total:h,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:h=0,month:r=0}=a;return{total_tips:D(o,u.total_tips),month:D(r,u.month),day:D(h,u.day)}},{total_tips:0,month:0,day:0}),s=s.map(({depart:u,total_tips:a,dayinfo:o,monthinfo:h})=>{let r=v(h.msale_total,h.mth_total);const _=Object.keys(e).find(E=>E.includes(u));_&&(r=D(r,e[_])),_==="\u5317\u4EAC\u666E\u6DA6\u5FC3\u5802\u5546\u8D38\u6709\u9650\u516C\u53F8"&&(r=D(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(h.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 C(t.dayinfo.sale_total)}},{label:"\u672C\u6708\u9500\u552E\u989D",prop:"month",cellRenderer({row:t}){return C(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:D(e[1].msale_total,e[2].msale_total),mth_total:D(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:_="0"})=>D(r,_),0),month:e.reduce((r,{msale_total:_="0"})=>D(r,_),0),monthReturn:e.reduce((r,{mth_total:_="0"})=>D(r,_),0)};return a.map(r=>{const _=e.find(y=>String(y.type)===r)||{},w=s.find(y=>String(y.type)===r)||{},E=v(_.msale_total,_.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:{..._,msale_total:E},proportion:A(B(E,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 C(t.day)}},{label:"\u6708\u51C0\u9500\u552E\u989D",prop:"month",cellRenderer({row:t}){return C(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=D(s,i)||0,o=A(B(i,a)||0,100).toFixed(2);let h;return Number(o)===0?h=A(B(s,a)||0,100)!==0?Number(100-Number(o)).toFixed(2):0:h=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:h}]},[])},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 C(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 C(t.total_tips)}},{label:"\u51C0\u9500\u552E",prop:"monthNetSales",cellRenderer({row:t}){return C(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:D(i,u),month:D(s,a),day:D(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={class:"mx-[12px] mb-[-15px]"},ft={class:"ml-15px",style:{"line-height":"32px"}},ht={class:"mx-[12px] mb-[-15px]"},Et="performanceReport",yt=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 E=new Date,d=E.getFullYear(),y=E.getMonth()+1,p=E.getDate();return d+"-"+(y<10?"0"+y:y)+"-"+(p<10?"0"+p:p)},o={total_tips:0,sale_total:0,completionRate:0},h=$({wanyu:{...o},wanyuCompletion:{...o}}),r=$(n.reduce((E,{companyNo:d})=>({...E,[d]:{...o}}),{})),_=function(E=[],d){h[d]=E.reduce((y,p)=>{const x=D(y.total_tips,p.total_tips),N=D(y.sale_total,p.monthinfo.monthNetSales),S=A(B(N,x),100);return{total_tips:x,sale_total:N,completionRate:S}},o)},w=function(E=[],d){r[d]=E.reduce((y,p)=>{const x=Number(p.total_tips),N=D(y.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,E=>{[s.value,i.value,e.value,...u.value].forEach(y=>{if(!y)return;const p=y.getContent();!p||p.value.getPageData({daytime:E})})}),c.value=a(),(E,d)=>{const y=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:Et},{default:f(()=>[b("div",pt,[b("div",mt,[m(y,{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"])]),b("div",it,[b("h2",ct," \u6574\u4F53\u641E\u4E86 "+F(R(C)(h.wanyuCompletion.sale_total))+" \u5143\uFF08\u4E07\u5B87\u5E73\u53F0+\u4E1A\u52A1\u516C\u53F8\u4F9B\u5E94\u5546\u7AEF\uFF09 ",1)]),b("div",dt,[m(x,{border:"",size:"small",data:[h.wanyuCompletion]},{default:f(()=>[m(p,{label:"\u6708\u6307\u6807"},{default:f(({row:l})=>[g(F(R(C)(l.total_tips)),1)]),_:1}),m(p,{label:"\u5B8C\u6210\u989D"},{default:f(({row:l})=>[g(F(R(C)(l.sale_total)),1)]),_:1}),m(p,{label:"\u5B8C\u6210\u7387"},{default:f(({row:l})=>[g(F(Number(l.completionRate).toFixed(2)+"%"),1)]),_:1})]),_:1},8,["data"])]),m(N,{ref_key:"wanyuCompletionReportRef",ref:i,contentConfig:R(Z),events:{content:{handleResult:l=>_(l,"wanyuCompletion")}}},null,8,["contentConfig","events"]),d[2]||(d[2]=b("h2",{style:{"font-size":"20px","font-weight":"700","margin-bottom":"10px","margin-left":"15px"}}," \u5E73\u53F0\u7EF4\u5EA6 ",-1)),m(Y,{style:{overflow:"hidden"}},{default:f(()=>[m(S,{xs:24,sm:24,md:12,lg:12,xl:12},{default:f(()=>[d[1]||(d[1]=b("p",{class:"ml-[15px]",style:{"line-height":"42px"}}," \u5317\u4EAC\u4E07\u5B87\u6052\u901A\u56FD\u9645\u79D1\u8D38\u6709\u9650\u516C\u53F8 ",-1)),b("div",_t,[m(x,{border:"",size:"small",data:[h.wanyu]},{default:f(()=>[m(p,{label:"\u6708\u6307\u6807"},{default:f(({row:l})=>[g(F(R(C)(l.total_tips)),1)]),_:1}),m(p,{label:"\u5B8C\u6210\u989D"},{default:f(({row:l})=>[g(F(R(C)(l.sale_total)),1)]),_:1}),m(p,{label:"\u5B8C\u6210\u7387"},{default:f(({row:l})=>[g(F(Number(l.completionRate).toFixed(2)+"%"),1)]),_:1})]),_:1},8,["data"])]),m(N,{ref_key:"wanyuReportRef",ref:s,contentConfig:R(rt),events:{content:{handleResult:l=>_(l,"wanyu")}}},null,8,["contentConfig","events"])]),_:1}),m(S,{xs:24,sm:24,md:12,lg:12,xl:12},{default:f(()=>[m(N,{ref_key:"wanyuTypeReportRef",ref:e,contentConfig:R(nt)},null,8,["contentConfig"])]),_:1})]),_:1}),d[3]||(d[3]=b("h2",{style:{"font-size":"20px","font-weight":"700","margin-bottom":"10px","margin-left":"15px"}}," \u516C\u53F8\u7EF4\u5EA6 ",-1)),m(Y,{style:{overflow:"hidden"}},{default:f(()=>[(G(),J(K,null,Q(n,(l,V)=>m(S,{xs:24,sm:24,md:12,lg:12,xl:12,key:l.companyNo},{default:f(()=>[b("div",ft,F(V+1)+"."+F(l.companyName||"--"),1),b("div",ht,[m(x,{border:"",size:"small",data:[r[l.companyNo]]},{default:f(()=>[m(p,{label:"\u6708\u6307\u6807"},{default:f(({row:T})=>[g(F(R(C)(T.total_tips)),1)]),_:1}),m(p,{label:"\u5B8C\u6210\u989D"},{default:f(({row:T})=>[g(F(R(C)(T.sale_total)),1)]),_:1}),m(p,{label:"\u5B8C\u6210\u7387"},{default:f(({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:R(ot)(l.companyNo),events:{content:{handleResult:T=>w(T,l.companyNo)}}},null,8,["contentConfig","events"])]),_:2},1024)),64))]),_:1})])]),_:1})}}});var bt=j(yt,[["__file","C:/Users/Administrator/Desktop/projects/report-v3/src/views/dashboard/performanceReport/index.vue"]]);export{bt as default};
|