webpackJsonp([51],{FSpY:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=r("woOf"),o=r.n(a),i=r("Dd8w"),n=r.n(i),s=r("AKaA"),l=r("NTL1"),c=r("SJI6"),m=r("8V46"),d={name:"CustomermainstoreDialog",props:{dialogVisible:{type:Boolean,default:!1},obj:{type:Object,default:function(){return{}}}},data:function(){return{visible:!1,form:{mainStoreIdBak:"",mainStoreId:"",mainClerkId:"",remark:"",optType:1},rules:{mainStoreId:[{required:!0,message:"请选择服务门店",trigger:"change"}],mainClerkId:[{required:!0,message:"请选择专属导购",trigger:"change"}],remark:[{required:!0,message:"请输入原因备注",trigger:"change"}]},mainstoreList:[],clerkOptions:[],loading:!1,btnLoading:!1}},computed:n()({},Object(c.mapState)(["showEditClique"])),watch:{dialogVisible:function(e,t){if(this.visible=e,e){var r=this.obj,a=r.memberId,i=r.mainStoreName,n=r.mainStoreId,s=r.mainClerkId,l=r.clerkInStore;this.form=o()({},this.form,{memberId:a,mainStoreId:n,mainClerkId:0===l?"":s,mainStoreIdBak:n}),n&&(this.getMainStoreCodeName(i),this.getClerckList(n,!0))}}},methods:{cancel:function(){this.$refs.form.resetFields(),this.$emit("update:dialogVisible",!1)},getMainStoreCodeName:function(e){var t=this;this.loading=!0,Object(s.c)(l.a.storeCodeName,{searchParam:e,flag:1}).then(function(e){0===e.data.errorCode?t.mainstoreList=e.data.result:Object(m.a)(e.data.message)}).catch(function(e){Object(m.b)(e)}).finally(function(e){return t.loading=!1})},getClerckList:function(e,t){var r=this;t||(this.form.mainClerkId=""),this.clerkOptions=[],Object(s.b)(l.a.getClerkList,{storeId:e,requestProject:"member"}).then(function(e){var t=e.data||{},a=t.errorCode,o=t.message,i=t.result,n=void 0===i?[]:i;if(0!=a)return r.$message.error(o);r.clerkOptions=n})},submit:function(){var e=this;this.$refs.form.validate(function(t){if(!t)return!1;e.btnLoading=!0,Object(s.a)(l.a.updateMemberStore,o()({},e.form)).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,r=e._self._c||t;return r("div",[r("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}},[r("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"133px"}},[r("el-form-item",{attrs:{label:"服务门店：",prop:"mainStoreId"}},[r("el-select",{staticStyle:{width:"386px"},attrs:{filterable:"",remote:"","reserve-keyword":"",placeholder:"请输入门店名称/门店code","remote-method":e.getMainStoreCodeName,loading:e.loading,"popper-class":"option-wrap"},on:{change:e.getClerckList},model:{value:e.form.mainStoreId,callback:function(t){e.$set(e.form,"mainStoreId",t)},expression:"form.mainStoreId"}},e._l(e.mainstoreList,function(t){return r("el-option",{key:t.storeId,attrs:{label:t.storeName,value:t.storeId}},[r("p",{staticClass:"name"},[e._v("\n              "+e._s(t.storeName)+"\n            ")]),e._v(" "),r("p",{staticClass:"code"},[e._v("\n              "+e._s(t.storeCode)+"\n            ")])])}),1)],1),e._v(" "),r("el-form-item",{attrs:{label:"专属导购：",prop:"mainClerkId"}},[r("el-select",{staticStyle:{width:"386px"},attrs:{"popper-class":"option-wrap"},model:{value:e.form.mainClerkId,callback:function(t){e.$set(e.form,"mainClerkId",t)},expression:"form.mainClerkId"}},e._l(e.clerkOptions,function(t){return r("el-option",{key:t.clerkId,attrs:{value:t.clerkId,label:t.clerkName}},[r("p",{staticClass:"name"},[e._v("\n              "+e._s(t.clerkName)+"\n            ")]),e._v(" "),r("p",{staticClass:"code"},[e._v("\n              "+e._s(t.clerkCode)+"\n            ")])])}),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":"",placeholder:"请输入内容"},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 f=r("VU/8")(d,u,!1,function(e){r("ZFcD")},null,null);t.default=f.exports},ZFcD:function(e,t){}});