drawings_stat.vue 4.1 KB

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