webpackJsonp([51],{uT4N:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a("aA9S"),o=a.n(r),i=a("AKaA"),l=a("NTL1"),s=a("8V46"),n={name:"integralDailog",props:{dialogVisible:{type:Boolean,default:!1},multipleList:{type:Array,default:function(){return[]}},integralFlag:{type:String,default:""},pageSize:{type:Number,default:""},memberSearchStr:{type:Number,default:""},phoneNameCard:{type:String,default:""},pageName:{type:String,default:""}},data:function(){return{form:{editType:1,accumulatPoints:0,remark:"",settlementStoreId:""},rules:{editType:[{required:!0,message:"请选择调整方式",trigger:"change"}],accumulatPoints:[{required:!0,message:"请选择调整额度",trigger:"change"}],remark:[{required:!0,message:"请输入原因备注",trigger:"change"}],settlementStoreId:[{required:!0,message:"请填写原始成本主体",trigger:"change"}]},btnLoading:!1,loading:!1,storeList:[]}},methods:{cancel:function(){this.$refs.form.resetFields(),this.$emit("update:dialogVisible",!1)},getStoreCodeName:function(e){var t=this;this.loading=!0,Object(i.c)(l.a.storeCodeName,{searchParam:e,flag:1}).then(function(e){0===e.data.errorCode?t.storeList=e.data.result:Object(s.a)(e.data.message)}).catch(function(e){Object(s.b)(e)}).finally(function(e){return t.loading=!1})},submit:function(){var e=this;this.$refs.form.validate(function(t){if(!t)return!1;e.btnLoading=!0;var a=[];e.multipleList.forEach(function(e){a.push(e.memberId)}),Object(i.a)(l.a.updateIntegrals,o()({},e.form,{memberIds:1==e.selectAll?"-1":a.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(s.c)(),e.$refs.form.resetFields(),e.$emit("update:dialogVisible",!1),e.$emit("refresh")},4500):(Object(s.a)(),e.btnLoading=!1)}).catch(function(t){e.btnLoading=!1,Object(s.b)(t)})})}}},m={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("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}},[a("div",{staticClass:"checkedCustomers"},[e._v("当前选中"),a("span",{staticClass:"num"},[e._v(" "+e._s(e.multipleList.length)+" ")]),e._v("位客户")]),e._v(" "),a("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"133px"}},[a("el-form-item",{attrs:{label:"调整积分：",prop:"editType"}},[a("el-radio-group",{model:{value:e.form.editType,callback:function(t){e.$set(e.form,"editType",t)},expression:"form.editType"}},[a("el-radio",{attrs:{label:1}},[e._v("增加积分")]),e._v(" "),a("el-radio",{attrs:{label:2}},[e._v("扣除积分")])],1)],1),e._v(" "),a("el-form-item",{attrs:{label:"调整额度：",prop:"accumulatPoints"}},[a("el-input-number",{staticStyle:{width:"115px"},attrs:{"controls-position":"right",min:1,max:999999},model:{value:e.form.accumulatPoints,callback:function(t){e.$set(e.form,"accumulatPoints",t)},expression:"form.accumulatPoints"}})],1),e._v(" "),"gic"==e.integralFlag&&1==e.form.editType?a("el-form-item",{attrs:{label:"原始成本主体：",prop:"settlementStoreId"}},[a("el-select",{staticStyle:{width:"400px"},attrs:{prop:"settlementStoreId",filterable:"",remote:"","reserve-keyword":"",placeholder:"请输入门店名称/门店code","remote-method":e.getStoreCodeName,loading:e.loading},model:{value:e.form.settlementStoreId,callback:function(t){e.$set(e.form,"settlementStoreId",t)},expression:"form.settlementStoreId"}},e._l(e.storeList,function(e){return a("el-option",{key:e.storeId,attrs:{label:e.storeName,value:e.storeId}})}),1),e._v(" "),a("p",{staticClass:"sub-tip"},[e._v("注：除输入选择具体门店外，还可输入总部，记总部名下")])],1):e._e(),e._v(" "),a("el-form-item",{attrs:{label:"原因备注：",prop:"remark"}},[a("el-input",{staticStyle:{width:"400px"},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(" "),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 c=a("C7Lr")(n,m,!1,function(e){a("xDAv")},"data-v-0a0746e0",null);t.default=c.exports},xDAv:function(e,t){}});