capital_stat.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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="'任务资金汇总'">
  9. </StatCapital>
  10. <view class="view_line"></view>
  11. <StatRanking :is_margin_top="false" :leftText="'个人业绩排行'"></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} 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. }
  67. },
  68. methods: {
  69. setSendMd5(){
  70. let str=JSON.stringify(this.dateTypeObj)
  71. return md5(str)
  72. },
  73. initData(){
  74. if(this.dateTypeObj.censusUserType>0){
  75. let sendMd5=this.setSendMd5()
  76. if(sendMd5 !== this.sendMd5){
  77. this.sendMd5=sendMd5
  78. this.getDepartmentMoney(1)
  79. this.getDepartmentMoney(2)
  80. }
  81. }
  82. },
  83. getDepartmentMoney(money_type){
  84. let selectData=this.dateTypeObj
  85. selectData.money_type=money_type
  86. getDepartmentMoney(selectData).then((res)=>{
  87. if(res.code === 1){
  88. if(money_type===1){
  89. this.moneyData.out_money=res.data.moneyData.loanMoney
  90. this.moneyData.out_num=res.data.moneyData.loanNum
  91. this.outList=res.data.items
  92. this.$refs.outObj.setPeakChartData(this.outList)
  93. }else {
  94. this.moneyData.put_money=res.data.moneyData.loanMoney
  95. this.moneyData.put_num=res.data.moneyData.loanNum
  96. this.putList=res.data.items
  97. this.$refs.putObj.setPeakChartData(this.putList)
  98. }
  99. // this.list = res.data.items
  100. // this.userType = res.data.userType
  101. // let ret = {series: [{data: []}]};
  102. // let totalMoney=0;
  103. // let totalNum=0;
  104. // res.data.items.forEach(v=>{
  105. // if(v.value > 0){
  106. // totalMoney+=(v.value*1)
  107. // totalNum+=(v.total_num*1)
  108. // ret.series[0].data.push(v)
  109. // }
  110. // })
  111. // this.totalMoney=totalMoney
  112. // this.totalNum=totalNum
  113. // let moneyData={
  114. // censusUserType:this.selectData.censusUserType,
  115. // totalNum: res.data.moneyData.loanNum,
  116. // totalMoney: res.data.moneyData.loanMoney,
  117. // money_type:this.selectData.money_type,
  118. // }
  119. // this.$emit('SetTotalMoneyOrNum',moneyData)
  120. // this.$refs.chartsMountView.show = true
  121. // this.$refs.chartsMountView.chartData = JSON.parse(JSON.stringify(ret));
  122. }else{
  123. // this.lisy = []
  124. // let moneyData={
  125. // censusUserType:this.selectData.censusUserType,
  126. // totalNum: 0,
  127. // totalMoney: 0,
  128. // money_type:this.selectData.money_type,
  129. // }
  130. // this.$emit('SetTotalMoneyOrNum',moneyData)
  131. // this.$refs.chartsMountView.setNoList()
  132. }
  133. })
  134. }
  135. },
  136. }
  137. </script>
  138. <style>
  139. </style>