1 |
- import{_ as P,d as x,aG as R,m as A,w as O,r as M,o as b,A as k,x as G,e as D,f as E,h as N,c as T,F as L,y as Y,G as S}from"./index.js";import{h as U,a as w,b as V,c as v}from"./index.6036f908.js";import{a as s,s as l,m as i,d as c,c as F,u as d}from"./calc.850c7422.js";const $=[{label:"\u4E1A\u7EE9\u7C7B\u578B",prop:"field"},{label:"\u672C\u65E5\u9500\u552E\u51C0\u989D",prop:"pure_day_sale",cellRenderer({row:e}){return d(e.pure_day_sale)}},{label:"\u672C\u65E5\u6BDB\u5229\u6DA6",prop:"pure_day_profit",cellRenderer({row:e}){return d(e.pure_day_profit)}},{label:"\u672C\u65E5\u6BDB\u5229\u7387",prop:"pure_day_interest_rate",cellRenderer({row:e}){return Number(e.pure_day_interest_rate||0).toFixed(2)+"%"}},{label:"\u672C\u6708\u9500\u552E\u51C0\u989D",prop:"pure_month_sale",cellRenderer({row:e}){return d(e.pure_month_sale)}},{label:"\u672C\u6708\u9500\u552E\u6307\u6807",prop:"total_tips",cellRenderer({row:e}){return e.total_tips==="--"?"--":d(e.total_tips)}},{label:"\u672C\u6708\u6307\u6807\u8FBE\u6210\u7387",prop:"month_completion_rate",cellRenderer({row:e}){return e.month_completion_rate==="--"?"--":Number(e.month_completion_rate||0).toFixed(2)+"%"}},{label:"\u672C\u6708\u6BDB\u5229\u6DA6",prop:"pure_month_profit",cellRenderer({row:e}){return d(e.pure_month_profit)}},{label:"\u672C\u6708\u6BDB\u5229\u7387",prop:"pure_month_interest_rate",cellRenderer({row:e}){return e.pure_month_interest_rate==="--"?"--":Number(e.pure_month_interest_rate||0).toFixed(2)+"%"}}],j=["\u81EA\u8425","\u6E20\u9053","\u5C0F\u8BA1","\u4F9B\u5E94\u5546\u7AEF","\u5408\u8BA1"],z={\u4F9B\u5E94\u5546\u7AEF:{saleDay:"supplierSaleDay",saleMonth:"supplierSaleMonth",purchDay:"supplierPurchDay",purchMonth:"supplierPurchMonth"},\u81EA\u8425:{saleDay:"selfOperatedSaleDay",saleMonth:"selfOperatedSaleMonth",purchDay:"selfOperatedPurchDay",purchMonth:"selfOperatedPurchMonth"},\u6E20\u9053:{saleDay:"channelSaleDay",saleMonth:"channelSaleMonth",purchDay:"channelPurchDay",purchMonth:"channelPurchMonth"}};function q(e){return{title:"",superUserNoAction:!1,handleData(p=[]){const n=p.reduce((o,t)=>({supplierSaleDay:s(o.supplierSaleDay,l(t.dayinfo[2].sale_total,t.dayinfo[2].th_total)),supplierSaleMonth:s(o.supplierSaleMonth,l(t.monthinfo[2].msale_total,t.monthinfo[2].mth_total)),supplierPurchDay:s(o.supplierPurchDay,l(t.dayinfo[2].cgd_total,t.dayinfo[2].cgd_th_total)),supplierPurchMonth:s(o.supplierPurchMonth,l(t.monthinfo[2].mcgd_total,t.monthinfo[2].mcgd_th_total)),selfOperatedSaleDay:s(o.selfOperatedSaleDay,l(t.dayinfo[0].sale_total,t.dayinfo[0].th_total)),selfOperatedSaleMonth:s(o.selfOperatedSaleMonth,l(t.monthinfo[0].msale_total,t.monthinfo[0].mth_total)),selfOperatedPurchDay:s(o.selfOperatedPurchDay,l(t.dayinfo[0].cgd_total,t.dayinfo[0].cgd_th_total)),selfOperatedPurchMonth:s(o.selfOperatedPurchMonth,l(t.monthinfo[0].mcgd_total,t.monthinfo[0].mcgd_th_total)),channelSaleDay:s(o.channelSaleDay,l(t.dayinfo[1].sale_total,t.dayinfo[1].th_total)),channelSaleMonth:s(o.channelSaleMonth,l(t.monthinfo[1].msale_total,t.monthinfo[1].mth_total)),channelPurchDay:s(o.channelPurchDay,l(t.dayinfo[1].cgd_total,t.dayinfo[1].cgd_th_total)),channelPurchMonth:s(o.channelPurchMonth,l(t.monthinfo[1].mcgd_total,t.monthinfo[1].mcgd_th_total)),totalTips:s(o.totalTips,t.total_tips)}),{supplierSaleDay:0,supplierSaleMonth:0,supplierPurchDay:0,supplierPurchMonth:0,selfOperatedSaleDay:0,selfOperatedSaleMonth:0,selfOperatedPurchDay:0,selfOperatedPurchMonth:0,channelSaleDay:0,channelSaleMonth:0,channelPurchDay:0,channelPurchMonth:0,totalTips:0}),r=j.map(o=>{const t=z[o];if(!t)return{field:o,total_tips:"--",pure_day_sale:0,pure_day_purch:0,pure_day_profit:0,pure_day_interest_rate:0,pure_month_sale:0,pure_month_purch:0,month_completion_rate:"--",pure_month_profit:0,pure_month_interest_rate:0};const _=n[t.saleDay],m=n[t.purchDay],f=l(_,m),h=n[t.saleMonth];let y=i(c(f,_),100);const C=n[t.purchMonth],g=l(h,C);let B=i(c(g,h),100);return Number(_)<0&&(y=0),Number(h)<0&&(B=0),{field:o,total_tips:"--",pure_day_sale:_,pure_day_purch:m,pure_day_profit:f,pure_month_sale:h,pure_month_purch:C,pure_day_interest_rate:y,month_completion_rate:"--",pure_month_profit:g,pure_month_interest_rate:B}}),u=F([r[0],r[1]]);u.field="\u5C0F\u8BA1",u.total_tips="--",u.month_completion_rate="--",u.pure_month_interest_rate=i(c(u.pure_month_profit,u.pure_month_sale),100),u.pure_day_interest_rate=i(c(u.pure_day_profit,u.pure_day_sale),100),Number(u.pure_day_sale)<0&&(u.pure_day_interest_rate=0),Number(u.pure_month_sale)<0&&(u.pure_month_interest_rate=0),r[2]=u;const a=F([r[2],r[3]]);return a.field="\u5408\u8BA1",a.total_tips=n.totalTips,a.pure_month_interest_rate=i(c(a.pure_month_profit,a.pure_month_sale),100),a.pure_day_interest_rate=i(c(a.pure_day_profit,a.pure_day_sale),100),a.month_completion_rate=i(c(a.pure_month_sale,a.total_tips),100),Number(a.pure_day_sale)<0&&(a.pure_day_interest_rate=0),Number(a.pure_month_sale)<0&&(a.pure_month_interest_rate=0),r[4]=a,r},columns:$,apis:{httpList:(p={})=>U({...p,companyNo:e})}}}const H=[{label:"\u6708\u4EFD",prop:"month"},{label:"\u9500\u552E\u51C0\u989D",prop:"pure_sale",cellRenderer({row:e}){return d(e.pure_sale)}},{label:"\u9500\u552E\u6307\u6807",prop:"total_tips",cellRenderer({row:e}){return d(e.total_tips)}},{label:"\u6307\u6807\u8FBE\u6210\u7387",prop:"completion_rate",cellRenderer({row:e}){return Number(e.completion_rate||0).toFixed(2)+"%"}},{label:"\u6BDB\u5229\u6DA6",prop:"pure_profit",cellRenderer({row:e}){return d(e.pure_profit)}},{label:"\u6BDB\u5229\u7387",prop:"pure_interest_rate",cellRenderer({row:e}){return Number(e.pure_interest_rate||0).toFixed(2)+"%"}}];function J(e){return{title:"",superUserNoAction:!1,handleData(p=[]){const n=p.map(u=>{const a=l(u.sale_total,u.th_total),o=i(c(a,u.total_tips),100),t=l(u.cgd_total,u.cgd_th_total),_=l(a,t);let m=i(c(_,a)||0,100);return Number(a)<0&&(m=0),{month:u.month,completion_rate:o,pure_interest_rate:m,pure_profit:_,pure_sale:a,pure_purch:t,total_tips:u.total_tips}}),r=F(n);return r.month="\u5E74\u5EA6\u5408\u8BA1",r.completion_rate=i(c(r.pure_sale,r.total_tips),100),r.pure_profit=l(r.pure_sale,r.pure_purch),r.pure_interest_rate=i(c(r.pure_profit,r.pure_sale),100),Number(r.pure_sale)<0&&(r.pure_interest_rate=0),[...n,r]},columns:H,apis:{httpList:()=>w({companyNo:e})}}}const K={\u6CD3\u6E90:"\u6CD3\u6E90\u5E7F\u8BDA",\u767E\u8FB0:"\u767E\u8FB0\u8363\u8FBE",\u666E\u6DA6:"\u666E\u6DA6\u5FC3\u5802&\u9526\u5174\u5F18\u660C"},Q=[{label:"\u4E1A\u52A1\u516C\u53F8",prop:"depart",cellRenderer({row:e}){const p=K[e.depart];return p||e.depart}},{label:"\u672C\u65E5\u9500\u552E\u51C0\u989D",prop:"pure_day_sale",cellRenderer({row:e}){return d(e.pure_day_sale)}},{label:"\u672C\u65E5\u6BDB\u5229\u6DA6",prop:"pure_day_profit",cellRenderer({row:e}){return d(e.pure_day_profit)}},{label:"\u672C\u65E5\u6BDB\u5229\u7387",prop:"pure_day_interest_rate",cellRenderer({row:e}){return Number(e.pure_day_interest_rate||0).toFixed(2)+"%"}},{label:"\u672C\u6708\u9500\u552E\u51C0\u989D",prop:"pure_month_sale",cellRenderer({row:e}){return d(e.pure_month_sale)}},{label:"\u672C\u6708\u6307\u6807\u8FBE\u6210\u7387",prop:"month_completion_rate",cellRenderer({row:e}){return Number(e.month_completion_rate||0).toFixed(2)+"%"}},{label:"\u672C\u6708\u9500\u552E\u6307\u6807",prop:"total_tips",cellRenderer({row:e}){return d(e.total_tips)}},{label:"\u672C\u6708\u6BDB\u5229\u6DA6",prop:"pure_month_profit",cellRenderer({row:e}){return d(e.pure_month_profit)}},{label:"\u672C\u6708\u6BDB\u5229\u7387",prop:"pure_month_interest_rate",cellRenderer({row:e}){return Number(e.pure_month_interest_rate||0).toFixed(2)+"%"}}],W={title:"",superUserNoAction:!1,handleData(e=[]){const p=[].reduce((u,a)=>({...u,[a.companyName]:{supplierSaleDay:0,supplierSaleMonth:0,supplierPurchDay:0,supplierPurchMonth:0}}),{}),n=e.map(u=>{const a=Object.keys(p).find(B=>B.includes(u.depart));let o=l(u.sale_total,u.th_total),t=l(u.cgd_total,u.cgd_th_total);a&&(t=s(t,p[a].supplierPurchDay),o=s(o,p[a].supplierSaleDay)),a==="\u5317\u4EAC\u666E\u6DA6\u5FC3\u5802\u5546\u8D38\u6709\u9650\u516C\u53F8"&&(t=s(t,p.\u5317\u4EAC\u9526\u5174\u5F18\u660C\u79D1\u6280\u6709\u9650\u516C\u53F8.supplierPurchDay),o=s(o,p.\u5317\u4EAC\u9526\u5174\u5F18\u660C\u79D1\u6280\u6709\u9650\u516C\u53F8.supplierSaleDay));const _=l(o,t),m=i(c(_,o),100);let f=l(u.msale_total,u.mth_total),h=l(u.mcgd_total,u.mcgd_th_total);a&&(f=s(f,p[a].supplierSaleMonth),h=s(h,p[a].supplierPurchMonth)),a==="\u5317\u4EAC\u666E\u6DA6\u5FC3\u5802\u5546\u8D38\u6709\u9650\u516C\u53F8"&&(f=s(f,p.\u5317\u4EAC\u9526\u5174\u5F18\u660C\u79D1\u6280\u6709\u9650\u516C\u53F8.supplierSaleMonth),h=s(h,p.\u5317\u4EAC\u9526\u5174\u5F18\u660C\u79D1\u6280\u6709\u9650\u516C\u53F8.supplierPurchMonth));const y=i(c(Number(f).toFixed(2),Number(u.total_tips).toFixed(2)),100),C=l(Number(f).toFixed(2),Number(h).toFixed(2)),g=i(c(Number(C).toFixed(2),Number(f).toFixed(2)),100);return{total_tips:u.total_tips,pure_day_purch:t,pure_month_purch:h,pure_day_interest_rate:m,depart:u.depart,pure_day_sale:o,pure_day_profit:_,pure_month_sale:f,month_completion_rate:y,pure_month_profit:C,pure_month_interest_rate:g}}),r=F(n);return r.depart="\u5408\u8BA1",r.month_completion_rate=i(c(r.pure_month_sale,r.total_tips),100),r.pure_month_interest_rate=i(c(r.pure_month_profit,Number(r.pure_month_sale).toFixed(2)),100),r.pure_day_interest_rate=i(c(r.pure_day_profit,Number(r.pure_day_sale).toFixed(2)),100),[...n,r]},columns:Q,apis:{httpList:e=>V({...e,companyNo:"GS2203161855277894"})}},X=[{label:"\u6708\u4EFD",prop:"month"},{label:"\u9500\u552E\u51C0\u989D",prop:"pure_sale",cellRenderer({row:e}){return d(e.pure_sale)}},{label:"\u9500\u552E\u6307\u6807",prop:"total_tips",cellRenderer({row:e}){return d(e.total_tips)}},{label:"\u6307\u6807\u8FBE\u6210\u7387",prop:"completion_rate",cellRenderer({row:e}){return Number(e.completion_rate||0).toFixed(2)+"%"}},{label:"\u6BDB\u5229\u6DA6",prop:"pure_profit",cellRenderer({row:e}){return d(e.pure_profit)}},{label:"\u6BDB\u5229\u7387",prop:"pure_interest_rate",cellRenderer({row:e}){return Number(e.pure_interest_rate||0).toFixed(2)+"%"}}],Z={title:"",superUserNoAction:!1,handleData(e=[]){const p=e.map(r=>{const u=l(r.sale_total,r.th_total),a=i(c(u,r.total_tips),100),o=l(r.cgd_total,r.cgd_th_total),t=l(u,o),_=i(c(t,u)||0,100);return{month:r.month,completion_rate:a,pure_interest_rate:_,pure_profit:t,pure_sale:u,pure_purch:o,total_tips:r.total_tips}}),n=F(p);return n.month="\u5E74\u5EA6\u5408\u8BA1",n.completion_rate=i(c(n.pure_sale,n.total_tips),100),n.pure_profit=l(n.pure_sale,n.pure_purch),n.pure_interest_rate=i(c(n.pure_profit,n.pure_sale),100),[...p,n]},columns:X,apis:{httpList:e=>v({...e,companyNo:"GS2203161855277894"})}},I={class:"bg-white"},ee={"w-full":"",flex:"","justify-end":"","p-2":""},te={class:"font-bold ml-[15px] pt-[10px]",style:{"font-size":"14px"}},ue="grossMargin",re=x({__name:"index",setup(e){const p=[{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"}],n=R(""),r=A(null),u=A([]),a=function(){let o=new Date,t=o.getFullYear(),_=o.getMonth()+1,m=o.getDate();return t+"-"+(_<10?"0"+_:_)+"-"+(m<10?"0"+m:m)};return n.value=a(),O(()=>n.value,o=>{[r.value,...u.value].forEach(t=>{if(!t)return;const _=t.getContent();!_||_.value.getPageData({daytime:o})})}),(o,t)=>{const _=M("ElDatePicker"),m=M("PageContainer"),f=M("PageAuth");return b(),k(f,{pageName:ue},{default:G(()=>[D("div",I,[D("div",ee,[E(_,{modelValue:n.value,"onUpdate:modelValue":t[0]||(t[0]=h=>n.value=h),"value-format":"YYYY-MM-DD",format:"YYYY-MM-DD",type:"date",placeholder:"\u9009\u62E9\u65E5\u671F",disabledDate:h=>h.getTime()>Date.now()},null,8,["modelValue","disabledDate"])]),t[1]||(t[1]=D("h2",{class:"font-bold ml-[15px] pt-[10px]",style:{"font-size":"16px"}}," \u5E73\u53F0\u7EF4\u5EA6 ",-1)),E(m,{ref_key:"singleDashBoardRef",ref:r,contentConfig:N(W)},null,8,["contentConfig"]),E(m,{contentConfig:N(Z)},null,8,["contentConfig"]),t[2]||(t[2]=D("h2",{class:"font-bold ml-[15px] pt-[10px]",style:{"font-size":"16px"}}," \u516C\u53F8\u7EF4\u5EA6 ",-1)),(b(),T(L,null,Y(p,(h,y)=>D("div",{key:h.companyNo},[D("h2",te,S(y+1)+". "+S(h.companyName),1),E(m,{ref_for:!0,ref_key:"dashboardRef",ref:u,contentConfig:N(q)(h.companyNo)},null,8,["contentConfig"]),E(m,{contentConfig:N(J)(h.companyNo)},null,8,["contentConfig"])])),64))])]),_:1})}}});var le=P(re,[["__file","C:/Users/89793/Desktop/projects/ticket-system/src/views/dashboard/grossMargin/index.vue"]]);export{le as default};
|