index.js 11 KB

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