USER-20230908AJ\Administrator 1 жил өмнө
parent
commit
729edc1bdc

+ 50 - 8
pages/statistics/module/head_data.vue

@@ -4,31 +4,73 @@
 			<view class="data_item page-box-bg-fff column-c r-30 p-tb25">
 				<image class="wh-80" src="/static/img/task/task-all.png" mode=""></image>
 				<view class="row-c p-tb20">
-					<text class="size-40 sys-weight-600 text-color-E83">78459.80</text>
+					<text class="size-40 sys-weight-600 text-color-E83">{{(moneyData.out_money).toFixed(2)}}</text>
 					<text class="size-24 text-color-666 m-l10">万</text>
 				</view>
-				<text class="num r-10 sys-from-background-color size-24 text-color-666">放款50笔</text>
+				<text class="num r-10 sys-from-background-color size-24 text-color-666">放款{{moneyData.out_num}}笔</text>
 			</view>
 			<view class="data_item page-box-bg-fff column-c r-30 p-tb25">
 				<image class="wh-80" src="/static/img/task/task-all.png" mode=""></image>
 				<view class="row-c p-tb20">
-					<text class="size-40 text-color-108 sys-weight-600">380.66</text>
+					<text class="size-40 text-color-108 sys-weight-600">{{(moneyData.put_money).toFixed(2)}}</text>
 					<text class="size-24 text-color-666 m-l10">万</text>
 				</view>
-				<text class="num r-10 sys-from-background-color size-24 text-color-666">回款50笔</text>
+				<text class="num r-10 sys-from-background-color size-24 text-color-666">回款{{moneyData.put_num}}笔</text>
 			</view>
 		</view>
 	</view>
 </template>
 
 <script>
-	export default {
+	import {getSysCashier} from "@/api/statistics";
+
+  export default {
 		name: 'head_filter',
-		data() {
+    props:{
+      'dateTypeObj':{
+        default:()=>{
+          return {
+            dateType:4,
+            selectDate:'2023-02-25',
+            money_type:1,
+            censusUserType:0,
+            product_id:5,
+          }
+        }
+      }
+    },
+    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>
 

+ 8 - 5
pages/statistics/module/head_filter.vue

@@ -53,14 +53,14 @@
 				isRote: false,
 				animation: null,
         newUserTypeName:'',
-        dateName:'数据',
+        dateName:'数据',
         dateData:[{'id':1,'name':'日数据'},{'id':2,'name':'周数据'},{'id':3,'name':'月数据'},{'id':4,'name':'年数据'}],
 
         dateTypeObj:{
           dateType:4,//时间类型
-          selectDate:'2023-02-25',//自定义的时候传数组,其它传开始日期
+          selectDate:'',//自定义的时候传数组,其它传开始日期
           money_type:1,
-          censusUserType:1,
+          censusUserType:0,
           product_id:5,
         },
         selectType:1,
@@ -73,8 +73,11 @@
         console.log(this.userStatusList)
         this.setCensusUserType(0)
       },
-      'dateTypeObj':function (){
-        this.$emit('input',this.dateTypeObj)
+      'dateTypeObj':{
+        deep:true,
+        handler:function (){
+          this.$emit('input',this.dateTypeObj)
+        }
       }
     },
     mounted() {

+ 1 - 1
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"></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;">