drawings_stat.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <template>
  2. <view class="">
  3. <view class="tabs page-box-bg-fff r-30 m-t30" :style="[{position:is_fixed?'absolute':''}]"
  4. style="height: 100rpx;">
  5. <z-tabs ref="tabs" :list="tabsList" :active-style="{color:'#10B261',fontWeight:'bold',fontSize:'30rpx'}"
  6. :bar-style="{background:'#10B261'}" :inactive-style="{fontWeight:'bold',fontSize:'28rpx'}"
  7. :current="current" :bar-animate-mode="'worm'" @change="tabsChange" />
  8. </view>
  9. <!-- 顶部单行统计 -->
  10. <StatSingleData :genre="dateTypeObj.censusUserType" :total-money="moneyData.loanMoney"
  11. :total-num="moneyData.loanNum"></StatSingleData>
  12. <StatLoanChart ref="outObj" :genre="1" :leftText="'提放汇总占比'"></StatLoanChart>
  13. <stat_gather is_group :leftText="'提放汇总明细'" :out-list="outList"></stat_gather>
  14. <StatRanking ref="rankingObj" :is_type="2" :leftText="'个人业绩排行'" :data-list="userList"></StatRanking>
  15. <StatSituation ref="situationObj" :date-type-obj="selectTypeObj" :type="1"></StatSituation>
  16. </view>
  17. </template>
  18. <script>
  19. import StatLoanChart from "../module/stat_loan_chart.vue"
  20. import md5 from "js-md5";
  21. import {
  22. getRanking,
  23. getDepartmentMoney
  24. } from "@/api/statistics";
  25. import StatSituation from "@/pages/statistics/module/stat_situation.vue";
  26. import StatRanking from "@/pages/statistics/module/stat_ranking.vue";
  27. import Stat_gather from "@/pages/statistics/module/stat_gather.vue";
  28. import StatSingleData from "@/pages/statistics/module/stat_single_data.vue";
  29. export default {
  30. props: {
  31. 'dateTypeObj': {
  32. default: () => {
  33. return {
  34. dateType: 4,
  35. selectDate: '2023-02-25',
  36. money_type: 1,
  37. censusUserType: 0,
  38. product_id: 5,
  39. }
  40. }
  41. }
  42. },
  43. components: {
  44. StatSingleData,
  45. Stat_gather,
  46. StatRanking,
  47. StatSituation,
  48. StatLoanChart,
  49. },
  50. data() {
  51. return {
  52. selectTypeObj: {
  53. dateType: 4,
  54. selectDate: '2023-02-25',
  55. money_type: 4,
  56. censusUserType: 0,
  57. product_id: 5,
  58. },
  59. tabsList: [{
  60. name: '汇总',
  61. dot_color: 'red',
  62. disabled: false
  63. }, {
  64. name: '银行',
  65. dot_color: 'yellow',
  66. disabled: false
  67. }],
  68. current: 0,
  69. userList: [],
  70. moneyData: {
  71. loanMoney: 0,
  72. loanNum: 0
  73. },
  74. outList: []
  75. }
  76. },
  77. watch: {
  78. 'dateTypeObj': function() {
  79. this.initData()
  80. }
  81. },
  82. mounted() {
  83. this.initData()
  84. },
  85. methods: {
  86. tabsChange(e) {
  87. if (e !== this.current) {
  88. this.current = e
  89. this.selectTypeObj.money_type = this.current === 0 ? 5 : 4
  90. this.startData()
  91. }
  92. },
  93. setSendMd5() {
  94. let str = JSON.stringify(this.dateTypeObj)
  95. return md5(str)
  96. },
  97. initData() {
  98. if (this.dateTypeObj.censusUserType > 0) {
  99. this.selectTypeObj = this.dateTypeObj
  100. this.selectTypeObj.money_type = 5
  101. this.selectTypeObj.product_id = 5
  102. let sendMd5 = this.setSendMd5()
  103. if (sendMd5 !== this.sendMd5) {
  104. this.sendMd5 = sendMd5
  105. this.startData()
  106. }
  107. }
  108. },
  109. startData() {
  110. this.getDepartmentMoney()
  111. this.setUserRanking()
  112. this.$refs.situationObj.startList()
  113. },
  114. setUserRanking() {
  115. let fromData = this.selectTypeObj
  116. fromData.pageNum = 5
  117. getRanking(fromData).then((res) => {
  118. if (res.code === 1) {
  119. this.userList = res.data.items
  120. this.$refs.rankingObj.setDataList(this.userList)
  121. } else {
  122. this.userList = []
  123. }
  124. })
  125. },
  126. getDepartmentMoney() {
  127. getDepartmentMoney(this.selectTypeObj).then((res) => {
  128. if (res.code === 1) {
  129. this.moneyData.loanMoney = res.data.moneyData.loanMoney
  130. this.moneyData.loanNum = res.data.moneyData.loanNum
  131. this.outList = res.data.items
  132. this.$refs.outObj.setPeakChartData(this.outList)
  133. }
  134. })
  135. },
  136. }
  137. }
  138. </script>
  139. <style>
  140. </style>