You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18.c5c01eb6b57f1d112519.js 9.6 KiB

3 vuotta sitten
12
  1. webpackJsonp([18],{"/yZt":function(e,t,r){"use strict";var s=r("BO1k"),i=r.n(s),o=r("zppT"),n=r("g45I"),a=r("rVpP");t.a={created:function(){var e=this;"sa"==this.usertype&&r.i(o.a)().then(function(t){e.manageList=t.result.rows}),"admin"==this.usertype&&this.selectlist(),"user"==this.usertype&&r.i(n.a)({org:this.ruleForm.org}).then(function(t){e.shopList=t.result.rows,e.ruleForm.store=e.shopList[0].id}).then(function(){e.selectlist()})},data:function(){return{usertype:this.$store.getters.usertype,ruleForm:{org:this.$store.getters.orgId,store:""},manageList:[],shopList:[],list:[],orgMember:""}},watch:{"ruleForm.org":function(){var e=this;r.i(n.a)({org:this.ruleForm.org}).then(function(t){e.shopList=t.result.rows,e.ruleForm.store=""}).then(function(){e.selectlist()})}},methods:{selectlist:function(){var e=this,t=0;if(this.orgMember=1,this.ruleForm.store){t=this.ruleForm.store;var s=!0,o=!1,n=void 0;try{for(var l,u=i()(this.shopList);!(s=(l=u.next()).done);s=!0){var c=l.value;c.id==t&&(this.orgMember=c.membertype)}}catch(e){o=!0,n=e}finally{try{!s&&u.return&&u.return()}finally{if(o)throw n}}}1==this.orgMember&&(t=0),r.i(a.a)({org:this.ruleForm.org,store:t}).then(function(t){e.list=t.result.map(function(t){return e.$set(t,"edit",!1),t})})},editVo:function(e,t){var s=this,i=this.list[e],o=i.requiredRechargeAmount,n=i.discount;if(!/^\+?[1-9][0-9]*$/.test(o)&&0!=e)return this.$message({type:"error",message:"请输入正确的充值额度!"}),!1;if(o>99999999&&0!=e)return this.$message({type:"error",message:"输入充值额度不能大于99999999!"}),!1;if(!/^(0|[1-9][0-9]{0,2})(\.[0-9]{1,2})?$/.test(n))return this.$message({type:"error",message:"请输入正确的折扣!"}),!1;if(n>10)return this.$message({type:"error",message:"折扣不能大于10!"}),!1;if(void 0!=this.list[e-1]){if(o<=this.list[e-1].requiredRechargeAmount)return this.$message({type:"error",message:"充值额度不能小于等于"+e+"级充值额度!"}),!1;if(n>=this.list[e-1].discount)return this.$message({type:"error",message:"折扣不能大于等于"+e+"级折扣!"}),!1}if(void 0!=this.list[e+1]){if(o>=this.list[e+1].requiredRechargeAmount)return this.$message({type:"error",message:"充值额度不能大于等于"+(e+2)+"级充值额度!"}),!1;if(n<=this.list[e+1].discount)return this.$message({type:"error",message:"折扣不能小于等于"+(e+2)+"级折扣!"}),!1}t.org=this.ruleForm.org;var l=0;this.ruleForm.store&&(l=1==this.orgMember?0:this.ruleForm.store),t.store=l,r.i(a.b)(t).then(function(e){s.$message({type:"success",message:"操作成功"}),i.edit=!1})},delVo:function(e){var t=this;this.$confirm("此操作将删除您所选的数据, 是否继续?","",{type:"warning",center:!0}).then(function(){var s=0;t.ruleForm.store&&(s=t.ruleForm.store);var i={org:t.ruleForm.org,store:s,level:e+1};r.i(a.c)(i).then(function(r){t.list.splice(e)})}).catch(function(){})},addLevel:function(){if(!this.list.every(function(e){return 0==e.edit}))return this.$message({type:"error",message:"请全部保存后再添加等级!"}),!1;this.list.push({discount:"",id:0,level:this.list.length+1,name:this.list.length+1+"级",requiredRechargeAmount:"",edit:!0})},shopChange:function(){this.selectlist()}}}},"0ghy":function(e,t,r){"use strict";function s(e){r("m2Cx")}Object.defineProperty(t,"__esModule",{value:!0});var i=r("/yZt"),o=r("oRGh"),n=r("VU/8"),a=s,l=n(i.a,o.a,a,null,null);t.default=l.exports},BO1k:function(e,t,r){e.exports={default:r("fxRn"),__esModule:!0}},VANc:function(e,t,r){t=e.exports=r("FZ+f")(!0),t.push([e.i,".box-cardgrade{height:100%}.box-cardgrade .el-card__header{padding:0 20px;color:red}.czed .el-input{width:170px}.zk .el-input{width:130px}","",{version:3,sources:["D:/projects/gitLab/wxpos/posadmin/src/views/marketing/member/grade.vue"],names:[],mappings:"AACA,eACI,WAAa,CAChB,AACD,gCACI,eAAkB,AAClB,SAAW,CACd,AACD,gBACI,WAAa,CAChB,AACD,cACI,WAAa,CAChB",file:"grade.vue",sourcesContent:["\n.box-cardgrade {\n height: 100%;\n}\n.box-cardgrade .el-card__header {\n padding: 0px 20px;\n color: red;\n}\n.czed .el-input {\n width: 170px;\n}\n.zk .el-input {\n width: 130px;\n}\n"],sourceRoot:""}])},fxRn:function(e,t,r){r("+tPU"),r("zQR9"),e.exports=r("g8Ux")},g45I:function(e,t,r){"use strict";function s(e){return r.i(u.a)({url:"/service-org/shop/list",method:"get",params:e})}function i(e){return r.i(u.a)({url:"/unionService/shop/shop",method:"post",data:e})}function o(e){return r.i(u.a)({url:"/service-org/shop/detail?shopId="+e,method:"get"})}function n(e){return r.i(u.a)({url:"/unionService/shop/shop",method:"put",data:e})}function a(e){return r.i(u.a)({url:"/unionService/device/store",method:"put",data:e})}function l(e){return r.i(u.a)({url:"/service-org/shop/delete?shopId="+e,method:"DELETE"})}t.a=s,t.f=i,t.b=o,t.c=n,t.d=a,t.e=l;var u=r("Vo7i")},g8Ux:function(e,t,r){var s=r("77Pl"),i=r("3fs2");e.exports=r("FeBl").getIterator=function(e){var t=i(e);if("function"!=typeof t)throw TypeError(e+" is not iterable!");return s(t.call(e))}},m2Cx:function(e,t,r){var s=r("VANc");"string"==typeof s&&(s=[[e.i,s,""]]),s.locals&&(e.exports=s.locals);r("rjj0")("6e9a8fb1",s,!0)},oRGh:function(e,t,r){"use strict";var s=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"app-container"},[r("el-form",{ref:"ruleForm",attrs:{model:e.ruleForm,"label-width":"20px"}},[r("el-form-item",{attrs:{label:"",prop:"org"}},["sa"==e.usertype?[r("el-select",{attrs:{placeholder:"集团",filterable:""},model:{value:e.ruleForm.org,callback:function(t){e.$set(e.ruleForm,"org",t)},expression:"ruleForm.org"}},e._l(e.manageList,function(e){return r("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),e._v(" "),r("el-select",{attrs:{placeholder:"门店",filterable:"",clearable:""},on:{change:e.shopChange},model:{value:e.ruleForm.store,callback:function(t){e.$set(e.ruleForm,"store",t)},expression:"ruleForm.store"}},e._l(e.shopList,function(e){return r("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})}))]:e._e(),e._v(" "),"user"==e.usertype?[r("el-select",{attrs:{placeholder:"门店",filterable:""},on:{change:e.shopChange},model:{value:e.ruleForm.store,callback:function(t){e.$set(e.ruleForm,"store",t)},expression:"ruleForm.store"}},e._l(e.shopList,function(e){return r("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})}))]:e._e(),e._v(" "),1==e.orgMember?r("el-tag",{attrs:{type:"warning"}},[e._v("使用会员等级:集团")]):e._e(),e._v(" "),2==e.orgMember?r("el-tag",{attrs:{type:"warning"}},[e._v("使用会员等级:门店")]):e._e()],2),e._v(" "),e._l(e.list,function(t,s){return r("el-form-item",{key:s},[r("el-card",{staticClass:"box-cardgrade"},[r("div",{attrs:{slot:"header"},slot:"header"},[r("span",[e._v(e._s(s+1)+"级")]),e._v(" "),"user"!=e.usertype||1!=e.orgMember?[e.list.length==s+1&&0!=s?r("el-button",{staticStyle:{float:"right",margin:"3px 10px"},attrs:{type:"danger",size:"small"},on:{click:function(t){e.delVo(s)}}},[e._v("删除\n ")]):e._e(),e._v(" "),t.edit?r("el-button",{staticStyle:{float:"right",margin:"3px 10px"},attrs:{type:"success",size:"small"},on:{click:function(r){e.editVo(s,t)}}},[e._v("保存\n ")]):r("el-button",{staticStyle:{float:"right",margin:"3px 10px"},attrs:{type:"primary",size:"small"},on:{click:function(e){t.edit=!t.edit}}},[e._v("编辑\n ")])]:e._e()],2),e._v(" "),r("div",{staticClass:"text item"},[t.edit?r("el-row",[r("el-col",{staticClass:"czed",attrs:{span:10}},[e._v(" 充值额度:\n "),0!=s?[r("el-input",{model:{value:t.requiredRechargeAmount,callback:function(r){e.$set(t,"requiredRechargeAmount",e._n(r))},expression:"item.requiredRechargeAmount"}},[r("template",{slot:"append"},[e._v("元")])],2),e._v(" "),r("span",{staticStyle:{color:"#dd5b46","font-size":"12px"}},[e._v("(正整数:1 - 99999999 )")])]:[e._v("\n 0元\n ")]],2),e._v(" "),r("el-col",{staticClass:"zk",attrs:{span:14}},[e._v("折扣:\n "),r("el-input",{model:{value:t.discount,callback:function(r){e.$set(t,"discount",e._n(r))},expression:"item.discount"}},[r("template",{slot:"append"},[e._v("折")])],2),e._v(" "),r("span",{staticStyle:{color:"#dd5b46","font-size":"12px"}},[e._v("(范围:0.01-10)")])],1)],1):r("el-row",[r("el-col",{attrs:{span:10}},[e._v(" 充值额度:\n "+e._s(t.requiredRechargeAmount)+"元\n ")]),e._v(" "),r("el-col",{attrs:{span:14}},[e._v("折扣:\n "+e._s(t.discount)+"折\n ")])],1)],1)])],1)}),e._v(" "),r("el-form-item",[r("el-button",{attrs:{type:"primary",disabled:e.list.length>4||e.list.length<1||"user"==e.usertype&&1==e.orgMember},on:{click:e.addLevel}},[e._v("+增加等级")])],1)],2)],1)},i=[],o={render:s,staticRenderFns:i};t.a=o},rVpP:function(e,t,r){"use strict";function s(e){return r.i(n.a)({url:"/service-member/member-level",method:"get",params:e})}function i(e){return r.i(n.a)({url:"/service-member/member-level",method:"post",data:e})}function o(e){return r.i(n.a)({url:"/service-member/member-level",method:"delete",data:e})}t.a=s,t.b=i,t.c=o;var n=r("Vo7i")},zppT:function(e,t,r){"use strict";function s(e){return r.i(u.a)({url:"/unionService/org/org",method:"post",data:e})}function i(e){return r.i(u.a)({url:"/service-org/org/list",method:"get",params:e})}function o(e){return r.i(u.a)({url:"/service-org/org/list",method:"get",params:e})}function n(e){return r.i(u.a)({url:"/service-org/org/delete?orgId="+e,method:"DELETE"})}function a(e){return r.i(u.a)({url:"/service-org/org/detail?orgId="+e,method:"get"})}function l(e){return r.i(u.a)({url:"/service-org/org/update",method:"put",data:e})}t.e=s,t.a=i,t.f=o,t.d=n,t.b=a,t.c=l;var u=r("Vo7i")}});
  2. //# sourceMappingURL=18.c5c01eb6b57f1d112519.js.map