From c77f5973192a8d22ff0ed34207f2397232c3e0d2 Mon Sep 17 00:00:00 2001
From: GULIMMO <2820890765@qq.com>
Date: Sat, 11 Nov 2023 20:23:53 +0800
Subject: [PATCH] 场所维护、房屋管理页面更新

---
 subPackage/workbench/views/editExamine.vue |  113 ++++++++++++++++++++-----------------
 subPackage/house/roomDetails/index.vue     |    2 
 subPackage/house/roomControl/index.vue     |   13 ++-
 3 files changed, 70 insertions(+), 58 deletions(-)

diff --git a/subPackage/house/roomControl/index.vue b/subPackage/house/roomControl/index.vue
index d455b56..b70ecf8 100644
--- a/subPackage/house/roomControl/index.vue
+++ b/subPackage/house/roomControl/index.vue
@@ -57,7 +57,7 @@
 					{{ labelModelInfo.title }}
 				</view>
 
-				<u-radio-group class="mt-40" v-model="labelValue" placement="row">
+				<u-radio-group v-model="" class="mt-40" v-model="labelValue" placement="row">
 					<u-radio :customStyle="{marginBottom: '8px'}" v-for="(item, index) in labelList" :key="index"
 						:label="item.name" :labelColor="item.color" :name="item.name" :activeColor="item.color" @change="radioChange(item)">
 					</u-radio>
@@ -178,10 +178,11 @@
 					title: '',
 					selectedColor: ''
 				},
-				labelValue: '',
+				labelValue: "",
 				remark: '',
 				// 标记
-				number: 0
+				number: 0
+				
 			}
 		},
 		created() {
@@ -306,9 +307,11 @@
 				this.labelModelInfo.title = item.name
 				this.currentLabelInfo = item
 				// 遍历标签集合
-				this.labelList.forEach(e => {
+				this.labelList.forEach(e => {
+					console.log(e.color,item.color);
 					if (e.color == item.color) {
-						this.labelValue = e.name
+						this.labelValue = e.name
+						console.log(e);
 						this.remark = item.remark
 						this.number = 1
 					}
diff --git a/subPackage/house/roomDetails/index.vue b/subPackage/house/roomDetails/index.vue
index f36b605..8c8a498 100644
--- a/subPackage/house/roomDetails/index.vue
+++ b/subPackage/house/roomDetails/index.vue
@@ -62,7 +62,7 @@
 						<view class="l flex">
 							<u-icon name="/static/icon/selected.png" size="16"></u-icon>
 							<!-- u-icon name="photo"></u-icon> -->
-							<view class="owner-img-box">主</view>
+							<view class="owner-img-box" v-if="item.relationship == 1">主</view>
 						</view>
 						<view class="r">
 							<u-icon name="/static/icon/delete.png" size="16" @click="removeHouseholdSub(item)"></u-icon>
diff --git a/subPackage/workbench/views/editExamine.vue b/subPackage/workbench/views/editExamine.vue
index 34482b0..3166e89 100644
--- a/subPackage/workbench/views/editExamine.vue
+++ b/subPackage/workbench/views/editExamine.vue
@@ -102,13 +102,13 @@
 			// this.getLocation()
 		},
 		methods: {
-			getLocation() {
-				uni.chooseLocation({
-					success: (res) => {
-						console.log(res);
-					}
-				})
-			},
+			// getLocation() {
+			// 	uni.chooseLocation({
+			// 		success: (res) => {
+			// 			console.log(res);
+			// 		}
+			// 	})
+			// },
 			getCsDetails() {
 				getPlaceDetail({
 					placeId: this.curSelectSite.id
@@ -128,10 +128,19 @@
 					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(data[key])
+							this.form[key] = [] 
+							if (!!data[key]) {
+								data[key] = JSON.parse(data[key])
+								if (Array.isArray(data[key])) {
+									this.form[key] = data[key]
+								}
+							} else {
+								this.form[key].push(data[key])
+							}
 						}
-					})
+					})
+					
+					console.log(this.form);
 					this.personNum = placePractitioner.length
 					this.$nextTick(() => {
 						console.log(placePractitioner);
@@ -140,49 +149,49 @@
 						})
 					})
 				})
+			},
+			updatePlaceExt(data) {
+				data['imageUrls'] = data['imageUrls'].join('、')
+				data['planImageUrls'] = data['planImageUrls'].join('、')
+				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>

--
Gitblit v1.9.3