From 98c817ed9c015b50bfa4cb04d4d718d767a071d5 Mon Sep 17 00:00:00 2001
From: GULIMMO <2820890765@qq.com>
Date: Sat, 11 Nov 2023 19:45:59 +0800
Subject: [PATCH] 门牌码信息接口更新

---
 subPackage/workbench/views/editExamine.vue |   99 ++++++++++++++----------
 subPackage/workbench/views/rental.vue      |   19 +++-
 subPackage/house/houseNumber/index.vue     |   48 +++++++++--
 subPackage/workbench/views/cscj.vue        |    9 +-
 subPackage/workbench/views/csjl.vue        |   13 ++-
 subPackage/workbench/views/cshw.vue        |   10 +-
 subPackage/workbench/views/report.vue      |    7 +
 7 files changed, 133 insertions(+), 72 deletions(-)

diff --git a/subPackage/house/houseNumber/index.vue b/subPackage/house/houseNumber/index.vue
index 6fff03f..d3c0417 100644
--- a/subPackage/house/houseNumber/index.vue
+++ b/subPackage/house/houseNumber/index.vue
@@ -21,7 +21,8 @@
 			<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>
+						<u--image :src="sdate.value" width="80px" height="80px"
+							@click="imgPreview(sdate.value)"></u--image>
 					</view>
 				</template>
 			</line-item>
@@ -56,6 +57,9 @@
 	import {
 		getDoorplateAddressDetail
 	} from "@/api/doorplateAddress/doorplateAddress";
