1 |
- import{_ as S,d as x,cl as R,m as A,w as O,r as N,o as b,A as k,x as T,b as D,h as E,u as M,c as L,F as Y,y as G,G as P}from"./index.56449854.js";import{h as U,a as v,b as w,c as V}from"./index.6fac7be7.js";import{a as s,s as l,m as i,d as c,c as F,u as m}from"./calc.f00124e1.js";const $=[{label:"\u4E1A\u7EE9\u7C7B\u578B",prop:"field"},{label:"\u672C\u65E5\u9500\u552E\u51C0\u989D",prop:"pure_day_sale",cellRenderer({row:e}){return m(e.pure_day_sale)}},{label:"\u672C\u65E5\u6BDB\u5229\u6DA6",prop:"pure_day_profit",cellRenderer({row:e}){return m(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 m(e.pure_month_sale)}},{label:"\u672C\u6708\u9500\u552E\u6307\u6807",prop:"total_tips",cellRenderer({row:e}){return e.total_tips==="--"?"--":m(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 m(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{responseCode:0,superUserNoAction:!1,handleData(p=[]){const n=p.reduce((a,t)=>({supplierSaleDay:s(a.supplierSaleDay,l(t.dayinfo[2].sale_total,t.dayinfo[2].th_total)),supplierSaleMonth:s(a.supplierSaleMonth,l(t.monthinfo[2].msale_total,t.monthinfo[2].mth_total)),supplierPurchDay:s(a.supplierPurchDay,l(t.dayinfo[2].cgd_total,t.dayinfo[2].cgd_th_total)),supplierPurchMonth:s(a.supplierPurchMonth,l(t.monthinfo[2].mcgd_total,t.monthinfo[2].mcgd_th_total)),selfOperatedSaleDay:s(a.selfOperatedSaleDay,l(t.dayinfo[0].sale_total,t.dayinfo[0].th_total)),selfOperatedSaleMonth:s(a.selfOperatedSaleMonth,l(t.monthinfo[0].msale_total,t.monthinfo[0].mth_total)),selfOperatedPurchDay:s(a.selfOperatedPurchDay,l(t.dayinfo[0].cgd_total,t.dayinfo[0].cgd_th_total)),selfOperatedPurchMonth:s(a.selfOperatedPurchMonth,l(t.monthinfo[0].mcgd_total,t.monthinfo[0].mcgd_th_total)),channelSaleDay:s(a.channelSaleDay,l(t.dayinfo[1].sale_total,t.dayinfo[1].th_total)),channelSaleMonth:s(a.channelSaleMonth,l(t.monthinfo[1].msale_total,t.monthinfo[1].mth_total)),channelPurchDay:s(a.channelPurchDay,l(t.dayinfo[1].cgd_total,t.dayinfo[1].cgd_th_total)),channelPurchMonth:s(a.channelPurchMonth,l(t.monthinfo[1].mcgd_total,t.monthinfo[1].mcgd_th_total)),totalTips:s(a.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(a=>{const t=z[a];if(!t)return{field:a,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],d=n[t.purchDay],f=l(_,d),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:a,total_tips:"--",pure_day_sale:_,pure_day_purch:d,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 o=F([r[2],r[3]]);return o.field="\u5408\u8BA1",o.total_tips=n.totalTips,o.pure_month_interest_rate=i(c(o.pure_month_profit,o.pure_month_sale),100),o.pure_day_interest_rate=i(c(o.pure_day_profit,o.pure_day_sale),100),o.month_completion_rate=i(c(o.pure_month_sale,o.total_tips),100),Number(o.pure_day_sale)<0&&(o.pure_day_interest_rate=0),Number(o.pure_month_sale)<0&&(o.pure_month_interest_rate=0),r[4]=o,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 m(e.pure_sale)}},{label:"\u9500\u552E\u6307\u6807",prop:"total_tips",cellRenderer({row:e}){return m(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 m(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{responseCode:0,superUserNoAction:!1,handleData(p=[]){const n=p.map(u=>{const o=l(u.sale_total,u.th_total),a=i(c(o,u.total_tips),100),t=l(u.cgd_total,u.cgd_th_total),_=l(o,t);let d=i(c(_,o)||0,100);return Number(o)<0&&(d=0),{month:u.month,completion_rate:a,pure_interest_rate:d,pure_profit:_,pure_sale:o,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:()=>v({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 m(e.pure_day_sale)}},{label:"\u672C\u65E5\u6BDB\u5229\u6DA6",prop:"pure_day_profit",cellRenderer({row:e}){return m(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 m(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 m(e.total_tips)}},{label:"\u672C\u6708\u6BDB\u5229\u6DA6",prop:"pure_month_profit",cellRenderer({row:e}){return m(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={responseCode:0,superUserNoAction:!1,handleData(e=[]){const p=[].reduce((u,o)=>({...u,[o.companyName]:{supplierSaleDay:0,supplierSaleMonth:0,supplierPurchDay:0,supplierPurchMonth:0}}),{}),n=e.map(u=>{const o=Object.keys(p).find(B=>B.includes(u.depart));let a=l(u.sale_total,u.th_total),t=l(u.cgd_total,u.cgd_th_total);o&&(t=s(t,p[o].supplierPurchDay),a=s(a,p[o].supplierSaleDay)),o==="\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),a=s(a,p.\u5317\u4EAC\u9526\u5174\u5F18\u660C\u79D1\u6280\u6709\u9650\u516C\u53F8.supplierSaleDay));const _=l(a,t),d=i(c(_,a),100);let f=l(u.msale_total,u.mth_total),h=l(u.mcgd_total,u.mcgd_th_total);o&&(f=s(f,p[o].supplierSaleMonth),h=s(h,p[o].supplierPurchMonth)),o==="\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:d,depart:u.depart,pure_day_sale:a,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:w}},X=[{label:"\u6708\u4EFD",prop:"month"},{label:"\u9500\u552E\u51C0\u989D",prop:"pure_sale",cellRenderer({row:e}){return m(e.pure_sale)}},{label:"\u9500\u552E\u6307\u6807",prop:"total_tips",cellRenderer({row:e}){return m(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 m(e.pure_profit)}},{label:"\u6BDB\u5229\u7387",prop:"pure_interest_rate",cellRenderer({row:e}){return Number(e.pure_interest_rate||0).toFixed(2)+"%"}}],Z={responseCode:0,superUserNoAction:!1,handleData(e=[]){const p=e.map(r=>{const u=l(r.sale_total,r.th_total),o=i(c(u,r.total_tips),100),a=l(r.cgd_total,r.cgd_th_total),t=l(u,a),_=i(c(t,u)||0,100);return{month:r.month,completion_rate:o,pure_interest_rate:_,pure_profit:t,pure_sale:u,pure_purch:a,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:V}},I={class:"bg-white"},ee={"w-full":"",flex:"","justify-end":"","p-2":""},te=D("h2",{class:"font-bold ml-[15px] pt-[10px]",style:{"font-size":"16px"}}," \u5E73\u53F0\u7EF4\u5EA6 ",-1),ue=D("h2",{class:"font-bold ml-[15px] pt-[10px]",style:{"font-size":"16px"}}," \u516C\u53F8\u7EF4\u5EA6 ",-1),re={class:"font-bold ml-[15px] pt-[10px]",style:{"font-size":"14px"}},oe="grossMargin",ae=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([]),o=function(){let a=new Date,t=a.getFullYear(),_=a.getMonth()+1,d=a.getDate();return t+"-"+(_<10?"0"+_:_)+"-"+(d<10?"0"+d:d)};return n.value=o(),O(()=>n.value,a=>{[r.value,...u.value].forEach(t=>{if(!t)return;const _=t.getContent();!_||_.value.getPageData({daytime:a})})}),(a,t)=>{const _=N("ElDatePicker"),d=N("PageContainer"),f=N("PageAuth");return b(),k(f,{pageName:oe},{default:T(()=>[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"])]),te,E(d,{ref_key:"singleDashBoardRef",ref:r,contentConfig:M(W)},null,8,["contentConfig"]),E(d,{contentConfig:M(Z)},null,8,["contentConfig"]),ue,(b(),L(Y,null,G(p,(h,y)=>D("div",{key:h.companyNo},[D("h2",re,P(y+1)+". "+P(h.companyName),1),E(d,{ref_for:!0,ref_key:"dashboardRef",ref:u,contentConfig:M(q)(h.companyNo)},null,8,["contentConfig"]),E(d,{contentConfig:M(J)(h.companyNo)},null,8,["contentConfig"])])),64))])]),_:1})}}});var _e=S(ae,[["__file","C:/Users/89793/Desktop/projects/report-v3/src/views/dashboard/grossMargin/index.vue"]]);export{_e as default};
|