drawings_stat.vue 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <template>
  2. <view class="">
  3. <StatLoanChart ref="outObj" :genre="1" :leftText="'提放汇总占比'"></StatLoanChart>
  4. <stat_gather is_group :leftText="'提放汇总明细'" :out-list="outList" ></stat_gather>
  5. <StatRanking ref="rankingObj" :is_margin_top="false" :is_type="2" :leftText="'个人业绩排行'" :data-list="userList"></StatRanking>
  6. <StatSituation ref="situationObj" :date-type-obj="dateTypeObj" :type="1"></StatSituation>
  7. </view>
  8. </template>
  9. <script>
  10. import StatLoanChart from "../module/stat_loan_chart.vue"
  11. import md5 from "js-md5";
  12. import {getRanking,getDepartmentMoney} from "@/api/statistics";
  13. import StatSituation from "@/pages/statistics/module/stat_situation.vue";
  14. import StatRanking from "@/pages/statistics/module/stat_ranking.vue";
  15. import Stat_gather from "@/pages/statistics/module/stat_gather.vue";
  16. export default {
  17. props:{
  18. 'dateTypeObj':{
  19. default:()=>{
  20. return {
  21. dateType:4,
  22. selectDate:'2023-02-25',
  23. money_type:1,
  24. censusUserType:0,
  25. product_id:5,
  26. }
  27. }
  28. }
  29. },
  30. components: {
  31. Stat_gather,
  32. StatRanking,
  33. StatSituation,
  34. StatLoanChart,
  35. },
  36. data() {
  37. return {
  38. userList:[],
  39. moneyData:{},
  40. outList:[]
  41. }
  42. },
  43. watch:{
  44. 'dateTypeObj':function () {
  45. this.initData()
  46. }
  47. },
  48. mounted() {
  49. this.initData()
  50. },
  51. methods:{
  52. setSendMd5(){
  53. let str=JSON.stringify(this.dateTypeObj)
  54. return md5(str)
  55. },
  56. initData(){
  57. if(this.dateTypeObj.censusUserType>0){
  58. let sendMd5=this.setSendMd5()
  59. if(sendMd5 !== this.sendMd5){
  60. this.sendMd5=sendMd5
  61. this.getDepartmentMoney()
  62. this.setUserRanking()
  63. this.$refs.situationObj.startList()
  64. }
  65. }
  66. },
  67. setUserRanking(){
  68. let fromData = this.dateTypeObj
  69. fromData.pageNum = 10
  70. getRanking(fromData).then((res)=>{
  71. if(res.code === 1){
  72. this.userList = res.data.items
  73. this.$refs.rankingObj.setDataList(this.userList)
  74. }else{
  75. this.userList = []
  76. }
  77. })
  78. },
  79. getDepartmentMoney(){
  80. getDepartmentMoney(this.dateTypeObj).then((res)=>{
  81. if(res.code === 1){
  82. this.moneyData.out_money=res.data.moneyData.loanMoney
  83. this.moneyData.out_num=res.data.moneyData.loanNum
  84. this.outList=res.data.items
  85. // this.$refs.outObj.setPeakChartData(this.outList)
  86. }
  87. })
  88. },
  89. }
  90. }
  91. </script>
  92. <style>
  93. </style>