|
|
@@ -78,16 +78,18 @@ const warehouse = store.warehouse
|
|
|
const active=ref('1')
|
|
|
// 扫描条码监听
|
|
|
const _handlerScan = (code) => {
|
|
|
+ if(!code) return
|
|
|
if (scanType.value == 1) {
|
|
|
- if(barcodeToUpperCase(code).includes('HK')){
|
|
|
+ const regex = /^HK\d{6}$/;
|
|
|
+ if(regex.test(barcodeToUpperCase(code))){
|
|
|
scanBox.value = barcodeToUpperCase(code)
|
|
|
scanType.value=2
|
|
|
tips.value='请扫描工作站台'
|
|
|
}else {
|
|
|
- scanBox.value=''
|
|
|
- tips.value='请扫描海康料箱'
|
|
|
+ tips.value=`${code}:料箱条码不匹配`
|
|
|
scanError()
|
|
|
- showNotify({ type: 'danger', duration: 3000, message:'请扫描海康料箱' })
|
|
|
+ showNotify({ type: 'danger', duration: 3000, message:`${code}:料箱条码不匹配` })
|
|
|
+ scanBox.value=''
|
|
|
}
|
|
|
}else if(scanType.value == 2){
|
|
|
if(code){
|