capital_stat.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <template>
  2. <view class="">
  3. <HeadData :money-data="moneyData"></HeadData>
  4. <StatLoanChart ref="outObj" :genre="1" :leftText="'放款汇总占比'"></StatLoanChart>
  5. <StatLoanChart ref="putObj" :genre="2" :leftText="'回款汇总占比'"></StatLoanChart>
  6. <stat_gather is_group is_subsection :leftText="'汇总明细'" :out-list="outList" :put-list="putList"></stat_gather>
  7. <view class="sys-background-fff r-30">
  8. <StatCapital :leftColor="0" :rightColor="1" :leftText="'任务资金汇总'" :tabulate-data="sysPassageData">
  9. </StatCapital>
  10. <view class="view_line"></view>
  11. <StatRanking ref="rankingObj" :is_margin_top="false" :is_type="2" :leftText="'个人业绩排行'"
  12. :data-list="userList"></StatRanking>
  13. </view>
  14. <StatSituation ref="situationObj" :date-type-obj="dateTypeObj" :type="1"></StatSituation>
  15. </view>
  16. </template>
  17. <script>
  18. import StatLoanChart from "../module/stat_loan_chart.vue"
  19. import StatRanking from "../module/stat_ranking.vue"
  20. import StatCapital from "../module/stat_capital.vue"
  21. import StatSituation from "../module/stat_situation.vue"
  22. import HeadData from "@/pages/statistics/module/head_data.vue";
  23. import {
  24. getDepartmentMoney,
  25. getRanking,
  26. getSysPassage
  27. } from "@/api/statistics";
  28. import md5 from "js-md5";
  29. import Stat_gather from "@/pages/statistics/module/stat_gather.vue";
  30. export default {
  31. props: {
  32. 'dateTypeObj': {
  33. default: () => {
  34. return {
  35. dateType: 4,
  36. selectDate: '2023-02-25',
  37. money_type: 1,
  38. censusUserType: 0,
  39. product_id: 5,
  40. }
  41. }
  42. }
  43. },
  44. components: {
  45. Stat_gather,
  46. HeadData,
  47. StatLoanChart,
  48. StatRanking,
  49. StatCapital,
  50. StatSituation
  51. },
  52. watch: {
  53. 'dateTypeObj': function() {
  54. this.initData()
  55. }
  56. },
  57. mounted() {
  58. this.initData()
  59. },
  60. data() {
  61. return {
  62. moneyData: {
  63. out_money: 0,
  64. out_num: 0,
  65. put_money: 0,
  66. put_num: 0,
  67. },
  68. outList: [],
  69. putList: [],
  70. sendMd5: '',
  71. sysPassageData: {
  72. consume_money: 0,
  73. consume_num: "0",
  74. consume_ratio: 0,
  75. pledge_money: 0,
  76. pledge_num: "0",
  77. pledge_ratio: 0,
  78. list: [{
  79. name: "",
  80. ratio: 0,
  81. value: 0,
  82. labelText: ""
  83. }, {
  84. name: "",
  85. ratio: 0,
  86. value: 0,
  87. labelText: ""
  88. }]
  89. },
  90. userList: []
  91. }
  92. },
  93. methods: {
  94. setSendMd5() {
  95. let str = JSON.stringify(this.dateTypeObj)
  96. return md5(str)
  97. },
  98. initData() {
  99. if (this.dateTypeObj.censusUserType > 0) {
  100. let sendMd5 = this.setSendMd5()
  101. if (sendMd5 !== this.sendMd5) {
  102. this.sendMd5 = sendMd5
  103. this.getDepartmentMoney(1)
  104. this.getDepartmentMoney(2)
  105. this.getSysPassage()
  106. this.setUserRanking()
  107. this.$refs.situationObj.startList()
  108. }
  109. }
  110. },
  111. //管理员-任务资金汇总
  112. getSysPassage() {
  113. getSysPassage(this.dateTypeObj).then((res) => {
  114. if (res.code === 1) {
  115. this.sysPassageData = res.data
  116. } else {
  117. // this.$refs.chartsPieView.setNoList()
  118. }
  119. })
  120. },
  121. getDepartmentMoney(money_type) {
  122. let selectData = this.dateTypeObj
  123. selectData.money_type = money_type
  124. getDepartmentMoney(selectData).then((res) => {
  125. if (res.code === 1) {
  126. if (money_type === 1) {
  127. this.moneyData.out_money = res.data.moneyData.loanMoney
  128. this.moneyData.out_num = res.data.moneyData.loanNum
  129. this.outList = res.data.items
  130. this.$refs.outObj.setPeakChartData(this.outList)
  131. } else {
  132. this.moneyData.put_money = res.data.moneyData.loanMoney
  133. this.moneyData.put_num = res.data.moneyData.loanNum
  134. this.putList = res.data.items
  135. this.$refs.putObj.setPeakChartData(this.putList)
  136. }
  137. }
  138. })
  139. },
  140. //设置员工排名
  141. setUserRanking() {
  142. let fromData = this.dateTypeObj
  143. fromData.pageNum = 3
  144. getRanking(fromData).then((res) => {
  145. if (res.code === 1) {
  146. this.userList = res.data.items
  147. console.log(this.userList)
  148. this.$refs.rankingObj.setDataList(this.userList)
  149. }
  150. })
  151. },
  152. },
  153. }
  154. </script>
  155. <style>
  156. </style>