2024-02-05 01:36:24 +08:00

52 lines
1.4 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import request from '@/config/axios'
// ERP 产品 VO
export interface ProductVO {
id: number // 产品编号
name: string // 产品名称
barCode: string // 产品条码
categoryId: number // 产品类型编号
unitId: number // 单位编号
status: number // 产品状态
standard: string // 产品规格
remark: string // 产品备注
expiryDay: number // 保质期天数
weight: number // 重量kg
purchasePrice: number // 采购价格,单位:元
salePrice: number // 销售价格,单位:元
minPrice: number // 最低价格,单位:元
}
// ERP 产品 API
export const ProductApi = {
// 查询产品分页
getProductPage: async (params: any) => {
return await request.get({ url: `/erp/product/page`, params })
},
// 查询产品详情
getProduct: async (id: number) => {
return await request.get({ url: `/erp/product/get?id=` + id })
},
// 新增产品
createProduct: async (data: ProductVO) => {
return await request.post({ url: `/erp/product/create`, data })
},
// 修改产品
updateProduct: async (data: ProductVO) => {
return await request.put({ url: `/erp/product/update`, data })
},
// 删除产品
deleteProduct: async (id: number) => {
return await request.delete({ url: `/erp/product/delete?id=` + id })
},
// 导出产品 Excel
exportProduct: async (params) => {
return await request.download({ url: `/erp/product/export-excel`, params })
}
}