From a65112ecf7580c7d5a2ae60d05150cac34e59f5d Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期一, 26 九月 2022 16:30:33 +0800
Subject: [PATCH] 1.工艺路线工艺设置下拉选中之后自动回车2.工序定义检验人员选中默认当前登录人员

---
 src/views/zzmx/chda.vue |  112 ++++++++++++++++++++++++++++++++++++--------------------
 1 files changed, 72 insertions(+), 40 deletions(-)

diff --git a/src/views/zzmx/chda.vue b/src/views/zzmx/chda.vue
index 296eba2..aec95f5 100644
--- a/src/views/zzmx/chda.vue
+++ b/src/views/zzmx/chda.vue
@@ -2,24 +2,27 @@
   <div>
     <div class="body" :style="{height:mainHeight+'px'}">
 
-      <div class="bodyTopButtonGroup">
+      <div class="bodyTopButtonGroup" style="justify-content: space-between;">
+
         <el-button type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">鏂板</el-button>
         <!--        <el-button type="primary" icon="el-icon-office-building" @click="office">鍗曚綅</el-button>-->
-        <el-button
-          icon="el-icon-refresh-right"
-          @click="syncSeaveSearchUnit"
-        >鍚屾璁¢噺鍗曚綅
-        </el-button>
-        <el-button
-          icon="el-icon-refresh-right"
-          @click="syncInventoryFileSelect"
-        >鍚屾瀛樿揣妗f
-        </el-button>
-        <el-button
-          icon="el-icon-refresh-right"
-          @click="syncStockTypeSelect"
-        >鍚屾瀛樿揣绫诲瀷
-        </el-button>
+        <div style="display: flex">
+          <el-button
+            icon="el-icon-refresh-right"
+            @click="syncSeaveSearchUnit"
+          >鍚屾璁¢噺鍗曚綅
+          </el-button>
+          <el-button
+            icon="el-icon-refresh-right"
+            @click="syncInventoryFileSelect"
+          >鍚屾瀛樿揣妗f
+          </el-button>
+          <el-button
+            icon="el-icon-refresh-right"
+            @click="syncStockTypeSelect"
+          >鍚屾瀛樿揣绫诲瀷
+          </el-button>
+        </div>
         <!--        <el-button type="primary" icon="el-icon-upload2" @click="upload">瀵煎叆</el-button>-->
       </div>
 
@@ -93,7 +96,7 @@
               </el-select>
             </el-form-item>
           </div>
-          <div style="display: flex;align-items: start;margin-top: 5px;z-index: 2">
+          <div class="bodySearchReset">
             <el-button type="primary" icon="el-icon-search" @click="search">鏌ヨ</el-button>
             <el-button type="info" icon="el-icon-refresh" @click="reset">閲嶇疆</el-button>
           </div>
@@ -102,6 +105,8 @@
 
       <div class="elTableDiv">
         <el-table
+          ref="tableDataRef"
+          class="tableFixed"
           :data="tableData"
           border
           :height="tableHeight"
@@ -139,7 +144,12 @@
             label="鐗╂枡瑙勬牸"
             width="110"
             sortable="custom"
-          />
+          >
+            <template slot-scope="{row}">
+              <div v-if="row.partspec">{{ row.partspec }}</div>
+              <div v-else>/</div>
+            </template>
+          </el-table-column>
           <el-table-column
             prop="uom_name"
             label="鍗曚綅"
@@ -162,19 +172,34 @@
             label="浠撳簱鍚嶇О"
             sortable="custom"
             min-width="110"
-          />
+          >
+            <template slot-scope="{row}">
+              <div v-if="row.stck_name">{{ row.stck_name }}</div>
+              <div v-else>/</div>
+            </template>
+          </el-table-column>
           <el-table-column
             prop="maxqty"
             label="搴撳瓨涓婇檺"
             width="110"
             sortable="custom"
-          />
+          >
+            <template slot-scope="{row}">
+              <div v-if="row.maxqty">{{ row.maxqty }}</div>
+              <div v-else>/</div>
+            </template>
+          </el-table-column>
           <el-table-column
             prop="minqty"
             label="搴撳瓨涓嬮檺"
             width="110"
             sortable="custom"
