risk-service.js 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. import axios from '@/common/services/axios-instance'
  2. class RiskService {
  3. // 根据ids获取到风险列表数据
  4. getFxlist(ids) {
  5. return axios
  6. .get('api/xcoa-mobile/v1/riskevent/getRiskEventEntitys?ids=' + ids)
  7. .then(function(res) {
  8. return res.data
  9. })
  10. }
  11. // 获取审计事项列表信息
  12. findIcIcmatrix(id) {
  13. return axios
  14. .get('api/xcoa-mobile/v1/riskcategory/findIamAuditMatters?id=', id)
  15. .then(function(res) {
  16. return res.data
  17. })
  18. }
  19. fngetsortNum(id) {
  20. return axios
  21. .post('api/xcoa-mobile/v1/riskevent/getsortNum?catalogId=' + id)
  22. .then(function(res) {
  23. return res.data
  24. })
  25. }
  26. // 获取审计事项分类树
  27. findIcIcmatrixCategoryTree(parentId, orgId, versionId) {
  28. if (versionId !== null) {
  29. const url =
  30. 'api/xcoa-mobile/v1/riskcategory/findIamAuditMattersCategoryTree?parentId=' +
  31. parentId +
  32. '&auditOrgId=' +
  33. orgId +
  34. '&versionId=' +
  35. versionId
  36. return axios.post(url).then(function(res) {
  37. return res
  38. })
  39. } else {
  40. const url =
  41. 'api/xcoa-mobile/v1/riskcategory/findIamAuditMattersCategoryTree?parentId=' +
  42. parentId +
  43. '&auditOrgId=' +
  44. orgId +
  45. '&versionId=-1'
  46. return axios.post(url).then(function(res) {
  47. return []
  48. })
  49. }
  50. }
  51. // 获取分类path
  52. findupcatinfo(categoryId) {
  53. const url = 'api/xcoa-mobile/v1/riskcategory/findupcatinfo?categoryId=' + categoryId
  54. return axios.post(url).then(function(res) {
  55. return res
  56. })
  57. }
  58. // 删除时检查分类
  59. deleteCheckCategory(ids) {
  60. return axios
  61. .get('api/xcoa-mobile/v1/riskcategory/delete-check-category?ids=' + ids)
  62. .then(function(res) {
  63. return res.data
  64. })
  65. }
  66. // 删除时分类
  67. deleteCategory(ids) {
  68. return axios
  69. .delete('api/xcoa-mobile/v1/riskcategory/delete-category?ids=' + ids)
  70. .then(function(res) {
  71. return res.data
  72. })
  73. }
  74. // 删除事项
  75. deleteIcIcmatrix(ids) {
  76. return axios
  77. .delete('api/xcoa-mobile/v1/riskcategory/delete-iamAuditMatters?ids=' + ids)
  78. .then(function(res) {
  79. return res.data
  80. })
  81. }
  82. // 获取分级授权下拉列表
  83. getManagedHierarchyOrg(formId) {
  84. return axios({
  85. url: `api/xcoa-mobile/v1/iam-page/getHavePermissionOrg/${formId}`,
  86. method: 'post',
  87. }).then((res) => {
  88. return res
  89. })
  90. }
  91. // 导出风险库
  92. exportItem(id, versionId) {
  93. return axios({
  94. method: 'post',
  95. url: 'api/xcoa-mobile/v1/riskevent/exportItem',
  96. params: { id: Number(id), versionId: Number(versionId) },
  97. responseType: 'blob',
  98. })
  99. }
  100. // 导出模板
  101. exportItemTemplate(level) {
  102. return axios({
  103. method: 'post',
  104. url: 'api/xcoa-mobile/v1/riskevent/exportItemTemplate',
  105. params: { level: Number(level) },
  106. responseType: 'blob',
  107. })
  108. }
  109. // 导入数据
  110. importItemTemplate(importType, groupId, mtxVersionId, orgId) {
  111. return axios({
  112. method: 'post',
  113. url: 'api/xcoa-mobile/v1/riskevent/importItemTemplate',
  114. params: {
  115. importType: importType,
  116. groupId: groupId,
  117. mtxVersionId: mtxVersionId,
  118. auditOrgId: orgId,
  119. },
  120. })
  121. }
  122. // 拖拽功能
  123. dragNode(data) {
  124. return axios({
  125. method: 'post',
  126. url: 'api/xcoa-mobile/v1/riskcategory/drage',
  127. data: data,
  128. })
  129. }
  130. // 获取版本ID
  131. getversion(belongUnitId) {
  132. return axios({
  133. method: 'post',
  134. url: 'api/xcoa-mobile/v1/risklibraryversion/getMtxVersion',
  135. params: { belongUnitId: belongUnitId },
  136. })
  137. }
  138. // 检查分类
  139. CheckCategory(ids) {
  140. return axios({
  141. method: 'get',
  142. url: 'api/xcoa-mobile/v1/riskcategory/check-category?ids=' + ids,
  143. }).then((res) => {
  144. return res.data
  145. })
  146. }
  147. // 检查编号唯一
  148. checkMeasurecode(eventCode, id, versionId, auditOrgId) {
  149. return axios({
  150. method: 'post',
  151. url: 'api/xcoa-mobile/v1/riskevent/checkMeasureCode',
  152. params: {
  153. eventCode: eventCode,
  154. id: id,
  155. versionId: versionId,
  156. auditOrgId: auditOrgId,
  157. },
  158. })
  159. }
  160. // 获取用户单位
  161. getUserDept() {
  162. return axios({
  163. method: 'post',
  164. url: 'api/xcoa-mobile/v1/risklibraryversion/getBelongUnit',
  165. })
  166. }
  167. }
  168. export default new RiskService()