| | |
| | | import request from '@/utils/http' |
| | | |
| | | export function buildWarehouseStockPageParams(params = {}) { |
| | | const matnrCode = typeof params.matnrCode === 'string' ? params.matnrCode.trim() : params.matnrCode |
| | | const matnrCode = |
| | | typeof params.matnrCode === 'string' ? params.matnrCode.trim() : params.matnrCode |
| | | const maktx = typeof params.maktx === 'string' ? params.maktx.trim() : params.maktx |
| | | const batch = typeof params.batch === 'string' ? params.batch.trim() : params.batch |
| | | return { |
| | |
| | | ...Object.fromEntries( |
| | | Object.entries(params).filter( |
| | | ([key, value]) => |
| | | !['current', 'pageSize', 'size', 'aggType', 'matnrCode', 'maktx', 'batch'].includes(key) && |
| | | !['current', 'pageSize', 'size', 'aggType', 'matnrCode', 'maktx', 'batch'].includes( |
| | | key |
| | | ) && |
| | | value !== undefined && |
| | | value !== '' |
| | | ) |
| | |
| | | current: params.current || 1, |
| | | pageSize: params.pageSize || params.size || 20, |
| | | ...(params.aggType !== undefined ? { aggType: params.aggType } : {}), |
| | | ...(params.orderBy !== undefined ? { orderBy: params.orderBy } : {}), |
| | | ...(params.stock !== undefined ? { stock: params.stock } : {}) |
| | | } |
| | | } |
| | | |
| | | export function fetchWarehouseStockPage(params = {}) { |
| | | return request.post({ url: '/warehouse/stock/page', params: buildWarehouseStockPageParams(params) }) |
| | | return request.post({ |
| | | url: '/warehouse/stock/page', |
| | | params: buildWarehouseStockPageParams(params) |
| | | }) |
| | | } |
| | | |
| | | export function fetchWarehouseStockInfoPage(params = {}) { |
| | | return request.post({ url: '/warehouse/stock/info', params: buildWarehouseStockInfoParams(params) }) |
| | | return request.post({ |
| | | url: '/warehouse/stock/info', |
| | | params: buildWarehouseStockInfoParams(params) |
| | | }) |
| | | } |
| | | |
| | | export function fetchWarehouseStockHistoriesPage(params = {}) { |