| | |
| | | <div style="width: 100%;height: 100%;" v-if="!isDetail"> |
| | | <div> |
| | | <el-row class="title"> |
| | | <el-col :span="12" style="padding-left: 20px;">样品管理</el-col> |
| | | <el-col :span="12" style="padding-left: 20px;text-align: left;">样品管理</el-col> |
| | | <el-col :span="12" style="text-align: right;"> |
| | | <el-button size="small" type="primary" @click="storageVisible=true">入库</el-button> |
| | | <el-button size="small" type="primary" @click="exportVisible=true">出库</el-button> |
| | |
| | | <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"> |
| | | <el-button slot="append" icon="el-icon-search" @click="handleSearch"></el-button> |
| | | </el-input> |
| | | </div> |
| | |
| | | effect="dark" |
| | | placement="top" |
| | | v-for="(n,j) in m.samples" |
| | | :key="j" :disabled="`${n.sample}${n.model}`.length<10"> |
| | | :key="j" :disabled="`${n.sample}${n.model}`.length<5"> |
| | | <div slot="content"><span>{{ n.sample }}</span> |
| | | <span> ({{ n.model }}) [{{ n.sampleCode }}]</span></div> |
| | | <li class="green" |
| | |
| | | <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> |
| | |
| | | <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> |
| | |
| | | <el-button type="primary" @click="confirmShelves" :loading="upLoadShelves">确 定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <input type="password" id="ScanCodeInfo" v-model="codeInfo" @keyup.enter="keyup" style="opacity: 0;height: 0px;margin: 0px;padding: 0px;position: absolute;top: 0;"></input> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | shelfId: null |
| | | }, |
| | | warehouse: [], |
| | | startTime: null, |
| | | shelf: [], |
| | | storageList:[], |
| | | storageVisible: false, |
| | |
| | | tableLoading:false, |
| | | sampleCode:'', |
| | | currentId:null, |
| | | searchSampleCode:'' |
| | | searchSampleCode:'', |
| | | codeInfo:null, |
| | | } |
| | | }, |
| | | watch:{ |
| | | storageVisible(newVal){ |
| | | if(newVal){ |
| | | // this.$message.success('扫码:打开') |
| | | let input = document.getElementById('ScanCodeInfo'); |
| | | input.focus(); |
| | | this.startTime = setInterval(()=>{ |
| | | input.focus() |
| | | },1000) |
| | | }else{ |
| | | // this.$message.warning('扫码:关闭') |
| | | clearInterval(this.startTime) |
| | | } |
| | | }, |
| | | exportVisible(newVal){ |
| | | if(newVal){ |
| | | // this.$message.success('扫码:打开') |
| | | let input = document.getElementById('ScanCodeInfo'); |
| | | input.focus(); |
| | | this.startTime = setInterval(()=>{ |
| | | input.focus() |
| | | },1000) |
| | | }else{ |
| | | // this.$message.warning('扫码:关闭') |
| | | clearInterval(this.startTime) |
| | | } |
| | | }, |
| | | }, |
| | | mounted() { |
| | | this.selectList() |
| | | }, |
| | | methods: { |
| | | keyup(e){ |
| | | var code = '' |
| | | try{ |
| | | code = JSON.parse(this.codeInfo) |
| | | if(code==null||code==undefined||code==''){ |
| | | this.$message.error('该二维码有误') |
| | | }else{ |
| | | this.sampleCode = code |
| | | } |
| | | }catch(e){ |
| | | this.$message.error('该二维码有误') |
| | | } |
| | | this.codeInfo = null |
| | | }, |
| | | selectList() { |
| | | this.$axios.get(this.$api.warehouse.selectWarehouse).then(res => { |
| | | this.warehouse = res.data |
| | |
| | | this.isDetail = true; |
| | | }, |
| | | warehouseChange(val) { |
| | | this.tableList = [] |
| | | let map = this.warehouse.find(a => { |
| | | return a.id === val ? a : null |
| | | }) |
| | |
| | | this.isDetail = true; |
| | | } |
| | | }) |
| | | }, |
| | | sampleCodeChange(e){ |
| | | if(e){ |
| | | this.sampleCode = e.replaceAll('"','') |
| | | } |
| | | } |
| | | } |
| | | } |