index.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <template>
  2. <div class="padding-20">
  3. <div class="search-box">
  4. <el-form
  5. ref="form"
  6. :inline="true"
  7. :model="searchForm"
  8. clearable
  9. class="mt-10">
  10. <el-form-item label="用户手机:">
  11. <el-input v-model="searchForm.user_phone" placeholder="请输入用户手机" clearable></el-input>
  12. </el-form-item>
  13. <el-form-item label="注册时间:">
  14. <el-date-picker
  15. :editable="false"
  16. v-model="time"
  17. @change="timearr => {timearr ? (searchForm.register_start_time = timearr[0] + ' 00:00:00', searchForm.register_end_time = timearr[1] + ' 23:59:59') : searchForm.register_start_time = searchForm.register_end_time = undefined}"
  18. type="daterange"
  19. value-format="yyyy-MM-dd"
  20. start-placeholder="开始时间"
  21. end-placeholder="结束时间"
  22. ></el-date-picker>
  23. </el-form-item>
  24. <el-form-item class="ml-10">
  25. <el-button icon="el-icon-search" type="primary" @click="searchSubmit">查询</el-button>
  26. </el-form-item>
  27. </el-form>
  28. </div>
  29. <el-table :data="tableData"
  30. stripe
  31. v-loading="tableLoading"
  32. fit class="marginT-10 order-table"
  33. border
  34. :max-height="vheight">
  35. <el-table-column label="ID" prop="id" width="80"></el-table-column>
  36. <el-table-column label="头像" width="130">
  37. <template slot-scope="scope">
  38. <el-image style="width: 100px; height: 100px"
  39. :src="scope.row.user_head_url"
  40. :preview-src-list="[scope.row.user_head_url]">
  41. </el-image>
  42. </template>
  43. </el-table-column>
  44. <el-table-column label="昵称" prop="user_name" width="160"></el-table-column>
  45. <el-table-column label="手机号" prop="user_phone" width="120"></el-table-column>
  46. <el-table-column label="生日" prop="user_birthday"></el-table-column>
  47. <el-table-column label="性别" prop="user_sex"></el-table-column>
  48. <el-table-column label="用户角色">
  49. <template slot-scope="scope">
  50. <p>{{ ['用户', '艺人', '吧台', '老板'][scope.row.user_type] }}</p>
  51. </template>
  52. </el-table-column>
  53. <el-table-column label="注册时间" prop="created_at" width="160"></el-table-column>
  54. <el-table-column label="最近一次登录时间" prop="user_login_at" width="160"></el-table-column>
  55. <el-table-column label="操作" fixed="right" width="140">
  56. <template slot-scope="scope">
  57. <!--todo 设置权限-->
  58. <el-button type="text" @click="edit(scope.row)">编辑</el-button>
  59. <el-button type="text" v-permission="'ums_customer_check'"
  60. @click="$router.push({name: 'FmsCheck', query: {user_id: scope.row.id }})">消费记录
  61. </el-button>
  62. </template>
  63. </el-table-column>
  64. </el-table>
  65. <el-pagination
  66. class="marginT-20"
  67. @size-change="handleSizeChange"
  68. @current-change="handleCurrentChange"
  69. :hide-on-single-page="true"
  70. :current-page="page"
  71. :page-size="page_size"
  72. :page-sizes="[10, 20, 100, 200, 300, 400]"
  73. background
  74. layout="total, sizes, prev, pager, next, jumper"
  75. :total="totalCount"/>
  76. <detail v-if="detailsDialog.show"
  77. v-model="detailsDialog.show"
  78. :exData="detailsDialog.exData"
  79. @success="init"></detail>
  80. </div>
  81. </template>
  82. <script>
  83. import page from '@/mixin/page'
  84. import detail from './details'
  85. export default {
  86. mixins: [page],
  87. components: {
  88. detail,
  89. },
  90. data () {
  91. return {
  92. detailsDialog: {
  93. show: false,
  94. exData: {}
  95. },
  96. time: [],
  97. searchForm: {},
  98. tableData: [],
  99. tableUrl: '/v1/user/member/List'
  100. }
  101. },
  102. methods: {
  103. edit (row) {
  104. this.detailsDialog.exData = row
  105. this.detailsDialog.show = true
  106. }
  107. },
  108. mounted () {
  109. this.init()
  110. }
  111. }
  112. </script>
  113. <style lang="scss" scoped>
  114. </style>