index.js 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405
  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. //获取已办事项列表
  49. export async function getDoneTaskPage(query) {
  50. const res = await get(
  51. Vue.prototype.apiUrl + `/bpm/task/done-page`, query, true
  52. );
  53. if (res.code == 0) {
  54. return res.data;
  55. }
  56. return Promise.reject(new Error(res.message));
  57. }
  58. //获取流程详情
  59. export async function getTaskListByProcessinstanceid(query) {
  60. const res = await get(
  61. Vue.prototype.apiUrl + `/bpm/task/list-by-process-instance-id`, query, true
  62. );
  63. if (res.code == 0) {
  64. return res.data;
  65. }
  66. return Promise.reject(new Error(res.message));
  67. }
  68. //获取流程任务实例
  69. export async function getProcessInstance(id) {
  70. const res = await get(Vue.prototype.apiUrl + `/bpm/process-instance/get`, id, true)
  71. if (res.code == 0) {
  72. return res.data;
  73. }
  74. return Promise.reject(new Error(res.message));
  75. }
  76. export async function getTaskListByProcessInstanceId(processInstanceId) {
  77. const res = await get(Vue.prototype.apiUrl + `/bpm/task/list-by-process-instance-id`, processInstanceId, true)
  78. if (res.code == 0) {
  79. return res.data;
  80. }
  81. return Promise.reject(new Error(res.message));
  82. }
  83. // 通用流程审核接口
  84. export async function approveTaskWithVariables(data) {
  85. const res = await putJ(Vue.prototype.apiUrl + `/bpm/task/approveTaskWithVariables`, data, true)
  86. if (res.code == 0) {
  87. return res.data;
  88. }
  89. return Promise.reject(new Error(res.message));
  90. }
  91. /**
  92. *销售退货审批流程审核接口
  93. */
  94. export async function approveTaskSalesOrderReturn(params) {
  95. const res = await postJ(Vue.prototype.apiUrl + `/bpm/salesOrderReturnApprove/approve`, params, true)
  96. if (res.code == 0) {
  97. return res;
  98. }
  99. return Promise.reject(new Error(res.message));
  100. }
  101. //费用申请
  102. // 编辑
  103. export async function feeApplyUpdateAPI(data) {
  104. const res = await putJ(Vue.prototype.apiUrl + `/eom/finfeeapply/update`, data, true)
  105. if (res.code == 0) {
  106. return res.data;
  107. }
  108. return Promise.reject(new Error(res.message));
  109. }
  110. // 信息
  111. export async function getFeeApplyInfoAPI(id) {
  112. const res = await get(Vue.prototype.apiUrl + `/eom/finfeeapply/getById/${id}`, {}, true)
  113. if (res.code == 0) {
  114. return res.data;
  115. }
  116. return Promise.reject(new Error(res.message));
  117. }
  118. //
  119. //
  120. //
  121. //销售合同
  122. /**
  123. * 获取信息详情
  124. */
  125. export async function getDetail(id) {
  126. const res = await get(Vue.prototype.apiUrl + `/eom/contract/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. //
  136. //客户申请
  137. /**
  138. * 客户申请列表
  139. */
  140. export async function contactApplyList(id) {
  141. const res = await get(Vue.prototype.apiUrl + `/eom/contactlistapply/getById/${id}`, {}, true);
  142. if (res.code == 0) {
  143. return res.data;
  144. }
  145. return Promise.reject(new Error(res.message));
  146. }
  147. //
  148. //
  149. //
  150. //
  151. //商机管理
  152. /**
  153. * /商机管理-获取信息详情
  154. */
  155. export async function getBusinessOpportunityDetailAPI(id) {
  156. const res = await get(Vue.prototype.apiUrl + `/eom/businessopportunity/getById/${id}`, {}, true);
  157. if (res.code == 0) {
  158. return res.data;
  159. }
  160. return Promise.reject(new Error(res.message));
  161. }
  162. /**
  163. * 更新信息
  164. */
  165. export async function businessOpportunityUpdateAPI(data) {
  166. const res = await postJ(Vue.prototype.apiUrl + `/eom/businessopportunity/updateProduct`, data, 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 getSaleOrderDetailAPI(id) {
  181. const res = await get(Vue.prototype.apiUrl + `/eom/saleorder/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 getSaleOrderReturnGetByIdAPI(id) {
  196. const res = await get(Vue.prototype.apiUrl + `/eom/saleorderreturnrecord/getById/${id}`, {}, 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. export async function getSaleOrderSendRecordDetailAPI(id) {
  211. const res = await get(Vue.prototype.apiUrl + `/eom/saleordersendrecord/getById/${id}`, {}, true);
  212. if (res.code == 0) {
  213. return res.data;
  214. }
  215. return Promise.reject(new Error(res.message));
  216. }
  217. //
  218. //
  219. //
  220. //
  221. //获取仓库信息
  222. /**
  223. * /获取仓库信息
  224. */
  225. export async function getWarehouseListByIdsAPI(data) {
  226. const res = await postJ(Vue.prototype.apiUrl + `/wms/warehouse/getWarehouseListByIds`, data, true);
  227. if (res.code == 0) {
  228. return res.data;
  229. }
  230. return Promise.reject(new Error(res.message));
  231. }
  232. //
  233. //
  234. //
  235. //
  236. //
  237. //采购需求
  238. /**
  239. * /获取需求单信息
  240. */
  241. export async function getPurchaseRequirementByIdsAPI(id) {
  242. const res = await get(Vue.prototype.apiUrl + `/eom/purchaserequirement/getById/${id}`, {}, true);
  243. if (res.code == 0) {
  244. return res.data;
  245. }
  246. return Promise.reject(new Error(res.message));
  247. }
  248. //获取采购计划单信息
  249. export async function getPurchasePlanByIdsAPI(id) {
  250. const res = await get(Vue.prototype.apiUrl + `/eom/purchaseplan/getById/${id}`, {}, true);
  251. if (res.code == 0) {
  252. return res.data;
  253. }
  254. return Promise.reject(new Error(res.message));
  255. }
  256. /**
  257. * /新增采购需求负责人
  258. */
  259. export async function AssignPurchasePlanUserAPI(data) {
  260. const res = await postJ(Vue.prototype.apiUrl + `/bpm/purchasePlanApprove/assign`, 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. export async function purchaseOrderGetByIdAPI(id) {
  275. const res = await get(Vue.prototype.apiUrl + `/eom/purchaseorder/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 purchaseOrderReceiveGetByIdAPI(id) {
  290. const res = await get(Vue.prototype.apiUrl + `/eom/purchaseorderreceive/getById/${id}`, {}, true);
  291. if (res.code == 0) {
  292. return res.data;
  293. }
  294. return Promise.reject(new Error(res.message));
  295. }
  296. //
  297. //
  298. //
  299. //
  300. /**
  301. * /采购退货
  302. */
  303. //获取采购退货单信息
  304. export async function purchaseOrderReturnGetByIdAPI(id) {
  305. const res = await get(Vue.prototype.apiUrl + `/eom/purchaseorderreturn/getById/${id}`, {}, true);
  306. if (res.code == 0) {
  307. return res.data;
  308. }
  309. return Promise.reject(new Error(res.message));
  310. }
  311. //
  312. //
  313. //
  314. //
  315. /**
  316. * /量具送检
  317. */
  318. //查询量具送检信息
  319. export async function processById(params) {
  320. const res = await get(Vue.prototype.apiUrl + `/eam/planmaintenance/processById`, params );
  321. if (res.code == 0) {
  322. return res.data;
  323. }
  324. return Promise.reject(new Error(res.data.message));
  325. }
  326. //
  327. // 个人日志列表
  328. export async function getList(params) {
  329. const res = await get('/eom/planToolLog/list', params );
  330. if (res.data.code == 0) {
  331. return res.data;
  332. }
  333. return Promise.reject(new Error(res.data.message));
  334. }
  335. //
  336. //
  337. //
  338. //动态表单 工作流自定义权限过滤表单集合
  339. export async function getBpmCustomFormList(params) {
  340. const res = await get(Vue.prototype.apiUrl + '/flowable/bpmcustomform/list', params );
  341. if (res.code == 0) {
  342. return res.data;
  343. }
  344. return Promise.reject(new Error(res.data.message));
  345. };
  346. //动态表单 我发起的申请
  347. export async function getProcessInstancePage(params) {
  348. const res = await get(Vue.prototype.apiUrl + '/bpm/process-instance/my-page', params );
  349. if (res.code == 0) {
  350. return res.data;
  351. }
  352. return Promise.reject(new Error(res.data.message));
  353. };
  354. //动态表单 部门发起的申请
  355. export async function getProcessInstanceDeptPage(query) {
  356. const res = await get(Vue.prototype.apiUrl + '/bpm/process-instance/my-dept-page', params );
  357. if (res.code == 0) {
  358. return res.data;
  359. }
  360. return Promise.reject(new Error(res.data.message));
  361. };
  362. //动态表单 通知我的申请
  363. export async function getProcessInstanceNoticePage(data) {
  364. const res = await postJ(Vue.prototype.apiUrl + '/bpm/process-instance/my-notice-page', data );
  365. if (res.code == 0) {
  366. return res.data;
  367. }
  368. return Promise.reject(new Error(res.data.message));
  369. };