Month.1f9e1de0.js 6.0 KB

12345678
  1. import{Z as e,cm as h,D as N,cn as y,_ as j,d as G,m as k,n as O,S as U,w,p as z,r as M,o as I,c as q,b as S,H,h as V,a as L,u as Z}from"./index.56449854.js";import{c as J}from"./index.85e76c41.js";import{s as p,a as F,m as g,d as x,u as t}from"./calc.f00124e1.js";const K={\u5317\u4EAC\u767E\u8FB0\u8363\u8FBE\u56FD\u9645\u79D1\u8D38\u6709\u9650\u516C\u53F8:"\u767E\u8FB0",\u5317\u4EAC\u6CD3\u6E90\u5E7F\u8BDA\u56FD\u9645\u5546\u8D38\u6709\u9650\u516C\u53F8:"\u6CD3\u6E90",\u5317\u4EAC\u4E07\u5B87\u6052\u901A\u56FD\u9645\u79D1\u8D38\u6709\u9650\u516C\u53F8:"\u4E07\u5B87",\u5317\u4EAC\u9526\u5174\u5F18\u660C\u79D1\u6280\u6709\u9650\u516C\u53F8:"\u9526\u5174",\u5317\u4EAC\u666E\u6DA6\u5FC3\u5802\u5546\u8D38\u6709\u9650\u516C\u53F8:"\u666E\u6DA6",\u5317\u4EAC\u77E5\u4E8B\u6587\u5316\u4EA7\u4E1A\u53D1\u5C55\u6709\u9650\u516C\u53F8:"\u77E5\u4E8B",\u5317\u4EAC\u6CF0\u6587\u521B\u4F9B\u5E94\u94FE\u7BA1\u7406\u6709\u9650\u516C\u53F8:"\u6CF0\u6587\u521B"},Q=[{label:"\u516C\u53F8",prop:"companyName",cellRenderer({row:u}){return u.companyName.indexOf("\u666E\u6DA6")===-1?K[u.companyName]||u.companyName:e(y,{width:220},{reference:()=>e("div",null,[e(h,{icon:N("information-line"),link:!0},{}),"\u666E\u6DA6"]),default:()=>"\u666E\u6DA6&\u9526\u5174&\u77E5\u4E8B"})}},{label:"\u5F53\u65E5\u8425\u4E1A\u6536\u5165",cellRenderer({row:u}){return t(u.sale_total)}},{label:"\u8425\u6536\u76EE\u6807",cellRenderer({row:u}){return t(u.total_tips)}},{label:"\u8425\u4E1A\u6536\u5165(\u51C0)",cellRenderer({row:u}){return e(y,{width:220},{reference:()=>e("div",null,[e(h,{icon:N("information-line"),link:!0},{}),e("span",null,t(u.msale_total))]),default:()=>e("div",{class:"table-size"},[e("p",null,`\u76F4\u8425/\u81EA\u8425: ${t(u.info[0][0].monthinfo.msale_total)}`),e("p",null,`\u652F\u4ED8\u6E20\u9053: ${t(u.info[0][1].monthinfo.msale_total)}`),e("p",null,`\u4F9B\u5E94\u5546\u7AEF: ${t(u.info[0][2].monthinfo.msale_total)}`)])})}},{label:"\u8425\u6536\u5B8C\u6210%",cellRenderer({row:u}){return(String(u.completion_rate)==="NaN"?0:u.completion_rate)+"%"}},{label:"\u6BDB\u5229\u76EE\u6807",cellRenderer({row:u}){return t(u.cost_tips)}},{label:"\u6BDB\u5229\u5B8C\u6210%",cellRenderer({row:u}){return u.gross_completion_rate+"%"}},{label:"\u6210\u672C\u5408\u8BA1",cellRenderer({row:u}){return e(y,{width:220},{reference:()=>e("div",null,[e(h,{icon:N("information-line"),link:!0},{}),e("span",null,t(u.msale_total))]),default:()=>e("div",{class:"table-size"},[e("p",null,`\u76F4\u8425/\u81EA\u8425: ${t(u.info[0][0].monthinfo.mcost_total)}`),e("p",null,`\u652F\u4ED8\u6E20\u9053: ${t(u.info[0][1].monthinfo.mcost_total)}`),e("p",null,`\u4F9B\u5E94\u5546\u7AEF: ${t(u.info[0][2].monthinfo.mcost_total)}`),e("p",null,`\u7269\u6D41\u8D39\u7528: ${t(u.info[0][3].monthinfo.mcost_total)}`)])})}},{label:"\u5B9E\u9645\u6BDB\u5229\u7387",cellRenderer({row:u}){return t(u.gross_sale_completion_rate)+"%"}}],W={title:"",superUserNoAction:!1,showTitle:!0,responseCode:0,columns:Q,noRequiredInit:!0,handleData(u=[]){let s=[];(u||[]).forEach(({companyName:o,monthinfo:l,dayinfo:C,total_tips:d,cost_tips:a})=>{const R={1:"\u81EA\u8425",2:"\u6E20\u9053",3:"\u4F9B\u5E94\u5546\u7AEF",4:"\u7269\u6D41\u8D39\u7528"},$=Object.keys(R);let D=0,i=0,A=0,_=0;const P=$.map(c=>{const m=l.find(b=>String(b.type)===c)||{},E=C.find(b=>String(b.type)===c)||{};let B=0;Number(c)!==4&&(B=p(m.msale_total,m.mth_total)||0);const Y=p(E.sale_total,E.th_total)||0,T=p(E.cgd_total,E.cgd_th_total)||0;let f=0;return Number(c)!==4?f=p(m.mcgd_total,m.mcgd_th_total)||0:f=Number(m.msale_total||0).toFixed(2),D=Number(F(D,Y)).toFixed(2),i=Number(F(i,B)).toFixed(2),A=Number(F(A,T)).toFixed(2),_=Number(F(_,f)).toFixed(2),{type:R[c],dayinfo:{...E,sale_total:Y},monthinfo:{...l,msale_total:B,mcost_total:f}}}),v=Number(p(i,_)).toFixed(2);s=[...s,{companyName:o,cost_tips:a,total_tips:d,info:[{...P}],sale_total:D,cost_total:A,msale_total:i,mcost_total:_,gross_completion:v,completion_rate:g(x(i,d),100).toFixed(2),gross_completion_rate:Number(a)===0?0:g(x(v,a)||0,100).toFixed(2),gross_sale_completion_rate:Number(g(x(v,i)||0,100)).toFixed(2)}]});let r=["\u5317\u4EAC\u767E\u8FB0\u8363\u8FBE\u56FD\u9645\u79D1\u8D38\u6709\u9650\u516C\u53F8","\u5317\u4EAC\u6CD3\u6E90\u5E7F\u8BDA\u56FD\u9645\u5546\u8D38\u6709\u9650\u516C\u53F8","\u5317\u4EAC\u666E\u6DA6\u5FC3\u5802\u5546\u8D38\u6709\u9650\u516C\u53F8"];const n=s.map(o=>o.companyName);return r=r.filter(o=>n.includes(o)),r.map(o=>s.find(l=>l.companyName===o))},apis:{httpList:J}},X={"w-full":""},uu={class:"flex justify-between px-[15px] pt-[10px] mt-[10px] mb-[-10px] bg-white"},eu={class:"flex"},tu=G({__name:"Month",setup(u){const s=[{value:"",label:"\u6240\u6709\u516C\u53F8"},{value:"GS2302231125079621",label:"\u4E1A\u52A1\u516C\u53F8: \u767E\u8FB0"},{value:"GS2302231323386950",label:"\u4E1A\u52A1\u516C\u53F8: \u6CD3\u6E90"},{value:"GS2302231124114965",label:"\u4E1A\u52A1\u516C\u53F8: \u666E\u6DA6&\u9526\u5174&\u77E5\u4E8B"}],r=k(null),n=k({companyNo:"",daytime:""});return O(()=>{const o=U(new Date).format("YYYY-MM-DD");n.value.daytime=o,n.value.companyNo=s[0].value}),w(()=>n.value,({daytime:o,companyNo:l})=>{z(()=>r.value.getPageData({daytime:o,companyNo:l}))},{deep:!0,immediate:!0}),(o,l)=>{const C=M("ElDatePicker"),d=M("PageContainer");return I(),q("div",X,[S("div",uu,[H(" \u6708\u5EA6\u5B8C\u6210\u60C5\u51B5-\u4E1A\u52A1\u516C\u53F8 "),S("div",eu,[V(C,{modelValue:n.value.daytime,"onUpdate:modelValue":l[0]||(l[0]=a=>n.value.daytime=a),clearable:!1,placeholder:"\u9009\u62E9\u65E5\u671F","value-format":"YYYY-MM-DD",format:"YYYY-MM-DD"},null,8,["modelValue"]),L(` <ElSelect v-model="monthState.companyNo" placeholder="\u4E1A\u52A1\u516C\u53F8">\r
  2. <ElOption\r
  3. v-for="option in companies"\r
  4. :key="option.value"\r
  5. :label="option.label"\r
  6. :value="option.value"\r
  7. />\r
  8. </ElSelect> `)])]),V(d,{"get-content-ref":a=>r.value=a,contentConfig:Z(W)},null,8,["get-content-ref","contentConfig"])])}}});var au=j(tu,[["__file","C:/Users/89793/Desktop/projects/report-v3/src/views/dashboard/newResults/Month.vue"]]);export{au as default};