(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2c2f450b"],{"970e":function(t,e,n){"use strict";n.r(e);var s=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ids-comp-tenants-income-analysis"},[e("div",{staticStyle:{"margin-top":"10px","border-top":"1px solid #CCCCCC"}}),e("div",{staticClass:"contentText",staticStyle:{height:"25px"}},[e("div",{staticClass:"thisYear",attrs:{id:"tenantsIncomeAnalysis_thisYear"},on:{click:t.tenantsIncomeAnalysisThisYear}},[t._v("今年")]),e("div",{staticClass:"lastYear",attrs:{id:"tenantsIncomeAnalysis_lastYear"},on:{click:t.tenantsIncomeAnalysisLastYear}},[t._v("去年")])]),e("div",{staticStyle:{height:"160px"},attrs:{id:"tenantsIncomeAnalysis"}}),e("div",{staticStyle:{"font-family":"PingFangSC-Medium","font-size":"16px",color:"#1F1F1F","text-align":"center"}},[t._v(t._s(t.title))])])},a=[],i=n("313e"),o=n.n(i),r=n("4532"),c=n("aed0"),l={name:"IDS-CompTenantsIncomeAnalysis",props:{title:String,default:"厂商回款分析"},data:function(){return{tenantsList:[],chart:null,timeLimit:"thisYear",legend:[],series:[],months:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"]}},created:function(){console.log("调试代码"),this.tenantsList=r["a"].vm.getBossAllTenants()},mounted:function(){$("#tenantsIncomeAnalysis_thisYear").css({"border-bottom":"2px solid deepskyblue"}),$("#tenantsIncomeAnalysis_lastYear").css({"border-bottom":"none"}),this.initChart()},beforeDestroy:function(){this.chart.dispose(),this.chart=null},methods:{tenantsIncomeAnalysisThisYear:function(){$("#tenantsIncomeAnalysis_thisYear").css({"border-bottom":"2px solid deepskyblue"}),$("#tenantsIncomeAnalysis_lastYear").css({"border-bottom":"none"}),this.timeLimit="thisYear",this.refreshData()},tenantsIncomeAnalysisLastYear:function(){$("#tenantsIncomeAnalysis_thisYear").css({"border-bottom":"none"}),$("#tenantsIncomeAnalysis_lastYear").css({"border-bottom":"2px solid deepskyblue"}),this.timeLimit="lastYear",this.refreshData()},initChart:function(){this.chart=o.a.init(document.getElementById("tenantsIncomeAnalysis"),"macarons"),this.refreshData()},refreshData:function(){var t=this,e=this.tenantsList.map((function(t){return t.tenant_id})),n={tenants:e.join(","),timeLimit:this.timeLimit};r["a"].vm.fetchBossTenantsIncomeAnalysis({authorization:{Authorization:"Bearer "+r["a"].vm.getUserToken()},data:n,vm:r["a"].vm}).then((function(){var e,n,s,a,i,o=r["a"].vm.getBossTenantsIncomeAnalysis(),c=(new Date).getMonth();for("lastYear"===t.timeLimit&&(c=11),t.series=[],t.legend=[],e=0;e<o.length;e++){i=[];var l=t.tenantsList.find((function(t){return t.tenant_id===o[e].tenant_id}));for(o[e].tenant_name=l.tenant_name,n=0;n<=c;n++)i[n]=0;for(n=0;n<o[e].value.length;n++)a=o[e].value[n].date,s=parseInt(a.substr(a.length-2,2)),i[s-1]=o[e].value[n].value;t.legend[e]=o[e].tenant_name,t.series[e]={name:o[e].tenant_name,type:"line",smooth:!0,stock:o[e].tenant_id,data:i}}t.setOptions()})).catch((function(t){t.type="error",t.prefix="boss:",c["a"].showTips(n.vm,t)}))},setOptions:function(){this.chart.clear(),this.chart.setOption({tooltip:{trigger:"axis",axisPointer:{type:"shadow"},formatter:function(t,e,n){for(var s="",a=0;a<t.length;a++){var i=t[a],o=i.name,r=i.value,c=i.seriesName,l='<i style="display:inline-block;width:10px;height:10px;background:'+i.color+';margin-right: 5px;border-radius: 50%;}"></i> ';0===a&&(s+=o+"<br/>"),s+=l+c+"："+r+" 万元<br/>"}return s}},legend:{top:"7%",data:this.legend},grid:{top:"30%",left:"4%",right:"4%",bottom:"3%",containLabel:!0},xAxis:{type:"category",boundaryGap:!1,data:this.months},yAxis:{type:"value"},series:this.series})}}},m=l,d=(n("d6da"),n("2877")),h=Object(d["a"])(m,s,a,!1,null,"a82b5b64",null);e["default"]=h.exports},bdac:function(t,e,n){},d6da:function(t,e,n){"use strict";n("bdac")}}]);