USER-20230908AJ\Administrator vor 1 Jahr
Ursprung
Commit
c0b02c0f4c

+ 55 - 8
pages/statistics/components/performance_stat.vue

@@ -1,24 +1,71 @@
 <template>
 	<view class="">
-		<StatLoanChart :leftText="'任务汇总占比'"></StatLoanChart>
-		<StatRanking :is_type="3" :leftText="'放款汇总明细'"></StatRanking>
+		<StatLoanChart ref="workChartObj" :leftText="'任务汇总占比'"></StatLoanChart>
+		<StatRanking ref="workListObj" :is_type="3" :leftText="'放款汇总明细'"></StatRanking>
 	</view>
 </template>
 
 <script>
-	import StatLoanChart from "../module/stat_loan_chart.vue"
-	import StatRanking from "../module/stat_ranking.vue"
+import StatLoanChart from "../module/stat_loan_chart.vue"
+import StatRanking from "../module/stat_ranking.vue"
+import md5 from "js-md5";
+import {getUserPerformance} from "@/api/statistics";
 
 	export default {
+    props:{
+      'dateTypeObj':{
+        default:()=>{
+          return {
+            dateType:4,
+            selectDate:'2023-02-25',
+            money_type:1,
+            censusUserType:0,
+            product_id:5,
+          }
+        }
+      }
+    },
 		components: {
 			StatLoanChart,
 			StatRanking,
 		},
-		data() {
-			return {
+    watch: {
+      'dateTypeObj': function() {
+        this.initData()
+      }
+    },
+    mounted() {
+      this.initData()
+    },
+    data() {
+      return {
+        workList:[]
+      }
+    },
+    methods: {
+      setSendMd5() {
+        let str = JSON.stringify(this.dateTypeObj)
+        return md5(str)
+      },
+      initData() {
+        if (this.dateTypeObj.censusUserType > 0) {
+          let sendMd5 = this.setSendMd5()
+          if (sendMd5 !== this.sendMd5) {
+            this.sendMd5 = sendMd5
+            this.getUserPerformance()
 
-			}
-		}
+          }
+        }
+      },
+      getUserPerformance() {
+        getUserPerformance(this.dateTypeObj).then((res)=>{
+          if(res.code===1){
+            this.$refs.workChartObj.setPeakChartData(res.data.items)
+            this.$refs.workListObj.setDataList(res.data.items)
+          }
+        })
+      },
+    }
 	}
 </script>
 

+ 51 - 4
pages/statistics/components/task_stat.vue

@@ -1,24 +1,71 @@
 <template>
 	<view class="">
-		<StatLoanChart :leftText="'任务汇总占比'"></StatLoanChart>
-		<StatRanking :is_type="3" :leftText="'任务明细'"></StatRanking>
+		<StatLoanChart ref="workChartObj" :leftText="'任务汇总占比'"></StatLoanChart>
+		<StatRanking ref="workListObj" :is_type="3" :leftText="'任务明细'"></StatRanking>
 	</view>
 </template>
 
 <script>
 	import StatLoanChart from "../module/stat_loan_chart.vue"
 	import StatRanking from "../module/stat_ranking.vue"
+  import md5 from "js-md5";
+  import {getUserWorkload} from "@/api/statistics";
 
 	export default {
+    props:{
+      'dateTypeObj':{
+        default:()=>{
+          return {
+            dateType:4,
+            selectDate:'2023-02-25',
+            money_type:1,
+            censusUserType:0,
+            product_id:5,
+          }
+        }
+      }
+    },
 		components: {
 			StatLoanChart,
 			StatRanking
 		},
+    watch: {
+      'dateTypeObj': function() {
+        this.initData()
+      }
+    },
+    mounted() {
+      this.initData()
+    },
 		data() {
 			return {
-
+        workList:[]
 			}
-		}
+		},
+    methods: {
+      setSendMd5() {
+        let str = JSON.stringify(this.dateTypeObj)
+        return md5(str)
+      },
+      initData() {
+        if (this.dateTypeObj.censusUserType > 0) {
+          let sendMd5 = this.setSendMd5()
+          if (sendMd5 !== this.sendMd5) {
+            this.sendMd5 = sendMd5
+            this.getUserWorkload()
+
+          }
+        }
+      },
+      getUserWorkload() {
+        getUserWorkload(this.dateTypeObj).then((res)=>{
+          if(res.code===1){
+              this.$refs.workChartObj.setPeakChartData(res.data.items)
+              this.$refs.workListObj.setDataList(res.data.items)
+          }
+        })
+      },
+    }
 	}
 </script>
 

+ 4 - 4
pages/statistics/module/stat_ranking.vue

@@ -39,15 +39,15 @@
 		</view>
 		<view v-if="is_type == 3">
 			<view class="ranking_item sys-from-background-color m-b16 r-20 p-20 row-justify-sb center"
-				v-for="(item,index) in 4" :key="index">
+				v-for="(item,index) in dataList" :key="index">
 				<view class="row-c sys-weight-400">
-					<image class="wh-60 m-r30" :src="`/static/img/statistics/${taskIconLsit[index]}.png`"
+					<image class="wh-60 m-r30" :src="item.product_icon"
 						mode="aspectFill">
 					</image>
-					<text class="size-28 text-color-000 p-b10">房抵业务</text>
+					<text class="size-28 text-color-000 p-b10">{{item.product_name}}</text>
 				</view>
 				<view class="row-c">
-					<text class="size-28 color-000 sys-weight-600 m-r10">200万</text>
+					<text class="size-28 color-000 sys-weight-600 m-r10">{{item.value}}次</text>
 					<uni-icons type="forward" size="16" color="#8F99B1"></uni-icons>
 				</view>
 			</view>