webpackJsonp([37],{"/F8/":function(e,t){},KVjP:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a("woOf"),o=a.n(r),s=a("Dd8w"),i=a.n(s),n=a("AKaA"),l=a("NTL1"),c=a("SJI6"),m=a("8V46"),d={name:"CustomermainstoreDialog",props:{dialogVisible:{type:Boolean,default:!1},obj:{type:Object,default:function(){return{}}}},data:function(){return{visible:!1,form:{memberId:"",subStoreIdsBak:"",storeIds:[],remark:"",optType:2},rules:{subStoreId:[{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:i()({},Object(c.mapState)(["showEditClique"])),watch:{dialogVisible:function(e,t){if(this.visible=e,e){var a=this.obj,r=a.shopNames,s=a.memberId,i=(r=r||[]).map(function(e){return e.storeId});this.subStoreList=[].concat(r),this.form=o()({},this.form,{memberId:s,storeIds:i,subStoreIdsBak:i.join(",")})}}},methods:{cancel:function(){this.$refs.form.resetFields(),this.$emit("update:dialogVisible",!1)},getOnlineStore:function(){var e=this,t=this.pageParam,a=t.searchName,r=t.currentPage,o=t.loading,s=t.totalPage;o||r>=s||(this.pageParam.loading=!0,Object(n.c)(l.a.getOnlineStore,{currentPage:r+1,pageSize:20,searchName:a}).then(function(t){var a=t.data||{},o=a.errorCode,s=a.message,i=a.result;0==o?(e.subStoreList=e.subStoreList.concat(i.list||[]),e.pageParam.totalPage=i.page.totalPage||1,e.pageParam.currentPage=r+1):Object(m.a)(s)}).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,Object(n.a)(l.a.updateMemberStore,o()({},e.form,{storeIds:e.form.storeIds.join(",")})).then(function(t){0===t.data.errorCode?setTimeout(function(){e.btnLoading=!1,Object(m.c)(),e.$refs.form.resetFields(),e.$emit("update:dialogVisible",!1),e.$emit("refresh")},4500):(Object(m.a)(),e.btnLoading=!1)}).catch(function(t){e.btnLoading=!1,Object(m.b)(t)})})}}},u={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("el-dialog",{attrs:{title:"修改协管门店","custom-class":"customer-dialog",visible:e.visible,"close-on-click-modal":!1,width:"600px"},on:{"update:visible":function(t){e.visible=t},close:e.cancel}},[a("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"133px"}},[a("el-form-item",{attrs:{label:"协管门店：",prop:"fromSubStoreIds"}},[a("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","popper-class":"option-wrap"},on:{"visible-change":function(t){return t?e.getSubStoreList():""}},model:{value:e.form.storeIds,callback:function(t){e.$set(e.form,"storeIds",t)},expression:"form.storeIds"}},[e._l(e.subStoreList,function(t){return a("el-option",{key:t.storeId,attrs:{label:t.storeName,value:t.storeId}},[a("p",{staticClass:"name"},[e._v("\n              "+e._s(t.storeName)+"\n            ")]),e._v(" "),a("p",{staticClass:"code"},[e._v("\n              "+e._s(t.storeCode)+"\n            ")])])}),e._v(" "),e.loading?a("el-option",{staticClass:"loadmore-loading"},[a("i",{directives:[{name:"loading",rawName:"v-loading",value:!0,expression:"true"}],staticClass:"loading-icon"}),e._v(" 加载中...\n          ")]):e._e()],2)],1),e._v(" "),a("el-form-item",{attrs:{label:"原因备注：",prop:"remark"}},[a("el-input",{staticStyle:{width:"386px"},attrs:{type:"text",maxlength:"20","show-word-limit":"",placeholder:"请输入内容"},model:{value:e.form.remark,callback:function(t){e.$set(e.form,"remark",t)},expression:"form.remark"}})],1)],1),e._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:e.cancel}},[e._v("取消")]),e._v(" "),a("el-button",{attrs:{type:"primary",loading:e.btnLoading},on:{click:e.submit}},[e._v("确定")])],1)],1)],1)},staticRenderFns:[]};var g=a("VU/8")(d,u,!1,function(e){a("/F8/")},null,null);t.default=g.exports}});