Browse Source

Merge branch 'develop_yh39' of http://git.chelingzhu.com/jianguan-web/jg-ocs-html into develop_yh39

chenrui 1 year ago
parent
commit
887669ef09

+ 21 - 14
src/views/dealerManagement/rebateBinding/categoryList.vue

@@ -48,6 +48,7 @@ const ChildTableComp = {
   },
   data () {
     return {
+      simpleImage: Empty.PRESENTED_IMAGE_SIMPLE,
       columns: [
         { title: '序号', field: 'no', key: 'a', width: 40, align: 'center', operationColumn: false },
         { title: '品牌', field: 'productBrandName', key: 'b', width: 100, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
@@ -234,24 +235,30 @@ export default {
         })
       }
 
-      return ret
+      return ret.filter(item => item.childData.length > 0)
     },
     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)

+ 9 - 3
src/views/dealerManagement/rebateBinding/list.vue

@@ -55,7 +55,7 @@
         <!-- 操作按钮 -->
         <div class="table-operator" style="display: flex;align-items: center;justify-content: space-between;" v-if="showBtns">
           <a-button id="rebateBinding-brand" type="primary" class="button-error" @click="openGlModal">差价设置</a-button>
-          <div v-if="!isTeyue">
+          <div v-if="!isTeyue && hasData">
             <a-button type="default" @click="expandAllRow">{{ expandAll?'收起全部':'展开全部' }}</a-button>
           </div>
         </div>
@@ -65,7 +65,7 @@
     </a-spin>
 
     <!-- 差价设置 -->
-    <priceDiffModal ref="priceDiffModal" :openModal="openModal" @ok="resetSearchForm" @close="openModal=false"></pricediffmodal>
+    <priceDiffModal ref="priceDiffModal" :openModal="openModal" @ok="resetGetData" @close="openModal=false"></pricediffmodal>
   </div>
 </template>
 
@@ -100,7 +100,8 @@ export default {
         dealerName: ''
       },
       showBtns: true,
-      expandAll: false
+      expandAll: false,
+      hasData: false
     }
   },
   computed: {
@@ -115,6 +116,7 @@ export default {
     },
     loadList (list) {
       this.showBtns = this.isTeyue ? list.length == 0 : true
+      this.hasData = list.length > 0
       this.$nextTick(() => {
         if (!this.expandAll) {
           this.expandAllRow()
@@ -146,6 +148,10 @@ export default {
       }
       this.expandAll = !this.expandAll
     },
+    resetGetData () {
+      this.$refs.categoryList.dataSource = []
+      this.resetSearchForm()
+    },
     // 重置表单
     resetSearchForm () {
       this.queryParam.dealerName = ''