risk-loss-event-list.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. <template>
  2. <div style="padding: 20px;padding-top: 0px;" class="reporttablecardxm">
  3. <div
  4. style="position: absolute; padding-top: 10px;line-height: 32px;"
  5. class="header_sd-header_common"
  6. >
  7. <div :class="$style.titlepoint"></div>
  8. <span :class="['toptitle', $style.toptitle]">损失事件列表</span>
  9. </div>
  10. <sd-data-table
  11. ref="dataTable"
  12. :class="$style.dataTable"
  13. :projectlist="true"
  14. :columns="columns"
  15. :data-url="dataUrl"
  16. row-key="INST_ID"
  17. :actions="actions"
  18. :process-req="processReq"
  19. :defultpagination-pagesize="50"
  20. >
  21. <template slot="islink" slot-scope="text, record">
  22. <a @click="rowClick(record)">{{ text }}</a>
  23. </template>
  24. </sd-data-table>
  25. </div>
  26. </template>
  27. <script>
  28. import crossWindowWatcher from '@/common/services/cross-window-watcher'
  29. import TableColumnTypes from '@/common/services/table-column-types'
  30. import moment from 'moment'
  31. import download from '@/common/services/download'
  32. import { Message } from 'ant-design-vue'
  33. import TableActionTypes from '@/common/services/table-action-types'
  34. import StatisticsService from './statistics-service'
  35. import components from './_import-components/risk-loss-event-list-import'
  36. const columns = [
  37. {
  38. title: '序号',
  39. customRender: (text, record, index) => `${index + 1}`,
  40. width: '80px',
  41. },
  42. {
  43. title: '发生日期',
  44. dataIndex: 'HAPPEN_TIME',
  45. sdRender: TableColumnTypes.date,
  46. defaultSortOrder: 'descend',
  47. width: '100px',
  48. },
  49. {
  50. title: '事件编号',
  51. dataIndex: 'EVENT_CODE',
  52. width: '100px',
  53. },
  54. {
  55. title: '事件名称',
  56. dataIndex: 'EVENT_NAME',
  57. scopedSlots: { customRender: 'islink' },
  58. width: '100px',
  59. },
  60. {
  61. title: '事件类型',
  62. dataIndex: 'EVENT_TYPE',
  63. width: '150px',
  64. },
  65. {
  66. title: '事件性质',
  67. dataIndex: 'EVENT_NATURE',
  68. width: '180px',
  69. },
  70. {
  71. title: '事件描述',
  72. dataIndex: 'EVENT_DESC',
  73. width: '150px',
  74. },
  75. {
  76. title: '是否重大风险事件',
  77. dataIndex: 'IS_MAJOR_EVENT',
  78. width: '150px',
  79. },
  80. {
  81. title: '损失金额(万元)',
  82. dataIndex: 'LOSS_AMOUNT',
  83. width: '150px',
  84. },
  85. {
  86. title: '责任单位/部门',
  87. dataIndex: 'RESPONSIBLE_DEPT_NAME',
  88. width: '350px',
  89. },
  90. {
  91. title: '事件责任人',
  92. dataIndex: 'RESPONSIBLE_USER_NAME',
  93. width: '100px',
  94. },
  95. {
  96. title: '是否涉诉',
  97. dataIndex: 'IS_LITIGATION',
  98. width: '100px',
  99. },
  100. {
  101. title: '是否涉外',
  102. dataIndex: 'IS_OUTSIDE',
  103. width: '100px',
  104. },
  105. {
  106. title: '处置进展',
  107. dataIndex: 'DISPOSAL_PROGRESS',
  108. width: '100px',
  109. },
  110. {
  111. title: '当前情况描述',
  112. dataIndex: 'SITUATION_DESC',
  113. width: '150px',
  114. },
  115. {
  116. title: '应对措施',
  117. dataIndex: 'COUNTERMEASURES',
  118. width: '100px',
  119. },
  120. {
  121. title: '填报单位',
  122. dataIndex: 'FILLING_UNIT_NAME',
  123. width: '100px',
  124. },
  125. {
  126. title: '填报人员',
  127. dataIndex: 'CREATOR_NAME',
  128. width: '100px',
  129. },
  130. {
  131. title: '填报日期',
  132. dataIndex: 'CREATION_TIME',
  133. sdRender: TableColumnTypes.date,
  134. width: '100px',
  135. },
  136. ]
  137. export default {
  138. name: 'RiskLossEventList',
  139. metaInfo: {
  140. title: '风险损失事件透视图',
  141. },
  142. components,
  143. data() {
  144. return {
  145. columns,
  146. data: [],
  147. actions: [
  148. {
  149. label: '导出',
  150. id: 'export',
  151. permission: null,
  152. type: TableActionTypes.primary,
  153. callback: () => {
  154. const params = JSON.parse(this.$route.query.params)
  155. // 审计发现统计_钻取审计发现列表导出
  156. StatisticsService.exportLossEventData(params)
  157. .then((data) => {
  158. const url = URL.createObjectURL(data)
  159. download(url, '损失事件列表导出.xls')
  160. })
  161. .catch(() => {
  162. Message.error('导出失败')
  163. })
  164. },
  165. },
  166. ],
  167. }
  168. },
  169. computed: {
  170. dataUrl() {
  171. return 'api/xcoa-mobile/v1/risk-statistics-analysis/getLossEventDrillList'
  172. },
  173. },
  174. methods: {
  175. rowClick(record) {
  176. let url = ''
  177. if ((record.FLOW_STATE === '起草') | (record.FLOW_STATE === '开始')) {
  178. url = `/sd-webflow/pages/draft/` + record.INST_ID
  179. } else {
  180. url = `/sd-webflow/done-pages/` + record.INST_ID
  181. }
  182. crossWindowWatcher.waitForChanged(url).then((refreshFlag) => {
  183. if (refreshFlag) this.refresh()
  184. })
  185. },
  186. isJson(str) {
  187. if (typeof str === 'string') {
  188. try {
  189. const obj = JSON.parse(str)
  190. if (typeof obj === 'object' && obj) {
  191. return true
  192. } else {
  193. return false
  194. }
  195. } catch (e) {
  196. return false
  197. }
  198. }
  199. },
  200. processRes(res) {
  201. if (res.data.length > 0) {
  202. res.data.forEach((item) => {
  203. if (this.isJson(item.FIND_TYPE)) {
  204. item.FIND_TYPE = JSON.parse(item.FIND_TYPE).text
  205. }
  206. })
  207. }
  208. return res
  209. },
  210. processReq(req) {
  211. const parasm = JSON.parse(this.$route.query.params)
  212. req.data = {
  213. ...req.data,
  214. ...parasm,
  215. }
  216. if (req.data.pageIndex === undefined) {
  217. req.data.pageIndex = req.data.startPosition
  218. }
  219. if (req.data.pageSize === undefined) {
  220. req.data.pageSize = 50
  221. }
  222. return req
  223. },
  224. },
  225. }
  226. </script>
  227. <style module lang="scss">
  228. @use '@/common/design' as *;
  229. .titlepoint {
  230. background: #1890ff;
  231. height: 27px;
  232. width: 8px;
  233. position: fixed;
  234. top: 12px;
  235. left: 20px;
  236. border-radius: 8px;
  237. }
  238. .toptitle {
  239. color: #404040;
  240. font-weight: bold;
  241. font-size: 22px;
  242. position: fixed;
  243. left: 40px;
  244. top: 9px;
  245. }
  246. :global(.reporttablecardxm) {
  247. :global(.ant-table-body) {
  248. height: calc(100vh - 140px);
  249. overflow: auto;
  250. }
  251. }
  252. .data-table {
  253. table {
  254. width: 3500px;
  255. }
  256. }
  257. </style>