list.vue 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. <template>
  2. <a-card size="small" :bordered="false" class="withdrawalManagementNew-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="withdrawal-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="handleSearch" :disabled="disabled" id="withdrawal-refresh" >查询</a-button>
  15. <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="withdrawal-reset">重置</a-button>
  16. </a-col>
  17. </a-row>
  18. </a-form>
  19. </div>
  20. <div style="margin:10px 0">
  21. <div style="margin:10px 0">
  22. <p>可提现金额:<strong style="color:#ed1c24;">{{ pageInfo&&(pageInfo.activeAmount||pageInfo.activeAmount==0)?toThousands(pageInfo.activeAmount):'--' }}</strong></p>
  23. <p>账户总金额:{{ pageInfo&&(pageInfo.totalAmount||pageInfo.totalAmount==0)?toThousands(pageInfo.totalAmount):'--' }}(包含到账金额:<span>{{ pageInfo&&(pageInfo.activeAmount||pageInfo.activeAmount==0)?toThousands(pageInfo.activeAmount):'--' }}</span>,在途金额:{{ pageInfo&&(pageInfo.floatAmount||pageInfo.floatAmount==0)?toThousands(pageInfo.floatAmount):'--' }})</p>
  24. <p>保证金:{{ pageInfo&&(pageInfo.freezeAmount||freezeAmount==0)?toThousands(pageInfo.freezeAmount):'--' }}(已冻结金额:{{ pageInfo&&(pageInfo.freezeAmount||freezeAmount==0)?toThousands(pageInfo.freezeAmount):'--' }})</p>
  25. <p style="margin-top:10px;">(①提现手续费为0.5元/笔;②资金到账周期:线上支付订单出库后自然日+10天;③订单被审核不通过或修理厂取消订单后,将在1-3个工作日原路返回对应金额)</p>
  26. </div>
  27. <a-button
  28. id="withdrawal-tixian"
  29. v-if="$hasPermissions('B_withdrawalAudit')"
  30. type="primary"
  31. class="button-primary"
  32. @click="handleTX">申请提现</a-button>
  33. <a-button id="withdrawal-zhangdan" class="button-info" v-if="$hasPermissions('B_billFlow')" @click="showBillFlowModal=true">账单流水</a-button>
  34. </div>
  35. <s-table
  36. class="sTable fixPagination"
  37. ref="table"
  38. :style="{ height: tableHeight+77+'px' }"
  39. size="small"
  40. :rowKey="(record) => record.id"
  41. :columns="columns"
  42. :data="loadData"
  43. :scroll="{ y:tableHeight }"
  44. :defaultLoadData="false"
  45. bordered>
  46. </s-table>
  47. </a-spin>
  48. <!-- 申请提现 -->
  49. <applyWithdrawal :pageInfo="pageInfo" :isOpenModal="showModal" @close="showModal=false" @refresh="getPageInfo"></applyWithdrawal>
  50. <!-- 交易流水 -->
  51. <billFlowModal :openModal="showBillFlowModal" @close="showBillFlowModal=false"></billFlowModal>
  52. </a-card>
  53. </template>
  54. <script>
  55. import { commonMixin } from '@/utils/mixin'
  56. // 组件
  57. import { STable } from '@/components'
  58. import applyWithdrawal from './applyWithdrawal.vue'
  59. import billFlowModal from './billFlowModal.vue'
  60. import rangeDate from '@/views/common/rangeDate.vue'
  61. // 接口
  62. import { queryMerchantCashOutPage, merchantCashOutDetail } from '@/api/merchantNew'
  63. export default {
  64. mixins: [commonMixin],
  65. components: { STable, applyWithdrawal, billFlowModal, rangeDate },
  66. data () {
  67. const _this = this
  68. return {
  69. spinning: false,
  70. disabled: false,
  71. tableHeight: 0, // 表格高度
  72. showModal: false, // 是否显示申请提现弹窗
  73. showBillFlowModal: false, // 打开交易流水 弹窗
  74. time: [], // 提现时间
  75. pageInfo: null, // 详情信息
  76. errorFlag: false, // 经销商未设置结算账户时,申请提现按钮不能点击
  77. queryParam: {
  78. beginDate: '', // 开始时间
  79. endDate: '' // 结束时间
  80. },
  81. columns: [
  82. { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
  83. { title: '提现单号', dataIndex: 'cashOutNo', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
  84. { title: '提现时间', dataIndex: 'cashOutDate', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
  85. { title: '申请提现金额', dataIndex: 'amount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } },
  86. { title: '开户名', dataIndex: 'bankAccount', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  87. { title: '开户银行', dataIndex: 'bankName', width: '12%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  88. { title: '银行卡号', dataIndex: 'bankCard', width: '12%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  89. { title: '提现人', dataIndex: 'operName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
  90. { title: '状态', dataIndex: 'stateDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
  91. { title: '备注', dataIndex: 'remarks', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true }
  92. ],
  93. // 加载数据方法 必须为 Promise 对象
  94. loadData: parameter => {
  95. const _this = this
  96. _this.disabled = true
  97. _this.spinning = true
  98. const paramsPage = Object.assign(parameter, this.queryParam) // 有分页
  99. paramsPage.merchantSn = this.pageInfo ? this.pageInfo.merchantSn : ''
  100. paramsPage.dealerSn = _this.$store.state.user.authOrgs[0].orgSn
  101. paramsPage.merchantType = 'DEALER'
  102. return queryMerchantCashOutPage(paramsPage).then(res => {
  103. let data
  104. if (res.status == 200) {
  105. data = res.data
  106. const no = (data.pageNo - 1) * data.pageSize
  107. for (var i = 0; i < data.list.length; i++) {
  108. data.list[i].no = no + i + 1
  109. }
  110. this.disabled = false
  111. }
  112. this.spinning = false
  113. return data
  114. })
  115. }
  116. }
  117. },
  118. methods: {
  119. // 时间改变
  120. dateChange (date) {
  121. this.queryParam.beginDate = date[0]
  122. this.queryParam.endDate = date[1]
  123. },
  124. // 获取详情信息
  125. getPageInfo () {
  126. merchantCashOutDetail({}).then(res => {
  127. if (res.status == 200) {
  128. this.pageInfo = res.data
  129. this.errorFlag = false
  130. } else {
  131. this.pageInfo = null
  132. this.errorFlag = true
  133. }
  134. })
  135. },
  136. // 查询
  137. handleSearch () {
  138. this.getPageInfo()
  139. this.$refs.table.refresh(true)
  140. },
  141. // 重置
  142. resetSearchForm () {
  143. this.time = []
  144. this.$refs.rangeDate.resetDate(this.time)
  145. this.$refs.table.refresh(true)
  146. },
  147. // 申请提现
  148. handleTX () {
  149. if (this.errorFlag) {
  150. this.$message.warning('请先设置结算账户!')
  151. return
  152. }
  153. this.showModal = true
  154. },
  155. // 计算表格高度
  156. setTableH () {
  157. const tableSearchH = this.$refs.tableSearch.offsetHeight
  158. this.tableHeight = window.innerHeight - tableSearchH - 360
  159. },
  160. // 页面初始化
  161. pageInit () {
  162. const _this = this
  163. this.$nextTick(() => { // 页面渲染完成后的回调
  164. _this.setTableH()
  165. })
  166. _this.getPageInfo()
  167. }
  168. },
  169. mounted () {
  170. if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
  171. this.pageInit()
  172. this.resetSearchForm()
  173. }
  174. },
  175. watch: {
  176. advanced (newValue, oldValue) {
  177. const _this = this
  178. setTimeout(() => {
  179. _this.setTableH()
  180. }, 400)
  181. },
  182. '$store.state.app.winHeight' (newValue, oldValue) { // 窗口变更时,需同时更改表格高度
  183. this.setTableH()
  184. }
  185. },
  186. activated () {
  187. // 如果是新页签打开,则重置当前页面
  188. if (this.$store.state.app.isNewTab) {
  189. this.pageInit()
  190. this.resetSearchForm()
  191. }
  192. // 仅刷新列表,不重置页面
  193. if (this.$store.state.app.updateList) {
  194. this.pageInit()
  195. this.$refs.table.refresh()
  196. }
  197. },
  198. beforeRouteEnter (to, from, next) {
  199. next(vm => {})
  200. }
  201. }
  202. </script>