USER-20230908AJ\Administrator 1 ano atrás
pai
commit
86df48b280

+ 122 - 10
pages/statistics/components/consume_stat.vue

@@ -1,29 +1,141 @@
 <template>
 	<view class="">
-		<StatLoanChart :genre="3" :leftText="'消金汇总占比'"></StatLoanChart>
-		<StatRanking :genre="3" :leftText="'消金汇总明细'"></StatRanking>
-		<StatRanking :genre="3" :is_type='2' :leftText="'个人业绩排行'"></StatRanking>
-		<StatSituation :type="1" :genre="3" :leftText="'情况说明'"></StatSituation>
+    <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" :type="current+1" :total-money="moneyData.loanMoney" :total-num="moneyData.loanNum"  ></StatSingleData>
+		<StatLoanChart ref="outObj" :genre="3" :leftText="'消金汇总占比'"></StatLoanChart>
+<!--		<StatRanking :genre="3" :leftText="'消金汇总明细'"></StatRanking>-->
+<!--		<StatRanking ref="rankingObj" :genre="3" :is_type='2' :leftText="'个人业绩排行'"></StatRanking>-->
+    <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="selectTypeObj" :type="1"></StatSituation>
 	</view>
 </template>
 
 <script>
 	import StatLoanChart from "../module/stat_loan_chart.vue"
-	import StatRanking from "../module/stat_situation.vue"
-	import StatSituation from "../module/stat_ranking.vue"
 	import StatSingleData from "../module/stat_single_data.vue"
+  import md5 from "js-md5";
+  import {getConsumeMoney, getRanking} from "@/api/statistics";
+  import Stat_gather from "@/pages/statistics/module/stat_gather.vue";
+  import StatRanking from "@/pages/statistics/module/stat_ranking.vue";
+  import StatSituation from "@/pages/statistics/module/stat_situation.vue";
 
 	export default {
+    props:{
+      'dateTypeObj':{
+        default:()=>{
+          return {
+            dateType:4,
+            selectDate:'2023-02-25',
+            money_type:1,
+            censusUserType:0,
+            product_id:5,
+          }
+        }
+      }
+    },
 		components: {
+      Stat_gather,
+      StatSingleData,
 			StatLoanChart,
-			StatRanking,
-			StatSituation,
+      StatRanking,
+      StatSituation,
 		},
 		data() {
 			return {
-
+        selectTypeObj:{
+          dateType:4,
+          selectDate:'2023-02-25',
+          money_type:1,
+          censusUserType:0,
+          product_id:5,
+        },
+        tabsList: [{
+          name: '未出款',
+          dot_color: 'red',
+          disabled: false
+        }, {
+          name: '签约',
+          dot_color: 'yellow',
+          disabled: false
+        }, {
+          name: '出款',
+          dot_color: 'yellow',
+          disabled: false
+        }],
+        current: 0,
+        moneyData:{
+          loanMoney: 0,
+          loanNum: 0
+        },
+        outList:[],
+        userList:[],
 			}
-		}
+		},
+    watch:{
+      'dateTypeObj':function () {
+        this.initData()
+      }
+    },
+    mounted() {
+      this.initData()
+    },
+    methods: {
+      tabsChange(e) {
+        if(e!==this.current){
+          this.current = e
+          this.selectTypeObj.money_type=this.current+1
+          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=1
+          let sendMd5=this.setSendMd5()
+          if(sendMd5 !== this.sendMd5){
+            this.sendMd5=sendMd5
+            this.startData()
+          }
+        }
+      },
+      startData(){
+        this.getConsumeMoney()
+        this.setUserRanking()
+      },
+      getConsumeMoney(){
+        getConsumeMoney(this.selectTypeObj).then((res)=>{
+          if(res.code === 1){
+            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)
+          }
+        })
+      },
+      setUserRanking(){
+        let fromData = this.selectTypeObj
+        fromData.pageNum = 5
+        getRanking(fromData).then((res)=>{
+          if(res.code === 1){
+            this.userList = res.data.items
+            this.$refs.rankingObj.setDataList(this.userList)
+          }else{
+            this.userList = []
+          }
+        })
+      },
+    },
 	}
 </script>
 

