index.js 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453
  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 get(
  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. //获取已办事项列表
  58. export async function getDoneTaskPage(query) {
  59. const res = await get(
  60. Vue.prototype.apiUrl + `/bpm/task/done-page`, query, true
  61. );
  62. if (res.code == 0) {
  63. return res.data;
  64. }
  65. return Promise.reject(new Error(res.message));
  66. }
  67. //获取已办事项列表
  68. export async function getDoneTaskList(query) {
  69. const res = await postJ(
  70. Vue.prototype.apiUrl + `/bpm/task/done-page`, query, true
  71. );
  72. if (res.code == 0) {
  73. return res.data;
  74. }
  75. return Promise.reject(new Error(res.message));
  76. }
  77. //获取流程详情
  78. export async function getTaskListByProcessinstanceid(query) {
  79. const res = await get(
  80. Vue.prototype.apiUrl + `/bpm/task/list-by-process-instance-id`, query, true
  81. );
  82. if (res.code == 0) {
  83. return res.data;
  84. }
  85. return Promise.reject(new Error(res.message));
  86. }
  87. //获取流程任务实例
  88. export async function getProcessInstance(id) {
  89. const res = await get(Vue.prototype.apiUrl + `/bpm/process-instance/get`, id, true)
  90. if (res.code == 0) {
  91. return res.data;
  92. }
  93. return Promise.reject(new Error(res.message));
  94. }
  95. export async function getTaskListByProcessInstanceId(processInstanceId) {
  96. const res = await get(Vue.prototype.apiUrl + `/bpm/task/list-by-process-instance-id`, processInstanceId, true)
  97. if (res.code == 0) {
  98. return res.data;
  99. }
  100. return Promise.reject(new Error(res.message));
  101. }
  102. // 通用流程审核接口
  103. export async function approveTaskWithVariables(data) {
  104. const res = await putJ(Vue.prototype.apiUrl + `/bpm/task/approveTaskWithVariables`, data, true)
  105. if (res.code == 0) {
  106. return res.data;
  107. }
  108. return Promise.reject(new Error(res.message));
  109. }
  110. /**
  111. *销售退货审批流程审核接口
  112. */
  113. export async function approveTaskSalesOrderReturn(params) {
  114. const res = await postJ(Vue.prototype.apiUrl + `/bpm/salesOrderReturnApprove/approve`, params, true)
  115. if (res.code == 0) {
  116. return res;
  117. }
  118. return Promise.reject(new Error(res.message));
  119. }
  120. //费用申请
  121. // 编辑
  122. export async function feeApplyUpdateAPI(data) {
  123. const res = await putJ(Vue.prototype.apiUrl + `/eom/finfeeapply/update`, data, true)
  124. if (res.code == 0) {
  125. return res.data;
  126. }
  127. return Promise.reject(new Error(res.message));
  128. }
  129. // 信息
  130. export async function getFeeApplyInfoAPI(id) {
  131. const res = await get(Vue.prototype.apiUrl + `/eom/finfeeapply/getById/${id}`, {}, true)
  132. if (res.code == 0) {
  133. return res.data;
  134. }
  135. return Promise.reject(new Error(res.message));
  136. }
  137. //
  138. //
  139. //
  140. //销售合同
  141. /**
  142. * 获取信息详情
  143. */
  144. export async function getDetail(id) {
  145. const res = await get(Vue.prototype.apiUrl + `/eom/contract/getById/${id}`, {}, true);
  146. if (res.code == 0) {
  147. return res.data;
  148. }
  149. return Promise.reject(new Error(res.message));
  150. }
  151. //
  152. //
  153. //
  154. //
  155. //客户申请
  156. /**
  157. * 客户申请列表
  158. */
  159. export async function contactApplyList(id) {
  160. const res = await get(Vue.prototype.apiUrl + `/eom/contactlistapply/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 getBusinessOpportunityDetailAPI(id) {
  175. const res = await get(Vue.prototype.apiUrl + `/eom/businessopportunity/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. export async function businessOpportunityUpdateAPI(data) {
  185. const res = await postJ(Vue.prototype.apiUrl + `/eom/businessopportunity/updateProduct`, data, true);
  186. if (res.code == 0) {
  187. return res.data;
  188. }
  189. return Promise.reject(new Error(res.message));
  190. }
  191. //
  192. //
  193. //
  194. //
  195. //销售订单
  196. /**
  197. * /销售订单-获取信息详情
  198. */
  199. export async function getSaleOrderDetailAPI(id) {
  200. const res = await get(Vue.prototype.apiUrl + `/eom/saleorder/getById/${id}`, {}, 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 getSaleOrderReturnGetByIdAPI(id) {
  215. const res = await get(Vue.prototype.apiUrl + `/eom/saleorderreturnrecord/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 getSaleOrderSendRecordDetailAPI(id) {
  230. const res = await get(Vue.prototype.apiUrl + `/eom/saleordersendrecord/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 getWarehouseListByIdsAPI(data) {
  245. const res = await postJ(Vue.prototype.apiUrl + `/wms/warehouse/getWarehouseListByIds`, data, 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. */
  260. export async function getPurchaseRequirementByIdsAPI(id) {
  261. const res = await get(Vue.prototype.apiUrl + `/eom/purchaserequirement/getById/${id}`, {}, true);
  262. if (res.code == 0) {
  263. return res.data;
  264. }
  265. return Promise.reject(new Error(res.message));
  266. }
  267. //获取采购计划单信息
  268. export async function getPurchasePlanByIdsAPI(id) {
  269. const res = await get(Vue.prototype.apiUrl + `/eom/purchaseplan/getById/${id}`, {}, true);
  270. if (res.code == 0) {
  271. return res.data;
  272. }
  273. return Promise.reject(new Error(res.message));
  274. }
  275. /**
  276. * /新增采购需求负责人
  277. */
  278. export async function AssignPurchasePlanUserAPI(data) {
  279. const res = await postJ(Vue.prototype.apiUrl + `/bpm/purchasePlanApprove/assign`, data, true);
  280. if (res.code == 0) {
  281. return res.data;
  282. }
  283. return Promise.reject(new Error(res.message));
  284. }
  285. //
  286. //
  287. //
  288. //
  289. /**
  290. * /采购订单
  291. */
  292. //获取采购订单信息
  293. export async function purchaseOrderGetByIdAPI(id) {
  294. const res = await get(Vue.prototype.apiUrl + `/eom/purchaseorder/getById/${id}`, {}, 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 purchaseOrderReceiveGetByIdAPI(id) {
  309. const res = await get(Vue.prototype.apiUrl + `/eom/purchaseorderreceive/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 purchaseOrderReturnGetByIdAPI(id) {
  324. const res = await get(Vue.prototype.apiUrl + `/eom/purchaseorderreturn/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 processById(params) {
  339. const res = await get(Vue.prototype.apiUrl + `/eam/planmaintenance/processById`, params );
  340. if (res.code == 0) {
  341. return res.data;
  342. }
  343. return Promise.reject(new Error(res.data.message));
  344. }
  345. //
  346. // 个人日志列表
  347. export async function getList(params) {
  348. const res = await get('/eom/planToolLog/list', params );
  349. if (res.data.code == 0) {
  350. return res.data;
  351. }
  352. return Promise.reject(new Error(res.data.message));
  353. }
  354. //
  355. //
  356. //
  357. //动态表单 工作流自定义权限过滤表单集合
  358. export async function getBpmCustomFormList(params) {
  359. const res = await get(Vue.prototype.apiUrl + '/flowable/bpmcustomform/list', params );
  360. if (res.code == 0) {
  361. return res.data;
  362. }
  363. return Promise.reject(new Error(res.data.message));
  364. };
  365. //动态表单 我发起的申请
  366. export async function getProcessInstancePage(params) {
  367. const res = await postJ(Vue.prototype.apiUrl + '/bpm/process-instance/my-page', params );
  368. if (res.code == 0) {
  369. return res.data;
  370. }
  371. return Promise.reject(new Error(res.data.message));
  372. };
  373. //动态表单 部门发起的申请
  374. export async function getProcessInstanceDeptPage(query) {
  375. const res = await get(Vue.prototype.apiUrl + '/bpm/process-instance/my-dept-page', params );
  376. if (res.code == 0) {
  377. return res.data;
  378. }
  379. return Promise.reject(new Error(res.data.message));
  380. };
  381. //动态表单 通知我的申请
  382. export async function getProcessInstanceNoticePage(data) {
  383. const res = await postJ(Vue.prototype.apiUrl + '/bpm/process-instance/my-notice-page', data );
  384. if (res.code == 0) {
  385. return res.data;
  386. }
  387. return Promise.reject(new Error(res.data.message));
  388. };
  389. //发起流程通用接口
  390. export async function processInstanceCreateAPI(params, loding = true) {
  391. const res = await postJ(
  392. Vue.prototype.apiUrl + `/bpm/process-instance/create`, params, loding
  393. );
  394. if (res.code == 0) {
  395. return res.data;
  396. }
  397. return Promise.reject(new Error(res.message));
  398. }
  399. //流程列表
  400. export async function processInstancePage(params, loding = false) {
  401. const res = await get(
  402. Vue.prototype.apiUrl + `/bpm/model/page`, params, loding
  403. );
  404. if (res.code == 0) {
  405. return res.data;
  406. }
  407. return Promise.reject(new Error(res.message));
  408. }