Browse Source

报表分析-总账统计页面

lichao 4 years ago
parent
commit
3f7d5a1972
1 changed files with 12 additions and 1 deletions
  1. 12 1
      src/views/reportManagement/outExcel/index.vue

+ 12 - 1
src/views/reportManagement/outExcel/index.vue

@@ -87,7 +87,7 @@
       </span>
     </el-dialog>
 
-    <el-table v-loading="loading" :data="stockDate">
+    <el-table v-loading="loading" :data="stockDate" ref="table" :height="tableHeight">
       <el-table-column type="index" label="序号" align="center" />
       <el-table-column
         v-for="(item, index) in getRowList"
@@ -122,6 +122,7 @@ export default {
   components: {},
   data() {
     return {
+      tableHeight: '0',
       // 遮罩层
       loading: true,
       queryParams: {
@@ -223,6 +224,16 @@ export default {
     this.getList();
     this.getRow();
   },
+  mounted() {
+    this.$nextTick(() => {
+      // 根据浏览器高度设置初始高度
+      this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 160
+      // 监听浏览器高度变化,改变表格高度
+      window.onresize = () => {
+        this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 70
+      }
+    })
+  },
   methods: {
     //列设置全选
     allChecked() {