capital_stat.vue 4.2 KB

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