index.js 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729
  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. export async function outApproveNotPass(data) {
  153. const res = await putJ(Vue.prototype.apiUrl + `/bpm/outApprove/notPass`, data, true)
  154. if (res.code == 0) {
  155. return res.data;
  156. }
  157. return Promise.reject(new Error(res.message));
  158. }
  159. /**
  160. *销售退货审批流程审核接口
  161. */
  162. export async function approveTaskSalesOrderReturn(params) {
  163. const res = await postJ(
  164. Vue.prototype.apiUrl + `/bpm/salesOrderReturnApprove/approve`,
  165. params,
  166. true,
  167. );
  168. if (res.code == 0) {
  169. return res;
  170. }
  171. return Promise.reject(new Error(res.message));
  172. }
  173. //费用申请
  174. // 编辑
  175. export async function feeApplyUpdateAPI(data) {
  176. const res = await putJ(
  177. Vue.prototype.apiUrl + `/eom/finfeeapply/update`,
  178. data,
  179. true,
  180. );
  181. if (res.code == 0) {
  182. return res.data;
  183. }
  184. return Promise.reject(new Error(res.message));
  185. }
  186. // 信息
  187. export async function getFeeApplyInfoAPI(id) {
  188. const res = await get(
  189. Vue.prototype.apiUrl + `/eom/finfeeapply/getById/${id}`,
  190. {},
  191. true,
  192. );
  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. export async function getDetail(id) {
  206. const res = await get(
  207. Vue.prototype.apiUrl + `/eom/contract/getById/${id}`,
  208. {},
  209. true,
  210. );
  211. if (res.code == 0) {
  212. return res.data;
  213. }
  214. return Promise.reject(new Error(res.message));
  215. }
  216. //
  217. //
  218. //
  219. //
  220. //客户申请
  221. /**
  222. * 客户申请列表
  223. */
  224. export async function contactApplyList(id) {
  225. const res = await get(
  226. Vue.prototype.apiUrl + `/eom/contactlistapply/getById/${id}`,
  227. {},
  228. true,
  229. );
  230. if (res.code == 0) {
  231. return res.data;
  232. }
  233. return Promise.reject(new Error(res.message));
  234. }
  235. //
  236. //
  237. //
  238. //
  239. //商机管理
  240. /**
  241. * /商机管理-获取信息详情
  242. */
  243. export async function getBusinessOpportunityDetailAPI(id) {
  244. const res = await get(
  245. Vue.prototype.apiUrl + `/eom/businessopportunity/getById/${id}`,
  246. {},
  247. true,
  248. );
  249. if (res.code == 0) {
  250. return res.data;
  251. }
  252. return Promise.reject(new Error(res.message));
  253. }
  254. /**
  255. * 更新信息
  256. */
  257. export async function businessOpportunityUpdateAPI(data) {
  258. const res = await postJ(
  259. Vue.prototype.apiUrl + `/eom/businessopportunity/updateProduct`,
  260. data,
  261. true,
  262. );
  263. if (res.code == 0) {
  264. return res.data;
  265. }
  266. return Promise.reject(new Error(res.message));
  267. }
  268. //
  269. //
  270. //
  271. //
  272. //销售订单
  273. /**
  274. * /销售订单-获取信息详情
  275. */
  276. export async function getSaleOrderDetailAPI(id) {
  277. const res = await get(
  278. Vue.prototype.apiUrl + `/eom/saleorder/getById/${id}`,
  279. {},
  280. true,
  281. );
  282. if (res.code == 0) {
  283. return res.data;
  284. }
  285. return Promise.reject(new Error(res.message));
  286. }
  287. //
  288. //
  289. //
  290. //
  291. //销售退货单
  292. /**
  293. * /销售退货单-获取信息详情
  294. */
  295. export async function getSaleOrderReturnGetByIdAPI(id) {
  296. const res = await get(
  297. Vue.prototype.apiUrl + `/eom/saleorderreturnrecord/getById/${id}`,
  298. {},
  299. true,
  300. );
  301. if (res.code == 0) {
  302. return res.data;
  303. }
  304. return Promise.reject(new Error(res.message));
  305. }
  306. //
  307. //
  308. //
  309. //
  310. //获取发货单
  311. /**
  312. * /获取发货单信息详情-获取信息详情
  313. */
  314. export async function getSaleOrderSendRecordDetailAPI(id) {
  315. const res = await get(
  316. Vue.prototype.apiUrl + `/eom/saleordersendrecord/getById/${id}`,
  317. {},
  318. true,
  319. );
  320. if (res.code == 0) {
  321. return res.data;
  322. }
  323. return Promise.reject(new Error(res.message));
  324. }
  325. /**
  326. * 获取发货信息详情(替代料)
  327. */
  328. export async function getByIdOnlyReplaceAPI(id) {
  329. const res = await get(
  330. Vue.prototype.apiUrl + `/eom/saleordersendrecord/getByIdOnlyReplace/${id}`,
  331. {},
  332. true,
  333. );
  334. if (res.code == 0) {
  335. return res.data;
  336. }
  337. return Promise.reject(new Error(res.message));
  338. }
  339. //
  340. //获取仓库信息
  341. /**
  342. * /获取仓库信息
  343. */
  344. export async function getWarehouseListByIdsAPI(data) {
  345. const res = await postJ(
  346. Vue.prototype.apiUrl + `/wms/warehouse/getWarehouseListByIds`,
  347. data,
  348. true,
  349. );
  350. if (res.code == 0) {
  351. return res.data;
  352. }
  353. return Promise.reject(new Error(res.message));
  354. }
  355. //
  356. //
  357. //
  358. //
  359. //
  360. //采购需求
  361. /**
  362. * /获取需求单信息
  363. */
  364. export async function getPurchaseRequirementByIdsAPI(id) {
  365. const res = await get(
  366. Vue.prototype.apiUrl + `/eom/purchaserequirement/getById/${id}`,
  367. {},
  368. true,
  369. );
  370. if (res.code == 0) {
  371. return res.data;
  372. }
  373. return Promise.reject(new Error(res.message));
  374. }
  375. //获取采购计划单信息
  376. export async function getPurchasePlanByIdsAPI(id) {
  377. const res = await get(
  378. Vue.prototype.apiUrl + `/eom/purchaseplan/getById/${id}`,
  379. {},
  380. true,
  381. );
  382. if (res.code == 0) {
  383. return res.data;
  384. }
  385. return Promise.reject(new Error(res.message));
  386. }
  387. /**
  388. * /新增采购需求负责人
  389. */
  390. export async function AssignPurchasePlanUserAPI(data) {
  391. const res = await postJ(
  392. Vue.prototype.apiUrl + `/bpm/purchasePlanApprove/assign`,
  393. data,
  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 purchaseOrderGetByIdAPI(id) {
  410. const res = await get(
  411. Vue.prototype.apiUrl + `/eom/purchaseorder/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 purchaseOrderReceiveGetByIdAPI(id) {
  429. const res = await get(
  430. Vue.prototype.apiUrl + `/eom/purchaseorderreceive/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 purchaseOrderReturnGetByIdAPI(id) {
  448. const res = await get(
  449. Vue.prototype.apiUrl + `/eom/purchaseorderreturn/getById/${id}`,
  450. {},
  451. true,
  452. );
  453. if (res.code == 0) {
  454. return res.data;
  455. }
  456. return Promise.reject(new Error(res.message));
  457. }
  458. //
  459. //
  460. //
  461. //
  462. /**
  463. * /量具送检
  464. */
  465. //查询量具送检信息
  466. export async function processById(params) {
  467. const res = await get(
  468. Vue.prototype.apiUrl + `/eam/planmaintenance/processById`,
  469. params,
  470. );
  471. if (res.code == 0) {
  472. return res.data;
  473. }
  474. return Promise.reject(new Error(res.data.message));
  475. }
  476. //
  477. // 个人日志列表
  478. export async function getList(params) {
  479. const res = await get("/eom/planToolLog/list", params);
  480. if (res.data.code == 0) {
  481. return res.data;
  482. }
  483. return Promise.reject(new Error(res.data.message));
  484. }
  485. //
  486. //
  487. //
  488. //动态表单 工作流自定义权限过滤表单集合
  489. export async function getBpmCustomFormList(params) {
  490. const res = await get(
  491. Vue.prototype.apiUrl + "/flowable/bpmcustomform/list",
  492. params,
  493. );
  494. if (res.code == 0) {
  495. return res.data;
  496. }
  497. return Promise.reject(new Error(res.data.message));
  498. }
  499. //动态表单 我发起的申请
  500. export async function getProcessInstancePage(params) {
  501. const res = await postJ(
  502. Vue.prototype.apiUrl + "/bpm/process-instance/my-page",
  503. params,
  504. );
  505. if (res.code == 0) {
  506. return res.data;
  507. }
  508. return Promise.reject(new Error(res.data.message));
  509. }
  510. //动态表单 部门发起的申请
  511. export async function getProcessInstanceDeptPage(query) {
  512. const res = await get(
  513. Vue.prototype.apiUrl + "/bpm/process-instance/my-dept-page",
  514. params,
  515. );
  516. if (res.code == 0) {
  517. return res.data;
  518. }
  519. return Promise.reject(new Error(res.data.message));
  520. }
  521. //动态表单 通知我的申请
  522. export async function getProcessInstanceNoticePage(data) {
  523. const res = await postJ(
  524. Vue.prototype.apiUrl + "/bpm/process-instance/my-notice-page",
  525. data,
  526. );
  527. if (res.code == 0) {
  528. return res.data;
  529. }
  530. return Promise.reject(new Error(res.data.message));
  531. }
  532. //发起流程通用接口
  533. export async function processInstanceCreateAPI(params, loding = true) {
  534. const res = await postJ(
  535. Vue.prototype.apiUrl + `/bpm/process-instance/create`,
  536. params,
  537. loding,
  538. );
  539. if (res.code == 0) {
  540. return res.data;
  541. }
  542. return Promise.reject(new Error(res.message));
  543. }
  544. //流程列表
  545. export async function processInstancePage(params, loding = false) {
  546. const res = await get(
  547. Vue.prototype.apiUrl + `/bpm/model/page`,
  548. params,
  549. loding,
  550. );
  551. if (res.code == 0) {
  552. return res.data;
  553. }
  554. return Promise.reject(new Error(res.message));
  555. }
  556. /**
  557. * /获取领料单信息
  558. */
  559. export async function getPickOrderById(id) {
  560. const res = await get(
  561. Vue.prototype.apiUrl + `/pda/mes/pickorder/getPickOrderById/${id}`,
  562. {},
  563. true,
  564. );
  565. if (res.code == 0) {
  566. return res.data;
  567. }
  568. return Promise.reject(new Error(res.message));
  569. }
  570. /**
  571. * 根据来源单号查出库详情
  572. */
  573. export async function getOutInBySourceBizNo(sourceBizNo) {
  574. const res = await get(
  575. Vue.prototype.apiUrl + `/wms/outintwo/getInfoBySourceBizNo/${sourceBizNo}`,
  576. {},
  577. true,
  578. );
  579. if (res.code == 0) {
  580. return res.data;
  581. }
  582. return Promise.reject(new Error(res.message));
  583. }
  584. /**
  585. * 查询所有物品分类
  586. */
  587. export async function allCategoryLevel() {
  588. const res = await get(
  589. Vue.prototype.apiUrl + `/main/categoryLevel/allCategoryLevel`,
  590. {},
  591. false,
  592. );
  593. if (res.code == 0) {
  594. return res.data;
  595. }
  596. return Promise.reject(new Error(res.message));
  597. }
  598. export async function getLoginUser(data) {
  599. const res = await get(
  600. Vue.prototype.apiUrl + "/system/account/getLoginUser",
  601. data,
  602. true,
  603. );
  604. if (res.code == 0) {
  605. return res.data;
  606. }
  607. if (res.data && res.data.code == 0) {
  608. return res.data.data;
  609. }
  610. return Promise.reject(
  611. new Error(res.message || res.data?.message || "获取登录用户数据失败"),
  612. );
  613. }
  614. // 生产入库审批(申请入库)
  615. export async function approveTaskWithVariablesOther(data) {
  616. const res = await postJ(
  617. Vue.prototype.apiUrl + `/bpm/inwarehouse/assign`,
  618. data,
  619. true,
  620. );
  621. if (res.code == 0) {
  622. return res.data;
  623. }
  624. return Promise.reject(new Error(res.message));
  625. }
  626. /**
  627. * 获取部门列表(树)
  628. */
  629. export async function getGroupList() {
  630. const res = await get(
  631. Vue.prototype.apiUrl + `/main/group/getGroupList`,
  632. {},
  633. false,
  634. );
  635. if (res.code == 0) {
  636. return res.data;
  637. }
  638. return Promise.reject(new Error(res.message));
  639. }
  640. /**
  641. * 根据部门获取员工列表
  642. */
  643. export async function getUserPageByGroupId(params) {
  644. const res = await get(
  645. Vue.prototype.apiUrl + `/main/user/getUserPage`,
  646. params,
  647. true,
  648. );
  649. if (res.code == 0) {
  650. return res.data;
  651. }
  652. return Promise.reject(new Error(res.message));
  653. }
  654. /**
  655. * 根据人员id获取用户信息(含部门)
  656. */
  657. export async function getUserById(id) {
  658. const res = await get(
  659. Vue.prototype.apiUrl + `/main/user/getById/${id}`,
  660. {},
  661. true,
  662. );
  663. if (res.code == 0) {
  664. return res.data;
  665. }
  666. return Promise.reject(new Error(res.message));
  667. }
  668. /**
  669. * 生产入库申请单详情
  670. */
  671. export async function getStorageDetail(id) {
  672. const res = await get(
  673. Vue.prototype.apiUrl + `/mes/applystorage/getById/${id}`,
  674. {},
  675. true,
  676. );
  677. if (res.code == 0) {
  678. return res.data;
  679. }
  680. return Promise.reject(new Error(res.message));
  681. }
  682. // 动态表头
  683. export async function fieldModel(params) {
  684. const res = await get(Vue.prototype.apiUrl + `/main/fieldmodel/list`, params, true);
  685. if (res.code == 0) {
  686. return res.data;
  687. }
  688. return Promise.reject(new Error(res.message));
  689. }