index.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428
  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. 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. export async function submitInsideTwo(data) {
  183. const res = await postJ(Vue.prototype.apiUrl + `/bpm/outApprove/submitInsideTwo`, data)
  184. if (res.code == 0) {
  185. return res.data
  186. }
  187. return Promise.reject(new Error(res.message))
  188. }
  189. // 出入库申请列表通过入库申请单查询详情
  190. export async function getApplystoragedetail(params) {
  191. const res = await get(Vue.prototype.apiUrl + `/wms/applystoragedetail/list`, params)
  192. if (res.code == 0) {
  193. return res.data
  194. }
  195. return Promise.reject(new Error(res.message))
  196. }
  197. // 出入库申请列表
  198. export async function getinboundRequestsList(params) {
  199. const res = await get(Vue.prototype.apiUrl + `/wms/applystorage/page`, params)
  200. if (res.code == 0) {
  201. return res.data
  202. }
  203. return Promise.reject(new Error(res.message))
  204. }
  205. // 库内调拨列表
  206. export async function getAllotApplyPage(params) {
  207. const res = await get(Vue.prototype.apiUrl + `/wms/allotApply/page`, params)
  208. if (res.code == 0) {
  209. return res.data
  210. }
  211. return Promise.reject(new Error(res.message))
  212. }
  213. // 仓库树
  214. export async function getWarehouseTrees(params) {
  215. const res = await get(Vue.prototype.apiUrl + `/wms/warehouse/getTrees`, params)
  216. if (res.code == 0) {
  217. return res.data
  218. }
  219. return Promise.reject(new Error(res.message))
  220. }
  221. // 调拨保存
  222. export async function allotApplySave(data) {
  223. const res = await postJ(Vue.prototype.apiUrl + `/wms/allotApply/save`, data)
  224. if (res.code == 0) {
  225. return res.data
  226. }
  227. return Promise.reject(new Error(res.message))
  228. }
  229. // 库内调拨详情列表
  230. export async function getAllotDetailList(params) {
  231. const res = await get(Vue.prototype.apiUrl + `/wms/allotDetail/list`, params)
  232. if (res.code == 0) {
  233. return res.data
  234. }
  235. return Promise.reject(new Error(res.message))
  236. }
  237. // 库内调拨详情
  238. export async function getAllotDetail(id) {
  239. const res = await get(Vue.prototype.apiUrl + `/wms/allotApply/getById/${id}`)
  240. if (res.code == 0) {
  241. return res.data
  242. }
  243. return Promise.reject(new Error(res.message))
  244. }
  245. // 盘点工单列表
  246. export async function getPlanOrderList(params) {
  247. const res = await get(Vue.prototype.apiUrl + '/wms/planOrder/page', params)
  248. if (res.code == 0) {
  249. return res.data
  250. }
  251. return Promise.reject(new Error(res.message))
  252. }
  253. // 盘点工单物品详情
  254. export async function getPlanDetailList(params) {
  255. const res = await get(Vue.prototype.apiUrl + '/wms/plandetail/page', params)
  256. if (res.code == 0) {
  257. return res.data
  258. }
  259. return Promise.reject(new Error(res.message))
  260. }
  261. // 盘点报工
  262. export async function reportWork(data, id) {
  263. console.log(data)
  264. const res = await postJ(Vue.prototype.apiUrl + '/wms/planOrder/reportWork?planOrderId=' + id, data)
  265. if (res.code == 0) {
  266. return res.data
  267. }
  268. return Promise.reject(new Error(res.message))
  269. }
  270. // 盘点工单详情
  271. export async function getOrderInfoByPlanId(params) {
  272. const res = await get(Vue.prototype.apiUrl + '/wms/plan/getOrderInfoByPlanId', params)
  273. if (res.code == 0) {
  274. return res.data
  275. }
  276. return Promise.reject(new Error(res.message))
  277. }
  278. // 报损报溢列表
  279. export async function getReportList(params) {
  280. const res = await get(Vue.prototype.apiUrl + '/wms/plandetail/list', params)
  281. if (res.code == 0) {
  282. return res.data
  283. }
  284. return Promise.reject(new Error(res.message))
  285. }
  286. // 报损报溢列表
  287. export async function getPlanProfitLoss(params) {
  288. const res = await get(Vue.prototype.apiUrl + '/wms/planProfitLoss/page', params)
  289. if (res.code == 0) {
  290. return res.data
  291. }
  292. return Promise.reject(new Error(res.message))
  293. }
  294. // 报损报溢保存
  295. export async function saveReportsList(data) {
  296. const res = await postJ(Vue.prototype.apiUrl + '/wms/planProfitLoss/save', data)
  297. if (res.code == 0) {
  298. return res.data
  299. }
  300. return Promise.reject(new Error(res.message))
  301. }
  302. // 获取临时盘点计划详情
  303. export async function getReportPlanDetailById(id) {
  304. const res = await get(Vue.prototype.apiUrl + '/wms/planProfitLoss/getById/' + id)
  305. if (res.code == 0) {
  306. return res.data
  307. }
  308. return Promise.reject(new Error(res.message))
  309. }
  310. // 拣货列表
  311. export async function getPickgoodsList(params) {
  312. const res = await get(Vue.prototype.apiUrl + '/wms/pickgoods/page', params)
  313. if (res.code == 0) {
  314. return res.data
  315. }
  316. return Promise.reject(new Error(res.message))
  317. }
  318. // 通过包装编码获取包装详情
  319. export async function outInGoodsPackingList(data) {
  320. const res = await postJ(Vue.prototype.apiUrl + '/wms/outInDetailRecordTwo/outInGoodsPackingList', data)
  321. if (res.code == 0) {
  322. return res.data
  323. }
  324. return Promise.reject(new Error(res.message))
  325. }
  326. // 库存台账调拨
  327. export async function getAllotDetails(params) {
  328. const res = await get(Vue.prototype.apiUrl + `/wms/allotDetail/page`, params)
  329. if (res.code == 0) {
  330. return res.data
  331. }
  332. return Promise.reject(new Error(res.message))
  333. }
  334. // 库存台账盘点
  335. export async function getPlandetails(params) {
  336. const res = await get(Vue.prototype.apiUrl + `/wms/plandetail/page`, params)
  337. if (res.code == 0) {
  338. return res.data
  339. }
  340. return Promise.reject(new Error(res.message))
  341. }
  342. // 保存拣货单
  343. export async function savePickgoods(data) {
  344. const res = await postJ(Vue.prototype.apiUrl + '/wms/pickgoods/save', data)
  345. if (res.code == 0) {
  346. return res.data
  347. }
  348. return Promise.reject(new Error(res.message))
  349. }
  350. // 通过物品编码查询物品详情
  351. export async function getDetailsByCode(code) {
  352. const res = await get(Vue.prototype.apiUrl + `/main/category/getByCode/${code}`)
  353. if (res.code == 0) {
  354. return res.data
  355. }
  356. return Promise.reject(new Error(res.message))
  357. }
  358. // 验证是否重复入库
  359. export async function isVerifyRepeatIsStock(data) {
  360. const res = await postJ(Vue.prototype.apiUrl + `/wms/outindetailtwo/isVerifyRepeatIsStock`, data)
  361. if (res.code == 0) {
  362. return res.data
  363. }
  364. return Promise.reject(new Error(res.message))
  365. }
  366. // 生产入库申请驳回
  367. export async function notPass(data) {
  368. const res = await postJ(Vue.prototype.apiUrl + `/bpm/inwarehouse/notPass`, data)
  369. if (res.code == 0) {
  370. return res.data
  371. }
  372. return Promise.reject(new Error(res.message))
  373. }
  374. // 根据编码批量获取物品信息
  375. export async function getListByNameOrModeType(data) {
  376. const res = await postJ(Vue.prototype.apiUrl + `/main/category/getListByNameOrModeType`, data)
  377. if (res.code == 0) {
  378. return res.data
  379. }
  380. return Promise.reject(new Error(res.message))
  381. }