list.vue 8.2 KB

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