webpackJsonp([45],{"58by":function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r("Dd8w"),a=r.n(i),l=r("woOf"),o=r.n(l),n=r("AKaA"),s=r("NTL1"),d=r("8V46"),u={name:"CustomergradeDialog",props:{dialogVisible:{type:Boolean,default:!1},isClique:{type:Boolean,default:!1},gradeId:{type:String,default:""},cliqueGradeId:{type:String,default:""},gradeList:{type:Array,default:function(){return[]}},cliqueGradeList:{type:Array,default:function(){return[]}},memberId:{type:String,default:""}},data:function(){return{visible:!1,form:{memberId:"",gradeId:"",remark:""},rules:{gradeId:[{required:!0,message:"请选择修改后等级",trigger:"change"}],remark:[{required:!0,message:"请输入原因备注",trigger:"change"}]},btnLoading:!1}},watch:{dialogVisible:function(e,t){if(this.visible=e,e){var r=this.isClique?this.cliqueGradeId:this.gradeId;this.form=o()(this.form,{gradeId:r,memberId:this.memberId})}}},methods:{cancel:function(){this.$refs.form.resetFields(),this.$emit("update:dialogVisible",!1)},submit:function(){var e=this;this.$refs.form.validate(function(t){if(!t)return!1;e.btnLoading=!0;var r=a()({},e.form,{isClique:Number(e.isClique)});Object(n.a)(s.a.memberGrade,o()({},r)).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")},2e3):(Object(d.a)(),e.btnLoading=!1)}).catch(function(t){e.btnLoading=!1,Object(d.b)(t)})})}}},c={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:"gradeId"}},[r("el-select",{staticStyle:{width:"386px"},attrs:{placeholder:"请选择"},model:{value:e.form.gradeId,callback:function(t){e.$set(e.form,"gradeId",t)},expression:"form.gradeId"}},[e.isClique?e._l(e.cliqueGradeList,function(e){return r("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})}):e._l(e.gradeList,function(e){return r("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})],2)],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 m=r("VU/8")(u,c,!1,function(e){r("v54v")},null,null);t.default=m.exports},v54v:function(e,t){}});