fix(api): update-stocktake-quantity 按 session_id 隔离更新,防止跨会话误改

后端 update_stocktake_quantity 原只按 stock_id+source_table 查草稿,
不同盘点会话会相互覆盖实盘数。后端增加 session_id 过滤,
前端 handleQuantityChange 配套传入当前会话ID,API 类型同步补全。
This commit is contained in:
yueli
2026-08-31 16:00:20 +08:00
parent eb017d881c
commit 893e7250db
3 changed files with 12 additions and 7 deletions

View File

@ -107,7 +107,7 @@ export function getAllStocktakeItems(params?: { keyword?: string; session_id?: s
}
// 更新盘点实盘数(手动修改)
export function updateStocktakeQuantity(data: { stock_id: number; source_table: string; quantity: number }) {
export function updateStocktakeQuantity(data: { stock_id: number; source_table: string; quantity: number; session_id?: string }) {
return request({
url: '/v1/inbound/stock/stocktake/update-quantity',
method: 'post',

View File

@ -1102,7 +1102,8 @@ const handleQuantityChange = async (row: any, val: number) => {
await updateStocktakeQuantity({
stock_id: row.stock_id,
source_table: row.source_table,
quantity: val
quantity: val,
session_id: currentSessionId.value // ★ 传入会话ID后端按会话隔离更新
})
ElMessage.success('实盘数已更新')
} catch (e) {