feat(outbound): 库存列表按规格+库位聚合 + BOM明细类型修复

This commit is contained in:
DXC
2026-04-28 09:23:59 +08:00
parent 40e405becd
commit e08eaff40a
3 changed files with 39 additions and 9 deletions

View File

@ -511,7 +511,8 @@ const loadStockList = async () => {
const res: any = await getStockList({
page: stockPage.value,
pageSize: stockPageSize.value,
keyword: searchKeyword.value.trim()
keyword: searchKeyword.value.trim(),
is_aggregated: true // ★ 触发后端按规格+库位合并
})
// 为每个item添加uniqueKey和确保warehouse_location字段正确映射
stockList.value = (res.data?.list || []).map((item: any) => ({
@ -649,7 +650,7 @@ watch(selectedBomNo, async (newBomNo) => {
return
}
try {
const detailRes = await getBomDetail(newBomNo)
const detailRes: any = await getBomDetail(newBomNo)
currentBomDetail.value = detailRes.data?.children || []
} catch (e) {
ElMessage.error('加载 BOM 明细失败')
@ -666,7 +667,7 @@ const confirmBomAdd = async () => {
if (currentBomDetail.value.length === 0) {
try {
const detailRes = await getBomDetail(selectedBomNo.value)
const detailRes: any = await getBomDetail(selectedBomNo.value)
currentBomDetail.value = detailRes.data?.children || []
} catch (e) {
ElMessage.error('获取 BOM 详情失败')