webpackJsonp([5],{LQEP:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=r("aA9S"),o=r.n(a),i=r("4YfN"),s=r.n(i),l=r("AKaA"),n=r("NTL1"),m=r("SJI6"),u=r("8V46"),c={name:"substoreDialog",props:{dialogVisible:{type:Boolean,default:!1},multipleList:{type:Array,default:function(){return[]}},gradeList:{type:Array,default:function(){return[]}},pageSize:{type:Number,default:""},memberSearchStr:{type:Number,default:""},phoneNameCard:{type:String,default:""},pageName:{type:String,default:""}},data:function(){return{form:{remark:"",optType:2,subOptType:1,fromSubStoreIds:[]},rules:{fromSubStoreIds:[{required:!0,message:"请选择要操作的协管门店",trigger:"change"}],remark:[{required:!0,message:"请输入原因备注",trigger:"change"}]},pageParam:{loading:!1,searchName:"",currentPage:1,pageSize:20,totalPage:1},subStoreList:[],btnLoading:!1}},computed:s()({},Object(m.mapState)(["showEditClique"])),methods:{cancel:function(){this.$refs.form.resetFields(),this.$emit("update:dialogVisible",!1)},getOnlineStore:function(){var e=this,t=this.pageParam,r=t.searchName,a=t.currentPage,o=t.loading,i=t.totalPage;o||a>=i||(this.pageParam.loading=!0,Object(l.c)(n.a.getOnlineStore,{currentPage:a+1,pageSize:20,searchName:r}).then(function(t){var r=t.data||{},o=r.errorCode,i=r.message,s=r.result;0==o?(e.subStoreList=e.subStoreList.concat(s.list||[]),e.pageParam.totalPage=s.page.totalPage||1,e.pageParam.currentPage=a+1):Object(u.a)(i)}).finally(function(){return e.pageParam.loading=!1}))},getSubStoreList:function(e){this.pageParam.searchName=e,this.pageParam.currentPage=0,this.subStoreList=[],this.getOnlineStore()},submit:function(){var e=this;this.$refs.form.validate(function(t){if(!t)return!1;e.btnLoading=!0;var r=[];e.multipleList.forEach(function(e){r.push(e.memberId)}),Object(l.a)(n.a.updateStore,o()({},e.form,{fromSubStoreIds:e.form.fromSubStoreIds.join(","),memberIds:1==e.selectAll?"-1":r.join(","),isCurrent:1==e.selectAll?2:e.multipleList.length==e.pageSize?1:0,memberSearchParamStr:1==e.selectAll?e.memberSearchStr?e.memberSearchStr:"-1":"",phoneNameCard:e.phoneNameCard,pageName:e.pageName})).then(function(t){0===t.data.errorCode?setTimeout(function(){e.btnLoading=!1,Object(u.c)(),e.$refs.form.resetFields(),e.$emit("update:dialogVisible",!1),e.$emit("refresh")},4500):(Object(u.a)(),e.btnLoading=!1)}).catch(function(t){e.btnLoading=!1,Object(u.b)(t)})})}}},d={render:function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",[r("el-dialog",{attrs:{title:"批量修改协管门店","custom-class":"customer-dailog",visible:e.dialogVisible,"close-on-click-modal":!1,width:"600px"},on:{"update:visible":function(t){e.dialogVisible=t},close:e.cancel}},[r("div",{staticClass:"checkedCustomers"},[e._v("当前选中"),r("span",{staticClass:"num"},[e._v(" "+e._s(e.multipleList.length)+" ")]),e._v("位客户")]),e._v(" "),r("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"133px"}},[r("el-form-item",{attrs:{label:"协管门店：",prop:"fromSubStoreIds"}},[r("el-form-item",{staticStyle:{"margin-bottom":"12px"},attrs:{prop:"subOptType"}},[r("el-radio-group",{model:{value:e.form.subOptType,callback:function(t){e.$set(e.form,"subOptType",t)},expression:"form.subOptType"}},[r("el-radio",{attrs:{label:1}},[e._v("增加")]),e._v(" "),r("el-radio",{attrs:{label:2}},[e._v("减少")])],1)],1),e._v(" "),r("el-form-item",{attrs:{prop:"fromSubStoreIds"}},[r("el-select",{directives:[{name:"select-loadmore",rawName:"v-select-loadmore",value:e.getOnlineStore,expression:"getOnlineStore"}],staticClass:"fromSubStoreIds-select",staticStyle:{width:"384px"},attrs:{filterable:"",remote:"",multiple:"","remote-method":e.getSubStoreList,placeholder:"请输入请输入门店名称/门店code"},on:{"visible-change":function(t){return t?e.getSubStoreList():""}},model:{value:e.form.fromSubStoreIds,callback:function(t){e.$set(e.form,"fromSubStoreIds",t)},expression:"form.fromSubStoreIds"}},[e._l(e.subStoreList,function(e){return r("el-option",{key:e.storeId,attrs:{label:e.storeName,value:e.storeId}})}),e._v(" "),e.loading?r("el-option",{staticClass:"loadmore-loading"},[r("i",{directives:[{name:"loading",rawName:"v-loading",value:!0,expression:"true"}],staticClass:"loading-icon"}),e._v(" 加载中...\n            ")]):e._e()],2)],1)],1),e._v(" "),r("el-form-item",{attrs:{label:"原因备注：",prop:"remark"}},[r("el-input",{staticStyle:{width:"386px"},attrs:{type:"text",maxlength:"20","show-word-limit":""},model:{value:e.form.remark,callback:function(t){e.$set(e.form,"remark",t)},expression:"form.remark"}})],1)],1),e._v(" "),r("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[r("el-button",{on:{click:e.cancel}},[e._v("取 消")]),e._v(" "),r("el-button",{attrs:{type:"primary",loading:e.btnLoading},on:{click:e.submit}},[e._v("确 定")])],1)],1)],1)},staticRenderFns:[]};var p=r("C7Lr")(c,d,!1,function(e){r("nQBJ"),r("pTGb")},"data-v-c2c872ac",null);t.default=p.exports},nQBJ:function(e,t){},pTGb:function(e,t){}});