| 12 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-c72ee85a"],{"053b":function(e,t,o){var a=o("1e2c"),r=o("d910").f,n=Function.prototype,l=n.toString,s=/^\s*function ([^ (]*)/,i="name";a&&!(i in n)&&r(n,i,{configurable:!0,get:function(){try{return l.call(this).match(s)[1]}catch(e){return""}}})},"20a5":function(e,t,o){"use strict";var a=o("1c8b"),r=o("3da3"),n=o("e1d9"),l=o("c7e6"),s=o("efe2"),i=1..toFixed,m=Math.floor,c=function(e,t,o){return 0===t?o:t%2===1?c(e,t-1,o*e):c(e*e,t/2,o)},u=function(e){var t=0,o=e;while(o>=4096)t+=12,o/=4096;while(o>=2)t+=1,o/=2;return t},f=i&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!s((function(){i.call({})}));a({target:"Number",proto:!0,forced:f},{toFixed:function(e){var t,o,a,s,i=n(this),f=r(e),p=[0,0,0,0,0,0],d="",h="0",g=function(e,t){var o=-1,a=t;while(++o<6)a+=e*p[o],p[o]=a%1e7,a=m(a/1e7)},b=function(e){var t=6,o=0;while(--t>=0)o+=p[t],p[t]=m(o/e),o=o%e*1e7},v=function(){var e=6,t="";while(--e>=0)if(""!==t||0===e||0!==p[e]){var o=String(p[e]);t=""===t?o:t+l.call("0",7-o.length)+o}return t};if(f<0||f>20)throw RangeError("Incorrect fraction digits");if(i!=i)return"NaN";if(i<=-1e21||i>=1e21)return String(i);if(i<0&&(d="-",i=-i),i>1e-21)if(t=u(i*c(2,69,1))-69,o=t<0?i*c(2,-t,1):i/c(2,t,1),o*=4503599627370496,t=52-t,t>0){g(0,o),a=f;while(a>=7)g(1e7,0),a-=7;g(c(10,a,1),0),a=t-1;while(a>=23)b(1<<23),a-=23;b(1<<a),g(1,1),b(2),h=v()}else g(0,o),g(1<<-t,0),h=v()+l.call("0",f);return f>0?(s=h.length,h=d+(s<=f?"0."+l.call("0",f-s)+h:h.slice(0,s-f)+"."+h.slice(s-f))):h=d+h,h}})},"74a5":function(e,t,o){},c7e6:function(e,t,o){"use strict";var a=o("3da3"),r=o("2732");e.exports="".repeat||function(e){var t=String(r(this)),o="",n=a(e);if(n<0||n==1/0)throw RangeError("Wrong number of repetitions");for(;n>0;(n>>>=1)&&(t+=t))1&n&&(o+=t);return o}},dbb3:function(e,t,o){"use strict";var a=o("1c8b"),r=o("5dfd").filter,n=o("1ea7"),l=o("ff9c"),s=n("filter"),i=l("filter");a({target:"Array",proto:!0,forced:!s||!i},{filter:function(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}})},e1d9:function(e,t,o){var a=o("2118");e.exports=function(e){if("number"!=typeof e&&"Number"!=a(e))throw TypeError("Incorrect invocation");return+e}},e646:function(e,t,o){"use strict";var a=o("74a5"),r=o.n(a);r.a},ee09:function(e,t,o){"use strict";o.r(t);var a=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"context"},[o("div",{staticClass:"panel"},[o("h5",[e._v("管理员管理")]),o("div",{staticClass:"panel-body"},[o("div",{staticClass:"panel_control"},[o("el-row",{attrs:{gutter:20}},[o("el-col",{attrs:{span:4}},[o("em",[e._v("姓名:")]),o("el-input",{attrs:{placeholder:"请输入用户名"},model:{value:e.panel.name,callback:function(t){e.$set(e.panel,"name",t)},expression:"panel.name"}})],1),o("el-col",{attrs:{span:4}},[o("em",[e._v("手机号:")]),o("el-input",{attrs:{placeholder:"请输入手机号"},model:{value:e.panel.phone,callback:function(t){e.$set(e.panel,"phone",t)},expression:"panel.phone"}})],1),o("el-col",{attrs:{span:4}},[o("em",[e._v("店面:")]),o("el-select",{model:{value:e.panel.shopId,callback:function(t){e.$set(e.panel,"shopId",t)},expression:"panel.shopId"}},e._l(e.panel.options,(function(e){return o("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),o("el-col",{attrs:{span:4}},[o("em",[e._v("类型:")]),o("el-select",{model:{value:e.panel.adminType,callback:function(t){e.$set(e.panel,"adminType",t)},expression:"panel.adminType"}},e._l(e.panel.typeList,(function(e){return o("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),o("el-col",{attrs:{span:4}},[o("el-button",{attrs:{size:"",type:"primary",plain:""},on:{click:e.query}},[e._v("查询")])],1)],1)],1)])]),o("div",{staticClass:"change"},[o("el-button",{on:{click:e.addAdmin}},[e._v("新增")]),o("el-button",{on:{click:e.editList}},[e._v("编辑")]),o("el-button",{on:{click:e.delList}},[e._v("删除")])],1),o("div",{staticClass:"table"},[o("el-table",{attrs:{data:e.tableData,border:"","is-horizontal-resize":"","default-sort":{prop:"date",order:"descending"},"element-loading-background":"rgba(0, 0, 0, 0.8)"},on:{"selection-change":e.handleSelectionChange,"current-change":e.clickChange}},[e._v(' @current-change="clickChange" > @current-change="clickChange" > '),o("el-table-column",{attrs:{label:"选择",width:"55"},scopedSlots:e._u([{key:"default",fn:function(t){return[o("el-radio",{attrs:{label:t.row},model:{value:e.tableRadio,callback:function(t){e.tableRadio=t},expression:"tableRadio"}},[o("i")])]}}])}),o("el-table-column",{attrs:{type:"index",label:"序号",align:"center",width:"50"}}),o("el-table-column",{attrs:{prop:"Usercode",label:"用户名",sortable:""}}),o("el-table-column",{attrs:{prop:"Name",label:"姓名",sortable:""}}),o("el-table-column",{attrs:{prop:"Phone",label:"手机号"}}),o("el-table-column",{attrs:{prop:"AdminType ",label:"角色"},scopedSlots:e._u([{key:"default",fn:function(t){return[1==t.row.AdminType?o("span",{staticStyle:{color:"#005EA2"}},[e._v("会员")]):e._e(),2==t.row.AdminType?o("span",{staticStyle:{color:"green"}},[e._v("系统管理员")]):e._e(),3==t.row.AdminType?o("span",{staticStyle:{color:"#8c939d"}},[e._v("店铺管理员")]):e._e(),4==t.row.AdminType?o("span",[e._v("教练")]):e._e()]}}])}),o("el-table-column",{attrs:{prop:"ShopName",label:"所属门店",sortable:""}}),o("el-table-column",{attrs:{prop:"LastLoginTime",label:"上次登陆时间",formatter:e.filterFmtDate,sortable:""}}),o("el-table-column",{attrs:{prop:"Memo",label:"备注",sortable:""},scopedSlots:e._u([{key:"default",fn:function(t){return[o("el-popover",{attrs:{placement:"top",title:"备注",width:"200",trigger:"hover",content:t.row.Memo}},[t.row.Memo.length>10?o("span",{attrs:{slot:"reference"},slot:"reference"},[e._v(e._s(t.row.Memo.substr(0,10))+" ....")]):e._e()]),t.row.Memo.length<=10?o("span",[e._v(e._s(t.row.Memo))]):e._e()]}}])}),o("el-table-column",{attrs:{prop:"Status",label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){return[1==t.row.Status?o("el-button",{attrs:{type:"danger",size:"mini"},on:{click:function(o){return e.runAndPause(t.row,8)}}},[e._v("禁用 ")]):e._e(),8==t.row.Status?o("el-button",{attrs:{type:"success",size:"mini"},on:{click:function(o){return e.runAndPause(t.row,1)}}},[e._v("启用 ")]):e._e()]}}])})],1),o("br"),o("el-pagination",{attrs:{background:"",total:e.pageination.total,"page-size":e.pageination.pageItem},on:{"current-change":e.pageChange}})],1),o("el-dialog",{attrs:{title:e.dialogTitle,visible:e.dialogVisible,width:"650px"},on:{"update:visible":function(t){e.dialogVisible=t}}},[o("div",[o("el-form",{ref:"form",attrs:{model:e.form,"label-width":"80px"}},[o("el-form-item",{attrs:{label:"登陆账号"}},[o("el-input",{model:{value:e.form.userCode,callback:function(t){e.$set(e.form,"userCode",t)},expression:"form.userCode"}})],1),o("el-form-item",{attrs:{label:"密码"}},[o("el-input",{attrs:{type:"password"},model:{value:e.form.password,callback:function(t){e.$set(e.form,"password",t)},expression:"form.password"}})],1),o("el-form-item",{attrs:{label:"姓名"}},[o("el-input",{model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1),o("el-form-item",{attrs:{label:"手机号"}},[o("el-input",{model:{value:e.form.phone,callback:function(t){e.$set(e.form,"phone",t)},expression:"form.phone"}})],1),o("el-form-item",{attrs:{label:"所属门店"}},[o("el-select",{attrs:{placeholder:"请选择所属门店"},model:{value:e.form.shopId,callback:function(t){e.$set(e.form,"shopId",t)},expression:"form.shopId"}},e._l(e.shops,(function(e){return o("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),o("el-form-item",{attrs:{label:"用户角色"}},[o("el-select",{attrs:{placeholder:"请选择用户角色"},model:{value:e.form.adminType,callback:function(t){e.$set(e.form,"adminType",t)},expression:"form.adminType "}},e._l(e.form.adminTypeList,(function(e){return o("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),o("el-form-item",{attrs:{label:"备注"}},[o("el-input",{model:{value:e.form.memo,callback:function(t){e.$set(e.form,"memo",t)},expression:"form.memo"}})],1)],1)],1),o("div",{staticClass:"dialogFooter"},[0==e.form.btnState?o("el-button",{attrs:{type:"primary",size:"small"},on:{click:e.confirmAdmin}},[e._v("确定")]):e._e(),1==e.form.btnState?o("el-button",{attrs:{type:"primary",size:"small"},on:{click:e.confirmEdit}},[e._v("确定")]):e._e(),o("el-button",{attrs:{size:"small"},on:{click:function(t){e.dialogVisible=!1}}},[e._v("取消")])],1)])],1)},r=[],n=(o("dbb3"),o("053b"),o("20a5"),o("379d"),o("b8a1")),l=o("1cfa"),s={data:function(){return{dialogVisible:!1,dialogTitle:"新增",panel:{userCode:"",name:"",phone:"",shopId:"",options:[],draw:1,start:0,recordsTotal:0,tableData:[],allTableData:[],limit:"10",multipleSort:!1,loading:!1,fileList:[],multipleSelection:[],detectedmac:"",time1:globalBt(),type:" ",adminType:"",typeList:[{value:"",label:"全部"},{value:3,label:"店铺管理员"},{value:4,label:"教练"}]},multipleSelection:[],pageination:{pageItem:100,pageoptions:pageOptions(),total:100,pageIndex:1},form:{shopId:"",userId:"",userCode:"",password:"",name:"",phone:"",memo:"",btnState:0,adminType:3,adminTypeList:[{value:3,label:"店铺管理员"},{value:4,label:"教练"}]},shops:[],tableData:[],tableRadio:[]}},mounted:function(){this.getTableQuery()},methods:{clickChange:function(e){this.tableRadio=e},confirmAdmin:function(){var e=this;if(!e.form.userCode)return this.$message.error("错了哦,登陆账号不能为空"),!1;if(e.form.name.length>20)return this.$message.error("错了哦,登陆账号字数超过20个字"),!1;if(!e.form.password)return this.$message.error("错了哦,密码不能为空"),!1;if(e.form.password.length<6)return this.$message.error("错了哦,密码字数小于6个字"),!1;if(e.form.password.length>8)return this.$message.error("错了哦,密码字数超过8个字"),!1;if(!e.form.name)return this.$message.error("错了哦,姓名不能为空"),!1;if(e.form.name.length>8)return this.$message.error("错了哦,姓名字数超过8个字"),!1;if(!e.form.phone)return this.$message.error("错了哦,手机号码不能为空"),!1;if(!globalCheckPhone(e.form.phone))return this.$message.error("错了哦,手机号格式不正确"),!1;if(e.form.memo&&e.form.name.memo>200)return this.$message.error("错了哦,备注字数超过200个字"),!1;var t={token:localStorage.token,shopId:e.form.shopId,usercode:e.form.userCode,password:e.form.password,name:e.form.name,phone:e.form.phone,adminType:e.form.adminType,memo:e.form.memo},o=l.stringify(t);Object(n["R"])(o).then((function(t){var o=t;0==o.Code?(e.dialogVisible=!1,e.$message({showClose:!0,message:"管理员添加成功!",type:"success"}),e.getTableQuery()):e.$message.error(o.Memo)}))},confirmEdit:function(){var e=this;if(!e.form.userCode)return this.$message.error("错了哦,登陆账号不能为空"),!1;if(e.form.name.length>20)return this.$message.error("错了哦,登陆账号字数超过20个字"),!1;if(e.form.password){if(e.form.password.length<6)return this.$message.error("错了哦,密码字数小于6个字"),!1;if(e.form.password.length>8)return this.$message.error("错了哦,密码字数超过8个字"),!1}if(!e.form.name)return this.$message.error("错了哦,姓名不能为空"),!1;if(e.form.name.length>8)return this.$message.error("错了哦,姓名字数超过8个字"),!1;if(!e.form.phone)return this.$message.error("错了哦,手机号码不能为空"),!1;if(!globalCheckPhone(e.form.phone))return this.$message.error("错了哦,手机号格式不正确"),!1;if(e.form.memo&&e.form.name.memo>200)return this.$message.error("错了哦,备注字数超过200个字"),!1;var t={token:localStorage.token,userId:e.form.userId,shopId:e.form.shopId,usercode:e.form.userCode,password:e.form.password,name:e.form.name,phone:e.form.phone,memo:e.form.memo},o=l.stringify(t);Object(n["S"])(o).then((function(t){var o=t;0==o.Code?(e.dialogVisible=!1,e.$message({showClose:!0,message:"管理员信息修改成功!",type:"success"}),e.getTableQuery()):e.$message.error(o.Memo)}))},panelSelect:function(){var e=this,t={token:localStorage.token},o=l.stringify(t);Object(n["Q"])(o).then((function(t){var o=t;if(0==o.Code){if(""==o.Rs)return e.$message.error("当前没有可选的店铺,请先在店面管理中添加店铺!"),!1;e.panel.options=turnShopResToOption(o.Rs),e.shops=turnShopResToOption(o.Rs),e.form.shopId=o.Rs[0].ShopID,e.panel.options.unshift({value:"",label:"全部"})}else e.$message.error(o.Memo)}))},delList:function(){var e=this,t=this;if(0==this.tableRadio.length)return this.$message.error("请先选中一条记录"),!1;var o=this.tableRadio.Id,a={token:localStorage.token,userId:o,status:9},r=l.stringify(a);this.$confirm("此操作将永久删除该管理员, 是否继续?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){Object(n["U"])(r).then((function(e){var o=e;0==o.Code?(t.$message({showClose:!0,message:"选中的管理员已删除!",type:"success"}),t.getTableQuery()):t.$message.error(o.Memo)}))})).catch((function(){e.$message({type:"info",message:"已取消删除"})}))},runAndPause:function(e,t){var o=this,a={token:localStorage.token,userId:e.Id,status:t},r=l.stringify(a);Object(n["U"])(r).then((function(e){var t=e;0==t.Code?(o.$message({showClose:!0,message:"管理员状态已修改成功!",type:"success"}),o.getTableQuery()):o.$message.error(t.Memo)}))},clearForm:function(){this.form.shopId=0,this.form.name="",this.form.userCode="",this.form.password="",this.form.phone="",this.form.memo=""},addAdmin:function(){this.clearForm(),this.panelSelect(),this.dialogVisible=!0,this.dialogTitle="新增",this.form.btnState=0},editList:function(){if(this.clearForm(),this.panelSelect(),console.log(this.tableRadio),0==this.tableRadio.length)return this.$message.error("请先选中一条记录"),!1;var e=this.tableRadio;this.form.shopid=e.ShopId,this.form.userId=e.Id,this.form.name=e.Name,this.form.userCode=e.Usercode,this.form.password="",this.form.phone=e.Phone,this.form.memo=e.Memo,this.form.adminType=e.AdminType,this.dialogVisible=!0,this.dialogTitle="编辑",this.form.btnState=1},handleSelectionChange:function(e){this.multipleSelection=e},query:function(){this.getTableQuery(),this.$message.success("查询完毕")},getTableQuery:function(){var e=this;e.loading=!0;var t={token:localStorage.token,shopId:this.panel.shopId,name:this.panel.name,phone:this.panel.phone,adminType:this.panel.adminType,start:1,tableMax:9999},o=l.stringify(t);Object(n["T"])(o).then((function(t){var o=t;0==o.Code?(e.loading=!1,o.Rs?(e.allTableData=o.Rs,e.recordsTotal=o.Rs.length):(e.allTableData=[],e.recordsTotal=0),e.setPaginations()):e.$message.error(o.Memo)}))},setPaginations:function(){var e=this;e.pageination.total=e.recordsTotal,e.tableData=e.allTableData.filter((function(t,o){return o<e.pageination.pageItem}))},handleSizeChange:function(){var e=this;e.tableData=e.allTableData.filter((function(t,o){return o<e.pageination.pageItem})),e.draw=e.pageination.pageItem,e.getTableQuery()},pageChange:function(e){for(var t=this,o=t.pageination.pageItem*(e-1),a=t.pageination.pageItem*e,r=[],n=o;n<a;n++)t.allTableData[n]&&r.push(t.allTableData[n]),this.tableData=r;t.start=o*t.draw,t.getTableQuery()},sortChange:function(e){console.log(e)},filterFmtDate:function(e,t,o){return nonTfmtDate(o,11)},filterMoney:function(e,t,o){return parseFloat(o).toFixed(2)}},watch:{$route:function(e){"AdminManage"==e.name&&this.getTableQuery()}}},i=s,m=(o("e646"),o("9ca4")),c=Object(m["a"])(i,a,r,!1,null,"6b5e5fbe",null);t["default"]=c.exports}}]);
- //# sourceMappingURL=chunk-c72ee85a.cd919b6a.js.map
|