USER-20230908AJ\Administrator 1 سال پیش
والد
کامیت
87775f917b

+ 14 - 1
common/chart/peak_chart.vue

@@ -151,7 +151,7 @@ export default {
     };
     };
   },
   },
   onReady() {
   onReady() {
-    this.getServerData();
+    // this.getServerData();
   },
   },
   methods: {
   methods: {
     getServerData() {
     getServerData() {
@@ -168,6 +168,19 @@ export default {
         this.chartData = JSON.parse(JSON.stringify(res));
         this.chartData = JSON.parse(JSON.stringify(res));
       }, 500);
       }, 500);
     },
     },
+    setServerData(data){
+      setTimeout(() => {
+        //模拟服务器返回数据,如果数据格式和标准格式不同,需自行按下面的格式拼接
+        let res = {
+          series: [
+            {
+              data:data
+            }
+          ]
+        };
+        this.chartData = JSON.parse(JSON.stringify(res));
+      }, 100);
+    }
   }
   }
 };
 };
 </script>
 </script>

+ 109 - 6
pages/statistics/components/capital_stat.vue

@@ -1,9 +1,9 @@
 <template>
 <template>
 	<view class="">
 	<view class="">
-		<StatSingleData :is_fixed="is_tabs_fixed"></StatSingleData>
-		<StatLoanChart :genre="1" :leftText="'放款汇总占比'"></StatLoanChart>
-		<StatLoanChart :genre="2" :leftText="'回款汇总占比'"></StatLoanChart>
-		<StatRanking is_group :leftText="'汇总明细'"></StatRanking>
+    <HeadData  :money-data="moneyData"></HeadData>
+		<StatLoanChart ref="outObj" :genre="1" :leftText="'放款汇总占比'"></StatLoanChart>
+		<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">
 		<view class="sys-background-fff r-30">
 			<StatCapital :leftColor="0" :rightColor="1" :leftText="'任务资金汇总'">
 			<StatCapital :leftColor="0" :rightColor="1" :leftText="'任务资金汇总'">
 			</StatCapital>
 			</StatCapital>
@@ -19,19 +19,122 @@
 	import StatRanking from "../module/stat_ranking.vue"
 	import StatRanking from "../module/stat_ranking.vue"
 	import StatCapital from "../module/stat_capital.vue"
 	import StatCapital from "../module/stat_capital.vue"
 	import StatSituation from "../module/stat_situation.vue"
 	import StatSituation from "../module/stat_situation.vue"
+  import HeadData from "@/pages/statistics/module/head_data.vue";
+  import { getDepartmentMoney} from "@/api/statistics";
+  import md5 from "js-md5";
+  import Stat_gather from "@/pages/statistics/module/stat_gather.vue";
 
 
 	export default {
 	export default {
+    props:{
+      'dateTypeObj':{
+        default:()=>{
+          return {
+            dateType:4,
+            selectDate:'2023-02-25',
+            money_type:1,
+            censusUserType:0,
+            product_id:5,
+          }
+        }
+      }
+    },
 		components: {
 		components: {
+      Stat_gather,
+      HeadData,
 			StatLoanChart,
 			StatLoanChart,
 			StatRanking,
 			StatRanking,
 			StatCapital,
 			StatCapital,
 			StatSituation
 			StatSituation
 		},
 		},
+    watch:{
+      'dateTypeObj':function () {
+        this.initData()
+      }
+    },
+    mounted() {
+      this.initData()
+    },
 		data() {
 		data() {
 			return {
 			return {
-
+        moneyData:{
+          out_money: 0,
+          out_num: 0,
+          put_money: 0,
+          put_num: 0,
+        },
+        outList:[],
+        putList:[],
+        sendMd5:''
 			}
 			}
-		}
+		},
+    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.getDepartmentMoney(1)
+            this.getDepartmentMoney(2)
+          }
+        }
+      },
+      getDepartmentMoney(money_type){
+        let selectData=this.dateTypeObj
+        selectData.money_type=money_type
+        getDepartmentMoney(selectData).then((res)=>{
+          if(res.code === 1){
+            if(money_type===1){
+              this.moneyData.out_money=res.data.moneyData.loanMoney
+              this.moneyData.out_num=res.data.moneyData.loanNum
+              this.outList=res.data.items
+              this.$refs.outObj.setPeakChartData(this.outList)
+            }else {
+              this.moneyData.put_money=res.data.moneyData.loanMoney
+              this.moneyData.put_num=res.data.moneyData.loanNum
+              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()
+          }
+        })
+      }
+    },
 	}
 	}
 </script>
 </script>
 
 

+ 3 - 4
pages/statistics/components/general_stat.vue

