index.js 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  1. import {
  2. get,
  3. put,
  4. putJ,
  5. postJ
  6. } from "@/utils/request";
  7. import Vue from "vue";
  8. //获取待办事项列表
  9. export async function getTodoTaskPage(query, loding = true) {
  10. const res = await get(
  11. Vue.prototype.apiUrl + `/bpm/task/todo-page`, query, loding
  12. );
  13. if (res.code == 0) {
  14. return res.data;
  15. }
  16. return Promise.reject(new Error(res.message));
  17. }
  18. //获取已办事项列表
  19. export async function getDoneTaskPage(query) {
  20. const res = await get(
  21. Vue.prototype.apiUrl + `/bpm/task/done-page`, query, true
  22. );
  23. if (res.code == 0) {
  24. return res.data;
  25. }
  26. return Promise.reject(new Error(res.message));
  27. }
  28. //获取流程详情
  29. export async function getTaskListByProcessinstanceid(query) {
  30. const res = await get(
  31. Vue.prototype.apiUrl + `/bpm/task/list-by-process-instance-id`, query, true
  32. );
  33. if (res.code == 0) {
  34. return res.data;
  35. }
  36. return Promise.reject(new Error(res.message));
  37. }
  38. //获取流程任务实例
  39. export async function getProcessInstance(id) {
  40. const res = await get(Vue.prototype.apiUrl + `/bpm/process-instance/get`, id, true)
  41. if (res.code == 0) {
  42. return res.data;
  43. }
  44. return Promise.reject(new Error(res.message));
  45. }
  46. export async function getTaskListByProcessInstanceId(processInstanceId) {
  47. const res = await get(Vue.prototype.apiUrl + `/bpm/task/list-by-process-instance-id`, processInstanceId, true)
  48. if (res.code == 0) {
  49. return res.data;
  50. }
  51. return Promise.reject(new Error(res.message));
  52. }
  53. // 通用流程审核接口
  54. export async function approveTaskWithVariables(data) {
  55. const res = await putJ(Vue.prototype.apiUrl + `/bpm/task/approveTaskWithVariables`, data, true)
  56. if (res.code == 0) {
  57. return res.data;
  58. }
  59. return Promise.reject(new Error(res.message));
  60. }
  61. /**
  62. *销售退货审批流程审核接口
  63. */
  64. export async function approveTaskSalesOrderReturn(params) {
  65. const res = await postJ(Vue.prototype.apiUrl + `/bpm/salesOrderReturnApprove/approve`, params, true)
  66. if (res.code == 0) {
  67. return res;
  68. }
  69. return Promise.reject(new Error(res.message));
  70. }
  71. //费用申请
  72. // 编辑
  73. export async function feeApplyUpdateAPI(data) {
  74. const res = await putJ(Vue.prototype.apiUrl + `/eom/finfeeapply/update`, data, true)
  75. if (res.code == 0) {
  76. return res.data;
  77. }
  78. return Promise.reject(new Error(res.message));
  79. }
  80. // 信息
  81. export async function getFeeApplyInfoAPI(id) {
  82. const res = await get(Vue.prototype.apiUrl + `/eom/finfeeapply/getById/${id}`, {}, true)
  83. if (res.code == 0) {
  84. return res.data;
  85. }
  86. return Promise.reject(new Error(res.message));
  87. }
  88. //
  89. //
  90. //
  91. //销售合同
  92. /**
  93. * 获取信息详情
  94. */
  95. export async function getDetail(id) {
  96. const res = await get(Vue.prototype.apiUrl + `/eom/contract/getById/${id}`, {}, true);
  97. if (res.code == 0) {
  98. return res.data;
  99. }
  100. return Promise.reject(new Error(res.message));
  101. }
  102. //
  103. //
  104. //
  105. //
  106. //客户申请
  107. /**
  108. * 客户申请列表
  109. */
  110. export async function contactApplyList(id) {
  111. const res = await get(Vue.prototype.apiUrl + `/eom/contactlistapply/getById/${id}`, {}, true);
  112. if (res.code == 0) {
  113. return res.data;
  114. }
  115. return Promise.reject(new Error(res.message));
  116. }
  117. //
  118. //
  119. //
  120. //
  121. //商机管理
  122. /**
  123. * /商机管理-获取信息详情
  124. */
  125. export async function getBusinessOpportunityDetailAPI(id) {
  126. const res = await get(Vue.prototype.apiUrl + `/eom/businessopportunity/getById/${id}`, {}, true);
  127. if (res.code == 0) {
  128. return res.data;
  129. }
  130. return Promise.reject(new Error(res.message));
  131. }
  132. /**
  133. * 更新信息
  134. */
  135. export async function businessOpportunityUpdateAPI(data) {
  136. const res = await postJ(Vue.prototype.apiUrl + `/eom/businessopportunity/updateProduct`, data, true);
  137. if (res.code == 0) {
  138. return res.data;
  139. }
  140. return Promise.reject(new Error(res.message));
  141. }
  142. //
  143. //
  144. //
  145. //
  146. //销售订单
  147. /**
  148. * /销售订单-获取信息详情
  149. */
  150. export async function getSaleOrderDetailAPI(id) {
  151. const res = await get(Vue.prototype.apiUrl + `/eom/saleorder/getById/${id}`, {}, true);
  152. if (res.code == 0) {
  153. return res.data;
  154. }
  155. return Promise.reject(new Error(res.message));
  156. }
  157. //
  158. //
  159. //
  160. //
  161. //销售退货单
  162. /**
  163. * /销售退货单-获取信息详情
  164. */
  165. export async function getSaleOrderReturnGetByIdAPI(id) {
  166. const res = await get(Vue.prototype.apiUrl + `/eom/saleorderreturnrecord/getById/${id}`, {}, true);
  167. if (res.code == 0) {
  168. return res.data;
  169. }
  170. return Promise.reject(new Error(res.message));
  171. }
  172. //
  173. //
  174. //
  175. //
  176. //获取发货单
  177. /**
  178. * /获取发货单信息详情-获取信息详情
  179. */
  180. export async function getSaleOrderSendRecordDetailAPI(id) {
  181. const res = await get(Vue.prototype.apiUrl + `/eom/saleordersendrecord/getById/${id}`, {}, true);
  182. if (res.code == 0) {
  183. return res.data;
  184. }
  185. return Promise.reject(new Error(res.message));
  186. }
  187. //
  188. //
  189. //
  190. //
  191. //获取仓库信息
  192. /**
  193. * /获取仓库信息
  194. */
  195. export async function getWarehouseListByIdsAPI(data) {
  196. const res = await postJ(Vue.prototype.apiUrl + `/wms/warehouse/getWarehouseListByIds`, data, true);
  197. if (res.code == 0) {
  198. return res.data;
  199. }
  200. return Promise.reject(new Error(res.message));
  201. }
  202. //
  203. //
  204. //
  205. //
  206. //
  207. //采购需求
  208. /**
  209. * /获取需求单信息
  210. */
  211. export async function getPurchaseRequirementByIdsAPI(id) {
  212. const res = await get(Vue.prototype.apiUrl + `/eom/purchaserequirement/getById/${id}`, {}, true);
  213. if (res.code == 0) {
  214. return res.data;
  215. }
  216. return Promise.reject(new Error(res.message));
  217. }
  218. //获取采购计划单信息
  219. export async function getPurchasePlanByIdsAPI(id) {
  220. const res = await get(Vue.prototype.apiUrl + `/eom/purchaseplan/getById/${id}`, {}, true);
  221. if (res.code == 0) {
  222. return res.data;
  223. }
  224. return Promise.reject(new Error(res.message));
  225. }
  226. /**
  227. * /新增采购需求负责人
  228. */
  229. export async function AssignPurchasePlanUserAPI(data) {
  230. const res = await postJ(Vue.prototype.apiUrl + `/bpm/purchasePlanApprove/assign`, data, true);
  231. if (res.code == 0) {
  232. return res.data;
  233. }
  234. return Promise.reject(new Error(res.message));
  235. }
  236. //
  237. //
  238. //
  239. //
  240. /**
  241. * /采购订单
  242. */
  243. //获取采购订单信息
  244. export async function purchaseOrderGetByIdAPI(id) {
  245. const res = await get(Vue.prototype.apiUrl + `/eom/purchaseorder/getById/${id}`, {}, true);
  246. if (res.code == 0) {
  247. return res.data;
  248. }
  249. return Promise.reject(new Error(res.message));
  250. }
  251. //
  252. //
  253. //
  254. //
  255. /**
  256. * /采购收货
  257. */
  258. //获取采购收货单信息
  259. export async function purchaseOrderReceiveGetByIdAPI(id) {
  260. const res = await get(Vue.prototype.apiUrl + `/eom/purchaseorderreceive/getById/${id}`, {}, true);
  261. if (res.code == 0) {
  262. return res.data;
  263. }
  264. return Promise.reject(new Error(res.message));
  265. }
  266. //
  267. //
  268. //
  269. //
  270. /**
  271. * /采购退货
  272. */
  273. //获取采购退货单信息
  274. export async function purchaseOrderReturnGetByIdAPI(id) {
  275. const res = await get(Vue.prototype.apiUrl + `/eom/purchaseorderreturn/getById/${id}`, {}, true);
  276. if (res.code == 0) {
  277. return res.data;
  278. }
  279. return Promise.reject(new Error(res.message));
  280. }
  281. //
  282. //
  283. //
  284. //
  285. /**
  286. * /量具送检
  287. */
  288. //查询量具送检信息
  289. export async function processById(params) {
  290. const res = await get(Vue.prototype.apiUrl + `/eam/planmaintenance/processById`, params );
  291. if (res.code == 0) {
  292. return res.data;
  293. }
  294. return Promise.reject(new Error(res.data.message));
  295. }
  296. //
  297. // 个人日志列表
  298. export async function getList(params) {
  299. const res = await get('/eom/planToolLog/list', params );
  300. if (res.data.code == 0) {
  301. return res.data;
  302. }
  303. return Promise.reject(new Error(res.data.message));
  304. }
  305. //
  306. //
  307. //