| 1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-6c28aad9","chunk-46366c28","chunk-a32cf3d6"],{"0c0b":function(e,t,s){"use strict";s.r(t);var i=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(s,i){return t("div",{key:i,staticClass:"role-list"},[t("el-checkbox",{attrs:{indeterminate:e.isIndeterminate[i]},on:{change:function(t){return e.handleCheckAllChange(t,i)}},model:{value:e.checkAll[i],callback:function(t){e.$set(e.checkAll,i,t)},expression:"checkAll[index]"}},[e._v(e._s(s.authName))]),t("div",{staticStyle:{margin:"15px 0"}}),t("el-checkbox-group",{on:{change:function(t){return e.handlecheckedPermChange(t,i)}},model:{value:e.checkedPerm,callback:function(t){e.checkedPerm=t},expression:"checkedPerm"}},e._l(s.children,(function(s,i){return t("el-checkbox",{key:s.id,attrs:{label:s.id}},[e._v(e._s(s.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)])},a=[],r=(s("b138"),s("8f26"),s("963e"),{name:"role-set",props:{show:{type:Boolean,default:!1},info:{type:Object,default:()=>{}}},data(){return{showStatus:!1,data:{},permTree:[],checkAll:[],checkedPerm:[],isIndeterminate:[]}},watch:{show(e){this.showStatus=e,e&&this.init()}},methods:{init(){this._getTreeB().then(e=>{console.log("res",e),"business"==this.$projectName&&this._getAuthB()})},async _getTreeB(){let e={};return await this.$service.common.permTree({endId:1}).then(t=>{this.permTree=t,this.permTree.map(()=>{this.isIndeterminate.push(!1),this.checkAll.push(!1)}),e=t}),e},async _getAuthB(){let e={};return await this.$service.auth.authList({roleId:this.info.roleId}).then(t=>{e=t}),e},saveFn(){console.log("this.info",this.info),this.$service.auth.authUpdate({roleId:this.info.roleId,authIdList:this.checkedPerm}).then(e=>{this.closeFn(),this.$message.success("保存成功!")})},closeFn(e){this.$emit("update:show",!1),e&&e()},handleCheckAllChange(e,t){let s=this.permTree[t].children?this.permTree[t].children:this.permTree[t];s=s.map(e=>e.id),this.checkedPerm=e?s:[],this.$set(this.isIndeterminate,t,!1)},handlecheckedPermChange(e,t){let s=e.length,i=this.permTree[t].children?this.permTree[t].children.length:0,a=s===i;this.$set(this.checkAll,t,a);let r=s>0&&s<i;this.$set(this.isIndeterminate,t,r)}}}),o=r,l=(s("e52a"),s("1805")),n=Object(l["a"])(o,i,a,!1,null,"cc52c0b6",null);t["default"]=n.exports},"32d0":function(e,t,s){"use strict";s("73cb")},6898:function(e,t,s){"use strict";s.r(t);var i=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({scope:s}){return[t("div",[t("el-radio",{attrs:{label:s.row.index}},[e._v("选择")])],1)]}},{key:"table-column-userName",fn:function({scope:s}){return[t("div",{staticClass:"flex-center"},[t("cl-avatar",{attrs:{shape:"square",size:40,src:e._f("default_avatar")(s.row.avatar)}}),t("div",{staticClass:"app-margin-left-10"},[e._v(e._s(s.row.userName))])],1)]}},{key:"table-column-member",fn:function({scope:s}){return[-1==s.row.member?t("div",[e._v("非会员")]):t("div",[e._v(e._s(s.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)])},a=[],r=(s("8f26"),s("963e"),{name:"sel-search",props:{show:{type:Boolean,default:!1},multi:{type:Boolean,default:!1}},data(){return{selDialog:!1,ruleForm:{},radio:"",list:[],selData:{}}},watch:{show(e){this.selDialog=e}},created(){},methods:{confirmFn(){this.$emit("confirm",this.list[this.radio])},resetForm(){this.$emit("update:show",!1),this.$emit("cancel")},onLoad({ctx:e,app:t}){this.app=t,e.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",async(e,{next:t,render:s})=>{let{list:i}=await t(e);i.map((e,t)=>{e.index=t}),this.list=i,s(i)}).done(),t.refresh({type:this.tabIndex})}}}),o=r,l=(s("7d50"),s("1805")),n=Object(l["a"])(o,i,a,!1,null,null,null);t["default"]=n.exports},"6e74":function(e,t,s){},"73cb":function(e,t,s){},"7d50":function(e,t,s){"use strict";s("6e74")},e25e:function(e,t,s){"use strict";s.r(t);var i=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({scope:e}){return[0!=e.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({scope:e}){return[t("cl-avatar",{style:{margin:"auto"},attrs:{shape:"circle",size:24,src:e.row.avatar}})]}},{key:"table-column-incomeNotice",fn:function({scope:s}){return[t("el-switch",{attrs:{"active-value":"1","inactive-value":"0"},on:{change:t=>{e.changeNotice(s.row.id,t)}},model:{value:s.row.remind,callback:function(t){e.$set(s.row,"remind",t)},expression:"scope.row.remind"}})]}},{key:"table-column-status",fn:function({scope:s}){return[t("el-switch",{attrs:{"active-value":"1","inactive-value":"0"},on:{change:t=>{e.changeStatus(s.row.id,t)}},model:{value:s.row.status,callback:function(t){e.$set(s.row,"status",t)},expression:"scope.row.status"}})]}},{key:"slot-modify",fn:function({scope:s}){return[t("el-button",{attrs:{type:"text"},on:{click:function(t){return e.modifyBtnFn(s.row)}}},[e._v("编辑")])]}},{key:"slot-del",fn:function({scope:s}){return[t("el-button",{attrs:{type:"text"},on:{click:function(t){return e.delBtnFn(s.row)}}},[e._v("删除")])]}},{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:(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(s,i){return t("el-option",{key:i,attrs:{value:s.roleName}},[e._v(e._s(s.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)},a=[],r=(s("8f26"),s("666b"),s("209c"),s("f803"),s("6898")),o=s("0c0b"),l={name:"list-ad",components:{selMember:r["default"],roleSet:o["default"]},data(){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:{getRole(){if(!this.$util.isEmpty(this.roleList))return this.roleList;this.$service.role.list().then(e=>{this.roleList=e.list})},delBtnFn(e){this.$confirm("是否删除该员工?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{this.$service.staff.delete({id:e.id}).then(e=>{this.$message.success("删除成功!"),this.app.refresh({type:this.tabIndex})})}).catch()},authBtnFn(e){this.modifyData=e,this.roleShow=!0},modifyBtnFn(e){this.$service.shopAdmin.info({id:e.id}).then(async e=>{let t={};e.userId&&"0"!=e.userId&&(t=await this.$service.member.info({userId:e.userId})),this.getRole(),this.memberData=t,this.addOrModify=2,this.modifyData=e,this.addDialog=!0;let s=JSON.parse(JSON.stringify(e));s.startTime=this.$util.$formatDate(s.startTime),s.endTime=this.$util.$formatDate(s.endTime),this.$util.isEmpty(s)||(Object.keys(this.adForm).forEach(e=>{this.adForm[e]=s[e]}),this.ruleForm.password.required=!1)})},addBtnFn(){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(e,t){this.$service.common.updateRemind({id:e,remind:t}).then(e=>{this.$message.success("操作成功!"),this.app.refresh()})},changeStatus(e,t){this.$service.common.updateStatus({id:e,status:t}).then(e=>{this.$message.success("操作成功!"),this.app.refresh()})},selRoleFn(e){let t=this.roleList.findIndex(t=>t.roleName==e);this.adForm.roleId=this.roleList[t].id,console.log("this.adForm.roleId",this.adForm.roleId)},resetForm(){this.$refs["adForm"].resetFields(),this.memberData={},this.addDialog=!1},addFn(){let e=JSON.parse(JSON.stringify(this.adForm)),t=null;delete e.roleName,t=1==this.addOrModify?()=>this.$service.shopAdmin.prepareBind(this.adForm):()=>this.$service.shopAdmin.update({id:this.modifyData.id,...e}),t(e).then(e=>{this.miniCodeSrc=e.miniCode,this.showMiniCode=!0,this.resetForm(),this.app.refresh({type:this.tabIndex})})},selGoods(){this.selMemberModal=!0,setTimeout(()=>{console.log(this.memberData)},6e3)},selMemberConfirmFn(e){this.memberData=e,this.adForm.userId=e.id,this.selMemberModal=!1},submitForm(e){this.$refs[e].validate(e=>{if(!e)return console.log("error submit!!"),!1;this.addFn()})},onLoad({ctx:e,app:t}){this.app=t,e.service(this.$service.shopAdmin).set("table",{columns:[{prop:"id",label:"id",align:"center",width:110},{prop:"avatar",label:"头像",align:"center",width:130},{prop:"name",label:"姓名",align:"center"},{prop:"mobile",label:"手机号",align:"center",width:200},{prop:"roleName",label:"角色",align:"center",width:150},{prop:"incomeNotice",label:"收款通知",align:"center",width:150},{prop:"status",label:"启用状态",align:"center",width:150},{prop:"addTime",label:"添加时间",align:"center",width:190}],op:{visible:!0,props:{width:250,align:"center",fixed:"right",label:"操作"},layout:[]}}).set("layout",[["slot-tabs"],["flex1","refresh-btn"],["data-table"],["flex1","pagination"]]).done(),t.refresh({type:this.tabIndex})}}},n=l,c=(s("32d0"),s("1805")),d=Object(c["a"])(n,i,a,!1,null,"7b3b38dd",null);t["default"]=d.exports},e52a:function(e,t,s){"use strict";s("fe3d")},fe3d:function(e,t,s){}}]);
|