扫码问题

This commit is contained in:
2024-03-13 17:01:16 +08:00
parent 406787cc09
commit dd8471def6
5 changed files with 33 additions and 21 deletions

View File

@@ -7,7 +7,6 @@
class="filter-input filter-scan-input search_input"
ref="scaninput"
:placeholder="keyCode === '' ? placeholder : keyCode"
:disabled="disabled"
:value="value"
@focus="handleFocus($event)"
@blur="handleBlur($event)"
@@ -37,10 +36,6 @@ export default {
props: {
value: String,
label: String,
focused: {
type: Boolean,
default: false
},
seaShow: {
type: Boolean,
default: true
@@ -48,10 +43,6 @@ export default {
keyCode: {
type: String,
default: ''
},
disabled: {
type: Boolean,
default: false
}
},
data () {
@@ -61,13 +52,10 @@ export default {
cur: ''
}
},
mounted () {
if (!this.focused) this.handleScan()
},
methods: {
handleScan () {
this.$refs.scaninput.focus()
this.placeholder = '请扫码键输入'
this.placeholder = '请扫码键输入'
this.type = true
this.$emit('input', '')
},
@@ -78,11 +66,11 @@ export default {
// this.$emit('input', this.cur)
},
handleFocus ($event) {
this.cur = $event.target.value
this.placeholder = '请扫码键输入'
this.type = false
// $event.target.value = ''
// this.$emit('input', $event.target.value)
// this.cur = $event.target.value
this.placeholder = '请扫码键输入'
this.type = true
$event.target.value = ''
this.$emit('input', $event.target.value)
},
handleBlur ($event) {
this.type = ''

View File

@@ -4,13 +4,14 @@
<section class="content">
<div class="filter-wraper">
<search-box
ref="myInput1"
label="托盘码"
v-model="val1"
@handleChange="handleChange1"
></search-box>
<search-box
ref="myInput2"
label="物料条码"
:focused="true"
v-model="val2"
@handleChange="handleChange2"
></search-box>
@@ -71,12 +72,16 @@ export default {
disabled: false
}
},
mounted () {
this.$refs.myInput1.handleScan()
},
methods: {
/** 读取托盘码 */
async _RFReadTrayStateInventory (val) {
try {
let res = await RFReadTrayStateInventory(val)
if (res.ErrNO === '1') {
this.$refs.myInput2.handleScan()
this._RFReadTrayStorageInventory()
} else {
this.toast(res.ErrMsg)
@@ -145,6 +150,7 @@ export default {
this.val2 = ''
this.dataList = []
this.disabled = false
this.$refs.myInput1.handleScan()
}
}
}

View File

@@ -4,11 +4,13 @@
<section class="content">
<div class="filter-wraper">
<search-box
ref="myInput1"
label="托盘码"
v-model="val1"
@handleChange="handleChange1"
></search-box>
<search-box
ref="myInput2"
label="物料条码"
:focused="true"
v-model="val2"
@@ -86,13 +88,17 @@ export default {
disabled: false
}
},
mounted () {
this.$refs.myInput1.handleScan()
},
methods: {
/** 读取托盘码 */
async _rfReadTrayStatePackage (val) {
try {
let res = await rfReadTrayStatePackage(val)
if (res.ErrNO === '1') {
this.toast(res.ErrMsg)
// this.toast(res.ErrMsg)
this.$refs.myInput2.handleScan()
this._rfReadTrayStoragePackage()
} else {
this.toast(res.ErrMsg)
@@ -162,6 +168,7 @@ export default {
this.dataList = []
this.active = ''
this.disabled = false
this.$refs.myInput1.handleScan()
},
toggleItem () {
if (!this.open) {

View File

@@ -4,6 +4,7 @@
<section class="content">
<div class="filter-wraper">
<search-box
ref="myInput1"
label="托盘码"
v-model="val1"
@handleChange="handleChange1"
@@ -62,6 +63,9 @@ export default {
disabled: false
}
},
mounted () {
this.$refs.myInput1.handleScan()
},
methods: {
/** 读取托盘码 */
async _rfReadTrayStateUnPackage (val) {
@@ -116,6 +120,7 @@ export default {
this.val1 = ''
this.dataList = []
this.disabled = false
this.$refs.myInput1.handleScan()
}
}
}

View File

@@ -4,13 +4,14 @@
<section class="content">
<div class="filter-wraper">
<search-box
ref="myInput1"
label="托盘码"
v-model="val1"
@handleChange="handleChange1"
></search-box>
<search-box
ref="myInput2"
label="物料条码"
:focused="true"
v-model="val2"
@handleChange="handleChange2"
></search-box>
@@ -71,12 +72,16 @@ export default {
disabled: false
}
},
mounted () {
this.$refs.myInput1.handleScan()
},
methods: {
/** 读取托盘码 */
async _RFReadTrayStatePick (val) {
try {
let res = await RFReadTrayStatePick(val)
if (res.ErrNO === '1') {
this.$refs.myInput2.handleScan()
this._RFReadTrayStoragePick()
} else {
this.toast(res.ErrMsg)
@@ -145,6 +150,7 @@ export default {
this.val2 = ''
this.dataList = []
this.disabled = false
this.$refs.myInput1.handleScan()
}
}
}