chunk-209d3aee.367ebee2.js 15 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-209d3aee","chunk-46366c28","chunk-a32cf3d6"],{"0c0b":function(e,t,a){"use strict";a.r(t);var r=function(){var e=this,t=e._self._c;return t("el-drawer",{attrs:{title:"权限设置",visible:e.showStatus,size:"70%","before-close":e.closeFn},on:{"update:visible":function(t){e.showStatus=t}}},[t("div",{staticClass:"role-set-wrap"},e._l(e.permTree,(function(a,r){return t("div",{key:r,staticClass:"role-list"},[t("el-checkbox",{attrs:{indeterminate:e.isIndeterminate[r]},on:{change:function(t){return e.handleCheckAllChange(t,r)}},model:{value:e.checkAll[r],callback:function(t){e.$set(e.checkAll,r,t)},expression:"checkAll[index]"}},[e._v(e._s(a.authName))]),t("div",{staticStyle:{margin:"15px 0"}}),t("el-checkbox-group",{on:{change:function(t){return e.handlecheckedPermChange(t,r)}},model:{value:e.checkedPerm,callback:function(t){e.checkedPerm=t},expression:"checkedPerm"}},e._l(a.children,(function(a,r){return t("el-checkbox",{key:a.id,attrs:{label:a.id}},[e._v(e._s(a.authName))])})),1)],1)})),0),t("div",{staticClass:"button-wrap flex-center"},[t("el-button",{attrs:{size:"mini"},on:{click:e.closeFn}},[e._v("关闭")]),t("el-button",{attrs:{type:"primary",size:"mini"},on:{click:e.saveFn}},[e._v("保存")])],1)])},i=[],n=a("f2ed"),o=a("c91c"),s=(a("0da6"),a("b138"),a("8f26"),a("963e"),a("0401"),{name:"role-set",props:{show:{type:Boolean,default:!1},info:{type:Object,default:function(){}}},data:function(){return{showStatus:!1,data:{},permTree:[],checkAll:[],checkedPerm:[],isIndeterminate:[]}},watch:{show:function(e){this.showStatus=e,e&&this.init()}},methods:{init:function(){var e=this;this._getTreeB().then((function(t){console.log("res",t),"business"==e.$projectName&&e._getAuthB()}))},_getTreeB:function(){var e=this;return Object(o["a"])(Object(n["a"])().m((function t(){var a;return Object(n["a"])().w((function(t){while(1)switch(t.n){case 0:return a={},t.n=1,e.$service.common.permTree({endId:1}).then((function(t){e.permTree=t,e.permTree.map((function(){e.isIndeterminate.push(!1),e.checkAll.push(!1)})),a=t}));case 1:return t.a(2,a)}}),t)})))()},_getAuthB:function(){var e=this;return Object(o["a"])(Object(n["a"])().m((function t(){var a;return Object(n["a"])().w((function(t){while(1)switch(t.n){case 0:return a={},t.n=1,e.$service.auth.authList({roleId:e.info.roleId}).then((function(e){a=e}));case 1:return t.a(2,a)}}),t)})))()},saveFn:function(){var e=this;console.log("this.info",this.info),this.$service.auth.authUpdate({roleId:this.info.roleId,authIdList:this.checkedPerm}).then((function(t){e.closeFn(),e.$message.success("保存成功!")}))},closeFn:function(e){this.$emit("update:show",!1),e&&e()},handleCheckAllChange:function(e,t){var a=this.permTree[t].children?this.permTree[t].children:this.permTree[t];a=a.map((function(e){return e.id})),this.checkedPerm=e?a:[],this.$set(this.isIndeterminate,t,!1)},handlecheckedPermChange:function(e,t){var a=e.length,r=this.permTree[t].children?this.permTree[t].children.length:0,i=a===r;this.$set(this.checkAll,t,i);var n=a>0&&a<r;this.$set(this.isIndeterminate,t,n)}}}),l=s,c=(a("e52a"),a("1805")),d=Object(c["a"])(l,r,i,!1,null,"cc52c0b6",null);t["default"]=d.exports},5483:function(e,t,a){},6898:function(e,t,a){"use strict";a.r(t);var r=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{title:"选择会员",visible:e.selDialog,"close-on-click-modal":!1,"append-to-body":!0,width:"800px"},on:{"update:visible":function(t){e.selDialog=t}}},[t("div",{staticClass:"recharge-modal-content"},[t("el-radio-group",{staticClass:"radio-wrap",model:{value:e.radio,callback:function(t){e.radio=t},expression:"radio"}},[t("x-crud",{staticClass:"liu-crud-wrap",on:{load:e.onLoad},scopedSlots:e._u([{key:"table-column-radio",fn:function(a){var r=a.scope;return[t("div",[t("el-radio",{attrs:{label:r.row.index}},[e._v("选择")])],1)]}},{key:"table-column-userName",fn:function(a){var r=a.scope;return[t("div",{staticClass:"flex-center"},[t("cl-avatar",{attrs:{shape:"square",size:40,src:e._f("default_avatar")(r.row.avatar)}}),t("div",{staticClass:"app-margin-left-10"},[e._v(e._s(r.row.userName))])],1)]}},{key:"table-column-member",fn:function(a){var r=a.scope;return[-1==r.row.member?t("div",[e._v("非会员")]):t("div",[e._v(e._s(r.row.userAsset.growth))])]}}])})],1)],1),t("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{attrs:{size:"small"},on:{click:e.resetForm}},[e._v("取 消")]),t("el-button",{attrs:{type:"primary",size:"small"},on:{click:e.confirmFn}},[e._v("确定")])],1)])},i=[],n=a("f2ed"),o=a("c91c"),s=(a("0da6"),a("8f26"),a("963e"),a("0401"),{name:"sel-search",props:{show:{type:Boolean,default:!1},multi:{type:Boolean,default:!1}},data:function(){return{selDialog:!1,ruleForm:{},radio:"",list:[],selData:{}}},watch:{show:function(e){this.selDialog=e}},created:function(){},methods:{confirmFn:function(){this.$emit("confirm",this.list[this.radio])},resetForm:function(){this.$emit("update:show",!1),this.$emit("cancel")},onLoad:function(e){var t=this,a=e.ctx,r=e.app;this.app=r,a.service(this.$service.member).set("table",{columns:[{prop:"radio",label:"选择",align:"center","min-width":60},{prop:"userName",label:"会员名字",align:"center"},{prop:"mobile",label:"手机号",align:"center"},{prop:"member",label:"会员级别",align:"center"},{prop:"visitTimeFormat",label:"最近访问",align:"center"}],op:{visible:!1}}).set("pagination",{size:6}).set("layout",[["slot-tabs"],["search-key","flex1","refresh-btn"],["data-table"],["flex1","pagination"]]).on("refresh",function(){var e=Object(o["a"])(Object(n["a"])().m((function e(a,r){var i,o,s,l;return Object(n["a"])().w((function(e){while(1)switch(e.n){case 0:return i=r.next,o=r.render,e.n=1,i(a);case 1:s=e.v,l=s.list,l.map((function(e,t){e.index=t})),t.list=l,o(l);case 2:return e.a(2)}}),e)})));return function(t,a){return e.apply(this,arguments)}}()).done(),r.refresh({type:this.tabIndex})}}}),l=s,c=(a("7d50"),a("1805")),d=Object(c["a"])(l,r,i,!1,null,null,null);t["default"]=d.exports},"6e74":function(e,t,a){},"7d50":function(e,t,a){"use strict";a("6e74")},e116:function(e,t,a){"use strict";a("5483")},e25e:function(e,t,a){"use strict";a.r(t);a("7212");var r=function(){var e=this,t=e._self._c;return t("div",{staticClass:"app-list-content"},[t("x-crud",{staticClass:"liu-crud-wrap",on:{load:e.onLoad},scopedSlots:e._u([{key:"table-column-userId",fn:function(e){var a=e.scope;return[0!=a.row.userId?t("i",{staticClass:"el-icon-success",staticStyle:{color:"#67C23A","font-size":"19px"}}):t("i",{staticClass:"el-icon-success",staticStyle:{color:"#C0C4CC","font-size":"19px"}})]}},{key:"table-column-avatar",fn:function(e){var a=e.scope;return[t("cl-avatar",{style:{margin:"auto"},attrs:{shape:"circle",size:24,src:a.row.avatar}})]}},{key:"table-column-incomeNotice",fn:function(a){var r=a.scope;return[t("el-switch",{attrs:{"active-value":"1","inactive-value":"0"},on:{change:function(t){e.changeNotice(r.row.id,t)}},model:{value:r.row.remind,callback:function(t){e.$set(r.row,"remind",t)},expression:"scope.row.remind"}})]}},{key:"table-column-status",fn:function(a){var r=a.scope;return[t("el-switch",{attrs:{"active-value":"1","inactive-value":"0"},on:{change:function(t){e.changeStatus(r.row.id,t)}},model:{value:r.row.status,callback:function(t){e.$set(r.row,"status",t)},expression:"scope.row.status"}})]}},{key:"slot-add-ad-btn",fn:function(){return[t("el-button",{attrs:{type:"primary",size:"mini"},on:{click:e.addBtnFn}},[e._v("添加")])]},proxy:!0}])}),t("el-dialog",{attrs:{title:"请员工扫下方图片完成绑定",visible:e.showMiniCode,width:"600px"},on:{"update:visible":function(t){e.showMiniCode=t}}},[t("div",{staticStyle:{"text-align":"center"}},[t("img",{staticStyle:{margin:"0 auto",width:"280px"},attrs:{src:e.miniCodeSrc}})]),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(t){e.showMiniCode=!1}}},[e._v("取 消")]),t("el-button",{attrs:{type:"primary"},on:{click:function(t){e.showMiniCode=!1}}},[e._v("确 定")])],1)]),t("el-dialog",{attrs:{title:"".concat(1==e.addOrModify?"添加":"修改","员工"),visible:e.addDialog,"close-on-click-modal":!1,width:"600px"},on:{"update:visible":function(t){e.addDialog=t}}},[t("div",{staticClass:"ad-modal-content"},[t("el-form",{ref:"adForm",staticClass:"demo-form",attrs:{model:e.adForm,rules:e.ruleForm,"label-width":"100px"}},[t("el-form-item",{attrs:{label:"姓名",prop:"name"}},[t("el-input",{attrs:{placeholder:"请输入姓名",size:"small"},model:{value:e.adForm.name,callback:function(t){e.$set(e.adForm,"name",t)},expression:"adForm.name"}})],1),t("el-form-item",{attrs:{label:"角色",prop:"roleId"}},[t("el-select",{attrs:{size:"small",placeholder:"请选择角色"},on:{change:e.selRoleFn},model:{value:e.adForm.roleName,callback:function(t){e.$set(e.adForm,"roleName",t)},expression:"adForm.roleName"}},e._l(e.roleList,(function(a,r){return t("el-option",{key:r,attrs:{value:a.roleName}},[e._v(e._s(a.roleName))])})),1)],1),t("el-form-item",{attrs:{label:"登陆密码",prop:"password"}},[t("el-input",{attrs:{placeholder:"请输入登录密码",type:"password",size:"small"},model:{value:e.adForm.password,callback:function(t){e.$set(e.adForm,"password",t)},expression:"adForm.password"}})],1),t("el-form-item",{attrs:{label:"备注"}},[t("el-input",{attrs:{type:"textarea",size:"small"},model:{value:e.adForm.remark,callback:function(t){e.$set(e.adForm,"remark",t)},expression:"adForm.remark"}})],1),t("el-form-item",{attrs:{label:"收款通知",prop:"remind"}},[t("el-switch",{attrs:{"active-value":"1","inactive-value":"0"},model:{value:e.adForm.remind,callback:function(t){e.$set(e.adForm,"remind",t)},expression:"adForm.remind"}})],1),t("el-form-item",{attrs:{label:"启用状态",prop:"status"}},[t("el-switch",{attrs:{"active-value":"1","inactive-value":"0"},model:{value:e.adForm.status,callback:function(t){e.$set(e.adForm,"status",t)},expression:"adForm.status"}})],1)],1)],1),t("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{attrs:{size:"small"},on:{click:e.resetForm}},[e._v("取 消")]),t("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(t){return e.submitForm("adForm")}}},[e._v("确认")])],1)]),t("sel-member",{attrs:{show:e.selMemberModal},on:{"update:show":function(t){e.selMemberModal=t},confirm:e.selMemberConfirmFn,cancel:function(t){e.selMemberModal=!1}}}),t("role-set",{attrs:{show:e.roleShow,info:e.modifyData},on:{"update:show":function(t){e.roleShow=t}}})],1)},i=[],n=a("4e57"),o=a("ecc5"),s=a("f2ed"),l=a("c91c"),c=(a("4348"),a("8f26"),a("666b"),a("209c"),a("f803"),a("6d35"),a("0401"),a("fddf"),a("6898")),d=a("0c0b"),u={name:"list-ad",components:{selMember:c["default"],roleSet:d["default"]},data:function(){return{app:null,modifyData:{},addOrModify:1,addDialog:!1,showMiniCode:!1,miniCodeSrc:"",adForm:{name:"",roleId:"",roleName:"",remind:"1",password:"",userId:"",remark:"",status:"1"},ruleForm:{name:[{required:!0,message:"请输入名称",trigger:"blur"}],roleName:[{required:!0,message:"请选择角色",trigger:"change"}],password:{required:!0,message:"请输入密码",trigger:"blur"}},roleList:[],selMemberModal:!1,memberData:{},roleShow:!1}},methods:Object(n["a"])({getRole:function(){var e=this;if(!this.$util.isEmpty(this.roleList))return this.roleList;this.$service.role.list().then((function(t){e.roleList=t.list}))},delBtnFn:function(e){var t=this;this.$confirm("是否删除该员工?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){t.$service.staff.delete({id:e.id}).then((function(e){t.$message.success("删除成功!"),t.app.refresh({type:t.tabIndex})}))})).catch()},authBtnFn:function(e){this.modifyData=e,this.roleShow=!0},modifyBtnFn:function(e){var t=this;this.$service.staff.info({id:e.id}).then(function(){var e=Object(l["a"])(Object(s["a"])().m((function e(a){var r,i;return Object(s["a"])().w((function(e){while(1)switch(e.n){case 0:if(r={},!a.userId||"0"==a.userId){e.n=2;break}return e.n=1,t.$service.member.info({userId:a.userId});case 1:r=e.v;case 2:if(t.getRole(),t.memberData=r,t.addOrModify=2,t.modifyData=a,t.addDialog=!0,i=JSON.parse(JSON.stringify(a)),i.startTime=t.$util.$formatDate(i.startTime),i.endTime=t.$util.$formatDate(i.endTime),!t.$util.isEmpty(i)){e.n=3;break}return e.a(2);case 3:Object.keys(t.adForm).forEach((function(e){t.adForm[e]=i[e]})),t.ruleForm.password.required=!1;case 4:return e.a(2)}}),e)})));return function(t){return e.apply(this,arguments)}}())},addBtnFn:function(){this.getRole(),this.addOrModify=1,this.addDialog=!0,this.memberData={},this.adForm={name:"",roleId:"",roleName:"",remind:"1",password:"",userId:"",remark:"",status:"1"},this.ruleForm.password.required=!0},changeNotice:function(e,t){var a=this;this.$service.common.updateRemind({id:e,remind:t}).then((function(e){a.$message.success("操作成功"),a.app.refresh()}))},changeStatus:function(e,t){var a=this;this.$service.common.updateStatus({id:e,status:t}).then((function(e){a.$message.success("操作成功"),a.app.refresh()}))},selRoleFn:function(e){var t=this.roleList.findIndex((function(t){return t.roleName==e}));this.adForm.roleId=this.roleList[t].id,console.log("this.adForm.roleId",this.adForm.roleId)},resetForm:function(){this.$refs["adForm"].resetFields(),this.memberData={},this.addDialog=!1},addFn:function(){var e=this,t=JSON.parse(JSON.stringify(this.adForm)),a=null;delete t.roleName,a=1==this.addOrModify?function(){return e.$service.shopAdmin.prepareBind(e.adForm)}:function(){return e.$service.shopAdmin.update(Object(o["a"])({id:e.modifyData.id},t))},a(t).then((function(t){e.miniCodeSrc=t.miniCode,e.showMiniCode=!0,e.resetForm(),e.app.refresh({type:e.tabIndex})}))},selGoods:function(){var e=this;this.selMemberModal=!0,setTimeout((function(){console.log(e.memberData)}),6e3)},selMemberConfirmFn:function(e){this.memberData=e,this.adForm.userId=e.id,this.selMemberModal=!1},submitForm:function(e){var t=this;this.$refs[e].validate((function(e){if(!e)return console.log("error submit!!"),!1;t.addFn()}))},onLoad:function(e){var t=e.ctx,a=e.app;this.app=a,t.service(this.$service.shopAdmin).set("table",{columns:[{prop:"id",label:"id",align:"center",width:100},{prop:"avatar",label:"头像",align:"center",width:90,formatter:function(e){return e.avatar}},{prop:"name",label:"姓名",align:"center",formatter:function(e){return e.name}},{prop:"mobile",label:"手机号",align:"center",formatter:function(e){return e.mobile}},{prop:"roleName",label:"角色",align:"center",width:100},{prop:"incomeNotice",label:"收款通知",align:"center"},{prop:"status",label:"启用状态",align:"center"},{prop:"lastLogin",label:"最后登录",align:"center"},{prop:"addDate",label:"添加时间",align:"center"}],op:{visible:!0,props:{width:120,align:"center",fixed:"right",label:"操作"},layout:["slot-auth","slot-modify","slot-del"]}}).set("layout",[["slot-tabs"],["flex1","slot-add-ad-btn","refresh-btn"],["data-table"],["flex1","pagination"]]).done(),a.refresh({type:this.tabIndex})}},"resetForm",(function(e){var t=e||"form";this.$refs[t].resetFields(),this.addDialog=!1}))},m=u,f=(a("e116"),a("1805")),h=Object(f["a"])(m,r,i,!1,null,"0e3f475c",null);t["default"]=h.exports},e52a:function(e,t,a){"use strict";a("fe3d")},fe3d:function(e,t,a){}}]);