list.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <template>
  2. <a-card size="small" :bordered="false" class="accountManagementList-wrap">
  3. <a-spin :spinning="spinning" tip="Loading...">
  4. <!-- 搜索条件 -->
  5. <div ref="tableSearch" class="table-page-search-wrapper">
  6. <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
  7. <a-row :gutter="15">
  8. <a-col :xl="6" :lg="6" :md="12" :sm="24">
  9. <a-form-item label="交易时间">
  10. <rangeDate ref="rangeDate" v-model="time" @change="dateChange" />
  11. </a-form-item>
  12. </a-col>
  13. <a-col :xl="6" :lg="6" :md="6" :sm="6">
  14. <a-button type="primary" @click="getRefresh" :disabled="disabled" id="outboundOrderList-refresh" >查询</a-button>
  15. <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="outboundOrderList-reset">重置</a-button>
  16. </a-col>
  17. </a-row>
  18. </a-form>
  19. </div>
  20. <div style="margin:10px 0">
  21. <div style="display: flex;align-items: center;padding: 2px 0;">
  22. <div style="display: flex;align-items: center;">
  23. 可提现金额:<span>{{ pageInfo&&pageInfo.activeAmount?toThousands(pageInfo.activeAmount):'--' }}</span>
  24. <a-button size="small" type="primary" class="button-primary" @click="handleTX">申请提现</a-button>
  25. <span>(提示:① 提现手续费为0.5元/笔;② 资金到账周期为工作日+1天)</span>
  26. </div>
  27. </div>
  28. </div>
  29. <s-table
  30. class="sTable fixPagination"
  31. ref="table"
  32. :style="{ height: tableHeight+77+'px' }"
  33. size="small"
  34. :rowKey="(record) => record.id"
  35. :columns="columns"
  36. :data="loadData"
  37. :scroll="{ y:tableHeight }"
  38. :defaultLoadData="false"
  39. bordered>
  40. </s-table>
  41. </a-spin>
  42. <!-- 申请提现 -->
  43. <applyWithdrawal :isOpenModal="showModal" :currentData="currentData" @close="showModal=false" @refresh="getPageInfo"></applyWithdrawal>
  44. </a-card>
  45. </template>
  46. <script>
  47. import { commonMixin } from '@/utils/mixin'
  48. import moment from 'moment'
  49. import { STable } from '@/components'
  50. import applyWithdrawal from './applyWithdrawal.vue'
  51. import rangeDate from '@/views/common/rangeDate.vue'
  52. import { queryMerchantCashOutPage, merchantCashOutDetail } from '@/api/merchant'
  53. export default {
  54. mixins: [commonMixin],
  55. components: { STable, applyWithdrawal, rangeDate },
  56. data () {
  57. const _this = this
  58. return {
  59. spinning: false,
  60. disabled: false,
  61. tableHeight: 0,
  62. showModal: false,
  63. currentData: null,
  64. time: [],
  65. pageInfo: null,
  66. queryParam: {
  67. beginDate: '',
  68. endDate: ''
  69. },
  70. columns: [
  71. { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
  72. { title: '提现单号', dataIndex: 'cashOutNo', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
  73. { title: '提现时间', dataIndex: 'cashOutDate', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
  74. { title: '申请提现金额', dataIndex: 'amount', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } },
  75. { title: '开户名', dataIndex: 'bankAccount', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  76. { title: '银行卡号', dataIndex: 'bankCard', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  77. { title: '提现人', dataIndex: 'operName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
  78. { title: '状态', dataIndex: 'stateDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
  79. { title: '备注', dataIndex: 'remarks', width: '10%', align: 'center', customRender: function (text) { return text || '--' } }
  80. ],
  81. // 加载数据方法 必须为 Promise 对象
  82. loadData: parameter => {
  83. const _this = this
  84. _this.disabled = true
  85. _this.spinning = true
  86. const paramsPage = Object.assign(parameter, this.queryParam) // 有分页
  87. paramsPage.merchantSn = this.pageInfo ? this.pageInfo.merchantSn : ''
  88. paramsPage.merchantType = 'DEALER'
  89. return queryMerchantCashOutPage(paramsPage).then(res => {
  90. let data
  91. if (res.status == 200) {
  92. data = res.data
  93. const no = (data.pageNo - 1) * data.pageSize
  94. for (var i = 0; i < data.list.length; i++) {
  95. data.list[i].no = no + i + 1
  96. }
  97. this.disabled = false
  98. }
  99. this.spinning = false
  100. return data
  101. })
  102. }
  103. }
  104. },
  105. methods: {
  106. // 时间改变
  107. dateChange (date) {
  108. this.queryParam.beginDate = date[0]
  109. this.queryParam.endDate = date[1]
  110. },
  111. getPageInfo () {
  112. merchantCashOutDetail({}).then(res => {
  113. console.log(res, '===========')
  114. if (res.status == 200) {
  115. this.pageInfo = res.data
  116. this.$refs.table.refresh(true)
  117. } else {
  118. this.pageInfo = null
  119. }
  120. })
  121. },
  122. getRefresh () {
  123. this.getPageInfo()
  124. this.$refs.table.refresh(true)
  125. },
  126. // 重置
  127. resetSearchForm () {
  128. this.time = []
  129. this.$refs.rangeDate.resetDate(this.time)
  130. this.$refs.table.refresh(true)
  131. },
  132. // 申请提现
  133. handleTX () {
  134. this.showModal = true
  135. },
  136. setTableH () {
  137. const tableSearchH = this.$refs.tableSearch.offsetHeight
  138. this.tableHeight = window.innerHeight - tableSearchH - 265
  139. },
  140. pageInit () {
  141. const _this = this
  142. this.$nextTick(() => { // 页面渲染完成后的回调
  143. _this.setTableH()
  144. })
  145. _this.getPageInfo()
  146. }
  147. },
  148. mounted () {
  149. if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
  150. this.pageInit()
  151. this.resetSearchForm()
  152. }
  153. },
  154. watch: {
  155. advanced (newValue, oldValue) {
  156. const _this = this
  157. setTimeout(() => {
  158. _this.setTableH()
  159. }, 400)
  160. },
  161. '$store.state.app.winHeight' (newValue, oldValue) { // 窗口变更时,需同时更改表格高度
  162. this.setTableH()
  163. }
  164. },
  165. activated () {
  166. // 如果是新页签打开,则重置当前页面
  167. if (this.$store.state.app.isNewTab) {
  168. this.pageInit()
  169. this.resetSearchForm()
  170. }
  171. // 仅刷新列表,不重置页面
  172. if (this.$store.state.app.updateList) {
  173. this.pageInit()
  174. this.$refs.table.refresh()
  175. }
  176. },
  177. beforeRouteEnter (to, from, next) {
  178. next(vm => {})
  179. }
  180. }
  181. </script>