36.9160da36f12bfb6c5920.js 10 KB

1
  1. webpackJsonp([36],{Awf0:function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});i("1O2T");var a=i("sXqm"),n=(i("3gWi"),i("ZxCb")),s=(i("NjV0"),i("dq/I")),o=(i("LlGJ"),i("Wtz3")),r=i("aEz7"),l=i("mrPP"),_=i("EUN7"),d=i("SjT7"),c=i("//BC"),m=i("vLgD"),u=i("7+uW");u.a.use(o.a),u.a.use(s.a),u.a.use(n.a),u.a.use(a.a);var p={name:"performance",components:{Mtextarea:l.a,EmployeeSelectorCell:_.a,RuleCategorySelectorCell:d.a,CategorySelectorCell:c.a,NumberInput:r.a},data:function(){return{pt_code:"",select_cate:!1,item_name:"",ticket_count:!1,cate_list:[],item_info:{},item_list:[],item_show:!1,can_edit_rule:!0,types_list:{},rule_list:[],rule_name:"",data:{review_id:0,action:"complete",rule_id:0,item_id:0,point:0,reviewer_id:0,remark:"",ticket_count:0},reviewer:[]}},methods:{item_del:function(){for(var t in this.item_show=!1,this.item_list)this.$set(this.item_list[t],"checked",!1);this.item_info={},this.data.point=0,this.data.item_id=0},item_confirm:function(t,e){for(var i in this.item_show=!1,this.item_list)this.$set(this.item_list[i],"checked",!1);this.item_info=t,this.data.point=t.min_point,this.data.item_id=t.id,this.$set(this.item_list[e],"checked",!0)},get_items:function(t){for(var e in this.item_info={},t)t[e].checked||(t[e].checked=!1);for(var i in this.item_list=t,t)this.data.item_id==t[i].id&&this.item_confirm(t[i],i)},showLoading:function(){this.$toast.loading({loadingType:"spinner",message:"正在处理"})},get_point_types:function(){for(var t in this.$store.getters.point_types)this.types_list[this.$store.getters.point_types[t].id]=this.$store.getters.point_types[t].name},choseItem:function(){""==this.item_name?this.item_show=!0:this.item_show=!1},get_data:function(){var t=this;this.$toast.loading({message:"正在加载"}),Object(m.a)({url:"/api/integral/review",method:"get",params:{review_id:this.data.review_id}}).then(function(e){t.data.item_id=e.data.data.item_id,t.data.point=e.data.data.point,t.item_name=e.data.data.item_name,t.pointTypeId=e.data.data.pt_id,e.data.data.pt_id>0&&(t.pt_code=e.data.data.pt_code),e.data.data.rule_id>0&&(t.cate_list=[{id:e.data.data.rule_id,name:e.data.data.rule_name}],t.can_edit_rule=!1,t.rule_name=e.data.data.rule_name)}).catch(function(t){return console.error(t)}).finally(function(){return t.$toast.clear()})},send:function(){var t=this;0!==this.data.point?this.validatePointPermission([this.data],this.pointTypeId,function(e){e?t.$notify({type:"danger",message:e.message}):(t.send_loading=!0,t.$toast.loading({message:"正在处理"}),Object(m.a)({url:"/api/integral/review",method:"post",data:t.data}).then(function(e){t.send_loading=!1,t.$toast.clear(),1==e.data.code?(t.$toast.success(e.data.msg),t.$keep_alive_update("update_approval_detail",t.data),t.$keep_alive_update("update_approval_list",t.data),setTimeout(function(){t.$route_back()},500)):(t.$toast(e.data.msg),t.$keep_alive_update("withdraw_apply",t.data))}).catch(function(e){t.send_loading=!1,t.$toast.clear()}))}):this.$toast("积分不能为0")},sava_btn:function(){var t=this;t.$validator.validate().then(function(e){e?t.send():t.$notify({type:"danger",message:t.$validator.errors.items[0].msg})})},validatePointPermission:function(t,e,i){var a=this.$store.getters.user_info,n=a.point_config,s=n.point_limit.findIndex(function(t){return t.pt_id===e});if(s<0||1===a.is_creator)i();else{var o=parseInt(n.point_limit[s].point);if(-1===o)i();else 0===a.site_config.rule_limit_check?this.validateRuleLimit(t,i,function(t){return t.point>o&&t.reviewer_id<=0}):this.validateRuleLimit(t,i,function(t){return 0===t.item_id&&t.point>o})}},validateRuleLimit:function(t,e,i){if("function"!=typeof e)throw new TypeError("callback is not a function");t.every(function(t,a){return!i(t,a)||(e(0===a?new Error("输入分值超出权限,请选择审批人递交"):new Error("第"+(a+1)+"条输入分值超出权限,请选择审批人递交")),!1)})&&e()}},watch:{select_cate:function(t){this.item_list=[],this.cate_list=[]},item_list:function(t){0==t.length?(this.data.item_id=0,this.data.rule_id=0,this.item_info={}):(this.data.point=t[0].min_point,this.data.rule_id=t[0].rule_id,this.data.item_id=t[0].id,this.item_info=t[0])},ticket_count:function(t){this.data.ticket_count=t?1:0},cate_list:function(t){0==t.length?this.data.rule_id=0:this.data.rule_id=t[0].id},rule_list:function(t,e){0==t.length?(this.data.item_id=0,this.data.rule_id=0):(this.data.rule_id=t[0].rule_id,this.data.item_id=t[0].id)},reviewer:function(t,e){0==t.length?this.data.reviewer_id=0:this.data.reviewer_id=t[0].id}},created:function(){this.$route.query.review_id&&(this.data.review_id=this.$route.query.review_id),this.get_point_types(),this.get_data()}},v={render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[i("van-nav-bar",{attrs:{title:"审批","left-text":"返回","left-arrow":""},on:{"click-left":t.$route_back}}),t._v(" "),i("div",{staticClass:"body_com has_header"},[i("scroller",[i("van-cell-group",[t.can_edit_rule?i("van-cell",{attrs:{title:"指定规则"}},[i("template",{slot:"right-icon"},[i("van-switch",{attrs:{size:"24"},model:{value:t.select_cate,callback:function(e){t.select_cate=e},expression:"select_cate"}})],1)],2):t._e(),t._v(" "),t.can_edit_rule&&!t.select_cate?i("CategorySelectorCell",{directives:[{name:"validate",rawName:"v-validate",value:"required",expression:"'required'"}],ref:"cate_selector",attrs:{title:"选择分类",name:"分类",max:1,multi:!1,required:""},model:{value:t.cate_list,callback:function(e){t.cate_list=e},expression:"cate_list"}}):t._e(),t._v(" "),i("van-cell",{directives:[{name:"show",rawName:"v-show",value:!t.can_edit_rule,expression:"!can_edit_rule"}],attrs:{title:"分类",value:t.rule_name}}),t._v(" "),t.can_edit_rule&&t.select_cate?i("RuleCategorySelectorCell",{attrs:{pt_code:t.pt_code,multi:!1,title:"选择规则"},model:{value:t.item_list,callback:function(e){t.item_list=e},expression:"item_list"}}):t._e(),t._v(" "),t.item_info.rule_id&&t.item_list.length>0?i("van-cell",{attrs:{title:t.item_info.remark}},[i("template",{slot:"label"},[t.item_info.min_point<0?i("span",{staticClass:"record color_green"},[t._v(t._s(1==t.item_info.range_type?t.item_info.min_point:t.item_info.min_point+"~"+t.item_info.max_point))]):t._e(),t._v(" "),t.item_info.min_point>0?i("span",{staticClass:"record color_red"},[t._v("+ "+t._s(1==t.item_info.range_type?t.item_info.min_point:t.item_info.min_point+"~"+t.item_info.max_point))]):t._e(),t._v(" "),i("span",{staticClass:"type"},[t._v(t._s(t.types_list[t.item_info.pt_id]))])])],2):t._e()],1),t._v(" "),i("van-cell-group",[i("NumberInput",{directives:[{name:"show",rawName:"v-show",value:t.item_info.rule_id&&1==t.item_info.range_type,expression:"item_info.rule_id && item_info.range_type == 1"},{name:"validate",rawName:"v-validate",value:"required",expression:"'required'"}],attrs:{title:"积分",min:t.item_info.min_point,max:t.item_info.min_point,required:"",name:"积分"},model:{value:t.data.point,callback:function(e){t.$set(t.data,"point",e)},expression:"data.point"}}),t._v(" "),i("NumberInput",{directives:[{name:"show",rawName:"v-show",value:t.item_info.rule_id&&2==t.item_info.range_type,expression:"item_info.rule_id && item_info.range_type == 2"},{name:"validate",rawName:"v-validate",value:"required",expression:"'required'"}],attrs:{title:"积分",min:t.item_info.min_point,max:t.item_info.max_point,required:"",name:"积分"},model:{value:t.data.point,callback:function(e){t.$set(t.data,"point",e)},expression:"data.point"}}),t._v(" "),i("NumberInput",{directives:[{name:"show",rawName:"v-show",value:!t.item_info.rule_id,expression:"!item_info.rule_id"},{name:"validate",rawName:"v-validate",value:"required",expression:"'required'"}],attrs:{title:"积分",required:"",name:"积分"},model:{value:t.data.point,callback:function(e){t.$set(t.data,"point",e)},expression:"data.point"}})],1),t._v(" "),i("van-cell-group",[i("div",{staticClass:"tip",attrs:{slot:"title"},slot:"title"},[t._v("奖票多用于优秀表现和重要事项的表彰\n ")]),t._v(" "),i("van-cell",{attrs:{center:"",title:"发放奖票"},scopedSlots:t._u([{key:"right-icon",fn:function(){return[i("van-switch",{attrs:{size:"24"},model:{value:t.ticket_count,callback:function(e){t.ticket_count=e},expression:"ticket_count"}})]},proxy:!0}])})],1),t._v(" "),i("van-cell-group",[i("EmployeeSelectorCell",{attrs:{title:"递交审批",multi:!1},model:{value:t.reviewer,callback:function(e){t.reviewer=e},expression:"reviewer"}})],1),t._v(" "),i("van-cell-group",[i("van-cell",[i("Mtextarea",{attrs:{placeholder:"填写意见(选填)"},model:{value:t.data.remark,callback:function(e){t.$set(t.data,"remark",e)},expression:"data.remark"}})],1)],1),t._v(" "),i("div",{staticStyle:{padding:"0.32rem"}},[i("van-button",{attrs:{size:"large",type:"info"},on:{click:t.sava_btn}},[t._v("提交")])],1)],1)],1),t._v(" "),i("van-popup",{attrs:{position:"bottom",closeable:""},model:{value:t.item_show,callback:function(e){t.item_show=e},expression:"item_show"}},[i("div",{staticStyle:{padding:"0.32rem"}},[t._v("选择规则")]),t._v(" "),i("van-cell-group",{directives:[{name:"show",rawName:"v-show",value:t.item_list.length>0,expression:"item_list.length > 0"}]},t._l(t.item_list,function(e,a){return i("van-cell",{key:a,attrs:{title:e.remark},on:{click:function(i){return t.item_confirm(e,a)}}},[i("template",{slot:"label"},[e.min_point<0?i("span",{staticClass:"record color_green"},[t._v(t._s(1==e.range_type?e.min_point:e.min_point+"~"+e.max_point))]):t._e(),t._v(" "),e.min_point>0?i("span",{staticClass:"record color_red"},[t._v("+ "+t._s(1==e.range_type?e.min_point:e.min_point+"~"+e.max_point))]):t._e(),t._v(" "),i("span",{staticClass:"type"},[t._v(t._s(t.types_list[e.pt_id].name))])]),t._v(" "),i("template",{slot:"icon"},[i("van-checkbox",{staticStyle:{"margin-right":"0.16rem"},model:{value:e.checked,callback:function(i){t.$set(e,"checked",i)},expression:"item.checked"}})],1)],2)}),1),t._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:0==t.item_list.length,expression:"item_list.length == 0"}],staticStyle:{padding:"0.32rem","text-align":"center","font-size":"0.32rem",color:"#999"}},[t._v("\n 当前分类没有规则可选\n ")])],1)],1)},staticRenderFns:[]};var h=i("VU/8")(p,v,!1,function(t){i("CJvb")},"data-v-eba7d950",null);e.default=h.exports},CJvb:function(t,e){}});