USER-20230908AJ\Administrator 1 год назад
Родитель
Сommit
d337d176e2
2 измененных файлов с 59 добавлено и 44 удалено
  1. 40 38
      pages/statistics/components/capital_stat.vue
  2. 19 6
      pages/statistics/module/stat_ranking.vue

+ 40 - 38
pages/statistics/components/capital_stat.vue

@@ -5,10 +5,10 @@
 		<StatLoanChart ref="putObj" :genre="2" :leftText="'回款汇总占比'"></StatLoanChart>
 		<stat_gather is_group :leftText="'汇总明细'"  :out-list="outList" :put-list="putList"></stat_gather>
 		<view class="sys-background-fff r-30">
-			<StatCapital :leftColor="0" :rightColor="1" :leftText="'任务资金汇总'">
+			<StatCapital :leftColor="0" :rightColor="1" :leftText="'任务资金汇总'" :tabulate-data="sysPassageData">
 			</StatCapital>
 			<view class="view_line"></view>
-			<StatRanking :is_margin_top="false" :leftText="'个人业绩排行'"></StatRanking>
+			<StatRanking ref="rankingObj" :is_margin_top="false" :is_type="2" :leftText="'个人业绩排行'" :data-list="userList"></StatRanking>
 		</view>
 		<StatSituation :type="1"></StatSituation>
 	</view>
@@ -20,7 +20,7 @@
 	import StatCapital from "../module/stat_capital.vue"
 	import StatSituation from "../module/stat_situation.vue"
   import HeadData from "@/pages/statistics/module/head_data.vue";
-  import { getDepartmentMoney} from "@/api/statistics";
+  import {getDepartmentMoney, getRanking, getSysPassage} from "@/api/statistics";
   import md5 from "js-md5";
   import Stat_gather from "@/pages/statistics/module/stat_gather.vue";
 
@@ -64,7 +64,17 @@
         },
         outList:[],
         putList:[],
-        sendMd5:''
+        sendMd5:'',
+        sysPassageData:{
+          consume_money: 0,
+          consume_num: "0",
+          consume_ratio: 0,
+          pledge_money: 0,
+          pledge_num: "0",
+          pledge_ratio: 0,
+          list:[{name: "", ratio: 0, value: 0, labelText: ""},{name: "", ratio: 0, value: 0, labelText: ""}]
+        },
+        userList:[]
 			}
 		},
     methods: {
@@ -79,9 +89,21 @@
             this.sendMd5=sendMd5
             this.getDepartmentMoney(1)
             this.getDepartmentMoney(2)
+            this.getSysPassage()
+            this.setUserRanking()
           }
         }
       },
+      //管理员-任务资金汇总
+      getSysPassage(){
+        getSysPassage(this.dateTypeObj).then((res)=>{
+          if(res.code === 1){
+            this.sysPassageData = res.data
+          }else{
+            // this.$refs.chartsPieView.setNoList()
+          }
+        })
+      },
       getDepartmentMoney(money_type){
         let selectData=this.dateTypeObj
         selectData.money_type=money_type
@@ -98,42 +120,22 @@
               this.putList=res.data.items
               this.$refs.putObj.setPeakChartData(this.putList)
             }
-            // this.list = res.data.items
-            // this.userType = res.data.userType
-            // let ret = {series: [{data: []}]};
-            // let totalMoney=0;
-            // let totalNum=0;
-            // res.data.items.forEach(v=>{
-            //   if(v.value > 0){
-            //     totalMoney+=(v.value*1)
-            //     totalNum+=(v.total_num*1)
-            //     ret.series[0].data.push(v)
-            //   }
-            // })
-            // this.totalMoney=totalMoney
-            // this.totalNum=totalNum
-            // let moneyData={
-            //   censusUserType:this.selectData.censusUserType,
-            //   totalNum: res.data.moneyData.loanNum,
-            //   totalMoney: res.data.moneyData.loanMoney,
-            //   money_type:this.selectData.money_type,
-            // }
-            // this.$emit('SetTotalMoneyOrNum',moneyData)
-            // this.$refs.chartsMountView.show = true
-            // this.$refs.chartsMountView.chartData = JSON.parse(JSON.stringify(ret));
-          }else{
-            // this.lisy = []
-            // let moneyData={
-            //   censusUserType:this.selectData.censusUserType,
-            //   totalNum: 0,
-            //   totalMoney: 0,
-            //   money_type:this.selectData.money_type,
-            // }
-            // this.$emit('SetTotalMoneyOrNum',moneyData)
-            // this.$refs.chartsMountView.setNoList()
           }
+
         })
-      }
+      },
+      //设置员工排名
+      setUserRanking(){
+        let fromData = this.dateTypeObj
+        fromData.pageNum = 3
+        getRanking(fromData).then((res)=>{
+          if(res.code === 1) {
+            this.userList = res.data.items
+            console.log(this.userList)
+            this.$refs.rankingObj.setDataList(this.userList)
+          }
+        })
+      },
     },
 	}
 </script>

+ 19 - 6
pages/statistics/module/stat_ranking.vue

@@ -22,19 +22,20 @@
 		</view>
 		<view v-if="is_type == 2">
 			<view class="ranking_item sys-from-background-color m-b16 r-20 p-20 row-justify-sb center"
-				v-for="(item,index) in 3" :key="index">
+				v-for="(item,index) in dataList" :key="index">
 				<view class="row-c sys-weight-400">
 					<image class="wh-36 m-r20" :src="`/static/img/statistics/${userIconList[index]}.png`"
 						mode="aspectFill">
 					</image>
-					<image class="wh-60" src="/static/img/index/index-avatar.png" mode=""></image>
+					<image class="wh-60" :src="item.head_img" mode=""></image>
 					<view class="column m-l16">
-						<text class="size-28 text-color-000 p-b10">张三</text>
-						<text class="size-24 text-color-666">2024.12.14 12:45</text>
+						<text class="size-28 text-color-000 p-b10">{{item.name}}</text>
+						<text class="size-24 text-color-666">{{item.departments_name}}</text>
 					</view>
 				</view>
-				<text class="size-28 color-000 sys-weight-600">200万</text>
+				<text class="size-28 color-000 sys-weight-600">{{item.total_money}}万</text>
 			</view>
+      <en-blank v-if="dataList.length<=0"></en-blank>
 		</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"
@@ -56,10 +57,12 @@
 
 <script>
 	import StatisticsTitle from "./statistics_title.vue";
+  import EnBlank from "@/components/en-utils/en-blank/en-blank.vue";
 
 	export default {
 		name: 'stat_ranking',
 		components: {
+      EnBlank,
 			StatisticsTitle
 		},
 		props: {
@@ -83,14 +86,24 @@
 				type: String,
 				default: '全部'
 			},
+
 		},
+
 		data() {
 			return {
+        dataList:[],
 				iconList: ['champion', 'runner-up', 'third'],
 				userIconList: ['one', 'two', 'three'],
 				taskIconLsit: ['task-one', 'task-two', 'task-three', 'task-four']
 			};
-		}
+		},
+    methods: {
+      setDataList(data){
+
+        this.dataList=data
+        console.log(this.dataList)
+      }
+    },
 	}
 </script>