index.js 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  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. console.log(id);
  27. const res = await request.get(`/aps/productionplan/getById/` + id);
  28. if (res.data.code == 0) {
  29. return res.data.data;
  30. }
  31. return Promise.reject(new Error(res.data.message));
  32. }
  33. /**
  34. * 发布信息返显
  35. */
  36. export async function getReleaseInfoById(id) {
  37. const res = await request.get(`/aps/productionplan/getReleaseInfoById/${id}`);
  38. if (res.data.code == 0) {
  39. return res.data.data;
  40. }
  41. return Promise.reject(new Error(res.data.message));
  42. }
  43. /**
  44. * 详情
  45. */
  46. export async function getProductPlanDetail(id) {
  47. const res = await request.get(
  48. `/aps/productionplan/getProductPlanDetail/${id}`
  49. );
  50. if (res.data.code == 0) {
  51. return res.data.data;
  52. }
  53. return Promise.reject(new Error(res.data.message));
  54. }
  55. /**
  56. * 根据计划id获取物料信息
  57. */
  58. export async function getMaterialinfo(planId) {
  59. const res = await request.get(`/aps/materialinfo/listByPlanId`, {
  60. params: { planId }
  61. });
  62. if (res.data.code == 0) {
  63. return res.data.data;
  64. }
  65. return Promise.reject(new Error(res.data.message));
  66. }
  67. /**
  68. * 删除
  69. */
  70. export async function del(id) {
  71. const res = await request.delete(`/aps/productionplan/delete/${id}`);
  72. if (res.data.code == 0) {
  73. return res.data.data;
  74. }
  75. return Promise.reject(new Error(res.data.message));
  76. }
  77. // 拆分
  78. export async function splitWork(params) {
  79. const res = await request.post(`/aps/productionplan/splitBatch`, params);
  80. if (res.data.code == 0) {
  81. return res.data.data;
  82. }
  83. return Promise.reject(new Error(res.data.message));
  84. }
  85. // 计划合批
  86. export async function mergeBatch(params) {
  87. const res = await request.post(`/aps/productionplan/mergeBatch`, params);
  88. if (res.data.code == 0) {
  89. return res.data.data;
  90. }
  91. return Promise.reject(new Error(res.data.message));
  92. }
  93. // 修改优先级
  94. export async function updatePriority(data) {
  95. const res = await request.post(`/aps/productionplan/updatePriority`, data);
  96. if (res.data.code == 0) {
  97. return res.data.data;
  98. }
  99. return Promise.reject(new Error(res.data.message));
  100. }
  101. /**
  102. * 生产详情列表
  103. */
  104. export async function queryTaskDetail(data) {
  105. const res = await request.get(
  106. '/aps/quality_details_work_order/queryPlanId/' + data
  107. );
  108. if (res.data.code == 0) {
  109. return res.data.data;
  110. }
  111. return Promise.reject(new Error(res.data.message));
  112. }
  113. // 计划分解(获取产品BOM)
  114. export async function getBom(params) {
  115. const res = await request.get(`/main/bomCategory/getBom`, { params });
  116. if (res.data.code == 0) {
  117. return res.data.data;
  118. }
  119. return Promise.reject(new Error(res.data.message));
  120. }
  121. // 计划分解 (保存)
  122. export async function batchSave(data) {
  123. const res = await request.post(`/aps/productionplan/batchSave`, data);
  124. if (res.data.code == 0) {
  125. return res.data.data;
  126. }
  127. return Promise.reject(new Error(res.data.message));
  128. }
  129. // 齐套性检查
  130. export async function homogeneityInspect(data) {
  131. const res = await request.post(
  132. `/aps/productionplan/homogeneityInspect`,
  133. data
  134. );
  135. if (res.data.code == 0) {
  136. return res.data.data;
  137. }
  138. return Promise.reject(new Error(res.data.message));
  139. }
  140. export async function getStockList(params) {
  141. const res = await request.get('/wms/outindetailtwo/page', { params });
  142. if (res.data.code == 0) {
  143. return res.data.data;
  144. }
  145. return Promise.reject(new Error(res.data.message));
  146. }
  147. export async function getCurrentList(data) {
  148. const res = await request.post('/eom/purchaseorder/getZtDetail', data);
  149. if (res.data.code == 0) {
  150. return res.data.data;
  151. }
  152. return Promise.reject(new Error(res.data.message));
  153. }
  154. // 齐套性检查
  155. export async function homogeneityInspectMerge(data) {
  156. const res = await request.post(
  157. `/aps/productionplan/homogeneityInspectMerge`,
  158. data
  159. );
  160. if (res.data.code == 0) {
  161. return res.data.data;
  162. }
  163. return Promise.reject(new Error(res.data.message));
  164. }
  165. // PBOM树
  166. export async function getBomRoot(data) {
  167. const res = await request.post(`/aps/productionplan/getBomRoot`, data);
  168. if (res.data.code == 0) {
  169. return res.data.data;
  170. }
  171. return Promise.reject(new Error(res.data.message));
  172. }
  173. // PBOM 齐套性检查
  174. export async function pbomHomogeneityInspect(data) {
  175. const res = await request.post(
  176. `/aps/productionplan/pbomHomogeneityInspect`,
  177. data
  178. );
  179. if (res.data.code == 0) {
  180. return res.data.data;
  181. }
  182. return Promise.reject(new Error(res.data.message));
  183. }
  184. export async function orderPbomHomogeneityInspect(data) {
  185. const res = await request.post(
  186. `/aps/productionplan/orderPbomHomogeneityInspect`,
  187. data
  188. );
  189. if (res.data.code == 0) {
  190. return res.data.data;
  191. }
  192. return Promise.reject(new Error(res.data.message));
  193. }
  194. export async function getPlanStatistics(params) {
  195. const res = await request.get('/aps/productionplan/getPlanStatistics', {
  196. params
  197. });
  198. if (res.data.code == 0) {
  199. return res.data.data;
  200. }
  201. return Promise.reject(new Error(res.data.message));
  202. }
  203. export async function getOrderBomRoot(data) {
  204. const res = await request.post(`/aps/productionplan/getOrderBomRoot`, data);
  205. if (res.data.code == 0) {
  206. return res.data.data;
  207. }
  208. return Promise.reject(new Error(res.data.message));
  209. }
  210. // 根据产品查询BOM分类
  211. export async function findBomCategoryByCategoryId(categoryId, produceType) {
  212. const res = await request.get(
  213. `/aps/productionplan/findBomCategoryByCategoryId/${categoryId}?produceType=${produceType}`
  214. );
  215. if (res.data.code == 0) {
  216. return res.data.data;
  217. }
  218. return Promise.reject(new Error(res.data.message));
  219. }
  220. // 根据计划id查询物料信息
  221. export async function findMaterialInfoByPlanId(params) {
  222. const res = await request.get(
  223. '/aps/productionplan/findMaterialInfoByPlanId',
  224. {
  225. params
  226. }
  227. );
  228. if (res.data.code == 0) {
  229. return res.data.data;
  230. }
  231. return Promise.reject(new Error(res.data.message));
  232. }
  233. // 根据产品查询BOM分类
  234. export async function findBomSalesorderCategoryId(categoryId, produceType) {
  235. const res = await request.get(
  236. `/aps/salesorder/findBomCategoryByCategoryId/${categoryId}?produceType=${produceType}`
  237. );
  238. if (res.data.code == 0) {
  239. return res.data.data;
  240. }
  241. return Promise.reject(new Error(res.data.message));
  242. }
  243. // 根据计划id查询物料信息
  244. export async function findMaterialInfoSalesorder(params) {
  245. const res = await request.get(
  246. '/aps/salesorder/findMaterialInfoBySalesOrderId',
  247. {
  248. params
  249. }
  250. );
  251. if (res.data.code == 0) {
  252. return res.data.data;
  253. }
  254. return Promise.reject(new Error(res.data.message));
  255. }
  256. // 根据产品ID查询物料信息
  257. export async function findMaterialInfoByCategory(params) {
  258. const res = await request.get(
  259. '/aps/salesorder/findMaterialInfoByCategoryId',
  260. {
  261. params
  262. }
  263. );
  264. if (res.data.code == 0) {
  265. return res.data.data;
  266. }
  267. return Promise.reject(new Error(res.data.message));
  268. }