You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
besure_web/src/api/erp/stock/stock/index.ts

149 lines
3.7 KiB
TypeScript

import request from '@/config/axios'
// ERP 产品库存 VO
export interface StockUnitStockVO {
unitId?: number
unitName?: string
count?: number
stockDisplay?: string
}
export interface ProductPackagingStockVO {
productId?: number
productName?: string
packagingSchemeId?: number
packagingSchemeName?: string
totalCount?: number
unitName?: string
stockDisplay?: string
packagingDisplay?: string
packageQuantity?: number
palletPackageQuantity?: number
palletTotalQuantity?: number
}
export interface ProductStockCardVO {
skuCount?: number
stockDisplay?: string
totalCount?: number
unitName?: string
packagingStocks?: ProductPackagingStockVO[]
todayFinishedInDisplay?: string
}
export interface UnitGroupedStockCardVO {
skuCount?: number
stockDisplay?: string
unitStocks?: StockUnitStockVO[]
}
export interface TodayInCardVO {
orderCount?: number
itemCount?: number
productStock?: ProductStockCardVO
materialStock?: UnitGroupedStockCardVO
sparePartStock?: UnitGroupedStockCardVO
productDisplay?: string
materialDisplay?: string
sparePartDisplay?: string
}
export interface TodayOutCardVO {
orderCount?: number
itemCount?: number
materialStock?: UnitGroupedStockCardVO
sparePartStock?: UnitGroupedStockCardVO
productStock?: ProductStockCardVO
materialDisplay?: string
sparePartDisplay?: string
productDisplay?: string
}
export interface StockStatisticsCardsRespVO {
productStock?: ProductStockCardVO
materialStock?: UnitGroupedStockCardVO
sparePartStock?: UnitGroupedStockCardVO
todayIn?: TodayInCardVO
todayOut?: TodayOutCardVO
}
export interface StockVO {
// 编号
id: number
// 产品编号
productId: number
name?: string
productName?: string
barCode?: string
categoryName?: string
unitName?: string
purchaseUnitName?: string
// 产品分类类型
categoryType?: number
// 仓库编号
warehouseId: number
warehouseName?: string
areaId?: number
areaName?: string
// 包装/换算规则
packagingRule?: string
// 库存展示
stockDisplay?: string
areaStocks?: Array<{
areaId?: number
areaName?: string
count?: number
packageCount?: number
baseCount?: number
stockDisplay?: string
}>
totalPackageCount?: number
totalBaseCount?: number
// 库存数量
count: number
lockedStockCount?: number
latestInTime?: number | string
lastInTime?: number | string
recentInTime?: number | string
latestStockInTime?: number | string
lastStockInTime?: number | string
latestOutTime?: number | string
lastOutTime?: number | string
recentOutTime?: number | string
latestStockOutTime?: number | string
lastStockOutTime?: number | string
}
// ERP 产品库存 API
export const StockApi = {
// 查询库存统计卡片
getStockStatisticsCards: async () => {
return await request.get<StockStatisticsCardsRespVO>({ url: `/erp/stock/statistics-cards` })
},
// 查询产品库存分页
getStockPage: async (params: any) => {
return await request.get({ url: `/erp/stock/page`, params })
},
// 查询产品库存详情
getStock: async (id: number) => {
return await request.get({ url: `/erp/stock/get?id=` + id })
},
// 查询产品库存详情
getStock2: async (productId: number, warehouseId: number, areaId?: number) => {
return await request.get({ url: `/erp/stock/get`, params: { productId, warehouseId, areaId } })
},
// 获得产品库存数量
getStockCount: async (productId: number) => {
return await request.get({ url: `/erp/stock/get-count`, params: { productId } })
},
// 导出产品库存 Excel
exportStock: async (params) => {
return await request.download({ url: `/erp/stock/export-excel`, params })
}
}