lilei 1 jaar geleden
bovenliggende
commit
a8bf583bab
1 gewijzigde bestanden met toevoegingen van 19 en 13 verwijderingen
  1. 19 13
      src/views/dealerManagement/rebateBinding/categoryList.vue

+ 19 - 13
src/views/dealerManagement/rebateBinding/categoryList.vue

@@ -237,21 +237,27 @@ export default {
       return ret
     },
     searchTable (queryParam) {
-      this.dataSource = []
-      this.list = []
-      this.disabled = true
-      this.spinning = true
-      // 品类列表
-      dealerUpsList(queryParam).then(res => {
-        this.$emit('loaded', res.data || [])
-        this.dataSource = res.data || []
-        // 处理数据
+      if (this.dataSource.length) {
+        this.$emit('loaded', this.dataSource)
         this.list = this.formatData(this.dataSource, queryParam)
         this.showEmpty = this.list.length <= 0
-        this.tableHeight = (this.showEmpty ? 0 : this.maxHeight) + 'px'
-        this.spinning = false
-        this.disabled = false
-      })
+      } else {
+        this.dataSource = []
+        this.list = []
+        this.disabled = true
+        this.spinning = true
+        // 品类列表
+        dealerUpsList(queryParam).then(res => {
+          this.$emit('loaded', res.data || [])
+          this.dataSource = res.data || []
+          // 处理数据
+          this.list = this.formatData(this.dataSource, queryParam)
+          this.showEmpty = this.list.length <= 0
+          this.tableHeight = (this.showEmpty ? 0 : this.maxHeight) + 'px'
+          this.spinning = false
+          this.disabled = false
+        })
+      }
     },
     handleEdit (record, e) {
       console.log(e)