index.ts 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import request from '@/config/axios'
  2. // ERP 产品单位 VO
  3. export interface ProductUnitVO {
  4. id: number // 单位编号
  5. name: string // 单位名字
  6. status: number // 单位状态
  7. }
  8. // ERP 产品单位 API
  9. export const ProductUnitApi = {
  10. // 查询产品单位分页
  11. getProductUnitPage: async (params: any) => {
  12. return await request.get({ url: `/erp/product-unit/page`, params })
  13. },
  14. // 查询商品单位精简列表
  15. getProductUnitSimpleList: async () => {
  16. return await request.get({ url: `/erp/product-unit/simple-list` })
  17. },
  18. // 查询产品单位详情
  19. getProductUnit: async (id: number) => {
  20. return await request.get({ url: `/erp/product-unit/get?id=` + id })
  21. },
  22. // 新增产品单位
  23. createProductUnit: async (data: ProductUnitVO) => {
  24. return await request.post({ url: `/erp/product-unit/create`, data })
  25. },
  26. // 修改产品单位
  27. updateProductUnit: async (data: ProductUnitVO) => {
  28. return await request.put({ url: `/erp/product-unit/update`, data })
  29. },
  30. // 删除产品单位
  31. deleteProductUnit: async (id: number) => {
  32. return await request.delete({ url: `/erp/product-unit/delete?id=` + id })
  33. },
  34. // 导出产品单位 Excel
  35. exportProductUnit: async (params) => {
  36. return await request.download({ url: `/erp/product-unit/export-excel`, params })
  37. }
  38. }