index.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439
  1. import { postJ, post, get, putJ } from '@/utils/request'
  2. import Vue from 'vue'
  3. // 获取仓库列表
  4. export async function getWarehouseList() {
  5. const res = await postJ(Vue.prototype.apiUrl + `/wms/warehouse/getWarehouseList`, {})
  6. if (res.code == 0) {
  7. return res
  8. }
  9. return Promise.reject(new Error(res.message))
  10. }
  11. // 根据type查分类树组
  12. export async function getProduceTreeByPid(data) {
  13. const res = await get(Vue.prototype.apiUrl + `/main/categoryLevel/getProduceTreeByPid`, data)
  14. if (res.code == 0) {
  15. return res.data
  16. }
  17. return Promise.reject(new Error(res.message))
  18. }
  19. // 物品维度台账列表
  20. export async function getProductList(data) {
  21. console.log(data)
  22. const res = await get(Vue.prototype.apiUrl + `/wms/outindetailtwo/page`, data)
  23. if (res.code == 0) {
  24. return res.data
  25. }
  26. return Promise.reject(new Error(res.message))
  27. }
  28. // 批次维度台账列表
  29. export async function getBatchList(data) {
  30. console.log(data)
  31. const res = await get(Vue.prototype.apiUrl + `/wms/outindetailtwo/batchPage`, data)
  32. if (res.code == 0) {
  33. return res.data
  34. }
  35. return Promise.reject(new Error(res.message))
  36. }
  37. // 包装维度台账列表
  38. export async function getPackingList(data) {
  39. const res = await get(Vue.prototype.apiUrl + `/wms/outInDetailRecordTwo/page`, data)
  40. if (res.code == 0) {
  41. return res.data
  42. }
  43. return Promise.reject(new Error(res.message))
  44. }
  45. // 包装维度流水
  46. export async function outInRecordsPage(data) {
  47. const res = await get(Vue.prototype.apiUrl + `/wms/outInDetailRecordTwo/outInRecordsPage`, data)
  48. if (res.code == 0) {
  49. return res.data
  50. }
  51. return Promise.reject(new Error(res.message))
  52. }
  53. // 获取出入库台账
  54. export async function getOutInList(data) {
  55. const res = await get(Vue.prototype.apiUrl + `/wms/outintwo/page`, data)
  56. if (res.code == 0) {
  57. return res.data
  58. }
  59. return Promise.reject(new Error(res.message))
  60. }
  61. // 根据type查分类树组
  62. export async function getTreeByGroup(data) {
  63. const res = await get(Vue.prototype.apiUrl + `/main/categoryLevel/getProduceTreeByPid`, data)
  64. if (res.code == 0) {
  65. return res.data
  66. }
  67. return Promise.reject(new Error(res.message))
  68. }
  69. // 根据ids查询物品分类
  70. export async function getTreeByIds(data) {
  71. const res = await get(Vue.prototype.apiUrl + `/pda/main/categoryLevel/pdaTreeByPid`, data)
  72. if (res.code == 0) {
  73. return res.data
  74. }
  75. return Promise.reject(new Error(res.message))
  76. }
  77. // 获取物品分类列表
  78. export async function getCategoryList(data) {
  79. console.log(data)
  80. const res = await get(Vue.prototype.apiUrl + `/main/category/getList`, data)
  81. if (res.code == 0) {
  82. return res.data
  83. }
  84. return Promise.reject(new Error(res.message))
  85. }
  86. // 生成编码
  87. export async function getCode(code) {
  88. const res = await get(Vue.prototype.apiUrl + `/main/codemanage/getCode/${code}`)
  89. if (res.code == 0) {
  90. return res.data
  91. }
  92. return Promise.reject(new Error(res.message))
  93. }
  94. // 通过物品id获取供货商列表
  95. export async function contactQueryByCategoryIdsAPI(data) {
  96. const res = await postJ(Vue.prototype.apiUrl + `/eom/contact/queryByCategoryIds`, data)
  97. if (res.code == 0) {
  98. return res.data
  99. }
  100. return Promise.reject(new Error(res.message))
  101. }
  102. // 根据物品ID获取包装维度
  103. export async function getCategoryPackageDisposition(data) {
  104. const res = await postJ(Vue.prototype.apiUrl + `/main/categoryPackageDisposition/list`, data)
  105. if (res.code == 0) {
  106. return res.data
  107. }
  108. return Promise.reject(new Error(res.message))
  109. }
  110. // 批量获取包装编码
  111. export async function getAssetNum(data) {
  112. const res = await postJ(Vue.prototype.apiUrl + `/wms/outintwo/getAssetNum`, data)
  113. if (res.code == 0) {
  114. return res
  115. }
  116. return Promise.reject(new Error(res.message))
  117. }
  118. // 入库
  119. export async function storage(data) {
  120. const res = await postJ(Vue.prototype.apiUrl + `/wms/outintwo/inStorage`, data)
  121. if (res.code == 0) {
  122. return res
  123. }
  124. return Promise.reject(new Error(res.message))
  125. }
  126. // 提交质检流程
  127. export async function qualityInspectionTwo(data) {
  128. const res = await postJ(Vue.prototype.apiUrl + `/bpm/outinApprove/qualityInspectionTwo`, data)
  129. if (res.code == 0) {
  130. return res
  131. }
  132. return Promise.reject(new Error(res.message))
  133. }
  134. // 提交流程(入库)
  135. export async function submitTwo(data) {
  136. const res = await postJ(Vue.prototype.apiUrl + `/bpm/outinApprove/submitTwo`, data)
  137. if (res.code == 0) {
  138. return res
  139. }
  140. return Promise.reject(new Error(res.message))
  141. }
  142. // 获取入库详情
  143. export async function getInboundDetailsById(id) {
  144. const res = await get(Vue.prototype.apiUrl + `/wms/outintwo/getById/${id}`)
  145. if (res.code == 0) {
  146. return res.data
  147. }
  148. return Promise.reject(new Error(res.message))
  149. }
  150. // 获取入库详情(出库单号)
  151. export async function getInboundDetailsByBizNo(id) {
  152. const res = await get(Vue.prototype.apiUrl + `/wms/outintwo/getInfoByBizNo/${id}`)
  153. if (res.code == 0) {
  154. return res.data
  155. }
  156. return Promise.reject(new Error(res.message))
  157. }
  158. // 通过台账id获取出库物品详情
  159. export async function getHierarchyList(params) {
  160. const res = await get(Vue.prototype.apiUrl + `/wms/outintwo/getHierarchyList`, params)
  161. if (res.code == 0) {
  162. return res.data
  163. }
  164. return Promise.reject(new Error(res.message))
  165. }
  166. export async function getHierarchyFifo(data) {
  167. const res = await postJ(Vue.prototype.apiUrl + `/wms/outintwo/getHierarchyFifo`, data)
  168. if (res.code == 0) {
  169. return res.data
  170. }
  171. return Promise.reject(new Error(res.message))
  172. }
  173. // 出库
  174. export async function outStorage(data) {
  175. const res = await postJ(Vue.prototype.apiUrl + `/wms/outintwo/outStorage`, data)
  176. if (res.code == 0) {
  177. return res
  178. }
  179. return Promise.reject(new Error(res.message))
  180. }
  181. /**
  182. * 更新发货单信息
  183. */
  184. export async function updateSendInformation(data) {
  185. const res = await putJ(Vue.prototype.apiUrl + `/eom/saleordersendrecord/update`, data);
  186. if(res.code == 0) {
  187. return res.data;
  188. }
  189. return Promise.reject(new Error(res.message))
  190. }
  191. // 提交流程(出库)
  192. export async function submitInsideTwo(data) {
  193. const res = await postJ(Vue.prototype.apiUrl + `/bpm/outApprove/submitInsideTwo`, data)
  194. if (res.code == 0) {
  195. return res.data
  196. }
  197. return Promise.reject(new Error(res.message))
  198. }
  199. // 出入库申请列表通过入库申请单查询详情
  200. export async function getApplystoragedetail(params) {
  201. const res = await get(Vue.prototype.apiUrl + `/wms/applystoragedetail/list`, params)
  202. if (res.code == 0) {
  203. return res.data
  204. }
  205. return Promise.reject(new Error(res.message))
  206. }
  207. // 出入库申请列表
  208. export async function getinboundRequestsList(params) {
  209. const res = await get(Vue.prototype.apiUrl + `/wms/applystorage/page`, params)
  210. if (res.code == 0) {
  211. return res.data
  212. }
  213. return Promise.reject(new Error(res.message))
  214. }
  215. // 库内调拨列表
  216. export async function getAllotApplyPage(params) {
  217. const res = await get(Vue.prototype.apiUrl + `/wms/allotApply/page`, params)
  218. if (res.code == 0) {
  219. return res.data
  220. }
  221. return Promise.reject(new Error(res.message))
  222. }
  223. // 仓库树
  224. export async function getWarehouseTrees(params) {
  225. const res = await get(Vue.prototype.apiUrl + `/wms/warehouse/getTrees`, params)
  226. if (res.code == 0) {
  227. return res.data
  228. }
  229. return Promise.reject(new Error(res.message))
  230. }
  231. // 调拨保存
  232. export async function allotApplySave(data) {
  233. const res = await postJ(Vue.prototype.apiUrl + `/wms/allotApply/save`, data)
  234. if (res.code == 0) {
  235. return res.data
  236. }
  237. return Promise.reject(new Error(res.message))
  238. }
  239. // 库内调拨详情列表
  240. export async function getAllotDetailList(params) {
  241. const res = await get(Vue.prototype.apiUrl + `/wms/allotDetail/list`, params)
  242. if (res.code == 0) {
  243. return res.data
  244. }
  245. return Promise.reject(new Error(res.message))
  246. }
  247. // 库内调拨详情
  248. export async function getAllotDetail(id) {
  249. const res = await get(Vue.prototype.apiUrl + `/wms/allotApply/getById/${id}`)
  250. if (res.code == 0) {
  251. return res.data
  252. }
  253. return Promise.reject(new Error(res.message))
  254. }
  255. // 盘点工单列表
  256. export async function getPlanOrderList(params) {
  257. const res = await get(Vue.prototype.apiUrl + '/wms/planOrder/page', params)
  258. if (res.code == 0) {
  259. return res.data
  260. }
  261. return Promise.reject(new Error(res.message))
  262. }
  263. // 盘点工单物品详情
  264. export async function getPlanDetailList(params) {
  265. const res = await get(Vue.prototype.apiUrl + '/wms/plandetail/page', params)
  266. if (res.code == 0) {
  267. return res.data
  268. }
  269. return Promise.reject(new Error(res.message))
  270. }
  271. // 盘点报工
  272. export async function reportWork(data, id) {
  273. console.log(data)
  274. const res = await postJ(Vue.prototype.apiUrl + '/wms/planOrder/reportWork?planOrderId=' + id, data)
  275. if (res.code == 0) {
  276. return res.data
  277. }
  278. return Promise.reject(new Error(res.message))
  279. }
  280. // 盘点工单详情
  281. export async function getOrderInfoByPlanId(params) {
  282. const res = await get(Vue.prototype.apiUrl + '/wms/plan/getOrderInfoByPlanId', params)
  283. if (res.code == 0) {
  284. return res.data
  285. }
  286. return Promise.reject(new Error(res.message))
  287. }
  288. // 报损报溢列表
  289. export async function getReportList(params) {
  290. const res = await get(Vue.prototype.apiUrl + '/wms/plandetail/list', params)
  291. if (res.code == 0) {
  292. return res.data
  293. }
  294. return Promise.reject(new Error(res.message))
  295. }
  296. // 报损报溢列表
  297. export async function getPlanProfitLoss(params) {
  298. const res = await get(Vue.prototype.apiUrl + '/wms/planProfitLoss/page', params)
  299. if (res.code == 0) {
  300. return res.data
  301. }
  302. return Promise.reject(new Error(res.message))
  303. }
  304. // 报损报溢保存
  305. export async function saveReportsList(data) {
  306. const res = await postJ(Vue.prototype.apiUrl + '/wms/planProfitLoss/save', data)
  307. if (res.code == 0) {
  308. return res.data
  309. }
  310. return Promise.reject(new Error(res.message))
  311. }
  312. // 获取临时盘点计划详情
  313. export async function getReportPlanDetailById(id) {
  314. const res = await get(Vue.prototype.apiUrl + '/wms/planProfitLoss/getById/' + id)
  315. if (res.code == 0) {
  316. return res.data
  317. }
  318. return Promise.reject(new Error(res.message))
  319. }
  320. // 拣货列表
  321. export async function getPickgoodsList(params) {
  322. const res = await get(Vue.prototype.apiUrl + '/wms/pickgoods/page', params)
  323. if (res.code == 0) {
  324. return res.data
  325. }
  326. return Promise.reject(new Error(res.message))
  327. }
  328. // 通过包装编码获取包装详情
  329. export async function outInGoodsPackingList(data) {
  330. const res = await postJ(Vue.prototype.apiUrl + '/wms/outInDetailRecordTwo/outInGoodsPackingList', data)
  331. if (res.code == 0) {
  332. return res.data
  333. }
  334. return Promise.reject(new Error(res.message))
  335. }
  336. // 库存台账调拨
  337. export async function getAllotDetails(params) {
  338. const res = await get(Vue.prototype.apiUrl + `/wms/allotDetail/page`, params)
  339. if (res.code == 0) {
  340. return res.data
  341. }
  342. return Promise.reject(new Error(res.message))
  343. }
  344. // 库存台账盘点
  345. export async function getPlandetails(params) {
  346. const res = await get(Vue.prototype.apiUrl + `/wms/plandetail/page`, params)
  347. if (res.code == 0) {
  348. return res.data
  349. }
  350. return Promise.reject(new Error(res.message))
  351. }
  352. // 保存拣货单
  353. export async function savePickgoods(data) {
  354. const res = await postJ(Vue.prototype.apiUrl + '/wms/pickgoods/save', data)
  355. if (res.code == 0) {
  356. return res.data
  357. }
  358. return Promise.reject(new Error(res.message))
  359. }
  360. // 通过物品编码查询物品详情
  361. export async function getDetailsByCode(code) {
  362. const res = await get(Vue.prototype.apiUrl + `/main/category/getByCode/${code}`)
  363. if (res.code == 0) {
  364. return res.data
  365. }
  366. return Promise.reject(new Error(res.message))
  367. }
  368. // 验证是否重复入库
  369. export async function isVerifyRepeatIsStock(data) {
  370. const res = await postJ(Vue.prototype.apiUrl + `/wms/outindetailtwo/isVerifyRepeatIsStock`, data)
  371. if (res.code == 0) {
  372. return res.data
  373. }
  374. return Promise.reject(new Error(res.message))
  375. }
  376. // 生产入库申请驳回
  377. export async function notPass(data) {
  378. const res = await postJ(Vue.prototype.apiUrl + `/bpm/inwarehouse/notPass`, data)
  379. if (res.code == 0) {
  380. return res.data
  381. }
  382. return Promise.reject(new Error(res.message))
  383. }
  384. // 根据编码批量获取物品信息
  385. export async function getListByNameOrModeType(data) {
  386. const res = await postJ(Vue.prototype.apiUrl + `/main/category/getListByNameOrModeType`, data)
  387. if (res.code == 0) {
  388. return res.data
  389. }
  390. return Promise.reject(new Error(res.message))
  391. }