index.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409
  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. * 删除
  79. */
  80. export async function factoryDelete(id) {
  81. const res = await request.delete(`/aps/productionplan/delete/${id}`);
  82. if (res.data.code == 0) {
  83. return res.data.data;
  84. }
  85. return Promise.reject(new Error(res.data.message));
  86. }
  87. // 拆分
  88. export async function splitWork(params) {
  89. const res = await request.post(`/aps/productionplan/splitBatch`, params);
  90. if (res.data.code == 0) {
  91. return res.data.data;
  92. }
  93. return Promise.reject(new Error(res.data.message));
  94. }
  95. // 计划合批
  96. export async function mergeBatch(params) {
  97. const res = await request.post(`/aps/productionplan/mergeBatch`, params);
  98. if (res.data.code == 0) {
  99. return res.data.data;
  100. }
  101. return Promise.reject(new Error(res.data.message));
  102. }
  103. // 修改优先级
  104. export async function updatePriority(data) {
  105. const res = await request.post(`/aps/productionplan/updatePriority`, data);
  106. if (res.data.code == 0) {
  107. return res.data.data;
  108. }
  109. return Promise.reject(new Error(res.data.message));
  110. }
  111. /**
  112. * 生产详情列表
  113. */
  114. export async function queryTaskDetail(data) {
  115. const res = await request.get(
  116. '/aps/quality_details_work_order/queryPlanId/' + data
  117. );
  118. if (res.data.code == 0) {
  119. return res.data.data;
  120. }
  121. return Promise.reject(new Error(res.data.message));
  122. }
  123. // 计划分解(获取产品BOM)
  124. export async function getBom(params) {
  125. const res = await request.get(`/main/bomCategory/getBom`, { params });
  126. if (res.data.code == 0) {
  127. return res.data.data;
  128. }
  129. return Promise.reject(new Error(res.data.message));
  130. }
  131. // 计划分解 (保存)
  132. export async function batchSave(data) {
  133. const res = await request.post(`/aps/productionplan/batchSave`, data);
  134. if (res.data.code == 0) {
  135. return res.data.data;
  136. }
  137. return Promise.reject(new Error(res.data.message));
  138. }
  139. // 计划分解 (保存并发布)
  140. export async function issueProductionPlan(data) {
  141. const res = await request.post(
  142. `/aps/productionplan/issueProductionPlan`,
  143. data
  144. );
  145. if (res.data.code == 0) {
  146. return res.data.data;
  147. }
  148. return Promise.reject(new Error(res.data.message));
  149. }
  150. // 齐套性检查
  151. export async function homogeneityInspect(data) {
  152. const res = await request.post(
  153. `/aps/productionplan/homogeneityInspect`,
  154. data
  155. );
  156. if (res.data.code == 0) {
  157. return res.data.data;
  158. }
  159. return Promise.reject(new Error(res.data.message));
  160. }
  161. export async function getStockList(params) {
  162. const res = await request.get('/wms/outindetailtwo/page', { params });
  163. if (res.data.code == 0) {
  164. return res.data.data;
  165. }
  166. return Promise.reject(new Error(res.data.message));
  167. }
  168. export async function getCurrentList(data) {
  169. const res = await request.post('/eom/purchaseorder/getZtDetail', data);
  170. if (res.data.code == 0) {
  171. return res.data.data;
  172. }
  173. return Promise.reject(new Error(res.data.message));
  174. }
  175. // 齐套性检查
  176. export async function homogeneityInspectMerge(data) {
  177. const res = await request.post(
  178. `/aps/productionplan/homogeneityInspectMerge`,
  179. data
  180. );
  181. if (res.data.code == 0) {
  182. return res.data.data;
  183. }
  184. return Promise.reject(new Error(res.data.message));
  185. }
  186. // PBOM树
  187. export async function getBomRoot(data) {
  188. const res = await request.post(`/aps/productionplan/getBomRoot`, data);
  189. if (res.data.code == 0) {
  190. return res.data.data;
  191. }
  192. return Promise.reject(new Error(res.data.message));
  193. }
  194. // PBOM 齐套性检查
  195. export async function pbomHomogeneityInspect(data) {
  196. const res = await request.post(
  197. `/aps/productionplan/pbomHomogeneityInspect`,
  198. data
  199. );
  200. if (res.data.code == 0) {
  201. return res.data.data;
  202. }
  203. return Promise.reject(new Error(res.data.message));
  204. }
  205. export async function orderPbomHomogeneityInspect(data) {
  206. const res = await request.post(
  207. `/aps/productionplan/orderPbomHomogeneityInspect`,
  208. data
  209. );
  210. if (res.data.code == 0) {
  211. return res.data.data;
  212. }
  213. return Promise.reject(new Error(res.data.message));
  214. }
  215. export async function getPlanStatistics(params) {
  216. const res = await request.get('/aps/productionplan/getPlanStatistics', {
  217. params
  218. });
  219. if (res.data.code == 0) {
  220. return res.data.data;
  221. }
  222. return Promise.reject(new Error(res.data.message));
  223. }
  224. export async function getOrderBomRoot(data) {
  225. const res = await request.post(`/aps/productionplan/getOrderBomRoot`, data);
  226. if (res.data.code == 0) {
  227. return res.data.data;
  228. }
  229. return Promise.reject(new Error(res.data.message));
  230. }
  231. // 根据产品查询BOM分类
  232. export async function findBomCategoryByCategoryIdV2(bomId, produceType) {
  233. const res = await request.get(
  234. `/aps/productionplan/findBomCategoryByCategoryId/v2/${bomId}?produceType=${produceType}`
  235. );
  236. if (res.data.code == 0) {
  237. return res.data.data;
  238. }
  239. return Promise.reject(new Error(res.data.message));
  240. }
  241. // 根据产品查询BOM分类
  242. export async function bomVersionList(params) {
  243. const res = await request.get(`/main/bomCategory/versionList`, { params });
  244. if (res.data.code == 0) {
  245. return res.data.data;
  246. }
  247. return Promise.reject(new Error(res.data.message));
  248. }
  249. // 根据产品查询bom类型
  250. export async function listBomType(params) {
  251. const res = await request.get(`/main/bomCategory/listBomType`, { params });
  252. if (res.data.code == 0) {
  253. return res.data.data;
  254. }
  255. return Promise.reject(new Error(res.data.message));
  256. }
  257. // 根据产品查询BOM分类
  258. export async function findBomCategoryByCategoryId(
  259. categoryId,
  260. produceType = ''
  261. ) {
  262. const res = await request.get(
  263. `/aps/productionplan/findBomCategoryByCategoryId/${categoryId}?produceType=${produceType}`
  264. );
  265. if (res.data.code == 0) {
  266. return res.data.data;
  267. }
  268. return Promise.reject(new Error(res.data.message));
  269. }
  270. // 根据计划id查询物料信息
  271. export async function findMaterialInfoByPlanId(params) {
  272. const res = await request.get(
  273. '/aps/productionplan/findMaterialInfoByPlanId',
  274. {
  275. params
  276. }
  277. );
  278. if (res.data.code == 0) {
  279. return res.data.data;
  280. }
  281. return Promise.reject(new Error(res.data.message));
  282. }
  283. // 根据产品查询BOM分类
  284. export async function findBomSalesorderCategoryIdV2(bomId, produceType) {
  285. const res = await request.get(
  286. `/aps/salesorder/findBomCategoryByCategoryId/v2/${bomId}?produceType=${produceType}`
  287. );
  288. if (res.data.code == 0) {
  289. return res.data.data;
  290. }
  291. return Promise.reject(new Error(res.data.message));
  292. }
  293. // 根据产品查询BOM分类
  294. export async function findBomSalesorderCategoryId(categoryId, produceType) {
  295. const res = await request.get(
  296. `/aps/salesorder/findBomCategoryByCategoryId/${categoryId}?produceType=${produceType}`
  297. );
  298. if (res.data.code == 0) {
  299. return res.data.data;
  300. }
  301. return Promise.reject(new Error(res.data.message));
  302. }
  303. // 根据计划id查询物料信息
  304. export async function findMaterialInfoSalesorder(params) {
  305. const res = await request.get(
  306. '/aps/salesorder/findMaterialInfoBySalesOrderId',
  307. {
  308. params
  309. }
  310. );
  311. if (res.data.code == 0) {
  312. return res.data.data;
  313. }
  314. return Promise.reject(new Error(res.data.message));
  315. }
  316. // 根据产品ID查询物料信息
  317. export async function findMaterialInfoByCategory(params) {
  318. const res = await request.get(
  319. '/aps/salesorder/findMaterialInfoByCategoryId',
  320. {
  321. params
  322. }
  323. );
  324. if (res.data.code == 0) {
  325. return res.data.data;
  326. }
  327. return Promise.reject(new Error(res.data.message));
  328. }
  329. // 根据产品ID查询物料信息
  330. export async function getProductKitting(params) {
  331. const res = await request.get('/aps/productionplan/getProductKitting', {
  332. params
  333. });
  334. if (res.data.code == 0) {
  335. return res.data.data;
  336. }
  337. return Promise.reject(new Error(res.data.message));
  338. }
  339. //发布计划是否需要审核
  340. export async function planIsReview(data) {
  341. const res = await request.post(
  342. `/aps/productionplan/releaseSaveByApproval`,
  343. data
  344. );
  345. if (res.data.code == 0) {
  346. return res.data.data;
  347. }
  348. return Promise.reject(new Error(res.data.message));
  349. }
  350. //生产前准备
  351. export async function completenessCheck(data) {
  352. const res = await request.post(`/aps/productionplan/preRelease`, data);
  353. if (res.data.code == 0) {
  354. return res.data.data;
  355. }
  356. return Promise.reject(new Error(res.data.message));
  357. }
  358. //任务派单
  359. export async function taskReleaseWork(data) {
  360. const res = await request.post(`/aps/assign/saveEventAssign`, data);
  361. if (res.data.code == 0) {
  362. return res.data.data;
  363. }
  364. return Promise.reject(new Error(res.data.message));
  365. }
  366. //任务齐套性检查
  367. export async function updatePreRelease(data) {
  368. const res = await request.post(`/aps/productionplan/updatePreRelease`, data);
  369. if (res.data.code == 0) {
  370. return res.data.data;
  371. }
  372. return Promise.reject(new Error(res.data.message));
  373. }
  374. //任务齐套性检查 订单
  375. export async function updatePreReleaseOrder(data) {
  376. const res = await request.post(`/aps/workorder/updatePreRelease`, data);
  377. if (res.data.code == 0) {
  378. return res.data.data;
  379. }
  380. return Promise.reject(new Error(res.data.message));
  381. }