From 01485892ff2bba1935d00eac76bce75843482818 Mon Sep 17 00:00:00 2001
From: GULIMMO <2820890765@qq.com>
Date: Tue, 07 Nov 2023 17:12:03 +0800
Subject: [PATCH] 场所记录、出租屋管理、门牌码信息更新

---
 subPackage/workbench/views/rental.vue     |  400 +++++++++++---------
 pages/home/index.vue                      |    4 
 api/place/place.js                        |    8 
 pages.json                                |    1 
 subPackage/house/houseNumber/index.vue    |  330 ++++++++++++----
 subPackage/house/houseNumber/lineItem.vue |   71 +++
 subPackage/workbench/views/csjl.vue       |  133 ++++--
 subPackage/house/family/index.vue         |    2 
 api/houseRental/houseRental.js            |  145 ++++---
 9 files changed, 710 insertions(+), 384 deletions(-)

diff --git a/api/houseRental/houseRental.js b/api/houseRental/houseRental.js
index aa1ccd2..0648ab2 100644
--- a/api/houseRental/houseRental.js
+++ b/api/houseRental/houseRental.js
@@ -1,69 +1,78 @@
-import http from '@/http/api.js'
-
-
-// 添加租赁信息
-export const addHouseRental = (data) => {
-	return http.request({
-		url: 'blade-houseRental/houseRental/add',
-		method: 'POST',
-		data
-	})
-}
-
-//删除
-export const deleteRentalInfo = (id) => {
-	return http.request({
-		url: 'blade-houseRental/houseRental/removeHouseRental',
-		method: 'POST',
-		params: {
-			id
-		}
-	})
-}
-
-// 续租
-export const updateDueTime = (data) => {
-	return http.request({
-		url: 'blade-houseRental/houseRental/update',
-		method: 'POST',
-		custom: {
-			'Authorization': true
-		},
-		data
-	})
-}
-
-// 修改数据
-// 续租
-export const updateRetalInfo = (data) => {
-	return http.request({
-		url: 'blade-houseRental/houseRental/updateHouseRental',
-		method: 'POST',
-		custom: {
-			'Authorization': true
-		},
-		data
-	})
-}
-
-//获取统计数据
-export const getStatistics = (params) => {
-	return http.request({
-		url: 'blade-houseRental/houseRental/getStatistics',
-		method: 'GET',
-		params: {
-			...params
-		}
-	})
-}
-
-//获取统计数据
-export const getPage = (params) => {
-	return http.request({
-		url: 'blade-houseRental/houseRental/page',
-		method: 'GET',
-		params: {
-			...params
-		}
-	})
+import http from '@/http/api.js'
+
+
+// 添加租赁信息
+export const addHouseRental = (data) => {
+	return http.request({
+		url: 'blade-houseRental/houseRental/add',
+		method: 'POST',
+		data
+	})
+}
+
+//删除
+export const deleteRentalInfo = (id) => {
+	return http.request({
+		url: 'blade-houseRental/houseRental/removeHouseRental',
+		method: 'POST',
+		params: {
+			id
+		}
+	})
+}
+
+// 续租
+export const updateDueTime = (data) => {
+	return http.request({
+		url: 'blade-houseRental/houseRental/update',
+		method: 'POST',
+		custom: {
+			'Authorization': true
+		},
+		data
+	})
+}
+
+// 修改数据
+// 续租
+export const updateRetalInfo = (data) => {
+	return http.request({
+		url: 'blade-houseRental/houseRental/updateHouseRental',
+		method: 'POST',
+		custom: {
+			'Authorization': true
+		},
+		data
+	})
+}
+
+//获取统计数据
+export const getStatistics = (params) => {
+	return http.request({
+		url: 'blade-houseRental/houseRental/getStatistics',
+		method: 'GET',
+		params: {
+			...params
+		}
+	})
+}
+
+//获取统计数据
+export const getPage = (params) => {
+	return http.request({
+		url: 'blade-houseRental/houseRental/page',
+		method: 'GET',
+		params: {
+			...params
+		},
+	})
+}
+
+// 出租房管理
+export const getRentalHouseContent = (params) => {
+	return http.request({
+		url: 'blade-houseRental/houseRental/page',
+		method: 'GET',
+		params
+	})
 }
\ No newline at end of file
diff --git a/api/place/place.js b/api/place/place.js
index 27ec08c..a19803b 100644
--- a/api/place/place.js
+++ b/api/place/place.js
@@ -6,4 +6,12 @@
 		method: 'POST',
 		data: data
 	})
