index.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. <template>
  2. <div class="">
  3. <div class="m-10 bg-w p-20 br-10 f-sa-s">
  4. <div class="f-fs-c f-col">
  5. <div style="font-size: 16px;">总收入金额</div>
  6. <div class="mt-4" style="font-weight: bold; font-size: 18px;">
  7. {{ statistics.sumPaidPrice }}
  8. </div>
  9. </div>
  10. <div class="f-fs-c f-col">
  11. <div style="font-size: 16px;">成功提现金额</div>
  12. <div class="mt-4" style="font-weight: bold; font-size: 18px;">
  13. {{ statistics.undrawnAmount }}
  14. </div>
  15. </div>
  16. <div class="f-fs-c f-col">
  17. <div style="font-size: 16px;">未提现金额</div>
  18. <div class="mt-4" style="font-weight: bold; font-size: 18px;">
  19. {{ statistics.withdrawalAmount }}
  20. </div>
  21. </div>
  22. </div>
  23. <toolbar @on-filter="filterData" @on-reset="filterData" />
  24. <base-table
  25. class="m-10 bg-w p-20 br-10"
  26. :columns="columns"
  27. :items="items"
  28. :pagination="pagination"
  29. :page-change="pageChange"
  30. />
  31. </div>
  32. </template>
  33. <script>
  34. import toolbar from './toolbar';
  35. import mxFilterList from '@/mixins/filterList';
  36. import { getPage, getCount } from '@/api/statistics/withdrawalRecord';
  37. export default {
  38. name: 'WithdrawalRecord',
  39. components: { toolbar },
  40. mixins: [
  41. mxFilterList({
  42. fetchList: getPage // 在下方data再声明一个 fetchList: iGetList 同等效果
  43. })
  44. ],
  45. data() {
  46. return {
  47. columns: [
  48. {
  49. key: 'id',
  50. name: '提现编号',
  51. width: this.$col.b
  52. },
  53. {
  54. key: 'transactionId',
  55. name: '第三方支付标识',
  56. minWidth: this.$col.b
  57. },
  58. {
  59. key: 'accountName',
  60. name: '提现用户',
  61. width: this.$col.m
  62. },
  63. {
  64. key: 'phonenumber',
  65. name: '账号手机号码',
  66. width: this.$col.m
  67. },
  68. {
  69. key: 'channels',
  70. name: '提现渠道',
  71. width: this.$col.s
  72. },
  73. {
  74. key: 'value',
  75. name: '提现金额',
  76. minWidth: this.$col.s,
  77. render: (h, { row }) => h('span', `¥${row.value}`)
  78. },
  79. {
  80. key: 'createAt',
  81. name: '提现时间',
  82. width: this.$col.b
  83. },
  84. {
  85. key: 'auditStatus',
  86. name: '审核状态',
  87. width: this.$col.s,
  88. type: 'tag',
  89. fetchTagType: val => {
  90. switch (val) {
  91. case 1:
  92. return 'success';
  93. case 0:
  94. return 'info';
  95. case -1:
  96. return 'danger';
  97. default:
  98. return 'info';
  99. }
  100. },
  101. tagName: row => {
  102. switch (row.auditStatus) {
  103. case 1:
  104. return '通过';
  105. case 0:
  106. return '待审核';
  107. case -1:
  108. return '拒绝';
  109. default:
  110. return '-';
  111. }
  112. }
  113. },
  114. {
  115. key: 'auditMsg',
  116. name: '审核备注',
  117. width: this.$col.b,
  118. 'show-overflow-tooltip': true
  119. },
  120. {
  121. key: 'action',
  122. name: '操作',
  123. width: '120',
  124. render: (h, { row }) => {
  125. const action = [];
  126. row.auditStatus === 0 &&
  127. action.push(
  128. h(
  129. 'el-button',
  130. {
  131. props: {
  132. type: 'text'
  133. },
  134. on: {
  135. click: () =>
  136. this.$WithdrawalRecordVerifyItemModal({
  137. id: row.id,
  138. auditStatus: row.auditStatus
  139. })
  140. }
  141. },
  142. '审核'
  143. )
  144. );
  145. return h('div', action);
  146. }
  147. }
  148. ],
  149. statistics: {}
  150. };
  151. },
  152. created() {
  153. this.$g_on('withdrawal_record_reload', this.reload);
  154. },
  155. beforeDestroy() {
  156. this.$g_off('withdrawal_record_reload', this.reload);
  157. },
  158. methods: {
  159. async pageChange(page) {
  160. this.pagination.page = page;
  161. const inParams = {
  162. ...this.filter,
  163. ...this.internalFilterObj,
  164. start: this.pagination.page,
  165. limit: this.pagination.pageSize
  166. };
  167. const { data, msg } = await this.apiList(inParams);
  168. const res2 = await getCount(inParams);
  169. this.statistics = res2.data;
  170. if ('data' in data) {
  171. const items = data.data;
  172. if (items.length === 0 && this.pagination.page > 1) {
  173. this.pageChange(1);
  174. } else {
  175. this.items = items;
  176. this.pagination.total = data.total;
  177. }
  178. this.loadCallBack(data);
  179. }
  180. }
  181. }
  182. };
  183. </script>
  184. <style type="scss" scoped></style>