import request from '@/config/axios' export interface BalanceVO { packingNumber: string containerNumber: string itemCode: string batch: string altBatch: string arriveDate: Date produceDate: Date expireDate: Date inventoryStatus: string locationCode: string locationGroupCode: string areaCode: string warehouseCode: string erpLocationCode: string ownerCode: string uom: string qty: number lockedQty: number usableQty: number singlePrice: number amount: number putInTime: Date frozen: string frozenReason: string lastTransNumber: string weight: number area: number volume: number } // 查询库存余额列表 export const getBalancePage = async (params) => { if (params.isSearch) { delete params.isSearch const data = {...params} return await request.post({ url: '/wms/balance/senior', data }) } else { return await request.get({ url: `/wms/balance/page`, params }) } } // 查询库存余额列表 export const getBalancePageReturn= async (params) => { if (params.isSearch) { delete params.isSearch const data = {...params} return await request.post({ url: '/wms/balance/senior', data }) } else { return await request.get({ url: `/wms/balance/pageReturn`, params }) } } // 查询库存余额列表 export const getBalancePagePutaway= async (params) => { if (params.isSearch) { delete params.isSearch const data = {...params} return await request.post({ url: '/wms/balance/senior', data }) } else { return await request.get({ url: `/wms/balance/pagePutaway`, params }) } } // 查询库存余额列表增加物料筛选条件 export const getBalanceItemPage = async (params) => { if (params.isSearch) { delete params.isSearch const data = {...params} return await request.post({ url: '/wms/balance/seniorItems', data }) } else { return await request.get({ url: `/wms/balance/pageItems`, params }) } } // 查询库存余额列表根据业务类型 export const getBalancePageByBusinessType = async (params) => { if (params.isSearch) { delete params.isSearch const data = {...params} return await request.post({ url: '/wms/balance/seniorBusinessType', data }) } else { return await request.get({ url: `/wms/balance/pageBusinessType`, params }) } } // 查询库存余额列表根据业务类型 export const getBalancePageByBusinessTypeByItemType = async (params) => { if (params.isSearch) { delete params.isSearch const data = {...params} return await request.post({ url: '/wms/balance/seniorBusinessTypeByItemType', data }) } else { return await request.get({ url: `/wms/balance/pageBusinessTypeByItemType`, params }) } } // 备件出库查询库存余额列表 export const getBalancePageSpare = async (params) => { if (params.isSearch) { delete params.isSearch const data = {...params} return await request.post({ url: '/wms/balance/seniorSpareItems', data }) } else { return await request.get({ url: `/wms/balance/pageSpareItem`, params }) } } // 查询库存余额详情 export const getBalance = async (id: number) => { return await request.get({ url: `/wms/balance/get?id=` + id }) } // 新增库存余额 export const createBalance = async (data: BalanceVO) => { return await request.post({ url: `/wms/balance/create`, data }) } // 修改库存余额 export const updateBalance = async (data: BalanceVO) => { return await request.put({ url: `/wms/balance/update`, data }) } // 删除库存余额 export const deleteBalance = async (id: number) => { return await request.delete({ url: `/wms/balance/delete?id=` + id }) } // 导出库存余额 Excel export const exportBalance = async (params) => { if (params.isSearch) { const data = {...params} return await request.downloadPost({ url: `/wms/balance/export-excel-senior`, data }) } else { return await request.download({ url: `/wms/balance/export-excel`, params }) } } // 下载用户导入模板 export const importTemplate = () => { return request.download({ url: '/wms/balance/get-import-template' }) } // 获得库位代码筛选出的库存余额分页 export const selectLocationTypeToBalance = async (params) => { if (params.isSearch) { delete params.isSearch const data = {...params} return await request.post({ url: '/wms/balance/pageLocationCodeToBalanceSenior', data }) } else { return request.get({ url: '/wms/balance/pageLocationCodeToBalance', params}) } }