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