webpackJsonp([39],{FSpY:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r("aA9S"),a=r.n(i),o=r("4YfN"),n=r.n(o),l=r("AKaA"),s=r("NTL1"),m=r("SJI6"),d=r("8V46"),c={name:"customermainstoreDialog",props:{dialogVisible:{type:Boolean,default:!1},mainStoreName:{type:String,default:""},mainStoreId:{type:String,default:""},mainClerkId:{type:String,default:""}},data:function(){return{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(m.mapState)(["showEditClique"])),methods:{cancel:function(){this.$refs.form.resetFields(),this.$emit("update:dialogVisible",!1)},getMainStoreCodeName:function(e){var t=this;this.loading=!0,Object(l.c)(s.a.storeCodeName,{searchParam:e,flag:1}).then(function(e){0===e.data.errorCode?t.mainstoreList=e.data.result:Object(d.a)(e.data.message)}).catch(function(e){Object(d.b)(e)}).finally(function(e){return t.loading=!1})},getClerckList:function(e){var t=this;this.clerkOptions=[],this.form.mainClerkId="",Object(l.b)(s.a.getClerkList,{storeId:e,requestProject:"member"}).then(function(e){var r=e.data||{},i=r.errorCode,a=r.message,o=r.result,n=void 0===o?[]:o;if(0!=i)return t.$message.error(a);t.clerkOptions=n})},submit:function(){var e=this;this.$refs.form.validate(function(t){if(!t)return!1;e.btnLoading=!0,Object(l.a)(s.a.updateMemberStore,a()({},e.form)).then(function(t){0===t.data.errorCode?setTimeout(function(){e.btnLoading=!1,Object(d.c)(),e.$refs.form.resetFields(),e.$emit("update:dialogVisible",!1),e.$emit("refresh")},4500):(Object(d.a)(),e.btnLoading=!1)}).catch(function(t){e.btnLoading=!1,Object(d.b)(t)})})}},watch:{dialogVisible:function(e,t){e&&(this.form=a()({},this.form,{mainStoreIdBak:this.mainStoreId,mainStoreId:this.mainStoreId,mainClerkId:this.mainClerkId}),this.getMainStoreCodeName(this.mainStoreName),this.getClerckList(this.mainStoreId))}}},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-dailog",visible:e.dialogVisible,"close-on-click-modal":!1,width:"600px"},on:{"update:visible":function(t){e.dialogVisible=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},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(e){return r("el-option",{key:e.storeId,attrs:{label:e.storeName,value:e.storeId}})}),1)],1),e._v(" "),r("el-form-item",{attrs:{label:"专属导购：",prop:"mainClerkId"}},[r("el-select",{staticStyle:{width:"386px"},model:{value:e.form.mainClerkId,callback:function(t){e.$set(e.form,"mainClerkId",t)},expression:"form.mainClerkId"}},e._l(e.clerkOptions,function(e){return r("el-option",{key:e.clerkId,attrs:{label:e.clerkName,value:e.clerkId}})}),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 f=r("C7Lr")(c,u,!1,function(e){r("ylAs")},null,null);t.default=f.exports},ylAs:function(e,t){}});