gongmall.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. <template>
  2. <view id="cloud-job">
  3. <view class="title">企业账户:可用余额{{titleInfo.availableAmount}}元 待确认金额{{titleInfo.totalWaitConfirm}}元 帐户总金额{{titleInfo.amount}}元 待付款金额{{titleInfo.totalWaitPay}}元 成功支付金额{{titleInfo.totalSuccessPay}}元</view>
  4. <z-table :data="tableData" :keys="tableProps" :labels="tableHeaders" />
  5. </view>
  6. </template>
  7. <script>
  8. import tableMixin from '../mixins/table'
  9. const tableHeaders = [
  10. "项目名称",
  11. "付款类型",
  12. "用户昵称",
  13. "银行卡号",
  14. "税前应付",
  15. "平台服务费",
  16. "所得税费",
  17. "开发者净收入",
  18. "本次应付",
  19. "实际到账",
  20. "结算时间",
  21. "付款流水号",
  22. "付款时间",
  23. "操作",
  24. ]
  25. const tableProps = [
  26. "projectName",
  27. "payTypeShow",
  28. "nickname",
  29. "bankCode",
  30. "prePay",
  31. "servicePay",
  32. "getPay",
  33. "realGet",
  34. "current_gongmall",
  35. "amount",
  36. "create_time",
  37. "gongmall_order_id",
  38. "pay_timeShow",
  39. "state",
  40. ]
  41. export default {
  42. mixins: [tableMixin],
  43. data() {
  44. return {
  45. // 头部信息
  46. titleInfo: {},
  47. // 数据总条目
  48. totalCount: 0,
  49. // 当前页面
  50. currentPage: 1,
  51. // 列表头显示内容
  52. tableHeaders,
  53. // 列表头字段
  54. tableProps,
  55. // 列表数据
  56. tableData: [],
  57. }
  58. },
  59. mounted() {
  60. this.getTableData()
  61. },
  62. filters: {
  63. toDate(val) {
  64. return new Date(val * 1000).toLocaleDateString()
  65. },
  66. projectLink(i) {
  67. const type = i.entity_type
  68. let link = 'javascript:void(0);'
  69. if(type === '1') link = `/rooter/outsourceitem/${i.entity_id}>`
  70. else if(type === '3') link = `/rooter/wagedetails?job_id=${i.entity_id}`
  71. return link
  72. }
  73. },
  74. methods: {
  75. // 重新支付
  76. async rePay(i) {
  77. const res = await this.$post('/api/admin/gongmall/confirm_pay', {
  78. id: i.id,
  79. amount: i.current_gongmall,
  80. nickname: i.nickname,
  81. })
  82. if(res) {
  83. this.getTableData()
  84. }
  85. },
  86. // 确认支付
  87. confirmPay(i) {
  88. this.rePay(i)
  89. },
  90. // 页码变动
  91. changePagination() {
  92. this.getTableData()
  93. },
  94. // 格式化列表数据
  95. formatTableData(data, rData) {
  96. this.titleInfo = {
  97. availableAmount: rData.accountBalance.availableAmount,
  98. totalWaitConfirm: rData.totalWaitConfirm ? rData.totalWaitConfirm / 100 : '--',
  99. amount: rData.accountBalance.amount,
  100. totalWaitPay: rData.totalWaitPay ? rData.totalWaitPay / 100 : '--',
  101. totalSuccessPay: rData.totalSuccessPay ? rData.totalSuccessPay / 100 : '--',
  102. }
  103. return data.map(i => {
  104. let projectName = '--'
  105. let prePay = ''
  106. let servicePay = ''
  107. let getPay = ''
  108. let realGet = ''
  109. // 3 比较特殊,所以这样写
  110. if(i.entity_type === '3') {
  111. projectName = rData.periodList[i.entity_id].pro_name
  112. prePay = ((rData.periodList[i.entity_id].origin_price || 0) / 100).toFixed(2)
  113. servicePay = ((rData.periodList[i.entity_id].person_platform_fee || 0) / 100).toFixed(2)
  114. getPay = rData.periodList[i.entity_id].total_person_tax_fee || 0
  115. realGet = rData.periodList[i.entity_id].developer_fee || 0
  116. } else {
  117. if(i.entity_type === '1') projectName = rData.projectList[i.entity_id].pro_name
  118. prePay = ((rData.projectList[i.entity_id].origin_price || 0) / 100).toFixed(2)
  119. servicePay = ((rData.projectList[i.entity_id].person_platform_fee || 0) / 100).toFixed(2)
  120. getPay = rData.projectList[i.entity_id].total_person_tax_fee || 0
  121. realGet = rData.projectList[i.entity_id].developer_fee || 0
  122. }
  123. return {
  124. ...i,
  125. projectName,
  126. payTypeShow: i.pay_type === '1' ? '首付款' : '解冻款',
  127. bankCode: rData.bankAccounts[i.uid] || '--',
  128. prePay,
  129. servicePay,
  130. getPay,
  131. realGet,
  132. pay_timeShow: i.pay_time > 0 ? new Date(i.pay_time).toLocaleDateString() : '--',
  133. }
  134. })
  135. },
  136. // 获取列表数据
  137. async getTableData() {
  138. this.tableData = []
  139. const p = this.currentPage
  140. const res = await this.$post("/api/admin/gongmall/orders", { p })
  141. // console.log(res)
  142. const data = res.data
  143. const list = data.list
  144. this.tableData = this.formatTableData(list, data)
  145. this.totalCount = Number(data.total)
  146. this.totalPage = data.totalPage
  147. }
  148. }
  149. }
  150. </script>
  151. <style lang='less' scoped>
  152. #cloud-job {
  153. .table {
  154. height: 100%;
  155. height: calc(100% - 80px);
  156. }
  157. }
  158. </style>