index.js 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459
  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 getDoneTaskPage(query) {
  66. const res = await get(
  67. Vue.prototype.apiUrl + `/bpm/task/done-page`, query, true
  68. );
  69. if (res.code == 0) {
  70. return res.data;
  71. }
  72. return Promise.reject(new Error(res.message));
  73. }
  74. //获取已办事项列表
  75. export async function getDoneTaskList(query) {
  76. const res = await postJ(
  77. Vue.prototype.apiUrl + `/bpm/task/done-page`, query, true
  78. );
  79. if (res.code == 0) {
  80. return res.data;
  81. }
  82. return Promise.reject(new Error(res.message));
  83. }
  84. //获取流程详情
  85. export async function getTaskListByProcessinstanceid(query) {
  86. const res = await get(
  87. Vue.prototype.apiUrl + `/bpm/task/list-by-process-instance-id`, query, true
  88. );
  89. if (res.code == 0) {
  90. return res.data;
  91. }
  92. return Promise.reject(new Error(res.message));
  93. }
  94. //获取流程任务实例
  95. export async function getProcessInstance(id) {
  96. const res = await get(Vue.prototype.apiUrl + `/bpm/process-instance/get`, id, true)
  97. if (res.code == 0) {
  98. return res.data;
  99. }
  100. return Promise.reject(new Error(res.message));
  101. }
  102. export async function getTaskListByProcessInstanceId(processInstanceId) {
  103. const res = await get(Vue.prototype.apiUrl + `/bpm/task/list-by-process-instance-id`, processInstanceId, true)
  104. if (res.code == 0) {
  105. return res.data;
  106. }
  107. return Promise.reject(new Error(res.message));
  108. }
  109. // 通用流程审核接口
  110. export async function approveTaskWithVariables(data) {
  111. const res = await putJ(Vue.prototype.apiUrl + `/bpm/task/approveTaskWithVariables`, data, true)
  112. if (res.code == 0) {
  113. return res.data;
  114. }
  115. return Promise.reject(new Error(res.message));
  116. }
  117. /**
  118. *销售退货审批流程审核接口
  119. */
  120. export async function approveTaskSalesOrderReturn(params) {
  121. const res = await postJ(Vue.prototype.apiUrl + `/bpm/salesOrderReturnApprove/approve`, params, true)
  122. if (res.code == 0) {
  123. return res;
  124. }
  125. return Promise.reject(new Error(res.message));
  126. }
  127. //费用申请
  128. // 编辑
  129. export async function feeApplyUpdateAPI(data) {
  130. const res = await putJ(Vue.prototype.apiUrl + `/eom/finfeeapply/update`, data, true)
  131. if (res.code == 0) {
  132. return res.data;
  133. }
  134. return Promise.reject(new Error(res.message));
  135. }
  136. // 信息
  137. export async function getFeeApplyInfoAPI(id) {
  138. const res = await get(Vue.prototype.apiUrl + `/eom/finfeeapply/getById/${id}`, {}, true)
  139. if (res.code == 0) {
  140. return res.data;
  141. }
  142. return Promise.reject(new Error(res.message));
  143. }
  144. //
  145. //
  146. //
  147. //销售合同
  148. /**
  149. * 获取信息详情
  150. */
  151. export async function getDetail(id) {
  152. const res = await get(Vue.prototype.apiUrl + `/eom/contract/getById/${id}`, {}, true);
  153. if (res.code == 0) {
  154. return res.data;
  155. }
  156. return Promise.reject(new Error(res.message));
  157. }
  158. //
  159. //
  160. //
  161. //
  162. //客户申请
  163. /**
  164. * 客户申请列表
  165. */
  166. export async function contactApplyList(id) {
  167. const res = await get(Vue.prototype.apiUrl + `/eom/contactlistapply/getById/${id}`, {}, true);
  168. if (res.code == 0) {
  169. return res.data;
  170. }
  171. return Promise.reject(new Error(res.message));
  172. }
  173. //
  174. //
  175. //
  176. //
  177. //商机管理
  178. /**
  179. * /商机管理-获取信息详情
  180. */
  181. export async function getBusinessOpportunityDetailAPI(id) {
  182. const res = await get(Vue.prototype.apiUrl + `/eom/businessopportunity/getById/${id}`, {}, true);
  183. if (res.code == 0) {
  184. return res.data;
  185. }
  186. return Promise.reject(new Error(res.message));
  187. }
  188. /**
  189. * 更新信息
  190. */
  191. export async function businessOpportunityUpdateAPI(data) {
  192. const res = await postJ(Vue.prototype.apiUrl + `/eom/businessopportunity/updateProduct`, data, true);
  193. if (res.code == 0) {
  194. return res.data;
  195. }
  196. return Promise.reject(new Error(res.message));
  197. }
  198. //
  199. //
  200. //
  201. //
  202. //销售订单
  203. /**
  204. * /销售订单-获取信息详情
  205. */
  206. export async function getSaleOrderDetailAPI(id) {
  207. const res = await get(Vue.prototype.apiUrl + `/eom/saleorder/getById/${id}`, {}, true);
  208. if (res.code == 0) {
  209. return res.data;
  210. }
  211. return Promise.reject(new Error(res.message));
  212. }
  213. //
  214. //
  215. //
  216. //
  217. //销售退货单
  218. /**
  219. * /销售退货单-获取信息详情
  220. */
  221. export async function getSaleOrderReturnGetByIdAPI(id) {
  222. const res = await get(Vue.prototype.apiUrl + `/eom/saleorderreturnrecord/getById/${id}`, {}, true);
  223. if (res.code == 0) {
  224. return res.data;
  225. }
  226. return Promise.reject(new Error(res.message));
  227. }
  228. //
  229. //
  230. //
  231. //
  232. //获取发货单
  233. /**
  234. * /获取发货单信息详情-获取信息详情
  235. */
  236. export async function getSaleOrderSendRecordDetailAPI(id) {
  237. const res = await get(Vue.prototype.apiUrl + `/eom/saleordersendrecord/getById/${id}`, {}, true);
  238. if (res.code == 0) {
  239. return res.data;
  240. }
  241. return Promise.reject(new Error(res.message));
  242. }
  243. //
  244. //
  245. //
  246. //
  247. //获取仓库信息
  248. /**
  249. * /获取仓库信息
  250. */
  251. export async function getWarehouseListByIdsAPI(data) {
  252. const res = await postJ(Vue.prototype.apiUrl + `/wms/warehouse/getWarehouseListByIds`, data, true);
  253. if (res.code == 0) {
  254. return res.data;
  255. }
  256. return Promise.reject(new Error(res.message));
  257. }
  258. //
  259. //
  260. //
  261. //
  262. //
  263. //采购需求
  264. /**
  265. * /获取需求单信息
  266. */
  267. export async function getPurchaseRequirementByIdsAPI(id) {
  268. const res = await get(Vue.prototype.apiUrl + `/eom/purchaserequirement/getById/${id}`, {}, true);
  269. if (res.code == 0) {
  270. return res.data;
  271. }
  272. return Promise.reject(new Error(res.message));
  273. }
  274. //获取采购计划单信息
  275. export async function getPurchasePlanByIdsAPI(id) {
  276. const res = await get(Vue.prototype.apiUrl + `/eom/purchaseplan/getById/${id}`, {}, true);
  277. if (res.code == 0) {
  278. return res.data;
  279. }
  280. return Promise.reject(new Error(res.message));
  281. }
  282. /**
  283. * /新增采购需求负责人
  284. */
  285. export async function AssignPurchasePlanUserAPI(data) {
  286. const res = await postJ(Vue.prototype.apiUrl + `/bpm/purchasePlanApprove/assign`, data, true);
  287. if (res.code == 0) {
  288. return res.data;
  289. }
  290. return Promise.reject(new Error(res.message));
  291. }
  292. //
  293. //
  294. //
  295. //
  296. /**
  297. * /采购订单
  298. */
  299. //获取采购订单信息
  300. export async function purchaseOrderGetByIdAPI(id) {
  301. const res = await get(Vue.prototype.apiUrl + `/eom/purchaseorder/getById/${id}`, {}, true);
  302. if (res.code == 0) {
  303. return res.data;
  304. }
  305. return Promise.reject(new Error(res.message));
  306. }
  307. //
  308. //
  309. //
  310. //
  311. /**
  312. * /采购收货
  313. */
  314. //获取采购收货单信息
  315. export async function purchaseOrderReceiveGetByIdAPI(id) {
  316. const res = await get(Vue.prototype.apiUrl + `/eom/purchaseorderreceive/getById/${id}`, {}, true);
  317. if (res.code == 0) {
  318. return res.data;
  319. }
  320. return Promise.reject(new Error(res.message));
  321. }
  322. //
  323. //
  324. //
  325. //
  326. /**
  327. * /采购退货
  328. */
  329. //获取采购退货单信息
  330. export async function purchaseOrderReturnGetByIdAPI(id) {
  331. const res = await get(Vue.prototype.apiUrl + `/eom/purchaseorderreturn/getById/${id}`, {}, true);
  332. if (res.code == 0) {
  333. return res.data;
  334. }
  335. return Promise.reject(new Error(res.message));
  336. }
  337. //
  338. //
  339. //
  340. //
  341. /**
  342. * /量具送检
  343. */
  344. //查询量具送检信息
  345. export async function processById(params) {
  346. const res = await get(Vue.prototype.apiUrl + `/eam/planmaintenance/processById`, params);
  347. if (res.code == 0) {
  348. return res.data;
  349. }
  350. return Promise.reject(new Error(res.data.message));
  351. }
  352. //
  353. // 个人日志列表
  354. export async function getList(params) {
  355. const res = await get('/eom/planToolLog/list', params);
  356. if (res.data.code == 0) {
  357. return res.data;
  358. }
  359. return Promise.reject(new Error(res.data.message));
  360. }
  361. //
  362. //
  363. //
  364. //动态表单 工作流自定义权限过滤表单集合
  365. export async function getBpmCustomFormList(params) {
  366. const res = await get(Vue.prototype.apiUrl + '/flowable/bpmcustomform/list', params);
  367. if (res.code == 0) {
  368. return res.data;
  369. }
  370. return Promise.reject(new Error(res.data.message));
  371. };
  372. //动态表单 我发起的申请
  373. export async function getProcessInstancePage(params) {
  374. const res = await postJ(Vue.prototype.apiUrl + '/bpm/process-instance/my-page', 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 getProcessInstanceDeptPage(query) {
  382. const res = await get(Vue.prototype.apiUrl + '/bpm/process-instance/my-dept-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 getProcessInstanceNoticePage(data) {
  390. const res = await postJ(Vue.prototype.apiUrl + '/bpm/process-instance/my-notice-page', data);
  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 processInstanceCreateAPI(params, loding = true) {
  398. const res = await postJ(
  399. Vue.prototype.apiUrl + `/bpm/process-instance/create`, params, loding
  400. );
  401. if (res.code == 0) {
  402. return res.data;
  403. }
  404. return Promise.reject(new Error(res.message));
  405. }
  406. //流程列表
  407. export async function processInstancePage(params, loding = false) {
  408. const res = await get(
  409. Vue.prototype.apiUrl + `/bpm/model/page`, params, loding
  410. );
  411. if (res.code == 0) {
  412. return res.data;
  413. }
  414. return Promise.reject(new Error(res.message));
  415. }