From ba1b15ac2556a322d1cea9bdd108255e0ff32048 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期二, 03 十二月 2024 13:43:44 +0800
Subject: [PATCH] 优化入库出库功能

---
 src/components/view/b1-sample.vue |   27 +++++++++++++++++++++++++--
 1 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/src/components/view/b1-sample.vue b/src/components/view/b1-sample.vue
index b2f0a0d..0bc487e 100644
--- a/src/components/view/b1-sample.vue
+++ b/src/components/view/b1-sample.vue
@@ -255,7 +255,11 @@
         <el-col class="search_thing" :span="24">
           <div class="search_label"><span class="required-span">* </span>鏍峰搧缂栧彿锛�</div>
           <div class="search_input">
-            <el-input v-model="sampleCode" size="small" @change="sampleCodeChange"></el-input>
+            <el-input v-model="sampleCode" size="small" @change="sampleCodeChange" :disabled="sampleCodeBtnDisabled">
+              <el-tooltip :content="sampleCodeBtnDisabled?'鎵嬪姩杈撳叆':'鎵爜鏋緭鍏�'" placement="top" slot="append">
+                <el-button type="primary" icon="el-icon-edit" @click="sampleCodeBtnDisabled=!sampleCodeBtnDisabled"></el-button>
+              </el-tooltip>
+            </el-input>
           </div>
         </el-col>
       </el-row>
@@ -287,7 +291,11 @@
         <el-col class="search_thing" :span="24">
           <div class="search_label"><span class="required-span">* </span>鏍峰搧缂栧彿锛�</div>
           <div class="search_input">
-            <el-input v-model="sampleCode" size="small" @change="sampleCodeChange" clearable></el-input>
+            <el-input v-model="sampleCode" size="small" @change="sampleCodeChange" clearable :disabled="sampleCodeBtnDisabled">
+              <el-tooltip :content="sampleCodeBtnDisabled?'鎵嬪姩杈撳叆':'鎵爜鏋緭鍏�'" placement="top" slot="append">
+                <el-button type="primary" icon="el-icon-edit" @click="sampleCodeBtnDisabled=!sampleCodeBtnDisabled"></el-button>
+              </el-tooltip>
+            </el-input>
           </div>
         </el-col>
       </el-row>
@@ -382,6 +390,7 @@
           warehouseId: null,
           shelfId: null
         },
+        sampleCodeBtnDisabled:true,
         warehouse: [],
         startTime: null,
         shelf: [],
@@ -425,6 +434,7 @@
         }else{
             // this.$message.warning('鎵爜锛氬叧闂�')
             clearInterval(this.startTime)
+            this.sampleCodeBtnDisabled=true
         }
       },
       exportVisible(newVal){
@@ -439,6 +449,19 @@
         }else{
             // this.$message.warning('鎵爜锛氬叧闂�')
             clearInterval(this.startTime)
+            this.sampleCodeBtnDisabled=true
+        }
+      },
+      sampleCodeBtnDisabled(val){
+        if(!val){
+          this.startTime&&clearInterval(this.startTime)
+        }else if(this.exportVisible||this.storageVisible){
+          this.sampleCode = null
+          let input = document.getElementById('ScanCodeInfo');
+          input.focus();
+          this.startTime = setInterval(()=>{
+              input.focus()
+          },1000)
         }
       },
       isEdit(newVal){

--
Gitblit v1.9.3