+}
+
+export const getLocationRecord = (params) => {
+	return http.request({
+		url: 'blade-place/place/page',
+		method: 'GET',
+		params
+	})
 }
\ No newline at end of file
diff --git a/pages.json b/pages.json
index f1827c0..e3111ae 100644
--- a/pages.json
+++ b/pages.json
@@ -120,6 +120,7 @@
 				{
 					"path": "views/csjl",
 					"style": {
+						"onReachBottomDistance": 10,
 						"navigationBarTitleText": "场所记录",
 						"enablePullDownRefresh": false,
 						"navigationBarBackgroundColor": "#fff",
diff --git a/pages/home/index.vue b/pages/home/index.vue
index 1389d9d..dd6c888 100644
--- a/pages/home/index.vue
+++ b/pages/home/index.vue
@@ -155,7 +155,7 @@
 					</view>
 				</view>
 			</view>
-			<u-picker :title="roleTypeName" :show="selectBoxShow" keyName="name" ref="uPicker" :columns="siteColumns"
+			<u-picker :title="roleTypeName" :closeOnClickOverlay="true" @close="selectBoxShow = false" :show="selectBoxShow" keyName="name" ref="uPicker" :columns="siteColumns"
 				@confirm="confirmSite" @change="changeSite" @cancel="selectBoxShow = false"></u-picker>
 		</view>
 
@@ -216,7 +216,7 @@
 						style: {
 							background: 'linear-gradient(133deg, #FFFCF9 0%, rgba(255,252,249,0) 100%)',
 						},
-						path:""
+						path:"/subPackage/workbench/views/csjl"
 					},
 					{
 						icon: "/static/icon/menu-02.png",
diff --git a/subPackage/house/family/index.vue b/subPackage/house/family/index.vue
index 9c98ca5..be79603 100644
--- a/subPackage/house/family/index.vue
+++ b/subPackage/house/family/index.vue
@@ -3,7 +3,7 @@
 		<view class="flex f-d-c main">
 			<view class="cur-header">
 				<u-icon name="home" color="#fff"></u-icon>
-				{{housingName}}/{{buildingName}}栋
+				{{housingName}}/{{buildingName}}
 			</view>
 			<view class="h0 flex-1 build-list-box">
 				<u-collapse :border="false">
diff --git a/subPackage/house/houseNumber/index.vue b/subPackage/house/houseNumber/index.vue
index 94ed91c..6dc1658 100644
--- a/subPackage/house/houseNumber/index.vue
+++ b/subPackage/house/houseNumber/index.vue
@@ -1,46 +1,43 @@
 <template>
 	<view class="container">
 		<view class="info-box">
-			<view class="policeman-box">
-				<view class="line-box">
-					<view class="title">公安局</view>
-					<view class="value">{{ policeData.branchName }}</view>
-				</view>
-				<view class="line-box">
-					<view class="title">派出所</view>
-					<view class="value">{{ policeData.localPoliceStationName }}</view>
-				</view>
-				<view class="line-box">
-					<view class="title">辖区民警</view>
-					<view class="value">{{ policeData.policeman }}</view>
-				</view>
-				<view class="line-box">
-					<view class="title">联系电话</view>
-					<view class="value">{{ policeData.policemanPhone }}</view>
-				</view>
+			<box-title title="门牌号信息"></box-title>
+			<line-item :list="houseNumberData"></line-item>
+			<view class="map">
+				<map style="width: 100%; height: 100%;"></map>
 			</view>
-			<view class="fireman-box">
-				<view class="line-box">
-					<view class="title">消防照片</view>
-					<view class="value">未完善</view>
-				</view>
-				<view class="line-box">
-					<view class="title">采集人</view>
-					<view class="value">未完善</view>
-				</view>
-				<view class="line-box">
-					<view class="title">消防责任人</view>
-					<view class="value">未完善</view>
-				</view>
-				<view class="line-box">
-					<view class="title">采集时间</view>
-					<view class="value">未完善</view>
-				</view>
-				<view class="line-box">
-					<view class="title">历史事件</view>
-					<view class="value">未完善</view>
-				</view>
+			<view class="box-title">
+				<box-title title="综治网格">
+					<template slot="titleMore">
+						<view class="title-more">
+							<view class="red item"></view>
+							<view class="orange item">85.9</view>
+							<view class="green item"></view>
+						</view>
+					</template>
+				</box-title>
 			</view>
+			<line-item :list="gridData"></line-item>
+			<line-item :list="collectData">
+				<template #other="{ sdate }">
+					<view style="padding: 20rpx 0;" v-if="sdate.name === 'imageUrls' && sdate.value !== '未完善' ">
+						<u--image :src="sdate.value" width="80px" height="80px" @click="imgPreview(sdate.value)"></u--image>
+					</view>
+				</template>
+			</line-item>
+			<view class="box-title">
+				<box-title title="公安网格">
+					<template slot="titleMore">
+						<view class="title-more">
+							<view class="red item"></view>
+							<view class="orange item">85.9</view>
+							<view class="green item"></view>
+						</view>
+					</template>
+				</box-title>
+			</view>
+			<line-item :list="policeData"></line-item>
+			<line-item :list="firemanData"></line-item>
 		</view>
 		<view class="btn-box">
 			<view class="sl-box" @click="csjlClick">
@@ -55,22 +52,137 @@
 	</view>
 </template>
 <script>
+	import lineItem from './lineItem.vue'
 	import {
 		getDoorplateAddressDetail
 	} from "@/api/doorplateAddress/doorplateAddress";
 	export default {
+		components: {
+			lineItem
+		},
 		data() {
 			return {
 				stdId: '',
-				policeData: {
-					branchName: '未完善',
-					localPoliceStationName: '未完善',
-					policeman: '未完善',
-					policemanPhone: '未完善'
-				},
-				firemanData: {
-				
-				}
+				houseNumberData: [{
+						title: '场所标签',
+						name: 'label',
+						value: '未完善'
+					},
+					{
+						title: '场所名称',
+						name: 'placeName',
+						value: '未完善'
+					},
+					{
+						title: '场所负责人',
+						name: 'principal',
+						value: '未完善'
+					},
+					{
+						title: '手机号',
+						name: 'phone',
+						value: '未完善'
+					},
+					{
+						title: '场所简介',
+						name: '',
+						value: '未完善'
+					},
+					{
+						title: '标准地址',
+						name: 'addressName',
+						value: '未完善'
+					}
+				],
+				gridData: [{
+						title: '社区名称',
+						name: 'neiName',
+						value: '未完善'
+					},
+					{
+						title: '网格名称',
+						name: '',
+						value: '未完善'
+					},
+					{
+						title: '网格员',
+						name: '',
+						value: '未完善'
+					},
+					{
+						title: '联系电话',
+						name: '',
+						value: '未完善'
+					}
+				],
+				collectData: [{
+						title: '场所照片',
+						name: 'imageUrls',
+						isUseSlot: true,
+						value: '未完善'
+					},
+					{
+						title: '场所负责人',
+						name: 'username',
+						value: '未完善'
+					},
+					{
+						title: '采集人',
+						name: 'createUser',
+						value: '未完善'
+					},
+					{
+						title: '采集时间',
+						name: 'createTime',
+						value: '未完善'
+					},
+					{
+						title: '历史事件',
+						value: '未完善'
+					}
+				],
+				policeData: [{
+						title: '公安局',
+						name: 'branchName',
+						value: '未完善'
+					},
+					{
+						title: '派出所',
+						name: 'localPoliceStationName',
+						value: '未完善'
+					},
+					{
+						title: '辖区民警',
+						name: 'policeman',
+						value: '未完善'
+					},
+					{
+						title: '联系电话',
+						name: 'policemanPhone',
+						value: '未完善'
+					}
+				],
+				firemanData: [{
+						title: '消防照片',
+						value: '未完善'
+					},
+					{
+						title: '采集人',
+						value: '未完善'
+					},
+					{
+						title: '消防责任人',
+						value: '未完善'
+					},
+					{
+						title: '采集时间',
+						value: '未完善'
+					},
+					{
+						title: '历史事件',
+						value: '未完善'
+					}
+				]
 			}
 		},
 		onLoad(option) {
@@ -90,68 +202,86 @@
 						title: "数据请求失败",
 						icon: "error",
 						duration: 1500
-					})
+					})
 					return
