USER-20230908AJ\Administrator před 1 rokem
rodič
revize
d25c345e2d

+ 55 - 11
pages/statistics/components/drawings_stat.vue

@@ -1,9 +1,17 @@
 <template>
 	<view class="">
+    <view class="tabs page-box-bg-fff  r-30 m-t30"
+          :style="[{position:is_fixed?'absolute':''}]" style="height: 100rpx;">
+      <z-tabs ref="tabs" :list="tabsList" :active-style="{color:'#10B261',fontWeight:'bold',fontSize:'30rpx'}"
+              :bar-style="{background:'#10B261'}" :inactive-style="{fontWeight:'bold',fontSize:'28rpx'}"
+              :current="current" :bar-animate-mode="'worm'" @change="tabsChange" />
+    </view>
+    <!-- 顶部单行统计 -->
+    <StatSingleData :genre="dateTypeObj.censusUserType" :total-money="moneyData.loanMoney" :total-num="moneyData.loanNum"  ></StatSingleData>
 		<StatLoanChart ref="outObj" :genre="1" :leftText="'提放汇总占比'"></StatLoanChart>
     <stat_gather is_group :leftText="'提放汇总明细'"  :out-list="outList" ></stat_gather>
     <StatRanking ref="rankingObj" :is_margin_top="false" :is_type="2" :leftText="'个人业绩排行'" :data-list="userList"></StatRanking>
-    <StatSituation ref="situationObj" :date-type-obj="dateTypeObj" :type="1"></StatSituation>
+    <StatSituation ref="situationObj" :date-type-obj="selectTypeObj" :type="1"></StatSituation>
 	</view>
 </template>
 
@@ -14,6 +22,7 @@
   import StatSituation from "@/pages/statistics/module/stat_situation.vue";
   import StatRanking from "@/pages/statistics/module/stat_ranking.vue";
   import Stat_gather from "@/pages/statistics/module/stat_gather.vue";
+  import StatSingleData from "@/pages/statistics/module/stat_single_data.vue";
 
 	export default {
     props:{
@@ -30,6 +39,7 @@
       }
     },
 		components: {
+      StatSingleData,
       Stat_gather,
       StatRanking,
       StatSituation,
@@ -37,8 +47,29 @@
 		},
 		data() {
 			return {
+        selectTypeObj:{
+          dateType:4,
+          selectDate:'2023-02-25',
+          money_type:4,
+          censusUserType:0,
+          product_id:5,
+        },
+        tabsList: [{
+          name: '汇总',
+          dot_color: 'red',
+          disabled: false
+        }, {
+          name: '银行',
+          dot_color: 'yellow',
+          disabled: false
+        }],
+        current: 0,
+
         userList:[],
-        moneyData:{},
+        moneyData:{
+          loanMoney: 0,
+          loanNum: 0
+        },
         outList:[]
 			}
 		},
@@ -51,24 +82,37 @@
       this.initData()
     },
     methods:{
+      tabsChange(e) {
+        if(e!==this.current){
+          this.current = e
+          this.selectTypeObj.money_type=this.current===0?4:5
+          this.startData()
+        }
+      },
       setSendMd5(){
         let str=JSON.stringify(this.dateTypeObj)
         return md5(str)
       },
       initData(){
         if(this.dateTypeObj.censusUserType>0){
+          this.selectTypeObj=this.dateTypeObj
+          this.selectTypeObj.money_type=4
+          this.selectTypeObj.product_id=5
           let sendMd5=this.setSendMd5()
           if(sendMd5 !== this.sendMd5){
             this.sendMd5=sendMd5
-            this.getDepartmentMoney()
-            this.setUserRanking()
-            this.$refs.situationObj.startList()
+           this.startData()
           }
         }
+      },
+      startData(){
+        this.getDepartmentMoney()
+        this.setUserRanking()
+        this.$refs.situationObj.startList()
       },
        setUserRanking(){
-        let fromData = this.dateTypeObj
-        fromData.pageNum = 10
+        let fromData = this.selectTypeObj
+        fromData.pageNum = 5
          getRanking(fromData).then((res)=>{
           if(res.code === 1){
             this.userList = res.data.items
@@ -79,12 +123,12 @@
         })
       },
       getDepartmentMoney(){
-         getDepartmentMoney(this.dateTypeObj).then((res)=>{
+         getDepartmentMoney(this.selectTypeObj).then((res)=>{
           if(res.code === 1){
-            this.moneyData.out_money=res.data.moneyData.loanMoney
-            this.moneyData.out_num=res.data.moneyData.loanNum
+            this.moneyData.loanMoney=res.data.moneyData.loanMoney
+            this.moneyData.loanNum=res.data.moneyData.loanNum
             this.outList=res.data.items
-            // this.$refs.outObj.setPeakChartData(this.outList)
+            this.$refs.outObj.setPeakChartData(this.outList)
           }
         })
       },

+ 26 - 11
pages/statistics/module/stat_gather.vue

@@ -2,14 +2,14 @@
 	<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 class="" v-if="is_type == 1">
-			<view class="row-justify-c m-b25" v-if="is_subsection">
-				<view class="subsection">
-					<uv-subsection :list="list" :bgColor="'#DBE8DB'" :activeColor="'#0FB160'" :inactiveColor="'#121212'"
-						:fontSize="14" custom-style="height: 70rpx;border-radius: 30rpx;"
-						custom-item-style="border-radius: 30rpx;" :current="current" @change="onChange"></uv-subsection>
-				</view>
-			</view>
+    <view class="row-justify-c m-b25" v-if="is_subsection">
+      <view class="subsection">
+        <uv-subsection :list="list" :bgColor="'#DBE8DB'" :activeColor="'#0FB160'" :inactiveColor="'#121212'"
+                       :fontSize="14" custom-style="height: 70rpx;border-radius: 30rpx;"
+                       custom-item-style="border-radius: 30rpx;" :current="current" @change="onChange"></uv-subsection>
+      </view>
+    </view>
+		<view class="" v-if="current===0">
 			<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">
@@ -28,7 +28,7 @@
 			</view>
 			<en-blank v-if="outList.length<=0"></en-blank>
 		</view>
-		<view v-if="is_type == 2">
+		<view v-else>
 			<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">
@@ -73,7 +73,7 @@
 			},
 			is_type: {
 				type: Number,
-				default: 1
+				default: 0
 			},
 			is_margin_top: {
 				type: Boolean,
@@ -94,6 +94,7 @@
 				default: []
 			}
 		},
+
 		data() {
 			return {
 				iconList: ['champion', 'runner-up', 'third'],
@@ -102,7 +103,21 @@
 				current: 0,
 				list: ['放款', '回款'],
 			};
-		}
+		},
+    watch:{
+      'is_type':function () {
+        this.current=this.is_type
+      }
+    },
+    mounted() {
+      this.current=this.is_type
+    },
+    methods: {
+      onChange(e){
+        console.log(e)
+        this.current=e+1
+      }
+    },
 	}
 </script>
 

