reservations.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <template>
  2. <div class="app-container">
  3. <div class="filter-container">
  4. <el-form
  5. :model="filter"
  6. v-bind:inline="true"
  7. label-position="left"
  8. label-width="100px"
  9. style="width: 100%;">
  10. <div class="filter-view">
  11. <div style="flex: 1; max-width: 350px;">
  12. <el-input
  13. v-model="filter.chargeBoxId"
  14. placeholder="Search by User ID, Email, Phone or Licence Plate"
  15. @keyup.enter.native="handleFilter" />
  16. </div>
  17. <div>
  18. <el-button
  19. type="primary"
  20. icon="el-icon-search"
  21. @click="handleFilter">
  22. Search
  23. </el-button>
  24. </div>
  25. </div>
  26. </el-form>
  27. </div>
  28. <el-table
  29. v-loading="listLoading"
  30. :data="tableList"
  31. fit
  32. style="width: 100%;">
  33. <el-table-column
  34. label="User ID"
  35. align="center"
  36. min-width="100">
  37. <template slot-scope="{row}">
  38. <span>{{ row.userPk }}</span>
  39. </template>
  40. </el-table-column>
  41. <el-table-column
  42. label="Name"
  43. align="center"
  44. min-width="100">
  45. <template slot-scope="{row}">
  46. <span>{{ row.userName }}</span>
  47. </template>
  48. </el-table-column>
  49. <el-table-column
  50. label="Email"
  51. align="center"
  52. min-width="100">
  53. <template slot-scope="{row}">
  54. <span>{{ row.email }}</span>
  55. </template>
  56. </el-table-column>
  57. <el-table-column
  58. label="Phone"
  59. align="center"
  60. min-width="100">
  61. <template slot-scope="{row}">
  62. <span>{{ row.mobile }}</span>
  63. </template>
  64. </el-table-column>
  65. <el-table-column
  66. label="Vehicle License Plate"
  67. align="center"
  68. class-name="fixed-width"
  69. min-width="180">
  70. <template slot-scope="{row}">
  71. <span>{{ row.mobile }}</span>
  72. </template>
  73. </el-table-column>
  74. <el-table-column
  75. label="Status"
  76. align="center"
  77. min-width="100">
  78. <template slot-scope="{row}">
  79. <span>{{ row.status }}</span>
  80. </template>
  81. </el-table-column>
  82. <el-table-column
  83. label="Action"
  84. align="center"
  85. min-width="120">
  86. <template slot-scope="{row}">
  87. <TableAction/>
  88. </template>
  89. </el-table-column>
  90. </el-table>
  91. <div class="right">
  92. <pagination
  93. v-show="total > 0"
  94. :total="total"
  95. :page.sync="listQuery.page"
  96. :limit.sync="listQuery.limit"
  97. @pagination="handlePageChange" />
  98. </div>
  99. </div>
  100. </template>
  101. <script>
  102. import Pagination from '@/components/Pagination'
  103. import TableAction from '@/components/TableAction.vue'
  104. export default {
  105. components: { Pagination, TableAction },
  106. data() {
  107. return {
  108. filter: {
  109. },
  110. listLoading: true,
  111. tableList: [],
  112. total: 0,
  113. listQuery: {
  114. page: 1,
  115. limit: 10,
  116. }
  117. }
  118. },
  119. created() {
  120. this.getList();
  121. },
  122. methods: {
  123. handleFilter() {
  124. this.listLoading = true;
  125. this.listQuery.page = 1;
  126. this.getList();
  127. },
  128. handlePageChange() {
  129. this.listLoading = true;
  130. this.getList();
  131. },
  132. getList() {
  133. this.listLoading = false;
  134. }
  135. }
  136. }
  137. </script>