From 1e9fa82cb2fe2c15f46bd1dd73f5c878c74b83b8 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期四, 04 八月 2022 15:35:50 +0800
Subject: [PATCH] 1.系统多账号登录问题2.采购订单页面样式修改及数据渲染

---
 src/views/wlgl/kwdy.vue |   59 ++++++++++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 42 insertions(+), 17 deletions(-)

diff --git a/src/views/wlgl/kwdy.vue b/src/views/wlgl/kwdy.vue
index 61d9696..243167b 100644
--- a/src/views/wlgl/kwdy.vue
+++ b/src/views/wlgl/kwdy.vue
@@ -23,7 +23,13 @@
               <el-input v-model="form.createuser" style="width: 200px" placeholder="璇疯緭鍏�" />
             </el-form-item>
             <el-form-item label="鎵�灞炰粨搴�" style=" display: flex;">
-              <el-select v-model="form.stockcode" :popper-append-to-body="false" style="width: 200px" placeholder="璇烽�夋嫨">
+              <el-select
+                v-model="form.stockcode"
+                :popper-append-to-body="false"
+                style="width: 200px"
+                placeholder="璇烽�夋嫨"
+              >
+                <!--                @focus="getWareHouseSelect"-->
                 <el-option
                   v-for="item in stockArr"
                   :key="item.code"
@@ -42,7 +48,7 @@
       <el-divider />
       <div style="margin-left: 10px;display: flex">
         <el-button type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">鏂板</el-button>
-        <el-button type="primary" icon="el-icon-upload2" @click="upload">瀵煎叆</el-button>
+        <!--        <el-button type="primary" icon="el-icon-upload2" @click="upload">瀵煎叆</el-button>-->
       </div>
       <el-divider />
       <div class="elTableDiv">
@@ -50,7 +56,7 @@
           :data="tableData"
           border
           stripe
-          :height="tableHeight"
+          :height="tableHeight+'px'"
           :style="{width: 100+'%',height:tableHeight+'px',}"
           highlight-current-row
           :header-cell-style="this.$headerCellStyle"
@@ -95,13 +101,14 @@
             prop="lm_date"
             label="鍒涘缓鏃堕棿"
             sortable="custom"
+            width="160"
           />
           <el-table-column
             label="鎿嶄綔"
           >
             <template slot-scope="{row}">
               <div class="operationClass">
-                <el-button type="text" @click="edit('edit',row)">淇敼</el-button>
+                <el-button type="text" @click="edit('edit',row)">缂栬緫</el-button>
                 <el-button type="text" @click="del(row)">鍒犻櫎</el-button>
               </div>
             </template>
@@ -122,9 +129,9 @@
     </div>
 
     <el-dialog
-      :title="operation==='add'?'鏂板':'淇敼'"
+      :title="operation==='add'?'鏂板':'缂栬緫'"
       :visible.sync="dialogVisible"
-      width="50%"
+      width="800px"
       :close-on-click-modal="false"
       top="15vh"
       @closed="handleClose"
@@ -132,18 +139,20 @@
     >
       <el-form ref="dialogForm" inline :rules="dialogFormRules" :model="dialogForm" label-width="80px">
         <el-form-item label="搴撲綅缂栫爜" prop="storagecode">
-          <el-input v-model="dialogForm.storagecode" :disabled="operation!=='add'" style="width: 220px" />
+          <el-input v-model="dialogForm.storagecode" :disabled="operation!=='add'" style="width: 200px" />
         </el-form-item>
         <el-form-item label="搴撲綅鍚嶇О" prop="storagename">
-          <el-input v-model="dialogForm.storagename" style="width: 220px" />
+          <el-input v-model="dialogForm.storagename" style="width: 200px" />
         </el-form-item>
         <el-form-item label="鎵�灞炲簱浣�" prop="stockcode">
           <el-select
             v-model="dialogForm.stockcode"
+            filterable
             :popper-append-to-body="false"
-            style="width: 220px"
+            style="width: 200px"
             placeholder="璇烽�夋嫨"
           >
+            <!--            @focus="getWareHouseSelect2"-->
             <el-option
               v-for="item in stockArr"
               :key="item.code"
@@ -153,7 +162,7 @@
           </el-select>
         </el-form-item>
         <el-form-item label="搴撲綅鎻忚堪">
-          <el-input v-model="dialogForm.description" type="textarea" style="width: 220px" />
+          <el-input v-model="dialogForm.description" type="textarea" style="width: 200px" />
         </el-form-item>
       </el-form>
       <span slot="footer" class="dialog-footer">
@@ -163,16 +172,17 @@
         </div>
       </span>
     </el-dialog>
+
   </div>
 </template>
 
 <script>
 import Pagination from '@/components/Pagination'
-import { AddUpdateStorageDef, DeleteStorageDef, StorageDefSearch, WareHouseDefSearch, WareHouseSelect } from '@/api/wlgl'
+import { AddUpdateStorageDef, DeleteStorageDef, StorageDefSearch, WareHouseSelect } from '@/api/wlgl'
 
 const SER_HZ = /^[\u4e00-\u9fa5]+$/
 export default {
-  name: 'Zzjg',
+  name: 'KWDY',
   components: {
     Pagination
   },
@@ -204,6 +214,7 @@
       },
       total: 10,
       stockArr: [], // 鎵�灞炰粨搴撴暟缁�
+      // stockArr2: [], // 鎵�灞炰粨搴撴暟缁勫璇濇
       tableData: [],
       dialogVisible: false,
       dialogForm: {
@@ -230,23 +241,36 @@
     }
   },
   created() {
-    this.getStorageDefSearch()
-    this.getWareHouseSelect()
+    this.handleRequest()
   },
   mounted() {
     window.addEventListener('resize', this.getHeight)
     this.getHeight()
   },
   methods: {
+    handleRequest() {
+      this.getStorageDefSearch().then(res => {
+        if (res.code === '200') {
+          this.getWareHouseSelect()
+        }
+      })
+    },
+
     async getStorageDefSearch() {
       const res = await StorageDefSearch(this.form)
       this.tableData = res.data
       this.total = res.count
+      return { code: res.code }
     },
     async getWareHouseSelect() {
       const { data: res } = await WareHouseSelect()
       this.stockArr = res
     },
+    // 瀵硅瘽妗嗕腑鐨�
+    // async getWareHouseSelect2() {
+    //   const { data: res } = await WareHouseSelect()
+    //   this.stockArr2 = res
+    // },
     // 鎺掑簭鏀瑰彉鏃�
     sortChange({ column, prop, order }) {
       if (order === 'descending') {
@@ -263,9 +287,6 @@
     // 鏌ヨ
     search() {
       this.getStorageDefSearch()
-    },
-    upload() {
-
     },
     // 閲嶇疆
     reset() {
@@ -352,8 +373,12 @@
       this.$nextTick(() => {
         this.mainHeight = window.innerHeight - 250
         this.tableHeight = this.mainHeight - 100
+        if (window.innerHeight < 800) {
+          this.tableHeight = this.tableHeight - 50
+        }
       })
     }
+
   }
 }
 </script>

--
Gitblit v1.9.3