106.e8955b30603eea6646cd.1706754571694+.js 2.4 KB

1
  1. webpackJsonp([106],{E85R:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a("mvHQ"),i=a.n(r),n=a("xD3r"),l=a("NzR9"),d={name:"rule_category_add",components:{CategorySelectorCell:n.a,DeptSelectorCell:l.a},data:function(){return{data:{name:"",pid:0,cycle_type:1},rule_cate:[],depts:[],dep_ids:[]}},watch:{rule_cate:function(e){e.length>0?this.data.pid=e[0].id:this.data.pid=0},depts:function(e){e.length>0&&(this.dep_ids=e.map(function(e){return e.dept_id}))}},methods:{data_verify:function(){var e=this;e.$validator.validateAll().then(function(t){t?e.send():e.$notify({type:"danger",message:e.$validator.errors.items[0].msg})})},send:function(){var e=this;e.send_loading=!0,e.$toast.loading({message:"正在处理"}),this.dep_ids.length>0&&(e.data.dep_ids=i()(this.dep_ids)),this.$axiosUser("post","/api/pro/integral/rule",e.data).then(function(t){e.send_loading=!1,e.$toast.clear(),1==t.data.code?(e.$toast("创建成功"),setTimeout(function(){e.$route_back()},500)):e.$toast(t.data.msg)}).catch(function(t){e.send_loading=!1,e.$toast.clear()})}},created:function(){var e=this;this.$route.query.rule_id&&this.$nextTick(function(){e.rule_cate=[{id:1*e.$route.query.rule_id,name:e.$route.query.rule_name}]})}},s={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"rule_category_add_box"},[a("van-nav-bar",{attrs:{title:"创建积分分类","left-text":"返回","left-arrow":"","right-text":"保存"},on:{"click-left":e.$route_back,"click-right":e.data_verify}}),e._v(" "),a("div",{staticClass:"body_com has_header"},[a("scroller",[a("van-cell-group",[a("van-field",{directives:[{name:"validate",rawName:"v-validate",value:"required|max:10",expression:"'required|max:10'"}],attrs:{label:"分类名称",name:"名称",placeholder:"请输入名称",required:"",maxlength:"10","show-word-limit":""},model:{value:e.data.name,callback:function(t){e.$set(e.data,"name",t)},expression:"data.name"}})],1),e._v(" "),a("van-cell-group",[a("CategorySelectorCell",{attrs:{title:"选择父级分类",max:2,multi:!1},model:{value:e.rule_cate,callback:function(t){e.rule_cate=t},expression:"rule_cate"}})],1),e._v(" "),a("van-cell-group",[a("DeptSelectorCell",{attrs:{title:"可见范围",multi:!1},model:{value:e.depts,callback:function(t){e.depts=t},expression:"depts"}})],1)],1)],1)],1)},staticRenderFns:[]};var o=a("VU/8")(d,s,!1,function(e){a("gmwv")},"data-v-5dbfcdfa",null);t.default=o.exports},gmwv:function(e,t){}});