USER-20230908AJ\Administrator 1 жил өмнө
parent
commit
351a14b349

+ 21 - 4
common/chart/circle_chart.vue

@@ -59,7 +59,7 @@ export default {
           offsetY: 0
         },
         subtitle: {
-          name: "60%",
+          name: "0%",
           fontSize: 15,
           color: "#666666",
           offsetX: 0,
@@ -84,7 +84,7 @@ export default {
     };
   },
   onReady() {
-    this.getServerData();
+    // this.getServerData();
   },
   methods: {
     getServerData() {
@@ -94,15 +94,32 @@ export default {
         let res = {
             series: [
               {
-                name: "正确率",
+                name:  "0%",
                 color: this.bgColor,
-                data: 0.8
+                data: 0
               }
             ]
           };
         this.chartData = JSON.parse(JSON.stringify(res));
       }, 500);
     },
+    setServerData(data){
+      console.log('series:'+data)
+      this.opts.subtitle.name=(data*100)+"%"
+      setTimeout(()=>{
+        let res = {
+          series: [
+            {
+              color: this.bgColor,
+              data: data
+            }
+          ]
+        };
+        this.chartData = JSON.parse(JSON.stringify(res));
+      },100)
+
+    }
+
   }
 };
 </script>

+ 53 - 6
pages/statistics/components/general_stat.vue

@@ -1,7 +1,9 @@
 <template>
 	<view class="">
-		<StatLoanChart :genre="1" :leftText="'放款汇总占比'"></StatLoanChart>
-		<StatLoanChart :genre="2" :leftText="'回款汇总占比'"></StatLoanChart>
+    <HeadData  :money-data="moneyData"></HeadData>
+    <stat_finance_chart :money-data="moneyData"></stat_finance_chart>
+<!--		<StatLoanChart :genre="1" :leftText="'放款汇总占比'"></StatLoanChart>-->
+<!--		<StatLoanChart :genre="2" :leftText="'回款汇总占比'"></StatLoanChart>-->
 		<StatRanking is_group :leftText="'汇总明细'"></StatRanking>
 		<view class="sys-background-fff r-30">
 			<StatCapital :leftColor="0" :rightColor="1" :leftText="'任务资金汇总'">
@@ -18,19 +20,64 @@
 	import StatRanking from "../module/stat_ranking.vue"
 	import StatCapital from "../module/stat_capital.vue"
 	import StatSituation from "../module/stat_situation.vue"
+  import HeadData from "@/pages/statistics/module/head_data.vue";
+  import {getSysCashier} from "@/api/statistics";
+  import Stat_finance_chart from "@/pages/statistics/module/stat_finance_chart.vue";
 
 	export default {
+    props:{
+      'dateTypeObj':{
+        default:()=>{
+          return {
+            dateType:4,
+            selectDate:'2023-02-25',
+            money_type:1,
+            censusUserType:0,
+            product_id:5,
+          }
+        }
+      }
+    },
 		components: {
+      Stat_finance_chart,
+      HeadData,
 			StatLoanChart,
 			StatRanking,
 			StatCapital,
 			StatSituation
 		},
+    watch:{
+      'dateTypeObj':function () {
+        this.initData()
+      }
+    },
+    mounted() {
+      this.initData()
+    },
 		data() {
-			return {
-
-			}
-		}
+      return {
+        moneyData:{
+          out_money: 0,
+          out_num: 0,
+          put_money: 0,
+          put_num: 0,
+        }
+      };
+		},
+    methods: {
+      initData(){
+        if(this.dateTypeObj.censusUserType>0){
+          this.getSysCashier()
+        }
+      },
+      getSysCashier(){
+        getSysCashier(this.dateTypeObj).then((res)=>{
+          if(res.code===1){
+            this.moneyData=res.data
+          }
+        })
+      }
+    },
 	}
 </script>
 

+ 9 - 34
pages/statistics/module/head_data.vue

