index.js 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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. }
  80. /**
  81. * 查询项目列表
  82. * @data data
  83. */
  84. export async function projectsPageAPI(data) {
  85. const res = await postJ(Vue.prototype.apiUrl+'/pro/projects/page', data);
  86. if (res.code == 0) {
  87. return res.data;
  88. }
  89. return Promise.reject(new Error(res.message));
  90. }
  91. /**
  92. * 查询发货单列表
  93. * @data data
  94. */
  95. export async function saleordersendrecord(data) {
  96. const res = await get(Vue.prototype.apiUrl+'/eom/saleordersendrecord/page', data);
  97. if (res.code == 0) {
  98. return res.data;
  99. }
  100. return Promise.reject(new Error(res.message));
  101. }
  102. /**
  103. * 查询发货单详情
  104. * @data data
  105. */
  106. export async function saleordersendrecordInfo(id) {
  107. const res = await get(Vue.prototype.apiUrl+`/eom/saleordersendrecord/getById/${id}`, {});
  108. if (res.code == 0) {
  109. return res.data;
  110. }
  111. return Promise.reject(new Error(res.message));
  112. }
  113. /**
  114. * 新增发货确认单
  115. * @data data
  116. */
  117. export async function saleordersendconfirmSave(data) {
  118. const res = await postJ(Vue.prototype.apiUrl+`/eom/saleordersendconfirm/save`, data);
  119. if (res.code == 0) {
  120. return res.data;
  121. }
  122. return Promise.reject(new Error(res.message));
  123. }
  124. /**
  125. * 查询发货确认单详情
  126. * @data data
  127. */
  128. export async function saleordersendconfirmInfo(id) {
  129. const res = await get(Vue.prototype.apiUrl+`/eom/saleordersendconfirm/getById/${id}`, {});
  130. if (res.code == 0) {
  131. return res.data;
  132. }
  133. return Promise.reject(new Error(res.message));
  134. }