17.c9193d3d17e1df42f770.js 6.6 KB

1
  1. webpackJsonp([17],{"1alW":function(e,t,a){var i=a("kM2E");i(i.S,"Number",{isInteger:a("AKgy")})},"3pOe":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=a("RRo+"),n=a.n(i),o=a("Gu7T"),r=a.n(o),s=a("lHA8"),c=a.n(s),l=(a("dKK0"),a("balU")),d=(a("PEgo"),a("HNZ3")),u=a("vLgD"),m=a("PJh5"),_=a.n(m),p=a("7+uW"),f=a("EUN7"),v=a("CC1l");p.a.use(l.a).use(d.a);var h={name:"efficiency_task_edit",data:function(){return{package_id:0,title:"修改绩效工作",include_self:!1,currentDate:new Date,show_date:!1,datetime:"",performance_ex:!1,executor_scope:[],employee_list:[],implement:0,reviewed_score:[],reviewed:[],score:"",inspector:[],notice_ids:"",minDate:new Date,sheet_show:!1,actions:[{name:"修改绩效"}]}},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}this.get_info()},components:{EmployeeSelectorCell:f.a,EmployeeSelector:v.a},watch:{implement:function(e){this.get_performance_info()},datetime:function(e){this.get_performance_info()}},methods:{get_info:function(){var e=this;e.showLoading(),u.a.get("/api/integral/performance/info",{params:{employee_id:this.$route.query.employee_id,month:this.$route.query.month}}).then(function(t){e.$toast.clear(),"1"==t.data.code?(e.score=t.data.data.base_point,e.package_id=t.data.data.id,e.employee_list=[{id:t.data.data.employee_id,name:t.data.data.employee_name,img_url:t.data.data.employee_img_url}],e.reviewed_score=e.$store.getters.employee_map[t.data.data.employee_id].superior_list,e.reviewed=[{id:t.data.data.reviewer_id,name:t.data.data.reviewer_name,img_url:t.data.data.reviewer_img_url}],e.inspector=t.data.data.notice_info):e.$toast(t.data.msg)}).catch(function(e){})},sheet_select:function(e,t){"修改绩效"==e.name&&this.post_data()},intersection:function(e){var t=[],a=new c.a;return e.forEach(function(e){t.push(new c.a(e.map(function(e){return e.id}))),e.forEach(function(e){return a.add(e.id)})}),[].concat(r()(a)).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;u.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=_()(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;for(var t in e.notice_ids=[],e.inspector)e.notice_ids.push(e.inspector[t].id);var a={package_id:e.package_id,base_point:e.score,reviewer_id:e.reviewed[0].id,notice_ids:e.notice_ids,type:2};e.showLoading(),Object(u.a)({url:"/api/integral/performance",method:"put",data:a}).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.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:"请输入月平衡分"})})}}},g={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"efficiency_task_box"},[a("van-nav-bar",{attrs:{title:e.title,"left-text":"返回","left-arrow":""},on:{"click-left":e.$route_back}}),e._v(" "),a("div",{staticClass:"body_com has_header"},[a("scroller",{ref:"my_scroller"},[a("van-cell-group",[a("div",{staticClass:"tip",attrs:{slot:"title"},slot:"title"},[e._v("任务按预期完成可得月平衡分,最终得分根据实际情况上下浮动")]),e._v(" "),a("van-field",{attrs:{required:"",label:"月平衡分",name:"月平衡分",type:"Number",placeholder:"请输入分值"},model:{value:e.score,callback:function(t){e.score=t},expression:"score"}})],1),e._v(" "),a("van-cell-group",[a("div",{staticClass:"tip",attrs:{slot:"title"},slot:"title"},[e._v("建议部门经理或人事主管作为月绩效评审人")]),e._v(" "),a("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(" "),a("van-cell-group",[a("div",{staticClass:"tip",attrs:{slot:"title"},slot:"title"},[e._v("监察员可查看此员工的月绩效,参与月终的绩效评审")]),e._v(" "),a("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(" "),a("div",{staticStyle:{padding:"0.32rem"}},[a("van-button",{attrs:{type:"info",block:""},on:{click:e.sava_btn}},[e._v("保存")])],1)],1),e._v(" "),a("van-popup",{attrs:{position:"bottom"},model:{value:e.show_date,callback:function(t){e.show_date=t},expression:"show_date"}},[a("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 y=a("VU/8")(h,g,!1,function(e){a("fhJ4")},"data-v-37a83e2c",null);t.default=y.exports},AKgy:function(e,t,a){var i=a("EqjI"),n=Math.floor;e.exports=function(e){return!i(e)&&isFinite(e)&&n(e)===e}},"RRo+":function(e,t,a){e.exports={default:a("c45H"),__esModule:!0}},c45H:function(e,t,a){a("1alW"),e.exports=a("FeBl").Number.isInteger},fhJ4:function(e,t){}});