|
|
|
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 getBalancePageAll = async (params) => {
|
|
|
|
if (params.isSearch) {
|
|
|
|
delete params.isSearch
|
|
|
|
const data = {...params}
|
|
|
|
return await request.post({ url: '/wms/balance/seniorAll', data })
|
|
|
|
} else {
|
|
|
|
return await request.get({ url: `/wms/balance/pageAll`, params })
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// 查询库存汇总列表
|
|
|
|
export const getBalanceSummaryPageAll = async (params) => {
|
|
|
|
return await request.get({ url: `/wms/balance/totalBalanceTree`, params })
|
|
|
|
}
|
|
|
|
// 查询库存余额列表
|
|
|
|
export const getBalancePageReturn= async (params) => {
|
|
|
|
if (params.isSearch) {
|
|
|
|
delete params.isSearch
|
|
|
|
const data = {...params}
|
|
|
|
return await request.post({ url: '/wms/balance/seniorReturn', 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 })
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// 根据物料code 批次 和库位码查询库存余额总数
|
|
|
|
export const getSumByConditions= async (params) => {
|
|
|
|
return await request.get({ url: `/wms/balance/getSumByConditions`, 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 })
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// 导出库存汇总 Excel
|
|
|
|
export const exportTotalBalanceTree = async (params) => {
|
|
|
|
return await request.download({ url: `/wms/balance/exportTotalBalanceTree`, 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})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// 获得配置筛选出的库存余额分页
|
|
|
|
export const selectConfigToBalance = async (params) => {
|
|
|
|
if (params.isSearch) {
|
|
|
|
delete params.isSearch
|
|
|
|
const data = {...params}
|
|
|
|
return await request.post({ url: '/wms/balance/pageConfigToBalanceSenior', data })
|
|
|
|
} else {
|
|
|
|
return request.get({ url: '/wms/balance/pageConfigToBalance', params})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 查询库存余额列表根据业务类型 根据库存状态及库区类型筛选
|
|
|
|
export const getBalanceByBusinessTypeByItemType = async (params) => {
|
|
|
|
if (params.isSearch) {
|
|
|
|
delete params.isSearch
|
|
|
|
const data = {...params}
|
|
|
|
return await request.post({ url: '/wms/balance/pageBusinessTypeToBalanceSenior', data })
|
|
|
|
} else {
|
|
|
|
return await request.get({ url: `/wms/balance/pageBusinessTypeToBalance`, params })
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// 查询库存余额列表根据业务类型 根据库存状态及库区类型再根据物料的种类筛选
|
|
|
|
export const getBalanceByBusinessCategoryByItemType = async (params) => {
|
|
|
|
if (params.isSearch) {
|
|
|
|
delete params.isSearch
|
|
|
|
const data = {...params}
|
|
|
|
return await request.post({ url: '/wms/balance/pageBusinessCategoryToBalanceSenior', data })
|
|
|
|
} else {
|
|
|
|
return await request.get({ url: `/wms/balance/pageBusinessCategoryToBalance`, params })
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 根据code获取数据列表
|
|
|
|
export const getBalanceItemListByCodes = async (data) => {
|
|
|
|
return await request.get({ url: `/wms/balance/listByCodes`,data })
|
|
|
|
}
|
|
|
|
// 查询bom批次默认数据
|
|
|
|
export const getBanchBomPage = async (params) => {
|
|
|
|
return await request.get({ url: `/wms/balance/pageBOM`, params })
|
|
|
|
}
|