chunk-dce2f862.7a6fe998.js 9.9 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-dce2f862"],{"73f5":function(t,e,a){"use strict";a.d(e,"j",(function(){return r})),a.d(e,"l",(function(){return i})),a.d(e,"n",(function(){return o})),a.d(e,"o",(function(){return s})),a.d(e,"m",(function(){return l})),a.d(e,"b",(function(){return c})),a.d(e,"f",(function(){return u})),a.d(e,"e",(function(){return d})),a.d(e,"k",(function(){return f})),a.d(e,"i",(function(){return m})),a.d(e,"d",(function(){return h})),a.d(e,"a",(function(){return p})),a.d(e,"h",(function(){return g})),a.d(e,"g",(function(){return b})),a.d(e,"c",(function(){return _}));var n=a("b775"),r=function(t){return Object(n["a"])({url:"/store/disabled",method:"post",params:t})},i=function(t){return Object(n["a"])({url:"/store/list",method:"get",params:t})},o=function(t){return Object(n["a"])({url:"/store/get_all_user",method:"get",params:t})},s=function(t){return Object(n["a"])({url:"/user/disabled",method:"post",data:t})},l=function(t){return Object(n["a"])({url:"/store/query",method:"get",params:t})},c=function(t){return Object(n["a"])({url:"/store/get_account_info",method:"get",params:t})},u=function(t){return Object(n["a"])({url:"/store/get_withdrawal_state",method:"get",params:t})},d=function(t){return Object(n["a"])({url:"/store/get_account_detail",method:"get",params:t})},f=function(t){return Object(n["a"])({url:"/store/export",method:"get",params:t})},m=function(t){return Object(n["a"])({url:"/store/set_wx_auth",method:"post",data:t})},h=function(t){return Object(n["a"])({url:"/store/get_data_info",method:"get",params:t})},p=function(t){return Object(n["a"])({url:"/store/deleteStore",method:"post",params:t})},g=function(t){return Object(n["a"])({url:"/store/resDelStore",method:"post",params:t})},b=function(t){return Object(n["a"])({url:"/store/newStore",method:"post",params:t})},_=function(t){return Object(n["a"])({url:"/store/get_account_detail_all",method:"get",params:t})}},"822f":function(t,e,a){"use strict";a("ca09")},a062:function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"content"},[a("div",{staticClass:"search_box"},[a("el-input",{attrs:{clearable:"",maxlength:"11",placeholder:"手机号或昵称","prefix-icon":"el-icon-search"},on:{clear:function(e){t.params.page_index=1,t.getList()}},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.handleSearch()}},model:{value:t.params.search_name,callback:function(e){t.$set(t.params,"search_name",e)},expression:"params.search_name"}}),a("el-button",{attrs:{type:"primary",icon:"el-icon-search",loading:t.loading},on:{click:function(e){return t.handleSearch()}}},[t._v("搜索/刷新")]),a("el-button",{attrs:{type:"primary",icon:"el-icon-download"},on:{click:t.exportExcel}},[t._v("导出")])],1),a("div",{staticClass:"table_box"},[a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],ref:"listTable",staticStyle:{width:"100%"},attrs:{"header-cell-style":{background:"#f8fbfc"},border:"",stripe:"",data:t.list,height:t.tableHeight+"px","cell-style":{padding:"10px 0"}}},[a("el-table-column",{attrs:{label:"序号",type:"index",width:"50",align:"center",index:function(e){return t.params.page_size*(t.params.page_index-1)+e+1}}}),a("el-table-column",{staticStyle:{padding:"0"},attrs:{label:"头像",prop:"avatar",width:"80","label-class-name":"label",align:"center"},scopedSlots:t._u([{key:"default",fn:function(t){return[a("img",{staticClass:"hoverImg",attrs:{width:"36",height:"36",src:t.row.avatar}})]}}])}),a("el-table-column",{attrs:{label:"昵称",prop:"nickname",align:"center"}}),a("el-table-column",{attrs:{label:"手机号",prop:"phone",align:"center"}}),a("el-table-column",{attrs:{label:"用户状态",prop:"status",width:"300",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){var n=e.row;return[a("el-tag",{attrs:{type:0===n.status?"success":"danger"}},[t._v(t._s(0===n.status?"启用":"禁用"))])]}}])}),a("el-table-column",{attrs:{label:"操作",prop:"status",width:"300",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){var n=e.row;return[a("el-button",{attrs:{type:"text"},on:{click:function(e){return t.handleDisable(n)}}},[t._v(t._s(0===n.status?"禁用":"启用"))]),a("el-button",{directives:[{name:"permit",rawName:"v-permit",value:0,expression:"0"}],attrs:{type:"text","roles-permit":t.roles},on:{click:function(e){return t.handleEdit(n)}}},[t._v("修改")])]}}])})],1)],1),a("el-dialog",{attrs:{title:"修改用户",visible:t.dialogFormVisible,width:"30%"},on:{"update:visible":function(e){t.dialogFormVisible=e}}},[a("el-form",{attrs:{model:t.userInfo}},[a("el-form-item",{attrs:{label:"用户昵称:","label-width":t.formLabelWidth}},[a("el-input",{staticStyle:{width:"300px"},attrs:{autocomplete:"off"},model:{value:t.userInfo.nickname,callback:function(e){t.$set(t.userInfo,"nickname",e)},expression:"userInfo.nickname"}})],1),a("el-form-item",{attrs:{label:"手机区号:","label-width":t.formLabelWidth}},[a("el-select",{staticStyle:{width:"300px"},attrs:{placeholder:"请选择手机区号"},model:{value:t.userInfo.area_code,callback:function(e){t.$set(t.userInfo,"area_code",e)},expression:"userInfo.area_code"}},[a("el-option",{attrs:{label:"中国大陆(+86)",value:"+86"}}),a("el-option",{attrs:{label:"中国澳门(+853)",value:"+853"}}),a("el-option",{attrs:{label:"中国台湾(+886)",value:"+886"}}),a("el-option",{attrs:{label:"中国香港(+852)",value:"+852"}})],1)],1),a("el-form-item",{attrs:{label:"用户手机号:","label-width":t.formLabelWidth}},[a("el-input",{staticStyle:{width:"300px"},attrs:{autocomplete:"off",maxlength:"11"},model:{value:t.userInfo.phone,callback:function(e){t.$set(t.userInfo,"phone",e)},expression:"userInfo.phone"}})],1)],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(e){t.dialogFormVisible=!1}}},[t._v("取 消")]),a("el-button",{attrs:{type:"primary"},on:{click:t.editUser}},[t._v("确 定")])],1)],1),a("div",{staticClass:"batch-container"},[a("pagination",{attrs:{total:t.totalPage,limit:t.params.page_size,page:t.params.page_index},on:{pagination:t.changePagination,"update:limit":t.changePagination}})],1)],1)},r=[],i=(a("a9e3"),a("ac1f"),a("466d"),a("b0c0"),a("99af"),a("d81d"),a("d3b7"),a("3ca3"),a("ddb0"),a("b775")),o=function(t){return Object(i["a"])({url:"/user/list",method:"get",params:t})},s=function(t){return Object(i["a"])({url:"/user/export",method:"get",params:t})},l=function(t){return Object(i["a"])({url:"/user/editUserInfo",method:"post",data:t})},c=a("73f5"),u=a("8975"),d={name:"UserList",filters:{getStatus:function(t){return 1===t}},data:function(){return{roles:this.$route.meta.buttonAuthList?this.$route.meta.buttonAuthList:[],formLabelWidth:"120px",userInfo:{nickname:"",phone:"",id:"",area_code:"+86"},total:0,loading:!1,dialogFormVisible:!1,form:{},params:{page_index:1,page_size:20,search_name:""},list:[],totalPage:0,tableHeight:0,isMatch:/^[1-9]\d{5}(18|19|20|(3\d))\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/}},created:function(){this.getList()},mounted:function(){var t=this;this.$nextTick((function(){t.tableHeight=document.getElementsByClassName("table_box")[0].offsetHeight}))},methods:{handleEdit:function(t){this.dialogFormVisible=!0,this.userInfo.nickname=t.nickname,this.userInfo.phone=t.phone,this.userInfo.id=t.id,this.userInfo.area_code=t.area_code?t.area_code:"+86"},getCodeInfo:function(t){t=Number(t);var e="";return 86===t?e=/^[1][3-8]\d{9}$/:853===t?e=/^[0][9]\d{8}$/:886===t?e=/^[0]{1}[9]{1}\d{8}$/:852===t&&(e=/^([6|9|5])\d{7}$/),e},editUser:function(){var t=this,e=this.userInfo,a=e.nickname,n=e.phone,r=e.id,i=e.area_code;if(a)if(i){var o=i,s=o.indexOf("+");o=o.substring(s+1),this.isMatch=this.getCodeInfo(o),n?n.match(this.isMatch)?l({id:r,nickname:a,phone:n,area_code:i}).then((function(e){200===e.code?(t.$message.success("修改成功"),t.getList(),t.dialogFormVisible=!1):t.$message.error(e.message||"修改失败")})):this.$message.warning("手机号格式错误"):this.$message.warning("请填写用户手机号与区号不匹配")}else this.$message.warning("请选择手机区号");else this.$message.warning("请填写用户昵称")},handleDisable:function(t){var e=this,a=t.id,n=t.name,r=t.status,i=0==r?"禁用":"启用";this.$confirm("确认要".concat(i).concat(n),{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(t){Object(c["o"])({id:a}).then((function(t){200==t.code?(e.getList(),e.$message.success(0==r?"已禁用".concat(n):"已启用".concat(n))):e.$message.error("设置失败")}))}))},exportExcel:function(){var t=this,e=this.params;s(e).then((function(e){if(200==e.code){var n=e.data;if(n.length<1)return t.$message.error("暂无可导出数据"),!1;var r=["序号","昵称","手机号","用户状态"];n.map((function(t,e){t.index=e+1,t.status=0==t.status?"启用":"禁用"}));var i=["index","nickname","phone","status"],o=t.formatJson(i,n);Promise.all([a.e("chunk-1457ffd4"),a.e("chunk-2133cd4f")]).then(a.bind(null,"4bf8")).then((function(t){t.export_json_to_excel({header:r,data:o,filename:"".concat(Object(u["formatter"])(new Date,"yyyy-MM-dd"),"用户列表"),bookType:"xlsx"})}))}}))},formatJson:function(t,e){return e.map((function(e){return t.map((function(t){return"timestamp"===t?parseTime(e[t]):e[t]}))}))},getList:function(){var t=this,e=this.params,a=e.page_index,n=e.page_size,r=e.search_name;o({page_index:a,page_size:n,search_name:r}).then((function(e){200===e.code?(t.list=e.data.list,t.totalPage=e.data.total):t.$message.error(e.msg||"获取用户列表失败")})).catch((function(t){})).finally((function(e){t.loading=!1}))},handleSearch:function(t){this.params.search_name?(this.loading=!0,!t&&(this.page=1),this.getList()):(this.page=1,this.created())},changePagination:function(t){var e=t.page,a=t.limit;this.params.page_size=a,this.params.page_index=e,this.getList()}}},f=d,m=(a("822f"),a("2877")),h=Object(m["a"])(f,n,r,!1,null,"6d6ba16b",null);e["default"]=h.exports},ca09:function(t,e,a){}}]);