webpackJsonp([90],{"76mw":function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=a("Gu7T"),s=a.n(i),n=a("//Fk"),r=a.n(n),o=(a("I4j4"),a("7fQT")),l=(a("g+tI"),a("NLod")),c=(a("LlGJ"),a("Wtz3")),u=(a("3Lne"),a("SSsa")),d=a("7+uW"),v=a("dVvq"),_=a("YcGw"),p=a("PJh5"),h=a.n(p);d.a.use(o.a).use(l.a).use(c.a).use(u.a);var m={components:{YearMonthPicker:v.a,StatisticsMonthTotal:_.a},name:"statistics_personal_a",data:function(){var t=this.$route.query.month;return{loading:!0,date_value:t||h()().format("YYYY-MM"),chartLine:null,statisticsData:[{label:"本月A分",value:0},{label:"年度A分",value:0},{label:"累计A分",value:0}],currentAPointEvents:[],employee_id:null,currentAPointEvents2:[]}},watch:{date_value:function(){this.get_data()}},computed:{hasData:function(){return!this.loading&&(!this.currentAPointEvents||0===this.currentAPointEvents.length)}},methods:{viewRanking:function(){this.$router.push({name:"integral_rank"})},initEChartOption:function(){this.option={tooltip:{trigger:"axis",formatter:function(t){return"月份:"+(t=t[0]).name+"
分值:"+t.value},axisPointer:{animation:!1},show:!0},grid:{containLabel:!0,top:"4%",right:"4%",bottom:"5%",left:"7%"},xAxis:{type:"category",boundaryGap:!1,axisLine:{lineStyle:{color:"#eee"}},axisLabel:{color:"#333"}},yAxis:{position:"right",axisLine:{lineStyle:{color:"#eee"}},axisLabel:{color:"#333"},type:"value",splitLine:{lineStyle:{color:"#eee"}}},series:{type:"line",lineStyle:{normal:{color:"#26A2FF"}}}}},get_data:function(){var t=this;this.$toast.loading({message:"正在加载"}),this.loading=!0;var e,a=h()(this.date_value).format("MM"),i=h()(this.date_value).format("YYYY");if(a>=6)e=i+"-0"+(a-5).toString();else{switch(i--,a-5){case 0:a=12;break;case-1:a=11;break;case-2:a=10;break;case-3:a="0"+9..toString();break;case-4:a="0"+8..toString()}e=i+"-"+a}var n=this.$axiosUser("get","/api/pro/integral/statistics/a",{employee_id:this.employee_id,start_date:e,end_date:this.date_value,show_type:"2"},"v2"),o=this.$axiosUser("get","/api/pro/integral/statistics",{employee_id:this.employee_id,month:this.date_value},"v3"),l=this.$axiosUser("get","/api/pro/integral/statistics",{employee_id:this.employee_id,year:h()(this.date_value).format("YYYY")},"v3"),c=this.$axiosUser("get","api/pro/integral/statistics/a",{employee_id:this.employee_id,start_date:h()(this.date_value).startOf("month").format("YYYY-MM-DD"),end_date:h()(this.date_value).endOf("month").format("YYYY-MM-DD"),show_type:"1"},"v2");r.a.all([n,o,l,c]).then(function(e){var a=[{label:"本月A分",value:0},{label:"年度A分",value:0},{label:"累计A分",value:0}];if(1==e[0].data.code){var i=[],n=e[0].data.data,r=n.chart,o=n.good,l=n.bad,c=r.reward.map(function(t,e){return i.push(t.date),t.point+(-r.deduction[e].point||0)});o.push.apply(o,s()(l)),t.setEChartOption(i,c)}if(1==e[1].data.code){var u=e[1].data.data,d=h()(t.date_value).format("M"),v=h()(t.date_value).format("yyyy");a=[{label:d+"月A分",value:u.a},{label:v+"年A分",value:u.a_total},{label:"累计A分",value:u.a_total}]}if(1==e[2].data.code){var _=e[2].data.data;a[1].value=_.a}if(1==e[3].data.code){var p=e[3].data.data,m=(p.chart,p.good),f=p.bad;t.currentAPointEvents=m,t.currentAPointEvents2=f}t.statisticsData=a}).finally(function(){t.loading=!1,t.$toast.clear()})},setEChartOption:function(t,e){this.option.xAxis.data=t,this.option.series.data=e,this.chartLine.setOption(this.option)}},mounted:function(){this.employee_id=this.$route.query.employee_id||this.$userInfo().id,this.get_data(),this.initEChartOption(),this.chartLine=this.$echarts.init(document.getElementById("chartLineBox"))}},f={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"statistics_personal_a_box"},[a("van-nav-bar",{attrs:{title:"我的A分统计","left-text":"返回","left-arrow":""},on:{"click-left":t.$route_back}}),t._v(" "),a("div",{staticClass:"body_com"},[a("scroller",[a("div",{staticClass:"person_a_box"},[a("YearMonthPicker",{model:{value:t.date_value,callback:function(e){t.date_value=e},expression:"date_value"}}),t._v(" "),a("StatisticsMonthTotal",{attrs:{data:t.statisticsData}})],1),t._v(" "),a("van-cell-group",{staticStyle:{margin:"0"}},[a("van-cell",{staticClass:"a-point__wrapper"},[a("div",{staticClass:"a-point-title",staticStyle:{"margin-top":"0.52rem"},attrs:{slot:"title"},slot:"title"},[t._v("近半年的A分")])]),t._v(" "),a("div",{attrs:{slot:"default"},slot:"default"},[a("div",{staticStyle:{height:"3.6rem"},attrs:{id:"chartLineBox"}})])],1),t._v(" "),a("van-cell-group",[a("van-cell",{staticClass:"b-point__wrapper",staticStyle:{"border-bottom":"0.02rem solid #ebedf0"}},[a("div",{staticClass:"a-point-title",attrs:{slot:"title"},slot:"title"},[t._v(t._s(t.$moment(this.date_value).format("M"))+"月奖分最多")])]),t._v(" "),t._l(t.currentAPointEvents,function(e,i){return a("div",{key:i,staticClass:"current-event__item",on:{click:function(a){return t.$router.push({name:"event_detail",query:{id:e.id}})}}},[""!=e.remark.customize?a("div",{staticClass:"current-event_content"},[t._v(t._s(e.remark.customize))]):a("div",{staticClass:"current-event_content"},[t._v(t._s(e.remark.rule))]),t._v(" "),a("div",{staticClass:"current-event_value"},[e.point>=0?a("span",[t._v("+"+t._s(e.point))]):a("span",{staticClass:"green"},[t._v(t._s(e.point))])])])}),t._v(" "),0==t.currentAPointEvents.length?a("van-empty",{attrs:{description:"当月没有A分事件"}}):t._e()],2),t._v(" "),a("van-cell-group",[a("van-cell",{staticClass:"b-point__wrapper",staticStyle:{"border-bottom":"0.02rem solid #ebedf0"}},[a("div",{staticClass:"a-point-title",attrs:{slot:"title"},slot:"title"},[t._v(t._s(t.$moment(this.date_value).format("M"))+"月扣分最多")])]),t._v(" "),t._l(t.currentAPointEvents2,function(e,i){return a("div",{key:i,staticClass:"current-event__item",on:{click:function(a){return t.$router.push({name:"event_detail",query:{id:e.id}})}}},[""!=e.remark.customize?a("div",{staticClass:"current-event_content"},[t._v(t._s(e.remark.customize))]):a("div",{staticClass:"current-event_content"},[t._v(t._s(e.remark.rule))]),t._v(" "),a("div",{staticClass:"current-event_value"},[e.point>=0?a("span",[t._v("+"+t._s(e.point))]):a("span",{staticClass:"green"},[t._v(t._s(e.point))])])])}),t._v(" "),0==t.currentAPointEvents2.length?a("van-empty",{attrs:{description:"当月没有A分事件"}}):t._e()],2)],1)],1)],1)},staticRenderFns:[]};var y=a("VU/8")(m,f,!1,function(t){a("MstC")},"data-v-7154c0b9",null);e.default=y.exports},MstC:function(t,e){}});