webpackJsonp([87],{XWVN: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"),m=r.n(o),s=r("exGp"),i=r.n(s),u=r("1fzb"),l=r("znzC"),d=r("P9l9"),c={components:{setActCode:u.default,SelectClerk:l.default},data:function(){return{loading:!1,form:{hmType:1,name:"",clerkIdList:[],hmUserNum:null},multiple:!1,data:[],dataArr:[],detailCode:[]}},created:function(){this.$route.query.hmId&&this.getActCodeInfo()},methods:{changeEvent:function(e){this.data=[],this.dataArr=[],2==e?this.multiple=!0:1==e&&(this.multiple=!1)},onChange:function(e){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())},getActCodeInfo:function(){var e=this;return i()(m.a.mark(function t(){var r;return m.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(d.b)("/haoban-manage3-web/hm/qrcode/detail",{hmId:e.$route.query.hmId}).then(function(t){e.detailCode=t.data.result,e.form.hmType=e.detailCode.hmType,e.form.name=e.detailCode.name,e.form.clerkIdList=e.detailCode.clerkList.map(function(e){return e.clerkId}),e.form.hmUserNum=e.form.clerkIdList.length,e.data=e.detailCode.clerkList,r.loading=!1});case 5:case"end":return t.stop()}},t,e)}))()},onSubmit:function(e){var t=this;return i()(m.a.mark(function r(){var a;return m.a.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(a=n()({},e,t.form),!t.$route.query.hmId){r.next=7;break}return a=n()({},a,{hmId:t.$route.query.hmId}),r.next=5,Object(d.f)("/haoban-manage3-web/hm/qrcode/update",a).then(function(e){if(0!=e.data.code)return t.$message.error(e.data.message);t.form={hmType:1,name:"",clerkIdList:[],hmUserNum:null},t.$router.go(-1)});case 5:r.next=9;break;case 7:return r.next=9,Object(d.f)("/haoban-manage3-web/hm/qrcode/add",a).then(function(e){if(0!=e.data.code)return t.$message.error(e.data.message);t.form={hmType:1,name:"",clerkIdList:[],hmUserNum:null},t.$router.go(-1)});case 9: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",{attrs:{actCodeData:e.detailCode},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",{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:"活码名称",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:"使用成员",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:{multiple:e.multiple,data:e.data},on:{change:e.onChange}})],1)]},proxy:!0}])})],1)},staticRenderFns:[]};var h=r("VU/8")(c,f,!1,function(e){r("XWVN")},"data-v-590fccc2",null);t.default=h.exports}});