-          />
+          >
+            <template slot-scope="{row}">
+              <div v-if="row.minqty">{{ row.minqty }}</div>
+              <div v-else>/</div>
+            </template>
+          </el-table-column>
           <el-table-column
             prop="lm_user"
             label="鍒涘缓浜哄憳"
@@ -219,12 +244,12 @@
       </div>
       <!--鍒嗛〉-->
       <pagination
-        v-show="total>0"
+
         :total="total"
         :page.sync="form.page"
         :limit.sync="form.rows"
         align="right"
-        layout="prev, pager, next,sizes"
+        layout="total,prev, pager, next,sizes"
         popper-class="select_bottom"
         @pagination="getInventoryFileSelect"
       />
@@ -442,12 +467,11 @@
       </el-table>
       <!--鍒嗛〉-->
       <pagination
-        v-show="officeTableDataLength>0"
         :total="officeTableDataLength"
         :page.sync="officeForm.page"
         :limit.sync="officeForm.rows"
         align="right"
-        layout="prev, pager, next,sizes"
+        layout="total,prev, pager, next,sizes"
         popper-class="select_bottom"
         @pagination="getUomSearch"
       />
@@ -508,8 +532,9 @@
         <el-select
           v-model="defaultroute_code"
           filterable
-          style="width: 200px"
+          style="width: 200px;"
           placeholder="璇烽�夋嫨"
+          class="defaultroute_code"
         >
           <el-option
             v-for="item in defaultroute_codeArr"
@@ -585,25 +610,14 @@
 } from '@/api/zzmx'
 import $ from 'jquery'
 import { SeaveSearchInventory, SeaveSearchInventoryClass, SeaveSearchUnit } from '@/api/ErpSyncMes'
+import { validateCode } from '@/utils/global'
 
-const SER_HZ = /^[\u4e00-\u9fa5]+$/
 export default {
   name: 'CHDA',
   components: {
     Pagination
   },
   data() {
-    const validateName = (rule, value, callback) => {
-      if (!value) {
-        return callback(new Error('璇疯緭鍏ョ墿鏂欑紪鐮�'))
-      } else {
-        if (SER_HZ.test(value)) {
-          return callback(new Error('缂栫爜涓嶈兘涓轰腑鏂�'))
-        } else {
-          callback()
-        }
-      }
-    }
     return {
       isIpad: false,
       mainHeight: 0,
@@ -645,7 +659,7 @@
       operation: '',
       dialogFormRules: {
         materialcode: [
-          { required: true, validator: validateName, trigger: ['blur', 'change'] }
+          { required: true, validator: validateCode, trigger: ['blur', 'change'] }
         ],
         materialname: [
           { required: true, message: '璇疯緭鍏ョ墿鏂欏悕绉�', trigger: ['blur', 'change'] }
@@ -884,6 +898,9 @@
         DeleteInventoryFile({ materialcode: row.partcode }).then(res => {
           if (res.code === '200') {
             this.$message.success('鍒犻櫎鎴愬姛!')
+            if (this.form.page > 1 && this.tableData.length === 1) {
+              this.form.page--
+            }
             this.getInventoryFileSelect()
           }
         })
@@ -950,6 +967,7 @@
           this.tableHeight = this.tableHeight - 40
         }
         this.isIpad = window.innerHeight < 769 && window.innerWidth < 1367
+        this.$refs.tableDataRef.doLayout()
       })
     },
     /* 鐐瑰嚮鍏宠仈宸ヨ壓璺嚎妯″潡*/
@@ -1229,6 +1247,13 @@
     }
   }
 }
+
+.defaultroute_code ::v-deep .el-input__suffix-inner{
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  margin-top: -3px;
+}
 </style>
 
 <!--鍏叡椤甸潰鏍峰紡-->
@@ -1319,7 +1344,14 @@
 .userDialogVisible ::v-deep .el-form-item {
   margin-bottom: 0;
 }
-
+.tableFixed{
+  ::v-deep .el-table__fixed-right{
+    height: 100% !important;
+  }
+  ::v-deep .el-table__fixed{
+    height: 100% !important;
+  }
+}
 </style>
 <style>
 

--
Gitblit v1.9.3