JX.Li 1 kuukausi sitten
vanhempi
commit
b3e52a5485
1 muutettua tiedostoa jossa 4 lisäystä ja 2 poistoa
  1. 4 2
      src/views/yiqi/area/index.vue

+ 4 - 2
src/views/yiqi/area/index.vue

@@ -144,7 +144,7 @@
 
       <el-table-column label="所属包" align="center" prop="affiliatedPackage">
         <template slot-scope="scope">
-          {{affiliatedPackageList.filter(req => {return req.dictValue = scope.row.affiliatedPackage})[0].dictLabel }}
+          {{affiliatedPackageList.filter(req => {return req.dictValue = scope.row.affiliatedPackage}).length>0? affiliatedPackageList.filter(req => {return req.dictValue = scope.row.affiliatedPackage})[0].dictLabel : "" }}
         </template>
       </el-table-column>
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
@@ -493,7 +493,6 @@ export default {
     }
   },
   created() {
-    this.getList()
     this.getYqDictsLists()
     this.getAreaList()
   },
@@ -505,6 +504,7 @@ export default {
       getYqDicts("affiliated_package").then(res => {
         this.affiliatedPackageList = res.data
       })
+      this.getList()
     },
     setCalculateDistrictName(data) {
       this.form.calculateDistrictName = this.areaLists.filter(item => item.id == data)[0].name
@@ -519,9 +519,11 @@ export default {
     /** 查询小区列表 */
     getList() {
       this.loading = true
+      this.areaList = []
       listArea(this.queryParams).then(response => {
         this.areaList = response.rows
         this.total = response.total
+        this.$forceUpdate()
         this.loading = false
       })
     },