From d60892249cd15d2a3b3e7383c48334e169499736 Mon Sep 17 00:00:00 2001 From: lion <120344285@qq.com> Date: Fri, 3 Nov 2023 14:45:23 +0800 Subject: [PATCH] up --- src/views/address/components/addAddress.vue | 8 +-- src/views/task/list/components/addPatrol.vue | 70 +++++++++++++++---- src/views/task/list/components/addUnit.vue | 12 ++-- src/views/task/list/components/showPatrol.vue | 2 +- 4 files changed, 67 insertions(+), 25 deletions(-) diff --git a/src/views/address/components/addAddress.vue b/src/views/address/components/addAddress.vue index 385b6fb..254820d 100644 --- a/src/views/address/components/addAddress.vue +++ b/src/views/address/components/addAddress.vue @@ -8,7 +8,7 @@ *枢纽名称:
- +
@@ -20,7 +20,7 @@
- +
@@ -30,7 +30,7 @@ 经度:
- +
@@ -40,7 +40,7 @@ 纬度:
- +
diff --git a/src/views/task/list/components/addPatrol.vue b/src/views/task/list/components/addPatrol.vue index b502d06..6ecec7c 100644 --- a/src/views/task/list/components/addPatrol.vue +++ b/src/views/task/list/components/addPatrol.vue @@ -8,7 +8,7 @@ *任务专题:
- + @@ -21,19 +21,19 @@ *检查日期:
-
- @@ -94,7 +94,9 @@ - + + + @@ -144,11 +146,19 @@ unitList: [], siteList: [], askList: [], - mission_id:'', + mission_id:'', + mapparams: { + zoom: 11, + }, + mapform: [], form: { mission_id: '', date: '', site_id: '', + siteName:'', + address:'', + lat:'', + lon:'', ask_id: '', ask_introduce: '', tips: '', @@ -164,7 +174,7 @@ required: true, message: '请选择检查日期' }], - site_id: [{ + siteName: [{ required: true, message: '请选择检查地点' }], @@ -198,6 +208,24 @@ }, changeSite(e){ console.log(e) + if(e==-1){ + this.form.site_id = '' + this.form.address = '' + this.form.lat = '' + this.form.lon = '' + this.form.siteName = '' + this.$refs.maps.box = true + }else{ + this.siteList.map(item=>{ + if(item.id==e){ + this.form.site_id = item.id + this.form.address = item.address + this.form.lat = item.lat + this.form.lon = item.lon + this.form.siteName = item.name + } + }) + } }, async getAddress() { const res = await listaddress({ @@ -225,13 +253,17 @@ this.form = { mission_id: res?.mission_id, date: res?.date, - site_id: res?.site_id, + site_id: res?.site_id, + siteName:'', + address:res?.address, + lat:res?.lat, + lon:res?.lon, ask_id: res?.ask_id, ask_introduce: res?.ask_introduce, tips: res?.tips, file_ids: res?.file_ids, } - + this.mapform = [res.lon, res.lat, res.address] for (var f of res.files) { this.pictureList.push({ id: f.id, @@ -294,7 +326,8 @@ } else { this.id = '' this.pictureList = [] - this.mission_id = '' + this.mission_id = '' + this.mapform=[] this.$refs['dialog'].reset() } }, @@ -303,6 +336,12 @@ if(newval){ this.form.mission_id = this.mission_id } + }, + mapform(newVal, oldVal) { + this.form.lon = newVal[0]; + this.form.lat = newVal[1]; + this.form.address = newVal[2]; + this.form.siteName = newVal[2] } } @@ -312,7 +351,10 @@