+	import {
+		getPlaceDetail
+	} from '@/api/place/place.js'
 	export default {
 		components: {
 			lineItem
@@ -191,12 +195,19 @@
 		},
 		methods: {
 			async getBuildingDetail() {
+				// const {
+				// 	code,
+				// 	data
+				// } = await getDoorplateAddressDetail({
+				// 	stdId: this.stdId
+				// })
 				const {
 					code,
 					data
-				} = await getDoorplateAddressDetail({
-					stdId: this.stdId
+				} = await getPlaceDetail({
+					houseCode: this.stdId
 				})
+				console.log(data);
 				if (code !== 200) {
 					uni.showToast({
 						title: "数据请求失败",
@@ -205,34 +216,49 @@
 					})
 					return
 				}
+				const doorplateAddressEntity = data?.doorplateAddressEntity || {}
+				const placePoiLabelVOList = data?.placePoiLabelVOList || {}
 				this.houseNumberData.forEach(item => {
 					if (!data[item.name]) {
-						item.value = data.place[item.name] || '未完善'
+						item.value = data.doorplateAddressEntity[item.name] || '未完善'
 					} else {
 						item.value = data[item.name] || '未完善'
 					}
+
+					if (item.name == 'label') {
+
+						let labelArr = []
+						placePoiLabelVOList.forEach(item => {
+							labelArr.push(item.labelName)
+						})
+						
+						item.value = labelArr.join('、')
+					}
 				})
-				
+
 				this.gridData.forEach(item => {
 					if (!data[item.name]) {
-						item.value = data.place[item.name] || '未完善'
+						item.value = data.doorplateAddressEntity[item.name] || '未完善'
 					} else {
 						item.value = data[item.name] || '未完善'
 					}
 				})
-				
+
 				this.collectData.forEach(item => {
 					if (!data[item.name]) {
-						item.value = data.place[item.name] || '未完善'
+						item.value = data.doorplateAddressEntity[item.name] || '未完善'
 					} else {
 						item.value = data[item.name] || '未完善'
 					}
 				})
-				
 
 
 				this.policeData.forEach(item => {
-					item.value = data[item.name] || '未完善'
+					if (!data[item.name]) {
+						item.value = data.doorplateAddressEntity[item.name] || '未完善'
+					} else {
+						item.value = data[item.name] || '未完善'
+					}
 				})
 			},
 			imgPreview(value) {
@@ -259,11 +285,13 @@
 			height: calc(100% - 110rpx);
 			padding-bottom: 20rpx;
 			overflow: auto;
+
 			.map {
 				width: 100%;
 				height: 240rpx;
 				background-color: #fff;
 			}
+
 			.box-title {
 				padding: 10px 0;
 
diff --git a/subPackage/workbench/views/cscj.vue b/subPackage/workbench/views/cscj.vue
index 028c8e9..11c8dbb 100644
--- a/subPackage/workbench/views/cscj.vue
+++ b/subPackage/workbench/views/cscj.vue
@@ -502,6 +502,7 @@
 
 					data.placePoiLabelVOList.forEach(item => {
 						let label = this.labelList[0].children.find(sl => sl.text === item.labelName) || {}
+						console.log(label);
 						label['isClose'] = false
 						this.showLabelList.push(label)
 					})
@@ -544,16 +545,16 @@
 				const townStreet = await this.getDoorplateAddressList(null, "townStreet")
 				this.setColumn(townStreet, 0)
 				//设置社区
-				const nei = await this.getDoorplateAddressList(townStreet[0].code, "nei")
+				const nei = await this.getDoorplateAddressList(townStreet[0]?.code, "nei")
 				this.setColumn(nei, 1)
 				//设置路
-				const streetRu = await this.getDoorplateAddressList(nei[0].code, "streetRu")
+				const streetRu = await this.getDoorplateAddressList(nei[0]?.code, "streetRu")
 				this.setColumn(streetRu, 2)
 				//设置地区
-				const district = await this.getDoorplateAddressList(streetRu[0].code, "district")
+				const district = await this.getDoorplateAddressList(streetRu[0]?.code, "district")
 				this.setColumn(district, 3)
 				//设置楼栋
-				const building = await this.getDoorplateAddressList(district[0].code, "building")
+				const building = await this.getDoorplateAddressList(district[0]?.code, "building")
 				this.setColumn(building, 4)
 			},
 
diff --git a/subPackage/workbench/views/cshw.vue b/subPackage/workbench/views/cshw.vue
index 36c834c..ffd876d 100644
--- a/subPackage/workbench/views/cshw.vue
+++ b/subPackage/workbench/views/cshw.vue
@@ -71,9 +71,9 @@
 			}
 		},
 		onShow() {
+			this.currentRole = uni.getStorageSync("activeRole")
 			this.resetParams()
-			this.getSiteList()
-			this.currentRole = uni.getStorageSync("activeRole")
+			this.getSiteList()
 		},
 		onReachBottom() {
 			this.pagingParams.current++
@@ -85,9 +85,11 @@
 				const params = {
 					placeName: this.keyWord,
 					confirmFlag: this.tabStatus
-				}
+				}
+				const { roleName } = this.currentRole
 				const res = await getSiteMaintenanceData({
-					...params,
+					...params,
+					roleName,
 					...this.pagingParams
 				})
 				console.log(res);
diff --git a/subPackage/workbench/views/csjl.vue b/subPackage/workbench/views/csjl.vue
index 0a12603..8a415ee 100644
--- a/subPackage/workbench/views/csjl.vue
+++ b/subPackage/workbench/views/csjl.vue
@@ -61,11 +61,13 @@
 					size: 10
 				},
 				tabsType: 1,
-				status: 'nomore'
+				status: 'nomore',
+				currentRole: {}
 			}
 		},
 		onShow() {
-			this.recordsData = []
+			this.recordsData = []
+			this.currentRole = uni.getStorageSync('activeRole')
 			this.getrRecordList()
 		},
 		onReachBottom() {
@@ -74,7 +76,9 @@
 		},
 		methods: {
 			async getrRecordList(placeName = this.iptContext, isPerfect = this.tabsType) {
-				this.status = 'loadmore'
+				this.status = 'loadmore'
+				const { roleName } = this.currentRole
+				console.log(this.currentRole);
 				const {
 					code,
 					data: {
@@ -82,7 +86,8 @@
 					}
 				} = await getLocationRecord({
 					placeName,
-					isPerfect,
+					isPerfect,
+					roleName,
 					...this.pagingParams
 				})
 				if (code !== 200) {
diff --git a/subPackage/workbench/views/editExamine.vue b/subPackage/workbench/views/editExamine.vue
index 408d4da..34482b0 100644
--- a/subPackage/workbench/views/editExamine.vue
+++ b/subPackage/workbench/views/editExamine.vue
@@ -99,13 +99,24 @@
 		onShow() {
 			this.curSelectSite = uni.getStorageSync('siteInfo')
 			this.getCsDetails()
+			// this.getLocation()
 		},
 		methods: {
+			getLocation() {
+				uni.chooseLocation({
+					success: (res) => {
+						console.log(res);
+					}
+				})
+			},
 			getCsDetails() {
 				getPlaceDetail({
 					placeId: this.curSelectSite.id
 				}).then(detailRes => {
-					const { code, data } = detailRes
+					const {
+						code,
+						data
+					} = detailRes
 					if (code !== 200) {
 						uni.showToast({
 							title: '数据请求失败',
@@ -116,9 +127,9 @@
 					const placePractitioner = data?.placePractitioner || []
 					Object.keys(this.form).forEach(key => {
 						this.form[key] = data[key]
-						if(key === 'imageUrls' || key === 'planImageUrls') {
-							this.form[key] = []
-							!!data[key] && this.form[key].push()
+						if (key === 'imageUrls' || key === 'planImageUrls') {
+							this.form[key] = []
+							!!data[key] && this.form[key].push(data[key])
 						}
 					})
 					this.personNum = placePractitioner.length
@@ -129,45 +140,49 @@
 						})
 					})
 				})
-			},
-			updatePlaceExt(data) {
-				data['imageUrls'] = JSON.stringify(data['imageUrls'])
-				data['planImageUrls'] = JSON.stringify(data['planImageUrls'])
-				updatePlaceExtData({...data}).then(res => {
-					const { code } = res
-					if (code !== 200) {
-						uni.showToast({
-							title: '提交失败',
-							icon: 'error'
-						})
-						return
-					}
-					uni.showToast({
-						title: '提交成功',
-						icon: 'success',
-						complete() {
-							setTimeout(() => {
-								uni.navigateBack()
-							}, 1500)
-						}
-					})
-				})
-			},
-			addPerson() {
-				this.personNum++
-			},
-			submit() {
-				const placePractitioner = []
-				this.$refs.formItemRef.forEach(item => {
-					item.form.placeId = this.form.placeId
-					placePractitioner.push(item.form)
-				})
-				this.form.placePractitioner = placePractitioner
-				this.updatePlaceExt(this.form)
-			},
-			pushPage() {
-				this.$u.func.globalNavigator('/subPackage/workbench/views/cshw')
 			}
+		},
+		updatePlaceExt(data) {
+			data['imageUrls'] = JSON.stringify(data['imageUrls'])
+			data['planImageUrls'] = JSON.stringify(data['planImageUrls'])
+			updatePlaceExtData({
+				...data
+			}).then(res => {
+				const {
+					code
+				} = res
+				if (code !== 200) {
+					uni.showToast({
+						title: '提交失败',
+						icon: 'error'
+					})
+					return
+				}
+				uni.showToast({
+					title: '提交成功',
+					icon: 'success',
+					complete() {
+						setTimeout(() => {
+							uni.navigateBack()
+						}, 1500)
+					}
+				})
+			})
+		},
+		addPerson() {
+			this.personNum++
+		},
+		submit() {
+			const placePractitioner = []
+			this.$refs.formItemRef.forEach(item => {
+				item.form.placeId = this.form.placeId
+				placePractitioner.push(item.form)
+			})
+			this.form.placePractitioner = placePractitioner
+			this.updatePlaceExt(this.form)
+		},
+		pushPage() {
+			this.$u.func.globalNavigator('/subPackage/workbench/views/cshw')
 		}
 	}
 </script>
diff --git a/subPackage/workbench/views/rental.vue b/subPackage/workbench/views/rental.vue
index 085ead8..2782260 100644
--- a/subPackage/workbench/views/rental.vue
+++ b/subPackage/workbench/views/rental.vue
@@ -158,7 +158,8 @@
 				})
 			}
 		},
