capital_stat.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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 ref="situationObj" :date-type-obj="dateTypeObj" :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. this.$refs.situationObj.startList()
  93. }
  94. }
  95. },
  96. //管理员-任务资金汇总
  97. getSysPassage(){
  98. getSysPassage(this.dateTypeObj).then((res)=>{
  99. if(res.code === 1){
  100. this.sysPassageData = res.data
  101. }else{
  102. // this.$refs.chartsPieView.setNoList()
  103. }
  104. })
  105. },
  106. getDepartmentMoney(money_type){
  107. let selectData=this.dateTypeObj
  108. selectData.money_type=money_type
  109. getDepartmentMoney(selectData).then((res)=>{
  110. if(res.code === 1){
  111. if(money_type===1){
  112. this.moneyData.out_money=res.data.moneyData.loanMoney
  113. this.moneyData.out_num=res.data.moneyData.loanNum
  114. this.outList=res.data.items
  115. this.$refs.outObj.setPeakChartData(this.outList)
  116. }else {
  117. this.moneyData.put_money=res.data.moneyData.loanMoney
  118. this.moneyData.put_num=res.data.moneyData.loanNum
  119. this.putList=res.data.items
  120. this.$refs.putObj.setPeakChartData(this.putList)
  121. }
  122. }
  123. })
  124. },
  125. //设置员工排名
  126. setUserRanking(){
  127. let fromData = this.dateTypeObj
  128. fromData.pageNum = 3
  129. getRanking(fromData).then((res)=>{
  130. if(res.code === 1) {
  131. this.userList = res.data.items
  132. console.log(this.userList)
  133. this.$refs.rankingObj.setDataList(this.userList)
  134. }
  135. })
  136. },
  137. },
  138. }
  139. </script>
  140. <style>
  141. </style>