index.js 1.9 KB

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