230320a303 2 年之前
父节点
当前提交
8eaa895cd1

文件差异内容过多而无法显示
+ 0 - 0
dist/index.html


文件差异内容过多而无法显示
+ 0 - 0
dist/static/css/chunk-096a06ce.40ec49cd.css


文件差异内容过多而无法显示
+ 0 - 0
dist/static/js/app.656a6207.js


文件差异内容过多而无法显示
+ 0 - 0
dist/static/js/chunk-096a06ce.1297a2f0.js


文件差异内容过多而无法显示
+ 0 - 0
dist/static/js/chunk-22f0e970.4704879a.js


+ 58 - 2
src/views/house/components/popup/IndexEdit.vue

@@ -142,6 +142,9 @@ export default {
       tempImgIndex: [0, 0, 0],
       tempImgIndex: [0, 0, 0],
       ptObj: {},
       ptObj: {},
       isPtShow: false,
       isPtShow: false,
+      areaList: [],
+      areaChildList: [],
+      areaValIdObj: {},
     }
     }
   },
   },
   watch: {
   watch: {
@@ -170,7 +173,13 @@ export default {
               })
               })
             })
             })
             this.productData = [...productData]
             this.productData = [...productData]
-            this.getDef()
+            if (curData.area_data) {
+              this.getAreaChild('bc', () => {
+                this.getDef()
+              })
+            } else {
+              this.getDef()
+            }
             this.loading = false
             this.loading = false
           })
           })
         } else {
         } else {
@@ -180,7 +189,43 @@ export default {
       }
       }
     },
     },
   },
   },
+  created () {
+    this.$api.other.admareainfolist({
+      level: 1,
+      page_size: 99
+    }).then(res => {
+      let list = res.list || []
+      let areaValIdObj = {}
+      list.map(item => {
+        item.key = item.area_name
+        item.val = item.option1
+        areaValIdObj[item.val] = item.id
+      })
+      this.areaList = [...list]
+      this.areaValIdObj = {...areaValIdObj}
+      // console.log(areaValIdObj)
+    })
+  },
   methods: {
   methods: {
+    getAreaChild (str, bc) {
+      const cObj = this.cObj
+      this.$api.other.admareainfolist({
+        level: 2,
+        page_size: 99,
+        parent_id: this.areaValIdObj[cObj.area_type] || ''
+      }).then(res => {
+        let list = res.list || []
+        list.map(item => {
+          item.key = item.area_name
+          item.val = String(item.id)
+        })
+        this.areaChildList = [...list]
+        console.log(this.areaChildList)
+        if (str && str === 'bc') {
+          bc()
+        }
+      })
+    },
     closePtPopup (bcData) {
     closePtPopup (bcData) {
       this.isPtShow = false
       this.isPtShow = false
       if (bcData) {
       if (bcData) {
@@ -282,6 +327,12 @@ export default {
       })
       })
       this.productData = [...newArr]
       this.productData = [...newArr]
     },
     },
+    areaChange (val) {
+      this.cObj.area_type = val
+      this.getAreaChild('bc', () => {
+        this.getDef('change', 'area_type')
+      })
+    },
     getDef (str, strKey, strParams) {
     getDef (str, strKey, strParams) {
       let params = {}
       let params = {}
       if (str === 'change') {
       if (str === 'change') {
@@ -292,6 +343,7 @@ export default {
       let metroLine = params.metro_line || []
       let metroLine = params.metro_line || []
       let metroTypeArr = []
       let metroTypeArr = []
       if (str === 'change' && strKey === 'metro_line') params.metro_type = ''
       if (str === 'change' && strKey === 'metro_line') params.metro_type = ''
+      if (str === 'change' && strKey === 'area_type') params.area_child = ''
       const metroTypeAll = this.$dictData.metro_type || []
       const metroTypeAll = this.$dictData.metro_type || []
       metroTypeAll.map(item => {
       metroTypeAll.map(item => {
         metroLine.map(mline => {
         metroLine.map(mline => {
@@ -322,7 +374,11 @@ export default {
       }
       }
       this.formData = [
       this.formData = [
         { label: '楼盘名称', key: 'estate_name', rules: 1 },
         { label: '楼盘名称', key: 'estate_name', rules: 1 },
-        { label: '所属区域', key: 'area_type', type: 'select', class: 'c-3', options: this.$dictData.area_type },
+        { label: '所属区域', key: 'area_type', type: 'select', class: 'c-3', options: this.areaList, changeHandle: this.areaChange },
+        { label: '所属区域', key: 'area_child', type: 'select', class: 'c-3', options: this.areaChildList },
+        // { label: '二级区域', key: 'area_child', type: 'selectRemote', class: 'c-3',
+        //   remoteParams: { skey: 'area_name', api: `other.admareainfolist?level=2&&page_size=99&parent_id=${params.area_type ? this.areaValIdObj[params.area_type] : ''}`, opKey: 'area_name', opVal: 'id' },
+        // },
         { label: '地铁线路', key: 'metro_line', type: 'select', class: 'c-3', options: this.$dictData.metro_line, changeHandle: this.metroLineChange, multiple: true },
         { label: '地铁线路', key: 'metro_line', type: 'select', class: 'c-3', options: this.$dictData.metro_line, changeHandle: this.metroLineChange, multiple: true },
         { label: '地铁站名', key: 'metro_type', type: 'select', class: 'c-3', options: metroTypeArr, multiple: true},
         { label: '地铁站名', key: 'metro_type', type: 'select', class: 'c-3', options: metroTypeArr, multiple: true},
         // { label: '周边医院', key: 'hospital_type', type: 'select', class: 'c-3', options: this.$dictData.hospital_type, multiple: true },
         // { label: '周边医院', key: 'hospital_type', type: 'select', class: 'c-3', options: this.$dictData.hospital_type, multiple: true },

部分文件因为文件数量过多而无法显示