1 |
- webpackJsonp([41],{VCC0:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});a("g+tI");var i=a("NLod"),s=(a("I4j4"),a("7fQT")),n=(a("LlGJ"),a("Wtz3")),o=a("XLwt"),r=a.n(o),l=a("vLgD"),c=a("7+uW"),v=a("eeE/"),_=a("4tEJ"),u=a("PJh5"),p=a.n(u);c.a.use(i.a).use(s.a).use(n.a);var d={name:"statistics_personal",data:function(){var t=this.$route.query.month;return{date_value:t||p()().format("YYYY-MM"),chartLine:null,outstandingList:null,promotionList:null,statisticsData:[{label:"月平衡分",value:0},{label:"最终得分",value:0},{label:"任务数",value:0}],employee_id:null}},components:{YearMonthPicker:v.a,StatisticsMonthTotal:_.a},watch:{date_value:function(){this.get_data()}},methods:{initEChartOption:function(){this.option={tooltip:{trigger:"axis",formatter:function(t){return"月份:"+(t=t[0]).name+" </br> 分值:"+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.employee_id?(this.employee_id,this.date_value):(this.$store.getters.user_info.id,this.date_value),Object(l.a)({url:"/api/integral/statistics/performance",method:"get",params:{employee_id:this.$store.getters.user_info.id,month:this.date_value}}).then(function(e){if(1==e.data.code){var a=[],i=e.data.data,s=i.chart,n=i.performance,o=i.works,r=s.map(function(t,e){return a.push(t.month),100*t.scale});t.outstandingList=o.good,t.promotionList=o.bad,t.statisticsData[0].value=n.base_point,t.statisticsData[1].value=n.review_point,t.statisticsData[2].value=n.work_count,t.setEChartOption(a,r)}}).catch(function(t){}).finally(function(){return t.$toast.clear()})},setEChartOption:function(t,e){this.option.xAxis.data=t,this.option.series.data=e,this.chartLine.setOption(this.option)},calculateOverWork:function(t,e){return"string"==typeof t&&(t=parseFloat(t)),"string"==typeof e&&(e=parseFloat(e)),100*(e/t-1)},calculateBalanceWork:function(t,e){return"string"==typeof t&&(t=parseFloat(t)),"string"==typeof e&&(e=parseFloat(e)),100*(1-e/t)}},mounted:function(){this.$route.query.employee_id&&(this.employee_id=this.$route.query.employee_id),this.get_data(),this.initEChartOption(),this.chartLine=r.a.init(document.getElementById("chartLineBox"))}},h={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"statistics_personal_box"},[a("van-nav-bar",{attrs:{title:"我的绩效统计","left-text":"返回","left-arrow":""},on:{"click-left":t.$route_back}}),t._v(" "),a("div",{staticClass:"body_com has_header"},[a("scroller",[a("div",{staticClass:"person_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:"personal-point__wrapper"},[a("div",{staticClass:"personal-point-title",staticStyle:{"margin-top":"0.52rem"},attrs:{slot:"title"},slot:"title"},[t._v("近半年的绩效")]),t._v(" "),a("div",{staticClass:"personal-point-subtitle"},[t._v("达成率%")])]),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:"personal-point__wrapper",staticStyle:{"border-bottom":"0.02rem solid #ebedf0"}},[a("div",{staticClass:"personal-point-title",attrs:{slot:"title"},slot:"title"},[t._v("表现出色")])]),t._v(" "),t._l(t.outstandingList,function(e,i){return a("div",{key:i,staticClass:"current-event__item"},[a("div",{staticClass:"event-content__wrap"},[a("div",{staticClass:"current-event_content"},[t._v(t._s(e.task_name))]),t._v(" "),a("div",{staticClass:"current-event_value"},[t._v("+"+t._s(e.review_point))])]),t._v(" "),a("div",{staticClass:"event-sub__content"},[a("span",[t._v("任务完成")]),t._v(" "),a("span",{staticClass:"event-sub_value"},[t._v("超额"+t._s((e.review_point/e.base_point*1*100-100).toFixed(2))+"%")])])])}),t._v(" "),Array.isArray(t.outstandingList)&&0!==t.outstandingList.length?t._e():a("van-empty",{attrs:{description:"没有表现出色的绩效,要加把劲"}})],2),t._v(" "),a("van-cell-group",[a("van-cell",{staticClass:"personal-point__wrapper",staticStyle:{"border-bottom":"0.02rem solid #ebedf0"}},[a("div",{staticClass:"personal-point-title",attrs:{slot:"title"},slot:"title"},[t._v("有待提升")])]),t._v(" "),t._l(t.promotionList,function(e,i){return a("div",{key:i,staticClass:"current-event__item"},[a("div",{staticClass:"event-content__wrap"},[a("div",{staticClass:"current-event_content"},[t._v(t._s(e.task_name))]),t._v(" "),a("div",{staticClass:"current-event_value"},[t._v("+"+t._s(e.review_point))])]),t._v(" "),a("div",{staticClass:"event-sub__content"},[a("span",[t._v("任务完成")]),t._v(" "),a("span",{staticClass:"event-sub_value"},[t._v("差额"+t._s(t.calculateBalanceWork(e.base_point,e.review_point))+"%")])])])}),t._v(" "),Array.isArray(t.promotionList)&&0!==t.promotionList.length?t._e():a("van-empty",{attrs:{description:"真棒,没有待提升的绩效"}})],2)],1)],1)],1)},staticRenderFns:[]};var m=a("VU/8")(d,h,!1,function(t){a("xqiP")},"data-v-d3901b80",null);e.default=m.exports},xqiP:function(t,e){}});
|