+ 12 - 5
pages/statistics/module/stat_single_data.vue

@@ -1,5 +1,5 @@
 <template>
-	<view class="stat_single m-t20 m-lr30">
+	<view class="stat_single m-t20 ">
 		<view class="page-box-bg-fff row-justify-sb center p-lr30 m-t20 r-30 p-tb25" v-if="genre == 1">
 			<text class="num r-10 size-28 sys-weight-600 text-color-12">任务统计汇总</text>
 			<view class="row center">
@@ -12,11 +12,11 @@
 			<view class="row-c">
 				<image class="wh-80 m-r16" :src="`/static/img/statistics/${iconList[type]}.png`" mode=""></image>
 				<view class="row-c">
-					<text class="size-40 sys-weight-600 text-color-E83">78459.80</text>
+					<text class="size-40 sys-weight-600 text-color-E83">{{(totalMoney*1).toFixed(2)}}</text>
 					<text class="size-24 text-color-666 m-l10">万</text>
 				</view>
 			</view>
-			<text class="num r-10 size-24 text-color-666">放款50笔</text>
+			<text class="num r-10 size-24 text-color-666">放款{{totalNum}}笔</text>
 		</view>
 	</view>
 </template>
@@ -36,8 +36,15 @@
 			genre: {
 				type: Number,
 				default: 0
-			}
-		},
+			},
+      totalMoney:{
+        default: 0
+      },
+      totalNum:{
+        default: 0
+      },
+
+    },
 		data() {
 			return {
 				current: 0,

+ 3 - 24
pages/statistics/statistics.vue

@@ -14,16 +14,7 @@
 			</view>
 		</Nav>
 		<view class="">
-			<view class="tabs page-box-bg-fff m-lr30 r-30 m-t30"
-				v-if="dateTypeObj.censusUserType === 6 || dateTypeObj.censusUserType === 7"
-				:style="[{position:is_fixed?'absolute':''}]" style="height: 100rpx;">
-				<z-tabs ref="tabs" :list="tabsList" :active-style="{color:'#10B261',fontWeight:'bold',fontSize:'30rpx'}"
-					:bar-style="{background:'#10B261'}" :inactive-style="{fontWeight:'bold',fontSize:'28rpx'}"
-					:current="current" :bar-animate-mode="'worm'" @change="tabsChange" />
-			</view>
-			<!-- 顶部单行统计 -->
-			<StatSingleData :genre="dateTypeObj.censusUserType" :is_fixed="is_tabs_fixed" v-if="is_single_data">
-			</StatSingleData>
+
 			<view class=" p-lr30">
 				<!-- 汇总统计-公司 -->
 				<GeneralStat :date-type-obj="dateTypeObj" v-if="dateTypeObj.censusUserType === 3"></GeneralStat>
@@ -96,20 +87,10 @@
 		data() {
 			return {
 				timeData: ['', ''],
-				is_single_data: false, // 顶部单行统计是否显示
-				is_tabs_fixed: false, // tabs是否固定
 				scrollTop: 0,
 				statType: 0,
 				current: 0,
-				tabsList: [{
-					name: '汇总',
-					dot_color: 'red',
-					disabled: false
-				}, {
-					name: '银行',
-					dot_color: 'yellow',
-					disabled: false
-				}],
+
 				bgHeight: 50,
 				navsHeight: 65,
 				positionHeight: 50,
@@ -164,9 +145,7 @@
 					}
 				})
 			},
-			onChange(e) {
-				this.current = e
-			},
+
 			onTopSelect(type) {
 				uni.pageScrollTo({
 					scrollTop: 0,