purchaseNeedManage.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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 putJ(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 postJ(Vue.prototype.apiUrl + `/eom/purchaserequirement/save`, data);
  61. if (res.code == 0) {
  62. return res.data;
  63. }
  64. return Promise.reject(new Error(res.message));
  65. }
  66. export async function getCBomAPI(params) {
  67. const res = await get(Vue.prototype.apiUrl + '/main/bomCategory/cBom', params);
  68. if (res.code == 0) {
  69. return res.data;
  70. }
  71. return Promise.reject(new Error(res.message));
  72. }