李红攀:V2.0.001仓库管理
This commit is contained in:
40
src/api/erp/stock/index.ts
Normal file
40
src/api/erp/stock/index.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
import type { PageParam, PageResult } from '@/http/types'
|
||||
import { http } from '@/http/http'
|
||||
|
||||
/** 产品库存信息 */
|
||||
export interface Stock {
|
||||
id?: number
|
||||
productId?: number
|
||||
productName?: string
|
||||
unitName?: string
|
||||
categoryName?: string
|
||||
warehouseId?: number
|
||||
warehouseName?: string
|
||||
count?: number
|
||||
unitPrice?: number
|
||||
stockValue?: number
|
||||
}
|
||||
|
||||
/** 获取产品库存分页列表 */
|
||||
export function getStockPage(params: PageParam) {
|
||||
return http.get<PageResult<Stock>>('/erp/stock/page', params)
|
||||
}
|
||||
|
||||
/** 获取产品库存详情 */
|
||||
export function getStock(id: number) {
|
||||
return http.get<Stock>(`/erp/stock/get?id=${id}`)
|
||||
}
|
||||
|
||||
/** 获取产品库存详情(通过产品ID和仓库ID) */
|
||||
export function getStock2(productId: number, warehouseId: number) {
|
||||
return http.get<Stock>('/erp/stock/get', { productId, warehouseId })
|
||||
}
|
||||
|
||||
/** 获取产品库存数量 */
|
||||
export function getStockCount(productId: number, warehouseId?: number) {
|
||||
const params: Record<string, any> = { productId }
|
||||
if (warehouseId) {
|
||||
params.warehouseId = warehouseId
|
||||
}
|
||||
return http.get<number>('/erp/stock/get-count', params)
|
||||
}
|
||||
Reference in New Issue
Block a user