Commit c018e910 by wusiyi

fix: 修复配货打单/配货分拣多次弹框导致卡死问题 #1001798

parent f8ba634d
...@@ -668,6 +668,7 @@ watch( ...@@ -668,6 +668,7 @@ watch(
const podBoxIndex = computed(() => orderStore.podBoxIndex) const podBoxIndex = computed(() => orderStore.podBoxIndex)
let renderLock = false let renderLock = false
let pickFinishedAlertToken = 0
const renderItemBox = (bool: boolean) => { const renderItemBox = (bool: boolean) => {
if ( if (
...@@ -1178,6 +1179,10 @@ const initOrderDetailBox = async (type: 'scan' | 'manual' = 'manual') => { ...@@ -1178,6 +1179,10 @@ const initOrderDetailBox = async (type: 'scan' | 'manual' = 'manual') => {
// 切换箱子至验货完成的箱子 // 切换箱子至验货完成的箱子
boxChange.value = true boxChange.value = true
boxIndex.value = boxs[0] as number boxIndex.value = boxs[0] as number
const token = ++pickFinishedAlertToken
if (token > 1) {
ElMessageBox.close()
}
try { try {
await ElMessageBox.alert( await ElMessageBox.alert(
`检测到${boxs.join(',')}号箱验货完成,请及时处理`, `检测到${boxs.join(',')}号箱验货完成,请及时处理`,
...@@ -1186,8 +1191,10 @@ const initOrderDetailBox = async (type: 'scan' | 'manual' = 'manual') => { ...@@ -1186,8 +1191,10 @@ const initOrderDetailBox = async (type: 'scan' | 'manual' = 'manual') => {
confirmButtonText: '确定', confirmButtonText: '确定',
}, },
) )
if (token !== pickFinishedAlertToken) return
productionOrderRef.value.focus() productionOrderRef.value.focus()
} catch (error) { } catch (error) {
if (token !== pickFinishedAlertToken) return
productionOrderRef.value.focus() productionOrderRef.value.focus()
console.error(error) console.error(error)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment