heli-mes/mes-ui/mes-ui-admin-vue3/src/api/heli/wmsstorage/index.ts
2026-03-31 14:54:45 +08:00

102 lines
2.4 KiB
TypeScript

import request from '@/config/axios'
export interface WmsStorageDetailVO {
id: number
xzdWmsId: number
stockNo: string
matCode: string
rgName: string
description: string
createTime: number
stockNum: number
price: number
}
export interface WmsStorageVO {
id: number
stockNo: string
busiType: string
whName: string
busiDate: localdate
supplierName: string
priceType: string
deptName: string
description: string
status: boolean
stockType: boolean
auItem: string
incoiceCode: string
stockEmp: string
stockTime: Date
exportEmp: string
exprotTime: Date
exportEmpName: string
detailList?: WmsStorageDetailVO[]
}
// 查询新中大入/出库主分页
export const getWmsStoragePage = async (params) => {
return await request.get({ url: `/heli/wms-storage/page`, params })
}
// 查询新中大入/出库主详情
export const getWmsStorage = async (id: number) => {
return await request.get({ url: `/heli/wms-storage/get?id=` + id })
}
// 新增新中大入/出库主
export const createWmsStorage = async (data: WmsStorageVO) => {
return await request.post({ url: `/heli/wms-storage/create`, data })
}
// 修改新中大入/出库主
export const updateWmsStorage = async (data: WmsStorageVO) => {
return await request.put({ url: `/heli/wms-storage/update`, data })
}
// 删除新中大入/出库主
export const deleteWmsStorage = async (id: number) => {
return await request.delete({ url: `/heli/wms-storage/delete?id=` + id })
}
// 导出新中大入/出库主 Excel
export const exportWmsStorage = async (stockType: Number, ids: String) => {
return await request.download({
url: `/heli/wms-storage/export`,
params: { stockType, ids }
})
}
/**
* 入库库存业务类型
*/
export const HeliStockTypeDict = [
{ label: '入库', value: 1 },
{ label: '出库', value: 2 }
]
/**
* 单据状态
*/
export const HeliStorageStatusDict = [
{ label: '未导出', value: 1 },
{ label: '已导出', value: 2 }
]
/**
* 根据值获取库存业务类型标签
*/
export const getHeliStockTypeLabel = (value: number): string => {
const item = HeliStockTypeDict.find((item) => item.value === value)
return item?.label || ''
}
/**
* 根据值获取单据状态标签
*/
export const getHeliStorageStatusLabel = (value: number): string => {
const item = HeliStorageStatusDict.find((item) => item.value === value)
return item?.label || ''
}