list.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. <template>
  2. <a-card size="small" :bordered="false" class="accountManagementList-wrap jg-page-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 id="withdrawa-time" 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="withdrawa-refresh" >查询</a-button>
  15. <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="withdrawa-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 id="withdrawa-tixian" 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 { STable } from '@/components'
  49. import applyWithdrawal from './applyWithdrawal.vue'
  50. import rangeDate from '@/views/common/rangeDate.vue'
  51. import { queryMerchantCashOutPage, merchantCashOutDetail } from '@/api/merchant'
  52. export default {
  53. mixins: [commonMixin],
  54. components: { STable, applyWithdrawal, rangeDate },
  55. data () {
  56. const _this = this
  57. return {
  58. spinning: false,
  59. disabled: false,
  60. tableHeight: 0, // 表格高度
  61. showModal: false, // 是否显示申请提现弹窗
  62. currentData: null, // 当前行数据
  63. time: [], // 提现时间
  64. pageInfo: null, // 详情信息
  65. queryParam: {
  66. beginDate: '', // 开始时间
  67. endDate: '' // 结束时间
  68. },
  69. columns: [
  70. { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
  71. { title: '提现单号', dataIndex: 'cashOutNo', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
  72. { title: '提现时间', dataIndex: 'cashOutDate', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
  73. { title: '申请提现金额', dataIndex: 'amount', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } },
  74. { title: '开户名', dataIndex: 'bankAccount', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  75. { title: '银行卡号', dataIndex: 'bankCard', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  76. { title: '提现人', dataIndex: 'operName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
  77. { title: '状态', dataIndex: 'stateDictValue', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
  78. { title: '备注', dataIndex: 'remarks', width: '10%', align: 'center', customRender: function (text) { return text || '--' } }
  79. ],
  80. // 加载数据方法 必须为 Promise 对象
  81. loadData: parameter => {
  82. const _this = this
  83. _this.disabled = true
  84. _this.spinning = true
  85. const paramsPage = Object.assign(parameter, this.queryParam) // 有分页
  86. paramsPage.merchantSn = this.pageInfo ? this.pageInfo.merchantSn : ''
  87. paramsPage.merchantType = 'DEALER'
  88. return queryMerchantCashOutPage(paramsPage).then(res => {
  89. let data
  90. if (res.status == 200) {
  91. data = res.data
  92. const no = (data.pageNo - 1) * data.pageSize
  93. for (var i = 0; i < data.list.length; i++) {
  94. data.list[i].no = no + i + 1
  95. }
  96. this.disabled = false
  97. }
  98. this.spinning = false
  99. return data
  100. })
  101. }
  102. }
  103. },
  104. methods: {
  105. // 时间改变
  106. dateChange (date) {
  107. this.queryParam.beginDate = date[0]
  108. this.queryParam.endDate = date[1]
  109. },
  110. // 获取详情信息
  111. getPageInfo () {
  112. merchantCashOutDetail({}).then(res => {
  113. if (res.status == 200) {
  114. this.pageInfo = res.data
  115. this.$refs.table.refresh(true)
  116. } else {
  117. this.pageInfo = null
  118. }
  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. // 计算表格高度
  137. setTableH () {
  138. const tableSearchH = this.$refs.tableSearch.offsetHeight
  139. this.tableHeight = window.innerHeight - tableSearchH - 265
  140. },
  141. // 页面初始化
  142. pageInit () {
  143. const _this = this
  144. this.$nextTick(() => { // 页面渲染完成后的回调
  145. _this.setTableH()
  146. })
  147. _this.getPageInfo()
  148. }
  149. },
  150. mounted () {
  151. if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
  152. this.pageInit()
  153. this.resetSearchForm()
  154. }
  155. },
  156. watch: {
  157. advanced (newValue, oldValue) {
  158. const _this = this
  159. setTimeout(() => {
  160. _this.setTableH()
  161. }, 400)
  162. },
  163. '$store.state.app.winHeight' (newValue, oldValue) { // 窗口变更时,需同时更改表格高度
  164. this.setTableH()
  165. }
  166. },
  167. activated () {
  168. // 如果是新页签打开,则重置当前页面
  169. if (this.$store.state.app.isNewTab) {
  170. this.pageInit()
  171. this.resetSearchForm()
  172. }
  173. // 仅刷新列表,不重置页面
  174. if (this.$store.state.app.updateList) {
  175. this.pageInit()
  176. this.$refs.table.refresh()
  177. }
  178. },
  179. beforeRouteEnter (to, from, next) {
  180. next(vm => {})
  181. }
  182. }
  183. </script>