+ 2 - 2
pages/statistics/components/drawings_stat.vue

@@ -85,7 +85,7 @@
       tabsChange(e) {
         if(e!==this.current){
           this.current = e
-          this.selectTypeObj.money_type=this.current===0?4:5
+          this.selectTypeObj.money_type=this.current===0?5:4
           this.startData()
         }
       },
@@ -96,7 +96,7 @@
       initData(){
         if(this.dateTypeObj.censusUserType>0){
           this.selectTypeObj=this.dateTypeObj
-          this.selectTypeObj.money_type=4
+          this.selectTypeObj.money_type=5
           this.selectTypeObj.product_id=5
           let sendMd5=this.setSendMd5()
           if(sendMd5 !== this.sendMd5){

+ 4 - 1
pages/statistics/module/stat_single_data.vue

@@ -16,7 +16,7 @@
 					<text class="size-24 text-color-666 m-l10">万</text>
 				</view>
 			</view>
-			<text class="num r-10 size-24 text-color-666">放款{{totalNum}}笔</text>
+			<text class="num r-10 size-24 text-color-666">{{text}}{{totalNum}}笔</text>
 		</view>
 	</view>
 </template>
@@ -43,6 +43,9 @@
       totalNum:{
         default: 0
       },
+      text:{
+        default:'放款'
+      }
 
     },
 		data() {

+ 18 - 7
pages/statistics/statistics.vue

@@ -7,7 +7,7 @@
 				<HeadFilter v-model="dateTypeObj" @onTopSelect="onTopSelect" :user-status-list="userStatusList"
 					@setTimeDate="setTimeDate"></HeadFilter>
 				<view class="m-lr30 m-t30 bor-255 r-100" v-if="statType === 7">
-					<uv-subsection :list="list" :bgColor="'rgba(255,255,255,0.1)'" :activeColor="'#0FB160'"
+					<uv-subsection :list="list" :bgColor="'rgba(255,255,255,0.1)'" :activeColor="'#0FB160'" key-name="product_name"
 						:inactiveColor="'#004615'" :fontSize="14" custom-style="height: 70rpx;border-radius: 30rpx;"
 						custom-item-style="border-radius: 30rpx;" :current="current" @change="onChange"></uv-subsection>
 				</view>
@@ -68,9 +68,10 @@
 	// 业绩统计
 	import PerformanceStat from "./components/performance_stat.vue"
 
-	import {
-		getUserType
-	} from "@/api/statistics";
+  import {
+    getConsumeType,
+    getUserType
+  } from "@/api/statistics";
 
 	export default {
 		components: {
@@ -90,20 +91,19 @@
 				scrollTop: 0,
 				statType: 0,
 				current: 0,
-
 				bgHeight: 50,
 				navsHeight: 65,
 				positionHeight: 50,
 				bgSize: 150,
 				bg_path: 'https://wealfavor-1257406827.cos.ap-beijing.myqcloud.com/new-xcx/statistics/statistics-bg.png',
-				list: ['中银消费', '中邮消费', '新网车抵'],
+				list: [],
 				userStatusList: [],
 				dateTypeObj: {
 					dateType: 4, //时间类型
 					selectDate: '2023-02-25', //自定义的时候传数组,其它传开始日期
 					money_type: 1,
 					censusUserType: 0,
-					product_id: 5,
+					product_id: 0,
 				},
 			}
 		},
@@ -115,6 +115,7 @@
 		},
 		mounted() {
 			this.getUserType()
+			this.getConsumeType()
 		},
 
 		computed: {
@@ -133,6 +134,16 @@
 			// },
 		},
 		methods: {
+      onChange(e){
+          this.dateTypeObj.product_id=this.list[e].id
+      },
+      getConsumeType(){
+         getConsumeType().then((res)=>{
+          if(res.code === 1){
+            this.list = res.data
+          }
+        })
+      },
 			setTimeDate(timeDate) {
 				this.timeData = timeDate
 			},