performance_stat.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <template>
  2. <view class="">
  3. <StatLoanChart ref="workChartObj" :leftText="'任务汇总占比'"></StatLoanChart>
  4. <StatRanking ref="workListObj" :is_type="3" :leftText="'放款汇总明细'"></StatRanking>
  5. </view>
  6. </template>
  7. <script>
  8. import StatLoanChart from "../module/stat_loan_chart.vue"
  9. import StatRanking from "../module/stat_ranking.vue"
  10. import md5 from "js-md5";
  11. import {getUserPerformance} from "@/api/statistics";
  12. export default {
  13. props:{
  14. 'dateTypeObj':{
  15. default:()=>{
  16. return {
  17. dateType:4,
  18. selectDate:'2023-02-25',
  19. money_type:1,
  20. censusUserType:0,
  21. product_id:5,
  22. }
  23. }
  24. }
  25. },
  26. components: {
  27. StatLoanChart,
  28. StatRanking,
  29. },
  30. watch: {
  31. 'dateTypeObj': function() {
  32. this.initData()
  33. }
  34. },
  35. mounted() {
  36. this.initData()
  37. },
  38. data() {
  39. return {
  40. workList:[]
  41. }
  42. },
  43. methods: {
  44. setSendMd5() {
  45. let str = JSON.stringify(this.dateTypeObj)
  46. return md5(str)
  47. },
  48. initData() {
  49. if (this.dateTypeObj.censusUserType > 0) {
  50. let sendMd5 = this.setSendMd5()
  51. if (sendMd5 !== this.sendMd5) {
  52. this.sendMd5 = sendMd5
  53. this.getUserPerformance()
  54. }
  55. }
  56. },
  57. getUserPerformance() {
  58. getUserPerformance(this.dateTypeObj).then((res)=>{
  59. if(res.code===1){
  60. this.$refs.workChartObj.setPeakChartData(res.data.items)
  61. this.$refs.workListObj.setDataList(res.data.items)
  62. }
  63. })
  64. },
  65. }
  66. }
  67. </script>
  68. <style>
  69. </style>