webpackJsonp([83],{"6GLP":function(e,t){},txZy:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=r("Dd8w"),a=r.n(o),n=r("1fzb"),s=r("znzC"),m=r("P9l9"),i={components:{setActCode:n.default,SelectClerk:s.default},data:function(){return{loading:!1,form:{hmId:"",hmGroupId:"",passFlag:1,welcomeId:"",hmType:1,name:"",memberLabelId:"",memberLabelName:"",memberLabelStatus:-1,clerkList:[],welcomeType:1,hmUserNum:null}}},created:function(){this.$route.query.hmId&&(this.form.hmId=this.$route.query.hmId,this.getActCodeInfo())},methods:{onTypeChange:function(){this.form.name="",this.form.clerkList=[],this.form.hmUserNum=0},onChange:function(e){var t=this;this.form.hmUserNum=e.length,this.form.clerkList=e,""==this.form.name&&(this.form.name=e.map(function(e){return e.clerkName}).toString().slice(0,20)),this.$nextTick(function(){t.$refs.setActCodePage.getForm().validateField(["name","clerkList"])})},getActCodeInfo:function(){var e=this;this.loading=!0,Object(m.b)("/haoban-manage3-web/hm/qrcode/detail",{hmId:this.form.hmId}).then(function(t){e.form=t.data.result,e.form.welcomeId?e.form.welcomeType=1:e.form.welcomeType=2,e.form.hmUserNum=e.form.clerkList.length}).finally(function(){return e.loading=!1})},onSubmit:function(e){var t=this,r=a()({},e,this.form);r.clerkIdList=r.clerkList.map(function(e){return e.clerkId}),this.form.hmId?Object(m.f)("/haoban-manage3-web/hm/qrcode/update",r).then(function(e){if(0!=e.data.code)return t.$refs.setActCodePage.btnLoading=!1,t.$refs.setActCodePage.saveLoading=!1,t.$message.error(e.data.message);setTimeout(function(){t.$router.go(-1),t.$refs.setActCodePage.btnLoading=!1,t.$refs.setActCodePage.saveLoading=!1},1e3)}):Object(m.f)("/haoban-manage3-web/hm/qrcode/add",r).then(function(e){if(0!=e.data.code)return t.$refs.setActCodePage.btnLoading=!1,t.$refs.setActCodePage.saveLoading=!1,t.$message.error(e.data.message);setTimeout(function(){t.$refs.setActCodePage.btnLoading=!1,t.$refs.setActCodePage.saveLoading=!1,t.$router.go(-1)},1e3)})}}},l={render:function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",[r("setActCode",{ref:"setActCodePage",attrs:{actCodeData:e.form},on:{sumbit:e.onSubmit},scopedSlots:e._u([{key:"typeCode",fn:function(){return[r("el-form-item",{attrs:{label:"活码类型",rules:[{required:!0,message:"请选择活码类型",trigger:"blur"}]}},[r("el-radio-group",{attrs:{disabled:!!e.form.hmId},on:{change:e.onTypeChange},model:{value:e.form.hmType,callback:function(t){e.$set(e.form,"hmType",t)},expression:"form.hmType"}},[r("el-radio",{attrs:{label:1}},[e._v("单人活码")]),e._v(" "),r("el-radio",{attrs:{label:2}},[e._v("多人活码")])],1)],1)]},proxy:!0},{key:"codeName",fn:function(){return[r("el-form-item",{attrs:{label:"活码名称",prop:"name",rules:[{required:!0,message:"请输入活码名称",trigger:"blur"}]}},[r("el-input",{staticClass:"w340",attrs:{placeholder:"请输入活码名称，默认使用成员名称",maxlength:"20","show-word-limit":""},model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1)]},proxy:!0},{key:"member",fn:function(){return[r("el-form-item",{attrs:{label:"关联导购",prop:"clerkList",rules:[{required:!0,message:"请选择使用成员",trigger:"blur"}]}},[1==e.form.hmType?r("p",{staticClass:"tabs"},[e._v("单人活码仅可选择一名成员")]):e._e(),e._v(" "),2==e.form.hmType?r("p",{staticClass:"tabs"},[e._v("若选择多名成员，则随机分配企微员工")]):e._e(),e._v(" "),r("select-clerk",{attrs:{"is-simple":1==e.form.hmType,multiple:2==e.form.hmType,data:e.form.clerkList,disabled:1==e.form.hmType&&!!e.form.hmId},on:{change:e.onChange}})],1)]},proxy:!0}])})],1)},staticRenderFns:[]};var c=r("VU/8")(i,l,!1,function(e){r("6GLP")},"data-v-69e10189",null);t.default=c.exports}});