index.js 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. import request from '@/utils/request';
  2. /**
  3. * 列表
  4. */
  5. export async function getList (data) {
  6. const res = await request.post('/aps/productionplan/page', data);
  7. if (res.data.code == 0) {
  8. return res.data.data;
  9. }
  10. return Promise.reject(new Error(res.data.message));
  11. }
  12. /**
  13. * 保存
  14. */
  15. export async function save (data) {
  16. const res = await request.post('/aps/productionplan/save', data);
  17. if (res.data.code == 0) {
  18. return res.data.data;
  19. }
  20. return Promise.reject(new Error(res.data.message));
  21. }
  22. /**
  23. * 基本信息
  24. */
  25. export async function getById (id) {
  26. const res = await request.get(`/aps/productionplan/getById/${id}`);
  27. if (res.data.code == 0) {
  28. return res.data.data;
  29. }
  30. return Promise.reject(new Error(res.data.message));
  31. }
  32. /**
  33. * 发布信息返显
  34. */
  35. export async function getReleaseInfoById (id) {
  36. const res = await request.get(`/aps/productionplan/getReleaseInfoById/${id}`);
  37. if (res.data.code == 0) {
  38. return res.data.data;
  39. }
  40. return Promise.reject(new Error(res.data.message));
  41. }
  42. /**
  43. * 详情
  44. */
  45. export async function getProductPlanDetail (id) {
  46. const res = await request.get(
  47. `/aps/productionplan/getProductPlanDetail/${id}`
  48. );
  49. if (res.data.code == 0) {
  50. return res.data.data;
  51. }
  52. return Promise.reject(new Error(res.data.message));
  53. }
  54. /**
  55. * 根据计划id获取物料信息
  56. */
  57. export async function getMaterialinfo (planId) {
  58. const res = await request.get(`/aps/materialinfo/getByPlanId/${planId}`);
  59. if (res.data.code == 0) {
  60. return res.data.data;
  61. }
  62. return Promise.reject(new Error(res.data.message));
  63. }
  64. /**
  65. * 删除
  66. */
  67. export async function del (id) {
  68. const res = await request.delete(`/aps/productionplan/delete/${id}`);
  69. if (res.data.code == 0) {
  70. return res.data.data;
  71. }
  72. return Promise.reject(new Error(res.data.message));
  73. }
  74. // 拆分
  75. export async function splitWork (params) {
  76. const res = await request.post(`/aps/productionplan/splitBatch`, params);
  77. if (res.data.code == 0) {
  78. return res.data.data;
  79. }
  80. return Promise.reject(new Error(res.data.message));
  81. }
  82. // 计划合批
  83. export async function mergeBatch (params) {
  84. const res = await request.post(`/aps/productionplan/mergeBatch`, params);
  85. if (res.data.code == 0) {
  86. return res.data.data;
  87. }
  88. return Promise.reject(new Error(res.data.message));
  89. }
  90. // 修改优先级
  91. export async function updatePriority(data) {
  92. const res = await request.post(`/aps/productionplan/updatePriority`, data);
  93. if (res.data.code == 0) {
  94. return res.data.data;
  95. }
  96. return Promise.reject(new Error(res.data.message));
  97. }
  98. /**
  99. * 生产详情列表
  100. */
  101. export async function queryTaskDetail (data) {
  102. const res = await request.get('/aps/quality_details_work_order/queryPlanId/'+data);
  103. if (res.data.code == 0) {
  104. return res.data.data;
  105. }
  106. return Promise.reject(new Error(res.data.message));
  107. }
  108. // 计划分解(获取产品BOM)
  109. export async function getBom(params) {
  110. const res = await request.get(`/main/bomCategory/getBom`, { params });
  111. if (res.data.code == 0) {
  112. return res.data.data;
  113. }
  114. return Promise.reject(new Error(res.data.message));
  115. }
  116. // 计划分解 (保存)
  117. export async function batchSave(data) {
  118. const res = await request.post(`/aps/productionplan/batchSave`, data);
  119. if (res.data.code == 0) {
  120. return res.data.data;
  121. }
  122. return Promise.reject(new Error(res.data.message));
  123. }
  124. // 齐套性检查
  125. export async function homogeneityInspect(data) {
  126. const res = await request.post(`/aps/productionplan/homogeneityInspect`, data);
  127. if (res.data.code == 0) {
  128. return res.data.data;
  129. }
  130. return Promise.reject(new Error(res.data.message));
  131. }
  132. export async function getStockList (params) {
  133. const res = await request.get('/wms/outindetailtwo/page', {params});
  134. if (res.data.code == 0) {
  135. return res.data.data;
  136. }
  137. return Promise.reject(new Error(res.data.message));
  138. }
  139. export async function getCurrentList (data) {
  140. const res = await request.post('/eom/purchaseorder/getZtDetail', data);
  141. if (res.data.code == 0) {
  142. return res.data.data;
  143. }
  144. return Promise.reject(new Error(res.data.message));
  145. }
  146. // 齐套性检查
  147. export async function homogeneityInspectMerge(data) {
  148. const res = await request.post(`/aps/productionplan/homogeneityInspectMerge`, data);
  149. if (res.data.code == 0) {
  150. return res.data.data;
  151. }
  152. return Promise.reject(new Error(res.data.message));
  153. }
  154. // PBOM树
  155. export async function getBomRoot(data) {
  156. const res = await request.post(`/aps/productionplan/getBomRoot`, data);
  157. if (res.data.code == 0) {
  158. return res.data.data;
  159. }
  160. return Promise.reject(new Error(res.data.message));
  161. }
  162. // PBOM 齐套性检查
  163. export async function pbomHomogeneityInspect(data) {
  164. const res = await request.post(`/aps/productionplan/pbomHomogeneityInspect`, data);
  165. if (res.data.code == 0) {
  166. return res.data.data;
  167. }
  168. return Promise.reject(new Error(res.data.message));
  169. }