fix(stocktake): strictly isolate stocktake drafts by session_id in list and finish generation to prevent historical data mixing

This commit is contained in:
DXC
2026-04-03 09:25:52 +08:00
parent 6aec571775
commit 43e1d0aa55
2 changed files with 18 additions and 5 deletions

View File

@ -986,11 +986,14 @@ const fetchInventoryList = async (silent = false) => {
params: {
page: 1,
limit: 500, // ★ 限制单次加载数量,防止内存溢出
keyword: listKeyword.value
keyword: listKeyword.value,
session_id: currentSessionId.value // ★ 必须传递 session_id 隔离会话
}
})
const scannedDrafts = res?.items || []
// ★ 使用返回的 total 获取真实已盘数量,而不是受限的数组长度
const totalScanned = res?.total || scannedDrafts.length
// 保存全量草稿记录用于全局统计
allScannedDrafts.value = scannedDrafts
@ -1133,7 +1136,10 @@ const handleGenerateMissing = async () => {
btnLoading.value = true
const res = await request({
url: '/v1/inbound/stock/stocktake/generate-missing',
method: 'post'
method: 'post',
data: {
session_id: currentSessionId.value // ★ 必须传递 session_id 隔离会话
}
})
if (res.code === 200) {