@@ -127,7 +127,7 @@
       },
       },
       //管理员-在途资金汇总
       //管理员-在途资金汇总
       getCapitalMoney(){
       getCapitalMoney(){
-        getCapitalMoney(this.selectData).then((res)=>{
+        getCapitalMoney(this.dateTypeObj).then((res)=>{
           if(res.code===1  && res.data.items.length>0){
           if(res.code===1  && res.data.items.length>0){
             let totalMoney=res.data.items[0].value+res.data.items[1].value
             let totalMoney=res.data.items[0].value+res.data.items[1].value
             this.sysCapitalMoney.consume_money=res.data.items[0].value
             this.sysCapitalMoney.consume_money=res.data.items[0].value
@@ -138,14 +138,13 @@
             this.sysCapitalMoney.pledge_ratio=(res.data.items[1].value/totalMoney*100).toFixed(2)
             this.sysCapitalMoney.pledge_ratio=(res.data.items[1].value/totalMoney*100).toFixed(2)
             this.sysCapitalMoney.list[0]={name: res.data.items[0].name, ratio: this.sysCapitalMoney.consume_ratio, value:  this.sysCapitalMoney.consume_money, labelText: ""}
             this.sysCapitalMoney.list[0]={name: res.data.items[0].name, ratio: this.sysCapitalMoney.consume_ratio, value:  this.sysCapitalMoney.consume_money, labelText: ""}
             this.sysCapitalMoney.list[1]={name: res.data.items[1].name, ratio: this.sysCapitalMoney.pledge_ratio, value:  this.sysCapitalMoney.pledge_money, labelText: ""}
             this.sysCapitalMoney.list[1]={name: res.data.items[1].name, ratio: this.sysCapitalMoney.pledge_ratio, value:  this.sysCapitalMoney.pledge_money, labelText: ""}
-            console.log(this.sysCapitalMoney)
           }
           }
         })
         })
       },
       },
 
 
       // //管理员-行业统计
       // //管理员-行业统计
       getSysIndustry(){
       getSysIndustry(){
-        getSysIndustry(this.selectData).then((res)=>{
+        getSysIndustry(this.dateTypeObj).then((res)=>{
           if(res.code === 1){
           if(res.code === 1){
             this.industryList=res.data
             this.industryList=res.data
             // let ret = {
             // let ret = {
@@ -161,7 +160,7 @@
 
 
       //管理员-年龄区域统计
       //管理员-年龄区域统计
       getSysAge(){
       getSysAge(){
-        getSysAge(this.selectData).then((res)=>{
+        getSysAge(this.dateTypeObj).then((res)=>{
           if(res.code === 1){
           if(res.code === 1){
             this.ageList=res.data
             this.ageList=res.data
             // this.$refs.chartsAdminThree.show = true
             // this.$refs.chartsAdminThree.show = true

+ 100 - 0
pages/statistics/module/stat_gather.vue

@@ -0,0 +1,100 @@
+<template>
+	<view class="page-box-bg-fff r-30 p-30 sys-weight-400" :class="is_margin_top?'m-t20':''">
+		<StatisticsTitle :genre="genre" :leftText="leftText" :rightText="rightText" @onHandle="onHandle">
+		</StatisticsTitle>
+		<view v-if="is_type == 1">
+			<view class="ranking_item sys-from-background-color m-b16 r-20 p-20 p-tb40" v-if="index<=2" v-for="(item,index) in outList"
+				:key="index">
+				<view class="row-justify-sb center sys-weight-400 size-28 color-000 r-20">
+					<view class="row-c line-40">
+						<image class="wh-36 m-r20" :src="`/static/img/statistics/${iconList[index]}.png`"
+							mode="aspectFill">
+						</image>
+						<text>{{item.name}}</text>
+					</view>
+					<text>{{item.total_num}}笔</text>
+					<view class="sys-weight-600 line-30">
+						<text class=" text-color-12 m-r10">{{item.value}}万</text>
+						<uni-icons type="forward" size="14" color="#D8D8D8"></uni-icons>
+					</view>
+				</view>
+			</view>
+      <en-blank v-if="outList.length<=0"></en-blank>
+		</view>
+    <view v-if="is_type == 2">
+      <view class="ranking_item sys-from-background-color m-b16 r-20 p-20 p-tb40" v-if="index<=2" v-for="(item,index) in putList"
+            :key="index">
+        <view class="row-justify-sb center sys-weight-400 size-28 color-000 r-20">
+          <view class="row-c line-40">
+            <image class="wh-36 m-r20" :src="`/static/img/statistics/${iconList[index]}.png`"
+                   mode="aspectFill">
+            </image>
+            <text>{{item.name}}</text>
+          </view>
+          <text>{{item.total_num}}笔</text>
+          <view class="sys-weight-600 line-30">
+            <text class=" text-color-12 m-r10">{{item.value}}万</text>
+            <uni-icons type="forward" size="14" color="#D8D8D8"></uni-icons>
+          </view>
+        </view>
+      </view>
+      <en-blank v-if="putList.length<=0"></en-blank>
+    </view>
+
+
+	</view>
+</template>
+
+<script>
+	import StatisticsTitle from "./statistics_title.vue";
+  import EnBlank from "@/components/en-utils/en-blank/en-blank.vue";
+
+	export default {
+		name: 'stat_gather',
+		components: {
+      EnBlank,
+			StatisticsTitle
+		},
+		props: {
+			genre: {
+				type: Number,
+				default: 0
+			},
+			is_type: {
+				type: Number,
+				default: 1
+			},
+			is_margin_top: {
+				type: Boolean,
+				default: true
+			},
+			leftText: {
+				type: String,
+				default: ''
+			},
+			rightText: {
+				type: String,
+				default: '全部'
+			},
+      outList:{
+        default:[]
+      },
+      putList:{
+        default:[]
+      }
+		},
+		data() {
+			return {
+				iconList: ['champion', 'runner-up', 'third'],
+				userIconList: ['one', 'two', 'three'],
+				taskIconLsit: ['task-one', 'task-two', 'task-three', 'task-four']
+			};
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.ranking_item:last-child {
+		margin-bottom: 0;
+	}
+</style>

+ 8 - 3
pages/statistics/module/stat_loan_chart.vue

@@ -1,8 +1,8 @@
 <template>
 <template>
 	<view class="page-box-bg-fff m-t20 r-30 p-30">
 	<view class="page-box-bg-fff m-t20 r-30 p-30">
-		<StatisticsTitle :genre="genre" :leftText="leftText" :rightText="'同比环比'" @onHandle="onHandle"></StatisticsTitle>
+		<StatisticsTitle :genre="genre" :leftText="leftText" :is_right="false"></StatisticsTitle>
 		<view class="column-c m-30 r-30 p-l16">
 		<view class="column-c m-30 r-30 p-l16">
-			<PeakChart></PeakChart>
+			<PeakChart ref="peakChart"></PeakChart>
 		</view>
 		</view>
 	</view>
 	</view>
 </template>
 </template>
@@ -31,7 +31,12 @@
 			return {
 			return {
 
 
 			};
 			};
-		}
+		},
+    methods: {
+      setPeakChartData(data){
+        this.$refs.peakChart.setServerData(data)
+      }
+    },
 	}
 	}
 </script>
 </script>
 
 

+ 5 - 5
pages/statistics/statistics.vue

@@ -29,15 +29,15 @@
 					<!-- 汇总统计-公司 -->
 					<!-- 汇总统计-公司 -->
 					<GeneralStat :date-type-obj="dateTypeObj" v-if="dateTypeObj.censusUserType === 3"></GeneralStat>
 					<GeneralStat :date-type-obj="dateTypeObj" v-if="dateTypeObj.censusUserType === 3"></GeneralStat>
 					<!-- 资金统计-部门 -->
 					<!-- 资金统计-部门 -->
-					<CapitalStat v-if="dateTypeObj.censusUserType === 4"></CapitalStat>
+					<CapitalStat :date-type-obj="dateTypeObj" v-if="dateTypeObj.censusUserType === 4"></CapitalStat>
 					<!-- 提放统计-部门 -->
 					<!-- 提放统计-部门 -->
-					<DrawingsStat v-if="dateTypeObj.censusUserType === 6"></DrawingsStat>
+					<DrawingsStat :date-type-obj="dateTypeObj" v-if="dateTypeObj.censusUserType === 6"></DrawingsStat>
 					<!-- 消金统计-部门 -->
 					<!-- 消金统计-部门 -->
-					<ConsumeStat v-if="dateTypeObj.censusUserType === 7"></ConsumeStat>
+					<ConsumeStat :date-type-obj="dateTypeObj" v-if="dateTypeObj.censusUserType === 7"></ConsumeStat>
 					<!-- 任务统计-个人 -->
 					<!-- 任务统计-个人 -->
-					<TaskStat v-if="dateTypeObj.censusUserType === 1"></TaskStat>
+					<TaskStat :date-type-obj="dateTypeObj" v-if="dateTypeObj.censusUserType === 1"></TaskStat>
 					<!-- 业绩统计-个人 -->
 					<!-- 业绩统计-个人 -->
-					<PerformanceStat v-if="dateTypeObj.censusUserType === 2"></PerformanceStat>
+					<PerformanceStat :date-type-obj="dateTypeObj" v-if="dateTypeObj.censusUserType === 2"></PerformanceStat>
 					<view class="bottom_view"></view>
 					<view class="bottom_view"></view>
 				</view>
 				</view>
 			</view>
 			</view>