index.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469
  1. import {
  2. get,
  3. put,
  4. putJ,
  5. postJ
  6. } from "@/utils/request";
  7. import Vue from "vue";
  8. //获取我的消息列表
  9. export async function notifyMessagePageAPI(params, loding = true) {
  10. const res = await postJ(
  11. Vue.prototype.apiUrl + `/sys/notifymessage/page`, params, loding
  12. );
  13. if (res.code == 0) {
  14. return res.data;
  15. }
  16. return Promise.reject(new Error(res.message));
  17. }
  18. //更新已读-指定消息ID
  19. export async function updateNotifyMessageReadByIdAPI(params, loding = true) {
  20. const res = await postJ(
  21. Vue.prototype.apiUrl + `/sys/notifymessage/updateNotifyMessageRead`, params, loding
  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 getUnreadNotifyMessageCountAPI() {
  30. const res = await get(
  31. Vue.prototype.apiUrl + `/sys/notifymessage/getUnreadNotifyMessageCount`, '', false
  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 getTodoTaskPage(query, loding = true) {
  40. const res = await postJ(
  41. Vue.prototype.apiUrl + `/bpm/task/todo-page`, query, loding
  42. );
  43. if (res.code == 0) {
  44. return res.data;
  45. }
  46. return Promise.reject(new Error(res.message));
  47. }
  48. export async function getTodoList(query, loding = true) {
  49. const res = await postJ(
  50. Vue.prototype.apiUrl + `/bpm/task/todo-page`, query, loding
  51. );
  52. if (res.code == 0) {
  53. return res.data;
  54. }
  55. return Promise.reject(new Error(res.message));
  56. }
  57. export async function rejectTask(data) {
  58. const res = await putJ(Vue.prototype.apiUrl + `/bpm/task/reject`, data, true)
  59. if (res.code == 0) {
  60. return res.data;
  61. }
  62. return Promise.reject(new Error(res.message));
  63. }
  64. // 作废
  65. export async function cancelTask(data) {
  66. const res = await postJ(Vue.prototype.apiUrl + `/bpm/process-instance/cancel`, data)
  67. if (res.code == 0) {
  68. return res.data;
  69. }
  70. return Promise.reject(new Error(res.message));
  71. }
  72. //获取已办事项列表
  73. export async function getDoneTaskPage(query) {
  74. const res = await get(
  75. Vue.prototype.apiUrl + `/bpm/task/done-page`, query, true
  76. );
  77. if (res.code == 0) {
  78. return res.data;
  79. }
  80. return Promise.reject(new Error(res.message));
  81. }
  82. //获取已办事项列表
  83. export async function getDoneTaskList(query) {
  84. const res = await postJ(
  85. Vue.prototype.apiUrl + `/bpm/task/done-page`, query, true
  86. );
  87. if (res.code == 0) {
  88. return res.data;
  89. }
  90. return Promise.reject(new Error(res.message));
  91. }
  92. //获取流程详情
  93. export async function getTaskListByProcessinstanceid(query) {
  94. const res = await get(
  95. Vue.prototype.apiUrl + `/bpm/task/list-by-process-instance-id`, query, true
  96. );
  97. if (res.code == 0) {
  98. return res.data;
  99. }
  100. return Promise.reject(new Error(res.message));
  101. }
  102. //获取流程任务实例
  103. export async function getProcessInstance(id) {
  104. const res = await get(Vue.prototype.apiUrl + `/bpm/process-instance/get`, id, true)
  105. if (res.code == 0) {
  106. return res.data;
  107. }
  108. return Promise.reject(new Error(res.message));
  109. }
  110. export async function getTaskListByProcessInstanceId(processInstanceId) {
  111. const res = await get(Vue.prototype.apiUrl + `/bpm/task/list-by-process-instance-id`, processInstanceId, true)
  112. if (res.code == 0) {
  113. return res.data;
  114. }
  115. return Promise.reject(new Error(res.message));
  116. }
  117. // 通用流程审核接口
  118. export async function approveTaskWithVariables(data) {
  119. const res = await putJ(Vue.prototype.apiUrl + `/bpm/task/approveTaskWithVariables`, data, true)
  120. if (res.code == 0) {
  121. return res.data;
  122. }
  123. return Promise.reject(new Error(res.message));
  124. }
  125. /**
  126. *销售退货审批流程审核接口
  127. */
  128. export async function approveTaskSalesOrderReturn(params) {
  129. const res = await postJ(Vue.prototype.apiUrl + `/bpm/salesOrderReturnApprove/approve`, params, true)
  130. if (res.code == 0) {
  131. return res;
  132. }
  133. return Promise.reject(new Error(res.message));
  134. }
  135. //费用申请
  136. // 编辑
  137. export async function feeApplyUpdateAPI(data) {
  138. const res = await putJ(Vue.prototype.apiUrl + `/eom/finfeeapply/update`, data, true)
  139. if (res.code == 0) {
  140. return res.data;
  141. }
  142. return Promise.reject(new Error(res.message));
  143. }
  144. // 信息
  145. export async function getFeeApplyInfoAPI(id) {
  146. const res = await get(Vue.prototype.apiUrl + `/eom/finfeeapply/getById/${id}`, {}, true)
  147. if (res.code == 0) {
  148. return res.data;
  149. }
  150. return Promise.reject(new Error(res.message));
  151. }
  152. //
  153. //
  154. //
  155. //销售合同
  156. /**
  157. * 获取信息详情
  158. */
  159. export async function getDetail(id) {
  160. const res = await get(Vue.prototype.apiUrl + `/eom/contract/getById/${id}`, {}, true);
  161. if (res.code == 0) {
  162. return res.data;
  163. }
  164. return Promise.reject(new Error(res.message));
  165. }
  166. //
  167. //
  168. //
  169. //
  170. //客户申请
  171. /**
  172. * 客户申请列表
  173. */
  174. export async function contactApplyList(id) {
  175. const res = await get(Vue.prototype.apiUrl + `/eom/contactlistapply/getById/${id}`, {}, true);
  176. if (res.code == 0) {
  177. return res.data;
  178. }
  179. return Promise.reject(new Error(res.message));
  180. }
  181. //
  182. //
  183. //
  184. //
  185. //商机管理
  186. /**
  187. * /商机管理-获取信息详情
  188. */
  189. export async function getBusinessOpportunityDetailAPI(id) {
  190. const res = await get(Vue.prototype.apiUrl + `/eom/businessopportunity/getById/${id}`, {}, true);
  191. if (res.code == 0) {
  192. return res.data;
  193. }
  194. return Promise.reject(new Error(res.message));
  195. }
  196. /**
  197. * 更新信息
  198. */
  199. export async function businessOpportunityUpdateAPI(data) {
  200. const res = await postJ(Vue.prototype.apiUrl + `/eom/businessopportunity/updateProduct`, data, true);
  201. if (res.code == 0) {
  202. return res.data;
  203. }
  204. return Promise.reject(new Error(res.message));
  205. }
  206. //
  207. //
  208. //
  209. //
  210. //销售订单
  211. /**
  212. * /销售订单-获取信息详情
  213. */
  214. export async function getSaleOrderDetailAPI(id) {
  215. const res = await get(Vue.prototype.apiUrl + `/eom/saleorder/getById/${id}`, {}, true);
  216. if (res.code == 0) {
  217. return res.data;
  218. }
  219. return Promise.reject(new Error(res.message));
  220. }
  221. //
  222. //
  223. //
  224. //
  225. //销售退货单
  226. /**
  227. * /销售退货单-获取信息详情
  228. */
  229. export async function getSaleOrderReturnGetByIdAPI(id) {
  230. const res = await get(Vue.prototype.apiUrl + `/eom/saleorderreturnrecord/getById/${id}`, {}, 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 getSaleOrderSendRecordDetailAPI(id) {
  245. const res = await get(Vue.prototype.apiUrl + `/eom/saleordersendrecord/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 getWarehouseListByIdsAPI(data) {
  260. const res = await postJ(Vue.prototype.apiUrl + `/wms/warehouse/getWarehouseListByIds`, data, 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. */
  275. export async function getPurchaseRequirementByIdsAPI(id) {
  276. const res = await get(Vue.prototype.apiUrl + `/eom/purchaserequirement/getById/${id}`, {}, true);
  277. if (res.code == 0) {
  278. return res.data;
  279. }
  280. return Promise.reject(new Error(res.message));
  281. }
  282. //获取采购计划单信息
  283. export async function getPurchasePlanByIdsAPI(id) {
  284. const res = await get(Vue.prototype.apiUrl + `/eom/purchaseplan/getById/${id}`, {}, true);
  285. if (res.code == 0) {
  286. return res.data;
  287. }
  288. return Promise.reject(new Error(res.message));
  289. }
  290. /**
  291. * /新增采购需求负责人
  292. */
  293. export async function AssignPurchasePlanUserAPI(data) {
  294. const res = await postJ(Vue.prototype.apiUrl + `/bpm/purchasePlanApprove/assign`, data, true);
  295. if (res.code == 0) {
  296. return res.data;
  297. }
  298. return Promise.reject(new Error(res.message));
  299. }
  300. //
  301. //
  302. //
  303. //
  304. /**
  305. * /采购订单
  306. */
  307. //获取采购订单信息
  308. export async function purchaseOrderGetByIdAPI(id) {
  309. const res = await get(Vue.prototype.apiUrl + `/eom/purchaseorder/getById/${id}`, {}, true);
  310. if (res.code == 0) {
  311. return res.data;
  312. }
  313. return Promise.reject(new Error(res.message));
  314. }
  315. //
  316. //
  317. //
  318. //
  319. /**
  320. * /采购收货
  321. */
  322. //获取采购收货单信息
  323. export async function purchaseOrderReceiveGetByIdAPI(id) {
  324. const res = await get(Vue.prototype.apiUrl + `/eom/purchaseorderreceive/getById/${id}`, {}, true);
  325. if (res.code == 0) {
  326. return res.data;
  327. }
  328. return Promise.reject(new Error(res.message));
  329. }
  330. //
  331. //
  332. //
  333. //
  334. /**
  335. * /采购退货
  336. */
  337. //获取采购退货单信息
  338. export async function purchaseOrderReturnGetByIdAPI(id) {
  339. const res = await get(Vue.prototype.apiUrl + `/eom/purchaseorderreturn/getById/${id}`, {}, true);
  340. if (res.code == 0) {
  341. return res.data;
  342. }
  343. return Promise.reject(new Error(res.message));
  344. }
  345. //
  346. //
  347. //
  348. //
  349. /**
  350. * /量具送检
  351. */
  352. //查询量具送检信息
  353. export async function processById(params) {
  354. const res = await get(Vue.prototype.apiUrl + `/eam/planmaintenance/processById`, params);
  355. if (res.code == 0) {
  356. return res.data;
  357. }
  358. return Promise.reject(new Error(res.data.message));
  359. }
  360. //
  361. // 个人日志列表
  362. export async function getList(params) {
  363. const res = await get('/eom/planToolLog/list', params);
  364. if (res.data.code == 0) {
  365. return res.data;
  366. }
  367. return Promise.reject(new Error(res.data.message));
  368. }
  369. //
  370. //
  371. //
  372. //动态表单 工作流自定义权限过滤表单集合
  373. export async function getBpmCustomFormList(params) {
  374. const res = await get(Vue.prototype.apiUrl + '/flowable/bpmcustomform/list', params);
  375. if (res.code == 0) {
  376. return res.data;
  377. }
  378. return Promise.reject(new Error(res.data.message));
  379. };
  380. //动态表单 我发起的申请
  381. export async function getProcessInstancePage(params) {
  382. const res = await postJ(Vue.prototype.apiUrl + '/bpm/process-instance/my-page', params);
  383. if (res.code == 0) {
  384. return res.data;
  385. }
  386. return Promise.reject(new Error(res.data.message));
  387. };
  388. //动态表单 部门发起的申请
  389. export async function getProcessInstanceDeptPage(query) {
  390. const res = await get(Vue.prototype.apiUrl + '/bpm/process-instance/my-dept-page', params);
  391. if (res.code == 0) {
  392. return res.data;
  393. }
  394. return Promise.reject(new Error(res.data.message));
  395. };
  396. //动态表单 通知我的申请
  397. export async function getProcessInstanceNoticePage(data) {
  398. const res = await postJ(Vue.prototype.apiUrl + '/bpm/process-instance/my-notice-page', data);
  399. if (res.code == 0) {
  400. return res.data;
  401. }
  402. return Promise.reject(new Error(res.data.message));
  403. };
  404. //发起流程通用接口
  405. export async function processInstanceCreateAPI(params, loding = true) {
  406. const res = await postJ(
  407. Vue.prototype.apiUrl + `/bpm/process-instance/create`, params, loding
  408. );
  409. if (res.code == 0) {
  410. return res.data;
  411. }
  412. return Promise.reject(new Error(res.message));
  413. }
  414. //流程列表
  415. export async function processInstancePage(params, loding = false) {
  416. const res = await get(
  417. Vue.prototype.apiUrl + `/bpm/model/page`, params, loding
  418. );
  419. if (res.code == 0) {
  420. return res.data;
  421. }
  422. return Promise.reject(new Error(res.message));
  423. }