fix(outbound): fix row-key collision causing UI select-all bug and false duplicate warnings in stock selection

This commit is contained in:
DXC
2026-04-02 17:48:06 +08:00
parent b614a7c8f5
commit d0cac14a33
2 changed files with 5 additions and 1 deletions

Binary file not shown.

View File

@ -452,7 +452,11 @@ const loadStockList = async () => {
pageSize: stockPageSize.value, pageSize: stockPageSize.value,
keyword: searchKeyword.value.trim() keyword: searchKeyword.value.trim()
}) })
stockList.value = res.data?.list || [] // 为每个item添加uniqueKey确保row-key唯一
stockList.value = (res.data?.list || []).map((item: any) => ({
...item,
uniqueKey: `${item.type}_${item.id}`
}))
stockTotal.value = res.data?.total || 0 stockTotal.value = res.data?.total || 0
} catch (e) { } catch (e) {
ElMessage.error('加载库存列表失败') ElMessage.error('加载库存列表失败')