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/check/index.ts

168 lines
5.0 KiB
TypeScript

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

import request from '@/config/axios'
// ERP 库存盘点单 VO
export interface StockCheckVO {
id: number // 盘点编号
no: string // 盘点单号
checkTime: Date | string // 盘点时间
sourceType?: number | string // 生成来源类型1-按库存2-按产品
categoryType?: number | string // 分类
totalCount: number // 合计数量
totalPrice: number // 合计金额,单位:元
status: number // 状态
checkStatus?: number | string // 盘点状态0-未盘点1-已盘点
auditUserId?: number // 审核人编号
auditUserName?: string // 审核人名称
remark?: string // 备注
fileUrl?: string // 附件 URL
creator?: string // 创建人
creatorName?: string // 创建人名称
createTime?: Date | string // 创建时间
productNames?: string // 产品信息
items?: StockCheckItemVO[] // 盘点项列表
approveRecords?: StockCheckApproveRecordVO[] // 审核记录
}
export interface StockCheckItemVO {
id?: number // 盘点项编号
warehouseId: number // 仓库编号
warehouseName?: string // 仓库名称
areaId?: number // 库区编号
areaName?: string // 库区名称
productId: number // 产品编号
productPrice: number // 产品单价
stockCount: number // 账面数量
actualCount: number // 实际数量
count: number // 盈亏数量
remark?: string // 备注
productName: string // 产品名称
productBarCode: string // 产品条码
productUnitName: string // 产品单位名称
purchaseUnitName?: string // 采购单位名称
}
export interface StockCheckRecordVO {
id: number
stockCheckId?: number
stockCheckItemId?: number
no?: string
checkTime?: Date | string
sourceType?: number | string
categoryType?: number | string
status?: number | string
checkStatus?: number | string
productId?: number
productName?: string
productBarCode?: string
barCode?: string
standard?: string
productUnitName?: string
purchaseUnitName?: string
unitName?: string
warehouseId?: number
warehouseName?: string
areaId?: number
areaName?: string
stockCount?: number | string
actualCount?: number | string
count?: number | string
remark?: string
creator?: string
creatorName?: string
createTime?: Date | string
[key: string]: any
}
export interface StockCheckApproveRecordVO {
id?: number // 编号
stockCheckId?: number // 盘点单编号
actionType?: string // 操作类型
fromStatus?: number // 变更前状态
toStatus?: number // 变更后状态
targetUserId?: number // 目标审核人编号
targetUserName?: string // 目标审核人名称
remark?: string // 备注
creator?: string // 操作人
creatorName?: string // 操作人名称
createTime?: Date | string // 创建时间
}
// ERP 库存盘点单 API
export const StockCheckApi = {
// 查询库存盘点单分页
getStockCheckPage: async (params: any) => {
return await request.get({ url: `/erp/stock-check/page`, params })
},
// 查询库存盘点记录分页
getStockCheckRecordPage: async (params: any) => {
return await request.get({ url: `/erp/stock-check/record-page`, params })
},
// 导出库存盘点记录 Excel
exportStockCheckRecord: async (params) => {
return await request.download({ url: `/erp/stock-check/record-export-excel`, params })
},
// 查询库存盘点单详情
getStockCheck: async (id: number) => {
return await request.get({ url: `/erp/stock-check/get?id=` + id })
},
// 按仓库/库区生成盘点项
generateItemsByLocation: async (data: any) => {
return await request.post({ url: `/erp/stock-check/generate-items/by-location`, data })
},
// 按产品生成盘点项
generateItemsByProduct: async (data: any) => {
return await request.post({ url: `/erp/stock-check/generate-items/by-product`, data })
},
// 新增库存盘点单
createStockCheck: async (data: StockCheckVO) => {
return await request.post({ url: `/erp/stock-check/create`, data })
},
// 修改库存盘点单
updateStockCheck: async (data: StockCheckVO) => {
return await request.put({ url: `/erp/stock-check/update`, data })
},
// 更新库存盘点单的状态
updateStockCheckStatus: async (id: number, status: number) => {
return await request.put({
url: `/erp/stock-check/update-status`,
params: {
id,
status
}
})
},
// 提交库存盘点单
submitStockCheck: async (data: { id: number; auditUserId?: number; remark?: string }) => {
return await request.put({ url: `/erp/stock-check/submit`, data })
},
// 审核库存盘点单
auditStockCheck: async (data: { id: number; status: number; remark?: string }) => {
return await request.put({ url: `/erp/stock-check/audit`, data })
},
// 删除库存盘点单
deleteStockCheck: async (ids: number[]) => {
return await request.delete({
url: `/erp/stock-check/delete`,
params: {
ids: ids.join(',')
}
})
},
// 导出库存盘点单 Excel
exportStockCheck: async (params) => {
return await request.download({ url: `/erp/stock-check/export-excel`, params })
}
}