index.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. import {
  2. get,
  3. put,
  4. putJ,
  5. postJ,deleteApi
  6. } from "@/utils/request";
  7. import Vue from "vue";
  8. /**
  9. * 获取信息列表
  10. */
  11. export async function getTableList(params) {
  12. const res = await get(Vue.prototype.apiUrl + `/eom/saleorder/page`, {
  13. params
  14. });
  15. if (res.code == 0) {
  16. return res.data;
  17. }
  18. return Promise.reject(new Error(res.message));
  19. }
  20. /**
  21. * 获取信息详情
  22. */
  23. export async function getSaleOrderDetail(id) {
  24. const res = await get(Vue.prototype.apiUrl + `/eom/saleorder/getById/${id}`, {});
  25. if (res.code == 0) {
  26. return res.data;
  27. }
  28. return Promise.reject(new Error(res.message));
  29. }
  30. /**
  31. * 更新信息
  32. */
  33. export async function saveSaleorder(data) {
  34. let api = data.id ? putJ : postJ
  35. const res = await api(Vue.prototype.apiUrl + `/eom/saleorder/` + (data.id ? 'update' :
  36. 'save'), data);
  37. if (res.code == 0) {
  38. return res.data;22
  39. }
  40. return Promise.reject(new Error(res.message));
  41. }
  42. /**
  43. * 获取合同列表
  44. */
  45. export async function contractList(params) {
  46. const res = await get(Vue.prototype.apiUrl + `/eom/contract/page`, params);
  47. if (res.code == 0) {
  48. return res.data;
  49. }
  50. return Promise.reject(new Error(res.message));
  51. }
  52. /**
  53. * 获取合同详情
  54. */
  55. export async function getContract(id) {
  56. const res = await get(Vue.prototype.apiUrl + `/eom/contract/getById/${id}`, {});
  57. if (res.code == 0) {
  58. return res.data;
  59. }
  60. return Promise.reject(new Error(res.message));
  61. }
  62. /**
  63. * 摘要卡片
  64. */
  65. export async function queryOrderNoCount(code) {
  66. const res = await get(Vue.prototype.apiUrl + `/eom/saleorder/queryOrderNoCount/${code}`, {});
  67. if (res.code == 0) {
  68. return res.data;
  69. }
  70. return Promise.reject(new Error(res.message));
  71. }
  72. /**
  73. * 删除事项
  74. */
  75. export async function deleteInformation(data) {
  76. const res = await deleteApi(Vue.prototype.apiUrl +'/eom/saleorder/delete', data);
  77. if (res.code == 0) {
  78. return res.data;
  79. }
  80. return Promise.reject(new Error(res.message));
  81. }