webpackJsonp([16],{"1alW":function(e,t,i){var a=i("kM2E");a(a.S,"Number",{isInteger:i("AKgy")})},A4bU:function(e,t){},AKgy:function(e,t,i){var a=i("EqjI"),n=Math.floor;e.exports=function(e){return!a(e)&&isFinite(e)&&n(e)===e}},"RRo+":function(e,t,i){e.exports={default:i("c45H"),__esModule:!0}},Xu4Q:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=i("RRo+"),n=i.n(a),o=i("Gu7T"),r=i.n(o),s=i("lHA8"),l=i.n(s),c=(i("dKK0"),i("balU")),d=i("vLgD"),m=i("PJh5"),u=i.n(m),_=i("7+uW"),p=i("EUN7"),f=i("CC1l");_.a.use(c.a);var v={name:"efficiency_task",data:function(){return{title:"发布绩效",include_self:!1,currentDate:new Date,show_date:!1,datetime:u()().month(u()().month()+1).startOf("month").format("YYYY-MM"),performance_ex:!1,executor_scope:[],employee_list:[],implement:0,reviewed_score:[],reviewed:[],score:"",inspector:[],notice_ids:"",minDate:new Date}},mounted:function(){if(this.$route.query.target_id){var e=this.$store.getters.employee_map[this.$route.query.target_id];e&&(""==e.img_url&&(e.img_url="static/images/defalut_custmer_headicon.png"),this.employee_list=[e],this.implement=this.$route.query.target_id)}if(this.$store.getters.user_info.employee_detail.manage_scope.length>0&&(this.executor_scope=this.$store.getters.user_info.employee_detail.manage_scope),this.$route.query.package_date){var t=this.$route.query.package_date;this.datetime=t}},components:{EmployeeSelectorCell:p.a,EmployeeSelector:f.a},watch:{implement:function(e){this.get_performance_info()},datetime:function(e){this.get_performance_info()},employee_list:function(e,t){0==e.length?this.implement=0:(this.implement=e[0].id,this.reviewed_score=this.$store.getters.employee_map[this.implement].superior_list)},reviewed_score:function(e){e.length>0&&(this.reviewed=[e[0]])},inspector:function(e){var t=this;0==e.length?this.inspector="":(this.notice_ids="",e.forEach(function(e){t.notice_ids+=e.id+","}))}},methods:{tipsMsg:function(){this.$dialog.alert({message:"为了保证分值的完整准确性,绩效分仅支持输入100的倍数"}).then(function(){})},intersection:function(e){var t=[],i=new l.a;return e.forEach(function(e){t.push(new l.a(e.map(function(e){return e.id}))),e.forEach(function(e){return i.add(e.id)})}),[].concat(r()(i)).filter(function(e){return t.every(function(t){return t.has(e)})})},get_performance_info:function(){var e=this;if(0==e.implement||""==e.datetime)return!1;d.a.get("/api/integral/performance/info",{params:{employee_id:e.implement,month:e.datetime}}).then(function(t){"1"==t.data.code&&(t.data.data.id>0?(e.performance_ex=!0,e.$dialog.confirm({confirmButtonText:"去看看",message:e.employee_list[0].name+e.datetime.substring(e.datetime.length-2,e.datetime.length)+"已有绩效,前去看看?"}).then(function(){e.efficiency_detail()})):e.performance_ex=!1)}).catch(function(e){})},showLoading:function(){this.$toast.loading({loadingType:"spinner",message:"正在处理"})},formatter:function(e,t){return"year"===e?t+"年":"month"===e?t+"月":t},datetime_confirm:function(e){this.show_date=!1,this.datetime=u()(e).format("YYYY-MM")},datetime_cancel:function(){this.show_date=!1},post_data:function(){var e=this;if(this.score%100>0)return this.$toast("月平衡分请输入100的倍数"),!1;if(this.score<1)return this.$toast("分值不能为0,不能为负"),!1;var t={employee_id:e.implement,month:e.datetime,base_point:e.score,reviewer_id:e.reviewed[0].id,notice_ids:e.notice_ids};e.showLoading(),Object(d.a)({url:"/api/integral/performance",method:"post",data:t}).then(function(t){1==t.data.code?(e.$toast.clear(),e.$toast.success(t.data.msg),e.$keep_alive_update("efficiency_detail_update",{}),setTimeout(function(){e.$route_back()},500)):(e.$toast.clear(),e.$toast(t.data.msg))}).catch(function(t){e.$toast.clear()})},sava_btn:function(){var e=this;e.$validator.validate().then(function(t){""==e.datetime?e.$notify({type:"danger",message:"请选择月份绩效"}):e.implement?e.score?!1===n()(Number(e.score))?e.$notify({type:"danger",message:"月平衡分必须是整数"}):0==e.reviewed.length?e.$notify({type:"danger",message:"请选择审核人"}):e.post_data():e.$notify({type:"danger",message:"请输入月平衡分"}):e.$notify({type:"danger",message:"请选择执行人"})})},efficiency_detail:function(){this.$router.push({name:"efficiency_detail",query:{date:this.datetime,employee_id:this.implement}})}}},h={render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"efficiency_task_box"},[i("van-nav-bar",{attrs:{title:e.title,"left-text":"返回","left-arrow":""},on:{"click-left":e.$route_back}}),e._v(" "),i("div",{staticClass:"body_com has_header"},[i("scroller",{ref:"my_scroller"},[i("van-cell-group",[i("van-cell",{attrs:{required:"",title:"月份绩效","is-link":"",value:e.datetime},on:{click:function(t){e.show_date=!0}}})],1),e._v(" "),i("van-cell-group",[e.performance_ex?i("div",{staticClass:"tip red",attrs:{slot:"title"},slot:"title"},[e._v(e._s(e.datetime)+"已有绩效,"),i("span",{on:{click:e.efficiency_detail}},[e._v("去查看")])]):e._e(),e._v(" "),i("EmployeeSelectorCell",{directives:[{name:"validate",rawName:"v-validate",value:"required",expression:"'required'"}],attrs:{bar_title:"选择执行人",required:"",title:"执行人",use_employee_list:"",employee_list:e.executor_scope,include_self:!1,multi:!1},model:{value:e.employee_list,callback:function(t){e.employee_list=t},expression:"employee_list"}})],1),e._v(" "),i("van-cell-group",[i("div",{staticClass:"tip",attrs:{slot:"title"},slot:"title"},[e._v("任务按预期完成可得月平衡分,最终得分根据实际情况上下浮动")]),e._v(" "),i("van-field",{attrs:{required:"",label:"月平衡分",name:"月平衡分",type:"Number","right-icon":"warning-o",placeholder:"请输入分值"},on:{"click-right-icon":e.tipsMsg},model:{value:e.score,callback:function(t){e.score=t},expression:"score"}})],1),e._v(" "),i("van-cell-group",[i("div",{staticClass:"tip",attrs:{slot:"title"},slot:"title"},[e._v("建议部门经理或人事主管作为月绩效评审人")]),e._v(" "),i("EmployeeSelectorCell",{directives:[{name:"validate",rawName:"v-validate",value:"required",expression:"'required'"}],attrs:{"bar-title":"选择审核人",required:"",title:"审核人",use_employee_list:"",employee_list:e.reviewed_score,multi:!1},model:{value:e.reviewed,callback:function(t){e.reviewed=t},expression:"reviewed"}})],1),e._v(" "),i("van-cell-group",[i("div",{staticClass:"tip",attrs:{slot:"title"},slot:"title"},[e._v("监察员可查看此员工的月绩效,参与月终的绩效评审")]),e._v(" "),i("EmployeeSelectorCell",{attrs:{title:"监察员",bar_title:"选择监察员",can_select_dept:!1,max:10,dept_multi:!1},model:{value:e.inspector,callback:function(t){e.inspector=t},expression:"inspector"}})],1),e._v(" "),i("div",{staticStyle:{padding:"0.32rem"}},[i("van-button",{attrs:{type:"info",block:""},on:{click:e.sava_btn}},[e._v("发布")])],1)],1),e._v(" "),i("van-popup",{attrs:{position:"bottom"},model:{value:e.show_date,callback:function(t){e.show_date=t},expression:"show_date"}},[i("van-datetime-picker",{attrs:{type:"year-month","min-date":e.minDate,formatter:e.formatter},on:{confirm:e.datetime_confirm,cancel:e.datetime_cancel},model:{value:e.currentDate,callback:function(t){e.currentDate=t},expression:"currentDate"}})],1)],1)],1)},staticRenderFns:[]};var g=i("VU/8")(v,h,!1,function(e){i("A4bU")},"data-v-6838e56a",null);t.default=g.exports},c45H:function(e,t,i){i("1alW"),e.exports=i("FeBl").Number.isInteger}});