From 197f13dbcf007eac8dd9a307aae992df677ea8f6 Mon Sep 17 00:00:00 2001
From: Lou <luzhiping@qqyjz.com>
Date: Fri, 10 Nov 2023 17:21:15 +0800
Subject: [PATCH] Merge branch 'master' of http://s16s652780.51mypc.cn:49896/r/jczz_app

---
 subPackage/workbench/views/rental.vue |   66 ++++++++++++++++++---------------
 1 files changed, 36 insertions(+), 30 deletions(-)

diff --git a/subPackage/workbench/views/rental.vue b/subPackage/workbench/views/rental.vue
index 7d417ff..550e135 100644
--- a/subPackage/workbench/views/rental.vue
+++ b/subPackage/workbench/views/rental.vue
@@ -67,7 +67,6 @@
 <script>
 	import {
 		getRentalHouseContent,
-		getPage,
 		getStatistics
 	} from '@/api/houseRental/houseRental.js'
 	export default {
@@ -86,10 +85,10 @@
 							name: '审核通过',
 							value: '1'
 						},
-						{
-							name: '审核不通过',
-							value: '2'
-						},
+						// {
+						// 	name: '审核不通过',
+						// 	value: '2'
+						// },
 						{
 							name: '未到期',
 							value: '10'
@@ -130,6 +129,7 @@
 					current: 1,
 					size: 10
 				},
+				selectParams: {},
 				tenantStatus: [{
 						name: '未到期',
 						value: 0
@@ -160,7 +160,6 @@
 		},
 		onLoad() {
 			this.getStatistics()
-			this.getList()
 		},
 		onShow() {
 			this.tenantList = []
@@ -179,24 +178,31 @@
 					params = {
 						auditStatus: auditStatus[0].value
 					}
-				}
-				if (floor[0].value !== '') {
-					params = {
-						...params,
-						floor: floor[0].value
-					}
 				}
-				this.getRentalHouseInfo(params)
+				if (floor[0].value !== '') {
+					params = {
+						...params,
+						floor: floor[0].value
+					}
+				}
+				this.selectParams = params
+				this.getRentalHouseInfo()
+				this.getStatistics(auditStatus[0].value)
+				// 回到顶部,避免触发触底加载
+				uni.pageScrollTo({
+					scrollTop: 0, // 滚动到页面的目标位置(单位px)
+				});
 			},
-			getStatistics() {
-				getStatistics().then(res => {
+			getStatistics(auditStatus = '') {
+				let params = {}
+				if (auditStatus) {
+					params = {
+						auditStatus
+					}
+				}
+				getStatistics(params).then(res => {
 					console.log(res, "+------------")
 					this.statistics = res.data
-				})
-			},
-			getList() {
-				getPage(this.query).then(res => {
-					console.log(res)
 				})
 			},
 			findObjValue(value, obj) {
@@ -215,7 +221,7 @@
 				} = await getRentalHouseContent({
 					tenantName: this.keyword,
 					...this.pagingParams,
-					...params
+					...this.selectParams
 				})
 				if (code !== 200) {
 					uni.showToast({
@@ -227,12 +233,12 @@
 				this.tenantList = [...this.tenantList, ...records]
 				this.loadingStatus = 'nomore'
 			},
-			search() {
+			search() {
 				this.resetParams()
 				this.getRentalHouseInfo()
 			},
 			clear() {
-				this.keyword = ''
+				this.keyword = ''
 				this.resetParams()
 				this.search()
 			},
@@ -241,13 +247,13 @@
 				id
 			}) {
 				this.$u.func.globalNavigator(`/subPackage/bs/views/rentDetail?houseCode=${houseCode}&id=${id}`)
-			},
-			resetParams() {
-				this.tenantList = []
-				this.pagingParams = {
-					current: 1,
-					size: 10
-				}
+			},
+			resetParams() {
+				this.tenantList = []
+				this.pagingParams = {
+					current: 1,
+					size: 10
+				}
 			}
 		}
 	}

--
Gitblit v1.9.3