list.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <template>
  2. <a-card size="small" :bordered="false" class="withdrawalManagementList-wrap">
  3. <!-- 搜索条件 -->
  4. <div class="table-page-search-wrapper">
  5. <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
  6. <a-row :gutter="15">
  7. <a-col :md="6" :sm="24">
  8. <a-form-item label="提现时间">
  9. <rangeDateTime ref="rangeDate" @change="dateChange" />
  10. </a-form-item>
  11. </a-col>
  12. <a-col :md="6" :sm="24">
  13. <span class="table-page-search-submitButtons">
  14. <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="withdrawalManagementList-refresh">查询</a-button>
  15. <a-button style="margin-left: 8px" @click="resetSearchForm()" :disabled="disabled" id="withdrawalManagementList-reset">重置</a-button>
  16. </span>
  17. </a-col>
  18. </a-row>
  19. </a-form>
  20. </div>
  21. <!-- 操作按钮 -->
  22. <div class="table-operator">
  23. <a-button v-if="$hasPermissions('B_withdrawalManagement_cashOut')" id="withdrawalManagementList-tx" type="primary" class="button-warning" @click="handleCashOut">申请提现</a-button>
  24. <div style="display: inline-block;margin-left: 80px;">可提现余额: <strong>{{ accountInfo&&(accountInfo.balance || accountInfo.balance==0) ? '¥'+accountInfo.balance : '--' }}</strong> 元</div>
  25. </div>
  26. <!-- 列表 -->
  27. <s-table
  28. class="sTable"
  29. ref="table"
  30. size="default"
  31. :rowKey="(record) => record.id"
  32. :columns="columns"
  33. :data="loadData"
  34. :scroll="{ x: 1320 }"
  35. bordered>
  36. </s-table>
  37. <!-- 提现说明 -->
  38. <div class="descriptions">
  39. <p class="descriptions-tit">提现说明:</p>
  40. <ul class="descriptions-list">
  41. <li><em>1、</em>提现手续费为元/笔,从可提现余额中扣除。</li>
  42. <li><em>2、</em>提现到账时间正常为T+1工作日(例如当天提现,则第二天到账。如果遇到周末或法定节假日,则依次顺延)。</li>
  43. <li><em>3、</em>页面上的【可提现余额】包含当天收款但支付公司未清算金额,该部分金额只能在第二天清算后才可提现,如果提示【提现失败】和【账户余额不足】,则表明【可提现金额】中会存在该部分金额,遇到这种情况时,请减少当日提现金额或在次日进行提现。</li>
  44. <li><em>4、</em>提现账户为申请开通支付结算账户时所提供的账户信息。</li>
  45. </ul>
  46. </div>
  47. <!-- 申请提现 -->
  48. <cashOutModal :openModal="openModal" :nowData="accountInfo" @ok="handleOk" @close="closeModal" />
  49. </a-card>
  50. </template>
  51. <script>
  52. import { STable, VSelect } from '@/components'
  53. import rangeDateTime from '@/views/common/rangeDateTime.vue'
  54. import cashOutModal from './cashOutModal.vue'
  55. import { satelliteWHWithdrawalList, satelliteWHWithdrawalAccount } from '@/api/satelliteWH'
  56. export default {
  57. components: { STable, VSelect, rangeDateTime, cashOutModal },
  58. data () {
  59. return {
  60. advanced: false, // 高级搜索 展开/关闭
  61. disabled: false, // 查询、重置按钮是否可操作
  62. // 查询参数
  63. queryParam: {
  64. beginDate: '',
  65. endDate: ''
  66. },
  67. // 表头
  68. columns: [
  69. { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
  70. { title: '提现时间', dataIndex: 'cashOutDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
  71. { title: '提现单号', dataIndex: 'withdrawalNo', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
  72. { title: '申请提现金额', dataIndex: 'amount', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  73. { title: '开户名', dataIndex: 'bankAccount', width: 150, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  74. { title: '银行卡号', dataIndex: 'bankAccountNo', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
  75. { title: '状态', dataIndex: 'stateDictValue', width: 150, align: 'center', customRender: function (text) { return text || '--' } },
  76. { title: '备注', dataIndex: 'resultDesc', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
  77. ],
  78. // 加载数据方法 必须为 Promise 对象
  79. loadData: parameter => {
  80. this.disabled = true
  81. return satelliteWHWithdrawalList(Object.assign(parameter, this.queryParam)).then(res => {
  82. const data = res.data
  83. const no = (data.pageNo - 1) * data.pageSize
  84. for (var i = 0; i < data.list.length; i++) {
  85. data.list[i].no = no + i + 1
  86. }
  87. this.disabled = false
  88. return data
  89. })
  90. },
  91. openModal: false, // 弹框
  92. itemId: '', // 当前id
  93. nowData: null, // 当前记录数据
  94. accountInfo: null
  95. }
  96. },
  97. methods: {
  98. // 时间 change
  99. dateChange (date) {
  100. this.queryParam.beginDate = date[0]
  101. this.queryParam.endDate = date[1]
  102. },
  103. // 账户信息
  104. getAccount () {
  105. satelliteWHWithdrawalAccount().then(res => {
  106. if (res.status == 200) {
  107. this.accountInfo = res.data
  108. } else {
  109. this.accountInfo = null
  110. }
  111. })
  112. },
  113. // 申请提现
  114. handleCashOut () {
  115. if (this.accountInfo && this.accountInfo.balance && this.accountInfo.serviceCharge) {
  116. const balance = Number(this.accountInfo.balance) * 100
  117. const serviceCharge = Number(this.accountInfo.serviceCharge) * 100
  118. if ((balance - serviceCharge) <= 0) {
  119. this.$message.warning('余额不足,暂不能提现!')
  120. } else {
  121. this.openModal = true
  122. }
  123. }
  124. },
  125. handleOk () {
  126. this.$refs.table.refresh(true)
  127. this.getAccount()
  128. },
  129. closeModal () {
  130. this.openModal = false
  131. },
  132. // 重置
  133. resetSearchForm () {
  134. this.$refs.rangeDate.resetDate()
  135. this.queryParam.beginDate = ''
  136. this.queryParam.endDate = ''
  137. this.$refs.table.refresh(true)
  138. }
  139. },
  140. beforeRouteEnter (to, from, next) {
  141. next(vm => {
  142. vm.getAccount()
  143. })
  144. }
  145. }
  146. </script>
  147. <style lang="less">
  148. .withdrawalManagementList-wrap{
  149. .sTable{
  150. margin-top: 15px;
  151. }
  152. .descriptions{
  153. margin-top: 45px;
  154. .descriptions-tit{
  155. font-size: 14px;
  156. font-weight: bold;
  157. }
  158. .descriptions-list{
  159. list-style: none;
  160. padding: 0;
  161. margin: 0;
  162. li{
  163. position: relative;
  164. padding: 5px 0 5px 20px;
  165. line-height: 1.5em;
  166. font-size: 13px;
  167. em{
  168. position: absolute;
  169. left: 0;
  170. top: 4px;
  171. font-style: normal;
  172. }
  173. }
  174. }
  175. }
  176. }
  177. </style>