index.vue 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <template>
  2. <div class="subPage">
  3. <div class="system-table-search">
  4. <div class="flex-h">
  5. <div class="flex-item flex-h"></div>
  6. <tableSearch value="请输入用户手机号" @exportSearchKey="searchList"></tableSearch>
  7. </div>
  8. <div class="moreFilter"></div>
  9. </div>
  10. <div class="system-table-box">
  11. <el-table
  12. :data="currentList"
  13. stripe
  14. style="width: 100%">
  15. <el-table-column
  16. prop="Name"
  17. label="姓名">
  18. </el-table-column>
  19. <el-table-column
  20. prop="Phone"
  21. label="手机号">
  22. </el-table-column>
  23. <el-table-column
  24. prop="CustomerName"
  25. label="微信昵称">
  26. </el-table-column>
  27. <el-table-column
  28. prop="RecommendName"
  29. label="推荐人">
  30. </el-table-column>
  31. <el-table-column
  32. prop="Points"
  33. label="积分">
  34. </el-table-column>
  35. <el-table-column
  36. prop="OpenId"
  37. label="openId">
  38. </el-table-column>
  39. <el-table-column
  40. label="创建时间">
  41. <template slot-scope="scope">
  42. <label>{{FormatDate(scope.row.CreateDate)}}</label>
  43. </template>
  44. </el-table-column>
  45. </el-table>
  46. </div>
  47. <el-pagination
  48. @current-change="handleCurrentChange"
  49. :current-page.sync="postData.page"
  50. :page-size="postData.pagesize"
  51. layout="prev, pager, next, jumper"
  52. :total="total">
  53. </el-pagination>
  54. </div>
  55. </template>
  56. <script>
  57. import tableSearch from '@/components/tableSearch/index'
  58. export default {
  59. name: '',
  60. data () {
  61. return {
  62. total: 0,
  63. postData: { // 表格搜索条件
  64. phone: '', // 手机号
  65. page: 1, // 当前页码
  66. pagesize: 10, // 请求数据量
  67. },
  68. currentList: [],
  69. }
  70. },
  71. components: {
  72. tableSearch,
  73. },
  74. mounted () {
  75. this.$nextTick(function () {
  76. this.getList()
  77. })
  78. },
  79. methods: {
  80. FormatDate (date) {
  81. return this.toolClass.dateFormat(date)
  82. },
  83. handleCurrentChange (val) {
  84. this.getList()
  85. },
  86. searchList (key) { // 搜索列表
  87. this.postData.phone = key
  88. this.postData.page = 1
  89. this.getList()
  90. },
  91. getList () {
  92. this.$ajax(this.$api.dataStatistics.getCustomerList.url, {
  93. method: this.$api.dataStatistics.getCustomerList.method,
  94. queryData: this.postData
  95. }).then(res => {
  96. this.currentList = res.list
  97. this.postData.page = res.page
  98. this.total = res.pagenum
  99. })
  100. }
  101. }
  102. }
  103. </script>
  104. <!-- Add "scoped" attribute to limit CSS to this component only -->
  105. <style lang="scss" scoped>
  106. @import "page.scss";
  107. </style>