优化
This commit is contained in:
@@ -762,7 +762,7 @@ const handleNext = async () => {
|
|||||||
Message.error('请先扫描物料编码')
|
Message.error('请先扫描物料编码')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// 调用后端接口获取比对结果
|
// 调用后端接口获取比对结果
|
||||||
vmSend(materialCode).then((res) => {
|
vmSend(materialCode).then((res) => {
|
||||||
if (res.code === '0') {
|
if (res.code === '0') {
|
||||||
@@ -782,17 +782,12 @@ const handleNext = async () => {
|
|||||||
Message.error('比对失败,请重试')
|
Message.error('比对失败,请重试')
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
activeStep.value++
|
activeStep.value++
|
||||||
// 进入称重页面时建立WebSocket连接
|
// 进入称重页面时建立WebSocket连接
|
||||||
if (activeStep.value === 2) {
|
if (activeStep.value === 2) {
|
||||||
establishWebSocket()
|
establishWebSocket()
|
||||||
// 离开扫码核验页面时,清除图片刷新定时器
|
}
|
||||||
if (imageRefreshTimer) {
|
}
|
||||||
clearInterval(imageRefreshTimer)
|
|
||||||
imageRefreshTimer = null
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -806,10 +801,6 @@ const handlePrevious = () => {
|
|||||||
if (activeStep.value !== 2) {
|
if (activeStep.value !== 2) {
|
||||||
closeWebSocket()
|
closeWebSocket()
|
||||||
}
|
}
|
||||||
// 进入扫码核验页面时,启动图片自动刷新
|
|
||||||
if (activeStep.value === 1) {
|
|
||||||
startImageRefresh()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1054,10 +1045,10 @@ const closeWebSocket = () => {
|
|||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
closeWebSocket()
|
closeWebSocket()
|
||||||
// 清除图片刷新定时器
|
// 清除图片刷新定时器
|
||||||
if (imageRefreshTimer) {
|
// if (imageRefreshTimer) {
|
||||||
clearInterval(imageRefreshTimer)
|
// clearInterval(imageRefreshTimer)
|
||||||
imageRefreshTimer = null
|
// imageRefreshTimer = null
|
||||||
}
|
// }
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user