Commit e61f0357 by qinjianhui

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

parent 59460180
...@@ -142,7 +142,7 @@ const filterForm = ref({ ...@@ -142,7 +142,7 @@ const filterForm = ref({
warehouseId: undefined as number | undefined, warehouseId: undefined as number | undefined,
warehouseSku: '', warehouseSku: '',
productNo: '', productNo: '',
inventoryStatus: undefined as string | undefined, inventoryStatus: undefined as number | undefined,
}) })
const buildQueryParams = () => ({ const buildQueryParams = () => ({
...@@ -153,6 +153,19 @@ const buildQueryParams = () => ({ ...@@ -153,6 +153,19 @@ const buildQueryParams = () => ({
inventoryStatus: filterForm.value.inventoryStatus || undefined, 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 { const {
loading, loading,
currentPage, currentPage,
...@@ -171,7 +184,10 @@ const { ...@@ -171,7 +184,10 @@ const {
current, current,
size, size,
) )
return res.data return {
...res.data,
records: applyQueryWarehouseName(res.data.records),
}
}, },
}) })
...@@ -294,7 +310,6 @@ const columns = [ ...@@ -294,7 +310,6 @@ const columns = [
align: 'right', align: 'right',
}, },
] ]
const handleSearch = () => { const handleSearch = () => {
refresh() 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