1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-398bdb4e"],{1582:function(e,t,r){"use strict";r.r(t);var a=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"m-container"},[e._m(0),e._v(" "),r("div",{staticClass:"m-core"},[r("save-form",{staticClass:"searchForm",attrs:{inline:!0,"save-key":"memberSet",model:e.searchForm},on:{submit:e.search,reset:e.onReSet,"update:model":function(t){e.searchForm=t}}},[r("el-form-item",[r("el-input",{attrs:{clearable:"",placeholder:"会员名称"},model:{value:e.searchForm.search,callback:function(t){e.$set(e.searchForm,"search","string"===typeof t?t.trim():t)},expression:"searchForm.search"}})],1),e._v(" "),r("el-form-item",[r("el-button",{attrs:{"native-type":"submit",type:"danger"}},[e._v("搜索")])],1)],1),e._v(" "),r("el-button",{directives:[{name:"permission",rawName:"v-permission",value:"memberRankSetting/add",expression:"'memberRankSetting/add'"}],staticStyle:{"margin-bottom":"20px"},attrs:{type:"primary"},on:{click:e.addLeave}},[e._v("新增会员等级")]),e._v(" "),r("el-table",{attrs:{data:e.tableList,"header-cell-style":{background:"#EDEEF0",color:"#444"}}},[r("el-table-column",{attrs:{align:"center",prop:"name",label:"会员名称"}}),e._v(" "),r("el-table-column",{attrs:{align:"center",prop:"type",label:"会员标识"},scopedSlots:e._u([{key:"default",fn:function(e){return[r("el-image",{staticStyle:{width:"100px",height:"100px"},attrs:{src:e.row.icon,"preview-src-list":[e.row.icon]}})]}}])}),e._v(" "),r("el-table-column",{attrs:{align:"center",prop:"type",label:"试用会员标识"},scopedSlots:e._u([{key:"default",fn:function(e){return[r("el-image",{staticStyle:{width:"100px",height:"100px"},attrs:{src:e.row.experienceIcon,"preview-src-list":[e.row.experienceIcon]}})]}}])}),e._v(" "),r("el-table-column",{attrs:{align:"center",prop:"updateTime",width:"100px",label:"修改时间"}}),e._v(" "),r("el-table-column",{attrs:{align:"center",prop:"operatorName",label:"修改人"}}),e._v(" "),r("el-table-column",{attrs:{align:"center",label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){return[r("div",[r("auth",{attrs:{auths:"memberRankSetting/get"}},[r("el-button",{attrs:{type:"text"},on:{click:function(r){return e.resetMember(t.row)}}},[e._v("详情")])],1),e._v(" "),r("auth",{attrs:{auths:["memberRankSetting/get","memberRankSetting/update"],mulit:""}},[r("el-button",{attrs:{type:"text"},on:{click:function(r){return e.resetMember(t.row,"update")}}},[e._v("修改")])],1)],1)]}}])})],1),e._v(" "),r("pagination",{attrs:{"save-key":"memberSet",total:e.rules.total,sync:"",page:e.rules.page,limit:e.rules.limit,"page-sizes":e.rules.page_size},on:{"update:total":function(t){return e.$set(e.rules,"total",t)},"update:page":function(t){return e.$set(e.rules,"page",t)},"update:limit":function(t){return e.$set(e.rules,"limit",t)},pagination:e.getList}})],1),e._v(" "),e.branchStatus?r("el-dialog",{attrs:{title:e.title,"close-on-click-modal":!1,visible:e.branchStatus,"default-expand-all":"",width:"800px"},on:{"update:visible":function(t){e.branchStatus=t},close:function(t){return e.onFormClose("ruleForm")}}},[r("el-form",{ref:"ruleForm",attrs:{model:e.form,inline:!0}},[r("el-alert",{staticStyle:{"margin-bottom":"20px"},attrs:{title:"会员信息",type:"info",closable:!1}}),e._v(" "),r("el-form-item",{attrs:{label:"会员名称",prop:"name","label-width":e.formLabelWidth,rules:[{required:!0,message:"请输入会员名称"}]}},[r("el-input",{staticStyle:{width:"620px"},attrs:{disabled:e.addDisabled,autocomplete:"off",maxlength:"10","show-word-limit":""},model:{value:e.form.name,callback:function(t){e.$set(e.form,"name","string"===typeof t?t.trim():t)},expression:"form.name"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"会员介绍",prop:"intro","label-width":e.formLabelWidth,rules:[{required:!0,message:"请输入会员介绍"}]}},[r("el-input",{staticStyle:{width:"620px"},attrs:{maxlength:"200","show-word-limit":"",disabled:e.addDisabled,autocomplete:"off",type:"textarea",rows:5},model:{value:e.form.intro,callback:function(t){e.$set(e.form,"intro","string"===typeof t?t.trim():t)},expression:"form.intro"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"会员标识",prop:"icon","label-width":e.formLabelWidth,rules:[{required:!0,message:"请上传会员标识"}]}},[r("image-cropper",{attrs:{options:e.cropperOptions,disabled:e.addDisabled,imgSize:2,imageUrl:e.form.icon},on:{"crop-upload-success":e.cropSuccess2}})],1),e._v(" "),r("br"),e._v(" "),r("el-form-item",{attrs:{label:"试用会员标识",prop:"experienceIcon","label-width":e.formLabelWidth,rules:[{required:!0,message:"请上传试用会员标识"}]}},[r("image-cropper",{attrs:{options:e.cropperOptions,disabled:e.addDisabled,imgSize:2,imageUrl:e.form.experienceIcon},on:{"crop-upload-success":e.cropSuccess}}),e._v(" "),e.addDisabled?e._e():r("p",{staticStyle:{color:"red"}},[e._v("\n 请上传大小2M以内,格式为jpg、png、gif图片\n ")])],1),e._v(" "),r("el-alert",{staticStyle:{"margin-bottom":"20px"},attrs:{title:"会员权益",type:"info",closable:!1}}),e._v(" "),r("el-form-item",{attrs:{label:e.searchName,"label-width":e.formLabelWidth}},[r("el-input",{staticStyle:{width:"210px"},model:{value:e.seachRoleValue,callback:function(t){e.seachRoleValue="string"===typeof t?t.trim():t},expression:"seachRoleValue"}}),e._v(" "),r("el-button",{staticStyle:{"margin-left":"10px"},attrs:{type:"danger"},on:{click:e.seachRoles}},[e._v("搜索")]),e._v(" "),r("el-button",{attrs:{type:"primary"},on:{click:e.onReSetRole}},[e._v("重置")])],1),e._v(" "),r("br"),e._v(" "),r("el-form-item",{attrs:{label:"会员功能","label-width":e.formLabelWidth}},[r("el-checkbox",{attrs:{disabled:e.addDisabled,indeterminate:e.isIndeterminate},on:{change:e.onCheckAll},model:{value:e.checkAll,callback:function(t){e.checkAll="string"===typeof t?t.trim():t},expression:"checkAll"}},[e._v("全选")]),e._v(" "),r("div",[r("el-tree",{ref:"trees",staticClass:"tree",attrs:{data:e.treeData,"show-checkbox":"","node-key":"id","filter-node-method":e.filterNode,"highlight-current":"","default-checked-keys":e.checkList,props:e.defaultProps},on:{check:e.onTreeCheck},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.node;t.data;return r("div",{},[e._v("\n "+e._s(a.label)+"\n ")])}}],null,!1,769793285)})],1)],1)],1),e._v(" "),r("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e.addDisabled?e._e():r("el-button",{on:{click:function(t){e.branchStatus=!1}}},[e._v("取 消")]),e._v(" "),r("el-button",{attrs:{type:"primary"},on:{click:e.onSubmit}},[e._v("确 定")])],1)],1):e._e()],1)},i=[function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("h2",[r("div",{staticClass:"squrt"}),e._v("\n 会员设置\n ")])}],s=(r("ac6a"),r("6762"),r("2fdb"),r("7f7f"),r("5530")),n=r("2909"),l=(r("386d"),r("96cf"),r("1da1")),c=r("333d"),o=r("c7f0"),u=r("896b"),d=r("6cfe"),m=r("624a"),h={components:{pagination:c["a"],Upload:o["a"],ImageCropper:u["a"]},name:"memberSet",data:function(){return{formLabelWidth:"120px",searchForm:{search:null},rules:{limit:10,page:1,total:0,page_size:[10,20,40,50]},tableList:[],title:"新增会员等级",branchStatus:!1,form:{name:"",icon:"",into:"",experienceIcon:""},addDisabled:!1,checkAll:!1,isIndeterminate:!1,treeData:[],defaultProps:{children:"children",label:"label",disabled:this.addDisabled},result:{roleName:null,roleDesc:null},seachRoleValue:"",silderList:[],slideCount:0,pageType:"",allChildIds:[],checkList:[],searchName:"搜索 ",cropperOptions:{autoCrop:!0,autoCropWidth:200,autoCropHeight:200,fixedBox:!0,previewsCircle:!1,title:"会员标识"}}},mounted:function(){var e=Object(l["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:this.getList();case 1:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}(),methods:{onFormClose:function(e){this.form={name:"",icon:"",into:""},this.$refs.trees.setCheckedNodes([]),this.onTreeCheck(),this.$refs[e].resetFields()},search:function(){this.rules.page=1,this.getList()},onReSet:function(){},cropSuccess:function(e){this.form.experienceIcon=e.data.url},cropSuccess2:function(e){this.form.icon=e.data.url},getList:function(){var e=Object(l["a"])(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Object(d["e"])({search:this.searchForm.search,rows:this.rules.limit,page:this.rules.page});case 3:t=e.sent,this.tableList=t.data.rows,this.rules.total=t.data.total,e.next=10;break;case 8:e.prev=8,e.t0=e["catch"](0);case 10:case"end":return e.stop()}}),e,this,[[0,8]])})));function t(){return e.apply(this,arguments)}return t}(),addLeave:function(){var e=Object(l["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return this.checkList=[],this.title="新增会员等级",this.addDisabled=!1,this.pageType="create",e.next=6,this.getNewTree();case 6:return this.slideCount=0,e.next=9,this.setTableData(this.silderList,this.addDisabled);case 9:this.treeData=e.sent,this.branchStatus=!0;case 11:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}(),onSubmit:function(){var e=this;this.$refs.ruleForm.validate(function(){var t=Object(l["a"])(regeneratorRuntime.mark((function t(r){var a,i,l;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!r){t.next=33;break}if(a=e.$refs.trees.getCheckedKeys(),i=e.$refs.trees.getHalfCheckedKeys(),l=[].concat(Object(n["a"])(a),Object(n["a"])(i)),"update"!=e.pageType){t.next=18;break}return t.prev=5,t.next=8,Object(d["h"])(Object(s["a"])(Object(s["a"])({},e.form),{},{memberPrivilegesItemIdList:l}));case 8:t.sent,e.$message.success("修改成功"),e.branchStatus=!1,e.getList(),t.next=16;break;case 14:t.prev=14,t.t0=t["catch"](5);case 16:t.next=33;break;case 18:if("create"!=e.pageType){t.next=32;break}return t.prev=19,t.next=22,Object(d["b"])(Object(s["a"])(Object(s["a"])({},e.form),{},{memberPrivilegesItemIdList:l}));case 22:t.sent,e.$message.success("新建会员成功"),e.branchStatus=!1,e.getList(),t.next=30;break;case 28:t.prev=28,t.t1=t["catch"](19);case 30:t.next=33;break;case 32:e.branchStatus=!1;case 33:case"end":return t.stop()}}),t,null,[[5,14],[19,28]])})));return function(e){return t.apply(this,arguments)}}())},onCheckAll:function(e){e?(this.isIndeterminate=!1,this.$refs.trees.setCheckedNodes(this.treeData)):this.$refs.trees.setCheckedNodes([])},onTreeCheck:function(){var e=this.$refs.trees.getCheckedKeys();this.checkAll=e.length>=this.slideCount,this.isIndeterminate=e.length>0&&e.length<this.slideCount},filterNode:function(e,t){return!e||-1!==t.label.indexOf(e)},seachRoles:function(){this.$refs.trees.filter(this.seachRoleValue)},onReSetRole:function(){this.seachRoleValue="",this.$refs.trees.filter(this.seachRoleValue)},setTableData:function(e,t){var r=this,a=[];return a=e.map((function(e){var a={};return a={id:e.id,name:e.name,label:e.name,disabled:t||!1},r.slideCount++,e.memberPrivilegesItems&&e.memberPrivilegesItems.length>0&&(a.children=r.setTableData(e.memberPrivilegesItems,t)),a})),a},resetMember:function(){var e=Object(l["a"])(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return this.branchStatus=!0,e.next=3,this.resetTree(t);case 3:if(!r){e.next=13;break}return this.title="修改会员等级",this.pageType="update",this.addDisabled=!1,this.slideCount=0,e.next=10,this.setTableData(this.silderList,this.addDisabled);case 10:this.treeData=e.sent,e.next=20;break;case 13:return this.addDisabled=!0,this.title="查看会员等级",this.pageType="",this.slideCount=0,e.next=19,this.setTableData(this.silderList,this.addDisabled);case 19:this.treeData=e.sent;case 20:case"end":return e.stop()}}),e,this)})));function t(t,r){return e.apply(this,arguments)}return t}(),getParent:function(e,t){var r=JSON.parse(JSON.stringify(e));this.getAllChildIds(t);for(var a=this.allChildIds,i=e.length;i>0;i--)a.includes(e[i-1])||r.splice(i-1,1);return r},getAllChildIds:function(e){var t=this,r=this.allChildIds;e.forEach((function(e,a){e.children&&e.children.length>0?t.getAllChildIds(e.children):r.push(e.id)}))},resetTree:function(){var e=Object(l["a"])(regeneratorRuntime.mark((function e(t){var r,a,i,n,l,c=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.getNewTree();case 3:return this.treeData=e.sent,e.next=6,Object(d["d"])({memberRankSettingId:t.id});case 6:n=e.sent,this.form=Object(s["a"])({},n.data),this.checkAll=(null===(r=n.data.memberPrivilegesItemIdList)||void 0===r?void 0:r.length)>=this.slideCount||!1,this.isIndeterminate=(null===(a=n.data.memberPrivilegesItemIdList)||void 0===a?void 0:a.length)>0&&(null===(i=n.data.memberPrivilegesItemIdList)||void 0===i?void 0:i.length)<this.slideCount,this.checkList=n.data.memberPrivilegesItemIdList,l=this.getParent(n.data.memberPrivilegesItemIdList||[],this.treeData),this.checkList=l,this.$nextTick((function(){c.$refs.trees.setCheckedKeys(c.checkList)})),e.next=19;break;case 16:e.prev=16,e.t0=e["catch"](0),console.log(e.t0);case 19:case"end":return e.stop()}}),e,this,[[0,16]])})));function t(t){return e.apply(this,arguments)}return t}(),getNewTree:function(){var e=Object(l["a"])(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Object(m["c"])();case 3:return t=e.sent,this.silderList=t.data,this.slideCount=0,e.abrupt("return",this.setTableData(t.data));case 9:e.prev=9,e.t0=e["catch"](0);case 11:case"end":return e.stop()}}),e,this,[[0,9]])})));function t(){return e.apply(this,arguments)}return t}()}},p=h,b=(r("6196"),r("2877")),f=Object(b["a"])(p,a,i,!1,null,"6e35d1ea",null);t["default"]=f.exports},"5be7":function(e,t,r){},6196:function(e,t,r){"use strict";r("5be7")},"624a":function(e,t,r){"use strict";r.d(t,"c",(function(){return s})),r.d(t,"a",(function(){return n})),r.d(t,"d",(function(){return l})),r.d(t,"b",(function(){return c}));var a=r("829b"),i=(r("4328"),"/api-web");function s(e){return Object(a["a"])({url:i+"/memberPrivilegesItem/findAll",method:"get",params:e})}function n(e){return Object(a["a"])({url:i+"/memberPrivilegesItem/add",method:"post",data:e})}function l(e){return Object(a["a"])({url:i+"/memberPrivilegesItem/update",method:"post",data:e})}function c(e){return Object(a["a"])({url:i+"/memberPrivilegesItem/del",method:"post",params:e})}},"720a":function(e,t,r){"use strict";r.r(t);var a=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"m-container"},[e._m(0),e._v(" "),r("div",{staticClass:"m-core"},[r("tab-router",{attrs:{type:"card"},on:{"tab-click":e.handleClick},model:{value:e.activeIndex,callback:function(t){e.activeIndex="string"===typeof t?t.trim():t},expression:"activeIndex"}},[e.permissionList.memberSet?r("el-tab-pane",{attrs:{label:"会员设置",lazy:"",name:"1"}},[1==e.activeIndex?r("member-set"):e._e()],1):e._e(),e._v(" "),e.permissionList.memberFeeSet?r("el-tab-pane",{attrs:{label:"会员收费标准",lazy:"",name:"2"}},[2==e.activeIndex?r("member-fee-set"):e._e()],1):e._e()],1)],1)])},i=[function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("h2",[r("div",{staticClass:"squrt"}),e._v("\n 会员收费设置\n ")])}],s=(r("7f7f"),r("763e")),n=r("1582"),l=r("ec8a"),c={components:{"member-fee-set":s["default"],"member-set":n["default"]},data:function(){return{activeIndex:"1",permissionList:{memberSet:Object(l["a"])("/memberSet"),memberFeeSet:Object(l["a"])("/memberFeeSet")}}},mounted:function(){},methods:{handleClick:function(e){this.activeIndex=e.name}}},o=c,u=r("2877"),d=Object(u["a"])(o,a,i,!1,null,null,null);t["default"]=d.exports}}]);
|