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 ++++++++++++++++++++++++++++++--------------------------
 1 files changed, 61 insertions(+), 52 deletions(-)

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