@@ -27,50 +27,25 @@
   export default {
 		name: 'head_filter',
     props:{
-      'dateTypeObj':{
+      'moneyData':{
         default:()=>{
           return {
-            dateType:4,
-            selectDate:'2023-02-25',
-            money_type:1,
-            censusUserType:0,
-            product_id:5,
+            out_money: 0,
+            out_num: 0,
+            put_money: 0,
+            put_num: 0,
           }
         }
       }
     },
-    watch:{
-      'dateTypeObj':function () {
-        this.initData()
-      }
-    },
-    mounted() {
-      this.initData()
-    },
+
+
     data() {
 			return {
-        moneyData:{
-          out_money: 0,
-          out_num: 0,
-          put_money: 0,
-          put_num: 0,
-        }
+
 			};
 		},
-    methods: {
-      initData(){
-        if(this.dateTypeObj.censusUserType>0){
-            this.getSysCashier()
-        }
-      },
-      getSysCashier(){
-        getSysCashier(this.dateTypeObj).then((res)=>{
-          if(res.code===1){
-              this.moneyData=res.data
-          }
-        })
-      }
-    },
+
 	}
 </script>
 

+ 37 - 8
pages/statistics/module/stat_finance_chart.vue

@@ -4,11 +4,11 @@
 		<StatisticsTitle :genre="0" :leftText="'财务汇总占比'" :rightText="'同比环比'" @onHandle="onHandle"></StatisticsTitle>
 		<view class="content_chart row-justify-sb center">
 			<view class="chart_item column-c sys-from-background-color m-r30 r-20 p-tb20">
-				<CircleChart :bgColor="'#2B7DFA'"></CircleChart>
+				<CircleChart ref="outObj" :bgColor="'#2B7DFA'"></CircleChart>
 				<text class="size-24 sys-from-background-color m-t16">放款</text>
 			</view>
 			<view class="chart_item column-c sys-from-background-color r-20 p-tb20">
-				<CircleChart :bgColor="'#ED9A2C'"></CircleChart>
+				<CircleChart ref="putObj" :bgColor="'#ED9A2C'"></CircleChart>
 				<text class="size-24 sys-from-background-color m-t16">回款</text>
 			</view>
 		</view>
@@ -20,21 +20,50 @@
 	import StatisticsTitle from "./statistics_title.vue";
 
 	export default {
-		name: 'content_chart',
+		name: 'stat_finance_chart',
+    props:{
+      'moneyData':{
+        default:()=>{
+          return {
+            out_money: 0,
+            out_num: 0,
+            put_money: 0,
+            put_num: 0,
+          }
+        }
+      }
+    },
 		components: {
 			CircleChart,
 			StatisticsTitle
 		},
+    watch:{
+      'moneyData':function (){
+        this.initData()
+      },
+      'outRatio':function (){
+        this.$refs.outObj.setServerData(this.outRatio)
+      },
+      'putRatio':function () {
+        this.$refs.putObj.setServerData(this.putRatio)
+      }
+    },
 		data() {
 			return {
-
+        totalMoney:0,
+        outRatio:0,
+        putRatio:0,
 			};
 		},
 		methods: {
-			onHandle() {
-				console.log(999);
-				// 业务跳转
-			}
+      initData(){
+        this.totalMoney=this.moneyData.out_money+this.moneyData.put_money
+        if(this.totalMoney>0){
+          this.outRatio=(this.moneyData.out_money/this.totalMoney).toFixed(2)
+          this.putRatio=(this.moneyData.put_money/this.totalMoney).toFixed(2)
+        }
+      },
+
 		}
 	}
 </script>

+ 2 - 2
pages/statistics/statistics.vue

@@ -14,7 +14,7 @@
 		<view class="statistics_content" :style="[{top:`${$tools.topHeight() + positionHeight}px`}]">
 
 			<view class="">
-				<HeadData v-if="statType === 3 || statType === 4" :date-type-obj="dateTypeObj"></HeadData>
+<!--				<HeadData v-if="statType === 3 || statType === 4" :date-type-obj="dateTypeObj"></HeadData>-->
 				<view class="tabs page-box-bg-fff m-lr30 r-30" v-if="statType === 6 || statType === 7"
 					:style="[{position:is_fixed?'absolute':''},{top:`${$tools.topHeight() + 85}px`}]"
 					style="height: 100rpx;">
@@ -27,7 +27,7 @@
 				<StatSingleData :is_fixed="is_tabs_fixed" v-if="is_single_data"></StatSingleData>
 				<view class="sys-list-background-color p-lr30">
 					<!-- 汇总统计-公司 -->
-					<GeneralStat v-if="statType === 3"></GeneralStat>
+					<GeneralStat :date-type-obj="dateTypeObj" v-if="statType === 3"></GeneralStat>
 					<!-- 资金统计-部门 -->
 					<CapitalStat v-if="statType === 4"></CapitalStat>
 					<!-- 提放统计-部门 -->