From 924b6972cbc7993d66dd85d5bb3d3150a145f076 Mon Sep 17 00:00:00 2001
From: GULIMMO <2820890765@qq.com>
Date: Sat, 11 Nov 2023 17:46:33 +0800
Subject: [PATCH] 场所维护等页面更新

---
 subPackage/workbench/views/editExamine.vue   |   89 +++++++++++++++++++++++++----
 subPackage/workbench/components/formItem.vue |    2 
 pages.json                                   |    2 
 subPackage/bs/views/repair.vue               |    2 
 subPackage/house/family/index.vue            |   32 +++++-----
 subPackage/bs/views/addRepair.vue            |    4 
 subPackage/house/list/index.vue              |   44 +++++++-------
 7 files changed, 118 insertions(+), 57 deletions(-)

diff --git a/pages.json b/pages.json
index 1748f03..1df850e 100644
--- a/pages.json
+++ b/pages.json
@@ -246,7 +246,7 @@
 				{
 					"path": "views/report",
 					"style": {
-						"navigationBarTitleText": "保修报事",
+						"navigationBarTitleText": "报事报修",
 						"enablePullDownRefresh": false,
 						"navigationBarBackgroundColor": "#fff",
 						"navigationBarTextStyle": "black"
diff --git a/subPackage/bs/views/addRepair.vue b/subPackage/bs/views/addRepair.vue
index 86ba038..c486804 100644
--- a/subPackage/bs/views/addRepair.vue
+++ b/subPackage/bs/views/addRepair.vue
@@ -86,8 +86,8 @@
 			this.info.type = option.type
 		},
 		onShow() {
-			this.curSelectSite = uni.getStorageSync('curSelectSite')
-			this.info.addressCode = this.curSelectSite.id
+			this.curSelectSite = uni.getStorageSync('siteInfo')
+			this.info.addressCode = this.curSelectSite.id
 			console.log(this.curSelectSite);
 		},
 		methods: {
diff --git a/subPackage/bs/views/repair.vue b/subPackage/bs/views/repair.vue
index e3460b6..258bc13 100644
--- a/subPackage/bs/views/repair.vue
+++ b/subPackage/bs/views/repair.vue
@@ -114,7 +114,7 @@
 		},
 		onShow() {
 			this.getStatistics()
-			this.curSelectSite = uni.getStorageSync('curSelectSite')
+			this.curSelectSite = uni.getStorageSync('siteInfo')
 			console.log(this.curSelectSite);
 		},
 
diff --git a/subPackage/house/family/index.vue b/subPackage/house/family/index.vue
index b574149..5a5c401 100644
--- a/subPackage/house/family/index.vue
+++ b/subPackage/house/family/index.vue
@@ -8,11 +8,11 @@
 			<view class="h0 flex-1 build-list-box content">
 				<u-collapse :border="false">
 					<u-collapse-item v-show="isShowBuild" style="border: none;" :name="index"
-						v-for="(item, index) in buildingList" :key="index">
-						<!-- :title="item.unitName" -->
-						<view slot="title" class="flex">
-							<u-icon name="/static/icon/group.png" size="16"></u-icon>
-							<view style="margin-left: 17rpx;">{{ item.unitName }}</view>
+						v-for="(item, index) in buildingList" :key="index">
+						<!-- :title="item.unitName" -->
+						<view slot="title" class="flex">
+							<u-icon name="/static/icon/group.png" size="16"></u-icon>
+							<view style="margin-left: 17rpx;">{{ item.unitName }}</view>
 						</view>
 						<view class="flex floor-content" v-for="(cItem, cIndex) in item.children" :key="cIndex">
 							<view class="floor-num-box flex a-i-c j-c-c">
@@ -56,10 +56,10 @@
 						</view>
 					</u-collapse-item>
 					<u-collapse-item class="sp-list" v-show="isShowShop" style="border: none;">
-						<view slot="title" class="flex">
-							<u-icon name="/static/icon/group.png" size="16"></u-icon>
-							<view style="margin-left: 17rpx;">商铺</view>
-						</view>
+						<view slot="title" class="flex">
+							<u-icon name="/static/icon/group.png" size="16"></u-icon>
+							<view style="margin-left: 17rpx;">商铺</view>
+						</view>
 						<view class="house-list-box flex" v-for="(item, index) in shopList" :name="index" :key="index"
 							@click.native="pushShopPage(item)">
 							<view class="l">
@@ -117,7 +117,7 @@
 		},
 		onShow() {
 			this.getBuildingList()
-			this.curSelectSite = uni.getStorageSync('curSelectSite')
+			this.curSelectSite = uni.getStorageSync('siteInfo')
 		},
 		methods: {
 			async getBuildingList() {
@@ -179,12 +179,12 @@
 			height: 0;
 			flex: 1;
 			overflow-y: auto;
-
-			
+
+			
 
 			.content {
 				margin-top: 20rpx;
-				background-color: #fff;
+				background-color: #fff;
 
 
 				.floor-info-box {
@@ -256,8 +256,8 @@
 						align-items: center;
 						width: calc(100% - 30rpx);
 						min-height: 116rpx;
-						box-sizing: border-box;
-						background-color: #FAFBFE;
+						box-sizing: border-box;
+						background-color: #FAFBFE;
 						margin: 15rpx;
 
 						&>view {
@@ -266,7 +266,7 @@
 						}
 					}
 
-					.u-grid-item {
+					.u-grid-item {
 						border: none;
 					}
 				}
diff --git a/subPackage/house/list/index.vue b/subPackage/house/list/index.vue
index 07342bc..c824d88 100644
--- a/subPackage/house/list/index.vue
+++ b/subPackage/house/list/index.vue
@@ -1,7 +1,7 @@
 <template>
 	<view class="container">
 		<view class="header">
-			<u-icon name="/static/icon/map.png" width="15" height="18"></u-icon>
+			<u-icon name="/static/icon/map.png" width="15" height="18"></u-icon>
 			<text>{{ curSelectSite.name }}/{{ curHouseTitle }}</text>
 		</view>
 		<view class="flex f-d-c main">
@@ -41,7 +41,7 @@
 			return {
 				isShowAoi:false,
 				isShowShop:false,
-				currentId: '',
+				currentId: '',
 				curSelectSite: {},
 				curHouseTitle: '',
 				houseList: [{
@@ -61,8 +61,8 @@
 			
 		},
 		onShow() {
-			this.getHouseInfo()
-			this.curSelectSite = uni.getStorageSync('curSelectSite')
+			this.getHouseInfo()
+			this.curSelectSite = uni.getStorageSync('siteInfo')
 		},
 
 		methods: {
@@ -75,9 +75,9 @@
 				const aoiList = res.data.aoiList
 				const shopList = res.data.shopList
 				if(aoiList.length>0){
-					this.isShowAoi =true
-					aoiList.forEach(item => {
-						item.title = item.name
+					this.isShowAoi =true
+					aoiList.forEach(item => {
+						item.title = item.name
 					})
 					this.houseList = aoiList || [{
 						title: '-'
@@ -95,9 +95,9 @@
 				
 			},
 			pushPage(value) {
-				const { id, title,addressType } = value
-				if (!id) {
-					return
+				const { id, title,addressType } = value
+				if (!id) {
+					return
 				}
 				// addressType == 3 街路巷
 				if(addressType == 1 || addressType == 3){
@@ -118,9 +118,9 @@
 	}
 </script>
 
-<style lang="scss" scoped>
-	page {
-		background-color: #f5f5f5;
+<style lang="scss" scoped>
+	page {
+		background-color: #f5f5f5;
 	}
 	.container {
 		width: 100%;
@@ -130,12 +130,12 @@
 		font-size: 26rpx;
 		
 		.header {
-			background-color: #fff;
-			padding: 20rpx 30rpx;
-			display: flex;
-			color: #333333;
-			text {
-				margin-left: 15rpx;
+			background-color: #fff;
+			padding: 20rpx 30rpx;
+			display: flex;
+			color: #333333;
+			text {
+				margin-left: 15rpx;
 			}
 		}
 
@@ -143,12 +143,12 @@
 			position: relative;
 			height: 0;
 			flex: 1;
-			overflow-y: auto;
-			margin-top: 20rpx;
+			overflow-y: auto;
+			margin-top: 20rpx;
 			background-color: #fff;
 
 			.house-container {
-				flex-wrap: wrap;
+				flex-wrap: wrap;
 				padding: 14rpx;
 
 				.house-list-box {
diff --git a/subPackage/workbench/components/formItem.vue b/subPackage/workbench/components/formItem.vue
index 0bff21e..4e2b7a5 100644
--- a/subPackage/workbench/components/formItem.vue
+++ b/subPackage/workbench/components/formItem.vue
@@ -7,7 +7,7 @@
 			<u-form-item label="电话号码" class="form-item">
 				<u--input v-model="form.telephone" border="none"></u--input>
 			</u-form-item>
-			<u-form-item label="咱据地" class="form-item">
+			<u-form-item label="根据地" class="form-item">
 				<u--input v-model="form.tempAddress" border="none"></u--input>
 			</u-form-item>
 		</u-form>
diff --git a/subPackage/workbench/views/editExamine.vue b/subPackage/workbench/views/editExamine.vue
index 1e36b43..07a0ba3 100644
--- a/subPackage/workbench/views/editExamine.vue
+++ b/subPackage/workbench/views/editExamine.vue
@@ -6,10 +6,10 @@
 				<u-form-item label="场所位置" required class="form-item" prop="localtion">
 					<u--input border="none" v-model="form.localtion"></u--input>
 				</u-form-item>
-				<u-form-item label="场所名称" required class="form-item"  prop="placeName">
+				<u-form-item label="场所名称" required class="form-item" prop="placeName">
 					<u--input border="none" v-model="form.placeName"></u--input>
 				</u-form-item>
-				<u-form-item label="法人信息" required class="form-item"  prop="legalPerson">
+				<u-form-item label="法人信息" required class="form-item" prop="legalPerson">
 					<u--input border="none" v-model="form.legalPerson"></u--input>
 				</u-form-item>
 				<u-form-item label="法人电话" class="form-item">
@@ -20,7 +20,7 @@
 		<view class="">
 			<box-title title="营业执照"></box-title>
 			<view class="upload-img">
-				<u-upload :fileList="form.images" :previewFullImage="uploadConfig.previewFullImage"
+				<u-upload :fileList="form.imageUrls" :previewFullImage="uploadConfig.previewFullImage"
 					:accept="uploadConfig.acceptImg" :multiple="uploadConfig.multiple" :maxCount="uploadConfig.maxCount"
 					:capture="uploadConfig.capture" @afterRead="afterReadImg" @delete="deletePic">
 				</u-upload>
@@ -29,7 +29,7 @@
 		<view class="">
 			<box-title title="场所平面图"></box-title>
 			<view class="upload-img">
-				<u-upload :fileList="form.images" :previewFullImage="uploadConfig.previewFullImage"
+				<u-upload :fileList="form.planImageUrls" :previewFullImage="uploadConfig.previewFullImage"
 					:accept="uploadConfig.acceptImg" :multiple="uploadConfig.multiple" :maxCount="uploadConfig.maxCount"
 					:capture="uploadConfig.capture" @afterRead="afterReadImg" @delete="deletePic">
 				</u-upload>
@@ -50,8 +50,11 @@
 	</div>
 </template>
 
-<script>
-	import { updatePlaceExtData } from '@/api/placeExp/placeExp.js'
+<script>
+	import {
+		updatePlaceExtData,
+		getPlaceDetail
+	} from '@/api/placeExp/placeExp.js'
 	import uploadMixin from "@/mixin/uploadMixin";
 	import boxTtitle from '@/components/boxTitle/index.vue'
 	import formItem from '../components/formItem.vue'
@@ -62,7 +65,8 @@
 		},
 		data() {
 			return {
-				form: {
+				form: {
+					id: '',
 					localtion: '',
 					placeName: '',
 					legalPerson: '',
@@ -87,22 +91,79 @@
 						trigger: ['blur', 'change']
 					}
 				},
-				personNum: 1
+				personNum: 1,
+				curSelectSite: {},
+				placeId: '',
 			}
 		},
+		onShow() {
+			this.curSelectSite = uni.getStorageSync('siteInfo')
+			this.getCsDetails()
+		},
 		methods: {
-			updatePlaceExt() {
-				
+			getCsDetails() {
+				getPlaceDetail({
+					placeId: this.curSelectSite.id
+				}).then(detailRes => {
+					const { code, data } = detailRes
+					if (code !== 200) {
+						uni.showToast({
+							title: '数据请求失败',
+							icon: 'error'
+						})
+						return
+					}
+					this.placeId = data.placeId
+					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()
+						}
+					})
+					this.personNum = placePractitioner.length
+					this.$nextTick(() => {
+						this.$refs.formItemRef.forEach((item, index) => {
+							item.form = this.$refs.formItemRef[index].form
+						})
+					})
+				})
+			},
+			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 personList = []
-				this.$refs.formItemRef.forEach(item => {
-					personList.push(item.form)
+				const placePractitioner = []
+				this.$refs.formItemRef.forEach(item => {
+					item.form.placeId = this.placeId
+					placePractitioner.push(item.form)
 				})
-				console.log(personList);
+				this.form.placePractitioner = placePractitioner
+				this.updatePlaceExt(this.form)
 			}
 		}
 	}

--
Gitblit v1.9.3