purchaseNeedManage.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. import {
  2. get,
  3. put,
  4. putJ,
  5. postJ,
  6. deleteApi
  7. } from "@/utils/request";
  8. import Vue from "vue";
  9. /**
  10. * 获取信息列表
  11. */
  12. export async function getTableList(params) {
  13. const res = await get(Vue.prototype.apiUrl + `/eom/purchaserequirement/page`, params);
  14. if (res.code == 0) {
  15. return res.data;
  16. }
  17. return Promise.reject(new Error(res.message));
  18. }
  19. /**
  20. * 获取信息详情
  21. */
  22. export async function getDetail(id) {
  23. const res = await get(Vue.prototype.apiUrl + `/eom/purchaserequirement/getById/${id}`, {});
  24. if (res.code == 0) {
  25. return res.data;
  26. }
  27. return Promise.reject(new Error(res.message));
  28. }
  29. /**
  30. * 删除事项
  31. */
  32. export async function deleteInformation(data) {
  33. const res = await deleteApi(Vue.prototype.apiUrl + '/eom/purchaserequirement/delete', data);
  34. if (res.code == 0) {
  35. return res.data;
  36. }
  37. return Promise.reject(new Error(res.message));
  38. }
  39. //工序分页
  40. export async function producetask(params) {
  41. const res = await get(Vue.prototype.apiUrl + '/main/producetask/page', params);
  42. if (res.code == 0) {
  43. return res.data;
  44. }
  45. }
  46. /**
  47. * 更新信息
  48. */
  49. export async function UpdateInformation(data) {
  50. const res = await put(Vue.prototype.apiUrl + `/eom/purchaserequirement/update`, data);
  51. if (res.code == 0) {
  52. return res.data;
  53. }
  54. return Promise.reject(new Error(res.message));
  55. }
  56. /**
  57. * 新增信息
  58. */
  59. export async function addPurchaseNeedManage(data) {
  60. const res = await post(Vue.prototype.apiUrl + `/eom/purchaserequirement/save`, data);
  61. if (res.data.code == 0) {
  62. return res.data.data;
  63. }
  64. return Promise.reject(new Error(res.data.message));
  65. }