浏览代码

fix: 附近项目展示

zh 2 年之前
父节点
当前提交
c0577c8ce5
共有 2 个文件被更改,包括 23 次插入23 次删除
  1. 23 19
      src/views/commercialEngineering/components/base.vue
  2. 0 4
      src/views/commercialEngineering/mixin/index.js

+ 23 - 19
src/views/commercialEngineering/components/base.vue

@@ -443,6 +443,7 @@ import { getTradeConfigList } from '@/api/basic_data/sectorAllocation'
 import GeographicalPosi from './geographicalPosi.vue'
 import FileUpload from '@/components/Common/file-upload.vue'
 import { mapGetters } from 'vuex'
+import { getPositionProject } from '@/api/frock'
 
 export default {
   components: {
@@ -503,25 +504,7 @@ export default {
     async 'formData.id'(newValue, oldValue) {
       if (newValue) {
         if (this.isTradeExaminer) {
-          if (this.commonData.vicinityMarkers.length) {
-            console.log(this.commonData, 8888)
-
-            this.markers = this.commonData.vicinityMarkers.map(k => {
-              return {
-                id: '',
-                name: k.projectName,
-                center: [k.lnt, k.lat],
-                address: k.address,
-                no: k.projectNo
-              }
-            })
-          }
-          this.markers.push({
-            name: this.formData.projectName,
-            center: [this.formData.lnt, this.formData.lat],
-            address: this.formData.address,
-            no: this.formData.projectNo
-          })
+          this.getPositionProject()
         } else {
           this.markers = [
             {
@@ -583,6 +566,26 @@ export default {
         }
       }
     },
+    getPositionProject() {
+      getPositionProject({ id: this.formData.id }).then(res => {
+        this.commonData.vicinityMarkers = res.data
+        this.markers = this.commonData.vicinityMarkers.map(k => {
+          return {
+            id: '',
+            name: k.projectName,
+            center: [k.lnt, k.lat],
+            address: k.address,
+            no: k.projectNo
+          }
+        })
+        this.markers.push({
+          name: this.formData.projectName,
+          center: [this.formData.lnt, this.formData.lat],
+          address: this.formData.address,
+          no: this.formData.projectNo
+        })
+      })
+    },
     handleArea(value, type) {
       this.formData[type] = this[type + 'List'].find(k => k.id === value).name
     },
@@ -677,6 +680,7 @@ export default {
         }
         this.tradeParentList = res.data
         if (this.formData.id) {
+          console.log(this.formData.tradeParentId)
           const item = this.tradeParentList.find(k => k.id === this.formData.tradeParentId)
           if (item.childList && item.childList.length) {
             this.tradeList = item.childList

+ 0 - 4
src/views/commercialEngineering/mixin/index.js

@@ -132,10 +132,6 @@ export default {
     this.getFirstPartyCustomerManagementList()
     if (this.detailId) {
       this.getCommercialEngineeringDetail()
-      // 审核员可查看附近项目
-      if (this.isTradeExaminer) {
-        this.getPositionProject()
-      }
     }
   },
   methods: {