From 78b5b28e9e014a09ddcbcae92ac7328044d1691d Mon Sep 17 00:00:00 2001
From: guoshilong <123456>
Date: Fri, 03 Nov 2023 17:37:02 +0800
Subject: [PATCH] 场所采集回显公安网格

---
 subPackage/workbench/views/cscj.vue |   85 +++++++++++++++++++++++++++++++-----------
 1 files changed, 62 insertions(+), 23 deletions(-)

diff --git a/subPackage/workbench/views/cscj.vue b/subPackage/workbench/views/cscj.vue
index 2a87976..ac8d6e5 100644
--- a/subPackage/workbench/views/cscj.vue
+++ b/subPackage/workbench/views/cscj.vue
@@ -109,10 +109,10 @@
 		</view>
 
 		<view class="item">
-			<lineItem :dataInfo="comprehensiveData.basic">
+			<lineItem :dataInfo="publicData.basic">
 			</lineItem>
 
-			<lineItem :dataInfo="comprehensiveData.scene">
+			<lineItem :dataInfo="publicData.scene">
 				<template v-slot:pic="{scope}">
 					{{scope.value}}
 				</template>
@@ -319,6 +319,7 @@
 				showLabelList: [],
 
 				stdId: "",
+				buildingData: {},
 			}
 		},
 		watch: {
@@ -330,6 +331,11 @@
 			"form.buildingCode": {
 				handler(newVal) {
 					console.log(newVal)
+
+					this.getBuildingDetail({
+						buildingCode: newVal
+					})
+
 				}
 			}
 
@@ -344,11 +350,21 @@
 		options: {
 			styleIsolation: 'shared', // 解除样式隔离
 		},
-		onLoad(option) {
+		async onLoad(option) {
 			this.stdId = option.stdId
 			console.log(this.stdId, "----------")
 			if (this.stdId) {
-				this.getBuildingDetail()
+				const data = await this.getBuildingDetail()
+				console.log(data, "-----------")
+				this.form.buildingCode = data.buildingCode
+
+				let buildingNameArr = [data.townStreetName, data.neiName, data.streetRuName, data.aoiName,
+					data.buildingName
+				]
+				let arr = buildingNameArr.filter(e => {
+					return e != null || e != ''
+				})
+				this.form.building = arr.join("")
 			}
 
 
@@ -359,24 +375,41 @@
 		},
 		methods: {
 
-			getBuildingDetail(params = {}) {
+			buildDataInfo() {
+				console.log("------------------------------22222222222")
+				let basic = [{
+						label: "公安局",
+						value: this.buildingData.branchName
+					},
+					{
+						label: "派出所",
+						value: this.buildingData.localPoliceStationName
+					},
+					{
+						label: "辖区民警",
+						value: this.buildingData.policeman
+					},
+					{
+						label: "联系电话",
+						value: this.buildingData.policemanPhone
+					}
+				]
+				this.publicData.basic = basic
+				console.log(this.publicData)
 
+			},
 
-				getDoorplateAddressDetail(Object.assign(params, {
+			async getBuildingDetail(params = {}) {
+
+				const res = await getDoorplateAddressDetail(Object.assign(params, {
 					stdId: this.stdId
-				})).then(res => {
-					let data = res.data
-					this.form.buildingCode = data.buildingCode
+				}))
 
-					let buildingNameArr = [data.townStreetName, data.neiName, data.streetRuName, data.aoiName,
-						data.buildingName
-					]
-					let arr = buildingNameArr.filter(e => {
-						return e != null || e != ''
-					})
-					this.form.building = arr.join("")
+				let data = res.data
+				this.buildingData = data
+				this.buildDataInfo()
+				return data
 
-				})
 			},
 
 			//表单提交
@@ -401,7 +434,8 @@
 								success() {
 									setTimeout(() => {
 										that.$u.func.globalNavigator(
-											"/pages/home/index", "switchTab")
+											"/pages/home/index",
+											"switchTab")
 									}, 1000)
 								}
 							})
@@ -488,10 +522,12 @@
 					const streetRu = await this.getDoorplateAddressList(nei[0].code, "streetRu")
 					picker.setColumnValues(2, streetRu)
 
-					const district = await this.getDoorplateAddressList(streetRu[0].code, "district")
+					const district = await this.getDoorplateAddressList(streetRu[0].code,
+						"district")
 					picker.setColumnValues(3, district)
 
-					const building = await this.getDoorplateAddressList(district[0].code, "building")
+					const building = await this.getDoorplateAddressList(district[0].code,
+						"building")
 					picker.setColumnValues(4, building)
 				}
 
@@ -499,10 +535,12 @@
 					const streetRu = await this.getDoorplateAddressList(item.code, "streetRu")
 					picker.setColumnValues(2, streetRu)
 
-					const district = await this.getDoorplateAddressList(streetRu[0].code, "district")
+					const district = await this.getDoorplateAddressList(streetRu[0].code,
+						"district")
 					picker.setColumnValues(3, district)
 
-					const building = await this.getDoorplateAddressList(district[0].code, "building")
+					const building = await this.getDoorplateAddressList(district[0].code,
+						"building")
 					picker.setColumnValues(4, building)
 				}
 
@@ -511,7 +549,8 @@
 					const district = await this.getDoorplateAddressList(item.code, "district")
 					picker.setColumnValues(3, district)
 
-					const building = await this.getDoorplateAddressList(district[0].code, "building")
+					const building = await this.getDoorplateAddressList(district[0].code,
+						"building")
 					picker.setColumnValues(4, building)
 				}
 

--
Gitblit v1.9.3