MonthPlatment.e18e6314.js 5.8 KB

12345678
  1. import{Z as e,cm as v,D as N,cn as y,_ as j,d as O,m as k,n as U,S as w,w as z,p as I,r as M,o as q,c as H,b as P,H as L,h as S,a as Z,u as G}from"./index.56449854.js";import{c as J}from"./index.85e76c41.js";import{s as d,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",\u5317\u4EAC\u5143\u9686\u96C5\u56FE\u6587\u5316\u4F20\u64AD\u80A1\u4EFD\u6709\u9650\u516C\u53F8:"\u9884\u8D2D\u5355E\u4F01\u8D2D"},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(v,{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(v,{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(v,{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 l=[];(u||[]).forEach(({companyName:o,monthinfo:r,dayinfo:F,total_tips:s,cost_tips:D})=>{const R={1:"\u81EA\u8425",2:"\u6E20\u9053",3:"\u4F9B\u5E94\u5546\u7AEF",4:"\u7269\u6D41\u8D39\u7528"},V=Object.keys(R);let C=0,i=0,A=0,p=0;const $=V.map(m=>{const c=r.find(b=>String(b.type)===m)||{},E=F.find(b=>String(b.type)===m)||{};let h=0;Number(m)!==4&&(h=d(c.msale_total,c.mth_total)||0);const Y=d(E.sale_total,E.th_total)||0,T=d(E.cgd_total,E.cgd_th_total)||0;let _=0;return Number(m)!==4?_=d(c.mcgd_total,c.mcgd_th_total)||0:_=Number(c.msale_total||0).toFixed(2),C=Number(f(C,Y)).toFixed(2),i=Number(f(i,h)).toFixed(2),A=Number(f(A,T)).toFixed(2),p=Number(f(p,_)).toFixed(2),{type:R[m],dayinfo:{...E,sale_total:Y},monthinfo:{...r,msale_total:h,mcost_total:_}}}),B=Number(d(i,p)).toFixed(2);l=[...l,{companyName:o,cost_tips:D,total_tips:s,info:[{...$}],sale_total:C,cost_total:A,msale_total:i,mcost_total:p,gross_completion:B,completion_rate:g(x(i,s),100).toFixed(2),gross_completion_rate:Number(D)===0?0:g(x(B,D)||0,100).toFixed(2),gross_sale_completion_rate:Number(g(x(B,i)||0,100)).toFixed(2)}]});let n=["\u5317\u4EAC\u4E07\u5B87\u6052\u901A\u56FD\u9645\u79D1\u8D38\u6709\u9650\u516C\u53F8","\u5317\u4EAC\u6CF0\u6587\u521B\u4F9B\u5E94\u94FE\u7BA1\u7406\u6709\u9650\u516C\u53F8","\u5317\u4EAC\u5143\u9686\u96C5\u56FE\u6587\u5316\u4F20\u64AD\u80A1\u4EFD\u6709\u9650\u516C\u53F8","\u7ED3\u7B97\u5355E\u4F01\u8D2D"];const a=l.map(o=>o.companyName);return n=n.filter(o=>a.includes(o)),n.map(o=>l.find(r=>r.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=O({__name:"MonthPlatment",setup(u){const l=k(null),n=k({companyNo:"",daytime:""});return U(()=>{const a=w(new Date).format("YYYY-MM-DD");n.value.daytime=a}),z(()=>n.value,({daytime:a})=>{I(()=>l.value.getPageData({daytime:a}))},{deep:!0,immediate:!0}),(a,o)=>{const r=M("ElDatePicker"),F=M("PageContainer");return q(),H("div",X,[P("div",uu,[L(" \u6708\u5EA6\u5B8C\u6210\u60C5\u51B5-\u5E73\u53F0\u516C\u53F8 "),P("div",eu,[S(r,{modelValue:n.value.daytime,"onUpdate:modelValue":o[0]||(o[0]=s=>n.value.daytime=s),clearable:!1,placeholder:"\u9009\u62E9\u65E5\u671F","value-format":"YYYY-MM-DD",format:"YYYY-MM-DD"},null,8,["modelValue"]),Z(` <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> `)])]),S(F,{"get-content-ref":s=>l.value=s,contentConfig:G(W)},null,8,["get-content-ref","contentConfig"])])}}});var au=j(tu,[["__file","C:/Users/89793/Desktop/projects/report-v3/src/views/dashboard/newResults/MonthPlatment.vue"]]);export{au as default};