list.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. <template>
  2. <a-card size="small" :bordered="false" class="withdrawalManagementList-wrap">
  3. <!-- 搜索条件 -->
  4. <div ref="tableSearch" 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 fixPagination"
  29. ref="table"
  30. :style="{ height: tableHeight+84.5+'px' }"
  31. size="small"
  32. :rowKey="(record) => record.id"
  33. :columns="columns"
  34. :data="loadData"
  35. :scroll="{ x: 1320 }"
  36. :defaultLoadData="false"
  37. bordered>
  38. </s-table>
  39. <!-- 提现说明 -->
  40. <div class="descriptions">
  41. <p class="descriptions-tit">提现说明:</p>
  42. <ul class="descriptions-list">
  43. <li><em>1、</em>提现手续费为元/笔,从可提现余额中扣除。</li>
  44. <li><em>2、</em>提现到账时间正常为T+1工作日(例如当天提现,则第二天到账。如果遇到周末或法定节假日,则依次顺延)。</li>
  45. <li><em>3、</em>页面上的【可提现余额】包含当天收款但支付公司未清算金额,该部分金额只能在第二天清算后才可提现,如果提示【提现失败】和【账户余额不足】,则表明【可提现金额】中会存在该部分金额,遇到这种情况时,请减少当日提现金额或在次日进行提现。</li>
  46. <li><em>4、</em>提现账户为申请开通支付结算账户时所提供的账户信息。</li>
  47. </ul>
  48. </div>
  49. <!-- 申请提现 -->
  50. <cashOutModal :openModal="openModal" :nowData="accountInfo" @ok="handleOk" @close="closeModal" />
  51. </a-card>
  52. </template>
  53. <script>
  54. import { STable, VSelect } from '@/components'
  55. import rangeDateTime from '@/views/common/rangeDateTime.vue'
  56. import cashOutModal from './cashOutModal.vue'
  57. import { satelliteWHWithdrawalList, satelliteWHWithdrawalAccount } from '@/api/satelliteWH'
  58. export default {
  59. components: { STable, VSelect, rangeDateTime, cashOutModal },
  60. data () {
  61. return {
  62. advanced: true, // 高级搜索 展开/关闭
  63. disabled: false, // 查询、重置按钮是否可操作
  64. tableHeight: 0,
  65. // 查询参数
  66. queryParam: {
  67. beginDate: '',
  68. endDate: ''
  69. },
  70. // 表头
  71. columns: [
  72. { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
  73. { title: '提现时间', dataIndex: 'cashOutDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
  74. { title: '提现单号', dataIndex: 'withdrawalNo', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
  75. { title: '申请提现金额', dataIndex: 'amount', width: 120, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  76. { title: '开户名', dataIndex: 'bankAccount', width: 150, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  77. { title: '银行卡号', dataIndex: 'bankAccountNo', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
  78. { title: '状态', dataIndex: 'stateDictValue', width: 150, align: 'center', customRender: function (text) { return text || '--' } },
  79. { title: '备注', dataIndex: 'resultDesc', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
  80. ],
  81. // 加载数据方法 必须为 Promise 对象
  82. loadData: parameter => {
  83. this.disabled = true
  84. return satelliteWHWithdrawalList(Object.assign(parameter, this.queryParam)).then(res => {
  85. const data = res.data
  86. const no = (data.pageNo - 1) * data.pageSize
  87. for (var i = 0; i < data.list.length; i++) {
  88. data.list[i].no = no + i + 1
  89. }
  90. this.disabled = false
  91. return data
  92. })
  93. },
  94. openModal: false, // 弹框
  95. itemId: '', // 当前id
  96. nowData: null, // 当前记录数据
  97. accountInfo: null
  98. }
  99. },
  100. methods: {
  101. // 时间 change
  102. dateChange (date) {
  103. this.queryParam.beginDate = date[0]
  104. this.queryParam.endDate = date[1]
  105. },
  106. // 账户信息
  107. getAccount () {
  108. satelliteWHWithdrawalAccount().then(res => {
  109. if (res.status == 200) {
  110. this.accountInfo = res.data
  111. } else {
  112. this.accountInfo = null
  113. }
  114. })
  115. },
  116. // 申请提现
  117. handleCashOut () {
  118. if (this.accountInfo && this.accountInfo.balance && this.accountInfo.serviceCharge) {
  119. const balance = Number(this.accountInfo.balance) * 100
  120. const serviceCharge = Number(this.accountInfo.serviceCharge) * 100
  121. if ((balance - serviceCharge) <= 0) {
  122. this.$message.warning('余额不足,暂不能提现!')
  123. } else {
  124. this.openModal = true
  125. }
  126. }
  127. },
  128. handleOk () {
  129. this.$refs.table.refresh(true)
  130. this.getAccount()
  131. },
  132. closeModal () {
  133. this.openModal = false
  134. },
  135. // 重置
  136. resetSearchForm () {
  137. this.$refs.rangeDate.resetDate()
  138. this.queryParam.beginDate = ''
  139. this.queryParam.endDate = ''
  140. this.$refs.table.refresh(true)
  141. },
  142. pageInit () {
  143. const _this = this
  144. this.$nextTick(() => { // 页面渲染完成后的回调
  145. _this.setTableH()
  146. })
  147. this.getAccount()
  148. },
  149. setTableH () {
  150. const tableSearchH = this.$refs.tableSearch.offsetHeight
  151. this.tableHeight = window.innerHeight - tableSearchH - 235 - 217.5
  152. }
  153. },
  154. watch: {
  155. advanced (newValue, oldValue) {
  156. const _this = this
  157. setTimeout(() => {
  158. _this.setTableH()
  159. }, 400)
  160. }
  161. },
  162. mounted () {
  163. if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
  164. this.pageInit()
  165. this.resetSearchForm()
  166. }
  167. },
  168. activated () {
  169. // 如果是新页签打开,则重置当前页面
  170. if (this.$store.state.app.isNewTab) {
  171. this.pageInit()
  172. this.resetSearchForm()
  173. }
  174. },
  175. beforeRouteEnter (to, from, next) {
  176. next(vm => {})
  177. }
  178. }
  179. </script>
  180. <style lang="less">
  181. .withdrawalManagementList-wrap{
  182. .descriptions{
  183. margin-top: 45px;
  184. .descriptions-tit{
  185. font-size: 14px;
  186. font-weight: bold;
  187. }
  188. .descriptions-list{
  189. list-style: none;
  190. padding: 0;
  191. margin: 0;
  192. li{
  193. position: relative;
  194. padding: 5px 0 5px 20px;
  195. line-height: 1.5em;
  196. font-size: 13px;
  197. em{
  198. position: absolute;
  199. left: 0;
  200. top: 4px;
  201. font-style: normal;
  202. }
  203. }
  204. }
  205. }
  206. }
  207. </style>