index.js 10 KB

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