index.js 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697
  1. import { get, put, putJ, postJ } from "@/utils/request";
  2. import Vue from "vue";
  3. //获取我的消息列表
  4. export async function notifyMessagePageAPI(params, loding = true) {
  5. const res = await postJ(
  6. Vue.prototype.apiUrl + `/sys/notifymessage/page`,
  7. params,
  8. loding,
  9. );
  10. if (res.code == 0) {
  11. return res.data;
  12. }
  13. return Promise.reject(new Error(res.message));
  14. }
  15. //更新已读-指定消息ID
  16. export async function updateNotifyMessageReadByIdAPI(params, loding = true) {
  17. const res = await postJ(
  18. Vue.prototype.apiUrl + `/sys/notifymessage/updateNotifyMessageRead`,
  19. params,
  20. loding,
  21. );
  22. if (res.code == 0) {
  23. return res.data;
  24. }
  25. return Promise.reject(new Error(res.message));
  26. }
  27. //获取某用户的未读消息条数
  28. export async function getUnreadNotifyMessageCountAPI() {
  29. const res = await get(
  30. Vue.prototype.apiUrl + `/sys/notifymessage/getUnreadNotifyMessageCount`,
  31. "",
  32. false,
  33. );
  34. if (res.code == 0) {
  35. return res.data;
  36. }
  37. return Promise.reject(new Error(res.message));
  38. }
  39. //获取待办事项列表
  40. export async function getTodoTaskPage(query, loding = true) {
  41. const res = await postJ(
  42. Vue.prototype.apiUrl + `/bpm/task/todo-page`,
  43. query,
  44. loding,
  45. );
  46. if (res.code == 0) {
  47. return res.data;
  48. }
  49. return Promise.reject(new Error(res.message));
  50. }
  51. export async function getTodoList(query, loding = true) {
  52. const res = await postJ(
  53. Vue.prototype.apiUrl + `/bpm/task/todo-page`,
  54. query,
  55. loding,
  56. );
  57. if (res.code == 0) {
  58. return res.data;
  59. }
  60. return Promise.reject(new Error(res.message));
  61. }
  62. export async function rejectTask(data) {
  63. const res = await putJ(Vue.prototype.apiUrl + `/bpm/task/reject`, data, true);
  64. if (res.code == 0) {
  65. return res.data;
  66. }
  67. return Promise.reject(new Error(res.message));
  68. }
  69. // 作废
  70. export async function cancelTask(data) {
  71. const res = await postJ(
  72. Vue.prototype.apiUrl + `/bpm/process-instance/cancel`,
  73. data,
  74. );
  75. if (res.code == 0) {
  76. return res.data;
  77. }
  78. return Promise.reject(new Error(res.message));
  79. }
  80. //获取已办事项列表
  81. export async function getDoneTaskPage(query) {
  82. const res = await get(
  83. Vue.prototype.apiUrl + `/bpm/task/done-page`,
  84. query,
  85. 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 getDoneTaskList(query) {
  94. const res = await postJ(
  95. Vue.prototype.apiUrl + `/bpm/task/done-page`,
  96. query,
  97. true,
  98. );
  99. if (res.code == 0) {
  100. return res.data;
  101. }
  102. return Promise.reject(new Error(res.message));
  103. }
  104. //获取流程详情
  105. export async function getTaskListByProcessinstanceid(query) {
  106. const res = await get(
  107. Vue.prototype.apiUrl + `/bpm/task/list-by-process-instance-id`,
  108. query,
  109. true,
  110. );
  111. if (res.code == 0) {
  112. return res.data;
  113. }
  114. return Promise.reject(new Error(res.message));
  115. }
  116. //获取流程任务实例
  117. export async function getProcessInstance(id) {
  118. const res = await get(
  119. Vue.prototype.apiUrl + `/bpm/process-instance/get`,
  120. id,
  121. true,
  122. );
  123. if (res.code == 0) {
  124. return res.data;
  125. }
  126. return Promise.reject(new Error(res.message));
  127. }
  128. export async function getTaskListByProcessInstanceId(processInstanceId) {
  129. const res = await get(
  130. Vue.prototype.apiUrl + `/bpm/task/list-by-process-instance-id`,
  131. processInstanceId,
  132. true,
  133. );
  134. if (res.code == 0) {
  135. return res.data;
  136. }
  137. return Promise.reject(new Error(res.message));
  138. }
  139. // 通用流程审核接口
  140. export async function approveTaskWithVariables(data) {
  141. const res = await putJ(
  142. Vue.prototype.apiUrl + `/bpm/task/approveTaskWithVariables`,
  143. data,
  144. true,
  145. );
  146. if (res.code == 0) {
  147. return res.data;
  148. }
  149. return Promise.reject(new Error(res.message));
  150. }
  151. /**
  152. *销售退货审批流程审核接口
  153. */
  154. export async function approveTaskSalesOrderReturn(params) {
  155. const res = await postJ(
  156. Vue.prototype.apiUrl + `/bpm/salesOrderReturnApprove/approve`,
  157. params,
  158. true,
  159. );
  160. if (res.code == 0) {
  161. return res;
  162. }
  163. return Promise.reject(new Error(res.message));
  164. }
  165. //费用申请
  166. // 编辑
  167. export async function feeApplyUpdateAPI(data) {
  168. const res = await putJ(
  169. Vue.prototype.apiUrl + `/eom/finfeeapply/update`,
  170. data,
  171. true,
  172. );
  173. if (res.code == 0) {
  174. return res.data;
  175. }
  176. return Promise.reject(new Error(res.message));
  177. }
  178. // 信息
  179. export async function getFeeApplyInfoAPI(id) {
  180. const res = await get(
  181. Vue.prototype.apiUrl + `/eom/finfeeapply/getById/${id}`,
  182. {},
  183. true,
  184. );
  185. if (res.code == 0) {
  186. return res.data;
  187. }
  188. return Promise.reject(new Error(res.message));
  189. }
  190. //
  191. //
  192. //
  193. //销售合同
  194. /**
  195. * 获取信息详情
  196. */
  197. export async function getDetail(id) {
  198. const res = await get(
  199. Vue.prototype.apiUrl + `/eom/contract/getById/${id}`,
  200. {},
  201. true,
  202. );
  203. if (res.code == 0) {
  204. return res.data;
  205. }
  206. return Promise.reject(new Error(res.message));
  207. }
  208. //
  209. //
  210. //
  211. //
  212. //客户申请
  213. /**
  214. * 客户申请列表
  215. */
  216. export async function contactApplyList(id) {
  217. const res = await get(
  218. Vue.prototype.apiUrl + `/eom/contactlistapply/getById/${id}`,
  219. {},
  220. true,
  221. );
  222. if (res.code == 0) {
  223. return res.data;
  224. }
  225. return Promise.reject(new Error(res.message));
  226. }
  227. //
  228. //
  229. //
  230. //
  231. //商机管理
  232. /**
  233. * /商机管理-获取信息详情
  234. */
  235. export async function getBusinessOpportunityDetailAPI(id) {
  236. const res = await get(
  237. Vue.prototype.apiUrl + `/eom/businessopportunity/getById/${id}`,
  238. {},
  239. true,
  240. );
  241. if (res.code == 0) {
  242. return res.data;
  243. }
  244. return Promise.reject(new Error(res.message));
  245. }
  246. /**
  247. * 更新信息
  248. */
  249. export async function businessOpportunityUpdateAPI(data) {
  250. const res = await postJ(
  251. Vue.prototype.apiUrl + `/eom/businessopportunity/updateProduct`,
  252. data,
  253. true,
  254. );
  255. if (res.code == 0) {
  256. return res.data;
  257. }
  258. return Promise.reject(new Error(res.message));
  259. }
  260. //
  261. //
  262. //
  263. //
  264. //销售订单
  265. /**
  266. * /销售订单-获取信息详情
  267. */
  268. export async function getSaleOrderDetailAPI(id) {
  269. const res = await get(
  270. Vue.prototype.apiUrl + `/eom/saleorder/getById/${id}`,
  271. {},
  272. true,
  273. );
  274. if (res.code == 0) {
  275. return res.data;
  276. }
  277. return Promise.reject(new Error(res.message));
  278. }
  279. //
  280. //
  281. //
  282. //
  283. //销售退货单
  284. /**
  285. * /销售退货单-获取信息详情
  286. */
  287. export async function getSaleOrderReturnGetByIdAPI(id) {
  288. const res = await get(
  289. Vue.prototype.apiUrl + `/eom/saleorderreturnrecord/getById/${id}`,
  290. {},
  291. true,
  292. );
  293. if (res.code == 0) {
  294. return res.data;
  295. }
  296. return Promise.reject(new Error(res.message));
  297. }
  298. //
  299. //
  300. //
  301. //
  302. //获取发货单
  303. /**
  304. * /获取发货单信息详情-获取信息详情
  305. */
  306. export async function getSaleOrderSendRecordDetailAPI(id) {
  307. const res = await get(
  308. Vue.prototype.apiUrl + `/eom/saleordersendrecord/getById/${id}`,
  309. {},
  310. true,
  311. );
  312. if (res.code == 0) {
  313. return res.data;
  314. }
  315. return Promise.reject(new Error(res.message));
  316. }
  317. //
  318. //
  319. //
  320. //
  321. //获取仓库信息
  322. /**
  323. * /获取仓库信息
  324. */
  325. export async function getWarehouseListByIdsAPI(data) {
  326. const res = await postJ(
  327. Vue.prototype.apiUrl + `/wms/warehouse/getWarehouseListByIds`,
  328. data,
  329. true,
  330. );
  331. if (res.code == 0) {
  332. return res.data;
  333. }
  334. return Promise.reject(new Error(res.message));
  335. }
  336. //
  337. //
  338. //
  339. //
  340. //
  341. //采购需求
  342. /**
  343. * /获取需求单信息
  344. */
  345. export async function getPurchaseRequirementByIdsAPI(id) {
  346. const res = await get(
  347. Vue.prototype.apiUrl + `/eom/purchaserequirement/getById/${id}`,
  348. {},
  349. true,
  350. );
  351. if (res.code == 0) {
  352. return res.data;
  353. }
  354. return Promise.reject(new Error(res.message));
  355. }
  356. //获取采购计划单信息
  357. export async function getPurchasePlanByIdsAPI(id) {
  358. const res = await get(
  359. Vue.prototype.apiUrl + `/eom/purchaseplan/getById/${id}`,
  360. {},
  361. true,
  362. );
  363. if (res.code == 0) {
  364. return res.data;
  365. }
  366. return Promise.reject(new Error(res.message));
  367. }
  368. /**
  369. * /新增采购需求负责人
  370. */
  371. export async function AssignPurchasePlanUserAPI(data) {
  372. const res = await postJ(
  373. Vue.prototype.apiUrl + `/bpm/purchasePlanApprove/assign`,
  374. data,
  375. true,
  376. );
  377. if (res.code == 0) {
  378. return res.data;
  379. }
  380. return Promise.reject(new Error(res.message));
  381. }
  382. //
  383. //
  384. //
  385. //
  386. /**
  387. * /采购订单
  388. */
  389. //获取采购订单信息
  390. export async function purchaseOrderGetByIdAPI(id) {
  391. const res = await get(
  392. Vue.prototype.apiUrl + `/eom/purchaseorder/getById/${id}`,
  393. {},
  394. true,
  395. );
  396. if (res.code == 0) {
  397. return res.data;
  398. }
  399. return Promise.reject(new Error(res.message));
  400. }
  401. //
  402. //
  403. //
  404. //
  405. /**
  406. * /采购收货
  407. */
  408. //获取采购收货单信息
  409. export async function purchaseOrderReceiveGetByIdAPI(id) {
  410. const res = await get(
  411. Vue.prototype.apiUrl + `/eom/purchaseorderreceive/getById/${id}`,
  412. {},
  413. true,
  414. );
  415. if (res.code == 0) {
  416. return res.data;
  417. }
  418. return Promise.reject(new Error(res.message));
  419. }
  420. //
  421. //
  422. //
  423. //
  424. /**
  425. * /采购退货
  426. */
  427. //获取采购退货单信息
  428. export async function purchaseOrderReturnGetByIdAPI(id) {
  429. const res = await get(
  430. Vue.prototype.apiUrl + `/eom/purchaseorderreturn/getById/${id}`,
  431. {},
  432. true,
  433. );
  434. if (res.code == 0) {
  435. return res.data;
  436. }
  437. return Promise.reject(new Error(res.message));
  438. }
  439. //
  440. //
  441. //
  442. //
  443. /**
  444. * /量具送检
  445. */
  446. //查询量具送检信息
  447. export async function processById(params) {
  448. const res = await get(
  449. Vue.prototype.apiUrl + `/eam/planmaintenance/processById`,
  450. params,
  451. );
  452. if (res.code == 0) {
  453. return res.data;
  454. }
  455. return Promise.reject(new Error(res.data.message));
  456. }
  457. //
  458. // 个人日志列表
  459. export async function getList(params) {
  460. const res = await get("/eom/planToolLog/list", params);
  461. if (res.data.code == 0) {
  462. return res.data;
  463. }
  464. return Promise.reject(new Error(res.data.message));
  465. }
  466. //
  467. //
  468. //
  469. //动态表单 工作流自定义权限过滤表单集合
  470. export async function getBpmCustomFormList(params) {
  471. const res = await get(
  472. Vue.prototype.apiUrl + "/flowable/bpmcustomform/list",
  473. params,
  474. );
  475. if (res.code == 0) {
  476. return res.data;
  477. }
  478. return Promise.reject(new Error(res.data.message));
  479. }
  480. //动态表单 我发起的申请
  481. export async function getProcessInstancePage(params) {
  482. const res = await postJ(
  483. Vue.prototype.apiUrl + "/bpm/process-instance/my-page",
  484. params,
  485. );
  486. if (res.code == 0) {
  487. return res.data;
  488. }
  489. return Promise.reject(new Error(res.data.message));
  490. }
  491. //动态表单 部门发起的申请
  492. export async function getProcessInstanceDeptPage(query) {
  493. const res = await get(
  494. Vue.prototype.apiUrl + "/bpm/process-instance/my-dept-page",
  495. params,
  496. );
  497. if (res.code == 0) {
  498. return res.data;
  499. }
  500. return Promise.reject(new Error(res.data.message));
  501. }
  502. //动态表单 通知我的申请
  503. export async function getProcessInstanceNoticePage(data) {
  504. const res = await postJ(
  505. Vue.prototype.apiUrl + "/bpm/process-instance/my-notice-page",
  506. data,
  507. );
  508. if (res.code == 0) {
  509. return res.data;
  510. }
  511. return Promise.reject(new Error(res.data.message));
  512. }
  513. //发起流程通用接口
  514. export async function processInstanceCreateAPI(params, loding = true) {
  515. const res = await postJ(
  516. Vue.prototype.apiUrl + `/bpm/process-instance/create`,
  517. params,
  518. loding,
  519. );
  520. if (res.code == 0) {
  521. return res.data;
  522. }
  523. return Promise.reject(new Error(res.message));
  524. }
  525. //流程列表
  526. export async function processInstancePage(params, loding = false) {
  527. const res = await get(
  528. Vue.prototype.apiUrl + `/bpm/model/page`,
  529. params,
  530. loding,
  531. );
  532. if (res.code == 0) {
  533. return res.data;
  534. }
  535. return Promise.reject(new Error(res.message));
  536. }
  537. /**
  538. * /获取领料单信息
  539. */
  540. export async function getPickOrderById(id) {
  541. const res = await get(
  542. Vue.prototype.apiUrl + `/pda/mes/pickorder/getPickOrderById/${id}`,
  543. {},
  544. true,
  545. );
  546. if (res.code == 0) {
  547. return res.data;
  548. }
  549. return Promise.reject(new Error(res.message));
  550. }
  551. /**
  552. * 根据来源单号查出库详情
  553. */
  554. export async function getOutInBySourceBizNo(sourceBizNo) {
  555. const res = await get(
  556. Vue.prototype.apiUrl + `/wms/outintwo/getInfoBySourceBizNo/${sourceBizNo}`,
  557. {},
  558. true,
  559. );
  560. if (res.code == 0) {
  561. return res.data;
  562. }
  563. return Promise.reject(new Error(res.message));
  564. }
  565. /**
  566. * 查询所有物品分类
  567. */
  568. export async function allCategoryLevel() {
  569. const res = await get(
  570. Vue.prototype.apiUrl + `/main/categoryLevel/allCategoryLevel`,
  571. {},
  572. false,
  573. );
  574. if (res.code == 0) {
  575. return res.data;
  576. }
  577. return Promise.reject(new Error(res.message));
  578. }
  579. export async function getLoginUser(data) {
  580. const res = await get(
  581. Vue.prototype.apiUrl + "/system/account/getLoginUser",
  582. data,
  583. true,
  584. );
  585. if (res.code == 0) {
  586. return res.data;
  587. }
  588. if (res.data && res.data.code == 0) {
  589. return res.data.data;
  590. }
  591. return Promise.reject(new Error(res.message || res.data?.message || "获取登录用户数据失败"));
  592. }
  593. // 生产入库审批(申请入库)
  594. export async function approveTaskWithVariablesOther(data) {
  595. const res = await postJ(
  596. Vue.prototype.apiUrl + `/bpm/inwarehouse/assign`,
  597. data,
  598. true,
  599. );
  600. if (res.code == 0) {
  601. return res.data;
  602. }
  603. return Promise.reject(new Error(res.message));
  604. }
  605. /**
  606. * 获取部门列表(树)
  607. */
  608. export async function getGroupList() {
  609. const res = await get(
  610. Vue.prototype.apiUrl + `/main/group/getGroupList`,
  611. {},
  612. false,
  613. );
  614. if (res.code == 0) {
  615. return res.data;
  616. }
  617. return Promise.reject(new Error(res.message));
  618. }
  619. /**
  620. * 根据部门获取员工列表
  621. */
  622. export async function getUserPageByGroupId(params) {
  623. const res = await get(
  624. Vue.prototype.apiUrl + `/main/user/getUserPage`,
  625. params,
  626. true,
  627. );
  628. if (res.code == 0) {
  629. return res.data;
  630. }
  631. return Promise.reject(new Error(res.message));
  632. }
  633. /**
  634. * 根据人员id获取用户信息(含部门)
  635. */
  636. export async function getUserById(id) {
  637. const res = await get(
  638. Vue.prototype.apiUrl + `/main/user/getById/${id}`,
  639. {},
  640. true,
  641. );
  642. if (res.code == 0) {
  643. return res.data;
  644. }
  645. return Promise.reject(new Error(res.message));
  646. }
  647. /**
  648. * 生产入库申请单详情
  649. */
  650. export async function getStorageDetail(id) {
  651. const res = await get(
  652. Vue.prototype.apiUrl + `/mes/applystorage/getById/${id}`,
  653. {},
  654. true,
  655. );
  656. if (res.code == 0) {
  657. return res.data;
  658. }
  659. return Promise.reject(new Error(res.message));
  660. }