lilei 6 months ago
parent
commit
aeb106090e

+ 3 - 3
src/views/salesManagement/salesQueryNew/comps/detailProductList.vue

@@ -1,11 +1,11 @@
 <template>
   <!-- 已选配件列表 -->
   <a-spin :spinning="spinning" tip="Loading...">
-    <div style="margin: 10px 0;">
+    <div style="margin: 0 0 10px 0;">
       <ve-table
         border-y
         :scroll-width="0"
-        :max-height="showEmpty?0:tableHeight"
+        :max-height="tableHeight"
         :show-header="showTableHead"
         :row-style-option="{clickHighlight: true}"
         :cellSelectionOption="{enable: false}"
@@ -327,7 +327,7 @@ export default {
         this.outStockStr = '产品编号为:' + str + '的产品库存不足;'
       }
       this.showEmpty = this.dataSource.length <= 0
-      this.tableHeight = (this.showEmpty ? 200 : this.maxHeight) + 'px'
+      this.tableHeight = (this.showEmpty ? 0 : this.maxHeight) + 'px'
       this.spinning = false
       this.disabled = false
     }

+ 9 - 5
src/views/salesManagement/salesQueryNew/detail.vue

@@ -143,6 +143,7 @@
         <div>
           <detailProductList
             ref="productList"
+            :maxHeight="pageHeight"
             :detailData="detailData"
             :warehouseSn="warehouseSn"
             :promoFlag="promoFlag"
@@ -158,6 +159,7 @@
         :bordered="false"
         title="活动产品"
         class="salesEdit-cont"
+        v-if="activeList.length"
       >
         <activeStatisticsList
           ref="activeTjList"
@@ -355,7 +357,7 @@ export default {
     },
     // 表格高度计算
     pageHeight () {
-      return window.innerHeight - 305 + (this.hideFooter ? 45 : 0)
+      return window.innerHeight - 315 + (this.hideFooter ? 45 : 0)
     }
   },
   methods: {
@@ -458,7 +460,7 @@ export default {
     // 查询数据
     searchTable () {
       this.$refs.productList.searchTable()
-      this.$refs.productActiveList.searchTable()
+      if (this.activeList.length) this.$refs.productActiveList.searchTable()
     },
     // 详情
     getDetail () {
@@ -477,9 +479,11 @@ export default {
       this.activeList = list.filter(item => item.promotion && item.promotionRule)
       // 触发活动统计查询变量
       this.$nextTick(() => {
-        this.$refs.activeTjList.hasInit = false
-        // 刷新活动统计
-        this.$refs.activeTjList.getDataList()
+        if (this.activeList.length) {
+          this.$refs.activeTjList.hasInit = false
+          // 刷新活动统计
+          this.$refs.activeTjList.getDataList()
+        }
       })
       setTimeout(() => {
         this.resetSearchForm()