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-inspect-order-plan.vue | 65 +++++++++++++++++++++++++++++--- 1 files changed, 59 insertions(+), 6 deletions(-) diff --git a/src/components/view/b1-inspect-order-plan.vue b/src/components/view/b1-inspect-order-plan.vue index 644055e..0a3f2cf 100644 --- a/src/components/view/b1-inspect-order-plan.vue +++ b/src/components/view/b1-inspect-order-plan.vue @@ -379,12 +379,16 @@ </el-table-column> </el-table> </el-dialog> - <el-dialog title="鎵爜妫�楠�" :visible.sync="qrCodeVisible" width="350px"> + <el-dialog title="鎵爜妫�楠�" :visible.sync="qrCodeVisible" width="400px"> <el-row> <el-col class="search_thing" :span="24"> <div class="search_label" style="width: 90px"><span class="required-span">* </span>鏍峰搧缂栧彿锛�</div> <div class="search_input"> - <el-input v-model="sampleCode" size="small" clearable></el-input> + <el-input v-model="sampleCode" size="small" 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> @@ -407,12 +411,16 @@ <el-button type="primary" @click="confirmStorage" :loading="upLoadStorage">纭� 瀹�</el-button> </span> </el-dialog> - <el-dialog title="鍑哄簱" :visible.sync="exportVisible" width="350px"> + <el-dialog title="鍑哄簱" :visible.sync="exportVisible" width="400px"> <el-row> <el-col class="search_thing" :span="24"> <div class="search_label" style="width: 90px"><span class="required-span">* </span>鏍峰搧缂栧彿锛�</div> <div class="search_input"> - <el-input v-model="sampleCode" size="small" clearable></el-input> + <el-input v-model="sampleCode" size="small" 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> @@ -421,6 +429,7 @@ <el-button type="primary" @click="confirmExport" :loading="upLoadExport">纭� 瀹�</el-button> </span> </el-dialog> + <input id="ScanCodeInfo" v-model="codeInfo" @keyup.enter="keyup" style="opacity: 0;height: 0px;margin: 0px;padding: 0px;position: absolute;top: 0;"></input> </div> </template> @@ -677,9 +686,54 @@ userInfo:{ name:[], ids:[] - } + }, + sampleCodeBtnDisabled:true, } }, + watch:{ + qrCodeVisible(newVal){ + if(newVal){ + // this.$message.success('鎵爜锛氭墦寮�') + this.sampleCode = null + let input = document.getElementById('ScanCodeInfo'); + input.focus(); + this.startTime = setInterval(()=>{ + input.focus() + },1000) + }else{ + // this.$message.warning('鎵爜锛氬叧闂�') + clearInterval(this.startTime) + this.sampleCodeBtnDisabled=true + } + }, + exportVisible(newVal){ + if(newVal){ + // this.$message.success('鎵爜锛氭墦寮�') + this.sampleCode = null + let input = document.getElementById('ScanCodeInfo'); + input.focus(); + this.startTime = setInterval(()=>{ + input.focus() + },1000) + }else{ + // this.$message.warning('鎵爜锛氬叧闂�') + clearInterval(this.startTime) + this.sampleCodeBtnDisabled=true + } + }, + sampleCodeBtnDisabled(val){ + if(!val){ + this.startTime&&clearInterval(this.startTime) + }else if(this.exportVisible||this.qrCodeVisible){ + this.sampleCode = null + let input = document.getElementById('ScanCodeInfo'); + input.focus(); + this.startTime = setInterval(()=>{ + input.focus() + },1000) + } + } + }, created() { this.getLaboratoryDicts() this.getTypeDicts() @@ -790,7 +844,6 @@ keyup(e){ var code = '' try{ - // console.log(2222,this.codeInfo) code = this.codeInfo.substring() if(code==null||code==undefined||code==''){ this.$message.error('璇ヤ簩缁寸爜鏈夎') -- Gitblit v1.9.3