purchasePlanManage.js 835 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. import {
  2. get,
  3. postJ
  4. } from "@/utils/request";
  5. import Vue from "vue";
  6. /**
  7. * 获取信息列表
  8. */
  9. export async function getTableList(params) {
  10. const res = await get(Vue.prototype.apiUrl + `/eom/purchaseplan/page`, params);
  11. if (res.code == 0) {
  12. return res.data;
  13. }
  14. return Promise.reject(new Error(res.message));
  15. }
  16. /**
  17. * 获取计划详情
  18. */
  19. export async function getplanDetail(id) {
  20. const res = await get(Vue.prototype.apiUrl + `/eom/purchaseplan/getById/${id}`, {});
  21. if (res.code == 0) {
  22. return res.data;
  23. }
  24. return Promise.reject(new Error(res.message));
  25. }
  26. /**
  27. * 新增/保存采购计划
  28. */
  29. export async function savePurchasePlan(data) {
  30. const res = await postJ(Vue.prototype.apiUrl + `/eom/purchaseplan/save`, data);
  31. if (res.code == 0) {
  32. return res.data;
  33. }
  34. return Promise.reject(new Error(res.message));
  35. }