index.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. import {
  2. get,
  3. put,
  4. putJ,
  5. postJ,
  6. deleteApi
  7. } from "@/utils/request";
  8. import Vue from "vue";
  9. // 配件申请记录 表格
  10. export async function accessoryPage(data) {
  11. const res = await get(Vue.prototype.apiUrl + `/eom/sparePartsApply/page`, {
  12. params: data
  13. });
  14. if (res.code == 0) {
  15. return res.data;
  16. }
  17. return Promise.reject(new Error(res.message));
  18. }
  19. // 配件回收记录 表格
  20. export async function recyclePage(data) {
  21. const res = await get(Vue.prototype.apiUrl + `/eom/afterSalesAccessoryApply/page`, {
  22. params: data
  23. });
  24. if (res.code == 0) {
  25. return res.data;
  26. }
  27. return Promise.reject(new Error(res.message));
  28. }
  29. // 配件申请记录 表格 新增
  30. export async function accessorySave(data) {
  31. const res = await postJ(Vue.prototype.apiUrl + `/eom/sparePartsApply/saveOrUpdate`, data);
  32. if (res.code == 0) {
  33. return res.data;
  34. }
  35. return Promise.reject(new Error(res.message));
  36. }
  37. // 配件申请记录 表格 修改
  38. export async function accessoryUpdate(data) {
  39. const res = await putJ(Vue.prototype.apiUrl + `/eom/sparePartsApply/update`, data);
  40. if (res.code == 0) {
  41. return res.data;
  42. }
  43. return Promise.reject(new Error(res.message));
  44. }
  45. // 配件申请记录 表格 详情
  46. export async function accessoryInfo(id) {
  47. const res = await get(Vue.prototype.apiUrl + `/eom/sparePartsApply/getById/${id}`);
  48. if (res.code == 0) {
  49. return res.data;
  50. }
  51. return Promise.reject(new Error(res.message));
  52. }
  53. // 配件申请记录 表格 删除
  54. export async function accessoryDelete(data) {
  55. const res = await deleteApi(Vue.prototype.apiUrl + '/eom/sparePartsApply/delete', data);
  56. if (res.code == 0) {
  57. return res.data;
  58. }
  59. return Promise.reject(new Error(res.message));
  60. }
  61. // 配件回收记录 表格 删除
  62. export async function recycleDelete(data) {
  63. const res = await deleteApi(Vue.prototype.apiUrl + '/eom/afterSalesAccessoryApply/delete', data);
  64. if (res.code == 0) {
  65. return res.data;
  66. }
  67. return Promise.reject(new Error(res.message));
  68. }