1 |
- (window.webpackJsonp=window.webpackJsonp||[]).push([["app"],{0:function(t,e,n){n("db4d"),t.exports=n("56d7")},"0b36":function(t,e,n){"use strict";n("bd24")},"0bee":function(t,e,n){"use strict";n("60d3")},"10b5":function(t,e,n){"use strict";n("196c")},"196c":function(t,e,n){},"1af2":function(t,e,n){},"1f39":function(t,e,n){"use strict";n("945a")},"2c46":function(t,e,n){},"2ea5":function(t,e,n){"use strict";n("c406")},3008:function(t,e,n){"use strict";n("ff67")},"32e0":function(t,e,n){},4306:function(t,e,n){},"43da":function(t,e,n){},"49c8":function(t,e,n){},"4bba":function(t,e,n){"use strict";n("83ac")},"4ffd":function(t,e,n){"use strict";n("7db1")},5011:function(t,e,n){"use strict";n("b3b9")},5037:function(t,e,n){},5139:function(t,e,n){"use strict";n("2c46")},"56d7":function(t,e,n){"use strict";n.r(e);var a={},o=(e=(n.r(a),n.d(a,"toThousandFilter",(function(){return i})),n("d25f"),n("456d"),n("ac6a"),n("f3e2"),n("7f7f"),n("cadf"),n("551c"),n("f751"),n("097d"),{name:"App"}),n("2877")),r=Object(o.a)(e,(function(){var t=this.$createElement;return(this._self._c||t)("router-view")}),[],!1,null,null,null).exports;function i(t){return"-"===t?"":(+t||0).toString().replace(/^-?\d+/g,(function(t){return t.replace(/(?=(?!\b)(\d{3})+$)/g,",")}))}n("6b54"),n("87b3"),n("a481"),n("1c01"),n("58b2"),n("8e6e");var s=n("2909"),l=(n("0cd8"),n("6762"),n("2fdb"),n("c5f6"),n("ade3")),c=(n("96cf"),n("1da1")),u={},p=(window.ajaxTimeout=5e4,Object(c.a)(regeneratorRuntime.mark((function t(){var e,n,a,o,r,i,s,l=arguments;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=0<l.length&&void 0!==l[0]?l[0]:"",n=1<l.length&&void 0!==l[1]?l[1]:{},a=2<l.length&&void 0!==l[2]?l[2]:"GET",o=3<l.length&&void 0!==l[3]?l[3]:{},r=4<l.length&&void 0!==l[4]?l[4]:u,i=5<l.length?l[5]:void 0,a=a.toLowerCase(),s={method:a,baseURL:"",url:e,data:n,params:o,timeout:window.ajaxTimeout,headers:r,onUploadProgress:i},i&&"function"==typeof i&&(s.onUploadProgress=i),axios.interceptors.request.use((function(t){return t}),(function(t){return Promise.reject(new Error("服务器异常,请联系管理员!"))})),axios.interceptors.response.use((function(t){return t}),(function(t){return Promise.reject(t.response.data)})),t.abrupt("return",new Promise((function(t,e){axios(s).then((function(e){t(e.data)})).catch((function(t){e(t)}))})));case 12:case"end":return t.stop()}}),t)})))),d=n("f121"),m=n.n(d),h="http://rep.report.caixiao365.com/admin/Everyday/",f=function(t,e){return p(h+"YsStat",t,"post",e)},_=function(t,e){return p(h+"departEveryDay",t,"post",e)},y=function(t,e){return p(h+"departEveryMonth",t,"post",e)},b=function(t,e){return p(h+"companyEvery",t,"post",e)},g=function(t,e){return p(h+"companyEveryMonth",t,"post",e)},v=function(t,e){return p(d.reportApi+"admin/wechat_getinfo",t,"post",e)},w=(e={methods:{getHeight:function(){var t=document.body.offsetHeight;this.maxHeight=t-90+""}}},n("3b2b"),"WECHAT_OPENID");function x(t){window.sessionStorage.setItem(w,t||"")}function T(){return window.sessionStorage.getItem(w)||""}function N(){window.sessionStorage.removeItem(w)}function O(t){var e=window.location.href;return t=t.replace(/[\[\]]/g,"\\$&"),t=new RegExp("[?&]"+t+"(=([^&#]*)|&|#|$)").exec(e),t?t[2]?decodeURIComponent(t[2].replace(/\+/g," ")):"":null}var S={name:"UnusualState",props:["message","path","hasPermission"],methods:{toNav:function(){window.location.href="/"},toLogin:function(){this.$router.push("/login"+(this.path?"?path=".concat(this.path):""))}}};S=Object(o.a)(S,(function(){var t=this,e=t.$createElement;e=t._self._c||e;return e("div",[e("el-empty",{attrs:{description:t.hasPermission?t.message:"您没有访问权限,请联系管理员",image:"/static/warning.png"}},[e("template",{slot:"description"},["未获取到用户数据"!==t.message?e("div",[e("p",{staticStyle:{"font-size":"16px"}},[t._v("未通过公众号授权")]),e("p",{staticStyle:{"font-size":"16px"}},[t._v("请联系系统管理员")])]):e("div",[e("p",{staticStyle:{"font-size":"16px"}},[t._v("登录已失效")]),e("p",{staticStyle:{"font-size":"16px"}},[t._v("请返回数据导航重新进入")])])]),e("div",{staticStyle:{display:"flex",gap:"10px"}},[e("el-button",{attrs:{size:"mini",type:""},on:{click:t.toNav}},[t._v("返回数据导航")])],1)],2)],1)}),[],!1,null,null,null).exports;function j(t,e){var n,a=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,n)),a}function D(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?j(Object(n),!0).forEach((function(e){Object(l.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):j(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function k(t){return C[String(t)]}n("ee1d"),n("28a5");var C={"泓源":"泓源广诚","普润":"普润心堂","百辰":"百辰荣达","平台":"平台部"},P={"泓源":"泓源广诚","普润":"普润心堂&锦兴弘昌","百辰":"百辰荣达","平台":"平台部"};function R(t,e){var n,a;try{n=t.toString().split(".")[1].length}catch(t){n=0}try{a=e.toString().split(".")[1].length}catch(t){a=0}return(t*(t=Math.pow(10,Math.max(n,a)))+e*t)/t}function F(t,e){var n=0,a=0;try{n=t.toString().split(".")[1].length}catch(t){}try{a=e.toString().split(".")[1].length}catch(t){}return E(Number(t.toString().replace(".",""))/Number(e.toString().replace(".","")),Math.pow(10,a-n))}function E(t,e){var n=0;t=t.toString(),e=e.toString();try{n+=t.split(".")[1].length}catch(t){}try{n+=e.split(".")[1].length}catch(t){}return Number(t.replace(".",""))*Number(e.replace(".",""))/Math.pow(10,n)}function M(t,e){var n,a;try{n=t.toString().split(".")[1].length}catch(t){n=0}try{a=e.toString().split(".")[1].length}catch(t){a=0}return((t*(t=Math.pow(10,Math.max(n,a)))-e*t)/t).toFixed(a<=n?n:a)}function A(t){return Number.isNaN(t)||"NaN"===t||0===Number(t)?"0":t<1e3&&0<t||t<0&&-1e3<t||"--"===t?Number(t).toFixed(2):F(t,1e4).toFixed(2)+"W"}function z(t){var e=Object.keys(t[0]);return t.reduce((function(t,n){return e.reduce((function(e,a){return D(D({},e),{},Object(l.a)({},a,R(t[a]||0,n[a])))}),{})}),{})}function I(t,e){var n,a=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,n)),a}function q(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?I(Object(n),!0).forEach((function(e){Object(l.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):I(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var L,$,H,U={name:"WanyuTypeReport",props:["date"],mixins:[e],components:{UnusualState:S},watch:{date:function(t){(this.dataTime=t)&&this.searchList()}},data:function(){return{isShow:!1,total:{day:0,month:0,total_tips:0},state:{error:!1,loading:!1,message:""},mapResponseCompletionCompanyName:P,dataTime:this.date,loading:!1,maxHeight:"0",tableData:[]}},created:(H=Object(c.a)(regeneratorRuntime.mark((function t(){var e=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:document.title="3.应收账款",window.onresize=function(){e.getHeight()};case 2:case"end":return t.stop()}}),t)}))),function(){return H.apply(this,arguments)}),mounted:function(){O("code")?this.requestUserinfo():this.login()},methods:{requestUserinfo:($=Object(c.a)(regeneratorRuntime.mark((function t(){var e,n,a,o=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.state.loading=!0,e=T(),n=O("code"),t.next=5,v(q({},e?{openid:e}:{code:n}));case 5:a=t.sent,this.state.loading=!1,t.t0=Number(a.code),t.next=0===t.t0?10:15;break;case 10:return this.isShow=(a.data.is_show||[]).includes(3)||(a.data.is_show||[]).includes("3"),this.$nextTick((function(){return o.getHeight()})),this.searchList(),x(a.data.openid),t.abrupt("break",19);case 15:return this.state.error=!0,this.state.message=a.message,e&&N(),t.abrupt("break",19);case 19:case"end":return t.stop()}}),t,this)}))),function(){return $.apply(this,arguments)}),getCompanyLabel:k,unit2TenThousand:A,objectSpanMethod:function(t){t.row,t.column;var e=t.rowIndex;if(0===t.columnIndex)return e%2==0?{rowspan:2,colspan:1}:{rowspan:0,colspan:0}},login:function(){var t=encodeURIComponent("http://stat.caixiao365.com/accountsReceivable"),e="wx_"+Math.random().toString(36).substr(2,15);t="https://open.weixin.qq.com/connect/oauth2/authorize?appid=".concat(config.appId,"&redirect_uri=").concat(t,"&response_type=code&scope=").concat("snsapi_userinfo","&state=").concat(e,"#wechat_redirect");window.location.href=t},searchList:(L=Object(c.a)(regeneratorRuntime.mark((function t(){var e,n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.loading=!0,this.tableData=[],t.next=4,f({daytime:this.date});case 4:0===(n=t.sent).code&&n.data&&0<n.data.length?(e=n.data,n=n.data.reduce((function(t,e){return Object.keys(e).reduce((function(t,n){return q(q({},t),{},Object(l.a)({},n,"depart"!==n?R(e[n]||0,t[n]||0):"总计"))}),t)}),{}),this.tableData=[].concat(Object(s.a)(e),[n])):this.tableData=[],this.getHeight(),this.loading=!1;case 8:case"end":return t.stop()}}),t,this)}))),function(){return L.apply(this,arguments)})}},Y=(U=(n("76db"),Object(o.a)(U,(function(){var t=this,e=t.$createElement;e=t._self._c||e;return e("div",{staticClass:"SalesReportRejectedNew",staticStyle:{"min-height":"300px"}},[!t.state.error&&t.isShow?e("div",[e("div",{staticClass:"table-header",staticStyle:{"line-height":"36px"}},[t._v("万宇应收账款报表看板")]),e("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{"max-height":t.maxHeight,data:t.tableData,size:"mini","row-key":"id",border:"",stripe:""}},[e("el-table-column",{attrs:{label:"业务公司",fixed:"left",width:"80",prop:"depart"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(e.row.depart.split("@")[1]||"总计"))]}}],null,!1,1754978939)}),e("el-table-column",{attrs:{label:"应收账款",prop:"wpay_fee",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.unit2TenThousand(e.row.wpay_fee))+"\n ")]}}],null,!1,3138572239)}),e("el-table-column",{attrs:{label:"已开票",prop:"ainv_fee",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.unit2TenThousand(e.row.ainv_fee))+"\n ")]}}],null,!1,118869792)}),e("el-table-column",{attrs:{label:"已回款",prop:"apay_fee",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.unit2TenThousand(e.row.apay_fee))+"\n ")]}}],null,!1,3390931897)}),e("el-table-column",{attrs:{label:"已开票-已回款",prop:"ainv_apay_fee",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.unit2TenThousand(e.row.ainv_apay_fee))+"\n ")]}}],null,!1,1087802902)}),e("el-table-column",{attrs:{label:"未开票",prop:"winv_fee",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.unit2TenThousand(e.row.winv_fee))+"\n ")]}}],null,!1,3967471286)}),e("el-table-column",{attrs:{label:"待开票",prop:"inv_fee",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.unit2TenThousand(e.row.inv_fee))+"\n ")]}}],null,!1,3438521025)}),e("el-table-column",{attrs:{label:"已发货未开票",prop:"winv_asend_fee",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.unit2TenThousand(e.row.winv_asend_fee))+"\n ")]}}],null,!1,3643196372)}),e("el-table-column",{attrs:{label:"未发货",prop:"wpay_send_fee",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.unit2TenThousand(e.row.wpay_send_fee))+"\n ")]}}],null,!1,4285740716)}),e("el-table-column",{attrs:{label:"超60天已发货未开票",prop:"winv_two_month",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.unit2TenThousand(e.row.winv_two_month))+"\n ")]}}],null,!1,3721957747)}),e("el-table-column",{attrs:{label:"超180天应收账款",prop:"wpay_six_month",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.unit2TenThousand(e.row.wpay_six_month))+"\n ")]}}],null,!1,2567968292)})],1)],1):t.state.loading?t._e():[e("unusual-state",{attrs:{hasPermission:t.isShow,message:t.state.message,path:"accountsReceivable"}})]],2)}),[],!1,null,"abb32cf4",null).exports),n("ac4d"),n("8a81"),n("5df3"),n("1c4c"),n("2caf"),n("7514"),n("78ce"),"report/Stats/"),G=function(t,e){return p(d.newReportApi+Y+"zxorder",t,"post",e)},V=function(t,e){return p(d.newReportApi+Y+"saleOrder",t,"post",e)},Q=function(t,e){return p(d.newReportApi+Y+"bkOrder",t,"post",e)},B=function(t,e){return p(d.newReportApi+Y+"cgdOrder",t,"post",e)},W=function(t,e){return p(d.newReportApi+Y+"bidsOrder",t,"post",e)},K=function(t,e){return p(d.newReportApi+Y+"bidsFail",t,"post",e)},Z=function(t,e){return p(d.newReportApi+"admin/salestock",t,"post",e)},J=function(t,e){return p(d.newReportApi+Y+"outChildOrder",t,"post",e)},X=function(t,e){return p(d.newReportApi+Y+"outOrder",t,"post",e)},tt=function(t,e){return p(d.newReportApi+Y+"wsendOrder",t,"post",e)},et=function(t,e){return p(d.newReportApi+Y+"outChildStock",t,"post",e)},nt=n("5a0c"),at=n.n(nt);function ot(t,e){var n,a;try{n=t.toString().split(".")[1].length}catch(t){n=0}try{a=e.toString().split(".")[1].length}catch(t){a=0}return(t*(t=Math.pow(10,Math.max(n,a)))+e*t)/t}function rt(t,e){var n=0,a=0;try{n=t.toString().split(".")[1].length}catch(t){}try{a=e.toString().split(".")[1].length}catch(t){}return it(Number(t.toString().replace(".",""))/Number(e.toString().replace(".","")),Math.pow(10,a-n))}function it(t,e){var n=0;t=t.toString(),e=e.toString();try{n+=t.split(".")[1].length}catch(t){}try{n+=e.split(".")[1].length}catch(t){}return Number(t.replace(".",""))*Number(e.replace(".",""))/Math.pow(10,n)}function st(t,e){var n,a;try{n=t.toString().split(".")[1].length}catch(t){n=0}try{a=e.toString().split(".")[1].length}catch(t){a=0}return((t*(t=Math.pow(10,Math.max(n,a)))-e*t)/t).toFixed(a<=n?n:a)}function lt(t){var e=!(1<arguments.length&&void 0!==arguments[1])||arguments[1];return"--"===t?"--":"-"===t?"-":NaN===t||"NaN"===t||0===Number(t)||void 0===t?"0":e?t<1e3&&0<t||t<0&&-1e3<t?Number(t).toFixed(2):rt(t,1e4).toFixed(2)+"W":t}function ct(t){var e=!(1<arguments.length&&void 0!==arguments[1])||arguments[1];return NaN===t||"NaN"===t||0===Number(t)?"0":e?(t<1e3&&0<t||t<0&&-1e3<t?Number(t):rt(t,1e4)).toFixed(2):t}function ut(t,e){var n,a=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,n)),a}function pt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ut(Object(n),!0).forEach((function(e){Object(l.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ut(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function dt(t,e){var n,a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=function(t,e){if(t){if("string"==typeof t)return mt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(n="Object"===n&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?mt(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length)return a&&(t=a),n=0,{s:e=function(){},n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:e};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,r=!0,i=!1;return{s:function(){a=a.call(t)},n:function(){var t=a.next();return r=t.done,t},e:function(t){i=!0,o=t},f:function(){try{r||null==a.return||a.return()}finally{if(i)throw o}}}}function mt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,a=new Array(e);n<e;n++)a[n]=t[n];return a}function ht(t){return NaN===t||"NaN"===t||0===Number(t)?"0":t<1e3&&0<t||t<0&&-1e3<t?t:rt(t,1e4).toFixed(2)+"W"}window.multiplication=it,window.division=rt;var ft,_t;nt={name:"Consult",mixins:[e],props:["title"],watch:{date:function(t){(this.dataTime=t)&&2===t.length&&this.searchList()}},data:function(){return{pickerOptions:{disabledDate:function(t){return t.getTime()>Date.now()}},tableData:[],date:"",year:"",months:["1","2","3","4","5","6","7","8","9","10","11","12"],loading:!1,statusOptions:[{id:"0",label:"待发货"},{id:"1",label:"待发货完成"},{id:"2",label:"发货已完成"},{id:"3",label:"订单已取消"}]}},created:(_t=Object(c.a)(regeneratorRuntime.mark((function t(){var e=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.handleChange(at()(new Date).format("YYYY")),window.onresize=function(){e.getHeight()};case 2:case"end":return t.stop()}}),t,this)}))),function(){return _t.apply(this,arguments)}),mounted:function(){var t=this;this.$nextTick((function(){t.getHeight()}))},methods:{getStatus:function(t){var e=Object.keys(t.result).find((function(e){return t.result[e]&&t.result[e][1]&&t.result[e][1].send_status}));return e&&(this.statusOptions.find((function(n){return n.id===t.result[e][1].send_status}))||{}).label||"--"},handleChange:function(t){t?(t=at()(t).format("YYYY"),this.year=t,this.searchList()):this.$message.warning("请选择年份!")},getSpanNumber:function(t,e){var n=Array.isArray(t)?t.length:0;if(0<n){for(var a=0,o=t[0][e],r=[1],i=1;i<n;i++)t[i][e]==o?(r[a]+=1,r[i]=0):(r[a=i]=1,o=t[i][e]);return r}return[0]},objectSpanMethod:function(t){t.row,t.column;var e=t.rowIndex;if(0==t.columnIndex)return{rowspan:this.getSpanNumber(this.tableData,"name")[e],colspan:1}},getTotal:function(t,e){return e?(e=this.months.reduce((function(e,n){return ot(e,t.result[n]?t.result[n].total_price:0)}),0),0===Number(e)?"0元":ht(e)+"元"):this.months.reduce((function(e,n){return ot(e,((t.result[n]||{})[1]||{}).num||0)}),0)},getField:function(t,e,n){return Array.isArray(e.result[t])||"status"===t?0:n?(n=e.result[t].total_price,0===Number(n)?"0元":ht(n)+"元"):((e.result[t]||{})[1]||{}).num||0},searchList:(ft=Object(c.a)(regeneratorRuntime.mark((function t(){var e,n,a,o,r,i,c,u=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.loading=!0,this.tableData=[],t.next=4,tt({start_y:this.year});case 4:if(0===(e=t.sent).code&&e.data){c=Object.keys(e.data.result).reduce((function(t,n){return[].concat(Object(s.a)(t),[e.data.result[n]])}),[]),this.tableData=c,n=e.data.noAddr,a=[],o=dt(c);try{for(i=function(){for(var t=r.value||{},e=t.name,n=t.result,o=0;o<2;o++)!function(t){a.push({name:e,result:Object.keys(n).reduce((function(e,a){return pt(pt({},e),{},Object(l.a)({status:0===t?"待发货":"待发货完成"},a,{1:Array.isArray(n[a])?{num:0,send_status:null}:{num:n[a][t+1]?n[a][t+1].num:0,send_status:n[a][t+1]?n[a][t+1].send_status:null}}))}),{})})}(o)},o.s();!(r=o.n()).done;)i()}catch(t){o.e(t)}finally{o.f()}this.tableData=a.reduce((function(t,e){return[].concat(Object(s.a)(t),[{name:e.name,result:u.months.reduce((function(t,n){return pt(pt({},t),{},Object(l.a)({status:e.result.status||"--"},n,{1:e.result[n]&&e.result[n][1]?pt({},e.result[n][1]):{num:0,send_status:null},2:e.result[n]&&e.result[n][2]?pt({},e.result[n][2]):{num:0,send_status:null}}))}),{})}])}),[]),c=this.months.reduce((function(t,e){return pt(pt({},t),{},Object(l.a)({},e,{1:{num:0}}))}),{}),(c={name:"合计",result:this.tableData.reduce((function(t,e){var n=e.result;return u.months.reduce((function(e,a){var o=(!Array.isArray(n[a])&&n[a][1]||{num:0}).num;o=ot(t[a][1].num,o);return pt(pt({},e),{},Object(l.a)({},a,{1:{num:o}}))}),{})}),pt({},c))}).result.status="--",this.tableData.push(c),n.name="无地址订单总金额",n.result=this.months.reduce((function(t,e){return pt(pt({},t),{},Object(l.a)({},e,{total_price:n.result[e]&&n.result[e].total_price?n.result[e].total_price:0}))}),{}),n.result.status="--",this.tableData.push(n)}else this.tableData=[];this.getHeight(),this.loading=!1;case 8:case"end":return t.stop()}}),t,this)}))),function(){return ft.apply(this,arguments)})}},nt=Object(o.a)(nt,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"SalesReportRejectedNew"},[n("div",{staticClass:"picker-title",staticStyle:{display:"flex","align-items":"center","justify-content":"space-between",margin:"10px 0px"}},[n("p",{staticStyle:{margin:"0"}},[t._v(t._s(t.title))]),n("el-date-picker",{staticStyle:{width:"150px"},attrs:{pickerOptions:t.pickerOptions,size:"mini",type:"year",placeholder:"选择年份"},on:{change:t.handleChange},model:{value:t.year,callback:function(e){t.year=e},expression:"year"}})],1),n("el-table",{attrs:{data:t.tableData,size:"mini",border:"","span-method":t.objectSpanMethod}},[n("el-table-column",{attrs:{width:"120px",label:"申请人所属部门",prop:"name"}}),n("el-table-column",{attrs:{label:"订单状态",width:"110px"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.result.status)+"\n ")]}}])}),t.months?n("el-table-column",{attrs:{label:"下单月份",align:"center"}},t._l(t.months,(function(e){return n("el-table-column",{key:e,attrs:{label:1<e.length?e:"0"+e,"min-width":"100px"},scopedSlots:t._u([{key:"default",fn:function(n){return[t._v("\n "+t._s(t.getField(e,n.row,"无地址订单总金额"===n.row.name))+"\n ")]}}],null,!0)})})),1):t._e(),n("el-table-column",{attrs:{label:"总计",width:"110px"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.getTotal(e.row,"无地址订单总金额"===e.row.name))+"\n ")]}}])})],1)],1)}),[],!1,null,null,null).exports;function yt(t,e){var n,a=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,n)),a}n("6d67");var bt,gt,vt,wt,xt={name:"Consult",mixins:[e],props:["date"],watch:{date:function(t){(this.dataTime=t)&&2===t.length&&this.searchList()}},computed:{total:function(){return this.tableData&&0!==this.tableData.length?this.tableData.reduce((function(t,e){return ot(t,e.num||0)}),0):0}},data:function(){return{loading:!1,tableData:[],zxTotal:0}},created:(gt=Object(c.a)(regeneratorRuntime.mark((function t(){var e=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:window.onresize=function(){e.getHeight()};case 1:case"end":return t.stop()}}),t)}))),function(){return gt.apply(this,arguments)}),mounted:function(){var t=this;this.$nextTick((function(){t.getHeight()})),this.searchList()},methods:{getParticipation:function(t){return 0===Number(t)&&0===Number(this.zxTotal)?"0%":it(rt(t,this.zxTotal),100).toFixed(2)+"%"},searchList:(bt=Object(c.a)(regeneratorRuntime.mark((function t(){var e;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.loading=!0,this.tableData=[],t.next=4,W({start:this.date[0]||"",end:this.date[1]||""});case 4:0===(e=t.sent).code&&e.data&&0<e.data.length?(this.tableData=e.data.reduce((function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{name:"",result:{}};return[].concat(Object(s.a)(t),Object(s.a)(Object.keys(e.result).map((function(t){return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?yt(Object(n),!0).forEach((function(e){Object(l.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):yt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({name:e.name},e.result[t])}))))}),[]),e=this.tableData.pop(),e=e.num,this.$emit("getZXTotal",e),this.zxTotal=e):this.tableData=[],this.getHeight(),this.loading=!1;case 8:case"end":return t.stop()}}),t,this)}))),function(){return bt.apply(this,arguments)})}},Tt=(xt=Object(o.a)(xt,(function(){var t=this,e=t.$createElement;e=t._self._c||e;return e("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"SalesReportRejectedNew"},[e("el-table",{attrs:{data:t.tableData.concat([{creater:"合计",name:"--",num:t.total,participation:"--"}]),size:"mini",border:""}},[e("el-table-column",{attrs:{label:"采购员",prop:"creater",width:"120px"}}),e("el-table-column",{attrs:{label:"反馈单数",prop:"num"}}),e("el-table-column",{attrs:{label:"竞价参与度",prop:"participation",width:"120px"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.getParticipation(e.row.num))+"\n ")]}}])})],1)],1)}),[],!1,null,null,null).exports,{name:"Consult",mixins:[e],props:["date"],watch:{date:function(t){t&&2===t.length&&this.searchList()}},data:function(){return{tableData:[],loading:!1,statusOptions:[{id:"0",label:"待发布竞标"},{id:"1",label:"招标进行中"},{id:"2",label:"招标已结束"},{id:"3",label:"待选择商品"},{id:"4",label:"已选商品待下单"},{id:"5",label:"已成功转单"},{id:"6",label:"已取消转单"},{id:"7",label:"招标已暂停"},{id:"10086",label:"合计"}]}},created:(wt=Object(c.a)(regeneratorRuntime.mark((function t(){var e=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:window.onresize=function(){e.getHeight()};case 1:case"end":return t.stop()}}),t)}))),function(){return wt.apply(this,arguments)}),mounted:function(){var t=this;this.$nextTick((function(){t.getHeight()})),this.searchList()},methods:{searchList:(vt=Object(c.a)(regeneratorRuntime.mark((function t(){var e;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.loading=!0,this.tableData=[],t.next=4,K({start:this.date[0],end:this.date[1]});case 4:0===(e=t.sent).code&&e.data&&e.data.result?(this.tableData=Object.keys(e.data.result||{}).map((function(t){return t=e.data.result[t],{status:t.status,num:t.num}})),this.tableData.push({status:"10086",num:this.tableData.reduce((function(t,e){return ot(t,e.num)}),0)})):this.tableData=[],this.getHeight(),this.loading=!1;case 8:case"end":return t.stop()}}),t,this)}))),function(){return vt.apply(this,arguments)})}}),Nt=(Tt=Object(o.a)(Tt,(function(){var t=this,e=t.$createElement;e=t._self._c||e;return e("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"SalesReportRejectedNew"},[e("el-table",{attrs:{data:t.tableData,size:"mini",border:""}},[e("el-table-column",{attrs:{label:"空返订单状态"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s((t.statusOptions.find((function(t){return t=t.id,String(t)===e.row.status}))||{}).label||"--")+"\n ")]}}])}),e("el-table-column",{attrs:{label:"竞价单空返数量",prop:"num"}})],1)],1)}),[],!1,null,null,null).exports,n("15fd")),Ot=["name"];function St(t,e){var n,a=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,n)),a}function jt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?St(Object(n),!0).forEach((function(e){Object(l.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):St(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Dt,kt,Ct,Pt,Rt,Ft={name:"Consult",mixins:[e],props:["date","title"],watch:{date:function(t){(this.dataTime=t)&&2===t.length&&this.searchList()}},data:function(){return{loading:!1,tableData:[],day:"",pickerOptions:{disabledDate:function(t){return t.getTime()>Date.now()}}}},created:(kt=Object(c.a)(regeneratorRuntime.mark((function t(){var e=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:window.onresize=function(){e.getHeight()};case 1:case"end":return t.stop()}}),t)}))),function(){return kt.apply(this,arguments)}),mounted:function(){var t=this;this.handleChange(at()(new Date).format("YYYY-MM-DD")),this.$nextTick((function(){t.getHeight()}))},methods:{getType:function(t){return{"库存品":"库存商品","咨询采返":"反馈商品","非库存品":"非库存商品"}[t]||t},objectSpanMethod:function(t){t.row,t.column;var e=t.rowIndex;if(0==t.columnIndex)return{rowspan:this.getSpanNumber(this.tableData,"name")[e],colspan:1}},getSpanNumber:function(t,e){var n=Array.isArray(t)?t.length:0;if(0<n){for(var a=0,o=t[0][e],r=[1],i=1;i<n;i++)t[i][e]==o?(r[a]+=1,r[i]=0):(r[a=i]=1,o=t[i][e]);return r}return[0]},getTotal:function(t){return["1","2","3","4","5","6"].reduce((function(e,n){return ot(t[n],e)}),0)},handleChange:function(t){t?(t=at()(t).format("YYYY-MM-DD"),this.day=t,this.searchList()):this.$message.warning("请选择截止日期!")},searchList:(Dt=Object(c.a)(regeneratorRuntime.mark((function t(){var e,n,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.loading=!0,this.tableData=[],t.next=4,J({end:this.day});case 4:0===(e=t.sent).code&&e.data&&0<e.data.length?(n=[],Object.keys(e.data).forEach((function(t){t=e.data[t];var a=t.name,o=(t=t.result,void 0===t?{}:t);0===o.length?n.push({name:a,0:"--",1:0,2:0,3:0,4:0,5:0,6:0}):Object.keys(o).forEach((function(t){n.push(jt({name:a},o[t]))}))})),(a=jt({0:"--"},n.reduce((function(t,e){e.name;var n=Object(Nt.a)(e,Ot);return Object.keys(n).reduce((function(n,a){return jt(jt({},n),{},Object(l.a)({},a,ot(e[a]||0,t[a]||0)))}),{})}),{}))).name="合计",a[0]="--",n.push(a),this.tableData=n):this.tableData=[],this.getHeight(),this.loading=!1;case 8:case"end":return t.stop()}}),t,this)}))),function(){return Dt.apply(this,arguments)})}},Et=(Ft=Object(o.a)(Ft,(function(){var t=this,e=t.$createElement;e=t._self._c||e;return e("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"SalesReportRejectedNew"},[e("div",{staticClass:"picker-title",staticStyle:{display:"flex","align-items":"center","justify-content":"space-between",margin:"10px 0px"}},[e("p",{staticStyle:{margin:"0"}},[t._v(t._s(t.title))])]),e("el-table",{attrs:{data:t.tableData,size:"mini",border:"","span-method":t.objectSpanMethod}},[e("el-table-column",{attrs:{label:"部门",width:"70",prop:"name"}}),e("el-table-column",{attrs:{width:"90px",label:"商品类型",prop:"0"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t.getType(e.row[0])))]}}])}),e("el-table-column",{attrs:{label:"时效",align:"center"}},[e("el-table-column",{attrs:{label:"A24小时",prop:"1"}}),e("el-table-column",{attrs:{label:"B48小时",prop:"2"}}),e("el-table-column",{attrs:{label:"C3-7天内",prop:"3"}}),e("el-table-column",{attrs:{label:"D14天内",prop:"4"}}),e("el-table-column",{attrs:{label:"E30天内",prop:"5"}}),e("el-table-column",{attrs:{label:"F超30天",prop:"6"}})],1),e("el-table-column",{attrs:{label:"总计"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.getTotal(e.row))+"\n ")]}}])})],1)],1)}),[],!1,null,null,null).exports,{name:"PeriodDatePicker",props:["start","end","disabled","size","width","type","placeholder"],data:function(){var t=this;return{startTime:this.start,endTime:this.end,isEdit:this.disabled,pickerOptions1:{disabledDate:function(e){if(null!=t.endTime&&""!=t.endTime&&e)return e.getTime()>new Date(t.endTime).valueOf()}},pickerOptions2:{disabledDate:function(e){if(null!=t.startTime&&""!=t.startTime&&e)return e.getTime()<new Date(t.startTime).valueOf()}}}},watch:{disabled:function(t){this.isEdit=t},start:function(t){this.startTime=t},end:function(t){this.endTime=t}},mounted:function(){},methods:{timeChange:function(){""!==this.startTime&&null!==this.startTime&&""!==this.endTime&&null!==this.endTime?this.type+""!="1"||this.setType(365)?this.type+""!="2"||this.setType(90)?this.type+""!="3"||this.setType(30)?new Date(this.endTime).valueOf()<new Date(this.startTime).valueOf()?this.showMessage("结束时间不大于开始时间!"):this.timeReturned():this.showMessage("时间跨度不能超过30天!"):this.showMessage("时间跨度不能超过90天!"):this.showMessage("时间跨度不能超过一年!"):this.timeReturned()},timeReturned:function(){var t=null==this.startTime?"":this.startTime,e=null==this.endTime?"":this.endTime;t={startTime:""==t?"":this.transformTime(t),endTime:""==e?"":this.transformTime(e)};this.$emit("timeReturned",t)},transformTime:function(t){t=new Date(t);var e=t.getFullYear(),n=t.getMonth()+1;t=t.getDate();return e+"-"+(n<10?"0"+n:n)+"-"+(t<10?"0"+t:t)},showMessage:function(t){this.$message.error(t),this.startTime="",this.endTime="",this.timeReturned()},setType:function(t){var e=new Date(this.startTime).valueOf();return!(864e5*t<new Date(this.endTime).valueOf()-e)}}}),Mt=(Et=(n("a646"),Object(o.a)(Et,(function(){var t=this,e=t.$createElement;e=t._self._c||e;return e("div",{staticClass:"fl time"},[e("el-date-picker",{staticClass:"date-picker",staticStyle:{margin:"0"},style:{width:t.width},attrs:{type:"date",size:t.size,placeholder:(t.placeholder||"")+"开始日期","value-format":"yyyy-MM-dd","picker-options":t.pickerOptions1,editable:!1,clearable:!0,disabled:t.isEdit},on:{change:t.timeChange},model:{value:t.startTime,callback:function(e){t.startTime=e},expression:"startTime"}}),e("samp",{staticStyle:{padding:"0 3px",margin:"0"}},[t._v("至")]),e("el-date-picker",{staticClass:"date-picker",staticStyle:{margin:"0"},style:{width:t.width},attrs:{size:t.size,type:"date",placeholder:(t.placeholder||"")+"结束日期",disabled:t.isEdit,"picker-options":t.pickerOptions2,editable:!1,"value-format":"yyyy-MM-dd",clearable:!0},on:{change:t.timeChange},model:{value:t.endTime,callback:function(e){t.endTime=e},expression:"endTime"}})],1)}),[],!1,null,null,null).exports),{name:"PickerTitle",props:["title"],components:{PeriodDatePicker:Et},data:function(){return{date:[]}},mounted:function(){var t=at()(new Date).format("YYYY-MM-DD");this.date=[t+" 00:00:00",t+" 23:59:59"],this.$emit("refresh",this.date)},methods:{time:(Ct=Object(c.a)(regeneratorRuntime.mark((function t(e){var n,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=e.startTime,n=e.endTime,this.start=a||"",this.end=n||"",a=this.start,n=this.end,""!==a&&""===n||""===a&&""!==n)return this.$message.warning("时间区间不完整!"),this.date=[],t.abrupt("return");t.next=8;break;case 8:this.start&&this.end?this.date=[this.start+" 00:00:00",this.end+" 23:59:59"]:this.date=[this.start,this.end],(a=this.date.filter((function(t){return""!==t})))&&2===a.length&&this.$emit("refresh",a);case 11:case"end":return t.stop()}}),t,this)}))),function(t){return Ct.apply(this,arguments)})}}),At=(Mt=Object(o.a)(Mt,(function(){var t=this,e=t.$createElement;e=t._self._c||e;return e("div",{staticClass:"picker-title",staticStyle:{width:"100%",margin:"10px 0px"}},[e("el-row",[e("el-col",{attrs:{xs:24,sm:12,md:12,lg:12,xl:12}},[e("p",{staticStyle:{margin:"0"}},[t._v(t._s(t.title))])]),e("el-col",{staticStyle:{display:"flex","justify-content":"flex-end"},attrs:{xs:24,sm:12,md:12,lg:12,xl:12}},[e("period-date-picker",{attrs:{start:t.date[0],end:t.date[1],size:"mini",width:"125px"},on:{timeReturned:function(e){return t.time(e)}}})],1)],1)],1)}),[],!1,null,null,null).exports,{name:"Consult",mixins:[e],components:{DatePickerTitle:Mt},props:["date","title"],watch:{date:function(t){(this.dataTime=t)&&2===t.length&&this.searchList()}},data:function(){return{loading:!1,tableData:[],date:[]}},created:(Rt=Object(c.a)(regeneratorRuntime.mark((function t(){var e=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:window.onresize=function(){e.getHeight()};case 1:case"end":return t.stop()}}),t)}))),function(){return Rt.apply(this,arguments)}),mounted:function(){var t=this;this.$nextTick((function(){t.getHeight()})),this.searchList()},methods:{handleRefresh:function(t){this.date=t},searchList:(Pt=Object(c.a)(regeneratorRuntime.mark((function t(){var e;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.loading=!0,this.tableData=[],t.next=4,Z({start_day:this.date[0]||"",end_day:this.date[1]||"",page:1,size:1e4});case 4:0===(e=t.sent).code&&e.data&&0<e.data.list.length?(this.tableData=e.data.list,e=Number(e.data.list.reduce((function(t,e){return ot(t,e.total_fee)}),0)).toFixed(2),this.tableData.push({good_code:"合计",total_fee:e})):this.tableData=[],this.getHeight(),this.loading=!1;case 8:case"end":return t.stop()}}),t,this)}))),function(){return Pt.apply(this,arguments)})}}),zt=(At=Object(o.a)(At,(function(){var t=this,e=t.$createElement;e=t._self._c||e;return e("div",{staticClass:"SalesReportRejectedNew"},[e("date-picker-title",{attrs:{title:t.title},on:{refresh:t.handleRefresh}}),e("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],attrs:{data:t.tableData,size:"mini",border:""}},[e("el-table-column",{attrs:{type:"index",width:"40px"}}),e("el-table-column",{attrs:{label:"产品编码",prop:"good_code",width:"160px","show-overflow-tooltip":""}}),e("el-table-column",{attrs:{label:"产品名称",prop:"good_name","min-width":"160px","show-overflow-tooltip":""}}),e("el-table-column",{attrs:{label:"当日库存销售",prop:"good_num",width:"120px","show-overflow-tooltip":""}}),e("el-table-column",{attrs:{label:"当日库存发货",prop:"send_num",width:"100px","show-overflow-tooltip":""}}),e("el-table-column",{attrs:{label:"当前剩余可用库存",prop:"stock_num",width:"120px","show-overflow-tooltip":""}}),e("el-table-column",{attrs:{label:"业务公司名称",prop:"supplierName","min-width":"190px","show-overflow-tooltip":""}}),e("el-table-column",{attrs:{label:"库存采购单",prop:"good_price",width:"90px","show-overflow-tooltip":""}}),e("el-table-column",{attrs:{label:"当前库存消耗金额",prop:"total_fee",width:"130px","show-overflow-tooltip":""}})],1)],1)}),[],!1,null,null,null).exports,["cgder","name"]);function It(t,e){var n,a=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,n)),a}function qt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?It(Object(n),!0).forEach((function(e){Object(l.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):It(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Lt,$t,Ht,Ut,Yt={name:"Purchasee",mixins:[e],props:["date"],watch:{date:function(t){(this.dataTime=t)&&2===t.length&&this.searchList()}},data:function(){return{loading:!1,tableData:[]}},created:($t=Object(c.a)(regeneratorRuntime.mark((function t(){var e=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:window.onresize=function(){e.getHeight()};case 1:case"end":return t.stop()}}),t)}))),function(){return $t.apply(this,arguments)}),mounted:function(){var t=this;this.$nextTick((function(){t.getHeight()})),this.searchList()},methods:{searchList:(Lt=Object(c.a)(regeneratorRuntime.mark((function t(){var e;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.loading=!0,this.tableData=[],t.next=4,B({start:this.date[0]||"",end:this.date[1]||""});case 4:0===(e=t.sent).code&&e.data&&0<e.data.length?(this.tableData=e.data.reduce((function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{name:"",result:{}};return[].concat(Object(s.a)(t),Object(s.a)(Object.keys(e.result).map((function(t){return qt({name:e.name},e.result[t])}))))}),[]),e=qt({cgder:"合计",name:"--"},this.tableData.reduce((function(t,e){e.cgder,e.name;var n=Object(Nt.a)(e,zt);return Object.keys(n).reduce((function(n,a){return qt(qt({},n),{},Object(l.a)({},a,ot(e[a]||0,t[a]||0)))}),{})}),{})),this.tableData.push(e)):this.tableData=[],this.getHeight(),this.loading=!1;case 8:case"end":return t.stop()}}),t,this)}))),function(){return Lt.apply(this,arguments)})}},Gt=(Yt=Object(o.a)(Yt,(function(){var t=this.$createElement;t=this._self._c||t;return t("div",{directives:[{name:"loading",rawName:"v-loading",value:this.loading,expression:"loading"}],staticClass:"SalesReportRejectedNew"},[t("el-table",{attrs:{data:this.tableData,size:"mini",border:""}},[t("el-table-column",{attrs:{label:"业务公司",prop:"cgder",width:"200px"}}),t("el-table-column",{attrs:{width:"110px",label:"采购单总量",prop:"total_cgd"}}),t("el-table-column",{attrs:{label:"库存商品",prop:"tag_1"}}),t("el-table-column",{attrs:{label:"非库存商品",prop:"tag_2"}}),t("el-table-column",{attrs:{label:"反馈商品",prop:"tag_zx"}}),t("el-table-column",{attrs:{label:"TOC",prop:"tag_c"}}),t("el-table-column",{attrs:{label:"TOB",prop:"tag_b"}})],1)],1)}),[],!1,null,null,null).exports,{name:"Consult",mixins:[e],props:["date"],watch:{date:function(t){t&&2===t.length&&this.searchList()}},data:function(){return{tableData:[],loading:!1}},created:(Ut=Object(c.a)(regeneratorRuntime.mark((function t(){var e=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:window.onresize=function(){e.getHeight()};case 1:case"end":return t.stop()}}),t)}))),function(){return Ut.apply(this,arguments)}),mounted:function(){var t=this;this.$nextTick((function(){t.getHeight()})),this.searchList()},methods:{searchList:(Ht=Object(c.a)(regeneratorRuntime.mark((function t(){var e;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.loading=!0,this.tableData=[],t.next=4,G({start:this.date[0]||"",end:this.date[1]||""});case 4:0===(e=t.sent).code&&e.data&&0<e.data.length?(this.tableData=e.data,this.tableData.push({name:"合计",num:this.tableData.reduce((function(t,e){return ot(t,e.num)}),0)})):this.tableData=[],this.getHeight(),this.loading=!1;case 8:case"end":return t.stop()}}),t,this)}))),function(){return Ht.apply(this,arguments)})}}),Vt=(Gt=Object(o.a)(Gt,(function(){var t=this.$createElement;t=this._self._c||t;return t("div",{directives:[{name:"loading",rawName:"v-loading",value:this.loading,expression:"loading"}],staticClass:"SalesReportRejectedNew"},[t("el-table",{attrs:{data:this.tableData,size:"mini",border:""}},[t("el-table-column",{attrs:{label:"部门",prop:"name"}}),t("el-table-column",{attrs:{label:"数量",prop:"num"}})],1)],1)}),[],!1,null,null,null).exports,["name"]);function Qt(t,e){var n,a=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,n)),a}function Bt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Qt(Object(n),!0).forEach((function(e){Object(l.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Qt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Wt,Kt,Zt={name:"Consult",mixins:[e],props:["date","title"],watch:{date:function(t){(this.dataTime=t)&&2===t.length&&this.searchList()}},data:function(){return{loading:!1,tableData:[],day:"",pickerOptions:{disabledDate:function(t){return t.getTime()>Date.now()}}}},created:(Kt=Object(c.a)(regeneratorRuntime.mark((function t(){var e=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:window.onresize=function(){e.getHeight()};case 1:case"end":return t.stop()}}),t)}))),function(){return Kt.apply(this,arguments)}),mounted:function(){var t=this;this.handleChange(at()(new Date).format("YYYY-MM-DD")),this.$nextTick((function(){t.getHeight()}))},methods:{getType:function(t){return{"库存品":"库存商品","咨询采返":"反馈商品","非库存品":"非库存商品"}[t]||t},getTotal:function(t){return["1","2","3","4","5","6"].reduce((function(e,n){return ot(t[n],e)}),0)},handleChange:function(t){t?(t=at()(t).format("YYYY-MM-DD"),this.day=t,this.searchList()):this.$message.warning("请选择截止日期!")},objectSpanMethod:function(t){t.row,t.column;var e=t.rowIndex;if(0==t.columnIndex)return{rowspan:this.getSpanNumber(this.tableData,"name")[e],colspan:1}},getSpanNumber:function(t,e){var n=Array.isArray(t)?t.length:0;if(0<n){for(var a=0,o=t[0][e],r=[1],i=1;i<n;i++)t[i][e]==o?(r[a]+=1,r[i]=0):(r[a=i]=1,o=t[i][e]);return r}return[0]},searchList:(Wt=Object(c.a)(regeneratorRuntime.mark((function t(){var e,n,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.loading=!0,this.tableData=[],t.next=4,X({end:this.day});case 4:0===(e=t.sent).code&&e.data&&0<e.data.length?(n=[],Object.keys(e.data).forEach((function(t){t=e.data[t];var a=t.name,o=(t=t.result,void 0===t?{}:t);0===o.length?n.push({name:a,0:"--",1:0,2:0,3:0,4:0,5:0,6:0}):Object.keys(o).forEach((function(t){n.push(Bt({name:a},o[t]))}))})),(a=Bt({0:"--"},n.reduce((function(t,e){e.name;var n=Object(Nt.a)(e,Vt);return Object.keys(n).reduce((function(n,a){return Bt(Bt({},n),{},Object(l.a)({},a,ot(e[a]||0,t[a]||0)))}),{})}),{}))).name="合计",a[0]="--",n.push(a),this.tableData=n):this.tableData=[],this.getHeight(),this.loading=!1;case 8:case"end":return t.stop()}}),t,this)}))),function(){return Wt.apply(this,arguments)})}};Zt=Object(o.a)(Zt,(function(){var t=this,e=t.$createElement;e=t._self._c||e;return e("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"SalesReportRejectedNew"},[e("div",{staticClass:"picker-title",staticStyle:{display:"flex","align-items":"center","justify-content":"space-between",margin:"10px 0px"}},[e("p",{staticStyle:{margin:"0"}},[t._v(t._s(t.title))])]),e("el-table",{attrs:{data:t.tableData,size:"mini",border:"","span-method":t.objectSpanMethod}},[e("el-table-column",{attrs:{width:"70px",label:"部门",prop:"name"}}),e("el-table-column",{attrs:{width:"90px",label:"商品类型",prop:"0"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t.getType(e.row[0])))]}}])}),e("el-table-column",{attrs:{label:"时效",align:"center"}},[e("el-table-column",{attrs:{label:"A24小时",prop:"1"}}),e("el-table-column",{attrs:{label:"B48小时",prop:"2"}}),e("el-table-column",{attrs:{label:"C3-7天内",prop:"3"}}),e("el-table-column",{attrs:{label:"D14天内",prop:"4"}}),e("el-table-column",{attrs:{label:"E30天内",prop:"5"}}),e("el-table-column",{attrs:{label:"F超30天",prop:"6"}})],1),e("el-table-column",{attrs:{label:"总计"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.getTotal(e.row))+"\n ")]}}])})],1)],1)}),[],!1,null,null,null).exports;function Jt(t,e){var n,a=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,n)),a}function Xt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Jt(Object(n),!0).forEach((function(e){Object(l.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Jt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var te,ee,ne,ae,oe={name:"Consult",mixins:[e],props:["date"],watch:{date:function(t){(this.dataTime=t)&&2===t.length&&this.searchList()}},data:function(){return{loading:!1,tableData:[]}},created:(ee=Object(c.a)(regeneratorRuntime.mark((function t(){var e=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:window.onresize=function(){e.getHeight()};case 1:case"end":return t.stop()}}),t)}))),function(){return ee.apply(this,arguments)}),mounted:function(){var t=this;this.$nextTick((function(){t.getHeight()})),this.searchList()},methods:{getRowTotal:function(t){return Array.isArray(t.result)?"0":(Object.keys(t.result).map((function(e){return t.result[e]}))||[]).reduce((function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return ot(t,"4"!==e.order_type&&e.num||0)}),0)},getResultWithType:function(t,e){return Array.isArray(t.result)?"0":(Object.keys(t.result).map((function(e){return t.result[e]})).find((function(t){return t.order_type===e}))||{}).num||0},searchList:(te=Object(c.a)(regeneratorRuntime.mark((function t(){var e,n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.loading=!0,this.tableData=[],t.next=4,V({start:this.date[0]||"",end:this.date[1]||""});case 4:0===(n=t.sent).code&&n.data&&0<n.data.length?(this.tableData=n.data,n=(e=["1","2","3"]).reduce((function(t,e){return Xt(Xt({},t),{},Object(l.a)({},e,{num:0,order_type:e}))}),{}),n={name:"总计",result:this.tableData.reduce((function(t,n){var a=n.result;return e.reduce((function(e,n){var o=(a[n]||{num:0}).num;o=ot(t[n].num,o);return Xt(Xt({},e),{},Object(l.a)({},n,{num:o,order_type:n}))}),{})}),Xt({},n))},this.tableData.push(n)):this.tableData=[],this.getHeight(),this.loading=!1;case 8:case"end":return t.stop()}}),t,this)}))),function(){return te.apply(this,arguments)})}},re=(oe=Object(o.a)(oe,(function(){var t=this,e=t.$createElement;e=t._self._c||e;return e("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"SalesReportRejectedNew"},[e("el-table",{attrs:{data:t.tableData,size:"mini",border:""}},[e("el-table-column",{attrs:{prop:"name",width:"120px"}}),e("el-table-column",{attrs:{label:"库存商品"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.getResultWithType(e.row,"1"))+"\n ")]}}])}),e("el-table-column",{attrs:{label:"非库存商品"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.getResultWithType(e.row,"2"))+"\n ")]}}])}),e("el-table-column",{attrs:{label:"反馈商品"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.getResultWithType(e.row,"3"))+"\n ")]}}])}),e("el-table-column",{attrs:{label:"总计"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.getRowTotal(e.row))+"\n ")]}}])})],1)],1)}),[],!1,null,null,null).exports,{name:"Consult",mixins:[e],props:["date"],watch:{date:function(t){(this.dataTime=t)&&2===t.length&&this.searchList()}},data:function(){return{loading:!1,tableData:[]}},created:(ae=Object(c.a)(regeneratorRuntime.mark((function t(){var e=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:window.onresize=function(){e.getHeight()};case 1:case"end":return t.stop()}}),t)}))),function(){return ae.apply(this,arguments)}),mounted:function(){var t=this;this.$nextTick((function(){t.getHeight()})),this.searchList()},methods:{searchList:(ne=Object(c.a)(regeneratorRuntime.mark((function t(){var e;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.loading=!0,this.tableData=[],t.next=4,Q({start:this.date[0]||"",end:this.date[1]||""});case 4:0===(e=t.sent).code&&e.data&&0<e.data.length?(this.tableData=e.data,this.tableData.push({name:"总计",num:this.tableData.reduce((function(t,e){return ot(t,e.num)}),0)})):this.tableData=[],this.getHeight(),this.loading=!1;case 8:case"end":return t.stop()}}),t,this)}))),function(){return ne.apply(this,arguments)})}});re=Object(o.a)(re,(function(){var t=this.$createElement;t=this._self._c||t;return t("div",{directives:[{name:"loading",rawName:"v-loading",value:this.loading,expression:"loading"}],staticClass:"SalesReportRejectedNew"},[t("el-table",{attrs:{data:this.tableData,size:"mini",border:""}},[t("el-table-column",{attrs:{label:"备库部门",prop:"name"}}),t("el-table-column",{attrs:{label:"备库单数",prop:"num"}})],1)],1)}),[],!1,null,null,null).exports;function ie(t,e){var n,a=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,n)),a}var se,le,ce={name:"newReport",components:{PeriodDatePicker:Et,NotDeliverGood:nt,UnusualState:S,PurchaseBack:xt,EmptyReturn:Tt,SendOrder:Ft,TheSales:At,Purchase:Yt,SendExp:Zt,Consult:Gt,Stock:re,Order:oe},data:function(){return{date:[],zxTotal:0,isDisplay:!1,state:{message:"",error:!1,loading:!1}}},mounted:function(){document.title="4.订单情况",O("code")?this.requestUserinfo():this.login();var t=at()(new Date).format("YYYY-MM-DD");this.date=[t+" 00:00:00",t+" 23:59:59"]},methods:{getZXTotal:function(t){this.zxTotal=t},time:(le=Object(c.a)(regeneratorRuntime.mark((function t(e){var n,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.startTime,a=e.endTime,this.start=n||"",this.end=a||"",n=this.start,a=this.end,""!==n&&""===a||""===n&&""!==a)return this.$message.warning("时间区间不完整!"),this.date=[],t.abrupt("return");t.next=8;break;case 8:this.start&&this.end?this.date=[this.start+" 00:00:00",this.end+" 23:59:59"]:this.date=[this.start,this.end];case 9:case"end":return t.stop()}}),t,this)}))),function(t){return le.apply(this,arguments)}),requestUserinfo:(se=Object(c.a)(regeneratorRuntime.mark((function t(){var e,n,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.state.loading=!0,e=T(),n=O("code"),t.next=5,v(function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ie(Object(n),!0).forEach((function(e){Object(l.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ie(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},e?{openid:e}:{code:n}));case 5:a=t.sent,this.state.loading=!1,t.t0=Number(a.code),t.next=0===t.t0?10:13;break;case 10:return this.isShow=(a.data.is_show||[]).includes(4)||(a.data.is_show||[]).includes("4"),x(a.data.openid),t.abrupt("break",17);case 13:return this.state.error=!0,this.state.message=a.message,e&&N(),t.abrupt("break",17);case 17:case"end":return t.stop()}}),t,this)}))),function(){return se.apply(this,arguments)}),login:function(){var t=encodeURIComponent("http://stat.caixiao365.com/accountsReceivable"),e="wx_"+Math.random().toString(36).substr(2,15);t="https://open.weixin.qq.com/connect/oauth2/authorize?appid=".concat(config.appId,"&redirect_uri=").concat(t,"&response_type=code&scope=").concat("snsapi_userinfo","&state=").concat(e,"#wechat_redirect");window.location.href=t}}},ue=(ce=(n("0b36"),Object(o.a)(ce,(function(){var t=this,e=t.$createElement;e=t._self._c||e;return e("div",{directives:[{name:"loading",rawName:"v-loading",value:t.state.loading,expression:"state.loading"}],staticClass:"new-report",staticStyle:{"min-height":"300px"}},[!t.state.error&&t.isShow?e("div",[e("div",{staticStyle:{display:"flex","justify-content":"flex-end"}},[e("period-date-picker",{attrs:{start:t.date[0],end:t.date[1],size:"mini",width:"150px"},on:{timeReturned:function(e){return t.time(e)}}})],1),e("el-row",{attrs:{gutter:"20"}},[e("el-row",{attrs:{gutter:"20"}},[e("el-col",{attrs:{xs:24}},[e("p",{staticClass:"title"},[t._v("1.竞价咨询统计")]),e("consult",{attrs:{date:t.date}})],1)],1),e("el-row",[e("el-col",{attrs:{xs:24}},[e("p",{staticClass:"title"},[t._v("2.竞价反馈统计, 竞价单总数:"+t._s(t.zxTotal))]),e("purchase-back",{attrs:{date:t.date},on:{getZXTotal:t.getZXTotal}})],1)],1),e("el-col",{attrs:{xs:24}},[e("p",{staticClass:"title"},[t._v("3.竞价空返统计")]),e("empty-return",{attrs:{date:t.date}})],1)],1),e("el-col",{attrs:{xs:24}},[e("p",{staticClass:"title"},[t._v("4.销售订单统计")]),e("order",{attrs:{date:t.date}})],1),e("el-col",{attrs:{xs:24}},[e("p",{staticClass:"title"},[t._v("5.备库单统计")]),e("stock",{attrs:{date:t.date}})],1),e("el-col",{attrs:{xs:24}},[e("p",{staticClass:"title"},[t._v("6.采购订单统计")]),e("purchase",{attrs:{date:t.date}})],1)],1):t.state.loading?t._e():[e("unusual-state",{attrs:{hasPermission:t.isShow,message:t.state.message,path:"newReport"}})]],2)}),[],!1,null,"1b74b70e",null).exports),n("57e7"),n("20d6"),"http://rep.report.caixiao365.com/admin/Everyday/"),pe={departmentEveryDay:function(t,e){return p(ue+"departEveryDay",t,"post",e)},departmentEveryMonth:function(t,e){return p(ue+"departEveryMonth",t,"post",e)},companyEvery:function(t,e){return p(ue+"companyEvery",t,"post",e)},companyEveryMonth:function(t,e){return p(ue+"companyEveryMonth",t,"post",e)},platform:function(t,e){return p(ue+"platformEvery",t,"post",e)},supplier:function(t,e){return p("http://rep.report.caixiao365.com/admin/everyday/supplierEvery",t,"post",e)},users:function(t,e){return p("http://rep.report.caixiao365.com/admin/accountInv/getUser",t,"post",e)},everyAccountMonth:function(t,e){return p(ue+"EveryAccountMonth",t,"post",e)},everyAccountDay:function(t,e){return p(ue+"EveryAccountDay",t,"post",e)},everyCompanyDay:function(t,e){return p(ue+"EveryCompanyDay",t,"post",e)},everyCompanMonth:function(t,e){return p(ue+"EveryCompanyMonth",t,"post",e)},accountInvList:function(t,e){return p("http://rep.report.caixiao365.com/admin/accountInv/list",t,"post",e)}},de={"北京百辰荣达国际科贸有限公司":"百辰","北京泓源广诚国际商贸有限公司":"泓源","北京万宇恒通国际科贸有限公司":"万宇","北京锦兴弘昌科技有限公司":"锦兴","北京普润心堂商贸有限公司":"普润","北京知事文化产业发展有限公司":"知事","北京泰文创供应链管理有限公司":"泰文创","北京元隆雅图文化传播股份有限公司":"预订单E企购","结算单E企购":"结算单E企购"};function me(t,e){var n,a=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,n)),a}function he(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?me(Object(n),!0).forEach((function(e){Object(l.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):me(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var fe,_e={props:["companies","costField","isTenThound"],data:function(){return{daytime:"",loading:!1,tableData:[],companyNo:"",plat_cp_companies:[],cp_companies:[],isEmpty:!1,mapCompany:de}},mounted:function(){var t,e=this,n=!1,a=this.companies.findIndex((function(t){return"北京锦兴弘昌科技有限公司"===t.label})),o=this.companies.findIndex((function(t){return"北京普润心堂商贸有限公司"===t.label})),r=this.companies.findIndex((function(t){return"北京知事文化产业发展有限公司"===t.label}));-1===a&&-1===o&&-1===r||(n=!0),this.cp_companies=this.companies.filter((function(t){return"北京锦兴弘昌科技有限公司"!==t.label&&"北京普润心堂商贸有限公司"!==t.label&&"北京知事文化产业发展有限公司"!==t.label})),n&&(this.cp_companies=[].concat(Object(s.a)(this.cp_companies),[{value:"GS2302231124114965",label:"普润&锦兴&知事"}])),this.isEmpty=0===this.cp_companies.length,this.isEmpty||(this.cp_companies=this.cp_companies.map((function(t,e){var n="";return"北京万宇恒通国际科贸有限公司"===t.label&&(n="平台公司: 万宇"),"北京泰文创供应链管理有限公司"===t.label&&(n="平台公司: 泰文创"),"北京元隆雅图文化传播股份有限公司"===t.label&&(n="预订单E企购"),"结算单E企购"===t.label&&(n="结算单E企购"),""===(n="普润&锦兴&知事"===t.label?"业务公司: 普润&锦兴&知事":n)&&(n="业务公司: ".concat(de[t.label])),he(he({},t),{},{label:n})})),a=["所有平台公司","平台公司: 万宇","平台公司: 泰文创","预订单E企购","结算单E企购"],t=this.cp_companies.map((function(t){return t.label})),a=a.filter((function(e){return t.includes(e)})),this.plat_cp_companies=a.map((function(t){return e.cp_companies.find((function(e){return e.label===t}))})),4===this.plat_cp_companies.length&&(this.plat_cp_companies=[{value:"",label:"所有平台公司"}].concat(Object(s.a)(this.plat_cp_companies))),this.companyNo=this.plat_cp_companies[0].value,this.daytime=this.transformTime(),this.requestData())},methods:{unit2TenThousand:lt,getCurrentRateStyle:function(t){var e=at()(this.daytime).daysInMonth(),n=(e=Number(rt(100,e)).toFixed(2),at()(this.daytime).date());n=Number(it(n,e)).toFixed(2);return Number(n)>Number(t)?"color:red":""},getCurrentValueStyle:function(t,e){var n=at()(this.daytime).daysInMonth();e=Number(rt(e,n)).toFixed(2),n=at()(this.daytime).date(),n=Number(it(n,e)).toFixed(2);return Number(n)>Number(t)?"color: red":""},addDataToCompany:function(t,e){return{companyName:"普润",cost_tips:Number(t.cost_tips).toFixed(2),total_tips:Number(t.total_tips).toFixed(2),monthinfo:t.monthinfo.map((function(t,n){return{mcgd_th_total:Number(ot(t.mcgd_th_total,e.monthinfo[n].mcgd_th_total)).toFixed(2),mcgd_total:Number(ot(t.mcgd_total,e.monthinfo[n].mcgd_total)).toFixed(2),msale_total:Number(ot(t.msale_total,e.monthinfo[n].msale_total)).toFixed(2),mth_total:Number(ot(t.mth_total,e.monthinfo[n].mth_total)).toFixed(2),type:t.type}})),dayinfo:t.dayinfo.map((function(t,n){return{cgd_th_total:Number(ot(t.cgd_th_total,e.dayinfo[n].cgd_th_total)).toFixed(2),cgd_total:Number(ot(t.cgd_total,e.dayinfo[n].cgd_total)).toFixed(2),sale_total:Number(ot(t.sale_total,e.dayinfo[n].sale_total)).toFixed(2),th_total:Number(ot(t.th_total,e.dayinfo[n].th_total)).toFixed(2),type:t.type}}))}},setCellClassName:function(t){var e=t.column,n=(t=t.row,e=e.label,"");return"北京元隆雅图文化传播股份有限公司"===t.companyName&&(n+="font-bold "),"营收目标"===e?n+"bg__success":-1===e.indexOf("营业")&&-1===e.indexOf("营收")||"当日营业收入"===e?"毛利目标"===e?n+"bg__primary":-1!==e.indexOf("毛利")?n+"bg__primary_1":-1!==e.indexOf("成本")?n+"bg__warning_1":n:n+"bg__success_1"},setHeaderClassName:function(t){return t=t.column.label,"营收目标"===t?"bg__success":-1===t.indexOf("营业")&&-1===t.indexOf("营收")||"当日营业收入"===t?"毛利目标"===t?"bg__primary":-1!==t.indexOf("毛利")?"bg__primary_1":-1!==t.indexOf("成本")?"bg__warning_1":void 0:"bg__success_1"},transformTime:function(){var t=new Date,e=t.getFullYear(),n=t.getMonth()+1;t=t.getDate();return e+"-"+(n<10?"0"+n:n)+"-"+(t<10?"0"+t:t)},requestData:(fe=Object(c.a)(regeneratorRuntime.mark((function t(){var e,n,a,o=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.loading=!0,this.tableData=[],t.next=4,pe.companyEveryMonth({daytime:this.daytime});case 4:0===(e=t.sent).code&&e.data&&0<e.data.length?(e.data.forEach((function(t){var e=t.companyName,n=t.companyNo,a=t.monthinfo,r=t.dayinfo,i=t.total_tips,l=(t=t.cost_tips,{1:"自营",2:"渠道",3:"供应商端",4:"物流费用"}),c=Object.keys(l),u=0,p=0,d=0,m=0,h=(c=c.map((function(t){var e=a.find((function(e){return String(e.type)===t}))||{},n=r.find((function(e){return String(e.type)===t}))||{},o=0,i=(4!==Number(t)&&(o=st(e.msale_total,e.mth_total)||0),st(n.sale_total,n.th_total)||0),s=st(n.cgd_total,n.cgd_th_total)||0,c=0;c=4!==Number(t)?st(e.mcgd_total,e.mcgd_th_total)||0:Number(e.mcgd_total||0).toFixed(2);return u=Number(ot(u,i)).toFixed(2),p=Number(ot(p,o)).toFixed(2),d=Number(ot(d,s)).toFixed(2),m=Number(ot(m,c)).toFixed(2),{type:l[t],dayinfo:he(he({},n),{},{sale_total:i}),monthinfo:he(he({},a),{},{msale_total:o,mcost_total:c})}})),Number(st(p,m)).toFixed(2));o.tableData=[].concat(Object(s.a)(o.tableData),[{companyNo:n,companyName:e,cost_tips:t,total_tips:i,info:[he({},c)],sale_total:u,cost_total:d,msale_total:p,mcost_total:m,gross_completion:h,completion_rate:it(rt(p,i),100).toFixed(2),gross_completion_rate:0===Number(t)?0:it(rt(h,t)||0,100).toFixed(2),gross_sale_completion_rate:Number(it(rt(h,p)||0,100)).toFixed(2)}])})),e=["北京元隆雅图文化传播股份有限公司","北京万宇恒通国际科贸有限公司","北京泰文创供应链管理有限公司","结算单E企购"],n=this.plat_cp_companies.map((function(t){return t.value})),a=this.tableData.map((function(t){return t.companyName})),e=e.filter((function(t){return a.includes(t)})),this.tableData=e.map((function(t){return o.tableData.find((function(e){return e.companyName===t}))})),this.tableData=this.tableData.filter((function(t){return t=t.companyNo,n.includes(t)}))):this.tableData=[],this.loading=!1;case 7:case"end":return t.stop()}}),t,this)}))),function(){return fe.apply(this,arguments)})}};n("8098"),_e=Object(o.a)(_e,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}]},[n("div",{staticClass:"search clear",staticStyle:{"align-items":"center"}},[n("span",{staticStyle:{"font-size":"15px"}},[t._v("平台公司业绩情况")]),n("div",{staticStyle:{float:"right"}},[n("el-date-picker",{staticClass:"fr picker no-padding",staticStyle:{width:"95px"},attrs:{"value-format":"yyyy-MM-dd",editable:!1,disabled:t.isEmpty,clearable:!1,size:"small",format:"yyyy-MM-dd",type:"date",align:"right",placeholder:"选择日期","picker-options":{disabledDate:function(t){return t.getTime()>Date.now()}}},on:{change:t.requestData},model:{value:t.daytime,callback:function(e){t.daytime=e},expression:"daytime"}})],1)]),t.isEmpty?[n("div",{staticStyle:{"text-align":"center","line-height":"60px","user-select":"none"}},[t._v("当前账号没有访问权限")])]:n("el-row",{staticStyle:{"margin-top":"10px"}},[n("el-table",{attrs:{border:"",size:"mini",data:t.tableData,"header-cell-class-name":t.setHeaderClassName,"cell-class-name":t.setCellClassName}},[n("el-table-column",{attrs:{fixed:"left",label:"公司",prop:"companyName",align:"center",width:"60px"},scopedSlots:t._u([{key:"default",fn:function(e){return[-1===e.row.companyName.indexOf("普润")?n("div",[t._v("\n "+t._s(t.mapCompany[e.row.companyName]||e.row.companyName)+"\n ")]):n("div",[n("el-popover",{attrs:{placement:"right",width:"200",trigger:"hover",content:"普润&锦兴&知事"},scopedSlots:t._u([{key:"reference",fn:function(){return[n("i",{staticClass:"el-icon-warning-outline",staticStyle:{"font-size":"14px",cursor:"pointer"}}),t._v("\n 普润\n ")]},proxy:!0}],null,!0)})],1)]}}],null,!1,992203119)}),n("el-table-column",{attrs:{label:"当日营业收入",align:"center",width:"95px"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.unit2TenThousand(e.row.sale_total,t.isTenThound))+"\n ")]}}],null,!1,1039656234)}),n("el-table-column",{attrs:{label:"营收目标",align:"center","min-width":"95px"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.unit2TenThousand(e.row.total_tips,t.isTenThound))+"\n ")]}}],null,!1,1256669967)}),n("el-table-column",{attrs:{label:"营业收入(净)",align:"center","min-width":"115px"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("div",{staticStyle:{display:"flex","justify-content":"center"},style:""+t.getCurrentValueStyle(e.row.msale_total,e.row.total_tips)},[t._v("\n "+t._s(t.unit2TenThousand(e.row.msale_total,t.isTenThound))+"\n "),n("el-popover",{attrs:{placement:"right",width:200,trigger:"click"},scopedSlots:t._u([{key:"reference",fn:function(){return[n("div",{style:""+t.getCurrentValueStyle(e.row.msale_total,e.row.total_tips)},[n("i",{staticClass:"el-icon-warning-outline trigger-hover",staticStyle:{"font-size":"16px",cursor:"pointer","margin-left":"5px"}})])]},proxy:!0}],null,!0)},[n("div",{staticClass:"table-size"},[n("p",[t._v("直营/自营: "+t._s(t.unit2TenThousand(e.row.info[0][0].monthinfo.msale_total,t.isTenThound)))]),n("p",[t._v("支付渠道: "+t._s(t.unit2TenThousand(e.row.info[0][1].monthinfo.msale_total,t.isTenThound)))]),n("p",[t._v("供应商端: "+t._s(t.unit2TenThousand(e.row.info[0][2].monthinfo.msale_total,t.isTenThound)))])])])],1)]}}],null,!1,877686572)}),n("el-table-column",{attrs:{label:"营收完成%",align:"center","min-width":"85px"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("div",{style:""+t.getCurrentRateStyle(e.row.completion_rate)},[t._v(t._s(("NaN"===String(e.row.completion_rate)?0:e.row.completion_rate)+"%")+"\n ")])]}}],null,!1,3143000876)}),t.costField?[n("el-table-column",{attrs:{label:"毛利目标",align:"center","min-width":"90px"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.costField?t.unit2TenThousand(e.row.cost_tips,t.isTenThound):"***")+"\n ")]}}],null,!1,2600940256)}),n("el-table-column",{attrs:{label:"毛利完成",align:"center","min-width":"90px"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("div",{style:""+t.getCurrentValueStyle(e.row.gross_completion,e.row.cost_tips)},[t._v("\n "+t._s(t.costField?t.unit2TenThousand(e.row.gross_completion,t.isTenThound):"***")+"\n ")])]}}],null,!1,3300465382)})]:t._e(),n("el-table-column",{attrs:{label:"毛利完成%",align:"center","min-width":"85px"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("div",{style:t.getCurrentRateStyle(e.row.gross_completion_rate)},[t._v("\n "+t._s(e.row.gross_completion_rate+"%")+"\n ")])]}}],null,!1,1390167442)}),t.costField?[n("el-table-column",{attrs:{label:"成本合计",align:"center","min-width":"125px"},scopedSlots:t._u([{key:"default",fn:function(e){return[t.costField?n("div",{staticStyle:{display:"flex","justify-content":"center"}},[t._v("\n "+t._s(t.unit2TenThousand(e.row.mcost_total,t.isTenThound))+"\n "),n("el-popover",{attrs:{placement:"right",width:200,trigger:"click"},scopedSlots:t._u([{key:"reference",fn:function(){return[n("i",{staticClass:"el-icon-warning-outline trigger-hover",staticStyle:{"font-size":"16px",cursor:"pointer","margin-left":"5px"}})]},proxy:!0}],null,!0)},[n("div",{staticClass:"table-size"},[n("p",[t._v("直营/自营: "+t._s(t.unit2TenThousand(e.row.info[0][0].monthinfo.mcost_total,t.isTenThound)))]),n("p",[t._v("支付渠道: "+t._s(t.unit2TenThousand(e.row.info[0][1].monthinfo.mcost_total,t.isTenThound)))]),n("p",[t._v("供应商端: "+t._s(t.unit2TenThousand(e.row.info[0][2].monthinfo.mcost_total,t.isTenThound)))]),n("p",[t._v("物流费用: "+t._s(t.unit2TenThousand(e.row.info[0][3].monthinfo.mcost_total,t.isTenThound)))])])])],1):n("p",[t._v("***")])]}}],null,!1,1442372113)}),n("el-table-column",{attrs:{label:"实际毛利率",align:"center",width:"85px"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.costField?t.unit2TenThousand(e.row.gross_sale_completion_rate)+"%":"***")+"\n ")]}}],null,!1,3104583033)})]:t._e()],2)],1)],2)}),[],!1,null,"a6e761f6",null).exports;function ye(t,e){var n,a=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,n)),a}function be(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ye(Object(n),!0).forEach((function(e){Object(l.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ye(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var ge,ve={props:["companies","costField","isTenThound"],data:function(){return{daytime:"",loading:!1,tableData:[],companyNo:"",plat_cp_companies:[],cp_companies:[],isEmpty:!1,mapCompany:de}},mounted:function(){var t,e=this,n=!1,a=this.companies.findIndex((function(t){return"北京锦兴弘昌科技有限公司"===t.label})),o=this.companies.findIndex((function(t){return"北京普润心堂商贸有限公司"===t.label})),r=this.companies.findIndex((function(t){return"北京知事文化产业发展有限公司"===t.label}));-1===a&&-1===o&&-1===r||(n=!0),this.cp_companies=this.companies.filter((function(t){return"北京锦兴弘昌科技有限公司"!==t.label&&"北京普润心堂商贸有限公司"!==t.label&&"北京知事文化产业发展有限公司"!==t.label})),n&&(this.cp_companies=[].concat(Object(s.a)(this.cp_companies),[{value:"GS2302231124114965",label:"普润&锦兴&知事"}])),this.isEmpty=0===this.cp_companies.length,this.isEmpty||(this.cp_companies=this.cp_companies.map((function(t,e){var n="";return"北京万宇恒通国际科贸有限公司"===t.label&&(n="平台公司: 万宇"),"北京泰文创供应链管理有限公司"===t.label&&(n="平台公司: 泰文创"),"北京元隆雅图文化传播股份有限公司"===t.label&&(n="平台公司: 元隆"),"结算单E企购"===t.label&&(n="结算单E企购"),""===(n="普润&锦兴&知事"===t.label?"业务公司: 普润&锦兴&知事":n)&&(n="业务公司: ".concat(de[t.label])),be(be({},t),{},{label:n})})),a=["所有业务公司","业务公司: 百辰","业务公司: 泓源","业务公司: 普润&锦兴&知事"],t=this.cp_companies.map((function(t){return t.label})),a=a.filter((function(e){return t.includes(e)})),this.plat_cp_companies=a.map((function(t){return e.cp_companies.find((function(e){return e.label===t}))})),3===this.plat_cp_companies.length&&(this.plat_cp_companies=[{value:"",label:"所有业务公司"}].concat(Object(s.a)(this.plat_cp_companies))),this.companyNo=this.plat_cp_companies[0].value,this.daytime=this.transformTime(),this.requestData())},methods:{unit2TenThousand:lt,getCurrentRateStyle:function(t){var e=at()(this.daytime).daysInMonth(),n=(e=Number(rt(100,e)).toFixed(2),at()(this.daytime).date());n=Number(it(n,e)).toFixed(2);return Number(n)>Number(t)?"color:red":""},getCurrentValueStyle:function(t,e){var n=at()(this.daytime).daysInMonth();e=Number(rt(e,n)).toFixed(2),n=at()(this.daytime).date(),n=Number(it(n,e)).toFixed(2);return Number(n)>Number(t)?"color: red":""},addDataToCompany:function(t,e){return{companyName:"普润",cost_tips:Number(t.cost_tips).toFixed(2),total_tips:Number(t.total_tips).toFixed(2),monthinfo:t.monthinfo.map((function(t,n){return{mcgd_th_total:Number(ot(t.mcgd_th_total,e.monthinfo[n].mcgd_th_total)).toFixed(2),mcgd_total:Number(ot(t.mcgd_total,e.monthinfo[n].mcgd_total)).toFixed(2),msale_total:Number(ot(t.msale_total,e.monthinfo[n].msale_total)).toFixed(2),mth_total:Number(ot(t.mth_total,e.monthinfo[n].mth_total)).toFixed(2),type:t.type}})),dayinfo:t.dayinfo.map((function(t,n){return{cgd_th_total:Number(ot(t.cgd_th_total,e.dayinfo[n].cgd_th_total)).toFixed(2),cgd_total:Number(ot(t.cgd_total,e.dayinfo[n].cgd_total)).toFixed(2),sale_total:Number(ot(t.sale_total,e.dayinfo[n].sale_total)).toFixed(2),th_total:Number(ot(t.th_total,e.dayinfo[n].th_total)).toFixed(2),type:t.type}}))}},setCellClassName:function(t){var e=t.column,n=(t=t.row,e=e.label,"");return"北京万宇恒通国际科贸有限公司"===t.companyName&&(n+="font-bold "),"营收目标"===e?n+"bg__success":-1===e.indexOf("营业")&&-1===e.indexOf("营收")||"当日营业收入"===e?"毛利目标"===e?n+"bg__primary":-1!==e.indexOf("毛利")?n+"bg__primary_1":-1!==e.indexOf("成本")?n+"bg__warning_1":n:n+"bg__success_1"},setHeaderClassName:function(t){return t=t.column.label,"营收目标"===t?"bg__success":-1===t.indexOf("营业")&&-1===t.indexOf("营收")||"当日营业收入"===t?"毛利目标"===t?"bg__primary":-1!==t.indexOf("毛利")?"bg__primary_1":-1!==t.indexOf("成本")?"bg__warning_1":void 0:"bg__success_1"},transformTime:function(){var t=new Date,e=t.getFullYear(),n=t.getMonth()+1;t=t.getDate();return e+"-"+(n<10?"0"+n:n)+"-"+(t<10?"0"+t:t)},requestData:(ge=Object(c.a)(regeneratorRuntime.mark((function t(){var e,n,a,o=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.loading=!0,this.tableData=[],t.next=4,pe.companyEveryMonth({daytime:this.daytime});case 4:0===(e=t.sent).code&&e.data&&0<e.data.length?(e.data.forEach((function(t){var e=t.companyName,n=t.companyNo,a=t.monthinfo,r=t.dayinfo,i=t.total_tips,l=(t=t.cost_tips,{1:"自营",2:"渠道",3:"供应商端",4:"物流费用"}),c=Object.keys(l),u=0,p=0,d=0,m=0,h=(c=c.map((function(t){var e=a.find((function(e){return String(e.type)===t}))||{},n=r.find((function(e){return String(e.type)===t}))||{},o=0,i=(4!==Number(t)&&(o=st(e.msale_total,e.mth_total)||0),st(n.sale_total,n.th_total)||0),s=st(n.cgd_total,n.cgd_th_total)||0,c=0;c=4!==Number(t)?st(e.mcgd_total,e.mcgd_th_total)||0:Number(e.mcgd_total||0).toFixed(2);return u=Number(ot(u,i)).toFixed(2),p=Number(ot(p,o)).toFixed(2),d=Number(ot(d,s)).toFixed(2),m=Number(ot(m,c)).toFixed(2),{type:l[t],dayinfo:be(be({},n),{},{sale_total:i}),monthinfo:be(be({},a),{},{msale_total:o,mcost_total:c})}})),Number(st(p,m)).toFixed(2));o.tableData=[].concat(Object(s.a)(o.tableData),[{companyNo:n,companyName:e,cost_tips:t,total_tips:i,info:[be({},c)],sale_total:u,cost_total:d,msale_total:p,mcost_total:m,gross_completion:h,completion_rate:it(rt(p,i),100).toFixed(2),gross_completion_rate:0===Number(t)?0:it(rt(h,t)||0,100).toFixed(2),gross_sale_completion_rate:Number(it(rt(h,p)||0,100)).toFixed(2)}])})),e=["北京百辰荣达国际科贸有限公司","北京泓源广诚国际商贸有限公司","北京普润心堂商贸有限公司"],n=this.tableData.map((function(t){return t.companyName})),a=this.plat_cp_companies.map((function(t){return t.value})),e=e.filter((function(t){return n.includes(t)})),this.tableData=e.map((function(t){return o.tableData.find((function(e){return e.companyName===t}))})),this.tableData=this.tableData.filter((function(t){return t=t.companyNo,a.includes(t)}))):this.tableData=[],this.loading=!1;case 7:case"end":return t.stop()}}),t,this)}))),function(){return ge.apply(this,arguments)})}};n("4ffd"),ve=Object(o.a)(ve,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}]},[n("div",{staticClass:"search clear",staticStyle:{"align-items":"center"}},[t._m(0),n("div",{staticStyle:{float:"right"}},[n("el-date-picker",{staticClass:"fr picker no-padding",staticStyle:{width:"95px"},attrs:{"value-format":"yyyy-MM-dd",editable:!1,disabled:t.isEmpty,clearable:!1,size:"small",format:"yyyy-MM-dd",type:"date",align:"right",placeholder:"选择日期","picker-options":{disabledDate:function(t){return t.getTime()>Date.now()}}},on:{change:t.requestData},model:{value:t.daytime,callback:function(e){t.daytime=e},expression:"daytime"}})],1)]),t.isEmpty?[n("div",{staticStyle:{"text-align":"center","line-height":"60px","user-select":"none"}},[t._v("当前账号没有访问权限")])]:n("el-row",{staticStyle:{"margin-top":"10px"}},[n("el-table",{attrs:{border:"",size:"mini",data:t.tableData,"header-cell-class-name":t.setHeaderClassName,"cell-class-name":t.setCellClassName}},[n("el-table-column",{attrs:{fixed:"left",label:"公司",prop:"companyName",align:"center",width:"65px"},scopedSlots:t._u([{key:"default",fn:function(e){return[-1===e.row.companyName.indexOf("普润")?n("div",[t._v("\n "+t._s(t.mapCompany[e.row.companyName]||e.row.companyName)+"\n ")]):n("div",[n("el-popover",{attrs:{placement:"right",width:"200",trigger:"hover",content:"普润&锦兴&知事"},scopedSlots:t._u([{key:"reference",fn:function(){return[n("i",{staticClass:"el-icon-warning-outline",staticStyle:{"font-size":"14px",cursor:"pointer"}}),t._v("\n 普润\n ")]},proxy:!0}],null,!0)})],1)]}}],null,!1,992203119)}),n("el-table-column",{attrs:{label:"当日营业收入",align:"center",width:"95px"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.unit2TenThousand(e.row.sale_total,t.isTenThound))+"\n ")]}}],null,!1,1039656234)}),n("el-table-column",{attrs:{label:"营收目标",align:"center","min-width":"95px"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.unit2TenThousand(e.row.total_tips,t.isTenThound))+"\n ")]}}],null,!1,1256669967)}),n("el-table-column",{attrs:{label:"营业收入(净)",align:"center","min-width":"115px"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("div",{staticStyle:{display:"flex","justify-content":"center"},style:""+t.getCurrentValueStyle(e.row.msale_total,e.row.total_tips)},[t._v("\n "+t._s(t.unit2TenThousand(e.row.msale_total,t.isTenThound))+"\n "),n("el-popover",{attrs:{placement:"right",width:200,trigger:"click"},scopedSlots:t._u([{key:"reference",fn:function(){return[n("div",{style:""+t.getCurrentValueStyle(e.row.msale_total,e.row.total_tips)},[n("i",{staticClass:"el-icon-warning-outline trigger-hover",staticStyle:{"font-size":"16px",cursor:"pointer","margin-left":"5px"}})])]},proxy:!0}],null,!0)},[n("div",{staticClass:"table-size"},[n("p",[t._v("直营/自营: "+t._s(t.unit2TenThousand(e.row.info[0][0].monthinfo.msale_total,t.isTenThound)))]),n("p",[t._v("支付渠道: "+t._s(t.unit2TenThousand(e.row.info[0][1].monthinfo.msale_total,t.isTenThound)))]),n("p",[t._v("供应商端: "+t._s(t.unit2TenThousand(e.row.info[0][2].monthinfo.msale_total,t.isTenThound)))])])])],1)]}}],null,!1,877686572)}),n("el-table-column",{attrs:{label:"营收完成%",align:"center","min-width":"85px"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("div",{style:""+t.getCurrentRateStyle(e.row.completion_rate)},[t._v(t._s(("NaN"===String(e.row.completion_rate)?0:e.row.completion_rate)+"%")+"\n ")])]}}],null,!1,3143000876)}),t.costField?[n("el-table-column",{attrs:{label:"毛利目标",align:"center","min-width":"90px"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.costField?t.unit2TenThousand(e.row.cost_tips,t.isTenThound):"***")+"\n ")]}}],null,!1,2600940256)}),n("el-table-column",{attrs:{label:"毛利完成",align:"center","min-width":"90px"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("div",{style:""+t.getCurrentValueStyle(e.row.gross_completion,e.row.cost_tips)},[t._v("\n "+t._s(t.costField?t.unit2TenThousand(e.row.gross_completion,t.isTenThound):"***")+"\n ")])]}}],null,!1,3300465382)})]:t._e(),n("el-table-column",{attrs:{label:"毛利完成%",align:"center","min-width":"85px"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("div",{style:t.getCurrentRateStyle(e.row.gross_completion_rate)},[t._v("\n "+t._s(e.row.gross_completion_rate+"%")+"\n ")])]}}],null,!1,1390167442)}),t.costField?[n("el-table-column",{attrs:{label:"成本合计",align:"center","min-width":"125px"},scopedSlots:t._u([{key:"default",fn:function(e){return[t.costField?n("div",{staticStyle:{display:"flex","justify-content":"center"}},[t._v("\n "+t._s(t.unit2TenThousand(e.row.mcost_total,t.isTenThound))+"\n "),n("el-popover",{attrs:{placement:"right",width:200,trigger:"click"},scopedSlots:t._u([{key:"reference",fn:function(){return[n("i",{staticClass:"el-icon-warning-outline trigger-hover",staticStyle:{"font-size":"16px",cursor:"pointer","margin-left":"5px"}})]},proxy:!0}],null,!0)},[n("div",{staticClass:"table-size"},[n("p",[t._v("直营/自营: "+t._s(t.unit2TenThousand(e.row.info[0][0].monthinfo.mcost_total,t.isTenThound)))]),n("p",[t._v("支付渠道: "+t._s(t.unit2TenThousand(e.row.info[0][1].monthinfo.mcost_total,t.isTenThound)))]),n("p",[t._v("供应商端: "+t._s(t.unit2TenThousand(e.row.info[0][2].monthinfo.mcost_total,t.isTenThound)))]),n("p",[t._v("物流费用: "+t._s(t.unit2TenThousand(e.row.info[0][3].monthinfo.mcost_total,t.isTenThound)))])])])],1):n("p",[t._v("***")])]}}],null,!1,1442372113)}),n("el-table-column",{attrs:{label:"实际毛利率",align:"center",width:"85px"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.costField?t.unit2TenThousand(e.row.gross_sale_completion_rate)+"%":"***")+"\n ")]}}],null,!1,3104583033)})]:t._e()],2)],1)],2)}),[function(){var t=this.$createElement;t=this._self._c||t;return t("div",{staticStyle:{float:"left","line-height":"30px",display:"flex","align-items":"center"}},[t("span",{staticStyle:{"font-size":"15px"}},[this._v("业务公司业绩情况")])])}],!1,null,"222a954c",null).exports;function we(t,e){var n,a=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,n)),a}function xe(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?we(Object(n),!0).forEach((function(e){Object(l.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):we(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Te,Ne={mixins:[e],props:["companies","costField","isTenThound"],data:function(){return{list:[],daytime:"",companyNo:"",loading:!1,isEmpty:!1,cp_companies:[]}},computed:{currentCompanyName:function(){var t=this;return this.companies.find((function(e){return e.value===t.companyNo})).label}},mounted:function(){var t,e,n=this;this.isEmpty=0===this.companies.length,this.isEmpty||(this.cp_companies=this.companies.map((function(t){return xe(xe({},t),{},{label:"万宇"===de[t.label]?"平台公司: 万宇":"泰文创"===de[t.label]?"平台公司: 泰文创":"预订单E企购"===de[t.label]?"预订单E企购":"结算单E企购"===de[t.label]?"结算单E企购":"业务公司: ".concat(de[t.label])})})),e=["平台公司: 万宇","业务公司: 百辰","业务公司: 泓源","业务公司: 普润","业务公司: 锦兴","业务公司: 知事","平台公司: 泰文创","预订单E企购","结算单E企购"],t=this.cp_companies.map((function(t){return t.label})),e=e.filter((function(e){return t.includes(e)})),this.cp_companies=e.map((function(t){return n.cp_companies.find((function(e){return e.label===t}))})),this.hasCompose()&&this.cp_companies.unshift({value:"",label:"万宇 + 预算单E企购"}),this.companyNo=this.cp_companies[0].value,this.daytime=this.transformTime(),this.requestData())},watch:{daytime:{handler:function(){this.requestData()}}},methods:{addition:ot,subtraction:st,unit2TenThousand:lt,hasCompose:function(){var t=this.cp_companies.findIndex((function(t){return"GS2203161855277894"===t.value})),e=this.cp_companies.findIndex((function(t){return"GS2404151642335170"===t.value}));return-1!==t&&-1!==e},setCellClassName:function(t){var e=t.column,n=(t=t.row,e=e.label,"");return-1!==t.depart.indexOf("泰文创")&&(n+="font-bold "),"当月营收目标"===e?n+"bg__success":-1===e.indexOf("营业")&&-1===e.indexOf("营收")||"当日营业收入"===e?"毛利目标"===e?n+"bg__primary":-1!==e.indexOf("毛利")?n+"bg__primary_1":-1!==e.indexOf("成本")?n+"bg__warning_1":n:n+"bg__success_1"},setHeaderClassName:function(t){return t=t.column.label,"当月营收目标"===t?"bg__success":-1===t.indexOf("营业")&&-1===t.indexOf("营收")||"当日营业收入"===t?"毛利目标"===t?"bg__primary":-1!==t.indexOf("毛利")?"bg__primary_1":-1!==t.indexOf("成本")?"bg__warning_1":void 0:"bg__success_1"},getCurrentRateStyle:function(t){var e=at()(this.daytime).daysInMonth(),n=(e=Number(rt(100,e)).toFixed(2),at()(this.daytime).date());n=Number(it(n,e)).toFixed(2);return Number(n)>Number(t)?"color:red":""},getCurrentValueStyle:function(t,e){var n=at()(this.daytime).daysInMonth();e=Number(rt(e,n)).toFixed(2),n=at()(this.daytime).date(),n=Number(it(n,e)).toFixed(2);return Number(n)>Number(t)?"color: red":""},transformTime:function(){var t=new Date,e=t.getFullYear(),n=t.getMonth()+1;t=t.getDate();return e+"-"+(n<10?"0"+n:n)+"-"+(t<10?"0"+t:t)},spanMethod:function(t){var e=t.rowIndex;if(0===t.columnIndex)return{rowspan:t=this.flitterData(this.list).one[e],colspan:0<t?1:0}},flitterData:function(t){var e=[],n=0;return t.forEach((function(a,o){0===o?e.push(1):a.company===t[o-1].company?(e[n]+=1,e.push(0)):(e.push(1),n=o)})),{one:e}},requestData:(Te=Object(c.a)(regeneratorRuntime.mark((function t(){var e,n,a,o,r,i,s,c,u,p=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.loading=!0,this.list=[],e={},""===this.companyNo)return t.next=6,pe.departmentEveryDay({daytime:this.daytime,companyNo:"GS2203161855277894"});t.next=17;break;case 6:return e=t.sent,t.next=9,pe.departmentEveryDay({daytime:this.daytime,companyNo:"GS2404151642335170"});case 9:c=t.sent,n=e.data,a=c.data,o=[],n.forEach((function(t){var e=a.find((function(e){return e.depart===t.depart})),n=Object.keys(t).reduce((function(n,a){return xe(xe({},n),{},Object(l.a)({},a,"depart"===a?t.depart:"total_tips"===a?t.total_tips:Number(ot(t[a],e[a])).toFixed(2)))}),{});o.push(n)})),e.data=o,t.next=20;break;case 17:return t.next=19,pe.departmentEveryDay({daytime:this.daytime,companyNo:this.companyNo});case 19:e=t.sent;case 20:0===e.code&&e.data&&0<e.data.length?(r=(r=(e.data||[]).map((function(t){var e=t.depart,n=t.msale_total,a=t.mth_total,o=t.sale_total,r=t.th_total,i=t.total_tips,s=t.mzy_sale_total,l=t.mchannel_sale_total,c=t.channel_cost_total,u=t.zy_cost_total,p=t.mzy_cost_total;return{depart:e,total_tips:i,mzy_sale_total:s,mchannel_sale_total:l,channel_cost_total:c,zy_cost_total:u,mchannel_cost_total:t.mchannel_cost_total,mzy_cost_total:p,post_fee:t.mpost_fee,dayinfo:{sale_total:o,th_total:r},monthinfo:{msale_total:n,mth_total:a}}}))).filter((function(t){return 0!==Number(t.monthinfo.msale_total)||0!==Number(t.post_fee)})),this.total=r.reduce((function(t,e){var n=e.total_tips,a=e.day;a=void 0===a?0:a,e=e.month,e=void 0===e?0:e;return{total_tips:ot(void 0===n?0:n,t.total_tips),month:ot(e,t.month),day:ot(a,t.day)}}),{total_tips:0,month:0,day:0}),r=r.map((function(t){return t.depart})).map((function(t){return r.find((function(e){return e.depart===t}))})),i={"百辰":"客服部@百辰","泓源":"网络部@泓源","普润":"\t项目部@普润","平台":"\t平台部@泰文创"},s=this.companies.find((function(t){return t.value===p.companyNo})),this.list=r.map((function(t){var e=t.depart,n=t.total_tips,a=t.dayinfo,o=t.monthinfo,r=t.mchannel_sale_total,l=t.mzy_sale_total,c=t.mchannel_cost_total,u=t.post_fee,d=(t=t.mzy_cost_total,st(o.msale_total,o.mth_total)),m=it(rt(d,n),100).toFixed(2);return{total_tips:n,zy_cost:t,qd_cost:c,post_fee:u,depart:i[e],company:s?s.label:"--",currentMonthPure:[{zy:l,qd:r}],zy_gross:Number(st(l,t)).toFixed(2),qd_gross:Number(st(r,c)).toFixed(2),dayinfo:xe(xe({},a),{},{sale_total:st(a.sale_total,a.th_total)}),proportion:it(rt(o.msale_total,p.total.month)||0,100)||0,monthinfo:{monthNetSales:d,monthProportion:m}}})),c=["百辰","泓源","普润","泰文创"],u=this.list.map((function(t){return t.depart})),c=c.filter((function(t){return-1!==u.findIndex((function(e){return e.indexOf(t)}))})),this.list=c.map((function(t){return p.list.find((function(e){return-1!==e.depart.indexOf(t)}))}))):this.list=[],this.getHeight(),this.loading=!1;case 23:case"end":return t.stop()}}),t,this)}))),function(){return Te.apply(this,arguments)})}};n("e80c"),Ne=Object(o.a)(Ne,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}]},[n("div",{staticClass:"search clear"},[n("div",{staticStyle:{float:"left","line-height":"30px",display:"flex","align-items":"center"}},[n("el-popover",{attrs:{placement:"top",width:"200",trigger:"hover",content:"不含业务公司供应商端数据"},scopedSlots:t._u([{key:"reference",fn:function(){return[n("i",{staticClass:"el-icon-warning-outline",staticStyle:{"font-size":"16px",cursor:"pointer","padding-top":"5px","padding-right":"5px",display:"inline-block"}})]},proxy:!0}])}),n("span",{staticStyle:{"font-size":"15px"}},[t._v("部门完成情况")])],1),n("div",{staticStyle:{float:"right"}},[n("el-select",{staticStyle:{"margin-right":"10px",width:"165px"},attrs:{size:"small",disabled:t.isEmpty},on:{change:t.requestData},model:{value:t.companyNo,callback:function(e){t.companyNo=e},expression:"companyNo"}},t._l(t.cp_companies,(function(t){return n("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1),n("el-date-picker",{staticClass:"fr picker no-padding",staticStyle:{width:"100px"},attrs:{disabled:t.isEmpty,"picker-options":{disbaledData:function(t){return t.getTime()>Date.now()}},"value-format":"yyyy-MM-dd",format:"yyyy-MM-dd",editable:!1,clearable:!1,placeholder:"选择日期",size:"small",align:"right",type:"date"},model:{value:t.daytime,callback:function(e){t.daytime=e},expression:"daytime"}})],1)]),t.isEmpty?[n("div",{staticStyle:{"text-align":"center","line-height":"60px","user-select":"none"}},[t._v("当前账号没有访问权限")])]:n("el-row",{staticStyle:{"margin-top":"10px",display:"flex",width:"100%"}},[n("el-table",{attrs:{border:"",size:"mini",data:t.list,"header-cell-class-name":t.setHeaderClassName,"cell-class-name":t.setCellClassName}},[n("el-table-column",{attrs:{fixed:"left",label:"部门",prop:"depart",align:"center",width:"60px"},scopedSlots:t._u([{key:"default",fn:function(e){return t._l(e.row.depart.split("@"),(function(e,a){return n("p",{key:a,staticStyle:{margin:"0px"}},[t._v(t._s(e))])}))}}],null,!1,3338273039)}),n("el-table-column",{attrs:{label:"当日营业收入",align:"center","min-width":"105px"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t.unit2TenThousand(e.row.dayinfo.sale_total,t.isTenThound)))]}}],null,!1,2984776438)}),n("el-table-column",{attrs:{label:"当月营收目标",align:"center","min-width":"115px"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t.unit2TenThousand(e.row.total_tips,t.isTenThound)))]}}],null,!1,1001740975)}),n("el-table-column",{attrs:{label:"当月营业收入(净)",align:"center","min-width":"120px"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("div",{staticStyle:{display:"flex","flex-direction":"column"}},[n("div",{staticStyle:{display:"flex","justify-content":"center","align-items":"center"},style:"text-align: center;"+t.getCurrentValueStyle(e.row.monthinfo.monthNetSales,e.row.total_tips)},[t._v("\n "+t._s(t.unit2TenThousand(e.row.monthinfo.monthNetSales,t.isTenThound))+"\n "),n("el-popover",{attrs:{placement:"right",width:200,trigger:"click"},scopedSlots:t._u([{key:"reference",fn:function(){return[n("p",{style:"text-align: center;"+t.getCurrentValueStyle(e.row.monthinfo.monthNetSales,e.row.total_tips)},[n("i",{staticClass:"el-icon-warning-outline trigger-hover",staticStyle:{"font-size":"16px",cursor:"pointer","margin-left":"5px"}})])]},proxy:!0}],null,!0)},[n("div",{staticClass:"table-size"},[n("p",[t._v("直营/自营: "+t._s(t.unit2TenThousand(e.row.currentMonthPure[0].zy,t.isTenThound)))]),n("p",[t._v("支付渠道: "+t._s(t.unit2TenThousand(e.row.currentMonthPure[0].qd,t.isTenThound)))])])])],1)])]}}],null,!1,3272773755)}),t.costField?[n("el-table-column",{attrs:{label:"当月成本",align:"center","min-width":"120px"},scopedSlots:t._u([{key:"default",fn:function(e){return[t.costField?n("div",{staticStyle:{display:"flex","justify-content":"center","align-items":"center"}},[t._v("\n "+t._s(t.unit2TenThousand(Number(t.addition(Number(t.addition(e.row.zy_cost,e.row.qd_cost)).toFixed(2),e.row.post_fee)).toFixed(2),t.isTenThound))+"\n "),n("el-popover",{attrs:{placement:"right",width:200,trigger:"click"},scopedSlots:t._u([{key:"reference",fn:function(){return[n("p",{staticStyle:{"text-align":"center"}},[n("i",{staticClass:"el-icon-warning-outline trigger-hover",staticStyle:{"font-size":"16px",cursor:"pointer","margin-left":"5px"}})])]},proxy:!0}],null,!0)},[n("div",{staticClass:"table-size"},[n("p",[t._v("直营/自营: "+t._s(t.unit2TenThousand(e.row.zy_cost,t.isTenThound)))]),n("p",[t._v("渠道: "+t._s(t.unit2TenThousand(e.row.qd_cost,t.isTenThound)))]),n("p",[t._v("物流费用: "+t._s(t.unit2TenThousand(e.row.post_fee,t.isTenThound)))])])])],1):n("p",[t._v("***")])]}}],null,!1,2419603932)}),n("el-table-column",{attrs:{align:"center",label:"当月毛利","min-width":"120px"},scopedSlots:t._u([{key:"default",fn:function(e){return[t.costField?n("div",{staticStyle:{display:"flex","justify-content":"center","align-items":"center"}},[t._v("\n "+t._s(t.unit2TenThousand(Number(t.subtraction(Number(t.addition(e.row.zy_gross,e.row.qd_gross)).toFixed(2),e.row.post_fee)).toFixed(2),t.isTenThound))+"\n "),n("el-popover",{attrs:{placement:"right",width:200,trigger:"click"},scopedSlots:t._u([{key:"reference",fn:function(){return[n("p",{staticStyle:{"text-align":"center"}},[n("i",{staticClass:"el-icon-warning-outline trigger-hover",staticStyle:{"font-size":"16px",cursor:"pointer","margin-left":"5px"}})])]},proxy:!0}],null,!0)},[n("div",{staticClass:"table-size"},[n("p",[t._v("直营/自营: "+t._s(t.unit2TenThousand(e.row.zy_gross,t.isTenThound)))]),n("p",[t._v("支付渠道: "+t._s(t.unit2TenThousand(e.row.qd_gross,t.isTenThound)))])])])],1):n("p",[t._v("***")])]}}],null,!1,280266069)})]:t._e()],2)],1)],2)}),[],!1,null,"e365658c",null).exports;function Oe(t,e){var n,a=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,n)),a}function Se(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Oe(Object(n),!0).forEach((function(e){Object(l.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Oe(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}n("6c7b");var je,De={props:["companies","costField","isTenThound"],data:function(){return{loading:!1,daytime:"",tableData:[],companyNo:"",cp_companies:[],isEmpty:!1}},mounted:function(){var t,e=this,n=!1,a=this.companies.findIndex((function(t){return"北京锦兴弘昌科技有限公司"===t.label})),o=this.companies.findIndex((function(t){return"北京普润心堂商贸有限公司"===t.label})),r=this.companies.findIndex((function(t){return"北京知事文化产业发展有限公司"===t.label}));-1===a&&-1===o&&-1===r||(n=!0),this.cp_companies=this.companies.filter((function(t){return"北京锦兴弘昌科技有限公司"!==t.label&&"北京普润心堂商贸有限公司"!==t.label&&"北京知事文化产业发展有限公司"!==t.label})),n&&(this.cp_companies=[].concat(Object(s.a)(this.cp_companies),[{value:"GS2401181650538135",label:"普润&锦兴&知事"}])),this.isEmpty=0===this.cp_companies.length,this.isEmpty||(this.cp_companies=this.cp_companies.map((function(t,e){var n="";return"所有公司"===t.label&&(n="所有公司"),"北京万宇恒通国际科贸有限公司"===t.label&&(n="平台公司: 万宇"),"北京泰文创供应链管理有限公司"===t.label&&(n="平台公司: 泰文创"),"北京元隆雅图文化传播股份有限公司"===t.label&&(n="预订单E企购"),"结算单E企购"===t.label&&(n="结算单E企购"),""===(n="普润&锦兴&知事"===t.label?"业务公司: 普润&锦兴&知事":n)&&(n="业务公司: ".concat(de[t.label])),Se(Se({},t),{},{label:n})})),a=["所有公司","预订单E企购","业务公司: 百辰","业务公司: 泓源","业务公司: 普润&锦兴&知事","平台公司: 泰文创","平台公司: 万宇","结算单E企购"],t=this.cp_companies.map((function(t){return t.label})),a=a.filter((function(e){return t.includes(e)})),this.cp_companies=a.map((function(t){return e.cp_companies.find((function(e){return e.label===t}))})),this.companyNo=this.cp_companies[0].value,this.daytime=this.transformTime(),this.requestData())},methods:{unit2TenThousand:lt,setRowClassName:function(t){return t=t.row,"合计"===t.month?"table-header-color":"当前合计"===t.month?"font-bold":void 0},getCurrentRateStyle:function(t,e){var n=at()().daysInMonth(),a=at()().month()+1;if(!(Number(e)>Number(a))&&"合计"!==e)return Number(e)<Number(a)&&Number(t)<100?"color: red":(e=Number(rt(100,n)).toFixed(2),a=at()().date(),n=Number(it(a,e)).toFixed(2),Number(n)>Number(t)?"color:red":"")},getCurrentValueStyle:function(t,e,n){var a=at()().daysInMonth(),o=at()().month()+1;if(!(Number(n)>Number(o))&&"合计"!==n)return Number(n)<Number(o)&&Number(t)<Number(e)?"color: red":(n=Number(rt(e,a)).toFixed(2),o=at()().date(),e=Number(it(o,n)).toFixed(2),Number(e)>Number(t)?"color: red":"")},setCellClassName:function(t){var e=t.column;if("合计"!==t.row.month)return t=e.label,"营收目标"===t?"bg__success":-1!==t.indexOf("营业")||-1!==t.indexOf("营收")?"bg__success_1":"毛利目标"===t?"bg__primary":-1!==t.indexOf("毛利")?"bg__primary_1":-1!==t.indexOf("成本")?"bg__warning_1":void 0},setHeaderClassName:function(t){return t=t.column.label,"营收目标"===t?"bg__success":-1!==t.indexOf("营业")||-1!==t.indexOf("营收")?"bg__success_1":"毛利目标"===t?"bg__primary":-1!==t.indexOf("毛利")?"bg__primary_1":-1!==t.indexOf("成本")?"bg__warning_1":void 0},transformTime:function(){var t=new Date,e=t.getFullYear(),n=t.getMonth()+1;t=t.getDate();return e+"-"+(n<10?"0"+n:n)+"-"+(t<10?"0"+t:t)},requestData:(je=Object(c.a)(regeneratorRuntime.mark((function t(){var e,n,a,o=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.loading=!0,t.next=3,pe.companyEvery({year:this.daytime.split("-")[0],companyNo:this.companyNo});case 3:e=t.sent,t.t0=Number(e.code),t.next=0===t.t0?7:16;break;case 7:return this.tableData=(e.data||[]).map((function(t){var e=st(t.sale_total,t.th_total),n=it(rt(e,t.total_tips),100),a=st(t.cgd_total,t.cgd_th_total),o=st(e,a);return{pure_sale:e,pure_purch:a,pure_profit:o,completion_rate:n,pure_interest_rate:it(rt(o,e)||0,100),month:t.month,cost_tips:t.cost_tips,total_tips:t.total_tips,cost_rate:0===Number(t.cost_tips)?0:it(rt(o,t.cost_tips)||0,100).toFixed(2)}})),(n=new Array(Number(at()().format("M"))).fill(0).reduce((function(t,e,n){return{pure_sale:Number(ot(t.pure_sale,o.tableData[n].pure_sale)).toFixed(2),pure_purch:Number(ot(t.pure_purch,o.tableData[n].pure_purch)).toFixed(2),pure_profit:Number(ot(t.pure_profit,o.tableData[n].pure_profit)).toFixed(2),completion_rate:Number(ot(t.completion_rate,o.tableData[n].completion_rate)).toFixed(2),pure_interest_rate:Number(ot(t.pure_interest_rate,o.tableData[n].pure_interest_rate)).toFixed(2),total_tips:Number(ot(t.total_tips,o.tableData[n].total_tips)).toFixed(2),cost_tips:Number(ot(t.cost_tips,o.tableData[n].cost_tips)).toFixed(2),cost_rate:Number(ot(t.cost_rate,o.tableData[n].cost_rate)).toFixed(2),month:"当前合计"}}),{pure_sale:0,pure_purch:0,pure_profit:0,completion_rate:0,pure_interest_rate:0,month:"当前合计",cost_tips:0,total_tips:0,cost_rate:0})).completion_rate=it(rt(n.pure_sale,n.total_tips)||0,100),n.cost_rate=0===Number(n.cost_tips)?0:it(rt(n.pure_profit,n.cost_tips)||0,100).toFixed(2),(a=this.tableData.reduce((function(t,e){return{pure_sale:Number(ot(t.pure_sale,e.pure_sale)).toFixed(2),pure_purch:Number(ot(t.pure_purch,e.pure_purch)).toFixed(2),pure_profit:Number(ot(t.pure_profit,e.pure_profit)).toFixed(2),completion_rate:Number(ot(t.completion_rate,e.completion_rate)).toFixed(2),pure_interest_rate:Number(ot(t.pure_interest_rate,e.pure_interest_rate)).toFixed(2),total_tips:Number(ot(t.total_tips,e.total_tips)).toFixed(2),cost_tips:Number(ot(t.cost_tips,e.cost_tips)).toFixed(2),cost_rate:Number(ot(t.cost_rate,e.cost_rate)).toFixed(2),month:"合计"}}),{pure_sale:0,pure_purch:0,pure_profit:0,completion_rate:0,pure_interest_rate:0,month:"合计",cost_tips:0,total_tips:0,cost_rate:0})).completion_rate=it(rt(a.pure_sale,a.total_tips)||0,100),a.cost_rate=0===Number(a.cost_tips)?0:it(rt(a.pure_profit,a.cost_tips)||0,100).toFixed(2),this.tableData=[n].concat(Object(s.a)(this.tableData),[a]),t.abrupt("break",17);case 16:return t.abrupt("break",17);case 17:this.loading=!1;case 18:case"end":return t.stop()}}),t,this)}))),function(){return je.apply(this,arguments)})}};function ke(t,e){var n,a=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,n)),a}function Ce(t){return ze[String(t)]}n("8600");ve={name:"newReport",components:{ResultCompanyBu:ve,UnusualState:S,ResultCompany:_e,ResultDepartment:Ne,PeriodDatePicker:Et,ResultCompanyMonth:Object(o.a)(De,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}]},[n("div",{staticClass:"search",staticStyle:{"align-items":"center"}},[n("div",{staticStyle:{float:"left","line-height":"30px",display:"flex","align-items":"center"}},[n("el-popover",{attrs:{placement:"top",width:"300",trigger:"hover",content:"9-12月目标据1-8月实际完成情况重新测定设置"},scopedSlots:t._u([{key:"reference",fn:function(){return[n("i",{staticClass:"el-icon-warning-outline",staticStyle:{"font-size":"16px",cursor:"pointer","padding-top":"5px","padding-right":"5px",display:"inline-block"}})]},proxy:!0}])}),n("span",{staticStyle:{"font-size":"15px"}},[t._v("年度完成情况")])],1),n("div",{staticStyle:{float:"right"}},[n("el-select",{staticStyle:{"margin-right":"10px",width:"160px"},attrs:{size:"small",disabled:t.isEmpty},on:{change:t.requestData},model:{value:t.companyNo,callback:function(e){t.companyNo=e},expression:"companyNo"}},t._l(t.cp_companies,(function(t){return n("el-option",{key:t.id,attrs:{value:t.value,label:t.label}})})),1),n("el-date-picker",{staticClass:"fr picker no-padding",staticStyle:{width:"65px"},attrs:{"value-format":"yyyy",editable:!1,disabled:t.isEmpty,clearable:!1,size:"small",type:"year",format:"yyyy",align:"right",placeholder:"选择日期","picker-options":{disabledDate:function(t){return t.getTime()>Date.now()}}},on:{change:t.requestData},model:{value:t.daytime,callback:function(e){t.daytime=e},expression:"daytime"}})],1)]),t.isEmpty?[n("div",{staticStyle:{"text-align":"center","line-height":"60px","user-select":"none"}},[t._v("当前账号没有访问权限")])]:n("el-row",{staticStyle:{"margin-top":"10px"}},[n("el-table",{attrs:{border:"",size:"mini",data:t.tableData,"header-cell-class-name":t.setHeaderClassName,"row-class-name":t.setRowClassName,"cell-class-name":t.setCellClassName}},[n("el-table-column",{attrs:{fixed:"left",label:"月度",prop:"month",align:"center",width:"70px"}}),n("el-table-column",{attrs:{label:"营收目标",align:"center","min-width":"115px"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.unit2TenThousand(e.row.total_tips,t.isTenThound))+"\n ")]}}],null,!1,2687046287)}),n("el-table-column",{attrs:{label:"营业收入(净)",align:"center","min-width":"115px"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("div",{style:t.getCurrentValueStyle(e.row.pure_sale,e.row.total_tips,e.row.month)},[t._v("\n "+t._s(t.unit2TenThousand(e.row.pure_sale,t.isTenThound))+"\n ")])]}}],null,!1,4055359095)}),n("el-table-column",{attrs:{label:"营收完成%",align:"center","min-width":"95px"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("div",{style:t.getCurrentRateStyle(e.row.completion_rate,e.row.month)},[t._v("\n "+t._s("NaN"===String(e.row.completion_rate)?"0%":Number(e.row.completion_rate).toFixed(2)+"%")+"\n ")])]}}],null,!1,88205757)}),t.costField?[n("el-table-column",{attrs:{label:"毛利目标",align:"center","min-width":"115px"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.costField?t.unit2TenThousand(e.row.cost_tips,t.isTenThound):"***")+"\n ")]}}],null,!1,3339256288)}),n("el-table-column",{attrs:{label:"毛利完成",align:"center","min-width":"115px"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("div",{style:t.getCurrentValueStyle(e.row.pure_profit,e.row.cost_tips,e.row.month)},[t._v("\n "+t._s(t.costField?t.unit2TenThousand(e.row.pure_profit,t.isTenThound):"***")+"\n ")])]}}],null,!1,2649462680)})]:t._e(),n("el-table-column",{attrs:{label:"毛利完成%",align:"center","min-width":"95px"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("div",{style:t.getCurrentRateStyle(e.row.cost_rate,e.row.month)},[t._v("\n "+t._s(Number(e.row.cost_rate).toFixed(2)+"%")+"\n ")])]}}],null,!1,2798921564)})],2),n("div",{staticStyle:{height:"100px"}})],1)],2)}),[],!1,null,"448c5759",null).exports},data:function(){return{companies:[],costField:!1,zxTotal:0,daytime:"",isDisplay:!1,isTenThound:!0,state:{message:"",error:!1,loading:!1}}},mounted:function(){O("code")?this.requestUserinfo():this.login()},methods:{time:(Re=Object(c.a)(regeneratorRuntime.mark((function t(e){var n,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.startTime,a=e.endTime,this.start=n||"",this.end=a||"",n=this.start,a=this.end,""!==n&&""===a||""===n&&""!==a)return this.$message.warning("时间区间不完整!"),this.date=[],t.abrupt("return");t.next=8;break;case 8:this.start&&this.end?this.date=[this.start+" 00:00:00",this.end+" 23:59:59"]:this.date=[this.start,this.end];case 9:case"end":return t.stop()}}),t,this)}))),function(t){return Re.apply(this,arguments)}),requestUserinfo:(Pe=Object(c.a)(regeneratorRuntime.mark((function t(){var e,n,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.state.loading=!0,e=T(),n=O("code"),t.next=5,v(function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ke(Object(n),!0).forEach((function(e){Object(l.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ke(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},e?{openid:e}:{code:n}));case 5:a=t.sent,this.companies=a.data.companyArr.reduce((function(t,e){return e.info.includes(6)||e.info.includes("6")?[].concat(Object(s.a)(t),[{value:e.companyNo,label:e.companyName}]):t}),[]),this.state.loading=!1,t.t0=Number(a.code),t.next=0===t.t0?11:15;break;case 11:return this.isShow=(a.data.is_show||[]).includes(6)||(a.data.is_show||[]).includes("6"),this.costField=(a.data.is_show||[]).includes("cost_field"),x(a.data.openid),t.abrupt("break",19);case 15:return this.state.error=!0,e&&N(),this.state.message=a.message,t.abrupt("break",19);case 19:case"end":return t.stop()}}),t,this)}))),function(){return Pe.apply(this,arguments)}),login:function(){var t=encodeURIComponent("http://stat.caixiao365.com/accountsReceivable"),e="wx_"+Math.random().toString(36).substr(2,15);t="".concat("https://open.weixin.qq.com/connect/oauth2/authorize","?appid=").concat(config.appId,"&redirect_uri=").concat(t,"&response_type=code&scope=").concat("snsapi_userinfo","&state=").concat(e,"#wechat_redirect");window.location.href=t}}},n("2ea5"),_e=Object(o.a)(ve,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{directives:[{name:"loading",rawName:"v-loading",value:t.state.loading,expression:"state.loading"}],staticClass:"new-results",staticStyle:{"min-height":"300px"}},[!t.state.error&&t.isShow?n("div",[n("div",{staticStyle:{color:"red",display:"flex","align-items":"center","justify-content":"space-between",width:"100%",padding:"5px 10px","box-sizing":"border-box"}},[n("el-popover",{attrs:{placement:"top-start",width:200,trigger:"hover",content:"以下报表一小时更新一次"},scopedSlots:t._u([{key:"reference",fn:function(){return[n("i",{staticClass:"el-icon-warning-outline",staticStyle:{"font-size":"22px",cursor:"pointer"}})]},proxy:!0}],null,!1,3390336504)}),n("el-switch",{attrs:{"active-text":"万元","inactive-text":"元"},model:{value:t.isTenThound,callback:function(e){t.isTenThound=e},expression:"isTenThound"}})],1),n("div",{staticClass:"container"},[n("result-company-bu",{attrs:{companies:t.companies,isTenThound:t.isTenThound,costField:t.costField}}),n("result-company",{attrs:{companies:t.companies,isTenThound:t.isTenThound,costField:t.costField}}),n("result-department",{attrs:{companies:t.companies,isTenThound:t.isTenThound,costField:t.costField}}),n("result-company-month",{attrs:{companies:t.companies,isTenThound:t.isTenThound,costField:t.costField}})],1)]):t.state.loading?t._e():[n("unusual-state",{attrs:{hasPermission:t.isShow,message:t.state.message,path:"newReport"}})]],2)}),[],!1,null,"49e60866",null).exports;var Pe,Re,Fe="http://rep.report.caixiao365.com/admin/Everyday/",Ee=function(t,e){return p(Fe+"departEveryDay",t,"post",e)},Me=function(t,e){return p(Fe+"companyEveryMonth",t,"post",e)},Ae={1:"自营",2:"渠道",3:"供应商端"},ze={"泓源":"泓源广诚","普润":"普润心堂","百辰":"百辰荣达","平台":"平台部"},Ie={"泓源":"泓源广诚","普润":"普润心堂&锦兴弘昌","百辰":"百辰荣达","平台":"平台部"};function qe(t,e){var n,a;try{n=t.toString().split(".")[1].length}catch(t){n=0}try{a=e.toString().split(".")[1].length}catch(t){a=0}return(t*(t=Math.pow(10,Math.max(n,a)))+e*t)/t}function Le(t,e){var n=0,a=0;try{n=t.toString().split(".")[1].length}catch(t){}try{a=e.toString().split(".")[1].length}catch(t){}return $e(Number(t.toString().replace(".",""))/Number(e.toString().replace(".","")),Math.pow(10,a-n))}function $e(t,e){var n=0;t=t.toString(),e=e.toString();try{n+=t.split(".")[1].length}catch(t){}try{n+=e.split(".")[1].length}catch(t){}return Number(t.replace(".",""))*Number(e.replace(".",""))/Math.pow(10,n)}function He(t,e){var n,a;try{n=t.toString().split(".")[1].length}catch(t){n=0}try{a=e.toString().split(".")[1].length}catch(t){a=0}return((t*(t=Math.pow(10,Math.max(n,a)))-e*t)/t).toFixed(a<=n?n:a)}function Ue(t){return NaN===t||"NaN"===t||0===Number(t)?"0":t<1e3&&0<t||t<0&&-1e3<t?Number(t).toFixed(2):Le(t,1e4).toFixed(2)+"W"}function Ye(t,e){var n,a=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,n)),a}function Ge(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ye(Object(n),!0).forEach((function(e){Object(l.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ye(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Ve,Qe,Be,We;Ne={name:"WanyuReport",props:["date"],mixins:[e],watch:{date:function(t){(this.dataTime=t)&&this.searchList()}},data:function(){return{total:{completion:0,total_tips:0},mapResponseCompletionCompanyName:Ie,dataTime:this.date,loading:!1,maxHeight:"0",tableData:[]}},computed:{stats:function(){var t=this.total,e=t.day,n=t.month;t=t.total_tips;return{day:Ue(e),month:Ue(n),total_tips:Ue(t),completionRate:$e(Le(n,t)||0,100)+"%"}}},created:(Qe=Object(c.a)(regeneratorRuntime.mark((function t(){var e=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:window.onresize=function(){e.getHeight()};case 1:case"end":return t.stop()}}),t)}))),function(){return Qe.apply(this,arguments)}),mounted:function(){var t=this;this.$nextTick((function(){t.getHeight()})),this.searchList()},methods:{division:Le,getCompanyLabel:Ce,unit2TenThousand:Ue,tableRowClassName:function(t){var e=t.row;t=t.rowIndex;return e&&e.child&&0<e.child.length||0===t?"warning-row":""},searchList:(Ve=Object(c.a)(regeneratorRuntime.mark((function t(){var e,n,a=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.loading=!0,this.tableData=[],t.next=4,Ee({daytime:this.date,companyNo:"GS2203161855277894"});case 4:0===(n=t.sent).code&&n.data&&0<n.data.length?(e=(n.data||[]).map((function(t){var e=t.depart,n=t.msale_total,a=t.mth_total,o=t.sale_total,r=t.th_total;return{depart:e,total_tips:t.total_tips,dayinfo:{sale_total:o,th_total:r},monthinfo:{msale_total:n,mth_total:a}}})),this.total=e.reduce((function(t,e){var n=e.total_tips,a=e.day;a=void 0===a?0:a,e=e.month,e=void 0===e?0:e;return{total_tips:qe(void 0===n?0:n,t.total_tips),month:qe(e,t.month),day:qe(a,t.day)}}),{total_tips:0,month:0,day:0}),e=["百辰","泓源","普润","平台"].map((function(t){return e.find((function(e){return e.depart===t}))})),this.tableData=e.map((function(t){var e=t.depart,n=t.total_tips,o=t.dayinfo,r=(t=t.monthinfo,He(t.msale_total,t.mth_total)),i=$e(Le(r,n),100).toFixed(2);return{depart:e,total_tips:n,dayinfo:Ge(Ge({},o),{},{sale_total:He(o.sale_total,o.th_total)}),monthinfo:{monthNetSales:r,monthProportion:i},proportion:$e(Le(t.msale_total,a.total.month)||0,100)||0}})),this.total={completion:this.tableData.reduce((function(t,e){return qe(t,e.monthinfo.monthNetSales)}),0),total_tips:this.tableData.reduce((function(t,e){return qe(t,e.total_tips)}),0)},n=$e(Le(this.total.completion,this.total.total_tips)||0,100).toFixed(2)+"%",this.total=Ge(Ge({},this.total),{},{completionRate:n})):this.tableData=[],this.getHeight(),this.loading=!1;case 8:case"end":return t.stop()}}),t,this)}))),function(){return Ve.apply(this,arguments)})}},n("4bba"),De=Object(o.a)(Ne,(function(){var t=this,e=t.$createElement;e=t._self._c||e;return e("div",{staticClass:"SalesReportRejectedNew"},[e("div",{staticClass:"table-header",staticStyle:{"line-height":"36px"}},[t._v("北京万宇恒通国际科贸有限公司")]),e("el-table",{staticStyle:{"margin-bottom":"-1px"},attrs:{size:"mini",border:"",data:[t.total]}},[e("el-table-column",{attrs:{label:"月指标",prop:"total_tips"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.unit2TenThousand(e.row.total_tips))+"\n ")]}}])}),e("el-table-column",{attrs:{label:"完成额",prop:"completion"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.unit2TenThousand(e.row.completion))+"\n ")]}}])}),e("el-table-column",{attrs:{label:"完成率"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.completionRate)+"\n ")]}}])})],1),e("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{border:"",data:t.tableData,"max-height":t.maxHeight,size:"mini","row-key":"id","default-expand-all":"","tree-props":{children:"child",hasChildren:"hasChildren"}}},[e("el-table-column",{attrs:{label:"部门",fixed:"left",width:"80",prop:"depart"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t.mapResponseCompletionCompanyName[e.row.depart]||e.row.depart))]}}])}),e("el-table-column",{attrs:{label:"本日销售额","min-width":"100",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.unit2TenThousand(e.row.dayinfo.sale_total))+"\n ")]}}])}),e("el-table-column",{attrs:{label:"本月金额","min-width":"120",align:"center"}},[e("el-table-column",{attrs:{label:"销售指标",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.unit2TenThousand(e.row.total_tips))+"\n ")]}}])}),e("el-table-column",{attrs:{label:"净销售",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.unit2TenThousand(e.row.monthinfo.monthNetSales))+"\n ")]}}])}),e("el-table-column",{attrs:{label:"净销售完成率",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.monthinfo.monthProportion)+"%\n ")]}}])})],1)],1)],1)}),[],!1,null,"0630d680",null).exports,ve={name:"WanyuTypeReport",props:["date"],mixins:[e],watch:{date:function(t){(this.dataTime=t)&&this.searchList()}},data:function(){return{total:{day:0,month:0,total_tips:0},mapResponseCompletionCompanyName:Ie,dataTime:this.date,loading:!1,maxHeight:"0",tableData:[]}},created:(We=Object(c.a)(regeneratorRuntime.mark((function t(){var e=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:window.onresize=function(){e.getHeight()};case 1:case"end":return t.stop()}}),t)}))),function(){return We.apply(this,arguments)}),mounted:function(){var t=this;this.$nextTick((function(){t.getHeight()})),this.searchList()},methods:{getCompanyLabel:Ce,unit2TenThousand:Ue,objectSpanMethod:function(t){t.row,t.column;var e=t.rowIndex;if(0===t.columnIndex)return e%2==0?{rowspan:2,colspan:1}:{rowspan:0,colspan:0}},searchList:(Be=Object(c.a)(regeneratorRuntime.mark((function t(){var e,n,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.loading=!0,this.tableData=[],t.next=4,Ee({daytime:this.date,companyNo:"GS2203161855277894"});case 4:0===(e=t.sent).code&&e.data&&0<e.data.length?(n=e.data.reduce((function(t,e){var n=e.mzy_sale_total,a=e.zy_sale_total,o=e.mchannel_sale_total,r=e.channel_sale_total,i=qe(o,n)||0,l=$e(Le(n,i)||0,100).toFixed(2);return i=0!==Number(l)||0!==$e(Le(o,i)||0,100)?Number(100-Number(l)).toFixed(2):0,[].concat(Object(s.a)(t),[{depart:e.depart,type:"直营",month:n,day:a,proportion:l},{depart:e.depart,type:"渠道",month:o,day:r,proportion:i}])}),[]),a=[],["百辰","泓源","普润","平台"].forEach((function(t){return n.forEach((function(e){e.depart===t&&a.push(e)}))})),this.tableData=a):this.tableData=[],this.getHeight(),this.loading=!1;case 8:case"end":return t.stop()}}),t,this)}))),function(){return Be.apply(this,arguments)})}},n("10b5"),Ne=Object(o.a)(ve,(function(){var t=this,e=t.$createElement;e=t._self._c||e;return e("div",{staticClass:"SalesReportRejectedNew"},[e("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{data:t.tableData,border:"","max-height":t.maxHeight,size:"mini","row-key":"id","span-method":t.objectSpanMethod,stripe:""}},[e("el-table-column",{attrs:{label:"部门",fixed:"left",width:"80",prop:"depart"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t.mapResponseCompletionCompanyName[e.row.depart]||e.row.depart))]}}])}),e("el-table-column",{attrs:{label:"业绩类型",prop:"type",align:"center"}}),e("el-table-column",{attrs:{label:"日净销售额",prop:"day",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.unit2TenThousand(e.row.day))+"\n ")]}}])}),e("el-table-column",{attrs:{label:"月净销售额",prop:"month",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.unit2TenThousand(e.row.month))+"\n ")]}}])}),e("el-table-column",{attrs:{label:"月占比",prop:"proportion",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.proportion)+"%\n ")]}}])})],1)],1)}),[],!1,null,"70b769e6",null).exports;function Ke(t,e){var n,a=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,n)),a}function Ze(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ke(Object(n),!0).forEach((function(e){Object(l.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ke(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Je,Xe;ve={name:"WanyuCompletion",props:["date"],mixins:[e],watch:{date:function(t){(this.dataTime=t)&&this.searchList()}},data:function(){return{total:{completion:0,total_tips:0},dataTime:this.date,loading:!1,maxHeight:"0",tableData:[]}},computed:{stats:function(){var t=this.total,e=t.day,n=t.month;t=t.total_tips;return{day:Ue(e),month:Ue(n),total_tips:Ue(t),completionRate:$e(Le(n,t)||0,100)+"%"}}},created:(Xe=Object(c.a)(regeneratorRuntime.mark((function t(){var e=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:window.onresize=function(){e.getHeight()};case 1:case"end":return t.stop()}}),t)}))),function(){return Xe.apply(this,arguments)}),mounted:function(){var t=this;this.$nextTick((function(){t.getHeight()})),this.searchList()},methods:{getCompanyCompletionLabel:function(t){return Ie[String(t)]},unit2TenThousand:Ue,division:Le,tableRowClassName:function(t){var e=t.row;t=t.rowIndex;return e&&e.child&&0<e.child.length||0===t?"warning-row":""},searchList:(Je=Object(c.a)(regeneratorRuntime.mark((function t(){var e,n,a,o,r,i=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.loading=!0,this.tableData=[],t.next=4,Ee({daytime:this.date,companyNo:"GS2203161855277894"});case 4:return e=t.sent,t.next=7,Me({daytime:this.date});case 7:r=t.sent,0===e.code&&e.data&&0<e.data.length&&0===r.code&&r.data&&0<r.data.length?(n=r.data.reduce((function(t,e){return Ze(Ze({},t),{},Object(l.a)({},e.companyName,He(e.monthinfo[2].msale_total,e.monthinfo[2].mth_total)))}),{}),a=r.data.reduce((function(t,e){return Ze(Ze({},t),{},Object(l.a)({},e.companyName,He(e.dayinfo[2].sale_total,e.dayinfo[2].th_total)))}),{}),o=(e.data||[]).map((function(t){var e=t.depart,n=t.msale_total,a=t.mth_total,o=t.sale_total,r=t.th_total;return{depart:e,total_tips:t.total_tips,dayinfo:{sale_total:o,th_total:r},monthinfo:{msale_total:n,mth_total:a}}})),o=["百辰","泓源","普润","平台"].map((function(t){return o.find((function(e){return e.depart===t}))})),this.total=o.reduce((function(t,e){var n=e.total_tips,a=e.day;a=void 0===a?0:a,e=e.month,e=void 0===e?0:e;return{total_tips:qe(void 0===n?0:n,t.total_tips),month:qe(e,t.month),day:qe(a,t.day)}}),{total_tips:0,month:0,day:0}),this.tableData=o.map((function(t){var e=t.depart,o=t.total_tips,r=t.dayinfo,s=(t=t.monthinfo,He(t.msale_total,t.mth_total)),l=He(r.sale_total,r.th_total),c=Object.keys(n).find((function(t){return t.includes(e)})),u=Object.keys(a).find((function(t){return t.includes(e)}));c&&(s=qe(s,n[c])),u&&(l=qe(l,a[u])),c=$e(Le(s,o),100).toFixed(2);return{depart:e,total_tips:o,dayinfo:Ze(Ze({},r),{},{sale_total:l}),monthinfo:{monthNetSales:s,monthProportion:c},proportion:$e(Le(t.msale_total,i.total.month)||0,100)||0}})),this.total={completion:this.tableData.reduce((function(t,e){return qe(t,e.monthinfo.monthNetSales)}),0),total_tips:this.tableData.reduce((function(t,e){return qe(t,e.total_tips)}),0)},r=$e(Le(this.total.completion,this.total.total_tips)||0,100).toFixed(2)+"%",this.total=Ze(Ze({},this.total),{},{completionRate:r})):this.tableData=[],this.getHeight(),this.loading=!1;case 11:case"end":return t.stop()}}),t,this)}))),function(){return Je.apply(this,arguments)})}},n("824d"),ve=Object(o.a)(ve,(function(){var t=this,e=t.$createElement;e=t._self._c||e;return e("div",{staticClass:"SalesReportRejectedNew"},[e("h3",[t._v("\n 整体搞了 "+t._s(t.unit2TenThousand(t.total.completion))+"元(万宇平台+业务公司供应商端)\n ")]),e("el-table",{staticStyle:{"margin-bottom":"-1px"},attrs:{size:"mini",border:"",data:[t.total]}},[e("el-table-column",{attrs:{label:"月指标",prop:"total_tips"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.unit2TenThousand(e.row.total_tips))+"\n ")]}}])}),e("el-table-column",{attrs:{label:"完成额",prop:"completion"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.unit2TenThousand(e.row.completion))+"\n ")]}}])}),e("el-table-column",{attrs:{label:"完成率"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.completionRate)+"\n ")]}}])})],1),e("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{data:t.tableData,border:"","max-height":t.maxHeight,size:"mini","row-key":"id","default-expand-all":"","tree-props":{children:"child",hasChildren:"hasChildren"}}},[e("el-table-column",{attrs:{label:"部门",fixed:"left",width:"80",prop:"depart"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t.getCompanyCompletionLabel(e.row.depart)))]}}])}),e("el-table-column",{attrs:{label:"本日销售额","min-width":"100",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.unit2TenThousand(e.row.dayinfo.sale_total))+"\n ")]}}])}),e("el-table-column",{attrs:{label:"本月金额","min-width":"120",align:"center"}},[e("el-table-column",{attrs:{label:"销售指标",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.unit2TenThousand(e.row.total_tips))+"\n ")]}}])}),e("el-table-column",{attrs:{label:"净销售",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.unit2TenThousand(e.row.monthinfo.monthNetSales))+"\n ")]}}])}),e("el-table-column",{attrs:{label:"净销售完成率",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.monthinfo.monthProportion)+"%\n ")]}}])})],1)],1)],1)}),[],!1,null,"5d95ed13",null).exports;function tn(t,e){var n,a=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,n)),a}function en(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?tn(Object(n),!0).forEach((function(e){Object(l.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):tn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var nn,an,on={name:"DepartmentReport",props:["date","companyNo","index"],mixins:[e],watch:{date:function(t){(this.dataTime=t)&&this.searchList()}},computed:{stats:function(){var t=this.total,e=t.month,n=t.monthReturn;t=t.total_tips,e=He(e,n),n=$e(Le(e,t)||0,100);return{month:Ue(e),total_tips:Ue(t),completionRate:n?n.toFixed(2)+"%":n+"%"}}},data:function(){return{total:{day:0,month:0,total_tips:0,monthReturn:0},companyName:"",mapReponseType:Ae,dataTime:this.date,loading:!1,maxHeight:"0",tableData:[]}},created:(an=Object(c.a)(regeneratorRuntime.mark((function t(){var e=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:window.onresize=function(){e.getHeight()};case 1:case"end":return t.stop()}}),t)}))),function(){return an.apply(this,arguments)}),mounted:function(){var t=this;this.$nextTick((function(){t.getHeight()})),this.searchList()},methods:{getTypeLabel:function(t){return Ae[String(t)]},unit2TenThousand:Ue,tableRowClassName:function(t){var e=t.row;t=t.rowIndex;return e&&e.child&&0<e.child.length||0===t?"warning-row":""},getDiffDay:function(){var t=Date.parse(this.date),e=Date.parse("2023-04-17 00:00:00");return Math.floor((t-e)/864e5)},searchList:(nn=Object(c.a)(regeneratorRuntime.mark((function t(){var e,n,a,o,r,i=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.loading=!0,this.tableData=[],t.next=4,Me({daytime:this.date,companyNo:this.companyNo});case 4:o=t.sent,r=this.getDiffDay()<0&&"GS2302231323386950"===this.companyNo,0===o.code&&o.data&&0<o.data.length?(o=o.data[0]||[],a=o.monthinfo,e=void 0===a?[]:a,a=o.dayinfo,n=void 0===a?[]:a,a=o.total_tips,a=void 0===a?0:a,o=o.companyName,e[1]=en({},r?{msale_total:qe(e[1].msale_total,e[2].msale_total),mth_total:qe(e[1].mth_total,e[2].mth_total),type:"2"}:e[1]),e[0]=en({},r?{msale_total:0,mth_total:0,type:"1"}:e[0]),e[2]=en({},r?{msale_total:0,mth_total:0,type:"3"}:e[2]),this.companyName=o,r=Object.keys(Ae),this.total={total_tips:Number(a),day:n.reduce((function(t,e){return e=e.sale_total,qe(t,void 0===e?"0":e)}),0),month:e.reduce((function(t,e){return e=e.msale_total,qe(t,void 0===e?"0":e)}),0),monthReturn:e.reduce((function(t,e){return e=e.mth_total,qe(t,void 0===e?"0":e)}),0)},this.tableData=r.map((function(t){var a=e.find((function(e){return String(e.type)===t}))||{},o=n.find((function(e){return String(e.type)===t}))||{},r=(a=He(a.msale_total,a.mth_total)||0,He(i.total.month,i.total.monthReturn));return{type:t,dayinfo:en(en({},o),{},{sale_total:He(o.sale_total,o.th_total)||0}),monthinfo:en(en({},e),{},{msale_total:a}),proportion:$e(Le(a,Number(r).toFixed(2))||0,100).toFixed(2)}}))):this.tableData=[],this.getHeight(),this.loading=!1;case 9:case"end":return t.stop()}}),t,this)}))),function(){return nn.apply(this,arguments)})}},rn=(on=(n("d187"),Object(o.a)(on,(function(){var t=this,e=t.$createElement;e=t._self._c||e;return e("div",{staticClass:"SalesReportRejectedNew"},[e("div",{staticClass:"table-header"},[t._v(t._s(t.index)+"."+t._s(t.companyName||"--"))]),e("el-table",{staticClass:"table-sub__header",staticStyle:{"margin-top":"10px","margin-bottom":"-1px"},attrs:{data:[t.stats],size:"mini",border:""}},[e("el-table-column",{attrs:{align:"center",prop:"total_tips",label:"月指标"}}),e("el-table-column",{attrs:{align:"center",prop:"month",label:"完成额"}}),e("el-table-column",{attrs:{align:"center",prop:"completionRate",label:"完成率"}})],1),e("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{data:t.tableData,border:"","max-height":t.maxHeight,size:"mini","row-key":"id","default-expand-all":"","tree-props":{children:"child",hasChildren:"hasChildren"}}},[e("el-table-column",{attrs:{prop:"type",label:"业绩类型",width:"70"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.getTypeLabel(e.row.type))+"\n ")]}}])}),e("el-table-column",{attrs:{label:"本日销售额","max-width":"120",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.unit2TenThousand(e.row.dayinfo.sale_total))+"\n ")]}}])}),e("el-table-column",{attrs:{label:"本月销售额","max-width":"120",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.unit2TenThousand(e.row.monthinfo.msale_total))+"\n ")]}}])}),e("el-table-column",{attrs:{label:"月占比",prop:"proportion",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.proportion)+"%\n ")]}}])})],1)],1)}),[],!1,null,"41456797",null).exports),{name:"ControlDisplay",props:["companyArr","hasPlatformDimension"],data:function(){return{date:""}},mounted:function(){this.date=this.transformTime()},methods:{transformTime:function(){var t=new Date,e=t.getFullYear(),n=t.getMonth()+1;t=t.getDate();return e+"-"+(n<10?"0"+n:n)+"-"+(t<10?"0"+t:t)}}}),sn=(rn=(n("729b0"),Object(o.a)(rn,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"app-main"},[n("div",{staticClass:"app-main-zhunbeixuanzhuan"},[n("div",{staticClass:"app-main-xuanzhuan"},[n("div",{staticClass:"search clear"},[n("el-date-picker",{staticClass:"fr picker",staticStyle:{"margin-top":"10px"},attrs:{size:"small",editable:!1,clearable:!1,"value-format":"yyyy-MM-dd",format:"yyyy-MM-dd",type:"date",align:"right",placeholder:"选择日期","picker-options":{disabledDate:function(t){return t.getTime()>Date.now()}}},model:{value:t.date,callback:function(e){t.date=e},expression:"date"}})],1),t.hasPlatformDimension&&t.date?[n("wanyu-completion",{attrs:{date:t.date}}),n("h3",[t._v("平台维度")]),n("el-row",{staticClass:"myul",attrs:{gutter:20}},[n("el-col",{staticStyle:{"margin-bottom":"20px"},attrs:{xs:24,sm:24,md:12,lg:12,xl:12}},[n("wanyu-report",{attrs:{date:t.date}})],1),n("el-col",{staticStyle:{"margin-bottom":"20px"},attrs:{xs:24,sm:24,md:12,lg:12,xl:12}},[n("wanyu-type-report",{attrs:{date:t.date}})],1)],1)]:t._e(),t.companyArr&&0<t.companyArr.length&&t.date?[n("h3",[t._v("业务公司维度")]),n("el-row",{attrs:{gutter:20}},t._l(t.companyArr,(function(e,a){return n("el-col",{key:e.companyNo,staticStyle:{"margin-bottom":"20px"},attrs:{xs:24,sm:12,md:12,lg:6,xl:6}},[n("department-report",{attrs:{date:t.date,index:a+1,companyNo:e.companyNo}})],1)})),1)]:t._e()],2)])])}),[],!1,null,null,null).exports),[De,rn,Ne,on,ve]);De={install:function(t){sn.forEach((function(e){return t.component(e.name,e)}))}};function ln(t,e){var n,a=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,n)),a}var cn,un;Ne={name:"report",components:{UnusualState:S,ControlDisplay:rn},data:function(){return{companyArr:[],hasPlatformDimension:!1,isShow:!1,state:{error:!1,loading:!1,message:""}}},mounted:(un=Object(c.a)(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:document.title="1.业绩报表",this.requestUserinfo();case 2:case"end":return t.stop()}}),t,this)}))),function(){return un.apply(this,arguments)}),methods:{requestUserinfo:(cn=Object(c.a)(regeneratorRuntime.mark((function t(){var e,n,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.state.loading=!0,e=T(),n=O("code"),t.next=5,v(function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ln(Object(n),!0).forEach((function(e){Object(l.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ln(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},e?{openid:e}:{code:n}));case 5:a=t.sent,this.state.loading=!1,t.t0=Number(a.code),t.next=0===t.t0?10:15;break;case 10:return this.companyArr=a.data.companyArr.filter((function(t){return t=t.info,t=void 0===t?[]:t,t.includes(1)||t.includes("1")})),this.hasPlatformDimension=(a.data.is_show||[]).includes(1)||(a.data.is_show||[]).includes("1"),this.isShow=this.hasPlatformDimension,x(a.data.openid),t.abrupt("break",19);case 15:return this.state.error=!0,this.state.message=a.message,e&&N(),t.abrupt("break",19);case 19:case"end":return t.stop()}}),t,this)}))),function(){return cn.apply(this,arguments)})}},on=Object(o.a)(Ne,(function(){var t=this,e=t.$createElement;e=t._self._c||e;return e("div",{directives:[{name:"loading",rawName:"v-loading",value:t.state.loading,expression:"state.loading"}],staticStyle:{"min-height":"300px"},attrs:{id:"app"}},[!t.state.error&&t.isShow?[t._m(0),e("control-display",{attrs:{companyArr:t.companyArr,hasPlatformDimension:t.hasPlatformDimension}})]:t.state.loading?t._e():[e("unusual-state",{attrs:{hasPermission:t.isShow,message:t.state.message,path:"results"}})]],2)}),[function(){var t=this.$createElement;t=this._self._c||t;return t("div",{staticStyle:{color:"red",position:"absolute",top:"30px",left:"10px","font-weight":"700",display:"flex"}},[t("div",[t("i",{staticClass:"el-icon-warning-outline"}),this._v("以下报表一小时更新一次\n ")])])}],!1,null,null,null).exports;function pn(t,e){var n,a=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,n)),a}function dn(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?pn(Object(n),!0).forEach((function(e){Object(l.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):pn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}ve={name:"CompanyGrossMargin",props:["daytime"],mixins:[e],watch:{daytime:function(t){(this.dataTime=t)&&this.searchList()}},data:function(){return{mapResponseCompletionCompanyName:P,loading:!1,maxHeight:"0",tableData:[]}},created:(hn=Object(c.a)(regeneratorRuntime.mark((function t(){var e=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:window.onresize=function(){e.getHeight()};case 1:case"end":return t.stop()}}),t)}))),function(){return hn.apply(this,arguments)}),mounted:function(){var t=this;this.$nextTick((function(){t.getHeight()})),this.searchList()},methods:{getCompanyLabel:k,unit2TenThousand:A,division:F,searchList:(mn=Object(c.a)(regeneratorRuntime.mark((function t(){var e,n,a,o;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.loading=!0,t.next=3,_({daytime:this.daytime,companyNo:"GS2203161855277894"});case 3:return e=t.sent,t.next=6,g({daytime:this.date,companyNo:"GS2203161855277894"});case 6:a=t.sent,e.data=e.data.splice(0,4),n=a.data.reduce((function(t,e){return dn(dn({},t),{},Object(l.a)({},e.companyName,{supplierSaleDay:0,supplierSaleMonth:0,supplierPurchDay:0,supplierPurchMonth:0}))}),{}),0===Number(a.code)&&0===Number(e.code)&&(a=(e.data||[]).map((function(t){var e=Object.keys(n).find((function(e){return e.includes(t.depart)})),a=M(t.sale_total,t.th_total),o=M(t.cgd_total,t.cgd_th_total),r=(o=(e&&(o=R(o,n[e].supplierPurchDay),a=R(a,n[e].supplierSaleDay)),"北京普润心堂商贸有限公司"===e&&(o=R(o,n["北京锦兴弘昌科技有限公司"].supplierPurchDay),a=R(a,n["北京锦兴弘昌科技有限公司"].supplierSaleDay)),M(a,o)),E(F(o,a),100)),i=M(t.msale_total,t.mth_total),s=M(t.mcgd_total,t.mcgd_th_total),l=(e=(e&&(i=R(i,n[e].supplierSaleMonth),s=R(s,n[e].supplierPurchMonth)),"北京普润心堂商贸有限公司"===e&&(i=R(i,n["北京锦兴弘昌科技有限公司"].supplierSaleMonth),s=R(s,n["北京锦兴弘昌科技有限公司"].supplierPurchMonth)),E(F(i,t.total_tips),100)),s=M(i,s),E(F(s,i),100));return{total_tips:t.total_tips,depart:t.depart,pure_day_interest_rate:r,pure_day_sale:a,pure_day_profit:o,pure_month_sale:i,month_completion_rate:e,pure_month_profit:s,pure_month_interest_rate:l}})),(o=z(a)).depart="合计",o.month_completion_rate=E(F(o.pure_month_sale,Number(o.total_tips).toFixed(2)),100),o.pure_month_interest_rate=E(F(Number(o.pure_month_profit).toFixed(2),Number(o.pure_month_sale).toFixed(2)),100),o.pure_day_interest_rate=E(F(o.pure_day_profit,Number(o.pure_day_sale).toFixed(2)),100),this.tableData=[].concat(Object(s.a)(a),[o])),this.getHeight(),this.loading=!1;case 12:case"end":return t.stop()}}),t,this)}))),function(){return mn.apply(this,arguments)})}},rn=Object(o.a)(ve,(function(){var t=this,e=t.$createElement;e=t._self._c||e;return e("div",{staticClass:"SalesReportRejectedNew"},[e("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{border:"",data:t.tableData,size:"mini","row-style":function(t){return"合计"===t.row.depart?{background:"#f5f7fa"}:{}}}},[e("el-table-column",{attrs:{label:"部门",width:"80",prop:"depart",align:"center",fixed:"left"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t.mapResponseCompletionCompanyName[e.row.depart]||e.row.depart))]}}])}),e("el-table-column",{attrs:{label:"本日销售净额",prop:"pure_day_sale"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t.unit2TenThousand(e.row.pure_day_sale)))]}}])}),e("el-table-column",{attrs:{label:"本日毛利润",prop:"pure_day_profit"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t.unit2TenThousand(e.row.pure_day_profit)))]}}])}),e("el-table-column",{attrs:{label:"本日毛利率",prop:"pure_day_interest_rate"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(Number(e.row.pure_day_interest_rate||0).toFixed(2)+"%"))]}}])}),e("el-table-column",{attrs:{label:"本月销售指标",prop:"total_tips"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t.unit2TenThousand(e.row.total_tips)))]}}])}),e("el-table-column",{attrs:{label:"本月销售净额",prop:"pure_month_sale"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t.unit2TenThousand(e.row.pure_month_sale)))]}}])}),e("el-table-column",{attrs:{label:"本月指标达成率",width:"105px",prop:"depart"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(("Infinity"===String(e.row.month_completion_rate)?"-":e.row.month_completion_rate.toFixed(2))+"%"))]}}])}),e("el-table-column",{attrs:{label:"本月毛利润",prop:"pure_month_profit"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t.unit2TenThousand(e.row.pure_month_profit)))]}}])}),e("el-table-column",{attrs:{label:"本月毛利率",prop:"pure_month_interest_rate"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(Number(e.row.pure_month_interest_rate||0).toFixed(2)+"%"))]}}])})],1)],1)}),[],!1,null,"fe3e072e",null).exports,Ne={name:"MonthGrossMargin",props:["daytime"],mixins:[e],watch:{daytime:function(t){(this.dataTime=t)&&this.searchList()}},data:function(){return{loading:!1,maxHeight:"0",tableData:[]}},created:(_n=Object(c.a)(regeneratorRuntime.mark((function t(){var e=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:window.onresize=function(){e.getHeight()};case 1:case"end":return t.stop()}}),t)}))),function(){return _n.apply(this,arguments)}),mounted:function(){var t=this;this.$nextTick((function(){t.getHeight()})),this.searchList()},methods:{getCompanyLabel:k,unit2TenThousand:A,division:F,searchList:(fn=Object(c.a)(regeneratorRuntime.mark((function t(){var e,n,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.loading=!0,t.next=3,y({year:this.daytime.split("-")[0],companyNo:"GS2203161855277894"});case 3:e=t.sent,t.t0=Number(e.code),t.next=0===t.t0?7:15;break;case 7:return n=(e.data||[]).map((function(t){var e=M(t.sale_total,t.th_total),n=E(F(e,t.total_tips),100),a=M(t.cgd_total,t.cgd_th_total),o=M(e,a),r=E(F(o,e)||0,100);return{month:t.month,completion_rate:n,pure_interest_rate:r,pure_profit:o,pure_sale:e,pure_purch:a,total_tips:t.total_tips}})),(a=z(n)).month="年度合计",a.completion_rate=E(F(a.pure_sale,a.total_tips),100),a.pure_profit=M(a.pure_sale,a.pure_purch),a.pure_interest_rate=E(F(a.pure_profit,a.pure_sale),100),this.tableData=[].concat(Object(s.a)(n),[a]),t.abrupt("break",16);case 15:return t.abrupt("break",16);case 16:this.getHeight(),this.loading=!1;case 18:case"end":return t.stop()}}),t,this)}))),function(){return fn.apply(this,arguments)})}},ve=Object(o.a)(Ne,(function(){var t=this,e=t.$createElement;e=t._self._c||e;return e("div",{staticClass:"SalesReportRejectedNew"},[e("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{data:t.tableData,border:"",size:"mini"}},[e("el-table-column",{attrs:{label:"月份",prop:"depart"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(e.row.month))]}}])}),e("el-table-column",{attrs:{label:"销售净额",prop:"pure_sale"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t.unit2TenThousand(e.row.pure_sale)))]}}])}),e("el-table-column",{attrs:{label:"销售指标",prop:"total_tips"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t.unit2TenThousand(e.row.total_tips)))]}}])}),e("el-table-column",{attrs:{label:"指标达成率",prop:"completion_rate"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(Number(e.row.completion_rate||0).toFixed(2)+"%"))]}}])}),e("el-table-column",{attrs:{label:"毛利润",prop:"pure_profit"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t.unit2TenThousand(e.row.pure_profit)))]}}])}),e("el-table-column",{attrs:{label:"毛利率",prop:"pure_interest_rate"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(Number(e.row.pure_interest_rate||0).toFixed(2)+"%"))]}}])})],1)],1)}),[],!1,null,"7de9174b",null).exports,n("759f"),Ne={name:"CompanyGrossMargin",props:["date","companyNo","index","daytime"],mixins:[e],watch:{daytime:function(t){(this.dataTime=t)&&this.searchList()}},data:function(){return{loading:!1,maxHeight:"0",tableData:[],companyName:""}},created:(bn=Object(c.a)(regeneratorRuntime.mark((function t(){var e=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:window.onresize=function(){e.getHeight()};case 1:case"end":return t.stop()}}),t)}))),function(){return bn.apply(this,arguments)}),mounted:function(){var t=this;this.$nextTick((function(){t.getHeight()})),this.searchList()},methods:{getCompanyLabel:k,unit2TenThousand:A,division:F,searchList:(yn=Object(c.a)(regeneratorRuntime.mark((function t(){var e,n,a,o,r,i,s;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.loading=!0,t.next=3,g({companyNo:this.companyNo,daytime:this.daytime});case 3:e=t.sent,t.t0=Number(e.code),t.next=0===t.t0?7:34;break;case 7:return this.companyName=e.data[0].companyName,n=["百辰","普润","泓源","锦兴"],i=["自营","渠道","小计","供应商端","合计"],a=(e.data||[]).filter((function(t){var e=t.companyName;return n.some((function(t){return-1!==e.indexOf(t)}))})),o=a.reduce((function(t,e){return{supplierSaleDay:R(t.supplierSaleDay,M(e.dayinfo[2].sale_total,e.dayinfo[2].th_total)),supplierSaleMonth:R(t.supplierSaleMonth,M(e.monthinfo[2].msale_total,e.monthinfo[2].mth_total)),supplierPurchDay:R(t.supplierPurchDay,M(e.dayinfo[2].cgd_total,e.dayinfo[2].cgd_th_total)),supplierPurchMonth:R(t.supplierPurchMonth,M(e.monthinfo[2].mcgd_total,e.monthinfo[2].mcgd_th_total)),selfOperatedSaleDay:R(t.selfOperatedSaleDay,M(e.dayinfo[0].sale_total,e.dayinfo[0].th_total)),selfOperatedSaleMonth:R(t.selfOperatedSaleMonth,M(e.monthinfo[0].msale_total,e.monthinfo[0].mth_total)),selfOperatedPurchDay:R(t.selfOperatedPurchDay,M(e.dayinfo[0].cgd_total,e.dayinfo[0].cgd_th_total)),selfOperatedPurchMonth:R(t.selfOperatedPurchMonth,M(e.monthinfo[0].mcgd_total,e.monthinfo[0].mcgd_th_total)),channelSaleDay:R(t.channelSaleDay,M(e.dayinfo[1].sale_total,e.dayinfo[1].th_total)),channelSaleMonth:R(t.channelSaleMonth,M(e.monthinfo[1].msale_total,e.monthinfo[1].mth_total)),channelPurchDay:R(t.channelPurchDay,M(e.dayinfo[1].cgd_total,e.dayinfo[1].cgd_th_total)),channelPurchMonth:R(t.channelPurchMonth,M(e.monthinfo[1].mcgd_total,e.monthinfo[1].mcgd_th_total)),totalTips:R(t.totalTips,e.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={"供应商端":{saleDay:"supplierSaleDay",saleMonth:"supplierSaleMonth",purchDay:"supplierPurchDay",purchMonth:"supplierPurchMonth"},"自营":{saleDay:"selfOperatedSaleDay",saleMonth:"selfOperatedSaleMonth",purchDay:"selfOperatedPurchDay",purchMonth:"selfOperatedPurchMonth"},"渠道":{saleDay:"channelSaleDay",saleMonth:"channelSaleMonth",purchDay:"channelPurchDay",purchMonth:"channelPurchMonth"}},a=i.map((function(t){var e=r[t];if(!e)return{field:t,total_tips:"--",pure_day_sale:0,pure_day_purch:0,pure_day_profit:0,pure_month_sale:0,pure_month_purch:0,month_completion_rate:"--",pure_month_profit:0,pure_month_interest_rate:0};var n=o[e.saleDay],a=o[e.purchDay],i=M(n,a),s=E(F(i,n),100),l=o[e.saleMonth],c=(e=o[e.purchMonth],M(l,e)),u=E(F(c,l),100);return Number(n)<0&&(s=0),{field:t,total_tips:"--",pure_day_sale:n,pure_day_purch:a,pure_day_profit:i,pure_month_sale:l,pure_month_purch:e,month_completion_rate:"--",pure_month_profit:c,pure_month_interest_rate:u=Number(l)<0?0:u,pure_day_interest_rate:s}})),(i=z([a[0],a[1]])).field="小计",i.total_tips="--",i.month_completion_rate="--",i.pure_month_interest_rate=E(F(i.pure_month_profit,i.pure_month_sale),100),i.pure_day_interest_rate=E(F(i.pure_day_profit,i.pure_day_sale),100),Number(i.pure_day_sale)<0&&(i.pure_day_interest_rate=0),Number(i.pure_month_sale)<0&&(i.pure_month_interest_rate=0),a[2]=i,(s=z([a[2],a[3]])).field="合计",s.total_tips=o.totalTips,s.pure_month_interest_rate=E(F(s.pure_month_profit,s.pure_month_sale),100),s.month_completion_rate=E(F(s.pure_month_sale,s.total_tips),100),s.pure_day_interest_rate=E(F(i.pure_day_profit,i.pure_day_sale),100),Number(s.pure_day_sale)<0&&(s.pure_day_interest_rate=0),Number(s.pure_month_sale)<0&&(s.pure_month_interest_rate=0),a[4]=s,this.tableData=a,t.abrupt("break",35);case 34:return t.abrupt("break",35);case 35:this.getHeight(),this.loading=!1;case 37:case"end":return t.stop()}}),t,this)}))),function(){return yn.apply(this,arguments)})}},Ne=Object(o.a)(Ne,(function(){var t=this,e=t.$createElement;e=t._self._c||e;return e("div",{staticClass:"SalesReportRejectedNew"},[e("div",{staticClass:"table-header"},[t._v(t._s(t.index)+"."+t._s(t.companyName||"--"))]),e("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{border:"",data:t.tableData,size:"mini","row-style":function(t){return"合计"===t.row.field?{background:"#f5f7fa"}:{}}}},[e("el-table-column",{attrs:{label:"业绩类型",prop:"depart",align:"center",fixed:"left"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(e.row.field))]}}])}),e("el-table-column",{attrs:{label:"本日销售净额",prop:"pure_day_sale"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t.unit2TenThousand(e.row.pure_day_sale)))]}}])}),e("el-table-column",{attrs:{label:"本日毛利润",prop:"pure_day_profit"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t.unit2TenThousand(e.row.pure_day_profit)))]}}])}),e("el-table-column",{attrs:{label:"本日毛利率",prop:"pure_month_interest_rate"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(Number(e.row.pure_day_interest_rate||0).toFixed(2)+"%"))]}}])}),e("el-table-column",{attrs:{label:"本月销售净额",prop:"pure_month_sale"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t.unit2TenThousand(e.row.pure_month_sale)))]}}])}),e("el-table-column",{attrs:{label:"本月销售指标",prop:"total_tips"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s("--"===e.row.total_tips?"--":t.unit2TenThousand(e.row.total_tips)))]}}])}),e("el-table-column",{attrs:{label:"本月指标达成率",width:"105px",prop:"month_completion_rate"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s("--"===e.row.month_completion_rate?"--":Number(e.row.month_completion_rate||0).toFixed(2)+"%"))]}}])}),e("el-table-column",{attrs:{label:"本月毛利润",prop:"pure_month_profit"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t.unit2TenThousand(e.row.pure_month_profit)))]}}])}),e("el-table-column",{attrs:{label:"本月毛利率",prop:"pure_month_interest_rate"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(Number(e.row.pure_month_interest_rate||0).toFixed(2)+"%"))]}}])})],1)],1)}),[],!1,null,"8045cf34",null).exports;var mn,hn,fn,_n,yn,bn,gn,vn,wn={name:"MonthGrossMargin",props:["daytime","companyNo"],mixins:[e],watch:{daytime:function(t){(this.dataTime=t)&&this.searchList()}},data:function(){return{loading:!1,maxHeight:"0",tableData:[]}},created:(vn=Object(c.a)(regeneratorRuntime.mark((function t(){var e=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:window.onresize=function(){e.getHeight()};case 1:case"end":return t.stop()}}),t)}))),function(){return vn.apply(this,arguments)}),mounted:function(){var t=this;this.$nextTick((function(){t.getHeight()})),this.searchList()},methods:{getCompanyLabel:k,unit2TenThousand:A,division:F,searchList:(gn=Object(c.a)(regeneratorRuntime.mark((function t(){var e,n,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.loading=!0,t.next=3,b({year:this.daytime.split("-")[0],companyNo:this.companyNo});case 3:e=t.sent,t.t0=Number(e.code),t.next=0===t.t0?7:16;break;case 7:return n=(e.data||[]).map((function(t){var e=M(t.sale_total,t.th_total),n=E(F(e,t.total_tips),100),a=M(t.cgd_total,t.cgd_th_total),o=M(e,a),r=E(F(o,e)||0,100);return Number(e)<0&&(r=0),{month:t.month,completion_rate:n,pure_interest_rate:r,pure_profit:o,pure_sale:e,pure_purch:a,total_tips:t.total_tips}})),(a=z(n)).month="年度合计",a.completion_rate=E(F(a.pure_sale,a.total_tips),100),a.pure_profit=M(a.pure_sale,a.pure_purch),a.pure_interest_rate=E(F(a.pure_profit,a.pure_sale),100),this.tableData=[].concat(Object(s.a)(n),[a]),Number(a.pure_sale)<0&&(a.pure_interest_rate=0),t.abrupt("break",17);case 16:return t.abrupt("break",17);case 17:this.getHeight(),this.loading=!1;case 19:case"end":return t.stop()}}),t,this)}))),function(){return gn.apply(this,arguments)})}};rn={name:"ControlDisplay",props:["companies","hasPlatformDimension"],components:{GrossMargin:rn,MonthGrossMargin:ve,CompanyGrossMargin:Ne,CompanyMonthGrossMargin:Object(o.a)(wn,(function(){var t=this,e=t.$createElement;e=t._self._c||e;return e("div",{staticClass:"SalesReportRejectedNew",staticStyle:{"margin-top":"10px"}},[e("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{border:"",data:t.tableData,size:"mini"}},[e("el-table-column",{attrs:{label:"月份",prop:"depart",fixed:"left"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(e.row.month))]}}])}),e("el-table-column",{attrs:{label:"销售净额",prop:"pure_sale"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t.unit2TenThousand(e.row.pure_sale)))]}}])}),e("el-table-column",{attrs:{label:"销售指标",prop:"total_tips"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t.unit2TenThousand(e.row.total_tips)))]}}])}),e("el-table-column",{attrs:{label:"指标达成率",prop:"completion_rate"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(Number(e.row.completion_rate||0).toFixed(2)+"%"))]}}])}),e("el-table-column",{attrs:{label:"毛利润",prop:"pure_profit"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t.unit2TenThousand(e.row.pure_profit)))]}}])}),e("el-table-column",{attrs:{label:"毛利率",prop:"pure_interest_rate"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(Number(e.row.pure_interest_rate||0).toFixed(2)+"%"))]}}])})],1)],1)}),[],!1,null,"27af9e47",null).exports},data:function(){return{date:"",platformData:[{component:"GrossMargin"},{component:"MonthGrossMargin"}],companyData:[{component:"CompanyGrossMargin"},{component:"CompanyMonthGrossMargin"}]}},mounted:function(){this.date=this.transformTime()},methods:{transformTime:function(){var t=new Date,e=t.getFullYear(),n=t.getMonth()+1;t=t.getDate();return e+"-"+(n<10?"0"+n:n)+"-"+(t<10?"0"+t:t)}}};function xn(t,e){var n,a=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,n)),a}n("e282");var Tn,Nn,On,Sn;ve={name:"report",components:{UnusualState:S,ControlDisplay:Object(o.a)(rn,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"app-main"},[n("div",{staticClass:"app-main-zhunbeixuanzhuan"},[n("div",{staticClass:"app-main-xuanzhuan"},[n("div",{staticClass:"search clear"},[n("el-date-picker",{staticClass:"fr picker",staticStyle:{"margin-top":"10px"},attrs:{size:"small",editable:!1,clearable:!1,"value-format":"yyyy-MM-dd",format:"yyyy-MM-dd",type:"date",align:"right",placeholder:"选择日期","picker-options":{disabledDate:function(t){return t.getTime()>Date.now()}}},model:{value:t.date,callback:function(e){t.date=e},expression:"date"}})],1),t.hasPlatformDimension?[n("h3",[t._v("利润报表看板(平台维度)")]),n("el-row",{staticClass:"myul",attrs:{gutter:20}},[t._l(t.platformData,(function(e,a){return[n("el-col",{key:a,staticStyle:{"margin-bottom":"20px"},attrs:{xs:24,sm:24,md:24,lg:24,xl:24}},[n(e.component,{tag:"component",attrs:{daytime:t.date,index:a}})],1)]}))],2)]:t._e(),t.companies&&0<t.companies.length?[n("h3",[t._v("利润报表看板(公司维度)")]),n("el-row",{staticClass:"myul",attrs:{gutter:20}},t._l(t.companies,(function(e,a){return n("div",[n("el-col",{key:e.companyNo,staticStyle:{"margin-bottom":"20px"},attrs:{xs:24,sm:24,md:24,lg:24,xl:24}},[t._l(t.companyData,(function(o){return[n(o.component,{tag:"component",attrs:{companyNo:e.companyNo,companyName:e.companyName,index:a+1,daytime:t.date}})]}))],2)],1)})),0)]:t._e()],2)])])}),[],!1,null,null,null).exports},data:function(){return{companyArr:[],companies:[],hasPlatformDimension:!1,isShow:!1,state:{error:!1,loading:!1,message:""}}},created:function(){document.title="2.利润看板"},mounted:(Nn=Object(c.a)(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.requestUserinfo();case 1:case"end":return t.stop()}}),t,this)}))),function(){return Nn.apply(this,arguments)}),methods:{requestUserinfo:(Tn=Object(c.a)(regeneratorRuntime.mark((function t(){var e,n,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.state.loading=!0,e=T(),n=O("code"),t.next=5,v(function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?xn(Object(n),!0).forEach((function(e){Object(l.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):xn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},e?{openid:e}:{code:n}));case 5:a=t.sent,this.state.loading=!1,t.t0=Number(a.code),t.next=0===t.t0?10:15;break;case 10:return this.companyArr=a.data.companyArr.filter((function(t){return t=t.info,t=void 0===t?[]:t,t.includes(2)||t.includes("2")})),this.hasPlatformDimension=(a.data.is_show||[]).includes(2)||(a.data.is_show||[]).includes("2"),this.isShow=this.hasPlatformDimension,x(a.data.openid),t.abrupt("break",19);case 15:return this.state.error=!0,this.state.message=a.message,e&&N(),t.abrupt("break",19);case 19:case"end":return t.stop()}}),t,this)}))),function(){return Tn.apply(this,arguments)})}},Ne=Object(o.a)(ve,(function(){var t=this,e=t.$createElement;e=t._self._c||e;return e("div",{directives:[{name:"loading",rawName:"v-loading",value:t.state.loading,expression:"state.loading"}],staticStyle:{"min-height":"300px"},attrs:{id:"app"}},[!t.state.error&&t.isShow?[e("control-display",{attrs:{companies:t.companyArr,hasPlatformDimension:t.hasPlatformDimension}})]:t.state.loading?t._e():[e("unusual-state",{attrs:{hasPermission:t.isShow,message:t.state.message,path:"report"}})]],2)}),[],!1,null,null,null).exports,wn={name:"Consult",mixins:[e],components:{DatePickerTitle:Mt},props:["date","title"],watch:{date:function(t){(this.dataTime=t)&&2===t.length&&this.searchList()}},data:function(){return{loading:!1,tableData:[],date:[]}},created:(Sn=Object(c.a)(regeneratorRuntime.mark((function t(){var e=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:window.onresize=function(){e.getHeight()};case 1:case"end":return t.stop()}}),t)}))),function(){return Sn.apply(this,arguments)}),mounted:function(){var t=this;this.$nextTick((function(){t.getHeight()})),this.searchList()},methods:{handleRefresh:function(t){this.date=t},searchList:(On=Object(c.a)(regeneratorRuntime.mark((function t(){var e;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.loading=!0,this.tableData=[],t.next=4,et({start:this.date[0]||"",end:this.date[1]||"",page:1,size:1e4});case 4:0===(e=t.sent).code&&e.data&&0<e.data.result.length?(this.tableData=e.data.result,e=Number(e.data.result.reduce((function(t,e){return ot(t,e.total_fee)}),0)).toFixed(2),this.tableData.push({spuCode:"合计",total_fee:e})):this.tableData=[],this.getHeight(),this.loading=!1;case 8:case"end":return t.stop()}}),t,this)}))),function(){return On.apply(this,arguments)})}};function jn(t,e){var n,a=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,n)),a}var Dn,kn,Cn;rn={name:"newReport",components:{PeriodDatePicker:Et,NotDeliverGood:nt,UnusualState:S,PurchaseBack:xt,EmptyReturn:Tt,SendOrder:Ft,TheSales:At,Purchase:Yt,SendExp:Zt,Consult:Gt,TheStock:Object(o.a)(wn,(function(){var t=this,e=t.$createElement;e=t._self._c||e;return e("div",{staticClass:"SalesReportRejectedNew"},[e("date-picker-title",{attrs:{title:t.title},on:{refresh:t.handleRefresh}}),e("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],attrs:{data:t.tableData,size:"mini",border:""}},[e("el-table-column",{attrs:{type:"index",width:"40px"}}),e("el-table-column",{attrs:{label:"产品编码",prop:"spuCode",width:"160px","show-overflow-tooltip":""}}),e("el-table-column",{attrs:{label:"产品名称",prop:"good_name","min-width":"160px","show-overflow-tooltip":""}}),e("el-table-column",{attrs:{label:"当日库存发货",prop:"num",width:"100px","show-overflow-tooltip":""}}),e("el-table-column",{attrs:{label:"当前剩余可用库存",prop:"stock_num",width:"120px","show-overflow-tooltip":""}}),e("el-table-column",{attrs:{label:"业务公司名称",prop:"companyName","min-width":"190px","show-overflow-tooltip":""}}),e("el-table-column",{attrs:{label:"当前库存消耗金额",prop:"total_fee",width:"130px","show-overflow-tooltip":""}})],1)],1)}),[],!1,null,null,null).exports,Stock:re,Order:oe},data:function(){return{date:[],zxTotal:0,isDisplay:!1,state:{message:"",error:!1,loading:!1}}},mounted:function(){document.body.style.position="static",document.title="5.发货情况",O("code")?this.requestUserinfo():this.login();var t=at()(new Date).format("YYYY-MM-DD");this.date=[t+" 00:00:00",t+" 23:59:59"]},methods:{getZXTotal:function(t){this.zxTotal=t},time:(kn=Object(c.a)(regeneratorRuntime.mark((function t(e){var n,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.startTime,a=e.endTime,this.start=n||"",this.end=a||"",n=this.start,a=this.end,""!==n&&""===a||""===n&&""!==a)return this.$message.warning("时间区间不完整!"),this.date=[],t.abrupt("return");t.next=8;break;case 8:this.start&&this.end?this.date=[this.start+" 00:00:00",this.end+" 23:59:59"]:this.date=[this.start,this.end];case 9:case"end":return t.stop()}}),t,this)}))),function(t){return kn.apply(this,arguments)}),requestUserinfo:(Dn=Object(c.a)(regeneratorRuntime.mark((function t(){var e,n,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.state.loading=!0,e=T(),n=O("code"),t.next=5,v(function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?jn(Object(n),!0).forEach((function(e){Object(l.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):jn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},e?{openid:e}:{code:n}));case 5:a=t.sent,this.state.loading=!1,t.t0=Number(a.code),t.next=0===t.t0?10:13;break;case 10:return this.isShow=(a.data.is_show||[]).includes(5)||(a.data.is_show||[]).includes("5"),x(a.data.openid),t.abrupt("break",17);case 13:return this.state.error=!0,this.state.message=a.message,e&&N(),t.abrupt("break",17);case 17:case"end":return t.stop()}}),t,this)}))),function(){return Dn.apply(this,arguments)}),login:function(){var t=encodeURIComponent("http://stat.caixiao365.com/accountsReceivable"),e="wx_"+Math.random().toString(36).substr(2,15);t="https://open.weixin.qq.com/connect/oauth2/authorize?appid=".concat(config.appId,"&redirect_uri=").concat(t,"&response_type=code&scope=").concat("snsapi_userinfo","&state=").concat(e,"#wechat_redirect");window.location.href=t}}},n("1f39"),ve=Object(o.a)(rn,(function(){var t=this,e=t.$createElement;e=t._self._c||e;return e("div",{directives:[{name:"loading",rawName:"v-loading",value:t.state.loading,expression:"state.loading"}],staticClass:"new-report",staticStyle:{"min-height":"300px"}},[!t.state.error&&t.isShow?e("div",[e("el-row",{attrs:{gutter:20}},[e("el-col",{attrs:{xs:24}},[e("not-deliver-good",{attrs:{title:"1.无地址销售订单统计",date:t.date}})],1),e("el-col",{attrs:{xs:24}},[e("send-order",{attrs:{title:"2.发货工单未发货时效统计",date:t.date}})],1),e("el-col",{attrs:{xs:24}},[e("send-exp",{attrs:{title:"3.待采购备货时效统计",date:t.date}})],1),e("el-col",{attrs:{xs:24}},[e("the-sales",{attrs:{title:"4.当日库存销售统计",date:t.date}})],1),e("el-col",{attrs:{xs:24}},[e("the-stock",{attrs:{title:"5.当日库存发货统计",date:t.date}})],1)],1)],1):t.state.loading?t._e():[e("unusual-state",{attrs:{hasPermission:t.isShow,message:t.state.message,path:"newReport"}})]],2)}),[],!1,null,"1574fc02",null).exports,Mt={name:"login",mounted:(Cn=Object(c.a)(regeneratorRuntime.mark((function t(){var e,n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=(this.$route.query||{}).path,n=encodeURIComponent("http://stat.caixiao365.com/"+(n?"#/".concat(n):"")),e="wx_"+Math.random().toString(36).substr(2,15),n="https://open.weixin.qq.com/connect/oauth2/authorize?appid=".concat(m.a.appId,"&redirect_uri=").concat(n,"&response_type=code&scope=").concat("snsapi_userinfo","&state=").concat(e,"#wechat_redirect"),window.location.href=n;case 7:case"end":return t.stop()}}),t,this)}))),function(){return Cn.apply(this,arguments)})},nt=Object(o.a)(Mt,(function(){var t=this.$createElement;return(this._self._c||t)("div",{})}),[],!1,null,null,null).exports;function Pn(t,e){var n,a=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,n)),a}xt={data:function(){return{isShow:[],state:{message:"",error:!1,loading:!1},routes:[{label:"9.业务公司开票统计",link:"/?path=invData",permission:"10"},{label:"6.业务公司业绩报表",link:"/?path=newResults",permission:"6"},{label:"8.结算订单业绩报表",link:"/?path=newEarningReport",permission:"8"},{label:"2.利润看板",link:"/?path=report",permission:"2"},{label:"3.应收账款",link:"/?path=accountsReceivable",permission:"3"},{label:"4.订单情况",link:"/?path=newReport",permission:"4"},{label:"5.发货情况",link:"/?path=stock",permission:"5"},{label:"7.库存情况",link:"?path=newStock",permission:"7"},{label:"1.业绩报表(2023版)",link:"/?path=results",permission:"1"},{label:"业务公司订单统计",link:"/?path=newReporting",permission:"9"}]}},computed:{permissionRoutes:function(){var t=this;return this.routes.filter((function(e){return t.isShow.includes(e.permission)||t.isShow.includes(Number(e.permission))}))}},mounted:function(){document.title="数据导航",O("code")?this.requestUserinfo():this.login()},methods:{goRouter:function(t,e){t.stopPropagation(),window.open(e)},requestUserinfo:(Rn=Object(c.a)(regeneratorRuntime.mark((function t(){var e,n,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.state.loading=!0,e=T(),n=O("code"),t.next=5,v(function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Pn(Object(n),!0).forEach((function(e){Object(l.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Pn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},e?{openid:e}:{code:n}));case 5:a=t.sent,this.state.loading=!1,t.t0=Number(a.code),t.next=0===t.t0?10:13;break;case 10:return this.isShow=a.data.is_show,x(a.data.openid),t.abrupt("break",17);case 13:return this.state.error=!0,this.state.message=a.message,e&&N(),t.abrupt("break",17);case 17:case"end":return t.stop()}}),t,this)}))),function(){return Rn.apply(this,arguments)}),login:function(){var t=encodeURIComponent("http://stat.caixiao365.com/"),e="wx_"+Math.random().toString(36).substr(2,15);t="https://open.weixin.qq.com/connect/oauth2/authorize?appid=".concat(m.a.appId,"&redirect_uri=").concat(t,"&response_type=code&scope=").concat("snsapi_userinfo","&state=").concat(e,"#wechat_redirect");window.location.href=t}}},n("bd5f"),Tt=Object(o.a)(xt,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"container"},[n("h3",{staticStyle:{"text-align":"center",color:"#ffffff","margin-bottom":"5px","margin-top":"35px"}},[t._v("数据导航")]),t._l(t.permissionRoutes,(function(e){return n("div",{key:e.label,staticClass:"wrapper"},[n("el-button",{attrs:{type:"info",plain:""},on:{click:function(n){return t.goRouter(n,e.link)}}},[t._v(t._s(e.label)+"\n "),n("i",{staticClass:"el-icon-right"})])],1)}))],2)}),[],!1,null,null,null).exports;var Rn,Fn={"北京百辰荣达国际科贸有限公司":"百辰","北京泓源广诚国际商贸有限公司":"泓源","北京万宇恒通国际科贸有限公司":"万宇","北京锦兴弘昌科技有限公司":"锦兴","北京普润心堂商贸有限公司":"普润"};function En(t,e){var n,a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=function(t,e){if(t){if("string"==typeof t)return Mn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(n="Object"===n&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Mn(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length)return a&&(t=a),n=0,{s:e=function(){},n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:e};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,r=!0,i=!1;return{s:function(){a=a.call(t)},n:function(){var t=a.next();return r=t.done,t},e:function(t){i=!0,o=t},f:function(){try{r||null==a.return||a.return()}finally{if(i)throw o}}}}function Mn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,a=new Array(e);n<e;n++)a[n]=t[n];return a}function An(t,e){var n,a=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,n)),a}function zn(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?An(Object(n),!0).forEach((function(e){Object(l.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):An(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var In,qn,Ln,$n;Ft={props:["companies","costField"],data:function(){return{loading:!1,isTenThound:!0,daytime:"",tableData:[],companyNo:"",cp_companies:[],isEmpty:!1,options:{},chart:null}},mounted:function(){var t=this.companies.findIndex((function(t){return"北京锦兴弘昌科技有限公司"===t.label})),e=this.companies.findIndex((function(t){return"北京普润心堂商贸有限公司"===t.label}));-1===t&&-1===e||(this.hasCompose=!0),this.cp_companies=this.companies.filter((function(t){return"北京锦兴弘昌科技有限公司"!==t.label&&"北京普润心堂商贸有限公司"!==t.label})),this.hasCompose&&(this.cp_companies=[].concat(Object(s.a)(this.cp_companies),[{value:"GS2302231124114965",label:"普润&锦兴&知事"}])),4===this.cp_companies.length&&(this.cp_companies=[{value:"",label:"所有公司"}].concat(Object(s.a)(this.cp_companies))),this.isEmpty=0===this.cp_companies.length,this.isEmpty||(this.cp_companies=this.cp_companies.map((function(t){return zn(zn({},t),{},{label:Fn[t.label]||t.label})})),this.companyNo=this.cp_companies[0].value,this.daytime=this.transformTime(),this.initialChart())},beforeDestory:function(){window.removeEventListener("resize",this.chart.resize)},methods:{unit2TenThousand2:ct,generateOptions:($n=Object(c.a)(regeneratorRuntime.mark((function t(){var e,n,a,o=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.requestData();case 2:return e=new Array(12).fill(0).map((function(t,e){return"".concat(e+1,"月")})),n=[],n=this.companyNo?[this.cp_companies.find((function(t){return t.value===o.companyNo})).label]:this.cp_companies.map((function(t){return t.label})).filter((function(t){return"所有公司"!==t})),a=n.reduce((function(t,e){return[].concat(Object(s.a)(t),[zn(zn({},o.tableData[e]),{},{company:e})])}),[]),e.map((function(t,e){return{title:{text:t},series:[{data:a.map((function(t){return t.pure_sale}))},{data:a.map((function(t){return t.pure_profit}))}]}})),t.abrupt("return",{baseOption:{timeline:{axisType:"category",autoplay:!1,data:e,playInterval:1e3},calculable:!0,tooltip:{},grid:{top:80,bottom:100,tooltip:{trigger:"axis"}},xAxis:[{type:"category",axisLabel:{interval:0},data:n,splitLine:{show:!1}}],yAxis:[{type:"value",name:this.isTenThound?"万元":"元"}],series:[{name:"当月营收完成",type:"bar"},{name:"当月毛利完成",type:"bar"},{name:"当月营收完成",type:"pie",center:["85%","15%"],radius:"20%"},{name:"当月毛利完成",type:"pie",center:["85%","45%"],radius:"20%"}]},options:e.map((function(t,e){return{title:{text:t},series:[{data:a.map((function(t){return(o.isTenThound?Number(ct(t[e].pure_sale)):Number(t[e].pure_sale)).toFixed(2)}))},{data:a.map((function(t){return(o.isTenThound?Number(ct(t[e].pure_profit)):Number(t[e].pure_profit)).toFixed(2)}))},{data:a.map((function(t,n){return{name:t.company,value:(o.isTenThound?Number(ct(t[e].pure_sale)):Number(t[e].pure_sale)).toFixed(2)}}))},{data:a.map((function(t,n){return{name:t.company,value:(o.isTenThound?Number(ct(t[e].pure_profit)):Number(t[e].pure_profit)).toFixed(2)}}))}]}}))});case 8:case"end":return t.stop()}}),t,this)}))),function(){return $n.apply(this,arguments)}),setOptions:(Ln=Object(c.a)(regeneratorRuntime.mark((function t(){var e;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.generateOptions();case 2:e=t.sent,this.chart.setOption(e);case 4:case"end":return t.stop()}}),t,this)}))),function(){return Ln.apply(this,arguments)}),initialChart:function(){var t=this;this.$nextTick(Object(c.a)(regeneratorRuntime.mark((function e(){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=document.getElementById("middle-container"),t.chart=echarts.init(n),e.next=4,t.setOptions();case 4:window.addEventListener("resize",t.chart.resize);case 5:case"end":return e.stop()}}),e)}))))},getCurrentRateStyle:function(t,e){var n=at()().daysInMonth(),a=at()().month()+1;if(!(Number(e)>Number(a)))return e=Number(rt(100,n)).toFixed(2),a=at()().date(),n=Number(it(a,e)).toFixed(2),Number(n)>Number(t)?"color:red":""},getCurrentValueStyle:function(t,e,n){var a=at()().daysInMonth(),o=at()().month()+1;if(!(Number(n)>Number(o)))return n=Number(rt(e,a)).toFixed(2),o=at()().date(),e=Number(it(o,n)).toFixed(2),Number(e)>Number(t)?"color: red":""},setCellClassName:function(t){return t=t.column.label,"当月营收目标"===t?"bg__yellow":"当月毛利目标"===t?"bg__red":void 0},setHeaderClassName:function(t){return t=t.column.label,"当月营收目标"===t?"bg__yellow":"当月毛利目标"===t?"bg__red":void 0},transformTime:function(){var t=new Date,e=t.getFullYear(),n=t.getMonth()+1;t=t.getDate();return e+"-"+(n<10?"0"+n:n)+"-"+(t<10?"0"+t:t)},requestData:(qn=Object(c.a)(regeneratorRuntime.mark((function t(){var e,n,a,o,r=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.loading=!0,e={},this.companyNo){t.next=28;break}n=En(this.cp_companies),t.prev=4,n.s();case 6:if((a=n.n()).done){t.next=18;break}if("锦兴"===(a=a.value).label)return t.abrupt("continue",16);t.next=10;break;case 10:return t.next=12,this.getCompanyData(a.value);case 12:return e["普润"===a.label?"普润&锦兴&知事":a.label]=t.sent,t.next=15,this.getCompanyData();case 15:e["所有公司"]=t.sent;case 16:t.next=6;break;case 18:t.next=23;break;case 20:t.prev=20,t.t0=t.catch(4),n.e(t.t0);case 23:return t.prev=23,n.f(),t.finish(23);case 26:t.next=32;break;case 28:return o=this.cp_companies.find((function(t){return t.value===r.companyNo})).label,t.next=31,this.getCompanyData(this.companyNo);case 31:e[o]=t.sent;case 32:this.loading=!1,this.tableData=e;case 34:case"end":return t.stop()}}),t,this,[[4,20,23,26]])}))),function(){return qn.apply(this,arguments)}),getCompanyData:(In=Object(c.a)(regeneratorRuntime.mark((function t(e){var n,a,o;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,pe.companyEvery({year:this.daytime.split("-")[0],companyNo:e});case 2:if(n=t.sent,"GS2302231124114965"===e)return t.next=6,pe.companyEvery({year:this.daytime.split("-")[0],companyNo:"GS2304031312553746"});t.next=8;break;case 6:a=t.sent,n.data=n.data.map((function(t,e){var o=n.data[e];e=a.data[e];return{month:o.month,cgd_th_total:Number(ot(o.cgd_th_total,e.cgd_th_total)).toFixed(2),cgd_total:Number(ot(o.cgd_total,e.cgd_total)).toFixed(2),cost_tips:Number(ot(o.cost_tips,e.cost_tips)).toFixed(2),sale_total:Number(ot(o.sale_total,e.sale_total)).toFixed(2),th_total:Number(ot(o.th_total,e.th_total)).toFixed(2),total_tips:Number(ot(o.total_tips,e.total_tips)).toFixed(2)}}));case 8:o="",t.t0=Number(n.code),t.next=0===t.t0?13:15;break;case 13:return o=(n.data||[]).map((function(t){var e=st(t.sale_total,t.th_total),n=it(rt(e,t.total_tips),100),a=st(t.cgd_total,t.cgd_th_total),o=st(e,a);return{pure_sale:e,pure_purch:a,pure_profit:o,completion_rate:n,pure_interest_rate:it(rt(o,e)||0,100),month:t.month,cost_tips:t.cost_tips,total_tips:t.total_tips,cost_rate:0===Number(t.cost_tips)?0:it(rt(o,t.cost_tips)||0,100).toFixed(2)}})),t.abrupt("break",17);case 15:return o={},t.abrupt("break",17);case 17:return t.abrupt("return",o);case 18:case"end":return t.stop()}}),t,this)}))),function(t){return In.apply(this,arguments)})}},n("98bf"),At=Object(o.a)(Ft,(function(){var t=this,e=t.$createElement;e=t._self._c||e;return e("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}]},[e("div",{staticClass:"search clear",staticStyle:{"align-items":"center"}},[e("el-switch",{staticStyle:{"margin-right":"10px"},attrs:{disabled:t.isEmpty,"active-text":"万元","inactive-text":"元"},on:{change:t.setOptions},model:{value:t.isTenThound,callback:function(e){t.isTenThound=e},expression:"isTenThound"}}),e("el-date-picker",{staticClass:"fr picker",staticStyle:{width:"100px"},attrs:{"value-format":"yyyy",editable:!1,disabled:t.isEmpty,clearable:!1,size:"small",type:"year",format:"yyyy",align:"right",placeholder:"选择日期","picker-options":{disabledDate:function(t){return t.getTime()>Date.now()}}},on:{change:t.setOptions},model:{value:t.daytime,callback:function(e){t.daytime=e},expression:"daytime"}})],1),t.isEmpty?[e("div",{staticStyle:{"text-align":"center","line-height":"60px","user-select":"none"}},[t._v("当前账号没有访问权限")])]:e("el-row",{staticStyle:{"margin-top":"10px"}},[e("div",{attrs:{id:"middle-container"}})])],2)}),[],!1,null,"53bedcff",null).exports;function Hn(t,e){var n,a=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,n)),a}function Un(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Hn(Object(n),!0).forEach((function(e){Object(l.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Hn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}Yt={mixins:[e],props:["companies","costField"],data:function(){return{list:[],daytime:"",companyNo:"",loading:!1,isTenThound:!0,isEmpty:!1}},computed:{currentCompanyName:function(){var t=this;return this.companies.find((function(e){return e.value===t.companyNo})).label}},mounted:function(){this.isEmpty=0===this.companies.length,this.isEmpty||(this.companyNo=this.companies[0].value,this.companies=this.companies.map((function(t){return Un(Un({},t),{},{label:Fn[t.label]||t.label})})),this.daytime=this.transformTime(),this.requestData())},watch:{daytime:{handler:function(){this.requestData()}}},methods:{addition:ot,unit2TenThousand:lt,setCellClassName:function(t){return t=t.column.label,"当月营业收入(净)"===t||"当月成本合计"===t?"pure__cell":"当月营收目标"===t?"bg__yellow":"当月毛利目标"===t?"bg__red":void 0},setHeaderClassName:function(t){return t=t.column.label,"当月营收目标"===t?"bg__yellow":"当月毛利目标"===t?"bg__red":void 0},getCurrentRateStyle:function(t){var e=at()().daysInMonth(),n=(e=Number(rt(100,e)).toFixed(2),at()().date());n=Number(it(n,e)).toFixed(2);return Number(n)>Number(t)?"color:red":""},getCurrentValueStyle:function(t,e){var n=at()().daysInMonth();e=Number(rt(e,n)).toFixed(2),n=at()().date(),n=Number(it(n,e)).toFixed(2);return Number(n)>Number(t)?"color: red":""},transformTime:function(){var t=new Date,e=t.getFullYear(),n=t.getMonth()+1;t=t.getDate();return e+"-"+(n<10?"0"+n:n)+"-"+(t<10?"0"+t:t)},spanMethod:function(t){var e=t.rowIndex;if(0===t.columnIndex)return{rowspan:t=this.flitterData(this.list).one[e],colspan:0<t?1:0}},flitterData:function(t){var e=[],n=0;return t.forEach((function(a,o){0===o?e.push(1):a.company===t[o-1].company?(e[n]+=1,e.push(0)):(e.push(1),n=o)})),{one:e}},requestData:(Yn=Object(c.a)(regeneratorRuntime.mark((function t(){var e,n,a,o,r=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.loading=!0,this.list=[],t.next=4,pe.departmentEveryDay({daytime:this.daytime,companyNo:this.companyNo});case 4:0===(e=t.sent).code&&e.data&&0<e.data.length?(n=(e.data||[]).map((function(t){var e=t.depart,n=t.msale_total,a=t.mth_total,o=t.sale_total,r=t.th_total,i=t.total_tips,s=t.mzy_sale_total,l=t.mchannel_sale_total,c=t.channel_cost_total,u=t.zy_cost_total,p=t.mzy_cost_total;return{depart:e,total_tips:i,mzy_sale_total:s,mchannel_sale_total:l,channel_cost_total:c,zy_cost_total:u,mchannel_cost_total:t.mchannel_cost_total,mzy_cost_total:p,dayinfo:{sale_total:o,th_total:r},monthinfo:{msale_total:n,mth_total:a}}})),this.total=n.reduce((function(t,e){var n=e.total_tips,a=e.day;a=void 0===a?0:a,e=e.month,e=void 0===e?0:e;return{total_tips:ot(void 0===n?0:n,t.total_tips),month:ot(e,t.month),day:ot(a,t.day)}}),{total_tips:0,month:0,day:0}),n=["百辰","泓源","普润","平台"].map((function(t){return n.find((function(e){return e.depart===t}))})),a={"百辰":"客服部@百辰","泓源":"网络部@泓源","普润":"\t项目部@普润","平台":"\t平台部@万宇"},o=this.companies.find((function(t){return t.value===r.companyNo})),this.list=n.map((function(t){var e=t.depart,n=t.total_tips,i=t.dayinfo,s=t.monthinfo,l=t.mchannel_sale_total,c=t.mzy_sale_total,u=(t.zy_cost_total,t.mchannel_cost_total),p=(t=t.mzy_cost_total,st(s.msale_total,s.mth_total)),d=it(rt(p,n),100).toFixed(2);return{total_tips:n,zy_cost:t,qd_cost:u,depart:a[e],company:o.label,currentMonthPure:[{zy:c,qd:l}],zy_gross:Number(st(c,t)).toFixed(2),qd_gross:Number(st(l,u)).toFixed(2),dayinfo:Un(Un({},i),{},{sale_total:st(i.sale_total,i.th_total)}),proportion:it(rt(s.msale_total,r.total.month)||0,100)||0,monthinfo:{monthNetSales:p,monthProportion:d}}}))):this.list=[],this.getHeight(),this.loading=!1;case 8:case"end":return t.stop()}}),t,this)}))),function(){return Yn.apply(this,arguments)})}},n("9e93"),Zt={name:"newReport",components:{Department:Object(o.a)(Yt,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}]},[n("div",{staticClass:"search clear",staticStyle:{"align-items":"center"}},[n("el-switch",{staticStyle:{"margin-right":"10px"},attrs:{disabled:t.isEmpty,"active-text":"万元","inactive-text":"元"},model:{value:t.isTenThound,callback:function(e){t.isTenThound=e},expression:"isTenThound"}}),n("el-select",{staticStyle:{"margin-right":"10px",width:"105px"},attrs:{size:"small",disabled:t.isEmpty},on:{change:t.requestData},model:{value:t.companyNo,callback:function(e){t.companyNo=e},expression:"companyNo"}},t._l(t.companies,(function(t){return n("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1),n("el-date-picker",{staticClass:"fr picker",staticStyle:{width:"140px"},attrs:{disabled:t.isEmpty,"picker-options":{disbaledData:function(t){return t.getTime()>Date.now()}},placeholder:"选择日期","value-format":"yyyy-MM-dd",format:"yyyy-MM-dd",editable:!1,clearable:!1,size:"small",align:"right",type:"date"},model:{value:t.daytime,callback:function(e){t.daytime=e},expression:"daytime"}})],1),t.isEmpty?[n("div",{staticStyle:{"text-align":"center","line-height":"60px","user-select":"none"}},[t._v("当前账号没有访问权限")])]:n("el-row",{staticStyle:{"margin-top":"10px",display:"flex"}},[n("div",{attrs:{id:"bottom-container"}})])],2)}),[],!1,null,"41d5c94c",null).exports,UnusualState:S,ResultCompanyMonth:At},data:function(){return{companies:[],costField:!1,zxTotal:0,daytime:"",isDisplay:!1,state:{message:"",error:!1,loading:!1}}},mounted:function(){O("code")?this.requestUserinfo():this.login()},methods:{time:(Vn=Object(c.a)(regeneratorRuntime.mark((function t(e){var n,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.startTime,a=e.endTime,this.start=n||"",this.end=a||"",n=this.start,a=this.end,""!==n&&""===a||""===n&&""!==a)return this.$message.warning("时间区间不完整!"),this.date=[],t.abrupt("return");t.next=8;break;case 8:this.start&&this.end?this.date=[this.start+" 00:00:00",this.end+" 23:59:59"]:this.date=[this.start,this.end];case 9:case"end":return t.stop()}}),t,this)}))),function(t){return Vn.apply(this,arguments)}),requestUserinfo:(Gn=Object(c.a)(regeneratorRuntime.mark((function t(){var e,n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.state.loading=!0,e=T(),O("code"),n={code:0,message:"获取成功",data:{openid:"oOpc26KiZFBKIm7SB8knFGvov1qg",subscribe_time:"2022-12-21 15:52:14",updatetime:"2023-05-09 16:22:33",addtime:"2023-04-10 18:11:17",is_show:["1","2","4","6","cost_field"],nickname:"雪寒",addr:"//",gender:"0",mobile:"",avatar:"",status:"1",id:"1",companyArr:[{companyNo:"GS2302231125079621",companyName:"北京百辰荣达国际科贸有限公司",info:[1,2,6]},{companyNo:"GS2302231323386950",companyName:"北京泓源广诚国际商贸有限公司",info:[1,2,6]},{companyNo:"GS2203161855277894",companyName:"北京万宇恒通国际科贸有限公司",info:[1,2,6]},{companyNo:"GS2304031312553746",companyName:"北京锦兴弘昌科技有限公司",info:[1,2,6]},{companyNo:"GS2302231124114965",companyName:"北京普润心堂商贸有限公司",info:[1,2,6]}]}},this.companies=n.data.companyArr.reduce((function(t,e){return e.info.includes(6)||e.info.includes("6")?[].concat(Object(s.a)(t),[{value:e.companyNo,label:e.companyName}]):t}),[]),this.state.loading=!1,t.t0=Number(n.code),t.next=0===t.t0?9:13;break;case 9:return this.isShow=(n.data.is_show||[]).includes(6)||(n.data.is_show||[]).includes("6"),this.costField=(n.data.is_show||[]).includes("cost_field"),x(n.data.openid),t.abrupt("break",17);case 13:return this.state.error=!0,this.state.message=n.message,e&&N(),t.abrupt("break",17);case 17:case"end":return t.stop()}}),t,this)}))),function(){return Gn.apply(this,arguments)}),login:function(){var t=encodeURIComponent("http://stat.caixiao365.com/accountsReceivable"),e="wx_"+Math.random().toString(36).substr(2,15);t="".concat("https://open.weixin.qq.com/connect/oauth2/authorize","?appid=").concat(config.appId,"&redirect_uri=").concat(t,"&response_type=code&scope=").concat("snsapi_userinfo","&state=").concat(e,"#wechat_redirect");window.location.href=t}}},n("5d85"),Gt=Object(o.a)(Zt,(function(){var t=this,e=t.$createElement;e=t._self._c||e;return e("div",{directives:[{name:"loading",rawName:"v-loading",value:t.state.loading,expression:"state.loading"}],staticClass:"new-results",staticStyle:{"min-height":"300px"}},[!t.state.error&&t.isShow?e("div",[e("result-company-month",{attrs:{companies:t.companies,costField:t.costField}}),e("department",{attrs:{companies:t.companies,costField:t.costField}})],1):t.state.loading?t._e():[e("unusual-state",{attrs:{hasPermission:t.isShow,message:t.state.message,path:"newReport"}})]],2)}),[],!1,null,"8c745724",null).exports;var Yn,Gn,Vn,Qn=n("3835"),Bn={"北京百辰荣达国际科贸有限公司":"百辰","北京泓源广诚国际商贸有限公司":"泓源","北京万宇恒通国际科贸有限公司":"万宇","北京锦兴弘昌科技有限公司":"锦兴","北京普润心堂商贸有限公司":"普润","北京知事文化产业发展有限公司":"知事","北京泰文创供应链管理有限公司":"泰文创","北京元隆雅图文化传播股份有限公司":"北京元隆雅图文化传播股份有限公司","结算单E企购":"结算单E企购"},Wn={"北京百辰荣达国际科贸有限公司":"百辰荣达","北京泓源广诚国际商贸有限公司":"泓源广诚","北京万宇恒通国际科贸有限公司":"万宇恒通","北京锦兴弘昌科技有限公司":"锦兴弘昌","北京普润心堂商贸有限公司":"普润心堂","北京知事文化产业发展有限公司":"知事文化","湖北泽仁文化发展有限公司":"泽仁文化"},Kn={companyNo:"yyyt",companyName:"合计-元隆雅图",cost_tips:"0",total_tips:"0",info:[{0:{type:"自营",dayinfo:{sale_total:"0.00",th_total:"0.00",type:"1",cgd_total:"0.00",cgd_th_total:"0.00"},monthinfo:{0:{msale_total:"0.00",mth_total:"0.00",mcgd_total:"0.00",mcgd_th_total:"0.00",type:"1"},1:{msale_total:"0.00",mth_total:"0.00",mcgd_total:"0.00",mcgd_th_total:"0.00",type:"2"},2:{msale_total:"0.00",mth_total:"0.00",mcgd_total:"0.00",mcgd_th_total:"0.00",type:"3"},3:{msale_total:"0.00",mth_total:"0.00",mcgd_total:"618.00",mcgd_th_total:"0.00",type:"4"},msale_total:"0.00",mcost_total:"0.00"}},1:{type:"渠道",dayinfo:{sale_total:"0.00",th_total:"0.00",type:"2",cgd_total:"327.60",cgd_th_total:"0.00"},monthinfo:{0:{msale_total:"5868465.56",mth_total:"44010.00",mcgd_total:"5680337.10",mcgd_th_total:"42689.70",type:"1"},1:{msale_total:"3545201.62",mth_total:"1901822.96",mcgd_total:"3352074.44",mcgd_th_total:"1799760.03",type:"2"},2:{msale_total:"1951934.40",mth_total:"0.00",mcgd_total:"0.00",mcgd_th_total:"0.00",type:"3"},3:{msale_total:"0.00",mth_total:"0.00",mcgd_total:"618.00",mcgd_th_total:"0.00",type:"4"},msale_total:"1643378.66",mcost_total:"1552314.41"}},2:{type:"供应商端",dayinfo:{sale_total:"0.00",th_total:"0.00",type:"3",cgd_total:"0.00",cgd_th_total:"0.00"},monthinfo:{0:{msale_total:"5868465.56",mth_total:"44010.00",mcgd_total:"5680337.10",mcgd_th_total:"42689.70",type:"1"},1:{msale_total:"3545201.62",mth_total:"1901822.96",mcgd_total:"3352074.44",mcgd_th_total:"1799760.03",type:"2"},2:{msale_total:0,mth_total:"0.00",mcgd_total:"0.00",mcgd_th_total:"0.00",type:"3"},3:{msale_total:"0.00",mth_total:"0.00",mcgd_total:"618.00",mcgd_th_total:"0.00",type:"4"},msale_total:0,mcost_total:"0.00"}},3:{type:"物流费用",dayinfo:{sale_total:"0.00",th_total:"0.00",type:"4",cgd_total:"0.00",cgd_th_total:"0.00"},monthinfo:{0:{msale_total:0,mth_total:0,mcgd_total:0,mcgd_th_total:0,type:"1"},1:{msale_total:0,mth_total:0,mcgd_total:0,mcgd_th_total:0,type:"2"},2:{msale_total:0,mth_total:"0.00",mcgd_total:"0.00",mcgd_th_total:"0.00",type:"3"},3:{msale_total:"0.00",mth_total:"0.00",mcgd_total:0,mcgd_th_total:"0.00",type:"4"},msale_total:0,mcost_total:0}}}],sale_total:0,cost_total:0,msale_total:0,mcost_total:0,gross_completion:0,completion_rate:0,gross_completion_rate:0,gross_sale_completion_rate:"0.00"};function Zn(t,e){var n,a=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,n)),a}function Jn(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Zn(Object(n),!0).forEach((function(e){Object(l.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Zn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Xn,ta;wn={props:["companies","costField","isTenThound"],data:function(){return{daytime:"",loading:!1,tableData:[],companyNo:"",plat_cp_companies:[],cp_companies:[],isEmpty:!1,mapCompany:Bn}},mounted:function(){var t,e,n=this,a=!1,o=this.companies.findIndex((function(t){return"北京锦兴弘昌科技有限公司"===t.label})),r=this.companies.findIndex((function(t){return"北京普润心堂商贸有限公司"===t.label})),i=this.companies.findIndex((function(t){return"北京知事文化产业发展有限公司"===t.label}));-1===o&&-1===r&&-1===i||(a=!0),this.cp_companies=this.companies.filter((function(t){return"北京锦兴弘昌科技有限公司"!==t.label&&"北京普润心堂商贸有限公司"!==t.label&&"北京知事文化产业发展有限公司"!==t.label})),a&&(this.cp_companies=[].concat(Object(s.a)(this.cp_companies),[{value:"GS2302231124114965",label:"普润&锦兴&知事"}])),this.isEmpty=0===this.cp_companies.length,this.isEmpty||(t={"北京万宇恒通国际科贸有限公司":"平台公司: 万宇","北京泰文创供应链管理有限公司":"平台公司: 泰文创","北京元隆雅图文化传播股份有限公司":"预订单E企购"},this.cp_companies=this.cp_companies.map((function(e,n){var a=t[e.label]||e.label;return Jn(Jn({},e),{},{label:a})})),o=["所有平台公司","平台公司: 万宇","平台公司: 泰文创","预订单E企购","结算单E企购"],e=this.cp_companies.map((function(t){return t.label})),o=o.filter((function(t){return e.includes(t)})),this.plat_cp_companies=o.map((function(t){return n.cp_companies.find((function(e){return e.label===t}))})),4===this.plat_cp_companies.length&&(this.plat_cp_companies=[{value:"",label:"所有平台公司"}].concat(Object(s.a)(this.plat_cp_companies))),this.companyNo=this.plat_cp_companies[0].value,this.daytime=this.transformTime(),this.requestData())},methods:{calcAmountRealRate:function(){var t=this.calcAmount("msale_total"),e=this.calcAmount("gross_completion");return Number(it(Number(rt(e,t)).toFixed(2),100)).toFixed(2)+"%"},calcAmountGrossCompletionRate:function(){var t=this.calcAmount("gross_completion"),e=this.calcAmount("cost_tips");return Number(it(Number(rt(t,e)).toFixed(2),100)).toFixed(2)+"%"},calcAmountCompletionRate:function(){var t=this.calcAmount("msale_total"),e=this.calcAmount("total_tips");return Number(it(Number(rt(t,e)).toFixed(2),100)).toFixed(2)+"%"},calcAmount:function(t){var e,n,a,o,r=1<arguments.length&&void 0!==arguments[1]&&arguments[1],i=this.tableData.find((function(t){return"合计-元隆雅图"===t.companyName}));return r?(r=t.split("."),r=Object(Qn.a)(r,4),e=r[0],n=r[1],a=r[2],o=r[3],i.children.reduce((function(t,r){return t=Number(ot(t,isNaN(r.info[e][n][a][o])?0:r.info[e][n][a][o])),0===t?0:t.toFixed(2)}),0)):i.children.reduce((function(e,n){return e=Number(ot(e,isNaN(n[t])?0:n[t])),0===e?0:e.toFixed(2)}),0)},unit2TenThousand:lt,load:function(t,e,n){var a=this.tableData.find((function(t){return-1!==t.companyName.indexOf("元隆雅图")}));n(a?a.children:[])},getCurrentRateStyle:function(t){var e=at()(this.daytime).daysInMonth(),n=(e=Number(rt(100,e)).toFixed(2),at()(this.daytime).date());n=Number(it(n,e)).toFixed(2);return Number(n)>Number(t)?"color:red":""},getCurrentValueStyle:function(t,e){var n=at()(this.daytime).daysInMonth();e=Number(rt(e,n)).toFixed(2),n=at()(this.daytime).date(),n=Number(it(n,e)).toFixed(2);return Number(n)>Number(t)?"color: red":""},addDataToCompany:function(t,e){return{companyName:"普润",cost_tips:Number(t.cost_tips).toFixed(2),total_tips:Number(t.total_tips).toFixed(2),monthinfo:t.monthinfo.map((function(t,n){return{mcgd_th_total:Number(ot(t.mcgd_th_total,e.monthinfo[n].mcgd_th_total)).toFixed(2),mcgd_total:Number(ot(t.mcgd_total,e.monthinfo[n].mcgd_total)).toFixed(2),msale_total:Number(ot(t.msale_total,e.monthinfo[n].msale_total)).toFixed(2),mth_total:Number(ot(t.mth_total,e.monthinfo[n].mth_total)).toFixed(2),type:t.type}})),dayinfo:t.dayinfo.map((function(t,n){return{cgd_th_total:Number(ot(t.cgd_th_total,e.dayinfo[n].cgd_th_total)).toFixed(2),cgd_total:Number(ot(t.cgd_total,e.dayinfo[n].cgd_total)).toFixed(2),sale_total:Number(ot(t.sale_total,e.dayinfo[n].sale_total)).toFixed(2),th_total:Number(ot(t.th_total,e.dayinfo[n].th_total)).toFixed(2),type:t.type}}))}},setCellClassName:function(t){var e=t.column,n=(t=t.row,e=e.label,"");return"北京万宇恒通国际科贸有限公司"===t.companyName&&(n+="font-bold "),"营收目标"===e?n+"bg__success":-1===e.indexOf("营业")&&-1===e.indexOf("营收")||"当日营业收入"===e?"毛利目标"===e?n+"bg__primary":-1!==e.indexOf("毛利")?n+"bg__primary_1":-1!==e.indexOf("成本")?n+"bg__warning_1":n:n+"bg__success_1"},setHeaderClassName:function(t){return t=t.column.label,"营收目标"===t?"bg__success":-1===t.indexOf("营业")&&-1===t.indexOf("营收")||"当日营业收入"===t?"毛利目标"===t?"bg__primary":-1!==t.indexOf("毛利")?"bg__primary_1":-1!==t.indexOf("成本")?"bg__warning_1":void 0:"bg__success_1"},transformTime:function(){var t=new Date,e=t.getFullYear(),n=t.getMonth()+1;t=t.getDate();return e+"-"+(n<10?"0"+n:n)+"-"+(t<10?"0"+t:t)},getData:(ta=Object(c.a)(regeneratorRuntime.mark((function t(){var e,n,a,o=arguments;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=(0<o.length&&void 0!==o[0]?o[0]:{isChildren:!1}).isChildren,this.loading=!0,n=e?pe.platform:pe.companyEveryMonth,t.next=5,n({daytime:this.daytime});case 5:return n=t.sent,this.loading=!1,a=[],(e?1===n.code:0===n.code)&&n.data&&0<n.data.length?n.data.forEach((function(t){var n=t.platform_name,o=t.platform_id,r=t.companyName,i=t.companyNo,l=t.monthinfo,c=void 0===l?[]:l,u=(l=t.dayinfo,void 0===l?[]:l),p=(l=t.total_tips,l=void 0===l?0:l,t=t.cost_tips,t=void 0===t?0:t,{1:"自营",2:"渠道",3:"供应商端",4:"物流费用"}),d=Object.keys(p),m=0,h=0,f=0,_=0,y=(d=d.map((function(t){var n=(Array.isArray(c)?c:[c]).find((function(e){return String(e.type)===t})),a=(Array.isArray(u)?u:[u]).find((function(e){return String(e.type)===t})),o=(n=n||{mcgd_th_total:"0.00",mcgd_total:"0.00",msale_total:"0.00",mth_total:"0.00",type:t},a=a||{sale_total:"0.00",th_total:"0.00",type:"1",cgd_total:"0.00",cgd_th_total:"0.00"},e&&"sum_sale_total"in a&&(a={cgd_total:a.sum_cgd_total,sale_total:a.sum_sale_total,cgd_th_total:a.sum_cgd_th_total,th_total:a.sum_th_total,type:t}),0),r=(4!==Number(t)&&(o=st(n.msale_total,n.mth_total)||0),st(a.sale_total,a.th_total)||0),i=st(a.cgd_total,a.cgd_th_total)||0,s=0;s=4!==Number(t)?st(n.mcgd_total,n.mcgd_th_total)||0:Number(n.mcgd_total||0).toFixed(2);return m=Number(ot(m,r)).toFixed(2),h=Number(ot(h,o)).toFixed(2),f=Number(ot(f,i)).toFixed(2),_=Number(ot(_,s)).toFixed(2),{type:p[t],dayinfo:Jn(Jn({},a),{},{sale_total:r}),monthinfo:Jn(Jn({},c),{},{msale_total:o,mcost_total:s})}})),Number(st(h,_)).toFixed(2));a=[].concat(Object(s.a)(a),[{companyNo:e?o:i,companyName:e?n:r,cost_tips:t,total_tips:l,info:d,sale_total:m,cost_total:f,msale_total:h,mcost_total:_,gross_completion:y,completion_rate:it(rt(h,l),100).toFixed(2),gross_completion_rate:0===Number(t)?0:it(rt(y,t)||0,100).toFixed(2),gross_sale_completion_rate:Number(it(rt(y,h)||0,100)).toFixed(2)}])})):a=[],t.abrupt("return",a);case 10:case"end":return t.stop()}}),t,this)}))),function(){return ta.apply(this,arguments)}),requestData:(Xn=Object(c.a)(regeneratorRuntime.mark((function t(){var e,n,a,o,r,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getData();case 2:if(e=t.sent,o=["北京万宇恒通国际科贸有限公司","北京泰文创供应链管理有限公司","北京元隆雅图文化传播股份有限公司"],n=this.plat_cp_companies.map((function(t){return t.value})),a=e.map((function(t){return t.companyName})),o=o.filter((function(t){return a.includes(t)})),e=(e=o.map((function(t){return e.find((function(e){return e.companyName===t}))}))).filter((function(t){return t=t.companyNo,n.includes(t)})),-1!==(o=e.findIndex((function(t){return"GS2404151642335170"===t.companyNo}))))return t.next=13,this.getData({isChildren:!0});t.next=16;break;case 13:r=t.sent,i=e.splice(o,1),i=Object(Qn.a)(i,1),i=i[0],e.unshift(Jn({hasChildren:!0,children:r},i));case 16:this.tableData=e;case 17:case"end":return t.stop()}}),t,this)}))),function(){return Xn.apply(this,arguments)})}},n("5011"),re=Object(o.a)(wn,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}]},[n("div",{staticClass:"search clear",staticStyle:{"align-items":"center"}},[n("el-tooltip",{attrs:{placement:"top",width:"50px",trigger:"hover",content:"平台公司"}},[n("i",{staticClass:"el-icon-warning-outline",staticStyle:{"font-size":"16px",cursor:"pointer",display:"inline-block","padding-right":"5px"}})]),n("span",{staticStyle:{"font-size":"15px"}},[t._v("月度完成情况")]),n("div",{staticStyle:{float:"right"}},[n("el-date-picker",{staticClass:"fr picker no-padding",staticStyle:{width:"95px"},attrs:{"value-format":"yyyy-MM-dd",editable:!1,disabled:t.isEmpty,clearable:!1,size:"small",format:"yyyy-MM-dd",type:"date",align:"right",placeholder:"选择日期","picker-options":{disabledDate:function(t){return t.getTime()>Date.now()}}},on:{change:t.requestData},model:{value:t.daytime,callback:function(e){t.daytime=e},expression:"daytime"}})],1)],1),t.isEmpty?[n("div",{staticStyle:{"text-align":"center","line-height":"60px","user-select":"none"}},[t._v("当前账号没有访问权限")])]:n("el-row",{staticStyle:{"margin-top":"10px"}},[n("el-table",{attrs:{border:"",size:"mini",data:t.tableData,"header-cell-class-name":t.setHeaderClassName,"cell-class-name":t.setCellClassName,"row-key":"companyNo",load:t.load,lazy:""}},[n("el-table-column",{attrs:{fixed:"left",label:"公司",prop:"companyName",align:"center",width:"120px"},scopedSlots:t._u([{key:"default",fn:function(e){return[-1===e.row.companyName.indexOf("元隆雅图")?n("span",[t._v("\n "+t._s(t.mapCompany[e.row.companyName]||e.row.companyName)+"\n ")]):n("span",[t._v("\n 元隆雅图\n ")])]}}],null,!1,3822457973)}),n("el-table-column",{attrs:{label:"当日营业收入",align:"center",width:"95px"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s("合计-元隆雅图"===e.row.companyName?t.unit2TenThousand(t.calcAmount("sale_total"),t.isTenThound):t.unit2TenThousand(e.row.sale_total,t.isTenThound))+"\n ")]}}],null,!1,1322192287)}),n("el-table-column",{attrs:{label:"营收目标",align:"center","min-width":"95px"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s("合计-元隆雅图"===e.row.companyName?t.unit2TenThousand(t.calcAmount("total_tips"),t.isTenThound):t.unit2TenThousand(e.row.total_tips,t.isTenThound))+"\n ")]}}],null,!1,3794592127)}),n("el-table-column",{attrs:{label:"营业收入(净)",align:"center","min-width":"115px"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("div",{staticStyle:{display:"flex","justify-content":"center"},style:""+("合计-元隆雅图"===e.row.companyName?"":t.getCurrentValueStyle(e.row.msale_total,e.row.total_tips))},[t._v("\n "+t._s("合计-元隆雅图"===e.row.companyName?t.unit2TenThousand(t.calcAmount("msale_total"),t.isTenThound):t.unit2TenThousand(e.row.msale_total,t.isTenThound))+"\n "),n("el-popover",{attrs:{placement:"right",width:200,trigger:"click"},scopedSlots:t._u([{key:"reference",fn:function(){return[n("div",{style:""+t.getCurrentValueStyle(e.row.msale_total,e.row.total_tips)},[n("i",{staticClass:"el-icon-warning-outline trigger-hover",staticStyle:{"font-size":"16px",cursor:"pointer","margin-left":"5px"}})])]},proxy:!0}],null,!0)},[n("div",{staticClass:"table-size"},[n("p",[t._v("直营/自营: "+t._s("合计-元隆雅图"===e.row.companyName?t.unit2TenThousand(t.calcAmount("0.0.monthinfo.msale_total",!0),t.isTenThound):t.unit2TenThousand(e.row.info[0].monthinfo.msale_total,t.isTenThound)))]),n("p",[t._v("支付渠道: "+t._s("合计-元隆雅图"===e.row.companyName?t.unit2TenThousand(t.calcAmount("0.1.monthinfo.msale_total",!0),t.isTenThound):t.unit2TenThousand(e.row.info[1].monthinfo.msale_total,t.isTenThound)))]),"预订单E企购"!==e.row.companyName&&"结算单E企购"!==e.row.companyName?n("p",[t._v("供应商端: "+t._s("合计-元隆雅图"===e.row.companyName?t.unit2TenThousand(t.calcAmount("0.2.monthinfo.msale_total",!0),t.isTenThound):t.unit2TenThousand(e.row.info[2].monthinfo.msale_total,t.isTenThound))+"\n ")]):t._e()])])],1)]}}],null,!1,3470727029)}),n("el-table-column",{attrs:{label:"营收完成%",align:"center","min-width":"85px"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("div",{style:""+("合计-元隆雅图"===e.row.companyName?"":t.getCurrentRateStyle(e.row.completion_rate))},[t._v("\n "+t._s("合计-元隆雅图"===e.row.companyName?t.calcAmountCompletionRate():("NaN"===String(e.row.completion_rate)?0:e.row.completion_rate)+"%")+"\n ")])]}}],null,!1,3604694451)}),t.costField?[n("el-table-column",{attrs:{label:"毛利目标",align:"center","min-width":"90px"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.costField?"合计-元隆雅图"===e.row.companyName?t.unit2TenThousand(t.calcAmount("cost_tips"),t.isTenThound):t.unit2TenThousand(e.row.cost_tips,t.isTenThound):"***")+"\n ")]}}],null,!1,982655705)}),n("el-table-column",{attrs:{label:"毛利完成",align:"center","min-width":"90px"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("div",{style:""+("合计-元隆雅图"===e.row.companyName?"":t.getCurrentValueStyle(e.row.gross_completion,e.row.cost_tips))},[t._v("\n "+t._s(t.costField?"合计-元隆雅图"===e.row.companyName?t.unit2TenThousand(t.calcAmount("gross_completion"),t.isTenThound):t.unit2TenThousand(e.row.gross_completion,t.isTenThound):"***")+"\n ")])]}}],null,!1,254990614)})]:t._e(),n("el-table-column",{attrs:{label:"毛利完成%",align:"center","min-width":"85px"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("div",{style:"合计-元隆雅图"===e.row.companyName?"":t.getCurrentRateStyle(e.row.gross_completion_rate)},[t._v("\n "+t._s("合计-元隆雅图"===e.row.companyName?t.calcAmountGrossCompletionRate():e.row.gross_completion_rate+"%")+"\n ")])]}}],null,!1,972493678)}),t.costField?[n("el-table-column",{attrs:{label:"成本合计",align:"center","min-width":"125px"},scopedSlots:t._u([{key:"default",fn:function(e){return[t.costField?n("div",{staticStyle:{display:"flex","justify-content":"center"}},[t._v("\n "+t._s("合计-元隆雅图"===e.row.companyName?t.unit2TenThousand(t.calcAmount("mcost_total"),t.isTenThound):t.unit2TenThousand(e.row.mcost_total,t.isTenThound))+"\n "),n("el-popover",{attrs:{placement:"right",width:200,trigger:"click"},scopedSlots:t._u([{key:"reference",fn:function(){return[n("i",{staticClass:"el-icon-warning-outline trigger-hover",staticStyle:{"font-size":"16px",cursor:"pointer","margin-left":"5px"}})]},proxy:!0}],null,!0)},[n("div",{staticClass:"table-size"},[n("p",[t._v("直营/自营: \n "+t._s("合计-元隆雅图"===e.row.companyName?t.unit2TenThousand(t.calcAmount("0.0.monthinfo.mcost_total",!0),t.isTenThound):t.unit2TenThousand(e.row.info[0].monthinfo.mcost_total,t.isTenThound))+"\n ")]),n("p",[t._v("支付渠道: \n "+t._s("合计-元隆雅图"===e.row.companyName?t.unit2TenThousand(t.calcAmount("0.1.monthinfo.mcost_total",!0),t.isTenThound):t.unit2TenThousand(e.row.info[1].monthinfo.mcost_total,t.isTenThound)))]),"预订单E企购"!==e.row.companyName&&"结算单E企购"!==e.row.companyName?n("p",[t._v("供应商端: \n "+t._s("合计-元隆雅图"===e.row.companyName?t.unit2TenThousand(t.calcAmount("0.2.monthinfo.mcost_total",!0),t.isTenThound):t.unit2TenThousand(e.row.info[2].monthinfo.mcost_total,t.isTenThound)))]):t._e(),n("p",[t._v("物流费用: \n "+t._s("合计-元隆雅图"===e.row.companyName?t.unit2TenThousand(t.calcAmount("0.3.monthinfo.mcost_total",!0),t.isTenThound):t.unit2TenThousand(e.row.info[3].monthinfo.mcost_total,t.isTenThound))+"\n ")])])])],1):n("p",[t._v("***")])]}}],null,!1,1664613604)}),n("el-table-column",{attrs:{label:"实际毛利率",align:"center",width:"85px"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.costField?"合计-元隆雅图"===e.row.companyName?t.calcAmountRealRate():t.unit2TenThousand(e.row.gross_sale_completion_rate)+"%":"***")+"\n ")]}}],null,!1,378145859)})]:t._e()],2)],1)],2)}),[],!1,null,"15c1b49a",null).exports;function ea(t,e){var n,a=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,n)),a}function na(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ea(Object(n),!0).forEach((function(e){Object(l.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ea(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var aa;oe={props:["companies","costField","isTenThound"],data:function(){return{daytime:"",loading:!1,tableData:[],companyNo:"",plat_cp_companies:[],cp_companies:[],isEmpty:!1,mapCompany:Bn}},mounted:function(){var t,e=this,n=!1,a=this.companies.findIndex((function(t){return"北京锦兴弘昌科技有限公司"===t.label})),o=this.companies.findIndex((function(t){return"北京普润心堂商贸有限公司"===t.label})),r=this.companies.findIndex((function(t){return"北京知事文化产业发展有限公司"===t.label}));-1===a&&-1===o&&-1===r||(n=!0),this.cp_companies=this.companies.filter((function(t){return"北京锦兴弘昌科技有限公司"!==t.label&&"北京普润心堂商贸有限公司"!==t.label&&"北京知事文化产业发展有限公司"!==t.label})),n&&(this.cp_companies=[].concat(Object(s.a)(this.cp_companies),[{value:"GS2302231124114965",label:"普润&锦兴&知事"}])),this.isEmpty=0===this.cp_companies.length,this.isEmpty||(this.cp_companies=this.cp_companies.map((function(t,e){var n="";return"北京万宇恒通国际科贸有限公司"===t.label&&(n="平台公司: 万宇"),"北京泰文创供应链管理有限公司"===t.label&&(n="平台公司: 泰文创"),"北京元隆雅图文化传播股份有限公司"===t.label&&(n="平台公司: 元隆"),"结算单E企购"===t.label&&(n="结算单E企购"),""===(n="普润&锦兴&知事"===t.label?"业务公司: 普润&锦兴&知事":n)&&(n="业务公司: ".concat(Bn[t.label])),na(na({},t),{},{label:n})})),a=["所有业务公司","业务公司: 百辰","业务公司: 泓源","业务公司: 普润&锦兴&知事"],t=this.cp_companies.map((function(t){return t.label})),a=a.filter((function(e){return t.includes(e)})),this.plat_cp_companies=a.map((function(t){return e.cp_companies.find((function(e){return e.label===t}))})),3===this.plat_cp_companies.length&&(this.plat_cp_companies=[{value:"",label:"所有业务公司"}].concat(Object(s.a)(this.plat_cp_companies))),this.companyNo=this.plat_cp_companies[0].value,this.daytime=this.transformTime(),this.requestData())},methods:{unit2TenThousand:lt,getCurrentRateStyle:function(t){var e=at()(this.daytime).daysInMonth(),n=(e=Number(rt(100,e)).toFixed(2),at()(this.daytime).date());n=Number(it(n,e)).toFixed(2);return Number(n)>Number(t)?"color:red":""},getCurrentValueStyle:function(t,e){var n=at()(this.daytime).daysInMonth();e=Number(rt(e,n)).toFixed(2),n=at()(this.daytime).date(),n=Number(it(n,e)).toFixed(2);return Number(n)>Number(t)?"color: red":""},addDataToCompany:function(t,e){return{companyName:"普润",cost_tips:Number(t.cost_tips).toFixed(2),total_tips:Number(t.total_tips).toFixed(2),monthinfo:t.monthinfo.map((function(t,n){return{mcgd_th_total:Number(ot(t.mcgd_th_total,e.monthinfo[n].mcgd_th_total)).toFixed(2),mcgd_total:Number(ot(t.mcgd_total,e.monthinfo[n].mcgd_total)).toFixed(2),msale_total:Number(ot(t.msale_total,e.monthinfo[n].msale_total)).toFixed(2),mth_total:Number(ot(t.mth_total,e.monthinfo[n].mth_total)).toFixed(2),type:t.type}})),dayinfo:t.dayinfo.map((function(t,n){return{cgd_th_total:Number(ot(t.cgd_th_total,e.dayinfo[n].cgd_th_total)).toFixed(2),cgd_total:Number(ot(t.cgd_total,e.dayinfo[n].cgd_total)).toFixed(2),sale_total:Number(ot(t.sale_total,e.dayinfo[n].sale_total)).toFixed(2),th_total:Number(ot(t.th_total,e.dayinfo[n].th_total)).toFixed(2),type:t.type}}))}},setCellClassName:function(t){var e=t.column,n=(t=t.row,e=e.label,"");return"北京万宇恒通国际科贸有限公司"===t.companyName&&(n+="font-bold "),"营收目标"===e?n+"bg__success":-1===e.indexOf("营业")&&-1===e.indexOf("营收")||"当日营业收入"===e?"毛利目标"===e?n+"bg__primary":-1!==e.indexOf("毛利")?n+"bg__primary_1":-1!==e.indexOf("成本")?n+"bg__warning_1":n:n+"bg__success_1"},setHeaderClassName:function(t){return t=t.column.label,"营收目标"===t?"bg__success":-1===t.indexOf("营业")&&-1===t.indexOf("营收")||"当日营业收入"===t?"毛利目标"===t?"bg__primary":-1!==t.indexOf("毛利")?"bg__primary_1":-1!==t.indexOf("成本")?"bg__warning_1":void 0:"bg__success_1"},transformTime:function(){var t=new Date,e=t.getFullYear(),n=t.getMonth()+1;t=t.getDate();return e+"-"+(n<10?"0"+n:n)+"-"+(t<10?"0"+t:t)},requestData:(aa=Object(c.a)(regeneratorRuntime.mark((function t(){var e,n,a,o=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.loading=!0,this.tableData=[],t.next=4,pe.companyEveryMonth({daytime:this.daytime});case 4:0===(e=t.sent).code&&e.data&&0<e.data.length?(e.data.forEach((function(t){var e=t.companyName,n=t.companyNo,a=t.monthinfo,r=t.dayinfo,i=t.total_tips,l=(t=t.cost_tips,{1:"自营",2:"渠道",3:"供应商端",4:"物流费用"}),c=Object.keys(l),u=0,p=0,d=0,m=0,h=(c=c.map((function(t){var e=a.find((function(e){return String(e.type)===t}))||{},n=r.find((function(e){return String(e.type)===t}))||{},o=0,i=(4!==Number(t)&&(o=st(e.msale_total,e.mth_total)||0),st(n.sale_total,n.th_total)||0),s=st(n.cgd_total,n.cgd_th_total)||0,c=0;c=4!==Number(t)?st(e.mcgd_total,e.mcgd_th_total)||0:Number(e.mcgd_total||0).toFixed(2);return u=Number(ot(u,i)).toFixed(2),p=Number(ot(p,o)).toFixed(2),d=Number(ot(d,s)).toFixed(2),m=Number(ot(m,c)).toFixed(2),{type:l[t],dayinfo:na(na({},n),{},{sale_total:i}),monthinfo:na(na({},a),{},{msale_total:o,mcost_total:c})}})),Number(st(p,m)).toFixed(2));o.tableData=[].concat(Object(s.a)(o.tableData),[{companyNo:n,companyName:e,cost_tips:t,total_tips:i,info:[na({},c)],sale_total:u,cost_total:d,msale_total:p,mcost_total:m,gross_completion:h,completion_rate:it(rt(p,i),100).toFixed(2),gross_completion_rate:0===Number(t)?0:it(rt(h,t)||0,100).toFixed(2),gross_sale_completion_rate:Number(it(rt(h,p)||0,100)).toFixed(2)}])})),e=["北京百辰荣达国际科贸有限公司","北京泓源广诚国际商贸有限公司","北京普润心堂商贸有限公司",""],n=this.tableData.map((function(t){return t.companyName})),a=this.plat_cp_companies.map((function(t){return t.value})),e=e.filter((function(t){return n.includes(t)})),this.tableData=e.map((function(t){return o.tableData.find((function(e){return e.companyName===t}))})),this.tableData=this.tableData.filter((function(t){return t=t.companyNo,a.includes(t)}))):this.tableData=[],this.loading=!1;case 7:case"end":return t.stop()}}),t,this)}))),function(){return aa.apply(this,arguments)})}},n("5139"),rn=Object(o.a)(oe,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}]},[n("div",{staticClass:"search clear",staticStyle:{"align-items":"center"}},[n("div",{staticStyle:{float:"left","line-height":"30px",display:"flex","align-items":"center"}},[n("el-tooltip",{attrs:{placement:"top",width:"50px",trigger:"hover",content:"业务公司"}},[n("i",{staticClass:"el-icon-warning-outline",staticStyle:{"font-size":"16px",cursor:"pointer",display:"inline-block","padding-right":"5px"}})]),n("span",{staticStyle:{"font-size":"15px"}},[t._v("月度完成情况")])],1),n("div",{staticStyle:{float:"right"}},[n("el-date-picker",{staticClass:"fr picker no-padding",staticStyle:{width:"95px"},attrs:{"value-format":"yyyy-MM-dd",editable:!1,disabled:t.isEmpty,clearable:!1,size:"small",format:"yyyy-MM-dd",type:"date",align:"right",placeholder:"选择日期","picker-options":{disabledDate:function(t){return t.getTime()>Date.now()}}},on:{change:t.requestData},model:{value:t.daytime,callback:function(e){t.daytime=e},expression:"daytime"}})],1)]),t.isEmpty?[n("div",{staticStyle:{"text-align":"center","line-height":"60px","user-select":"none"}},[t._v("当前账号没有访问权限")])]:n("el-row",{staticStyle:{"margin-top":"10px"}},[n("el-table",{attrs:{border:"",size:"mini",data:t.tableData,"header-cell-class-name":t.setHeaderClassName,"cell-class-name":t.setCellClassName}},[n("el-table-column",{attrs:{fixed:"left",label:"公司",prop:"companyName",align:"center",width:"65px"},scopedSlots:t._u([{key:"default",fn:function(e){return[-1===e.row.companyName.indexOf("普润")?n("div",[t._v("\n "+t._s(t.mapCompany[e.row.companyName]||e.row.companyName)+"\n ")]):n("div",[n("el-popover",{attrs:{placement:"right",width:"200",trigger:"hover",content:"普润&锦兴&知事"},scopedSlots:t._u([{key:"reference",fn:function(){return[n("i",{staticClass:"el-icon-warning-outline",staticStyle:{"font-size":"14px",cursor:"pointer"}}),t._v("\n 普润\n ")]},proxy:!0}],null,!0)})],1)]}}],null,!1,992203119)}),n("el-table-column",{attrs:{label:"当日营业收入",align:"center",width:"95px"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.unit2TenThousand(e.row.sale_total,t.isTenThound))+"\n ")]}}],null,!1,1039656234)}),n("el-table-column",{attrs:{label:"营收目标",align:"center","min-width":"95px"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.unit2TenThousand(e.row.total_tips,t.isTenThound))+"\n ")]}}],null,!1,1256669967)}),n("el-table-column",{attrs:{label:"营业收入(净)",align:"center","min-width":"115px"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("div",{staticStyle:{display:"flex","justify-content":"center"},style:""+t.getCurrentValueStyle(e.row.msale_total,e.row.total_tips)},[t._v("\n "+t._s(t.unit2TenThousand(e.row.msale_total,t.isTenThound))+"\n "),n("el-popover",{attrs:{placement:"right",width:200,trigger:"click"},scopedSlots:t._u([{key:"reference",fn:function(){return[n("div",{style:""+t.getCurrentValueStyle(e.row.msale_total,e.row.total_tips)},[n("i",{staticClass:"el-icon-warning-outline trigger-hover",staticStyle:{"font-size":"16px",cursor:"pointer","margin-left":"5px"}})])]},proxy:!0}],null,!0)},[n("div",{staticClass:"table-size"},[n("p",[t._v("直营/自营: "+t._s(t.unit2TenThousand(e.row.info[0][0].monthinfo.msale_total,t.isTenThound)))]),n("p",[t._v("支付渠道: "+t._s(t.unit2TenThousand(e.row.info[0][1].monthinfo.msale_total,t.isTenThound)))]),n("p",[t._v("供应商端: "+t._s(t.unit2TenThousand(e.row.info[0][2].monthinfo.msale_total,t.isTenThound)))])])])],1)]}}],null,!1,877686572)}),n("el-table-column",{attrs:{label:"营收完成%",align:"center","min-width":"85px"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("div",{style:""+t.getCurrentRateStyle(e.row.completion_rate)},[t._v(t._s(("NaN"===String(e.row.completion_rate)?0:e.row.completion_rate)+"%")+"\n ")])]}}],null,!1,3143000876)}),t.costField?[n("el-table-column",{attrs:{label:"毛利目标",align:"center","min-width":"90px"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.costField?t.unit2TenThousand(e.row.cost_tips,t.isTenThound):"***")+"\n ")]}}],null,!1,2600940256)}),n("el-table-column",{attrs:{label:"毛利完成",align:"center","min-width":"90px"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("div",{style:""+t.getCurrentValueStyle(e.row.gross_completion,e.row.cost_tips)},[t._v("\n "+t._s(t.costField?t.unit2TenThousand(e.row.gross_completion,t.isTenThound):"***")+"\n ")])]}}],null,!1,3300465382)})]:t._e(),n("el-table-column",{attrs:{label:"毛利完成%",align:"center","min-width":"85px"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("div",{style:t.getCurrentRateStyle(e.row.gross_completion_rate)},[t._v("\n "+t._s(e.row.gross_completion_rate+"%")+"\n ")])]}}],null,!1,1390167442)}),t.costField?[n("el-table-column",{attrs:{label:"成本合计",align:"center","min-width":"125px"},scopedSlots:t._u([{key:"default",fn:function(e){return[t.costField?n("div",{staticStyle:{display:"flex","justify-content":"center"}},[t._v("\n "+t._s(t.unit2TenThousand(e.row.mcost_total,t.isTenThound))+"\n "),n("el-popover",{attrs:{placement:"right",width:200,trigger:"click"},scopedSlots:t._u([{key:"reference",fn:function(){return[n("i",{staticClass:"el-icon-warning-outline trigger-hover",staticStyle:{"font-size":"16px",cursor:"pointer","margin-left":"5px"}})]},proxy:!0}],null,!0)},[n("div",{staticClass:"table-size"},[n("p",[t._v("直营/自营: "+t._s(t.unit2TenThousand(e.row.info[0][0].monthinfo.mcost_total,t.isTenThound)))]),n("p",[t._v("支付渠道: "+t._s(t.unit2TenThousand(e.row.info[0][1].monthinfo.mcost_total,t.isTenThound)))]),n("p",[t._v("供应商端: "+t._s(t.unit2TenThousand(e.row.info[0][2].monthinfo.mcost_total,t.isTenThound)))]),n("p",[t._v("物流费用: "+t._s(t.unit2TenThousand(e.row.info[0][3].monthinfo.mcost_total,t.isTenThound)))])])])],1):n("p",[t._v("***")])]}}],null,!1,1442372113)}),n("el-table-column",{attrs:{label:"实际毛利率",align:"center",width:"85px"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.costField?t.unit2TenThousand(e.row.gross_sale_completion_rate)+"%":"***")+"\n ")]}}],null,!1,3104583033)})]:t._e()],2)],1)],2)}),[],!1,null,"c076d702",null).exports;function oa(t,e){var n,a=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,n)),a}function ra(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?oa(Object(n),!0).forEach((function(e){Object(l.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):oa(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var ia;Mt={props:["companies","costField","isTenThound"],data:function(){return{daytime:"",loading:!1,tableData:[],companyNo:"",plat_cp_companies:[],cp_companies:[],isEmpty:!1,mapCompany2:Wn,composeCompanies:["QS2206011447553544","QS2304031312553756","QS2203150147012961"],otherCompanise:[],notOtherCompanise:["QS2206011447553544","QS2304031312553756","QS2203150147012961","QS2203150147013805","QS2203150147015222","QS2206011103304501"]}},mounted:function(){var t,e=this,n=!1,a=this.companies.findIndex((function(t){return"北京锦兴弘昌科技有限公司"===t.label})),o=this.companies.findIndex((function(t){return"北京普润心堂商贸有限公司"===t.label})),r=this.companies.findIndex((function(t){return"北京知事文化产业发展有限公司"===t.label}));-1===a&&-1===o&&-1===r||(n=!0),this.cp_companies=this.companies.filter((function(t){return"北京锦兴弘昌科技有限公司"!==t.label&&"北京普润心堂商贸有限公司"!==t.label&&"北京知事文化产业发展有限公司"!==t.label})),n&&(this.cp_companies=[].concat(Object(s.a)(this.cp_companies),[{value:"GS2302231124114965",label:"普润&锦兴&知事"}])),this.isEmpty=0===this.cp_companies.length,this.isEmpty||(this.cp_companies=this.cp_companies.map((function(t,e){var n="";return"北京万宇恒通国际科贸有限公司"===t.label&&(n="平台公司: 万宇"),"北京泰文创供应链管理有限公司"===t.label&&(n="平台公司: 泰文创"),"北京元隆雅图文化传播股份有限公司"===t.label&&(n="预订单E企购"),"结算单E企购"===t.label&&(n="结算单E企购"),""===(n="普润&锦兴&知事"===t.label?"业务公司: 普润&锦兴&知事":n)&&(n="业务公司: ".concat(Wn[t.label])),ra(ra({},t),{},{label:n})})),a=["所有平台公司","平台公司: 万宇","平台公司: 泰文创","预订单E企购","结算单E企购"],t=this.cp_companies.map((function(t){return t.label})),a=a.filter((function(e){return t.includes(e)})),this.plat_cp_companies=a.map((function(t){return e.cp_companies.find((function(e){return e.label===t}))})),4===this.plat_cp_companies.length&&(this.plat_cp_companies=[{value:"",label:"所有平台公司"}].concat(Object(s.a)(this.plat_cp_companies))),this.companyNo=this.plat_cp_companies[0].value,this.daytime=this.transformTime(),this.requestData())},methods:{calcAmountRealRate:function(t){var e=this.calcAmount("msale_total",t);t=this.calcAmount("gross_completion",t);return Number(it(Number(rt(t,e)).toFixed(2),100)).toFixed(2)+"%"},calcAmountGrossCompletionRate:function(t){if("otherSupplier"===t)return"-%";var e=this.calcAmount("gross_completion",t);t=this.calcAmount("cost_tips",t);return Number(it(Number(rt(e,t)).toFixed(2),100)).toFixed(2)+"%"},calcAmountCompletionRate:function(t){if("otherSupplier"===t)return"-%";var e=this.calcAmount("msale_total",t);t=this.calcAmount("total_tips",t);return Number(it(Number(rt(e,t)).toFixed(2),100)).toFixed(2)+"%"},calcAmount:function(t,e){var n=[];if("compoeseSupplier"===e){if(n=this.tableData.find((function(t){return"普润"===t.companyName})).children,"total_tips"===t||"cost_tips"===t)return n[0][t]}else{if("total_tips"===t||"cost_tips"===t)return"-";n=this.otherCompanise}return n.reduce((function(e,n){return e=Number(ot(e,isNaN(n[t])?0:n[t])),0===e?0:e.toFixed(2)}),0)},isAmountProp:function(t){return"普润"===t||"其他"===t},load:function(t,e,n){var a=this.tableData.find((function(t){return"compoeseSupplier"===t.companyNo}));n(a?a.children:[])},unit2TenThousand:lt,getCurrentRateStyle:function(t){var e=at()(this.daytime).daysInMonth(),n=(e=Number(rt(100,e)).toFixed(2),at()(this.daytime).date());n=Number(it(n,e)).toFixed(2);return Number(n)>Number(t)?"color:red":""},getCurrentValueStyle:function(t,e){var n=at()(this.daytime).daysInMonth();e=Number(rt(e,n)).toFixed(2),n=at()(this.daytime).date(),n=Number(it(n,e)).toFixed(2);return Number(n)>Number(t)?"color: red":""},setCellClassName:function(t){var e=t.column,n=(t=t.row,e=e.label,"");return"北京万宇恒通国际科贸有限公司"===t.companyName&&(n+="font-bold "),"营收目标"===e?n+"bg__success":-1===e.indexOf("营业")&&-1===e.indexOf("营收")||"当日营业收入"===e?"毛利目标"===e?n+"bg__primary":-1!==e.indexOf("毛利")?n+"bg__primary_1":-1!==e.indexOf("成本")?n+"bg__warning_1":n:n+"bg__success_1"},setHeaderClassName:function(t){return t=t.column.label,"营收目标"===t?"bg__success":-1===t.indexOf("营业")&&-1===t.indexOf("营收")||"当日营业收入"===t?"毛利目标"===t?"bg__primary":-1!==t.indexOf("毛利")?"bg__primary_1":-1!==t.indexOf("成本")?"bg__warning_1":void 0:"bg__success_1"},transformTime:function(){var t=new Date,e=t.getFullYear(),n=t.getMonth()+1;t=t.getDate();return e+"-"+(n<10?"0"+n:n)+"-"+(t<10?"0"+t:t)},requestData:(ia=Object(c.a)(regeneratorRuntime.mark((function t(){var e,n,a=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.loading=!0,this.tableData=[],t.next=4,pe.supplier({daytime:this.daytime});case 4:n=t.sent,e=[],1===n.code&&n.data&&0<n.data.length?(n.data.forEach((function(t){var n=t.supplierName,a=t.supplierNo,o=t.total_tips,r=t.monthinfo,i=t.cost_tips,l=t.dayinfo,c=(t=t.is_sup,{1:"自营"}),u=Object.keys(c),p=0,d=0,m=0,h=0,f=(u=u.map((function(t){var e=(Array.isArray(r)?r:[r])[0];Array.isArray(l);var n,a=(a=l[0])||{sale_total:"0.00",th_total:"0.00",type:"1",cgd_total:"0.00",cgd_th_total:"0.00"},o=("msale_th_total"in(e=e||{mcgd_th_total:"0.00",mcgd_total:"0.00",msale_total:"0.00",mth_total:"0.00",type:t})&&(e.mth_total=e.msale_th_total),n=st(e.msale_total,e.mth_total)||0,st(a.sale_total,a.th_total)||0),i=st(a.cgd_total,a.cgd_th_total)||0;e=st(e.mcgd_total,e.mcgd_th_total)||0;return p=Number(ot(p,o)).toFixed(2),d=Number(ot(d,n)).toFixed(2),m=Number(ot(m,i)).toFixed(2),h=Number(ot(h,e)).toFixed(2),{type:c[t],dayinfo:ra(ra({},a),{},{sale_total:o}),monthinfo:ra(ra({},r),{},{msale_total:n,mcost_total:e})}})),Number(st(d,h)).toFixed(2));e=[].concat(Object(s.a)(e),[{is_sup:t,companyNo:a,companyName:n,cost_tips:i,total_tips:o,info:u[0],sale_total:p,cost_total:m,msale_total:d,mcost_total:h,gross_completion:f,completion_rate:"-"===o?"-":it(rt(d,o),100).toFixed(2),gross_completion_rate:"-"===i?"-":0===Number(i)?0:it(rt(f,i)||0,100).toFixed(2),gross_sale_completion_rate:Number(it(rt(f,d)||0,100)).toFixed(2)}])})),n=e.filter((function(t){return t=t.companyNo,a.composeCompanies.includes(t)})),this.otherCompanise=e.filter((function(t){return 1===t.is_sup})),e=e.filter((function(t){return t=t.companyNo,!a.composeCompanies.includes(t)&&a.notOtherCompanise.includes(t)})),e=[ra(ra({},Kn),{},{companyName:"普润",companyNo:"compoeseSupplier",hasChildren:!0,children:n})].concat(Object(s.a)(e),[ra(ra({},Kn),{},{companyNo:"otherSupplier",companyName:"其他"})]),this.tableData=e):this.tableData=[],this.loading=!1;case 8:case"end":return t.stop()}}),t,this)}))),function(){return ia.apply(this,arguments)})}},n("b945"),xt=Object(o.a)(Mt,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}]},[n("div",{staticClass:"search clear",staticStyle:{"align-items":"center"}},[n("span",{staticStyle:{"font-size":"15px"}},[t._v("结算单E企购-月度完成情况")]),n("div",{staticStyle:{float:"right"}},[n("el-date-picker",{staticClass:"fr picker no-padding",staticStyle:{width:"95px"},attrs:{"value-format":"yyyy-MM-dd",editable:!1,disabled:t.isEmpty,clearable:!1,size:"small",format:"yyyy-MM-dd",type:"date",align:"right",placeholder:"选择日期","picker-options":{disabledDate:function(t){return t.getTime()>Date.now()}}},on:{change:t.requestData},model:{value:t.daytime,callback:function(e){t.daytime=e},expression:"daytime"}})],1)]),t.isEmpty?[n("div",{staticStyle:{"text-align":"center","line-height":"60px","user-select":"none"}},[t._v("当前账号没有访问权限")])]:n("el-row",{staticStyle:{"margin-top":"10px"}},[n("el-table",{attrs:{border:"",size:"mini",data:t.tableData,"header-cell-class-name":t.setHeaderClassName,"cell-class-name":t.setCellClassName,"row-key":"companyNo",load:t.load,lazy:""}},[n("el-table-column",{attrs:{fixed:"left",label:"公司",prop:"companyName",align:"center",width:"120px"},scopedSlots:t._u([{key:"default",fn:function(e){return[-1===e.row.companyName.indexOf("合计-")?n("span",[t._v("\n "+t._s(t.mapCompany2[e.row.companyName]||e.row.companyName)+"\n ")]):n("span",[t._v("\n 元隆雅图\n ")])]}}],null,!1,3172232701)}),n("el-table-column",{attrs:{label:"当日营业收入",align:"center",width:"95px"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.isAmountProp(e.row.companyName)?t.unit2TenThousand(t.calcAmount("sale_total",e.row.companyNo),t.isTenThound):t.unit2TenThousand(e.row.sale_total,t.isTenThound))+"\n ")]}}],null,!1,3591617944)}),n("el-table-column",{attrs:{label:"营收目标",align:"center","min-width":"95px"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.isAmountProp(e.row.companyName)?t.unit2TenThousand(t.calcAmount("total_tips",e.row.companyNo),t.isTenThound):t.unit2TenThousand(e.row.total_tips,t.isTenThound))+"\n ")]}}],null,!1,25679736)}),n("el-table-column",{attrs:{label:"营业收入(净)",align:"center","min-width":"115px"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("div",{staticStyle:{display:"flex","justify-content":"center"},style:""+(t.isAmountProp(e.row.companyName)?"":t.getCurrentValueStyle(e.row.msale_total,e.row.total_tips))},[t._v("\n "+t._s(t.isAmountProp(e.row.companyName)?t.unit2TenThousand(t.calcAmount("msale_total",e.row.companyNo),t.isTenThound):t.unit2TenThousand(e.row.msale_total,t.isTenThound))+"\n ")])]}}],null,!1,482359302)}),n("el-table-column",{attrs:{label:"营收完成%",align:"center","min-width":"85px"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("div",{style:""+(t.isAmountProp(e.row.companyName)?"":t.getCurrentRateStyle(e.row.completion_rate))},[t._v("\n "+t._s(t.isAmountProp(e.row.companyName)?t.calcAmountCompletionRate(e.row.companyNo):("NaN"===String(e.row.completion_rate)?0:e.row.completion_rate)+"%")+"\n ")])]}}],null,!1,2583386453)}),t.costField?[n("el-table-column",{attrs:{label:"毛利目标",align:"center","min-width":"90px"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.costField?t.isAmountProp(e.row.companyName)?t.unit2TenThousand(t.calcAmount("cost_tips",e.row.companyNo),t.isTenThound):t.unit2TenThousand(e.row.cost_tips,t.isTenThound):"***")+"\n ")]}}],null,!1,1622815230)}),n("el-table-column",{attrs:{label:"毛利完成",align:"center","min-width":"90px"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("div",{style:""+(t.isAmountProp(e.row.companyName)?"":t.getCurrentValueStyle(e.row.gross_completion,e.row.cost_tips))},[t._v("\n "+t._s(t.costField?t.isAmountProp(e.row.companyName)?t.unit2TenThousand(t.calcAmount("gross_completion",e.row.companyNo),t.isTenThound):t.unit2TenThousand(e.row.gross_completion,t.isTenThound):"***")+"\n ")])]}}],null,!1,926456604)})]:t._e(),n("el-table-column",{attrs:{label:"毛利完成%",align:"center","min-width":"85px"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("div",{style:t.isAmountProp(e.row.companyName)?"":t.getCurrentRateStyle(e.row.gross_completion_rate)},[t._v("\n "+t._s(t.isAmountProp(e.row.companyName)?t.calcAmountGrossCompletionRate(e.row.companyNo):e.row.gross_completion_rate+"%")+"\n ")])]}}],null,!1,1499731272)}),t.costField?[n("el-table-column",{attrs:{label:"成本合计",align:"center","min-width":"125px"},scopedSlots:t._u([{key:"default",fn:function(e){return[t.costField?n("div",{staticStyle:{display:"flex","justify-content":"center"}},[t._v("\n "+t._s(t.isAmountProp(e.row.companyName)?t.unit2TenThousand(t.calcAmount("mcost_total",e.row.companyNo),t.isTenThound):t.unit2TenThousand(e.row.mcost_total,t.isTenThound))+"\n ")]):n("p",[t._v("***")])]}}],null,!1,4047076869)}),n("el-table-column",{attrs:{label:"实际毛利率",align:"center",width:"85px"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.costField?t.isAmountProp(e.row.companyName)?t.calcAmountRealRate(e.row.companyNo):t.unit2TenThousand(e.row.gross_sale_completion_rate)+"%":"***")+"\n ")]}}],null,!1,3193788296)})]:t._e()],2)],1)],2)}),[],!1,null,"3948d830",null).exports;function sa(t,e){var n,a=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,n)),a}function la(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?sa(Object(n),!0).forEach((function(e){Object(l.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):sa(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var ca;Ft={mixins:[e],props:["companies","costField","isTenThound"],data:function(){return{list:[],daytime:"",companyNo:"",loading:!1,isEmpty:!1,cp_companies:[]}},computed:{currentCompanyName:function(){var t=this;return this.companies.find((function(e){return e.value===t.companyNo})).label}},mounted:function(){var t,e,n=this;this.isEmpty=0===this.companies.length,this.isEmpty||(this.cp_companies=this.companies.map((function(t){return la(la({},t),{},{label:"万宇"===Bn[t.label]?"平台公司: 万宇":"泰文创"===Bn[t.label]?"平台公司: 泰文创":"预订单E企购"===Bn[t.label]?"预订单E企购":"结算单E企购"===Bn[t.label]?"结算单E企购":"业务公司: ".concat(Bn[t.label])})})),e=["平台公司: 万宇","业务公司: 百辰","业务公司: 泓源","业务公司: 普润","业务公司: 锦兴","业务公司: 知事","平台公司: 泰文创","预订单E企购","结算单E企购"],t=this.cp_companies.map((function(t){return t.label})),e=e.filter((function(e){return t.includes(e)})),this.cp_companies=e.map((function(t){return n.cp_companies.find((function(e){return e.label===t}))})),this.hasCompose()&&this.cp_companies.unshift({value:"",label:"万宇 + 预算单E企购"}),this.companyNo=this.cp_companies[0].value,this.daytime=this.transformTime(),this.requestData())},watch:{daytime:{handler:function(){this.requestData()}}},methods:{addition:ot,subtraction:st,unit2TenThousand:lt,hasCompose:function(){var t=this.cp_companies.findIndex((function(t){return"GS2203161855277894"===t.value})),e=this.cp_companies.findIndex((function(t){return"GS2404151642335170"===t.value}));return-1!==t&&-1!==e},setCellClassName:function(t){var e=t.column,n=(t=t.row,e=e.label,"");return-1!==t.depart.indexOf("泰文创")&&(n+="font-bold "),"当月营收目标"===e?n+"bg__success":-1===e.indexOf("营业")&&-1===e.indexOf("营收")||"当日营业收入"===e?"毛利目标"===e?n+"bg__primary":-1!==e.indexOf("毛利")?n+"bg__primary_1":-1!==e.indexOf("成本")?n+"bg__warning_1":n:n+"bg__success_1"},setHeaderClassName:function(t){return t=t.column.label,"当月营收目标"===t?"bg__success":-1===t.indexOf("营业")&&-1===t.indexOf("营收")||"当日营业收入"===t?"毛利目标"===t?"bg__primary":-1!==t.indexOf("毛利")?"bg__primary_1":-1!==t.indexOf("成本")?"bg__warning_1":void 0:"bg__success_1"},getCurrentRateStyle:function(t){var e=at()(this.daytime).daysInMonth(),n=(e=Number(rt(100,e)).toFixed(2),at()(this.daytime).date());n=Number(it(n,e)).toFixed(2);return Number(n)>Number(t)?"color:red":""},getCurrentValueStyle:function(t,e){var n=at()(this.daytime).daysInMonth();e=Number(rt(e,n)).toFixed(2),n=at()(this.daytime).date(),n=Number(it(n,e)).toFixed(2);return Number(n)>Number(t)?"color: red":""},transformTime:function(){var t=new Date,e=t.getFullYear(),n=t.getMonth()+1;t=t.getDate();return e+"-"+(n<10?"0"+n:n)+"-"+(t<10?"0"+t:t)},spanMethod:function(t){var e=t.rowIndex;if(0===t.columnIndex)return{rowspan:t=this.flitterData(this.list).one[e],colspan:0<t?1:0}},flitterData:function(t){var e=[],n=0;return t.forEach((function(a,o){0===o?e.push(1):a.company===t[o-1].company?(e[n]+=1,e.push(0)):(e.push(1),n=o)})),{one:e}},requestData:(ca=Object(c.a)(regeneratorRuntime.mark((function t(){var e,n,a,o,r,i,s,c,u,p=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.loading=!0,this.list=[],e={},""===this.companyNo)return t.next=6,pe.departmentEveryDay({daytime:this.daytime,companyNo:"GS2203161855277894"});t.next=17;break;case 6:return e=t.sent,t.next=9,pe.departmentEveryDay({daytime:this.daytime,companyNo:"GS2404151642335170"});case 9:c=t.sent,n=e.data,a=c.data,o=[],n.forEach((function(t){var e=a.find((function(e){return e.depart===t.depart})),n=Object.keys(t).reduce((function(n,a){return la(la({},n),{},Object(l.a)({},a,"depart"===a?t.depart:"total_tips"===a?t.total_tips:Number(ot(t[a],e[a])).toFixed(2)))}),{});o.push(n)})),e.data=o,t.next=20;break;case 17:return t.next=19,pe.departmentEveryDay({daytime:this.daytime,companyNo:this.companyNo});case 19:e=t.sent;case 20:0===e.code&&e.data&&0<e.data.length?(r=(r=(e.data||[]).map((function(t){var e=t.depart,n=t.msale_total,a=t.mth_total,o=t.sale_total,r=t.th_total,i=t.total_tips,s=t.mzy_sale_total,l=t.mchannel_sale_total,c=t.channel_cost_total,u=t.zy_cost_total,p=t.mzy_cost_total;return{depart:e,total_tips:i,mzy_sale_total:s,mchannel_sale_total:l,channel_cost_total:c,zy_cost_total:u,mchannel_cost_total:t.mchannel_cost_total,mzy_cost_total:p,post_fee:t.mpost_fee,dayinfo:{sale_total:o,th_total:r},monthinfo:{msale_total:n,mth_total:a}}}))).filter((function(t){return 0!==Number(t.monthinfo.msale_total)||0!==Number(t.post_fee)})),this.total=r.reduce((function(t,e){var n=e.total_tips,a=e.day;a=void 0===a?0:a,e=e.month,e=void 0===e?0:e;return{total_tips:ot(void 0===n?0:n,t.total_tips),month:ot(e,t.month),day:ot(a,t.day)}}),{total_tips:0,month:0,day:0}),r=r.map((function(t){return t.depart})).map((function(t){return r.find((function(e){return e.depart===t}))})),i={"百辰":"客服部@百辰","泓源":"网络部@泓源","普润":"\t项目部@普润","平台":"\t平台部@泰文创"},s=this.companies.find((function(t){return t.value===p.companyNo})),this.list=r.map((function(t){var e=t.depart,n=t.total_tips,a=t.dayinfo,o=t.monthinfo,r=t.mchannel_sale_total,l=t.mzy_sale_total,c=t.mchannel_cost_total,u=t.post_fee,d=(t=t.mzy_cost_total,st(o.msale_total,o.mth_total)),m=it(rt(d,n),100).toFixed(2);return{total_tips:n,zy_cost:t,qd_cost:c,post_fee:u,depart:i[e],company:s?s.label:"--",currentMonthPure:[{zy:l,qd:r}],zy_gross:Number(st(l,t)).toFixed(2),qd_gross:Number(st(r,c)).toFixed(2),dayinfo:la(la({},a),{},{sale_total:st(a.sale_total,a.th_total)}),proportion:it(rt(o.msale_total,p.total.month)||0,100)||0,monthinfo:{monthNetSales:d,monthProportion:m}}})),c=["百辰","泓源","普润","泰文创"],u=this.list.map((function(t){return t.depart})),c=c.filter((function(t){return-1!==u.findIndex((function(e){return e.indexOf(t)}))})),this.list=c.map((function(t){return p.list.find((function(e){return-1!==e.depart.indexOf(t)}))}))):this.list=[],this.getHeight(),this.loading=!1;case 23:case"end":return t.stop()}}),t,this)}))),function(){return ca.apply(this,arguments)})}},n("ae8d"),Yt=Object(o.a)(Ft,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}]},[n("div",{staticClass:"search clear"},[n("div",{staticStyle:{float:"left","line-height":"30px",display:"flex","align-items":"center"}},[n("el-popover",{attrs:{placement:"top",width:"200",trigger:"hover",content:"不含业务公司供应商端数据"},scopedSlots:t._u([{key:"reference",fn:function(){return[n("i",{staticClass:"el-icon-warning-outline",staticStyle:{"font-size":"16px",cursor:"pointer","padding-top":"5px","padding-right":"5px",display:"inline-block"}})]},proxy:!0}])}),n("span",{staticStyle:{"font-size":"15px"}},[t._v("部门完成情况")])],1),n("div",{staticStyle:{float:"right"}},[n("el-select",{staticStyle:{"margin-right":"10px",width:"165px"},attrs:{size:"small",disabled:t.isEmpty},on:{change:t.requestData},model:{value:t.companyNo,callback:function(e){t.companyNo=e},expression:"companyNo"}},t._l(t.cp_companies,(function(t){return n("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1),n("el-date-picker",{staticClass:"fr picker no-padding",staticStyle:{width:"100px"},attrs:{disabled:t.isEmpty,"picker-options":{disbaledData:function(t){return t.getTime()>Date.now()}},"value-format":"yyyy-MM-dd",format:"yyyy-MM-dd",editable:!1,clearable:!1,placeholder:"选择日期",size:"small",align:"right",type:"date"},model:{value:t.daytime,callback:function(e){t.daytime=e},expression:"daytime"}})],1)]),t.isEmpty?[n("div",{staticStyle:{"text-align":"center","line-height":"60px","user-select":"none"}},[t._v("当前账号没有访问权限")])]:n("el-row",{staticStyle:{"margin-top":"10px",display:"flex",width:"100%"}},[n("el-table",{attrs:{border:"",size:"mini",data:t.list,"header-cell-class-name":t.setHeaderClassName,"cell-class-name":t.setCellClassName}},[n("el-table-column",{attrs:{fixed:"left",label:"部门",prop:"depart",align:"center",width:"60px"},scopedSlots:t._u([{key:"default",fn:function(e){return t._l(e.row.depart.split("@"),(function(e,a){return n("p",{key:a,staticStyle:{margin:"0px"}},[t._v(t._s(e))])}))}}],null,!1,3338273039)}),n("el-table-column",{attrs:{label:"当日营业收入",align:"center","min-width":"105px"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t.unit2TenThousand(e.row.dayinfo.sale_total,t.isTenThound)))]}}],null,!1,2984776438)}),n("el-table-column",{attrs:{label:"当月营收目标",align:"center","min-width":"115px"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(t.unit2TenThousand(e.row.total_tips,t.isTenThound)))]}}],null,!1,1001740975)}),n("el-table-column",{attrs:{label:"当月营业收入(净)",align:"center","min-width":"120px"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("div",{staticStyle:{display:"flex","flex-direction":"column"}},[n("div",{staticStyle:{display:"flex","justify-content":"center","align-items":"center"},style:"text-align: center;"+t.getCurrentValueStyle(e.row.monthinfo.monthNetSales,e.row.total_tips)},[t._v("\n "+t._s(t.unit2TenThousand(e.row.monthinfo.monthNetSales,t.isTenThound))+"\n "),n("el-popover",{attrs:{placement:"right",width:200,trigger:"click"},scopedSlots:t._u([{key:"reference",fn:function(){return[n("p",{style:"text-align: center;"+t.getCurrentValueStyle(e.row.monthinfo.monthNetSales,e.row.total_tips)},[n("i",{staticClass:"el-icon-warning-outline trigger-hover",staticStyle:{"font-size":"16px",cursor:"pointer","margin-left":"5px"}})])]},proxy:!0}],null,!0)},[n("div",{staticClass:"table-size"},[n("p",[t._v("直营/自营: "+t._s(t.unit2TenThousand(e.row.currentMonthPure[0].zy,t.isTenThound)))]),n("p",[t._v("支付渠道: "+t._s(t.unit2TenThousand(e.row.currentMonthPure[0].qd,t.isTenThound)))])])])],1)])]}}],null,!1,3272773755)}),t.costField?[n("el-table-column",{attrs:{label:"当月成本",align:"center","min-width":"120px"},scopedSlots:t._u([{key:"default",fn:function(e){return[t.costField?n("div",{staticStyle:{display:"flex","justify-content":"center","align-items":"center"}},[t._v("\n "+t._s(t.unit2TenThousand(Number(t.addition(Number(t.addition(e.row.zy_cost,e.row.qd_cost)).toFixed(2),e.row.post_fee)).toFixed(2),t.isTenThound))+"\n "),n("el-popover",{attrs:{placement:"right",width:200,trigger:"click"},scopedSlots:t._u([{key:"reference",fn:function(){return[n("p",{staticStyle:{"text-align":"center"}},[n("i",{staticClass:"el-icon-warning-outline trigger-hover",staticStyle:{"font-size":"16px",cursor:"pointer","margin-left":"5px"}})])]},proxy:!0}],null,!0)},[n("div",{staticClass:"table-size"},[n("p",[t._v("直营/自营: "+t._s(t.unit2TenThousand(e.row.zy_cost,t.isTenThound)))]),n("p",[t._v("渠道: "+t._s(t.unit2TenThousand(e.row.qd_cost,t.isTenThound)))]),n("p",[t._v("物流费用: "+t._s(t.unit2TenThousand(e.row.post_fee,t.isTenThound)))])])])],1):n("p",[t._v("***")])]}}],null,!1,2419603932)}),n("el-table-column",{attrs:{align:"center",label:"当月毛利","min-width":"120px"},scopedSlots:t._u([{key:"default",fn:function(e){return[t.costField?n("div",{staticStyle:{display:"flex","justify-content":"center","align-items":"center"}},[t._v("\n "+t._s(t.unit2TenThousand(Number(t.subtraction(Number(t.addition(e.row.zy_gross,e.row.qd_gross)).toFixed(2),e.row.post_fee)).toFixed(2),t.isTenThound))+"\n "),n("el-popover",{attrs:{placement:"right",width:200,trigger:"click"},scopedSlots:t._u([{key:"reference",fn:function(){return[n("p",{staticStyle:{"text-align":"center"}},[n("i",{staticClass:"el-icon-warning-outline trigger-hover",staticStyle:{"font-size":"16px",cursor:"pointer","margin-left":"5px"}})])]},proxy:!0}],null,!0)},[n("div",{staticClass:"table-size"},[n("p",[t._v("直营/自营: "+t._s(t.unit2TenThousand(e.row.zy_gross,t.isTenThound)))]),n("p",[t._v("支付渠道: "+t._s(t.unit2TenThousand(e.row.qd_gross,t.isTenThound)))])])])],1):n("p",[t._v("***")])]}}],null,!1,280266069)})]:t._e()],2)],1)],2)}),[],!1,null,"1a2de156",null).exports;function ua(t,e){var n,a=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,n)),a}function pa(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ua(Object(n),!0).forEach((function(e){Object(l.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ua(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var da;At={props:["companies","costField","isTenThound"],data:function(){return{loading:!1,daytime:"",tableData:[],companyNo:"",cp_companies:[],isEmpty:!1}},mounted:function(){var t,e=this,n=!1,a=this.companies.findIndex((function(t){return"北京锦兴弘昌科技有限公司"===t.label})),o=this.companies.findIndex((function(t){return"北京普润心堂商贸有限公司"===t.label})),r=this.companies.findIndex((function(t){return"北京知事文化产业发展有限公司"===t.label}));-1===a&&-1===o&&-1===r||(n=!0),this.cp_companies=this.companies.filter((function(t){return"北京锦兴弘昌科技有限公司"!==t.label&&"北京普润心堂商贸有限公司"!==t.label&&"北京知事文化产业发展有限公司"!==t.label})),n&&(this.cp_companies=[].concat(Object(s.a)(this.cp_companies),[{value:"GS2401181650538135",label:"普润&锦兴&知事"}])),this.isEmpty=0===this.cp_companies.length,this.isEmpty||(this.cp_companies=this.cp_companies.map((function(t,e){var n="";return"所有公司"===t.label&&(n="所有公司"),"北京万宇恒通国际科贸有限公司"===t.label&&(n="平台公司: 万宇"),"北京泰文创供应链管理有限公司"===t.label&&(n="平台公司: 泰文创"),"北京元隆雅图文化传播股份有限公司"===t.label&&(n="预订单E企购"),"结算单E企购"===t.label&&(n="结算单E企购"),""===(n="普润&锦兴&知事"===t.label?"业务公司: 普润&锦兴&知事":n)&&(n="业务公司: ".concat(Bn[t.label])),pa(pa({},t),{},{label:n})})),a=["所有公司","平台公司: 万宇","业务公司: 百辰","业务公司: 泓源","业务公司: 普润&锦兴&知事","平台公司: 泰文创","预订单E企购","结算单E企购"],t=this.cp_companies.map((function(t){return t.label})),a=a.filter((function(e){return t.includes(e)})),this.cp_companies=a.map((function(t){return e.cp_companies.find((function(e){return e.label===t}))})),this.companyNo=this.cp_companies[0].value,this.daytime=this.transformTime(),this.requestData())},methods:{unit2TenThousand:lt,setRowClassName:function(t){return t=t.row,"合计"===t.month?"table-header-color":"当前合计"===t.month?"font-bold":void 0},getCurrentRateStyle:function(t,e){var n=at()().daysInMonth(),a=at()().month()+1;if(!(Number(e)>Number(a))&&"合计"!==e)return a=Number(rt(100,n)).toFixed(2),e=at()().date(),n=Number(it(e,a)).toFixed(2),Number(n)>Number(t)?"color:red":""},getCurrentValueStyle:function(t,e,n){var a=at()().daysInMonth(),o=at()().month()+1;if(!(Number(n)>Number(o))&&"合计"!==n)return o=Number(rt(e,a)).toFixed(2),n=at()().date(),e=Number(it(n,o)).toFixed(2),Number(e)>Number(t)?"color: red":""},setCellClassName:function(t){var e=t.column;if("合计"!==t.row.month)return t=e.label,"营收目标"===t?"bg__success":-1!==t.indexOf("营业")||-1!==t.indexOf("营收")?"bg__success_1":"毛利目标"===t?"bg__primary":-1!==t.indexOf("毛利")?"bg__primary_1":-1!==t.indexOf("成本")?"bg__warning_1":void 0},setHeaderClassName:function(t){return t=t.column.label,"营收目标"===t?"bg__success":-1!==t.indexOf("营业")||-1!==t.indexOf("营收")?"bg__success_1":"毛利目标"===t?"bg__primary":-1!==t.indexOf("毛利")?"bg__primary_1":-1!==t.indexOf("成本")?"bg__warning_1":void 0},transformTime:function(){var t=new Date,e=t.getFullYear(),n=t.getMonth()+1;t=t.getDate();return e+"-"+(n<10?"0"+n:n)+"-"+(t<10?"0"+t:t)},requestData:(da=Object(c.a)(regeneratorRuntime.mark((function t(){var e,n,a,o=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.loading=!0,t.next=3,pe.companyEvery({year:this.daytime.split("-")[0],companyNo:this.companyNo});case 3:e=t.sent,t.t0=Number(e.code),t.next=0===t.t0?7:16;break;case 7:return this.tableData=(e.data||[]).map((function(t){var e=st(t.sale_total,t.th_total),n=it(rt(e,t.total_tips),100),a=st(t.cgd_total,t.cgd_th_total),o=st(e,a);return{pure_sale:e,pure_purch:a,pure_profit:o,completion_rate:n,pure_interest_rate:it(rt(o,e)||0,100),month:t.month,cost_tips:t.cost_tips,total_tips:t.total_tips,cost_rate:0===Number(t.cost_tips)?0:it(rt(o,t.cost_tips)||0,100).toFixed(2)}})),(n=new Array(Number(at()().format("M"))).fill(0).reduce((function(t,e,n){return{pure_sale:Number(ot(t.pure_sale,o.tableData[n].pure_sale)).toFixed(2),pure_purch:Number(ot(t.pure_purch,o.tableData[n].pure_purch)).toFixed(2),pure_profit:Number(ot(t.pure_profit,o.tableData[n].pure_profit)).toFixed(2),completion_rate:Number(ot(t.completion_rate,o.tableData[n].completion_rate)).toFixed(2),pure_interest_rate:Number(ot(t.pure_interest_rate,o.tableData[n].pure_interest_rate)).toFixed(2),total_tips:Number(ot(t.total_tips,o.tableData[n].total_tips)).toFixed(2),cost_tips:Number(ot(t.cost_tips,o.tableData[n].cost_tips)).toFixed(2),cost_rate:Number(ot(t.cost_rate,o.tableData[n].cost_rate)).toFixed(2),month:"当前合计"}}),{pure_sale:0,pure_purch:0,pure_profit:0,completion_rate:0,pure_interest_rate:0,month:"当前合计",cost_tips:0,total_tips:0,cost_rate:0})).completion_rate=it(rt(n.pure_sale,n.total_tips)||0,100),n.cost_rate=0===Number(n.cost_tips)?0:it(rt(n.pure_profit,n.cost_tips)||0,100).toFixed(2),(a=this.tableData.reduce((function(t,e){return{pure_sale:Number(ot(t.pure_sale,e.pure_sale)).toFixed(2),pure_purch:Number(ot(t.pure_purch,e.pure_purch)).toFixed(2),pure_profit:Number(ot(t.pure_profit,e.pure_profit)).toFixed(2),completion_rate:Number(ot(t.completion_rate,e.completion_rate)).toFixed(2),pure_interest_rate:Number(ot(t.pure_interest_rate,e.pure_interest_rate)).toFixed(2),total_tips:Number(ot(t.total_tips,e.total_tips)).toFixed(2),cost_tips:Number(ot(t.cost_tips,e.cost_tips)).toFixed(2),cost_rate:Number(ot(t.cost_rate,e.cost_rate)).toFixed(2),month:"合计"}}),{pure_sale:0,pure_purch:0,pure_profit:0,completion_rate:0,pure_interest_rate:0,month:"合计",cost_tips:0,total_tips:0,cost_rate:0})).completion_rate=it(rt(a.pure_sale,a.total_tips)||0,100),a.cost_rate=0===Number(a.cost_tips)?0:it(rt(a.pure_profit,a.cost_tips)||0,100).toFixed(2),this.tableData=[n].concat(Object(s.a)(this.tableData),[a]),t.abrupt("break",17);case 16:return t.abrupt("break",17);case 17:this.loading=!1;case 18:case"end":return t.stop()}}),t,this)}))),function(){return da.apply(this,arguments)})}};function ma(t,e){var n,a=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,n)),a}n("c86b");Zt={name:"newReportsInfo",components:{UnusualState:S,ResultCompany:re,ResultSupplier:xt,ResultCompanyBu:rn,PeriodDatePicker:Et,ResultDepartment:Yt,ResultCompanyMonth:Object(o.a)(At,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}]},[n("div",{staticClass:"search",staticStyle:{"align-items":"center"}},[n("div",{staticStyle:{float:"left","font-size":"15px","line-height":"30px"}},[t._v("\n 年度完成情况\n ")]),n("div",{staticStyle:{float:"right"}},[n("el-select",{staticStyle:{"margin-right":"10px",width:"160px"},attrs:{size:"small",disabled:t.isEmpty},on:{change:t.requestData},model:{value:t.companyNo,callback:function(e){t.companyNo=e},expression:"companyNo"}},t._l(t.cp_companies,(function(t){return n("el-option",{key:t.id,attrs:{value:t.value,label:t.label}})})),1),n("el-date-picker",{staticClass:"fr picker no-padding",staticStyle:{width:"65px"},attrs:{"value-format":"yyyy",editable:!1,disabled:t.isEmpty,clearable:!1,size:"small",type:"year",format:"yyyy",align:"right",placeholder:"选择日期","picker-options":{disabledDate:function(t){return t.getTime()>Date.now()}}},on:{change:t.requestData},model:{value:t.daytime,callback:function(e){t.daytime=e},expression:"daytime"}})],1)]),t.isEmpty?[n("div",{staticStyle:{"text-align":"center","line-height":"60px","user-select":"none"}},[t._v("当前账号没有访问权限")])]:n("el-row",{staticStyle:{"margin-top":"10px"}},[n("el-table",{attrs:{border:"",size:"mini",data:t.tableData,"header-cell-class-name":t.setHeaderClassName,"row-class-name":t.setRowClassName,"cell-class-name":t.setCellClassName}},[n("el-table-column",{attrs:{fixed:"left",label:"月度",prop:"month",align:"center",width:"70px"}}),n("el-table-column",{attrs:{label:"营收目标",align:"center","min-width":"115px"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.unit2TenThousand(e.row.total_tips,t.isTenThound))+"\n ")]}}],null,!1,2687046287)}),n("el-table-column",{attrs:{label:"营业收入(净)",align:"center","min-width":"115px"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("div",{style:t.getCurrentValueStyle(e.row.pure_sale,e.row.total_tips,e.row.month)},[t._v("\n "+t._s(t.unit2TenThousand(e.row.pure_sale,t.isTenThound))+"\n ")])]}}],null,!1,4055359095)}),n("el-table-column",{attrs:{label:"营收完成%",align:"center","min-width":"95px"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("div",{style:t.getCurrentRateStyle(e.row.completion_rate,e.row.month)},[t._v("\n "+t._s(Number(e.row.completion_rate).toFixed(2)+"%")+"\n ")])]}}],null,!1,258527676)}),t.costField?[n("el-table-column",{attrs:{label:"毛利目标",align:"center","min-width":"115px"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.costField?t.unit2TenThousand(e.row.cost_tips,t.isTenThound):"***")+"\n ")]}}],null,!1,3339256288)}),n("el-table-column",{attrs:{label:"毛利完成",align:"center","min-width":"115px"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("div",{style:t.getCurrentValueStyle(e.row.pure_profit,e.row.cost_tips,e.row.month)},[t._v("\n "+t._s(t.costField?t.unit2TenThousand(e.row.pure_profit,t.isTenThound):"***")+"\n ")])]}}],null,!1,2649462680)})]:t._e(),n("el-table-column",{attrs:{label:"毛利完成%",align:"center","min-width":"95px"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("div",{style:t.getCurrentRateStyle(e.row.cost_rate,e.row.month)},[t._v("\n "+t._s(Number(e.row.cost_rate).toFixed(2)+"%")+"\n ")])]}}],null,!1,2798921564)})],2),n("div",{staticStyle:{height:"100px"}})],1)],2)}),[],!1,null,"1266316c",null).exports},data:function(){return{state:{message:"",error:!1,loading:!1},hasPermission:!1,isTenThound:!1,isDisplay:!1,costField:!1,companies:[],daytime:"",zxTotal:0}},mounted:function(){O("code")?this.requestUserinfo():this.login()},methods:{time:(fa=Object(c.a)(regeneratorRuntime.mark((function t(e){var n,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.startTime,a=e.endTime,this.start=n||"",this.end=a||"",n=this.start,a=this.end,""!==n&&""===a||""===n&&""!==a)return this.$message.warning("时间区间不完整!"),this.date=[],t.abrupt("return");t.next=8;break;case 8:this.start&&this.end?this.date=[this.start+" 00:00:00",this.end+" 23:59:59"]:this.date=[this.start,this.end];case 9:case"end":return t.stop()}}),t,this)}))),function(t){return fa.apply(this,arguments)}),requestUserinfo:(ha=Object(c.a)(regeneratorRuntime.mark((function t(){var e,n,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.state.loading=!0,e=T(),a=O("code"),t.next=5,v(function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ma(Object(n),!0).forEach((function(e){Object(l.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ma(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},e?{openid:e}:{code:a}));case 5:n=t.sent,a=["oOpc26KiZFBKIm7SB8knFGvov1qg","oOpc26KDBFTU71t-vWvJ_jTOPhGU","oOpc26LU21JoejLExJxOmjG7_E2I","oOpc26GnkwTcASDd1kHGd6TR23PE","oOpc26P6UZxE9eIwdQ4EXxKv1lRA"],this.hasPermission=a.includes(n.data.openid),this.companies=n.data.companyArr.reduce((function(t,e){return e.info.includes(6)||e.info.includes("6")?[].concat(Object(s.a)(t),[{value:e.companyNo,label:e.companyName}]):t}),[]),this.state.loading=!1,t.t0=Number(n.code),t.next=0===t.t0?13:17;break;case 13:return this.isShow=(n.data.is_show||[]).includes(6)||(n.data.is_show||[]).includes("6"),this.costField=(n.data.is_show||[]).includes("cost_field"),x(n.data.openid),t.abrupt("break",21);case 17:return this.state.error=!0,e&&N(),this.state.message=n.message,t.abrupt("break",21);case 21:case"end":return t.stop()}}),t,this)}))),function(){return ha.apply(this,arguments)}),login:function(){var t=encodeURIComponent("http://stat.caixiao365.com/accountsReceivable"),e="wx_"+Math.random().toString(36).substr(2,15);t="".concat("https://open.weixin.qq.com/connect/oauth2/authorize","?appid=").concat(config.appId,"&redirect_uri=").concat(t,"&response_type=code&scope=").concat("snsapi_userinfo","&state=").concat(e,"#wechat_redirect");window.location.href=t}}},n("6c64"),wn=Object(o.a)(Zt,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{directives:[{name:"loading",rawName:"v-loading",value:t.state.loading,expression:"state.loading"}],staticClass:"new-results",staticStyle:{"min-height":"300px"}},[!t.state.error&&t.isShow&&t.hasPermission?n("div",[n("div",{staticStyle:{color:"red",width:"100%",display:"flex",padding:"5px 10px","align-items":"center","box-sizing":"border-box","justify-content":"space-between"}},[n("ElPopover",{attrs:{width:200,trigger:"hover",placement:"top-start",content:"以下报表一小时更新一次"},scopedSlots:t._u([{key:"reference",fn:function(){return[n("i",{staticClass:"el-icon-warning-outline",staticStyle:{"font-size":"22px",cursor:"pointer"}})]},proxy:!0}],null,!1,3390336504)}),n("ElSwitch",{attrs:{"active-text":"万元","inactive-text":"元"},model:{value:t.isTenThound,callback:function(e){t.isTenThound=e},expression:"isTenThound"}})],1),n("div",{staticClass:"container"},[n("result-company",{attrs:{companies:t.companies,costField:t.costField,isTenThound:t.isTenThound}}),n("result-company-bu",{attrs:{companies:t.companies,costField:t.costField,isTenThound:t.isTenThound}}),n("result-supplier",{attrs:{companies:t.companies,costField:t.costField,isTenThound:t.isTenThound}}),n("result-department",{attrs:{companies:t.companies,costField:t.costField,isTenThound:t.isTenThound}}),n("result-company-month",{attrs:{companies:t.companies,costField:t.costField,isTenThound:t.isTenThound}})],1)]):t.state.loading?t._e():[t._m(0)]],2)}),[function(){var t=this.$createElement;t=this._self._c||t;return t("div",{staticStyle:{color:"red",display:"flex","justify-content":"center","align-items":"center","margin-top":"10px"}},[t("i",{staticClass:"el-icon-warning-outline",staticStyle:{"font-size":"18px","margin-right":"5px"}}),this._v("\n 该报表为信息部内部报表,暂不对外开放\n ")])}],!1,null,"bac8cfb0",null).exports;var ha,fa,_a=function(t,e){return p("http://rep.report.caixiao365.com//admin/Everyday/GetCompanyStat",t,"post",e)};function ya(t,e){var n,a=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,n)),a}oe={name:"newReport",components:{PeriodDatePicker:Et,UnusualState:S},data:function(){return{date:[],tableData:[],zxTotal:0,isDisplay:!1,loading:!1,state:{message:"",error:!1,loading:!1}}},mounted:(wa=Object(c.a)(regeneratorRuntime.mark((function t(){var e,n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(document.title="6.库存情况",O("code")){t.next=5;break}this.login(),t.next=9;break;case 5:return t.next=7,this.requestUserinfo();case 7:if(this.state.error)return t.abrupt("return");t.next=9;break;case 9:return e=at()(new Date),n=e.subtract(7,"day"),this.date=[at()(n).format("YYYY-MM-DD"),at()(e).format("YYYY-MM-DD")],t.next=14,this.onSearch();case 14:case"end":return t.stop()}}),t,this)}))),function(){return wa.apply(this,arguments)}),methods:{unit2TenThousand:lt,time:(va=Object(c.a)(regeneratorRuntime.mark((function t(e){var n,a,o;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.startTime,a=e.endTime,this.start=n||"",this.end=a||"",n=this.start,a=this.end,""!==n&&""===a||""===n&&""!==a)return this.$message.warning("时间区间不完整!"),this.date=[],t.abrupt("return");t.next=8;break;case 8:if(o=at()(n).diff(at()(a),"day"),31<Math.abs(o))return this.$message.warning("时间区间不能超过31天!"),t.abrupt("return");t.next=12;break;case 12:this.start&&this.end?this.date=[this.start+" 00:00:00",this.end+" 23:59:59"]:this.date=[this.start,this.end],this.onSearch();case 14:case"end":return t.stop()}}),t,this)}))),function(t){return va.apply(this,arguments)}),onSearch:(ga=Object(c.a)(regeneratorRuntime.mark((function t(){var e,n,a,o;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,n=Object(Qn.a)(this.date,2),e=n[0],n=n[1],e||n){t.next=5;break}return this.$message.warning("请选择时间区间"),t.abrupt("return");case 5:if(a=at()(e).diff(at()(n),"day"),31<Math.abs(a))return this.$message.warning("时间区间不能超过31天!"),t.abrupt("return");t.next=9;break;case 9:return this.loading=!0,t.next=12,_a({start:e+" 00:00:00",end:n+" 23:59:59"});case 12:o=t.sent,t.t0=Number(o.code),t.next=0===t.t0?16:19;break;case 16:return this.tableData=o.data,this.loading=!1,t.abrupt("break",22);case 19:return this.tableData=[],this.loading=!1,t.abrupt("break",22);case 22:t.next=28;break;case 24:t.prev=24,t.t1=t.catch(0),this.tableData=[],this.loading=!1;case 28:case"end":return t.stop()}}),t,this,[[0,24]])}))),function(){return ga.apply(this,arguments)}),requestUserinfo:(ba=Object(c.a)(regeneratorRuntime.mark((function t(){var e,n,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.state.loading=!0,e=T(),n=O("code"),t.next=5,v(function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ya(Object(n),!0).forEach((function(e){Object(l.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ya(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},e?{openid:e}:{code:n}));case 5:a=t.sent,this.state.loading=!1,t.t0=Number(a.code),t.next=0===t.t0?10:14;break;case 10:return this.isShow=(a.data.is_show||[]).includes(7)||(a.data.is_show||[]).includes("7"),x(a.data.openid),t.abrupt("break",18);case 14:return this.state.error=!0,this.state.message=a.message,e&&N(),t.abrupt("break",18);case 18:case"end":return t.stop()}}),t,this)}))),function(){return ba.apply(this,arguments)}),login:function(){var t=encodeURIComponent("http://stat.caixiao365.com/accountsReceivable"),e="wx_"+Math.random().toString(36).substr(2,15);t="https://open.weixin.qq.com/connect/oauth2/authorize?appid=".concat(config.appId,"&redirect_uri=").concat(t,"&response_type=code&scope=").concat("snsapi_userinfo","&state=").concat(e,"#wechat_redirect");window.location.href=t}}},n("0bee"),Mt=Object(o.a)(oe,(function(){var t=this,e=t.$createElement;e=t._self._c||e;return e("div",{directives:[{name:"loading",rawName:"v-loading",value:t.state.loading||t.loading,expression:"state.loading || loading"}],staticClass:"new-report",staticStyle:{"min-height":"300px",padding:"10px"}},[!t.state.error&&t.isShow?e("div",[e("div",{staticStyle:{display:"flex","justify-content":"flex-end","align-items":"center","margin-bottom":"10px"},attrs:{xs:24}},[e("el-date-picker",{attrs:{size:"mini",type:"daterange",format:"yyyy-MM-dd",clearable:!1,"value-format":"yyyy-MM-dd","end-placeholder":"结束日期","start-placeholder":"开始日期","picker-options":{disabledDate:function(t){return t.getTime()>Date.now()}}},on:{change:t.onSearch},model:{value:t.date,callback:function(e){t.date=e},expression:"date"}})],1),e("el-table",{attrs:{border:"",size:"mini",data:t.tableData}},[e("el-table-column",{attrs:{label:"责任业务公司","min-width":"95px",prop:"companyName"}}),e("el-table-column",{attrs:{label:"新备SKU量","min-width":"85px",prop:"spu_num"}}),e("el-table-column",{attrs:{label:"新备库存金额","min-width":"95px",prop:"spu_total"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.unit2TenThousand(e.row.spu_total))+"\n ")]}}],null,!1,3668864674)}),e("el-table-column",{attrs:{label:"可用库存品SKU总量","min-width":"130px",prop:"stock_num"}}),e("el-table-column",{attrs:{label:"出库金额","min-width":"80px",prop:"out_total"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.unit2TenThousand(e.row.out_total))+"\n ")]}}],null,!1,1629660506)}),e("el-table-column",{attrs:{label:"无地址销售金额","min-width":"100px",prop:"out_total"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.unit2TenThousand(e.row.waddr_num))+"\n ")]}}],null,!1,2523447908)}),e("el-table-column",{attrs:{label:"当前可用库存金额","min-width":"120px",prop:"stock_total"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.unit2TenThousand(e.row.stock_total))+"\n ")]}}],null,!1,2365569236)})],1)],1):t.state.loading?t._e():[e("unusual-state",{attrs:{hasPermission:t.isShow,message:t.state.message,path:"newStock"}})]],2)}),[],!1,null,"847f4cbe",null).exports;var ba,ga,va,wa,xa={"北京百辰荣达国际科贸有限公司":"百辰","北京泓源广诚国际商贸有限公司":"泓源","北京万宇恒通国际科贸有限公司":"万宇","北京锦兴弘昌科技有限公司":"锦兴","北京普润心堂商贸有限公司":"普润","北京知事文化产业发展有限公司":"知事","北京泰文创供应链管理有限公司":"泰文创","北京元隆雅图文化传播股份有限公司":"北京元隆雅图文化传播股份有限公司","结算单E企购":"结算单E企购"},Ta={"北京百辰荣达国际科贸有限公司":"百辰荣达","北京泓源广诚国际商贸有限公司":"泓源广诚","北京万宇恒通国际科贸有限公司":"万宇恒通","北京锦兴弘昌科技有限公司":"锦兴弘昌","北京普润心堂商贸有限公司":"普润心堂","北京知事文化产业发展有限公司":"知事文化","湖北泽仁文化发展有限公司":"泽仁文化","深圳鸿逸科技发展有限公司":"鸿逸科技"},Na={companyNo:"yyyt",companyName:"合计-元隆雅图",cost_tips:"0",total_tips:"0",info:[{0:{type:"自营",dayinfo:{sale_total:"0.00",th_total:"0.00",type:"1",cgd_total:"0.00",cgd_th_total:"0.00"},monthinfo:{0:{msale_total:"0.00",mth_total:"0.00",mcgd_total:"0.00",mcgd_th_total:"0.00",type:"1"},1:{msale_total:"0.00",mth_total:"0.00",mcgd_total:"0.00",mcgd_th_total:"0.00",type:"2"},2:{msale_total:"0.00",mth_total:"0.00",mcgd_total:"0.00",mcgd_th_total:"0.00",type:"3"},3:{msale_total:"0.00",mth_total:"0.00",mcgd_total:"618.00",mcgd_th_total:"0.00",type:"4"},msale_total:"0.00",mcost_total:"0.00"}},1:{type:"渠道",dayinfo:{sale_total:"0.00",th_total:"0.00",type:"2",cgd_total:"327.60",cgd_th_total:"0.00"},monthinfo:{0:{msale_total:"5868465.56",mth_total:"44010.00",mcgd_total:"5680337.10",mcgd_th_total:"42689.70",type:"1"},1:{msale_total:"3545201.62",mth_total:"1901822.96",mcgd_total:"3352074.44",mcgd_th_total:"1799760.03",type:"2"},2:{msale_total:"1951934.40",mth_total:"0.00",mcgd_total:"0.00",mcgd_th_total:"0.00",type:"3"},3:{msale_total:"0.00",mth_total:"0.00",mcgd_total:"618.00",mcgd_th_total:"0.00",type:"4"},msale_total:"1643378.66",mcost_total:"1552314.41"}},2:{type:"供应商端",dayinfo:{sale_total:"0.00",th_total:"0.00",type:"3",cgd_total:"0.00",cgd_th_total:"0.00"},monthinfo:{0:{msale_total:"5868465.56",mth_total:"44010.00",mcgd_total:"5680337.10",mcgd_th_total:"42689.70",type:"1"},1:{msale_total:"3545201.62",mth_total:"1901822.96",mcgd_total:"3352074.44",mcgd_th_total:"1799760.03",type:"2"},2:{msale_total:0,mth_total:"0.00",mcgd_total:"0.00",mcgd_th_total:"0.00",type:"3"},3:{msale_total:"0.00",mth_total:"0.00",mcgd_total:"618.00",mcgd_th_total:"0.00",type:"4"},msale_total:0,mcost_total:"0.00"}},3:{type:"物流费用",dayinfo:{sale_total:"0.00",th_total:"0.00",type:"4",cgd_total:"0.00",cgd_th_total:"0.00"},monthinfo:{0:{msale_total:0,mth_total:0,mcgd_total:0,mcgd_th_total:0,type:"1"},1:{msale_total:0,mth_total:0,mcgd_total:0,mcgd_th_total:0,type:"2"},2:{msale_total:0,mth_total:"0.00",mcgd_total:"0.00",mcgd_th_total:"0.00",type:"3"},3:{msale_total:"0.00",mth_total:"0.00",mcgd_total:0,mcgd_th_total:"0.00",type:"4"},msale_total:0,mcost_total:0}}}],sale_total:0,cost_total:0,msale_total:0,mcost_total:0,gross_completion:0,completion_rate:0,gross_completion_rate:0,gross_sale_completion_rate:"0.00"};function Oa(t,e){var n,a=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,n)),a}function Sa(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Oa(Object(n),!0).forEach((function(e){Object(l.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Oa(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var ja,Da;e={props:["companies","costField","isTenThound"],data:function(){return{isDefaultExpandAll:!1,cacheDefaultExpandAll:!1,isShowTable:!1,filterCompany:{},daytime:"",loading:!1,tableData:[],companyNo:"",plat_cp_companies:[],cp_companies:[],isEmpty:!1,mapCompany:xa}},mounted:function(){var t,e,n=this,a=!1,o=this.companies.findIndex((function(t){return"北京锦兴弘昌科技有限公司"===t.label})),r=this.companies.findIndex((function(t){return"北京普润心堂商贸有限公司"===t.label})),i=this.companies.findIndex((function(t){return"北京知事文化产业发展有限公司"===t.label}));-1===o&&-1===r&&-1===i||(a=!0),this.cp_companies=this.companies.filter((function(t){return"北京锦兴弘昌科技有限公司"!==t.label&&"北京普润心堂商贸有限公司"!==t.label&&"北京知事文化产业发展有限公司"!==t.label})),a&&(this.cp_companies=[].concat(Object(s.a)(this.cp_companies),[{value:"GS2302231124114965",label:"普润&锦兴&知事"}])),this.isEmpty=0===this.cp_companies.length,this.isEmpty||(t={"北京万宇恒通国际科贸有限公司":"平台公司: 万宇","北京泰文创供应链管理有限公司":"平台公司: 泰文创","北京元隆雅图文化传播股份有限公司":"预订单E企购"},this.cp_companies=this.cp_companies.map((function(e,n){var a=t[e.label]||e.label;return Sa(Sa({},e),{},{label:a})})),o=["所有平台公司","平台公司: 万宇","平台公司: 泰文创","预订单E企购","结算单E企购"],e=this.cp_companies.map((function(t){return t.label})),o=o.filter((function(t){return e.includes(t)})),this.plat_cp_companies=o.map((function(t){return n.cp_companies.find((function(e){return e.label===t}))})),4===this.plat_cp_companies.length&&(this.plat_cp_companies=[{value:"",label:"所有平台公司"}].concat(Object(s.a)(this.plat_cp_companies))),this.companyNo=this.plat_cp_companies[0].value,this.daytime=this.transformTime(),this.requestData())},methods:{handleExpandChange:function(t,e){this.isDefaultExpandAll=e},calcAmountRealRate:function(){var t=this.calcAmount("msale_total"),e=this.calcAmount("gross_completion");return Number(it(Number(rt(e,t)).toFixed(2),100)).toFixed(2)+"%"},calcAmountGrossCompletionRate:function(){var t=this.calcAmount("gross_completion"),e=this.calcAmount("cost_tips");return Number(it(Number(rt(t,e)).toFixed(2),100)).toFixed(2)+"%"},calcAmountCompletionRate:function(){var t=this.calcAmount("msale_total"),e=this.calcAmount("total_tips");return Number(it(Number(rt(t,e)).toFixed(2),100)).toFixed(2)+"%"},calcAmount:function(t){var e,n,a=1<arguments.length&&void 0!==arguments[1]&&arguments[1],o=this.tableData.find((function(t){return"北京元隆雅图文化传播股份有限公司"===t.companyName}));return a?(a=t.split("."),e=(a=Object(Qn.a)(a,3))[0],n=a[1],a=a[2],Number(st(o.info[e][n][a],this.filterCompany.info[e][n][a])).toFixed(2)):"total_tips"===t||"cost_tips"===t?o[t]:Number(st(o[t],this.filterCompany[t])).toFixed(2)},unit2TenThousand:lt,load:function(t,e,n){var a=this.tableData.find((function(t){return-1!==t.companyName.indexOf("元隆雅图")}));n(a?a.children:[])},getCurrentRateStyle:function(t){var e=at()(this.daytime).daysInMonth(),n=(e=Number(rt(100,e)).toFixed(2),at()(this.daytime).date());n=Number(it(n,e)).toFixed(2);return Number(n)>Number(t)?"color:red":""},getCurrentValueStyle:function(t,e){var n=at()(this.daytime).daysInMonth();e=Number(rt(e,n)).toFixed(2),n=at()(this.daytime).date(),n=Number(it(n,e)).toFixed(2);return Number(n)>Number(t)?"color: red":""},setCellClassName:function(t){var e=t.column,n=(t=t.row,e=e.label,"");return"北京万宇恒通国际科贸有限公司"===t.companyName&&(n+="font-bold "),"营收目标"===e?n+"bg__success":-1===e.indexOf("营业")&&-1===e.indexOf("营收")||"当日营业收入"===e?"毛利目标"===e?n+"bg__primary":-1!==e.indexOf("毛利")?n+"bg__primary_1":-1!==e.indexOf("成本")?n+"bg__warning_1":n:n+"bg__success_1"},isLineValue:function(t){return"-"===t?"-":t+"%"},setHeaderClassName:function(t){return t=t.column.label,"营收目标"===t?"bg__success":-1===t.indexOf("营业")&&-1===t.indexOf("营收")||"当日营业收入"===t?"毛利目标"===t?"bg__primary":-1!==t.indexOf("毛利")?"bg__primary_1":-1!==t.indexOf("成本")?"bg__warning_1":void 0:"bg__success_1"},transformTime:function(){var t=new Date,e=t.getFullYear(),n=t.getMonth()+1;t=t.getDate();return e+"-"+(n<10?"0"+n:n)+"-"+(t<10?"0"+t:t)},getData:(Da=Object(c.a)(regeneratorRuntime.mark((function t(){var e,n,a,o=arguments;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=(0<o.length&&void 0!==o[0]?o[0]:{isChildren:!1}).isChildren,this.loading=!0,n=e?pe.platform:pe.companyEveryMonth,t.next=5,n({daytime:this.daytime});case 5:return n=t.sent,this.loading=!1,a=[],(e?1===n.code:0===n.code)&&n.data&&0<n.data.length?n.data.forEach((function(t){var n=t.platform_name,o=t.platform_id,r=t.companyName,i=t.companyNo,l=t.monthinfo,c=void 0===l?[]:l,u=(l=t.dayinfo,void 0===l?[]:l),p=(l=t.total_tips,l=void 0===l?0:l,t=t.cost_tips,t=void 0===t?0:t,{1:"自营",2:"渠道",3:"供应商端",4:"物流费用"}),d=Object.keys(p),m=0,h=0,f=0,_=0,y=(d=d.map((function(t){var n=(Array.isArray(c)?c:[c]).find((function(e){return String(e.type)===t})),a=(Array.isArray(u)?u:[u]).find((function(e){return String(e.type)===t})),o=(n=n||{mcgd_th_total:"0.00",mcgd_total:"0.00",msale_total:"0.00",mth_total:"0.00",type:t},a=a||{sale_total:"0.00",th_total:"0.00",type:"1",cgd_total:"0.00",cgd_th_total:"0.00"},e&&"sum_sale_total"in a&&(a={cgd_total:a.sum_cgd_total,sale_total:a.sum_sale_total,cgd_th_total:a.sum_cgd_th_total,th_total:a.sum_th_total,type:t}),0),r=(4!==Number(t)&&(o=st(n.msale_total,e?n.msale_th_total:n.mth_total),o=isNaN(o)?0:o),st(a.sale_total,a.th_total)||0),i=st(a.cgd_total,a.cgd_th_total)||0;n=st(n.mcgd_total,n.mcgd_th_total)||0;return m=Number(ot(m,r)).toFixed(2),h=Number(ot(h,o)).toFixed(2),f=Number(ot(f,i)).toFixed(2),_=Number(ot(_,n)).toFixed(2),{type:p[t],dayinfo:Sa(Sa({},a),{},{sale_total:r}),monthinfo:Sa(Sa({},c),{},{msale_total:o,mcost_total:n})}})),Number(st(h,_)).toFixed(2));l=0===Number(l)?"-":l,t=0===Number(t)?"-":t;a=[].concat(Object(s.a)(a),[{companyNo:e?o:i,companyName:e?n:r,cost_tips:t,total_tips:l,info:d,sale_total:m,cost_total:f,msale_total:h,mcost_total:_,gross_completion:y,completion_rate:"-"===l?"-":it(rt(h,l),100).toFixed(2),gross_completion_rate:"-"===t?"-":0===Number(t)?0:it(rt(y,t)||0,100).toFixed(2),gross_sale_completion_rate:0==Number(y)?0:Number(it(Number(rt(y,h)).toFixed(2),100)).toFixed(2)}])})):a=[],t.abrupt("return",a);case 10:case"end":return t.stop()}}),t,this)}))),function(){return Da.apply(this,arguments)}),isSubProp:function(t){return!1},requestData:(ja=Object(c.a)(regeneratorRuntime.mark((function t(){var e,n,a,o,r,i,s=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getData();case 2:if(0===(e=t.sent).length)return this.tableData=[],t.abrupt("return");t.next=6;break;case 6:if(o=["北京元隆雅图文化传播股份有限公司"],n=this.plat_cp_companies.map((function(t){return t.value})),a=e.map((function(t){return t.companyName})),o=o.filter((function(t){return a.includes(t)})),e=(e=o.map((function(t){return e.find((function(e){return e.companyName===t}))}))).filter((function(t){return t=t.companyNo,n.includes(t)})),-1!==(o=e.findIndex((function(t){return"GS2404151642335170"===t.companyNo}))))return t.next=16,this.getData({isChildren:!0});t.next=21;break;case 16:i=t.sent,r=i.filter((function(t){return"结算单E企购"!==t.companyName})),this.filterCompany=i.filter((function(t){return"结算单E企购"===t.companyName}))[0],i=e.splice(o,1),i=Object(Qn.a)(i,1),i=i[0],e.unshift(Sa({hasChildren:!0,children:r},i));case 21:this.tableData=e,this.isShowTable=!1,this.$nextTick((function(){s.isShowTable=!0}));case 24:case"end":return t.stop()}}),t,this)}))),function(){return ja.apply(this,arguments)})}},n("c17f"),Ft=Object(o.a)(e,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}]},[n("div",{staticClass:"search clear",staticStyle:{"align-items":"center"}},[n("span",{staticStyle:{"font-size":"15px"}},[t._v("预定单E企购-月度完成情况")]),n("div",{staticStyle:{float:"right"}},[n("el-date-picker",{staticClass:"fr picker no-padding",staticStyle:{width:"95px"},attrs:{"value-format":"yyyy-MM-dd",editable:!1,disabled:t.isEmpty,clearable:!1,size:"small",format:"yyyy-MM-dd",type:"date",align:"right",placeholder:"选择日期","picker-options":{disabledDate:function(t){return t.getTime()>Date.now()}}},on:{change:t.requestData},model:{value:t.daytime,callback:function(e){t.daytime=e},expression:"daytime"}})],1)]),t.isEmpty?[n("div",{staticStyle:{"text-align":"center","line-height":"60px","user-select":"none"}},[t._v("当前账号没有访问权限")])]:n("el-row",{staticStyle:{"margin-top":"10px"}},[t.isShowTable?n("el-table",{attrs:{border:"",size:"mini",data:t.tableData,"header-cell-class-name":t.setHeaderClassName,"cell-class-name":t.setCellClassName,"default-expand-all":t.isDefaultExpandAll,"row-key":"companyNo",load:t.load,lazy:""},on:{"expand-change":t.handleExpandChange}},[n("el-table-column",{attrs:{fixed:"left",label:"公司",prop:"companyName",align:"center",width:"120px"},scopedSlots:t._u([{key:"default",fn:function(e){return[-1===e.row.companyName.indexOf("元隆雅图")?n("span",[t._v("\n "+t._s(t.mapCompany[e.row.companyName]||e.row.companyName)+"\n ")]):n("span",[t._v("\n 预定单E企购\n ")])]}}],null,!1,267755817)}),n("el-table-column",{attrs:{label:"当日营业收入",align:"center",width:"95px"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.isSubProp(e.row)?t.unit2TenThousand(t.calcAmount("sale_total"),t.isTenThound):t.unit2TenThousand(e.row.sale_total,t.isTenThound))+"\n ")]}}],null,!1,3003726740)}),n("el-table-column",{attrs:{label:"营收目标",align:"center","min-width":"95px"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.isSubProp(e.row)?t.unit2TenThousand(t.calcAmount("total_tips"),t.isTenThound):t.unit2TenThousand(e.row.total_tips,t.isTenThound))+"\n ")]}}],null,!1,542741428)}),n("el-table-column",{attrs:{label:"营业收入(净)",align:"center","min-width":"115px"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("div",{staticStyle:{display:"flex","justify-content":"center"},style:""+(t.isSubProp(e.row.companyName)?"":t.getCurrentValueStyle(e.row.msale_total,e.row.total_tips))},[t._v("\n "+t._s(t.isSubProp(e.row)?t.unit2TenThousand(t.calcAmount("msale_total"),t.isTenThound):t.unit2TenThousand(e.row.msale_total,t.isTenThound))+"\n "),n("el-popover",{attrs:{placement:"right",width:200,trigger:"click"},scopedSlots:t._u([{key:"reference",fn:function(){return[n("div",{style:""+t.getCurrentValueStyle(e.row.msale_total,e.row.total_tips)},[n("i",{staticClass:"el-icon-warning-outline trigger-hover",staticStyle:{"font-size":"16px",cursor:"pointer","margin-left":"5px"}})])]},proxy:!0}],null,!0)},[n("div",{staticClass:"table-size"},[n("p",[t._v("直营/自营: "+t._s(t.isSubProp(e.row)?t.unit2TenThousand(t.calcAmount("0.monthinfo.msale_total",!0),t.isTenThound):t.unit2TenThousand(e.row.info[0].monthinfo.msale_total,t.isTenThound)))]),n("p",[t._v("支付渠道: "+t._s(t.isSubProp(e.row)?t.unit2TenThousand(t.calcAmount("1.monthinfo.msale_total",!0),t.isTenThound):t.unit2TenThousand(e.row.info[1].monthinfo.msale_total,t.isTenThound)))]),n("p",[t._v("供应商端: "+t._s(t.isSubProp(e.row)?t.unit2TenThousand(t.calcAmount("2.monthinfo.msale_total",!0),t.isTenThound):t.unit2TenThousand(e.row.info[2].monthinfo.msale_total,t.isTenThound))+"\n ")])])])],1)]}}],null,!1,3981620659)}),n("el-table-column",{attrs:{label:"营收完成%",align:"center","min-width":"85px"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("div",{style:""+("合计-元隆雅图"===e.row.companyName?"":t.getCurrentRateStyle(e.row.completion_rate))},[t._v("\n "+t._s(t.isSubProp(e.row)?t.calcAmountCompletionRate():t.isLineValue("NaN"===String(e.row.completion_rate)?0:e.row.completion_rate))+"\n ")])]}}],null,!1,2730491624)}),t.costField?[n("el-table-column",{attrs:{label:"毛利目标",align:"center","min-width":"90px"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.costField?"合计-元隆雅图"===e.row.companyName?t.unit2TenThousand(t.calcAmount("cost_tips"),t.isTenThound):t.unit2TenThousand(e.row.cost_tips,t.isTenThound):"***")+"\n ")]}}],null,!1,982655705)}),n("el-table-column",{attrs:{label:"毛利完成",align:"center","min-width":"90px"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("div",{style:""+(t.isSubProp(e.row)?"":t.getCurrentValueStyle(e.row.gross_completion,e.row.cost_tips))},[t._v("\n "+t._s(t.costField?t.isSubProp(e.row)?t.unit2TenThousand(t.calcAmount("gross_completion"),t.isTenThound):t.unit2TenThousand(e.row.gross_completion,t.isTenThound):"***")+"\n ")])]}}],null,!1,339503446)})]:t._e(),n("el-table-column",{attrs:{label:"毛利完成%",align:"center","min-width":"85px"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("div",{style:"合计-元隆雅图"===e.row.companyName?"":t.getCurrentRateStyle(e.row.gross_completion_rate)},[t._v("\n "+t._s(t.isSubProp(e.row)?t.calcAmountGrossCompletionRate():t.isLineValue(e.row.gross_completion_rate))+"\n ")])]}}],null,!1,1646152117)}),t.costField?[n("el-table-column",{attrs:{label:"成本合计",align:"center","min-width":"125px"},scopedSlots:t._u([{key:"default",fn:function(e){return[t.costField?n("div",{staticStyle:{display:"flex","justify-content":"center"}},[t._v("\n "+t._s(t.isSubProp(e.row)?t.unit2TenThousand(t.calcAmount("mcost_total"),t.isTenThound):t.unit2TenThousand(e.row.mcost_total,t.isTenThound))+"\n "),n("el-popover",{attrs:{placement:"right",width:200,trigger:"click"},scopedSlots:t._u([{key:"reference",fn:function(){return[n("i",{staticClass:"el-icon-warning-outline trigger-hover",staticStyle:{"font-size":"16px",cursor:"pointer","margin-left":"5px"}})]},proxy:!0}],null,!0)},[n("div",{staticClass:"table-size"},[n("p",[t._v("直营/自营: \n "+t._s(t.isSubProp(e.row)?t.unit2TenThousand(t.calcAmount("0.monthinfo.mcost_total",!0),t.isTenThound):t.unit2TenThousand(e.row.info[0].monthinfo.mcost_total,t.isTenThound))+"\n ")]),n("p",[t._v("支付渠道: \n "+t._s(t.isSubProp(e.row)?t.unit2TenThousand(t.calcAmount("1.monthinfo.mcost_total",!0),t.isTenThound):t.unit2TenThousand(e.row.info[1].monthinfo.mcost_total,t.isTenThound)))]),n("p",[t._v("供应商端: \n "+t._s(t.isSubProp(e.row)?t.unit2TenThousand(t.calcAmount("2.monthinfo.mcost_total",!0),t.isTenThound):t.unit2TenThousand(e.row.info[2].monthinfo.mcost_total,t.isTenThound)))]),n("p",[t._v("物流费用: \n "+t._s(t.isSubProp(e.row)?t.unit2TenThousand(t.calcAmount("3.monthinfo.mcost_total",!0),t.isTenThound):t.unit2TenThousand(e.row.info[3].monthinfo.mcost_total,t.isTenThound))+"\n ")])])])],1):n("p",[t._v("***")])]}}],null,!1,3128657394)}),n("el-table-column",{attrs:{label:"实际毛利率",align:"center",width:"85px"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.costField?t.unit2TenThousand(e.row.gross_sale_completion_rate)+"%":"***")+"\n ")]}}],null,!1,1372563993)})]:t._e()],2):t._e()],1)],2)}),[],!1,null,"4f025341",null).exports;function ka(t,e){var n,a=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,n)),a}function Ca(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ka(Object(n),!0).forEach((function(e){Object(l.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ka(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Pa;re={props:["companies","costField","isTenThound"],data:function(){return{lastSupportCompany:"",totalAmount:[],selfSupport:{companyArr:[]},otherSupport:{companyArr:[],companyAmount:[]},daytime:"",loading:!1,tableData:[],companyNo:"",plat_cp_companies:[],cp_companies:[],isEmpty:!1,mapCompany2:Ta,composeCompanies:["QS2206011447553544","QS2304031312553756","QS2203150147012961"],otherCompanise:[],notOtherCompanise:["QS2206011447553544","QS2304031312553756","QS2203150147012961","QS2203150147013805","QS2203150147015222","QS2206011103304501"]}},mounted:function(){var t,e=this,n=!1,a=this.companies.findIndex((function(t){return"北京锦兴弘昌科技有限公司"===t.label})),o=this.companies.findIndex((function(t){return"北京普润心堂商贸有限公司"===t.label})),r=this.companies.findIndex((function(t){return"北京知事文化产业发展有限公司"===t.label}));-1===a&&-1===o&&-1===r||(n=!0),this.cp_companies=this.companies.filter((function(t){return"北京锦兴弘昌科技有限公司"!==t.label&&"北京普润心堂商贸有限公司"!==t.label&&"北京知事文化产业发展有限公司"!==t.label})),n&&(this.cp_companies=[].concat(Object(s.a)(this.cp_companies),[{value:"GS2302231124114965",label:"普润&锦兴&知事"}])),this.isEmpty=0===this.cp_companies.length,this.isEmpty||(this.cp_companies=this.cp_companies.map((function(t,e){var n="";return"北京万宇恒通国际科贸有限公司"===t.label&&(n="平台公司: 万宇"),"北京泰文创供应链管理有限公司"===t.label&&(n="平台公司: 泰文创"),"北京元隆雅图文化传播股份有限公司"===t.label&&(n="预订单E企购"),"结算单E企购"===t.label&&(n="结算单E企购"),""===(n="普润&锦兴&知事"===t.label?"业务公司: 普润&锦兴&知事":n)&&(n="业务公司: ".concat(Ta[t.label])),Ca(Ca({},t),{},{label:n})})),a=["所有平台公司","平台公司: 万宇","平台公司: 泰文创","预订单E企购","结算单E企购"],t=this.cp_companies.map((function(t){return t.label})),a=a.filter((function(e){return t.includes(e)})),this.plat_cp_companies=a.map((function(t){return e.cp_companies.find((function(e){return e.label===t}))})),4===this.plat_cp_companies.length&&(this.plat_cp_companies=[{value:"",label:"所有平台公司"}].concat(Object(s.a)(this.plat_cp_companies))),this.companyNo=this.plat_cp_companies[0].value,this.daytime=this.transformTime(),this.requestData())},methods:{isLineRete:function(t){return"-"===t?"-":t+"%"},calcAmountRealRate:function(t){var e=this.calcAmount("msale_total",t);t=this.calcAmount("gross_completion",t),t=Number(it(Number(rt(t,e)).toFixed(2),100)).toFixed(2);return isNaN(t)?"0%":t+"%"},calcAmountGrossCompletionRate:function(t){if("selfSupportOrderPR"===t)return"-";var e="";e="selfSupportOrderAmount"===t?this.selfSupport.cost_tips:"otherSupportOrderAmount"===t?this.otherSupport.cost_tips:this.calcAmount("cost_tips",t),t=this.calcAmount("gross_completion",t);return Number(it(Number(rt(t,e)).toFixed(2),100)).toFixed(2)+"%"},getTotalValueStyle:function(t,e){var n=2<arguments.length&&void 0!==arguments[2]&&arguments[2],a=at()(this.daytime).daysInMonth();n=this.calcAmount(n?"cost_tips":"total_tips",t.companyNo),e=this.calcAmount(e,t.companyNo),t=Number(rt(n,a)).toFixed(2),n=at()(this.daytime).date(),a=Number(it(n,t)).toFixed(2);return Number(a)>Number(e)?"color: red":""},getTotalRateStyle:function(t,e){var n=at()(this.daytime).daysInMonth(),a=(n=Number(rt(100,n)).toFixed(2),at()(this.daytime).date());a=Number(it(a,n)),a=Number(100<a?100:a).toFixed(2),n="";return"completion_rate"===e&&(n=this.calcAmountCompletionRate(t.companyNo)),n=this.calcAmountGrossCompletionRate(t.companyNo),String(n).indexOf("%")&&(n=n.replace("%","")),Number(a)>Number(n)?"color:red":""},getCurrentRateStyle:function(t){var e=at()(this.daytime).daysInMonth(),n=(e=Number(rt(100,e)).toFixed(2),at()(this.daytime).date());n=Number(it(n,e)).toFixed(2);return Number(n)>Number(t)?"color:red":""},getCurrentValueStyle:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,n=at()(this.daytime).daysInMonth();e=Number(rt(e,n)).toFixed(2),n=at()(this.daytime).date(),n=Number(it(n,e)).toFixed(2);return Number(n)>Number(t)?"color: red":""},calcAmountCompletionRate:function(t){var e=this.calcAmount("msale_total",t);t=this.calcAmount("total_tips",t);return Number(it(Number(rt(e,t)).toFixed(2),100)).toFixed(2)+"%"},calcAmount:function(t,e){var n,a=[];if("totalAmount"===e)return o=this.calcAmount(t,"selfSupportOrderAmount"),n=this.calcAmount(t,"otherSupportOrderAmount"),Number(ot(o,n)).toFixed(2);if("selfSupportOrderPR"===e&&(a=this.selfSupport.companyArr.find((function(t){return"普润"===t.companyName})).children,"total_tips"===t||"cost_tips"===t))return a[0][t];if("otherSupportOrderAmount"===e){if("total_tips"===t)return this.otherSupport.total_tips;if("cost_tips"===t)return this.otherSupport.cost_tips;a=this.otherSupport.companyArr}if("selfSupportOrderAmount"===e){var o=this.selfSupport.companyArr.find((function(t){return"普润"===t.companyName})).children;if("cost_tips"===t)return this.selfSupport.cost_tips;if("total_tips"===t)return this.selfSupport.total_tips;if(a=[].concat(Object(s.a)(this.selfSupport.companyArr),Object(s.a)(o)),"cost_tips"===t)return"-"}return a.reduce((function(e,n){return n?(e=Number(ot(e,isNaN(n[t])?0:n[t])),0===e?0:e.toFixed(2)):0}),0)},isAmountProp:function(t){return"普润"===t||"其他"===t||"合计"===t},load:function(t,e,n){var a=this.tableData.find((function(t){return"compoeseSupplier"===t.companyNo}));n(a?a.children:[])},unit2TenThousand:lt,handleData:function(t){var e=[];return t.companyArr.forEach((function(t){var n=t.supplierName,a=t.supplierNo,o=t.total_tips,r=(o=void 0===o?"-":o,t.monthinfo),i=t.cost_tips,c=(i=void 0===i?"-":i,t.dayinfo),u=(t=t.is_sup,t=void 0===t?"-":t,o=0===Number(o)?"-":o,{1:"自营"}),p=Object.keys(u),d=0,m=0,h=0,f=0,_=(p=p.map((function(t){var e=(Array.isArray(r)?r:[r])[0],n=(Array.isArray(c)?c:[c])[0],a={mcgd_th_total:"0.00",mcgd_total:"0.00",msale_total:"0.00",mth_total:"0.00",type:t},o=Object(l.a)({sale_total:"0.00",th_total:"0.00",type:"1",cgd_total:"0.00",cgd_th_total:"0.00"},"type",t),i=(n=n||o,a=("msale_th_total"in(e=e||a)&&(e.mth_total=e.msale_th_total),o=st(e.msale_total,e.mth_total)||0,st(n.sale_total,n.sale_th_total)||0),st(n.cgd_total,n.cgd_th_total)||0);e=st(e.mcgd_total,e.mcgd_th_total)||0;return d=Number(ot(d,a)).toFixed(2),m=Number(ot(m,o)).toFixed(2),h=Number(ot(h,i)).toFixed(2),f=Number(ot(f,e)).toFixed(2),{type:u[t],dayinfo:Ca(Ca({},n),{},{sale_total:a}),monthinfo:Ca(Ca({},r),{},{msale_total:o,mcost_total:e})}})),Number(st(m,f)).toFixed(2));e=[].concat(Object(s.a)(e),[{is_sup:t,companyNo:a,companyName:n,cost_tips:i,total_tips:o,info:p[0],sale_total:d,cost_total:h,msale_total:m,mcost_total:f,gross_completion:_,completion_rate:"-"===o?"-":it(Number(rt(m,o)).toFixed(2),100).toFixed(2),gross_completion_rate:"-"===i?"-":0===Number(i)?0:it(rt(_,i)||0,100).toFixed(2),gross_sale_completion_rate:Number(it(Number(rt(_,m)).toFixed(2),100)).toFixed(2)}])})),e},setCellClassName:function(t){var e=t.column,n=t.row,a=(t=t.columnIndex,e=e.label,"");return 0!==t||"自营订单"!==n.order_type&&void 0!==n.order_type||n.companyName===this.lastSupportCompany||(a+="no-border-bottom "),"北京万宇恒通国际科贸有限公司"===n.companyName&&(a+="font-bold "),"营收目标"===e?a+"bg__success":-1===e.indexOf("营业")&&-1===e.indexOf("营收")||"当日营业收入"===e?"毛利目标"===e?a+"bg__primary":-1!==e.indexOf("毛利")?a+"bg__primary_1":-1!==e.indexOf("成本")?a+"bg__warning_1":a:a+"bg__success_1"},setHeaderClassName:function(t){return t=t.column.label,"营收目标"===t?"bg__success":-1===t.indexOf("营业")&&-1===t.indexOf("营收")||"当日营业收入"===t?"毛利目标"===t?"bg__primary":-1!==t.indexOf("毛利")?"bg__primary_1":-1!==t.indexOf("成本")?"bg__warning_1":void 0:"bg__success_1"},transformTime:function(){var t=new Date,e=t.getFullYear(),n=t.getMonth()+1;t=t.getDate();return e+"-"+(n<10?"0"+n:n)+"-"+(t<10?"0"+t:t)},requestData:(Pa=Object(c.a)(regeneratorRuntime.mark((function t(){var e,n,a,o,r=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.loading=!0,this.tableData=[],t.next=4,pe.supplier({daytime:this.daytime});case 4:1===(n=t.sent).code&&n.data?(n=JSON.parse(JSON.stringify(n.data)),a=n[2],n=n[3],a.companyArr=this.handleData(a),n.companyArr=this.handleData(n),this.otherSupport=n,this.selfSupport=a,e=this.selfSupport.companyArr.filter((function(t){return t=t.companyNo,r.composeCompanies.includes(t)})),e=["北京普润心堂商贸有限公司","北京锦兴弘昌科技有限公司","北京知事文化产业发展有限公司"].map((function(t){return e.find((function(e){return e.companyName===t}))})).filter((function(t){return void 0!==t})),this.selfSupport.companyArr=this.selfSupport.companyArr.filter((function(t){return t=t.companyNo,!r.composeCompanies.includes(t)})),this.selfSupport.companyArr=[Ca(Ca({},Na),{},{companyNo:"selfSupportOrderAmount",order_type:"自营订单",companyName:"合计"})].concat(Object(s.a)(0===e.length?[]:[Ca(Ca({},Na),{},{companyNo:"selfSupportOrderPR",companyName:"普润",children:e})]),Object(s.a)(this.selfSupport.companyArr)),this.otherSupport.companyAmount=[Ca(Ca({},Na),{},{order_type:"地推订单",companyName:"合计",companyNo:"otherSupportOrderAmount"})],this.totalAmount=[Ca(Ca({},Na),{},{companyNo:"totalAmount",order_type:"结算单E企购",companyName:"合计"})],n=this.selfSupport.companyArr.findIndex((function(t){return"QS2206011103304501"===t.companyNo})),a=this.selfSupport.companyArr.findIndex((function(t){return"QS2203150147015222"===t.companyNo})),-1!==n&&-1!==a&&(o=this.selfSupport.companyArr[n],this.selfSupport.companyArr[n]=this.selfSupport.companyArr[a],this.selfSupport.companyArr[a]=o),this.selfSupport.companyArr=this.selfSupport.companyArr.map((function(t){return Ca(Ca({},t),{},{order_type:void 0})})),2===this.selfSupport.companyArr.length&&"合计"===this.selfSupport.companyArr[0].companyName&&this.selfSupport.companyArr.splice(0,1),this.lastSupportCompany=this.selfSupport.companyArr[this.selfSupport.companyArr.length-1].companyName,Math.floor(this.selfSupport.companyArr.length/2),this.selfSupport.companyArr[0].order_type="自营订单"):this.tableData=[],this.loading=!1;case 7:case"end":return t.stop()}}),t,this)}))),function(){return Pa.apply(this,arguments)})}};function Ra(t,e){var n,a=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,n)),a}n("3008");xt={name:"newReportsInfo",components:{ResultCompany:Ft,ResultSupplier:Object(o.a)(re,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}]},[n("div",{staticClass:"search clear",staticStyle:{"align-items":"center"}},[n("span",{staticStyle:{"font-size":"15px"}},[t._v("结算单E企购-月度完成情况")]),n("div",{staticStyle:{float:"right"}},[n("el-date-picker",{staticClass:"fr picker no-padding",staticStyle:{width:"95px"},attrs:{"value-format":"yyyy-MM-dd",editable:!1,disabled:t.isEmpty,clearable:!1,size:"small",format:"yyyy-MM-dd",type:"date",align:"right",placeholder:"选择日期","picker-options":{disabledDate:function(t){return t.getTime()>Date.now()}}},on:{change:t.requestData},model:{value:t.daytime,callback:function(e){t.daytime=e},expression:"daytime"}})],1)]),t.isEmpty?[n("div",{staticStyle:{"text-align":"center","line-height":"60px","user-select":"none"}},[t._v("当前账号没有访问权限")])]:n("el-row",{staticStyle:{"margin-top":"10px"}},[n("el-table",{attrs:{border:"",size:"mini",data:t.totalAmount.concat(t.selfSupport.companyArr,t.otherSupport.companyAmount),"header-cell-class-name":t.setHeaderClassName,"cell-class-name":t.setCellClassName,"row-key":"companyNo",load:t.load,lazy:""}},[n("el-table-column",{attrs:{type:"",fixed:"left",label:"",prop:"order_type",align:"center",width:"120px"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.order_type)+"\n ")]}}],null,!1,4285348596)}),n("el-table-column",{attrs:{label:"公司",prop:"companyName",align:"center",width:"120px"},scopedSlots:t._u([{key:"default",fn:function(e){return[-1===e.row.companyName.indexOf("合计-")?n("span",[t._v("\n "+t._s(t.mapCompany2[e.row.companyName]||e.row.companyName)+"\n ")]):n("span",[t._v("\n 元隆雅图\n ")])]}}],null,!1,3172232701)}),n("el-table-column",{attrs:{label:"当日营业收入",align:"center",width:"95px"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.isAmountProp(e.row.companyName)?t.unit2TenThousand(t.calcAmount("sale_total",e.row.companyNo),t.isTenThound):t.unit2TenThousand(e.row.sale_total,t.isTenThound))+"\n ")]}}],null,!1,3591617944)}),n("el-table-column",{attrs:{label:"营收目标",align:"center","min-width":"95px"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.isAmountProp(e.row.companyName)?t.unit2TenThousand(t.calcAmount("total_tips",e.row.companyNo),t.isTenThound):t.unit2TenThousand(e.row.total_tips,t.isTenThound))+"\n ")]}}],null,!1,25679736)}),n("el-table-column",{attrs:{label:"营业收入(净)",align:"center","min-width":"115px"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("div",{staticStyle:{display:"flex","justify-content":"center"},style:""+(t.isAmountProp(e.row.companyName)?t.getTotalValueStyle(e.row,"msale_total"):t.getCurrentValueStyle(e.row.msale_total,e.row.total_tips))},[t._v("\n "+t._s(t.isAmountProp(e.row.companyName)?t.unit2TenThousand(t.calcAmount("msale_total",e.row.companyNo),t.isTenThound):t.unit2TenThousand(e.row.msale_total,t.isTenThound))+"\n ")])]}}],null,!1,2878073542)}),n("el-table-column",{attrs:{label:"营收完成%",align:"center","min-width":"85px"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("div",{style:""+(t.isAmountProp(e.row.companyName)?t.getTotalRateStyle(e.row,"completion_rate"):t.getCurrentRateStyle(e.row.completion_rate))},[t._v("\n "+t._s(t.isAmountProp(e.row.companyName)?t.calcAmountCompletionRate(e.row.companyNo):t.isLineRete("NaN"===String(e.row.completion_rate)||Math.abs(e.row.completion_rate)===1/0?0:e.row.completion_rate))+"\n ")])]}}],null,!1,639857370)}),t.costField?[n("el-table-column",{attrs:{label:"毛利目标",align:"center","min-width":"90px"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.costField?t.isAmountProp(e.row.companyName)?t.unit2TenThousand(t.calcAmount("cost_tips",e.row.companyNo),t.isTenThound):t.unit2TenThousand(e.row.cost_tips,t.isTenThound):"***")+"\n ")]}}],null,!1,1622815230)}),n("el-table-column",{attrs:{label:"毛利完成",align:"center","min-width":"90px"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("div",{style:""+(t.isAmountProp(e.row.companyName)?t.getTotalValueStyle(e.row,"gross_completion",!0):t.getCurrentValueStyle(e.row.gross_completion,e.row.cost_tips))},[t._v("\n "+t._s(t.costField?t.isAmountProp(e.row.companyName)?t.unit2TenThousand(t.calcAmount("gross_completion",e.row.companyNo),t.isTenThound):t.unit2TenThousand(e.row.gross_completion,t.isTenThound):"***")+"\n ")])]}}],null,!1,1816209260)})]:t._e(),n("el-table-column",{attrs:{label:"毛利完成%",align:"center","min-width":"85px"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("div",{style:t.isAmountProp(e.row.companyName)?t.getTotalRateStyle(e.row,"gross_completion_rate"):t.getCurrentRateStyle(e.row.gross_completion_rate)},[t._v("\n "+t._s(t.isAmountProp(e.row.companyName)?t.calcAmountGrossCompletionRate(e.row.companyNo):"-"===e.row.gross_completion_rate?"-":e.row.gross_completion_rate+"%")+"\n ")])]}}],null,!1,2748519026)}),t.costField?[n("el-table-column",{attrs:{label:"成本合计",align:"center","min-width":"125px"},scopedSlots:t._u([{key:"default",fn:function(e){return[t.costField?n("div",{staticStyle:{display:"flex","justify-content":"center"}},[t._v("\n "+t._s(t.isAmountProp(e.row.companyName)?t.unit2TenThousand(t.calcAmount("mcost_total",e.row.companyNo),t.isTenThound):t.unit2TenThousand(e.row.mcost_total,t.isTenThound))+"\n ")]):n("p",[t._v("***")])]}}],null,!1,4047076869)}),n("el-table-column",{attrs:{label:"实际毛利率",align:"center",width:"85px"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.costField?t.isAmountProp(e.row.companyName)?t.calcAmountRealRate(e.row.companyNo):t.unit2TenThousand(e.row.gross_sale_completion_rate)+"%":"***")+"\n ")]}}],null,!1,3193788296)})]:t._e()],2)],1)],2)}),[],!1,null,"633b0d0e",null).exports,PeriodDatePicker:Et,UnusualState:S},data:function(){return{state:{message:"",error:!1,loading:!1},hasPermission:!1,isTenThound:!0,isDisplay:!1,costField:!1,companies:[],daytime:"",zxTotal:0}},mounted:function(){O("code")?this.requestUserinfo():this.login()},methods:{time:(Ea=Object(c.a)(regeneratorRuntime.mark((function t(e){var n,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.startTime,a=e.endTime,this.start=n||"",this.end=a||"",n=this.start,a=this.end,""!==n&&""===a||""===n&&""!==a)return this.$message.warning("时间区间不完整!"),this.date=[],t.abrupt("return");t.next=8;break;case 8:this.start&&this.end?this.date=[this.start+" 00:00:00",this.end+" 23:59:59"]:this.date=[this.start,this.end];case 9:case"end":return t.stop()}}),t,this)}))),function(t){return Ea.apply(this,arguments)}),requestUserinfo:(Fa=Object(c.a)(regeneratorRuntime.mark((function t(){var e,n,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.state.loading=!0,e=T(),n=O("code"),t.next=5,v(function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ra(Object(n),!0).forEach((function(e){Object(l.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ra(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},e?{openid:e}:{code:n}));case 5:a=t.sent,this.companies=[{value:"GS2404151642335170",label:"北京元隆雅图文化传播股份有限公司"}],this.state.loading=!1,t.t0=Number(a.code),t.next=0===t.t0?11:16;break;case 11:return this.isShow=(a.data.is_show||[]).includes(8)||(a.data.is_show||[]).includes("8"),this.costField=(a.data.is_show||[]).includes("cost_field_settle"),x(a.data.openid),t.abrupt("break",20);case 16:return this.state.error=!0,e&&N(),this.state.message=a.message,t.abrupt("break",20);case 20:case"end":return t.stop()}}),t,this)}))),function(){return Fa.apply(this,arguments)}),login:function(){var t=encodeURIComponent("http://stat.caixiao365.com/accountsReceivable"),e="wx_"+Math.random().toString(36).substr(2,15);t="".concat("https://open.weixin.qq.com/connect/oauth2/authorize","?appid=").concat(config.appId,"&redirect_uri=").concat(t,"&response_type=code&scope=").concat("snsapi_userinfo","&state=").concat(e,"#wechat_redirect");window.location.href=t}}},n("f9a4"),rn=Object(o.a)(xt,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{directives:[{name:"loading",rawName:"v-loading",value:t.state.loading,expression:"state.loading"}],staticClass:"new-results",staticStyle:{"min-height":"300px"}},[!t.state.error&&t.isShow?n("div",[n("div",{staticStyle:{color:"red",width:"100%",display:"flex",padding:"5px 10px","align-items":"center","box-sizing":"border-box","justify-content":"space-between"}},[n("ElPopover",{attrs:{width:200,trigger:"hover",placement:"top-start",content:"以下报表一小时更新一次"},scopedSlots:t._u([{key:"reference",fn:function(){return[n("i",{staticClass:"el-icon-warning-outline",staticStyle:{"font-size":"22px",cursor:"pointer"}})]},proxy:!0}],null,!1,3390336504)}),n("ElSwitch",{attrs:{"active-text":"万元","inactive-text":"元"},model:{value:t.isTenThound,callback:function(e){t.isTenThound=e},expression:"isTenThound"}})],1),n("div",{staticClass:"container"},[n("result-supplier",{attrs:{companies:t.companies,costField:t.costField,isTenThound:t.isTenThound}}),n("result-company",{attrs:{companies:t.companies,costField:t.costField,isTenThound:t.isTenThound}})],1)]):t.state.loading?t._e():[n("unusual-state",{attrs:{hasPermission:t.isShow,message:t.state.message,path:"newEarningReport"}})]],2)}),[],!1,null,"854d531c",null).exports;var Fa,Ea,Ma=function(t,e){return p("http://rep.report.caixiao365.com/admin/everyday/companyStat",t,"post",e)};function Aa(t,e){var n,a;try{n=t.toString().split(".")[1].length}catch(t){n=0}try{a=e.toString().split(".")[1].length}catch(t){a=0}return(t*(t=Math.pow(10,Math.max(n,a)))+e*t)/t}function za(t,e){var n=0,a=0;try{n=t.toString().split(".")[1].length}catch(t){}try{a=e.toString().split(".")[1].length}catch(t){}t=Number(t.toString().replace(".",""))/Number(e.toString().replace(".","")),e=Math.pow(10,a-n),a=0,t=t.toString(),e=e.toString();try{a+=t.split(".")[1].length}catch(t){}try{a+=e.split(".")[1].length}catch(t){}return Number(t.replace(".",""))*Number(e.replace(".",""))/Math.pow(10,a)}function Ia(t,e){var n,a;try{n=t.toString().split(".")[1].length}catch(t){n=0}try{a=e.toString().split(".")[1].length}catch(t){a=0}return((t*(t=Math.pow(10,Math.max(n,a)))-e*t)/t).toFixed(a<=n?n:a)}var qa={express:[{label:"无地址订单",prop:"noAddrOrderNum",suffix:"_date",minWidth:"100px",exportUrl:"http://rep.report.caixiao365.com/purchease/sale/saleNoAddrListExport",baseParameter:{}},{label:"未发货发货单",prop:"waitSendOrderNum",suffix:"",minWidth:"100px",exportUrl:"http://rep.report.caixiao365.com/purchease/sale/orderNoOutListExport",baseParameter:{}},{label:"未签收订单",minWidth:"100px",children:[{label:"未签收订单总数",prop:"noSignOrderNum",minWidth:"120px",suffix:"",exportUrl:"http://rep.report.caixiao365.com//purchease/sale/OutChildListExport",baseParameter:{status:"2"}},{label:"无物流信息",prop:"noSignOrderNoExpressNum",minWidth:"100px",suffix:"",exportUrl:"http://rep.report.caixiao365.com//purchease/sale/OutChildErrorExport",baseParameter:{status:"0"}},{label:"物流信息异常",prop:"noSignOrderFailNum",minWidth:"100px",suffix:"",exportUrl:"http://rep.report.caixiao365.com//purchease/sale/OutChildErrorExport",baseParameter:{status:"7"}}]}],saleOrder:[{label:"未回款销售单",children:[{label:"toB",prop:"noPayQrdTobNum",minWidth:"100px"},{label:"toC",prop:"noPayQrdTocNum",minWidth:"100px"}]},{label:"未开票销售单",children:[{label:"toB",prop:"noInvQrdTobNum",minWidth:"100px"},{label:"toC",prop:"noInvQrdTocNum",minWidth:"100px"}]}],purchaseOrder:[{label:"未对账采购单",children:[{label:"通用订单",prop:"noDzCgdNumComon",minWidth:"100px"},{label:"采购/源头订单",prop:"noDzCgdNum",minWidth:"100px"}]},{label:"已对账未付款采购单",children:[{label:"通用订单",prop:"dzNoPayCgdNumCom",minWidth:"100px"},{label:"采购/源头订单",prop:"dzNoPayCgdNum",minWidth:"100px"}]},{label:"已对账未回票采购单",children:[{label:"通用订单",prop:"dzNoInvCgdNumCom",minWidth:"100px"},{label:"采购/源头订单",prop:"dzNoInvCgdNum",minWidth:"100px"}]}]},La=(Yt=n("cebe"),n.n(Yt));function $a(t,e){var n,a=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,n)),a}function Ha(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?$a(Object(n),!0).forEach((function(e){Object(l.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):$a(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Ua(t,e){var n,a=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,n)),a}function Ya(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ua(Object(n),!0).forEach((function(e){Object(l.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ua(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}At={props:{data:{type:Array,default:function(){return[]}},mode:{type:String,default:"express"}},data:function(){return{loading:!1}},computed:{columns:function(){return qa[this.mode]},tableProps:function(){var t=[];return this.columns.forEach((function(e){e.children?e.children.forEach((function(e){return t.push(e.prop)})):t.push(e.prop)})),t},tableData:function(){var t=this,e=[],n=(this.data.forEach((function(n){t.tableProps.every((function(t){return 0===Number(n[t])}))||e.push(n)})),{companyName:"全部",companyNo:"",year:"合计",noAddrOrderNum:0,waitSendOrderNum:0,noSignOrderNum:0,noDzCgdNumComon:0,noDzCgdNum:0,dzNoPayCgdNumCom:0,dzNoPayCgdNum:0,dzNoInvCgdNumCom:0,dzNoInvCgdNum:0,noPayQrdTobNum:0,noPayQrdTocNum:0,noInvQrdTobNum:0,noInvQrdTocNum:0,noSignOrderNoExpressNum:0,noSignOrderExpressNum:0,noSignOrderFailNum:0});return this.data.forEach((function(t){"合计"===t.year&&(n={companyName:"全部",companyNo:"",year:"合计",noAddrOrderNum:Aa(n.noAddrOrderNum,t.noAddrOrderNum),waitSendOrderNum:Aa(n.waitSendOrderNum,t.waitSendOrderNum),noSignOrderNum:Aa(n.noSignOrderNum,t.noSignOrderNum),noDzCgdNumComon:Aa(n.noDzCgdNumComon,t.noDzCgdNumComon),noDzCgdNum:Aa(n.noDzCgdNum,t.noDzCgdNum),dzNoPayCgdNumCom:Aa(n.dzNoPayCgdNumCom,t.dzNoPayCgdNumCom),dzNoPayCgdNum:Aa(n.dzNoPayCgdNum,t.dzNoPayCgdNum),dzNoInvCgdNumCom:Aa(n.dzNoInvCgdNumCom,t.dzNoInvCgdNumCom),dzNoInvCgdNum:Aa(n.dzNoInvCgdNum,t.dzNoInvCgdNum),noPayQrdTobNum:Aa(n.noPayQrdTobNum,t.noPayQrdTobNum),noPayQrdTocNum:Aa(n.noPayQrdTocNum,t.noPayQrdTocNum),noInvQrdTobNum:Aa(n.noInvQrdTobNum,t.noInvQrdTobNum),noInvQrdTocNum:Aa(n.noInvQrdTocNum,t.noInvQrdTocNum),noSignOrderNoExpressNum:Aa(n.noSignOrderNoExpressNum,t.noSignOrderNoExpressNum),noSignOrderExpressNum:Aa(n.noSignOrderExpressNum,t.noSignOrderExpressNum),noSignOrderFailNum:Aa(n.noSignOrderFailNum,t.noSignOrderFailNum)})})),[n].concat(e)}},methods:{handleDownload:function(t,e){var n=Ha({companyNo:e.companyNo},t.baseParameter);"合计"===e.year?(n["start".concat(t.suffix)]="2023-01-01",n["end".concat(t.suffix)]="2024-12-31"):(n[["start".concat(t.suffix)]]="".concat(e.year,"-01-01"),n["end".concat(t.suffix)]="".concat(e.year,"-12-31")),"全部"===e.companyName&&(n=Ha({},t.baseParameter)),this.exportData(t.exportUrl,n,this.generateTitle(t,e))},handleChildDownload:function(t,e,n){var a=Ha({companyNo:n.companyNo},e.baseParameter);"合计"===n.year?(a["start".concat(e.suffix)]="2023-01-01",a["end".concat(e.suffix)]="2024-12-31"):(a["start".concat(e.suffix)]="".concat(n.year,"-01-01"),a["end".concat(e.suffix)]="".concat(n.year,"-12-31")),"全部"===n.companyName&&(a=Ha({},e.baseParameter)),this.exportData(e.exportUrl,a,this.generateChildTitle(t,e,n))},exportData:function(t,e,n){var a=this;this.loading=!0,La()({method:"post",url:t,data:e,responseType:"blob"}).then((function(t){a.loading=!1;t=new Blob([t.data],{type:"aplication/x-msexecl"}),t=window.URL.createObjectURL(t);var e=document.createElement("a");e.style.display="none",e.href=t,e.setAttribute("download",n+".xlsx"),document.body.appendChild(e),e.click(),window.URL.revokeObjectURL(t),a.$message.success("下载完成")})).catch((function(){a.loading=!1}))},generateChildTitle:function(t,e,n){return"合计"===n.year?"".concat(n.companyName).concat(t.label,"(").concat(e.label,") 合计"):"".concat(n.year,"年").concat(n.companyName).concat(t.label,"(").concat(e.label,")")},generateTitle:function(t,e){return"合计"===e.year?"".concat(e.companyName).concat(t.label," 合计"):"".concat(e.year,"年").concat(e.companyName).concat(t.label)},getSpanNumber:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"",n=Array.isArray(t)?t.length:0;if(0<n){for(var a=0,o=t[0][e],r=[1],i=1;i<n;i++)t[i][e]==o?(r[a]+=1,r[i]=0):(r[a=i]=1,o=t[i][e]);return r}return[0]},tableRowClassName:function(t){if("合计"===t.row.year)return"bg__warning_1"},objectSpanMethod:function(t){t.row,t.column;var e=t.rowIndex;if(0==t.columnIndex)return{rowspan:this.getSpanNumber(this.tableData,"companyName")[e],colspan:1}}}},n("a0cb");var Ga,Va,Qa,Ba,Wa;Zt={name:"report",components:{UnusualState:S,CommonReporting:Object(o.a)(At,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("ElTable",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{border:"",size:"mini",data:t.tableData,"span-method":t.objectSpanMethod,"row-class-name":t.tableRowClassName}},[n("ElTableColumn",{attrs:{fixed:"left",width:"120px",label:"业务公司",prop:"companyName","show-overflow-tooltip":""}}),n("ElTableColumn",{attrs:{label:"年度",prop:"year",width:"50px","show-overflow-tooltip":""}}),t._l(t.columns,(function(e){return[e.children?n("ElTableColumn",t._b({attrs:{align:"center"}},"ElTableColumn",e,!1),t._l(e.children,(function(a){return n("ElTableColumn",t._b({scopedSlots:t._u([{key:"default",fn:function(o){return[a.exportUrl?n("ElPopconfirm",{attrs:{title:"是否确认下载 "+t.generateChildTitle(e,a,o.row),placement:"top"},on:{confirm:function(n){return t.handleChildDownload(e,a,o.row)}}},[n("template",{slot:"reference"},[n("i",{staticClass:"el-icon-download download-btn"})])],2):t._e(),t._v("\n "+t._s(o.row[a.prop])+"\n ")]}}],null,!0)},"ElTableColumn",a,!1))})),1):n("ElTableColumn",t._b({scopedSlots:t._u([{key:"default",fn:function(a){return[e.exportUrl?n("ElPopconfirm",{attrs:{title:"是否确认下载 "+t.generateTitle(e,a.row)},on:{confirm:function(n){return t.handleDownload(e,a.row)}}},[n("template",{slot:"reference"},[n("i",{staticClass:"el-icon-download download-btn"})])],2):t._e(),t._v("\n "+t._s(a.row[e.prop])+"\n ")]}}],null,!0)},"ElTableColumn",e,!1))]}))],2)}),[],!1,null,null,null).exports},data:function(){return{state:{error:!1,loading:!1,message:""},hasPlatformDimension:!1,isShow:!1,companyArr:[],orderNums:[]}},mounted:(Ba=Object(c.a)(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:document.title="业务公司订单统计",this.requestUserinfo();case 2:case"end":return t.stop()}}),t,this)}))),function(){return Ba.apply(this,arguments)}),methods:{requestOrderNum:(Qa=Object(c.a)(regeneratorRuntime.mark((function t(){var e,n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Ma();case 2:0==(e=t.sent).code?(n=[],e.data.forEach((function(t){var e={companyName:t.company,companyNo:t.companyNo,year:"合计",noAddrOrderNum:0,waitSendOrderNum:0,noSignOrderNum:0,noDzCgdNumComon:0,noDzCgdNum:0,dzNoPayCgdNumCom:0,dzNoPayCgdNum:0,dzNoInvCgdNumCom:0,dzNoInvCgdNum:0,noPayQrdTobNum:0,noPayQrdTocNum:0,noInvQrdTobNum:0,noInvQrdTocNum:0,noSignOrderNoExpressNum:0,noSignOrderExpressNum:0,noSignOrderFailNum:0},a=["companyName","companyNo","year"],o=Object.keys(e).filter((function(t){return!a.includes(t)}));t.data.forEach((function(a){o.forEach((function(t){e[t]=Number(Aa(Number(a[t]).toFixed(2),Number(e[t]).toFixed(2)))})),n.push(Ya({companyName:t.company,companyNo:t.companyNo},a))})),n.push(e)})),this.orderNums=n):this.$message.warning(e.message);case 4:case"end":return t.stop()}}),t,this)}))),function(){return Qa.apply(this,arguments)}),requestData:(Va=Object(c.a)(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.state.loading=!0,t.next=3,this.requestOrderNum();case 3:this.state.loading=!1;case 4:case"end":return t.stop()}}),t,this)}))),function(){return Va.apply(this,arguments)}),requestUserinfo:(Ga=Object(c.a)(regeneratorRuntime.mark((function t(){var e,n,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.state.loading=!0,e=T(),n=O("code"),t.next=5,v(Ya({},e?{openid:e}:{code:n}));case 5:a=t.sent,this.state.loading=!1,t.t0=Number(a.code),t.next=0===t.t0?10:13;break;case 10:return this.isShow=a.data.is_show.includes("9")||a.data.is_show.includes(9),this.isShow&&this.requestData(),t.abrupt("break",17);case 13:return this.state.error=!0,this.state.message=a.message,e&&N(),t.abrupt("break",17);case 17:case"end":return t.stop()}}),t,this)}))),function(){return Ga.apply(this,arguments)})}},oe=Object(o.a)(Zt,(function(){var t=this,e=t.$createElement;e=t._self._c||e;return e("div",{directives:[{name:"loading",rawName:"v-loading",value:t.state.loading,expression:"state.loading"}],staticStyle:{"min-height":"300px",padding:"10px"},attrs:{id:"app"}},[!t.state.error&&t.isShow?[e("ElTabs",[e("ElTabPane",{attrs:{label:"无地址&未发货&未签收"}},[e("CommonReporting",{attrs:{data:t.orderNums,mode:"express"}})],1),e("ElTabPane",{attrs:{label:"采购单"}},[e("CommonReporting",{attrs:{data:t.orderNums,mode:"purchaseOrder"}})],1),e("ElTabPane",{attrs:{label:"销售单"}},[e("CommonReporting",{attrs:{data:t.orderNums,mode:"saleOrder"}})],1)],1)]:t.state.loading?t._e():[e("unusual-state",{attrs:{hasPermission:t.isShow,message:t.state.message,path:"results"}})]],2)}),[],!1,null,null,null).exports,e={props:["placeholder","value","year"],data:function(){return{options:[]}},computed:{modelValue:{get:function(){return this.value},set:function(t){this.$emit("update:value",t)}}},watch:{year:{handler:function(){this.requestData()},immediate:!0}},methods:{requestData:(Wa=Object(c.a)(regeneratorRuntime.mark((function t(){var e,n,a=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,pe.users({year:this.year});case 2:n=t.sent,e=n.code,n=n.data,1===e&&(this.options=n,0===this.options.length?(this.modelValue="",this.$nextTick((function(){return a.$emit("change")}))):(this.$emit("update:value",this.options[0].uid),this.$emit("change")));case 6:case"end":return t.stop()}}),t,this)}))),function(){return Wa.apply(this,arguments)})}};function Ka(t,e){var n,a=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,n)),a}function Za(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ka(Object(n),!0).forEach((function(e){Object(l.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ka(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Ja(t,e){var n,a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=function(t,e){if(t){if("string"==typeof t)return Xa(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(n="Object"===n&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xa(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length)return a&&(t=a),n=0,{s:e=function(){},n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:e};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,r=!0,i=!1;return{s:function(){a=a.call(t)},n:function(){var t=a.next();return r=t.done,t},e:function(t){i=!0,o=t},f:function(){try{r||null==a.return||a.return()}finally{if(i)throw o}}}}function Xa(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,a=new Array(e);n<e;n++)a[n]=t[n];return a}var to,eo,no,ao,oo,ro,io,so;Ft={name:"invData",components:{PeriodDatePicker:Et,UnusualState:S,UserSelect:Object(o.a)(e,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("ElSelect",{attrs:{placeholder:t.placeholder,size:"mini",filterable:"","remote-method":t.requestData},on:{change:function(e){return t.$emit("change")}},model:{value:t.modelValue,callback:function(e){t.modelValue=e},expression:"modelValue"}},t._l(t.options,(function(t){return n("el-option",{attrs:{value:t.uid,label:t.uname}})})),1)}),[],!1,null,null,null).exports},data:function(){return{isTenThound:!1,zxTotal:0,isDisplay:!1,companies:[],monthCompanyNo:"",companyMonthLoading:!1,companyMonthDate:"",monthCompany:[],dayCompanyNo:"",companyDayLoading:!1,companyDayDate:"",dayCompany:[],monthUser:"",monthAccount:[],monthLoading:!1,monthDate:"",dayAccountLoading:!1,dayAccount:[],dayDate:"",blDayAccountLoading:!1,blDayAccount:[],blDayDate:"",state:{message:"",error:!1,loading:!1}}},mounted:function(){document.title="数据统计",this.dayDate=at()(new Date).format("YYYY-MM-DD"),this.blDayDate=at()(new Date).format("YYYY-MM-DD"),this.monthDate=at()(new Date).format("YYYY"),this.companyDayDate=at()(new Date).format("YYYY-MM-DD"),this.companyMonthDate=at()(new Date).format("YYYY"),O("code")?this.requestUserinfo():this.login()},methods:{addition:Aa,division:za,subtraction:Ia,unit2TenThousand:function(t){var e=!(1<arguments.length&&void 0!==arguments[1])||arguments[1];return"--"===t?"--":"-"===t?"-":NaN===t||"NaN"===t||0===Number(t)||void 0===t?"0":e?t<1e3&&0<t||t<0&&-1e3<t?Number(t).toFixed(2):za(t,1e4).toFixed(2)+"W":t},isNotValidNum:function(t){return NaN===Number(t)||0===Number(t)},calcBl:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=0),0===Number(e)?"--":this.isNotValidNum(t)&&this.isNotValidNum(e)?"0.00%":Number(100*za(t,e)).toFixed(2)+"%"},requestCompanyMonth:(so=Object(c.a)(regeneratorRuntime.mark((function t(){var e,n,a,o,r,i,s,l,c,u,p,d,m;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.companyMonthLoading=!0,t.next=3,pe.everyCompanMonth({year:this.companyMonthDate,companyNo:this.monthCompanyNo});case 3:if(m=t.sent,e=m.data,m=m.code,this.companyMonthLoading=!1,1===m){n=[],a=Ja(e);try{for(a.s();!(o=a.n()).done;)r=o.value,i=r.cost_tips,s=r.inv_tips,r.year,l=r.month,c=Ia(r.month_info.month_inv_fee,r.month_info.month_return_inv_fee),u=Ia(c,Ia(r.month_info.month_cost_fee,r.month_info.month_return_cost_fee)),p=this.calcBl(c,s),d=this.calcBl(u,i),n.push({month:l,invMonth:c,cost_tips:i,inv_tips:s,monthInvRate:p,costMonth:u,costMonthRate:d})}catch(t){a.e(t)}finally{a.f()}(m=n.reduce((function(t,e){return{invMonth:Aa(t.invMonth,e.invMonth),cost_tips:Aa(t.cost_tips,e.cost_tips),inv_tips:Aa(t.inv_tips,e.inv_tips),costMonth:Aa(t.costMonth,e.costMonth)}}),{invMonth:0,cost_tips:0,inv_tips:0,costMonth:0})).month="合计",m.monthInvRate=this.calcBl(m.invMonth,m.inv_tips),m.costMonthRate=this.calcBl(m.costMonth,m.cost_tips),n.push(m),this.monthCompany=n}case 8:case"end":return t.stop()}}),t,this)}))),function(){return so.apply(this,arguments)}),requestAccountMonth:(io=Object(c.a)(regeneratorRuntime.mark((function t(){var e,n,a,o,r,i,s,l,c,u;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("2025"!==this.monthDate)return this.monthAccount=[],t.abrupt("return");t.next=3;break;case 3:return this.monthAccountLoading=!0,t.next=6,pe.everyAccountMonth({year:this.monthDate,uid:this.monthUser});case 6:if(u=t.sent,e=u.data,u=u.code,this.monthAccountLoading=!1,n=[],1===u)for(a in e)s=e[a],o=s.cost_tips,r=s.inv_tips,s.month,i=Ia(s.month_inv_fee,s.month_return_inv_fee),s=Ia(i,Ia(s.month_cost_fee,s.month_return_cost_fee)),l=this.calcBl(i,r),c=this.calcBl(s,o),n.push({month:Number(a)+1,invMonth:i,cost_tips:o,inv_tips:r,monthInvRate:l,costMonth:s,costMonthRate:c});(u=n.reduce((function(t,e){return{invMonth:Aa(t.invMonth,e.invMonth),cost_tips:Aa(t.cost_tips,e.cost_tips),inv_tips:Aa(t.inv_tips,e.inv_tips),costMonth:Aa(t.costMonth,e.costMonth)}}),{invMonth:0,cost_tips:0,inv_tips:0,costMonth:0})).month="合计",u.monthInvRate=this.calcBl(u.invMonth,u.inv_tips),u.costMonthRate=this.calcBl(u.costMonth,u.cost_tips),n.push(u),this.monthAccount=n;case 19:case"end":return t.stop()}}),t,this)}))),function(){return io.apply(this,arguments)}),requestCompanyDay:(ro=Object(c.a)(regeneratorRuntime.mark((function t(){var e,n,a,o,r,i,s,l,c,u,p,d,m,h,f,_,y,b,g,v;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e={"北京百辰荣达国际科贸有限公司":"百辰","北京泓源广诚国际商贸有限公司":"泓源","北京万宇恒通国际科贸有限公司":"万宇","北京锦兴弘昌科技有限公司":"锦兴","北京普润心堂商贸有限公司":"普润","北京知事文化产业发展有限公司":"知事","北京泰文创供应链管理有限公司":"泰文创","北京元隆雅图文化传播股份有限公司":"预订单E企购","结算单E企购":"结算单E企购"},this.companyDayLoading=!0,t.next=4,pe.everyCompanyDay({daytime:this.companyDayDate});case 4:if(a=t.sent,n=a.data,a=a.code,this.companyDayLoading=!1,1===a){o=[],r=Ja(n);try{for(r.s();!(i=r.n()).done;)s=i.value,l=s.tips,c=l.cost_tips,u=l.inv_tips,p=Ia(s.dayinfo.inv_fee,s.dayinfo.return_inv_fee),d=Ia(s.month_inv_fee,s.month_return_inv_fee),m=Ia(s.month_cost_fee,s.month_return_cost_fee),h=this.calcBl(d,u),f=this.calcBl(Ia(d,m),c),this.companies.map((function(t){return t.companyNo})).includes(s.companyNo)&&o.push({companyName:e[s.companyName],invDay:p,invMonth:d,inv_tips:u,cost_tips:c,monthInvRate:h,costMonth:m,costRate:f})}catch(t){r.e(t)}finally{r.f()}for(_=o.filter((function(t){return!["预订单E企购","结算单E企购"].includes(t.companyName)})),y=[],b=function(){var t=v[g],e=_.findIndex((function(e){return e.companyName===t}));0<=e&&y.push(_[e])},g=0,v=["百辰","泓源","普润","锦兴","知事","万宇","泰文创"];g<v.length;g++)b();this.dayCompany=y}case 9:case"end":return t.stop()}}),t,this)}))),function(){return ro.apply(this,arguments)}),requestAccountDay:(oo=Object(c.a)(regeneratorRuntime.mark((function t(){var e,n,a,o,r,i,s,l,c,u,p,d,m,h,f,_,y,b,g,v;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.dayAccountLoading=!0,t.next=3,pe.everyAccountDay({daytime:this.dayDate});case 3:return n=t.sent,e=n.data,n=n.code,t.next=8,pe.accountInvList({daytime:at()(this.dayDate).format("YYYY-MM")});case 8:if(a=t.sent,this.dayAccountLoading=!1,o=[],1===n){r=Ja(e);try{for(r.s();!(i=r.n()).done;)s=i.value,l=s.tips,c=l.inv_tips,u=l.cost_tips,p=Ia(s.dayinfo.inv_fee,s.dayinfo.return_inv_fee),d=Ia(s.month_inv_fee,s.month_return_inv_fee),m=this.calcBl(s.month_inv_fee,c),h=Ia(s.month_cost_fee,s.month_return_cost_fee),f=this.calcBl(d,u),o.push({uname:s.uname,companyName:s.companyName,invDay:p,invMonth:d,inv_tips:c,invMonthRate:m,costMonthTotal:h,cost_tips:u,costMonthRate:f})}catch(t){r.e(t)}finally{r.f()}}if(1===a.code){_=Ja(a.data.list);try{for(_.s();!(y=_.n()).done;)b=y.value,g=Ia(b.inv_fee,b.return_inv_fee),v=Ia(b.cost_fee,b.return_cost_fee),o.push({uname:b.uname,companyName:b.companyName,invDay:"--",invMonth:g,inv_tips:"--",invMonthRate:"--",costMonthTotal:v,cost_tips:"--",costMonthRate:"--"})}catch(t){_.e(t)}finally{_.f()}}this.dayAccount=o;case 14:case"end":return t.stop()}}),t,this)}))),function(){return oo.apply(this,arguments)}),requestAccountDayBl:(ao=Object(c.a)(regeneratorRuntime.mark((function t(){var e,n,a,o,r,i,s,l,c,u,p,d,m,h,f;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.blDayAccountLoading=!0,t.next=3,pe.accountInvList({daytime:this.blDayDate});case 3:if(n=t.sent,e=n.data,n=n.code,this.blDayAccountLoading=!1,1===n){a=[],o=Ja(e.list);try{for(o.s();!(r=o.n()).done;)i=r.value,s=i.inv_tips,l=void 0===s?0:s,c=i.cost_tips,u=void 0===c?0:c,p=Ia(i.inv_fee,i.return_inv_fee),d=Ia(i.month_inv_fee,i.month_return_inv_fee),m=this.calcBl(i.month_inv_fee,l),h=Ia(i.month_cost_fee,i.month_return_cost_fee),f=this.calcBl(d,u),a.push({uname:i.uname,companyName:i.companyName,invDay:p,invMonth:d,inv_tips:l,invMonthRate:m,costMonthTotal:h,cost_tips:u,costMonthRate:f})}catch(t){o.e(t)}finally{o.f()}this.blDayAccount=a}case 8:case"end":return t.stop()}}),t,this)}))),function(){return ao.apply(this,arguments)}),requestData:(no=Object(c.a)(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.requestAccountDay(),this.requestAccountDayBl(),this.requestAccountMonth(),this.requestCompanyDay(),this.requestCompanyMonth();case 5:case"end":return t.stop()}}),t,this)}))),function(){return no.apply(this,arguments)}),time:(eo=Object(c.a)(regeneratorRuntime.mark((function t(e){var n,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.startTime,a=e.endTime,this.start=n||"",this.end=a||"",n=this.start,a=this.end,""!==n&&""===a||""===n&&""!==a)return this.$message.warning("时间区间不完整!"),this.date=[],t.abrupt("return");t.next=8;break;case 8:this.start&&this.end?this.date=[this.start+" 00:00:00",this.end+" 23:59:59"]:this.date=[this.start,this.end];case 9:case"end":return t.stop()}}),t,this)}))),function(t){return eo.apply(this,arguments)}),requestUserinfo:(to=Object(c.a)(regeneratorRuntime.mark((function t(){var e,n,a,o,r,i,l,c,u,p;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.state.loading=!0,e=T(),n=O("code"),t.next=5,v(Za({},e?{openid:e}:{code:n}));case 5:a=t.sent,o={"北京百辰荣达国际科贸有限公司":"百辰","北京泓源广诚国际商贸有限公司":"泓源","北京万宇恒通国际科贸有限公司":"万宇","北京锦兴弘昌科技有限公司":"锦兴","北京普润心堂商贸有限公司":"普润","北京知事文化产业发展有限公司":"知事","北京泰文创供应链管理有限公司":"泰文创","北京元隆雅图文化传播股份有限公司":"预订单E企购","结算单E企购":"结算单E企购"},r=["百辰","泓源","普润","锦兴","知事","万宇","泰文创"],this.state.loading=!1,t.t0=Number(a.code),t.next=0===t.t0?12:21;break;case 12:this.isShow=(a.data.is_show||[]).includes(10)||(a.data.is_show||[]).includes("10"),i=a.data.companyArr.reduce((function(t,e){return e.info.includes(10)||e.info.includes("10")?[].concat(Object(s.a)(t),[{companyNo:e.companyNo,companyName:e.companyName}]):t}),[]).map((function(t){return Za(Za({},t),{},{companyName:o[t.companyName]})})).filter((function(t){return!["预订单E企购","结算单E企购"].includes(t.companyName)})),l=[],c=Ja(r);try{for(p=function(){var t=u.value,e=i.findIndex((function(e){return e.companyName===t}));0<=e&&l.push(i[e])},c.s();!(u=c.n()).done;)p()}catch(t){c.e(t)}finally{c.f()}return this.companies=l,this.monthCompanyNo=this.companies[0].companyNo,this.requestData(),t.abrupt("break",25);case 21:return this.state.error=!0,this.state.message=a.message,e&&N(),t.abrupt("break",25);case 25:case"end":return t.stop()}}),t,this)}))),function(){return to.apply(this,arguments)}),login:function(){var t=encodeURIComponent("http://stat.caixiao365.com/accountsReceivable"),e="wx_"+Math.random().toString(36).substr(2,15);t="https://open.weixin.qq.com/connect/oauth2/authorize?appid=".concat(config.appId,"&redirect_uri=").concat(t,"&response_type=code&scope=").concat("snsapi_userinfo","&state=").concat(e,"#wechat_redirect");window.location.href=t}}},n("9cfa"),re=Object(o.a)(Ft,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{directives:[{name:"loading",rawName:"v-loading",value:t.state.loading,expression:"state.loading"}],staticClass:"new-report",staticStyle:{"min-height":"300px"}},[!t.state.error&&t.isShow?n("div",[n("div",{staticStyle:{color:"red",display:"flex","align-items":"center","justify-content":"space-between",width:"100%",padding:"5px 10px","box-sizing":"border-box",position:"fixed",top:"0px",left:"5px","background-color":"#fff","z-index":"1000"}},[n("el-popover",{attrs:{placement:"top-start",width:200,trigger:"hover",content:"每晚7:00更新"},scopedSlots:t._u([{key:"reference",fn:function(){return[n("i",{staticClass:"el-icon-warning-outline",staticStyle:{"font-size":"22px",cursor:"pointer"}})]},proxy:!0}],null,!1,3390336504)}),n("el-switch",{attrs:{"active-text":"万元","inactive-text":"元"},model:{value:t.isTenThound,callback:function(e){t.isTenThound=e},expression:"isTenThound"}})],1),n("div",{directives:[{name:"loading",rawName:"v-loading",value:t.dayCompanyLoading,expression:"dayCompanyLoading"}]},[n("div",{staticClass:"main-title"},[n("p",{staticClass:"title"},[t._v("业务公司维度")]),n("div",{staticStyle:{display:"flex"}},[n("ElDatePicker",{staticClass:"fr picker no-padding",staticStyle:{width:"95px",padding:"0px"},attrs:{placeholder:"日期",clearable:!1,size:"mini",datetype:"year","value-format":"yyyy-MM-dd"},on:{change:t.requestCompanyDay},model:{value:t.companyDayDate,callback:function(e){t.companyDayDate=e},expression:"companyDayDate"}})],1)]),n("el-table",{attrs:{size:"small",border:"",data:t.dayCompany}},[n("el-table-column",{attrs:{label:"业务公司",prop:"companyName",width:"70px","show-overflow-tooltip":"",fixed:"left"}}),n("el-table-column",{attrs:{label:"当日开票收入","min-width":"100px",prop:"invDay","show-overflow-tooltip":""},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.unit2TenThousand(e.row.invDay,t.isTenThound))+"\n ")]}}],null,!1,1178150849)}),n("el-table-column",{attrs:{label:"当月"}},[n("el-table-column",{attrs:{label:"开票收入目标","min-width":"100px",prop:"inv_tips","show-overflow-tooltip":""},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.unit2TenThousand(e.row.inv_tips,t.isTenThound))+"\n ")]}}],null,!1,3206311004)}),n("el-table-column",{attrs:{label:"开票收入","min-width":"80px",prop:"invMonth","show-overflow-tooltip":""},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.unit2TenThousand(e.row.invMonth,t.isTenThound))+"\n ")]}}],null,!1,2163151821)}),n("el-table-column",{attrs:{label:"开票完成比","min-width":"100px",prop:"monthInvRate","show-overflow-tooltip":""}}),n("el-table-column",{attrs:{label:"开票成本","min-width":"100px",prop:"costMonth","show-overflow-tooltip":""},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.unit2TenThousand(e.row.costMonth,t.isTenThound))+"\n ")]}}],null,!1,3200565687)}),n("el-table-column",{attrs:{label:"毛利目标","min-width":"100px",prop:"cost_tips","show-overflow-tooltip":""},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.unit2TenThousand(e.row.cost_tips,t.isTenThound))+"\n ")]}}],null,!1,2983318406)}),n("el-table-column",{attrs:{label:"毛利完成比","min-width":"90px",prop:"costRate"}})],1)],1)],1),n("div",{directives:[{name:"loading",rawName:"v-loading",value:t.dayAccountLoading,expression:"dayAccountLoading"}]},[n("div",{staticClass:"main-title"},[n("p",{staticClass:"title"},[t._v("人员维度")]),n("ElDatePicker",{staticClass:"fr picker no-padding",staticStyle:{width:"95px"},attrs:{placeholder:"日期",clearable:!1,size:"mini","value-format":"yyyy-MM-dd"},on:{change:t.requestAccountDay},model:{value:t.dayDate,callback:function(e){t.dayDate=e},expression:"dayDate"}})],1),n("el-table",{attrs:{size:"small",border:"",data:t.dayAccount}},[n("el-table-column",{attrs:{label:"人员",prop:"uname",width:"70px","show-overflow-tooltip":"",fixed:"left"}}),n("el-table-column",{attrs:{label:"当日开票收入",prop:"invDay","min-width":"100px","show-overflow-tooltip":""},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.unit2TenThousand(e.row.invDay,t.isTenThound))+"\n ")]}}],null,!1,1178150849)}),n("el-table-column",{attrs:{label:"当月"}},[n("el-table-column",{attrs:{label:"开票收入目标",prop:"inv_tips","min-width":"100px","show-overflow-tooltip":""},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.unit2TenThousand(e.row.inv_tips,t.isTenThound))+"\n ")]}}],null,!1,3206311004)}),n("el-table-column",{attrs:{label:"开票收入",prop:"invMonth","min-width":"80px","show-overflow-tooltip":""},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.unit2TenThousand(e.row.invMonth,t.isTenThound))+"\n ")]}}],null,!1,2163151821)}),n("el-table-column",{attrs:{label:"开票完成比",prop:"invMonthRate","min-width":"100px","show-overflow-tooltip":""}}),n("el-table-column",{attrs:{label:"开票成本",prop:"costMonthTotal","min-width":"80px","show-overflow-tooltip":""},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.unit2TenThousand(e.row.costMonthTotal,t.isTenThound))+"\n ")]}}],null,!1,2506736661)})],1)],1)],1),n("div",{directives:[{name:"loading",rawName:"v-loading",value:t.monthCompanyLoading,expression:"monthCompanyLoading"}]},[n("div",{staticClass:"main-title",staticStyle:{"flex-wrap":"wrap"}},[n("p",{staticClass:"title"},[t._v("年度业务公司维度")]),n("div",{staticStyle:{display:"flex"}},[n("ElSelect",{staticStyle:{width:"80px","margin-right":"10px"},attrs:{size:"mini"},on:{change:t.requestCompanyMonth},model:{value:t.monthCompanyNo,callback:function(e){t.monthCompanyNo=e},expression:"monthCompanyNo"}},t._l(t.companies,(function(t){return n("ElOption",{attrs:{label:t.companyName,value:t.companyNo}})})),1),n("ElDatePicker",{staticClass:"fr picker no-padding",staticStyle:{width:"70px"},attrs:{size:"mini",placeholder:"日期",clearable:!1,"value-format":"yyyy",type:"year"},on:{change:t.requestCompanyMonth},model:{value:t.companyMonthDate,callback:function(e){t.companyMonthDate=e},expression:"companyMonthDate"}})],1)]),n("el-table",{attrs:{size:"small",border:"",data:t.monthCompany}},[n("el-table-column",{attrs:{label:"月份",width:"50px","show-overflow-tooltip":"",prop:"month",fixed:"left"}}),n("el-table-column",{attrs:{label:"开票收入目标","min-width":"100px","show-overflow-tooltip":"",prop:"inv_tips"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.unit2TenThousand(e.row.inv_tips,t.isTenThound))+"\n ")]}}],null,!1,1491024860)}),n("el-table-column",{attrs:{label:"开票收入","min-width":"80px","show-overflow-tooltip":"",prop:"invMonth"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.unit2TenThousand(e.row.invMonth,t.isTenThound))+"\n ")]}}],null,!1,772193229)}),n("el-table-column",{attrs:{label:"开票完成比","min-width":"100px","show-overflow-tooltip":"",prop:"monthInvRate"}}),n("el-table-column",{attrs:{label:"毛利目标","min-width":"80px","show-overflow-tooltip":"",prop:"cost_tips"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.unit2TenThousand(e.row.cost_tips,t.isTenThound))+"\n ")]}}],null,!1,4225304710)}),n("el-table-column",{attrs:{label:"毛利完成","min-width":"80px","show-overflow-tooltip":"",prop:"costMonth"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.unit2TenThousand(e.row.costMonth,t.isTenThound))+"\n ")]}}],null,!1,2529900343)}),n("el-table-column",{attrs:{label:"毛利完成比","min-width":"100px","show-overflow-tooltip":"",prop:"costMonthRate"}})],1)],1),n("div",{directives:[{name:"loading",rawName:"v-loading",value:t.monthLoading,expression:"monthLoading"}],staticStyle:{"margin-top":"10px"}},[n("div",{staticClass:"main-title",staticStyle:{"flex-wrap":"wrap"}},[n("p",{staticClass:"title"},[t._v("年度业务经理维度")]),n("div",{staticStyle:{display:"flex","justify-self":"end"}},[n("UserSelect",{staticStyle:{"margin-right":"10px",width:"100px"},attrs:{value:t.monthUser,year:t.monthDate},on:{"update:value":function(e){t.monthUser=e},change:t.requestAccountMonth,clear:function(e){t.monthAccount=[]}}}),n("ElDatePicker",{staticClass:"no-padding",staticStyle:{width:"70px"},attrs:{size:"mini",placeholder:"日期",clearable:!1,"value-format":"yyyy",type:"year"},on:{change:t.requestAccountMonth},model:{value:t.monthDate,callback:function(e){t.monthDate=e},expression:"monthDate"}})],1)]),n("el-table",{attrs:{size:"small",border:"",data:t.monthAccount}},[n("el-table-column",{attrs:{label:"月份",width:"60px","show-overflow-tooltip":"",prop:"month",fixed:"left"}}),n("el-table-column",{attrs:{label:"开票收入目标","min-width":"110px","show-overflow-tooltip":"",prop:"inv_tips"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.unit2TenThousand(e.row.inv_tips,t.isTenThound))+"\n ")]}}],null,!1,1491024860)}),n("el-table-column",{attrs:{label:"开票收入","min-width":"80px","show-overflow-tooltip":"",prop:"invMonth"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.unit2TenThousand(e.row.invMonth,t.isTenThound))+"\n ")]}}],null,!1,772193229)}),n("el-table-column",{attrs:{label:"开票完成比","min-width":"100px","show-overflow-tooltip":"",prop:"monthInvRate"}}),n("el-table-column",{attrs:{label:"毛利目标","min-width":"80px","show-overflow-tooltip":"",prop:"cost_tips"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.unit2TenThousand(e.row.cost_tips,t.isTenThound))+"\n ")]}}],null,!1,4225304710)}),n("el-table-column",{attrs:{label:"毛利完成","min-width":"80px","show-overflow-tooltip":"",prop:"costMonth"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(t.unit2TenThousand(e.row.costMonth,t.isTenThound))+"\n ")]}}],null,!1,2529900343)}),n("el-table-column",{attrs:{label:"毛利完成比","min-width":"100px","show-overflow-tooltip":"",prop:"costMonthRate"}})],1)],1)]):t.state.loading?t._e():[n("unusual-state",{attrs:{hasPermission:t.isShow,message:t.state.message,path:"newReport"}})]],2)}),[],!1,null,"8e647588",null).exports,xt=new VueRouter({routes:[{path:"/",component:Tt},{path:"/report",component:Ne},{path:"/login",component:nt},{path:"/newReport",component:ce},{path:"/results",component:on},{path:"/accountsReceivable",component:U},{path:"/stock",component:ve},{path:"/newResults",component:_e},{path:"/newResultChart",component:Gt},{path:"/newResultInfo",component:wn},{path:"/newEarningReport",component:rn},{path:"/newReporting",component:oe},{path:"/newStock",component:Mt},{path:"/invData",component:re}],mode:"hash"}),xt.beforeEach((function(t,e,n){var a=O("path");"/"===t.path&&!a||"/login"===t.path||O("code")?n():n({path:"login",query:{path:a}})})),Yt=xt,n("b20f"),At=n("5c96");n("0fae"),Vue.component(At.Table.name,At.Table),Vue.component(At.Select.name,At.Select),Vue.component(At.Option.name,At.Option),Vue.component(At.DatePicker.name,At.DatePicker),Vue.use(De),Vue.use(Yt),Object.keys(a).forEach((function(t){return Vue.filter(t,a[t])})),Vue.config.productionTip=!1,window.vm=new Vue({router:Yt,render:function(t){return t(r)}}).$mount("#app")},"58c3":function(t,e,n){},"5cc3":function(t,e,n){},"5d85":function(t,e,n){"use strict";n("5037")},"5e78":function(t,e,n){},"5fca":function(t,e,n){},"60d3":function(t,e,n){},6159:function(t,e,n){},"6a48":function(t,e,n){},"6c64":function(t,e,n){"use strict";n("6a48")},"6e7a":function(t,e,n){},"729b0":function(t,e,n){"use strict";n("49c8")},"76db":function(t,e,n){"use strict";n("32e0")},"7db1":function(t,e,n){},8098:function(t,e,n){"use strict";n("d7ac")},"824d":function(t,e,n){"use strict";n("4306")},"83ac":function(t,e,n){},8600:function(t,e,n){"use strict";n("8eff")},8977:function(t,e,n){},"8bbf":function(t,e){t.exports=Vue},"8eff":function(t,e,n){},"945a":function(t,e,n){},"98bf":function(t,e,n){"use strict";n("dbb6")},"9cfa":function(t,e,n){"use strict";n("43da")},"9e93":function(t,e,n){"use strict";n("d8e3")},a0cb:function(t,e,n){"use strict";n("1af2")},a646:function(t,e,n){"use strict";n("6e7a")},ae8d:function(t,e,n){"use strict";n("d363")},b20f:function(t,e,n){},b3b9:function(t,e,n){},b945:function(t,e,n){"use strict";n("e5cc")},bd24:function(t,e,n){},bd5f:function(t,e,n){"use strict";n("5cc3")},c17f:function(t,e,n){"use strict";n("6159")},c406:function(t,e,n){},c86b:function(t,e,n){"use strict";n("5fca")},cebe:function(t,e){t.exports=axios},d168:function(t,e,n){},d187:function(t,e,n){"use strict";n("d168")},d363:function(t,e,n){},d7ac:function(t,e,n){},d8e3:function(t,e,n){},dbb6:function(t,e,n){},e282:function(t,e,n){"use strict";n("5e78")},e5cc:function(t,e,n){},e80c:function(t,e,n){"use strict";n("8977")},f121:function(t,e,n){n=n("f1e0"),t.exports=n},f1e0:function(t,e){t.exports={title:"业绩报表",baseApi:"http://inv.sitw.wanyuhengtong.com/",cxApi:"http://stock.api.wanyuhengtong.com/",fileURL:"https://api2.edu.futurelab.tv",appId:"wxfa1f1a0211edf630",redirect:"http://depart.test241.wanyuhengtong.com/",reportApi:"http://cxinv.api.caixiao365.com/",newReportApi:"http://stock.api.caixiao365.com/",ding:{CorpId:"dingc78fa4301e1a424a35c2f4657eb6378f",AgentId:"1184953963"}}},f9a4:function(t,e,n){"use strict";n("58c3")},ff67:function(t,e,n){}},[[0,"runtime","chunk-elementUI","chunk-libs"]]]);
|