TopUp.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <template>
  2. <div class="app-container">
  3. <el-form
  4. :model="filter.pageVo"
  5. class="filter-container"
  6. label-position="right">
  7. <div class="filter-view">
  8. <el-form-item>
  9. <el-input
  10. clearable
  11. v-model="filter.pageVo.criteria"
  12. placeholder="Search by Number/Email"
  13. @keyup.enter.native="handleFilter" />
  14. </el-form-item>
  15. <el-form-item>
  16. <el-date-picker
  17. v-model="filter.pageVo.date"
  18. type="month"
  19. format="yyyy-MM"
  20. value-format="yyyy-MM"
  21. placeholder="Filter Date"/>
  22. </el-form-item>
  23. <div>
  24. <el-button
  25. type="primary"
  26. icon="el-icon-search"
  27. @click="getTableData">
  28. Search
  29. </el-button>
  30. </div>
  31. </div>
  32. </el-form>
  33. <el-table
  34. :data="table.list"
  35. v-loading="loading">
  36. <el-table-column
  37. label="Transaction ID"
  38. align="center"
  39. prop="creditHistoryPk"/>
  40. <el-table-column
  41. label="User ID"
  42. align="center"
  43. width="80">
  44. <template slot-scope="{row}">
  45. <span>{{ row.userPk }}</span>
  46. </template>
  47. </el-table-column>
  48. <el-table-column
  49. label="Email"
  50. align="center">
  51. <template slot-scope="{row}">
  52. <span :title="row.email">{{ row.email }}</span>
  53. </template>
  54. </el-table-column>
  55. <el-table-column
  56. label="Top Up Type"
  57. align="center"
  58. prop="paymentPlatform"/>
  59. <el-table-column
  60. label="Amount"
  61. align="center"
  62. prop="amount"/>
  63. <el-table-column
  64. label="Creation Time"
  65. align="center"
  66. prop="creationTime"/>
  67. <el-table-column
  68. label="Payment Status"
  69. align="center"
  70. prop="paymentStatus"/>
  71. <el-table-column
  72. label="Payment Reference"
  73. align="center"
  74. prop="paymentReference"/>
  75. <el-table-column
  76. label="Update Time"
  77. align="center"
  78. prop="updateTime"/>
  79. </el-table>
  80. <div class="right">
  81. <Pagination
  82. v-show="table.total > 0"
  83. :total="table.total"
  84. :page.sync="filter.pageNo"
  85. :limit.sync="filter.pageSize"
  86. @pagination="getTableData" />
  87. </div>
  88. </div>
  89. </template>
  90. <script>
  91. import site from '@/http/api/site'
  92. import ocpp from '@/http/api/ocpp'
  93. import financial from '@/http/api/financial'
  94. import Pagination from '@/components/Pagination'
  95. export default {
  96. data() {
  97. return {
  98. loading: false,
  99. listLoading: false,
  100. siteOptions: [],
  101. stationOptions: [],
  102. table: {
  103. list: [],
  104. total: 0
  105. },
  106. filter: {
  107. pageNo: 1,
  108. pageSize: 10,
  109. pageVo: {
  110. date: "",
  111. sitePk: "",
  112. criteria: "",
  113. chargeBoxId: ""
  114. }
  115. },
  116. }
  117. },
  118. components: { Pagination },
  119. created() {
  120. //this.getSiteOptions()
  121. this.getTableData()
  122. },
  123. methods: {
  124. getSiteOptions(search) {
  125. site.getAllSiteList({siteName: search ?? ""}).then(res => {
  126. if (res.data && res.data.length > 0) {
  127. this.siteOptions = res.data
  128. }
  129. });
  130. },
  131. getStationOptions() {
  132. this.listLoading = true;
  133. ocpp.getStationPages({
  134. pageNo: 1,
  135. pageSize: 20,
  136. pageVo: {
  137. date: "",
  138. sitePk: this.filter.pageVo.sitePk
  139. }
  140. }).then(res => {
  141. if (res.data) {
  142. this.stationOptions = res.data;
  143. }
  144. }).finally(() => {
  145. this.listLoading = false;
  146. })
  147. },
  148. getTableData() {
  149. this.loading = true;
  150. financial.getTopUpPages(this.filter).then(res => {
  151. this.loading = false;
  152. if (res.data) {
  153. this.table.total = res.total
  154. this.table.list = res.data
  155. }
  156. }).catch(err => {
  157. this.loading = false;
  158. this.$message({
  159. message: err,
  160. type: 'error'
  161. })
  162. })
  163. }
  164. }
  165. }
  166. </script>
  167. <style>
  168. </style>