-		onLoad() {
+		onLoad() {
+			this.currentRole = uni.getStorageSync('activeRole')
 			this.getStatistics()
 		},
 		onShow() {
@@ -193,11 +194,15 @@
 					scrollTop: 0, // 滚动到页面的目标位置(单位px)
 				});
 			},
-			getStatistics(auditStatus = '') {
-				let params = {}
+			getStatistics(auditStatus = '') {
+				const { roleName } = this.currentRole
+				let params = {
+					roleName
+				}
 				if (auditStatus) {
 					params = {
-						auditStatus
+						auditStatus,
+						roleName
 					}
 				}
 				getStatistics(params).then(res => {
@@ -212,7 +217,8 @@
 				return res.name
 			},
 			async getRentalHouseInfo(params = {}) {
-				this.loadingStatus = 'loadmore'
+				this.loadingStatus = 'loadmore'
+				const { roleName } = this.currentRole
 				const {
 					code,
 					data: {
@@ -220,7 +226,8 @@
 					}
 				} = await getRentalHouseContent({
 					tenantName: this.keyword,
-					...this.pagingParams,
+					...this.pagingParams,
+					roleName,
 					...this.selectParams
 				})
 				if (code !== 200) {
diff --git a/subPackage/workbench/views/report.vue b/subPackage/workbench/views/report.vue
index beea98b..cabbc65 100644
--- a/subPackage/workbench/views/report.vue
+++ b/subPackage/workbench/views/report.vue
@@ -93,6 +93,7 @@
 			}
 		},
 		onShow() {
+			this.currentRole = uni.getStorageSync("activeRole")
 			this.reportList = []
 			this.getPageList()
 		},
@@ -106,9 +107,11 @@
 				const params = {
 					realName: this.keyWord,
 					confirmFlag: this.tabStatus
-				}
+				}
+				const { roleName } = this.currentRole
 				const res = await getPage({
-					...params,
+					...params,
+					roleName,
 					...this.pagingParams
 				})
 				const {

--
Gitblit v1.9.3