From d33eacc1f85ac3a736b33ba4713a19aae466d711 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期五, 05 八月 2022 16:42:53 +0800
Subject: [PATCH] 1.做适应平板显示的内容大小

---
 src/views/zzmx/chda.vue |   36 +++++++++++++++++++++++-------------
 1 files changed, 23 insertions(+), 13 deletions(-)

diff --git a/src/views/zzmx/chda.vue b/src/views/zzmx/chda.vue
index 17aedb5..ce61cde 100644
--- a/src/views/zzmx/chda.vue
+++ b/src/views/zzmx/chda.vue
@@ -204,6 +204,7 @@
           <el-table-column
             label="鎿嶄綔"
             fixed="right"
+            width="120"
           >
             <template slot-scope="{row}">
               <div class="operationClass">
@@ -463,7 +464,7 @@
       :visible.sync="dialogVisibleRoute"
       width="800px"
       top="15vh"
-      :fullscreen="isFullscreen"
+      :fullscreen="isIpad"
       class="dialogVisibleRoute"
       @closed="handleCloseRoute"
       @close="handleCloseRoute"
@@ -520,11 +521,11 @@
       <div style="margin-bottom: 10px">
         <i class="el-icon-s-operation" style="color:#42b983;" /> 宸ュ簭鍒楄〃
       </div>
-      <div style="height: 400px;overflow-y: scroll">
+      <div style="overflow-y: scroll">
         <el-table
           :data="projectTableData"
           border
-          height="300"
+          height="280"
           highlight-current-row
           :header-cell-style="this.$headerCellStyle"
           :cell-style="this.$cellStyle"
@@ -598,7 +599,7 @@
       }
     }
     return {
-      isFullscreen: false,
+      isIpad: false,
       mainHeight: 0,
       tableHeight: 0,
       form: {
@@ -643,9 +644,9 @@
         materialname: [
           { required: true, message: '璇疯緭鍏ョ墿鏂欏悕绉�', trigger: ['blur', 'change'] }
         ],
-        materialspec: [
-          { required: true, message: '璇疯緭鍏ョ墿鏂欒鏍�', trigger: ['blur', 'change'] }
-        ],
+        // materialspec: [//鐗╂枡瑙勬牸鏆傛椂鏀逛负闈炲繀濉�
+        //   { required: true, message: '璇疯緭鍏ョ墿鏂欒鏍�', trigger: ['blur', 'change'] }
+        // ],
         uomcode: [
           { required: true, message: '璇烽�夋嫨浣跨敤鍗曚綅', trigger: ['blur', 'change'] }
         ],
@@ -693,15 +694,22 @@
     }
   },
   created() {
-    this.getInventoryFileSelect()
-    this.getStockTypeSelect()
-    this.getWareHouseSelect()
+    this.handleRequest()
   },
   mounted() {
     window.addEventListener('resize', this.getHeight)
     this.getHeight()
   },
   methods: {
+    handleRequest() {
+      this.getInventoryFileSelect().then(res => {
+        if (res.code === '200') {
+          this.getStockTypeSelect()
+          this.getWareHouseSelect()
+        }
+      })
+    },
+
     // 鍚屾璁¢噺鍗曚綅
     async syncSeaveSearchUnit() {
       const loading = this.$loading({
@@ -777,6 +785,7 @@
       const res = await InventoryFileSelect(this.form)
       this.tableData = res.data
       this.total = res.count
+      return { code: res.code }
     },
     async getStockTypeSelect() {
       const { data: res } = await StockTypeSelect()
@@ -857,6 +866,7 @@
         this.dialogForm.minstockqty = row.maxqty
         this.dialogForm.maxstockqty = row.minqty
       })
+      await this.getuomSelect()
     },
     // 鍒犻櫎鎸夐挳
     async del(row) {
@@ -929,11 +939,11 @@
     getHeight() {
       this.$nextTick(() => {
         this.mainHeight = window.innerHeight - 250
-        this.tableHeight = this.mainHeight - 100
-        // this.isFullscreen = window.innerHeight < 800
-        if (window.innerHeight < 800) {
+        this.tableHeight = this.mainHeight - 50
+        if (window.innerHeight < 769) {
           this.tableHeight = this.tableHeight - 50
         }
+        this.isIpad = window.innerHeight < 769 && window.innerWidth < 1367
       })
     },
     /* 鐐瑰嚮鍏宠仈宸ヨ壓璺嚎妯″潡*/

--
Gitblit v1.9.3