Commit e61f0357 by qinjianhui

fix: 未入过库的商品统一填充仓库名称

parent 59460180
......@@ -142,7 +142,7 @@ const filterForm = ref({
warehouseId: undefined as number | undefined,
warehouseSku: '',
productNo: '',
inventoryStatus: undefined as string | undefined,
inventoryStatus: undefined as number | undefined,
})
const buildQueryParams = () => ({
......@@ -153,6 +153,19 @@ const buildQueryParams = () => ({
inventoryStatus: filterForm.value.inventoryStatus || undefined,
})
const applyQueryWarehouseName = (records: OrderInventoryData[]) => {
const { inventoryStatus, warehouseId } = filterForm.value
if (inventoryStatus !== 3 || !warehouseId) {
return records
}
const warehouseName = props.warehouseList.find((w) => w.id === warehouseId)
?.name
return records.map((record) => ({
...record,
warehouseName,
}))
}
const {
loading,
currentPage,
......@@ -171,7 +184,10 @@ const {
current,
size,
)
return res.data
return {
...res.data,
records: applyQueryWarehouseName(res.data.records),
}
},
})
......@@ -294,7 +310,6 @@ const columns = [
align: 'right',
},
]
const handleSearch = () => {
refresh()
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment