inventory.ts 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. import {
  2. GetInventoryParams,
  3. BaseResult,
  4. MplanInventoryParams,
  5. EditInventoryParams,
  6. AddInventoryParams,
  7. BaseListResult,
  8. GetInventoryData,
  9. } from '@models';
  10. import {request} from './network';
  11. const BASE_URL = '/inventory';
  12. /** 查询物料管理列表 */
  13. export function GetInventoryList(
  14. data: GetInventoryParams,
  15. ): BaseListResult<GetInventoryData> {
  16. return request({
  17. method: 'GET',
  18. url: BASE_URL + '/getInventoryLists',
  19. data,
  20. });
  21. }
  22. /** 查询物料管理列表 */
  23. export function GetInventoryInfo(
  24. id: string,
  25. ): BaseListResult<GetInventoryData> {
  26. return request({
  27. method: 'GET',
  28. url: BASE_URL + '/getInventoryLists',
  29. data: {id, page: '1', limit: '1'},
  30. });
  31. }
  32. /** 物料管理导出 */
  33. export function exportInventory(
  34. data: GetInventoryParams,
  35. ): BaseResult {
  36. return request({
  37. method: 'GET',
  38. url: BASE_URL + '/inventoryExport',
  39. data,
  40. });
  41. }
  42. /** 新增物料管理 */
  43. export function addInventory(
  44. data: AddInventoryParams,
  45. ): BaseResult {
  46. return request({
  47. method: 'POST',
  48. url: BASE_URL + '/addInventory',
  49. data,
  50. });
  51. }
  52. /** 删除物料 */
  53. export function DeleteInventory(
  54. id: string,
  55. ): BaseResult {
  56. return request({
  57. method: 'DELETE',
  58. url: BASE_URL + '/delInventory',
  59. data: {id},
  60. });
  61. }
  62. /** 修改物料 */
  63. export function updateInventory(
  64. data: EditInventoryParams,
  65. ): BaseResult {
  66. return request({
  67. method: 'PUT',
  68. url: BASE_URL + '/updateInventory',
  69. data,
  70. });
  71. }