-				}
-				const {
-					branchName,
-					localPoliceStationName,
-					policeman,
-					policemanPhone
-				} = data
-				console.log(data);
-				this.policeData = {
-					branchName: branchName || '未完善',
-					localPoliceStationName: localPoliceStationName || '未完善',
-					policeman: policeman || '未完善',
-					policemanPhone: policemanPhone || '未完善'
 				}
+				this.houseNumberData.forEach(item => {
+					if (!data[item.name]) {
+						item.value = data.place[item.name] || '未完善'
+					} else {
+						item.value = data[item.name] || '未完善'
+					}
+				})
+				
+				this.gridData.forEach(item => {
+					if (!data[item.name]) {
+						item.value = data.place[item.name] || '未完善'
+					} else {
+						item.value = data[item.name] || '未完善'
+					}
+				})
+				
+				this.collectData.forEach(item => {
+					if (!data[item.name]) {
+						item.value = data.place[item.name] || '未完善'
+					} else {
+						item.value = data[item.name] || '未完善'
+					}
+				})
+				
+
+
+				this.policeData.forEach(item => {
+					item.value = data[item.name] || '未完善'
+				})
+			},
+			imgPreview(value) {
+				uni.previewImage({
+					urls: [value],
+				})
 			},
-			cscjClick() {
-				this.$u.func.globalNavigator('/subPackage/workbench/views/cscj?stdId='+this.stdId)
-			},
-			csjlClick() {
-				this.$u.func.globalNavigator('/subPackage/workbench/views/csjl?stdId='+this.stdId)
+			cscjClick() {
+				this.$u.func.globalNavigator('/subPackage/workbench/views/cscj?stdId=' + this.stdId)
+			},
+			csjlClick() {
+				this.$u.func.globalNavigator('/subPackage/workbench/views/csjl?stdId=' + this.stdId)
 			}
 		},
 	}
 </script>
 <style lang="scss" scoped>
 	.container {
-		background-color: #f6f6f6;
+		background-color: #f6f6f6;
 		height: 100%;
 
-		.info-box {
-			height: calc(100% - 110rpx);
-			padding-bottom: 20rpx;
+		.info-box {
+			height: calc(100% - 110rpx);
+			padding-bottom: 20rpx;
 			overflow: auto;
-			.policeman-box,
-			.fireman-box {
-				background-color: #fff;
-				margin-top: 20rpx;
-				padding: 0 20rpx;
+			.map {
+				width: 100%;
+				height: 240rpx;
+				background-color: #fff;
+			}
+			.box-title {
+				padding: 10px 0;
 
-				.line-box {
+				.title-more {
 					display: flex;
-					justify-content: space-between;
-					border-bottom: 1rpx solid #f6f6f6;
-					padding: 25rpx 0;
-					font-size: 32rpx;
-					.title {
-						flex-shrink: 0;
-					}
-					
-					.value {
-						color: #989898;
-						width: 50%;
-						word-wrap: break-word;
-						margin-left: 20rpx;
-						text-align: right;
+					align-items: center;
+					height: 100%;
+
+					.item {
+						width: 50rpx;
+						height: 40rpx;
+						color: #ffffff;
+						padding: 6rpx;
+						font-size: 25rpx;
+						text-align: center;
+						line-height: 20px;
+						font-weight: 700;
 					}
 
-					&:last-child {
-						border: 0;
-					}
 				}
 			}
 		}
@@ -176,4 +306,18 @@
 			}
 		}
 	}
+
+	.red {
+		background-color: red;
+		border-radius: 10rpx 0rpx 0rpx 10rpx;
+	}
+
+	.orange {
+		background-color: orange;
+	}
+
+	.green {
+		background-color: green;
+		border-radius: 0rpx 10rpx 10rpx 0rpx;
+	}
 </style>
\ No newline at end of file
diff --git a/subPackage/house/houseNumber/lineItem.vue b/subPackage/house/houseNumber/lineItem.vue
new file mode 100644
index 0000000..68b14ae
--- /dev/null
+++ b/subPackage/house/houseNumber/lineItem.vue
@@ -0,0 +1,71 @@
+<template>
+	<view class="line-box">
+		<view class="line-item" v-for="(item, index) in list" :key="index">
+			<view class="text">
+				<view class="title">{{ item.title }}</view>
+				<view class="value" v-if="!item.isUseSlot">{{ item.value }}</view>
+			</view>
+			<view class="pic">
+				<slot name="pic" :sdate="item"></slot>
+			</view>
+			<view class="other">
+				<slot name="other" :sdate="item"></slot>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		props: {
+			list: {
+				required: true,
+				type: Array,
+				default: () => [{
+					title: '',
+					value: ''
+				}]
+			},
+		},
+	}
+</script>
+
+<style lang="scss" scoped>
+	.line-box {
+		background-color: #fff;
+		margin-top: 20rpx;
+		padding: 0 20rpx;
+
+		.line-item {
+			.text {
+				display: flex;
+				justify-content: space-between;
+				padding: 25rpx 0;
+				font-size: 32rpx;
+				background-color: #fff;
+				border-bottom: 1rpx solid #f6f6f6;
+
+				.title {
+					flex-shrink: 0;
+					width: 200rpx;
+				}
+
+				.value {
+					color: #989898;
+					width: 50%;
+					word-wrap: break-word;
+					margin-left: 20rpx;
+					text-align: right;
+				}
+
+				&:last-child {
+					border: 0;
+				}
+			}
+			.pic {
+				display: flex;
+				flex-wrap: wrap;
+			}
+		}
+	}
+</style>
\ No newline at end of file
diff --git a/subPackage/workbench/views/csjl.vue b/subPackage/workbench/views/csjl.vue
index 1fdfd90..1c8fc91 100644
--- a/subPackage/workbench/views/csjl.vue
+++ b/subPackage/workbench/views/csjl.vue
@@ -5,82 +5,128 @@
 				<u-tabs :list="tabsList" @click="tabClick" :scrollable="false"></u-tabs>
 			</view>
 			<view class="search">
-				<u--input placeholder="请输入场所名称" prefixIcon="search" class="search-ipt"
-					prefixIconStyle="font-size: 22px;color: #909399"></u--input>
+				<u-search placeholder="请输入场所名称" v-model="iptContext" :clearabled="true" :showAction="true" :animation="true"
+					@search="searchConfirm" @clear="clearConfirm"></u-search>
 			</view>
 		</view>
 		<view class="info-box">
-			<view class="records-card" v-for="records in recordsData" :key="records.id">
+			<view class="records-card" v-for="(records, index) in recordsData" :key="records.id"
+				@click="pushPage(records)">
 				<view class="title">
-					<text>{{ records.title }}</text>
-					<text>{{ records.time }}</text>
+					<text>{{ records.placeName }}</text>
+					<text>{{ records.createTime }}</text>
 				</view>
 				<view class="info">
 					<view class="charge-man">
 						<text>场所负责人:</text>
-						<text>{{ records.chargeMan }}</text>
+						<text>{{ records.username || '未完善' }}</text>
 					</view>
 					<view class="phone">
 						<text>手机号:</text>
-						<text>{{ records.phone }}</text>
+						<text>{{ records.phone || '未完善' }}</text>
 					</view>
 				</view>
 			</view>
 		</view>
+		<u-loadmore :status="status" loadmoreText="开始加载" loadingText="数据加载中" nomoreText="数据加载完成" line />
 	</view>
 </template>
 
 <script>
+	import {
+		getLocationRecord
+	} from '@/api/place/place.js'
 	export default {
 		data() {
 			return {
 				tabsList: [{
-						id: 1,
+						type: 1,
 						name: '全部'
 					},
 					{
-						id: 2,
+						type: 2,
 						name: '待完善'
 					},
 					{
-						id: 3,
+						type: 3,
 						name: '已完善'
 					}
 				],
-				recordsData: [{
-						id: 1,
-						title: '科创4栋',
-						time: new Date().toLocaleString(),
-						chargeMan: '铃铃铃',
-						phone: '17678654431'
-					},
-					{
-						id: 2,
-						title: '科创4栋',
-						time: new Date().toLocaleString(),
-						chargeMan: '铃铃铃',
-						phone: '17678654431'
-					},
-					{
-						id: 3,
-						title: '科创4栋',
-						time: new Date().toLocaleString(),
-						chargeMan: '铃铃铃',
-						phone: '17678654431'
-					},
-					{
-						id: 4,
-						title: '科创4栋',
-						time: new Date().toLocaleString(),
-						chargeMan: '铃铃铃',
-						phone: '17678654431'
-					}
-				]
+				recordsData: [],
+				iptContext: '',
+				pagingParams: {
+					current: 1,
+					size: 10
+				},
+				tabsType: 1,
+				status: 'nomore'
 			}
 		},
+		onShow() {
+			this.getrRecordList()
+		},
+		onReachBottom() {
+			this.pagingParams.current++
+			this.getrRecordList()
+		},
 		methods: {
-			tabClick() {
-
+			async getrRecordList(placeName = this.iptContext, isPerfect = this.tabsType) {
+				this.status = 'loadmore'
+				const {
+					code,
+					data: {
+						records
+					}
+				} = await getLocationRecord({
+					placeName,
+					isPerfect,
+					...this.pagingParams
+				})
+				if (code !== 200) {
+					this.$u.func.showToast({
+						title: "获取数据失败",
+						icon: "error"
+					})
+					return
+				}
+				this.recordsData = [...this.recordsData, ...records]
+				this.status = 'nomore'
+			},
+			tabClick({
+				type
+			}) {
+				this.pagingParams = {
+					current: 1,
+					size: 10
+				}
+				this.recordsData = []
+				this.tabsType = type
+				this.getrRecordList(this.iptContext, this.tabsType)
+			},
+			searchConfirm() {
+				this.recordsData = []
+				this.pagingParams = {
+					current: 1,
+					size: 10
+				}
+				this.getrRecordList(this.iptContext, this.tabsType)
+			},
+			clearConfirm() {
+				this.iptContext = ''
+				this.searchConfirm()
+			},
+			pushPage({
+				houseCode
+			}) {
+				if (!houseCode) {
+					uni.showToast({
+						title: "关键参数为空",
+						icon: "error"
+					})
+					return
+				}
+				let url = "/subPackage/workbench/views/cscj?stdId=" + houseCode
+				this.$u.func.globalNavigator(url)
 			}
 		}
 	}
@@ -88,15 +134,14 @@
 
 <style lang="scss" scoped>
 	.container {
-		height: 100%;
+		min-height: 100%;
 		overflow-y: auto;
 		background-color: #f6f6f6;
 
 		.tabsAndSearch {
 			background-color: #fff;
 
-			.tabs {
-			}
+			.tabs {}
 
 			.search {
 				padding: 20rpx 70rpx;
diff --git a/subPackage/workbench/views/rental.vue b/subPackage/workbench/views/rental.vue
index 74faf35..1105d1b 100644
--- a/subPackage/workbench/views/rental.vue
+++ b/subPackage/workbench/views/rental.vue
@@ -1,168 +1,216 @@
-<template>
-	<view class="">
-		<view class="header bgc-ff">
-			<view class="filter-box">
-				<chenchuang-CCDropDownFilter :filterData='filterData' :defaultIndex='defaultIndex'
-					@ed='handleSelect'></chenchuang-CCDropDownFilter>
-			</view>
-			<view class="search-box">
-				<u-search placeholder="请输入租户名" v-model="query.tenantName" :clearabled="true" :showAction="true"
-					:animation="true"></u-search>
-			</view>
-		</view>
-
-		<view class="content">
-			<view class="row flex  a-i-c" style="flex-wrap: wrap;">
-				<!-- 				<view class="row-item bgc-ff flex a-i-c">
-					<view class="dot bgc-green"></view>
-					<text class="f-24">长期3户 (3)人</text>
-				</view>
-				<view class="row-item bgc-ff flex a-i-c">
-					<view class="dot bgc-main"></view>
-					<text class="f-24">长期3户 (3)人</text>
-				</view>
-				<view class="row-item bgc-ff flex a-i-c">
-					<view class="dot bgc-orange"></view>
-					<text class="f-24">长期3户 (3)人</text>
-				</view> -->
-				<view v-for="(item,index) in statistics" :key="index" class="row-item bgc-ff flex a-i-c">
-					<view v-if="item.term =='shortTerm' " class="dot bgc-orange"></view>
-					<view v-if="item.term =='middleTerm' " class="dot bgc-main"></view>
-					<view v-if="item.term =='longTerm' " class="dot bgc-green"></view>
-					<text class="f-24">{{formatTerm(item.term)}}{{item.total}}户 ({{item.personNum}})人</text>
-				</view>
-
-
-
-			</view>
-
-			<view class="list bgc-ff" v-for="i in 3">
-				<view class="flex j-c-s-b a-i-c">
-					<view class="flex a-i-c">
-						<text class="f-32 mr-50">黄莺</text>
-						<view class="flex a-i-c">
-							<u-icon name="phone-fill" color="#017BFC"></u-icon>
-							<text class="f-28 ml-10">15180114174</text>
-						</view>
-					</view>
-					<u-tag text="未到期" type="success" plain plainFill></u-tag>
-				</view>
-				<view class="list-address f-28 c-99">
-					江西省上饶市信州区西市街道万达社区居民委员会滨江西路66号万达晶座11栋303室
-				</view>
-				<view class="list-action flex ">
-					<view class="action-item">
-						<u-icon name="/static/icon/list-02.png" width="40rpx" height="40rpx"></u-icon>
-						<text class="f-28 c-main ml-10">租客管理</text>
-					</view>
-					<view class="action-item">
-						<u-icon name="/static/icon/list-01.png" width="40rpx" height="40rpx"></u-icon>
-						<text class="f-28 c-main ml-10">租客管理</text>
-					</view>
-				</view>
-			</view>
-		</view>
-
-	</view>
-</template>
-
-<script>
-	import {
-		getPage,
-		getStatistics
-	} from '@/api/houseRental/houseRental';
-	export default {
-		data() {
-			return {
-				filterData: [
-					[{
-							name: '全部',
-							value: ''
-						},
-						{
-							name: '待审核',
-							value: '0'
-						},
-						{
-							name: '未到期',
-							value: '10'
-						},
-						{
-							name: '即将到期',
-							value: '20'
-						},
-						{
-							name: '已到期',
-							value: '30'
-						}
-					],
-					[{
-							name: '楼层',
-							value: ''
-						},
-						{
-							name: '1楼',
-							value: '1'
-						},
-						{
-							name: '2楼',
-							value: '2'
-						},
-						{
-							name: '3楼',
-							value: '3'
-						}
-					]
-				],
-				defaultIndex: [0, 0],
+<template>
+	<view class="">
+		<view class="header bgc-ff">
+			<view class="filter-box">
+				<chenchuang-CCDropDownFilter :filterData='filterData' :defaultIndex='defaultIndex'
+					@ed='handleSelect'></chenchuang-CCDropDownFilter>
+			</view>
+			<view class="search-box">
+				<u-search placeholder="请输入租户名" v-model="keyword" :clearabled="true" :showAction="true" :animation="true"
+					@search="search" @clear="clear"></u-search>
+			</view>
+		</view>
+
+		<view class="content">
+			<view class="row flex  a-i-c" style="flex-wrap: wrap;">
+				<!-- <view class="row-item bgc-ff flex a-i-c">
+					<view class="dot bgc-green"></view>
+					<text class="f-24">长期3户 (3)人</text>
+				</view>
+				<view class="row-item bgc-ff flex a-i-c">
+					<view class="dot bgc-main"></view>
+					<text class="f-24">中期3户 (3)人</text>
+				</view>
+				<view class="row-item bgc-ff flex a-i-c">
+					<view class="dot bgc-orange"></view>
+					<text class="f-24">短期3户 (3)人</text>
+				</view> -->
+				<view v-for="(item,index) in statistics" :key="index" class="row-item bgc-ff flex a-i-c">
+					<view v-if="item.term =='shortTerm' " class="dot bgc-orange"></view>
+					<view v-if="item.term =='middleTerm' " class="dot bgc-main"></view>
+					<view v-if="item.term =='longTerm' " class="dot bgc-green"></view>
+					<text class="f-24">{{formatTerm(item.term)}}{{item.total}}户 ({{item.personNum}})人</text>
+				</view>
+			</view>
+
+			<view class="list bgc-ff" v-for="records in tenantList">
+				<view class="flex j-c-s-b a-i-c">
+					<view class="flex a-i-c">
+						<text class="f-32 mr-50">{{ records.tenantName }}</text>
+						<view class="flex a-i-c">
+							<u-icon name="phone-fill" color="#017BFC"></u-icon>
+							<text class="f-28 ml-10">{{ records.phone || '未填写' }}</text>
+						</view>
+					</view>
+					<u-tag text="未到期" type="success" plain plainFill></u-tag>
+				</view>
+				<view class="list-address f-28 c-99">
+					{{ records.houseName }}
+				</view>
+				<view class="list-action flex ">
+					<view class="action-item" @click="tenantManage(records)">
+						<u-icon name="/static/icon/list-02.png" width="40rpx" height="40rpx"></u-icon>
+						<text class="f-28 c-main ml-10">租客管理</text>
+					</view>
+					<view class="action-item">
+						<u-icon name="/static/icon/list-01.png" width="40rpx" height="40rpx"></u-icon>
+						<text class="f-28 c-main ml-10">走访日志</text>
+					</view>
+				</view>
+			</view>
+		</view>
+
+	</view>
+</template>
+
+<script>
+	import {
+		getRentalHouseContent,
+		getPage,
+		getStatistics
+	} from '@/api/houseRental/houseRental.js'
+	export default {
+		data() {
+			return {
+				filterData: [
+					[{
+							name: '全部',
+							value: ''
+						},
+						{
+							name: '待审核',
+							value: '1'
+						},
+						{
+							name: '未到期',
+							value: '2'
+						},
+						{
+							name: '即将到期',
+							value: '3'
+						},
+						{
+							name: '已到期',
+							value: '3'
+						}
+					],
+					[{
+							name: '楼层',
+							value: ''
+						},
+						{
+							name: '1楼',
+							value: '1'
+						},
+						{
+							name: '2楼',
+							value: '2'
+						},
+						{
+							name: '3楼',
+							value: '3'
+						}
+					]
+				],
+				defaultIndex: [0, 0],
 				keyword: "",
-				statistics: [],
-				query: {
-					teanatName: "",
-				},
-
-			}
-		},
-		computed: {
-			formatTerm() {
-				return (term => {
-					if (term == 'longTerm') {
-						return "长期"
-					} else if (term == 'middleTerm') {
-						return "中期"
-					} else if (term == 'shortTerm') {
-						return "短期"
-					}
-				})
-			}
-		},
-		onLoad() {
-			this.getStatistics()
-			this.getList()
-		},
-		methods: {
-			handleSelect(res) {
-				console.log('选择res = ' + JSON.stringify(res));
-			},
-			getStatistics() {
-				getStatistics().then(res => {
-					console.log(res, "+------------")
-					this.statistics = res.data
-				})
-			},
-			getList() {
-				getPage(this.query).then(res => {
-					console.log(res)
-				})
-			}
-		}
-	}
-</script>
-<style lang="scss">
+				statistics: [],
+				tenantList: [],
+				status: [{
+						name: '未到期',
+						value: 0
+					},
+					{
+						name: '已到期',
+						value: 1
+					},
+					{
+						name: '已终止',
+						value: 2
+					},
+				],
+			}
+		},
+		computed: {
+			formatTerm() {
+				return (term => {
+					if (term == 'longTerm') {
+						return "长期"
+					} else if (term == 'middleTerm') {
+						return "中期"
+					} else if (term == 'shortTerm') {
+						return "短期"
+					}
+				})
+			}
+		},
+		onLoad() {
+			this.getStatistics()
+			this.getList()
+		},
+		onShow() {
+			this.getRentalHouseInfo()
+		},
+		methods: {
+			handleSelect(res) {
+				console.log('选择res = ' + JSON.stringify(res));
+			},
+			getStatistics() {
+				getStatistics().then(res => {
+					console.log(res, "+------------")
+					this.statistics = res.data
+				})
+			},
+			getList() {
+				getPage(this.query).then(res => {
+					console.log(res)
+				})
+			},
+			findObjValue(value, obj) {
+				const res = obj.find(item => {
+					return item.value == value
+				})
+				return res.name
+			},
+			async getRentalHouseInfo() {
+				const {
+					code,
+					data: {
+						records
+					}
+				} = await getRentalHouseContent({
+					tenantName: this.keyword
+				})
+				if (code !== 200) {
+					uni.showToast({
+						title: "数据请求错误",
+						icon: "error"
+					})
+					return
+				}
+				this.tenantList = records
+			},
+			search() {
+				this.getRentalHouseInfo()
+			},
+			clear() {
+				this.keyword = ''
+				this.search()
+			},
+			tenantManage({
+				houseCode,
+				id
+			}) {
+				this.$u.func.globalNavigator(`/subPackage/bs/views/rentDetail?houseCode=${houseCode}&id=${id}`)
+			}
+		}
+	}
+</script>
+<style lang="scss">
 	page {
 		background-color: #F5F5F5;
 	}
-
+	
 	.header {
 		width: 100%;
 		position: fixed;
@@ -170,27 +218,27 @@
 		left: 0;
 		z-index: 10;
 	}
-
+	
 	.filter-box {
 		width: 100%;
 		height: 100rpx;
 	}
-
+	
 	.search-box {
 		padding: 20rpx 24rpx 30rpx;
 	}
-
+	
 	.content {
 		width: 100%;
 		margin-top: 220rpx;
 		padding: 0 30rpx;
 		box-sizing: border-box;
-
+	
 		.row {
 			width: 100%;
 			padding: 20rpx 0;
 		}
-
+	
 		.row-item {
 			width: calc(100% / 3);
 			height: 46rpx;
@@ -198,50 +246,50 @@
 			padding: 0 20rpx;
 			box-sizing: border-box;
 		}
-
+	
 		.dot {
 			width: 10rpx;
 			height: 10rpx;
 			border-radius: 50%;
 			margin-right: 18rpx;
 		}
-
+	
 		.bgc-green {
 			background-color: #30D17C;
 		}
-
+	
 		.bgc-orange {
 			background-color: #FFAC3D;
 		}
-
+	
 		.list {
 			width: 100%;
 			padding: 30rpx 30rpx 0;
 			box-sizing: border-box;
 			margin-bottom: 20rpx;
-
+	
 			.list-address {
 				padding: 30rpx 0;
 			}
-
+	
 			.list-action {
 				padding: 22rpx 0 30rpx;
 				border-top: 1px solid #F5F5F5;
 			}
-
+	
 			.action-item {
 				display: flex;
 				flex: 1;
 				justify-content: center;
 			}
-
+	
 			.action-item:first-child {
 				border-right: 1px solid #DBDBDB;
 			}
-
+	
 			.mr-50 {
 				margin-right: 50rpx;
 			}
 		}
-	}
+	}
 </style>
\ No newline at end of file

--
Gitblit v1.9.3