From 830498273ee74b031faa6029ebaa5f1cda204c87 Mon Sep 17 00:00:00 2001 From: licp <lichunping@guanfang.com.cn> Date: 星期三, 23 十月 2024 15:58:11 +0800 Subject: [PATCH] 同上 --- src/components/view/b1-sample.vue | 40 ++++++++++++++++++++++++---------------- 1 files changed, 24 insertions(+), 16 deletions(-) diff --git a/src/components/view/b1-sample.vue b/src/components/view/b1-sample.vue index 1f7589a..c7a18b0 100644 --- a/src/components/view/b1-sample.vue +++ b/src/components/view/b1-sample.vue @@ -195,7 +195,7 @@ <div class="search_thing"> <div class="search_label">鏍峰搧缂栧彿锛�</div> <div class="search_input"> - <el-input placeholder="璇疯緭鍏ユ牱鍝佺紪鍙�" v-model="searchSampleCode" size="small"> + <el-input placeholder="璇疯緭鍏ユ牱鍝佺紪鍙�" v-model="searchSampleCode" size="small" autocomplete="off" ref="organization" readonly="readonly" @focus="remove('organization')" @blur="setType('organization')"> <el-button slot="append" icon="el-icon-search" @click="handleSearch"></el-button> </el-input> </div> @@ -255,7 +255,7 @@ <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"></el-input> + <el-input v-model="sampleCode" size="small" @change="sampleCodeChange"></el-input> </div> </el-col> </el-row> @@ -287,7 +287,7 @@ <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"></el-input> + <el-input v-model="sampleCode" size="small" @change="sampleCodeChange" clearable></el-input> </div> </el-col> </el-row> @@ -408,7 +408,7 @@ tableLoading:false, sampleCode:'', currentId:null, - searchSampleCode:'', + searchSampleCode:null, codeInfo:null, } }, @@ -439,6 +439,11 @@ clearInterval(this.startTime) } }, + isEdit(newVal){ + if(!newVal){ + this.shelves = {} + } + } }, mounted() { this.selectList() @@ -446,23 +451,15 @@ methods: { keyup(e){ var code = '' - var str = {} - var that = this; - console.log(3333,this.codeInfo) try{ - code = JSON.parse(this.codeInfo) - if(code.moNo2==null||code.moNo2==undefined||code.moNo2==''){ + code = this.codeInfo.substring() + if(code==null||code==undefined||code==''){ this.$message.error('璇ヤ簩缁寸爜鏈夎') }else{ - str = { - moNo2: code.moNo2, - } - // if(this.storageVisible){ - // }else if(this.exportVisible){} - this.sampleCode = code.moNo2 + this.sampleCode = code } }catch(e){ - this.$message.error('璇ヤ簩缁寸爜鏈夎') + this.$message.error('璇疯皟鑷宠嫳鏂囬敭鐩�') } this.codeInfo = null }, @@ -805,6 +802,17 @@ this.isDetail = true; } }) + }, + sampleCodeChange(e){ + if(e){ + this.sampleCode = e.replaceAll('"','') + } + }, + remove(type){ + this.$refs[type].$el.querySelector('input').removeAttribute('readonly') + }, + setType(type){ + this.$refs[type].$el.querySelector('input').setAttribute('readonly', 'true') } } } -- Gitblit v1.9.3