webpackJsonp([111],{kryv:function(e,t){},txZy:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=r("Dd8w"),n=r.n(a),o=r("Xxa5"),s=r.n(o),i=r("exGp"),m=r.n(i),l=r("1fzb"),d=r("znzC"),c=r("P9l9"),u={components:{setActCode:l.default,SelectClerk:d.default},data:function(){return{loading:!1,form:{hmType:1,name:"",clerkIdList:[],hmUserNum:null},multiple:!1,data:[],dataArr:[],clerkDisabled:!1}},created:function(){this.$route.query.hmId&&this.getActCodeInfo()},methods:{changeEvent:function(e){this.data=[],this.dataArr=[],2==e?(this.multiple=!0,this.clerkDisabled=!1):1==e&&(this.multiple=!1)},onChange:function(e){var t=this;this.data=e,this.form.hmUserNum=e.length,this.form.clerkIdList=e.map(function(e){return e.clerkId}),this.dataArr=e.map(function(e){return e.clerkName}),""==this.form.name&&(this.form.name=this.dataArr.toString()),this.$nextTick(function(){t.$refs.setActCodePage.getForm().validateField(["name","clerkIdList"])})},getActCodeInfo:function(){var e=this;return m()(s.a.mark(function t(){var r;return s.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if((r=e).loading=!0,!e.$route.query.hmId){t.next=5;break}return t.next=5,Object(c.b)("/haoban-manage3-web/hm/qrcode/detail",{hmId:e.$route.query.hmId}).then(function(t){e.form=t.data.result,e.form.clerkIdList=e.form.clerkList.map(function(e){return e.clerkId}),e.form.hmUserNum=e.form.clerkIdList.length,e.data=t.data.result.clerkList,1==e.form.hmType?(e.clerkDisabled=!0,e.multiple=!1):2==e.form.hmType&&(e.multiple=!0,e.clerkDisabled=!1),r.loading=!1});case 5:case"end":return t.stop()}},t,e)}))()},onSubmit:function(e){var t=this;return m()(s.a.mark(function r(){var a;return s.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if((a=n()({},e,t.form)).passFlag=a.passFlag?1:0,!t.$route.query.hmId){r.next=8;break}return a=n()({},a,{hmId:t.$route.query.hmId}),r.next=6,Object(c.f)("/haoban-manage3-web/hm/qrcode/update",a).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,t.form={hmType:1,name:"",clerkIdList:[],hmUserNum:null}},1e3)});case 6:r.next=10;break;case 8:return r.next=10,Object(c.f)("/haoban-manage3-web/hm/qrcode/add",a).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.$route.meta.refresh=!0,t.$refs.setActCodePage.btnLoading=!1,t.$refs.setActCodePage.saveLoading=!1,t.$router.go(-1),t.form={hmType:1,name:"",clerkIdList:[],hmUserNum:null}},1e3)});case 10:case"end":return r.stop()}},r,t)}))()}}},f={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.$route.query.hmId},on:{change:e.changeEvent},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:"clerkIdList",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:e.multiple,data:e.data,disabled:e.clerkDisabled},on:{change:e.onChange}})],1)]},proxy:!0}])})],1)},staticRenderFns:[]};var h=r("VU/8")(u,f,!1,function(e){r("kryv")},"data-v-20d0ff8c",null);t.default=h.exports}});