index.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <template>
  2. <div id="index">
  3. <el-row>
  4. <el-col :span="24" class="style">
  5. <el-col :span="24" class="top">
  6. <NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow" @onClickLeft="onClickLeft"> </NavBar>
  7. </el-col>
  8. <el-col :span="24" class="main">
  9. <el-col :span="24">
  10. <van-tabs v-model="active">
  11. <van-tab title="待审核">
  12. <userlist :list="oneList" @shenhebtn="shenhebtn"></userlist>
  13. </van-tab>
  14. <van-tab title="审核通过">
  15. <userlist :list="twoList" @shenhebtn="shenhebtn"></userlist>
  16. </van-tab>
  17. <van-tab title="审核拒绝">
  18. <userlist :list="threeList" @shenhebtn="shenhebtn"></userlist>
  19. </van-tab>
  20. </van-tabs>
  21. </el-col>
  22. </el-col>
  23. </el-col>
  24. </el-row>
  25. </div>
  26. </template>
  27. <script>
  28. import { mapState, mapMutations, createNamespacedHelpers } from 'vuex';
  29. import NavBar from '@/layout/common/topInfo.vue';
  30. import userlist from './parts/userlist.vue';
  31. const { mapActions: marketuser } = createNamespacedHelpers('marketuser');
  32. export default {
  33. name: 'index',
  34. props: {},
  35. components: { NavBar, userlist },
  36. data: () => ({
  37. // 头部标题
  38. title: '',
  39. // meta为true
  40. isleftarrow: '',
  41. // 返回
  42. navShow: true,
  43. show: false,
  44. // 用户列表
  45. active: '1',
  46. // 待审核
  47. oneList: [],
  48. // 审核通过
  49. twoList: [],
  50. // 审核拒绝
  51. threeList: [],
  52. // 搜索
  53. value: '',
  54. }),
  55. async created() {
  56. await this.search();
  57. },
  58. methods: {
  59. ...marketuser(['userquery']),
  60. async search({ ...info } = {}) {
  61. let user = this.user;
  62. if (this.user.code == 'JLCJGLY') {
  63. const res = await this.userquery({ ...info });
  64. if (this.$checkRes(res)) {
  65. let one = res.data.filter(i => i.status == '0' && i.isdel == '0');
  66. if (one) this.$set(this, `oneList`, one);
  67. let two = res.data.filter(i => i.status == '1' && i.isdel == '0');
  68. if (two) this.$set(this, `twoList`, two);
  69. let three = res.data.filter(i => i.status == '2' && i.isdel == '0');
  70. if (three) this.$set(this, `threeList`, three);
  71. }
  72. } else {
  73. const res = await this.userquery({ code: this.user.code, ...info });
  74. if (this.$checkRes(res)) {
  75. let one = res.data.filter(i => i.status == '0' && i.isdel == '0');
  76. if (one) this.$set(this, `oneList`, one);
  77. let two = res.data.filter(i => i.status == '1' && i.isdel == '0');
  78. if (two) this.$set(this, `twoList`, two);
  79. let three = res.data.filter(i => i.status == '2' && i.isdel == '0');
  80. if (three) this.$set(this, `threeList`, three);
  81. }
  82. }
  83. },
  84. // 审核用户。查看用户
  85. shenhebtn(data) {
  86. this.$router.push({ path: '/adminCenter/user/detail', query: { id: data.uid, role: data.role } });
  87. },
  88. // 返回
  89. onClickLeft() {
  90. this.$router.push({ path: '/user/index' });
  91. },
  92. },
  93. computed: {
  94. ...mapState(['user']),
  95. },
  96. mounted() {
  97. this.title = this.$route.meta.title;
  98. this.isleftarrow = this.$route.meta.isleftarrow;
  99. },
  100. };
  101. </script>
  102. <style lang="less" scoped>
  103. .style {
  104. width: 100%;
  105. min-height: 667px;
  106. position: relative;
  107. background-color: #f9fafc;
  108. }
  109. .top {
  110. height: 46px;
  111. overflow: hidden;
  112. position: relative;
  113. z-index: 999;
  114. }
  115. .main {
  116. min-height: 570px;
  117. }
  118. </style>