Browse Source

增加采购订单维护详情子表高度

002390 1 year ago
parent
commit
74eeb3e8d1

+ 11 - 2
src/views/purchase/purchase-order/add/index.vue

@@ -69,7 +69,16 @@ export default {
         
       },
       set(){}
-    }
+    },
+    tabHeight:{
+      get(){
+        return `${this.params['puOrderItemList'].length ? 
+                  (this.params['puOrderItemList'].length > 8 ? 500 :
+                   (this.params['puOrderItemList'].length *60) +100)
+                : 120}px`
+      },
+      set(){}
+    },
   },
   watch: {
     "params.puOrderItemList": {
@@ -909,7 +918,7 @@ export default {
               :row-key="column.key === 'puOrderItemList' ? 'rowNo' :'rowno'" 
               :data="tableData" 
               style="width: 100%"
-              height="calc(100vh - 440px)"
+              :height="tabHeight"
               border
             >
               <template slot="empty">

+ 12 - 2
src/views/purchase/purchase-order/edit/index.vue

@@ -42,7 +42,17 @@ export default {
         
       },
       set(){}
-    }
+    },
+    tabHeight:{
+      get(){
+        let length = this.params['puOrderItemList'].filter(item => item.delFlag === '0').length;
+        return `${length ? 
+                  (length > 8 ? 500 :
+                   (length *60) +100)
+                : 120}px`
+      },
+      set(){}
+    },
   },
   watch: {
     "params.contractType": function (newProp) {
@@ -884,7 +894,7 @@ export default {
               border
               :data="tableData" 
               style="width: 100%"
-              height="calc(100vh - 440px)"
+              :height="tabHeight"
             >
               <el-table-column label="序号">
                 <template slot-scope="scope">

+ 13 - 2
src/views/purchase/purchase-order/see/index.vue

@@ -53,7 +53,18 @@ export default {
       tableData:[],  //虚拟滚动加载显示的数据
     };
   },
-  computed: {},
+  computed: {
+    tabHeight:{
+      get(){
+        let length = this.params['puOrderItemList'].filter(item => item.delFlag === '0').length;
+        return `${length ? 
+                  (length > 8 ? 500 :
+                   (length *60) +100)
+                : 120}px`
+      },
+      set(){}
+    },
+  },
   watch: {},
   methods: {
     
@@ -343,7 +354,7 @@ export default {
             <el-table 
               :data="tableData" 
               style="width: 100%"  
-              height="calc(100vh - 440px)"
+              :height="tabHeight"
               border
             >
               <el-table-column label="序号">