index.js 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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. }