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