fix(stocktake): strictly isolate stocktake drafts by session_id in list and finish generation to prevent historical data mixing
This commit is contained in:
@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user