spic-audit-dsc-three-coverage-list.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <template>
  2. <div style="padding: 20px; padding-top: 0" 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]">{{ this.unitName }}</span>
  9. </div>
  10. <sd-data-table
  11. ref="dataTable"
  12. :columns="columns"
  13. :projectlist="true"
  14. :data-url="dataUrl"
  15. :actions="actions"
  16. :process-req="processReq"
  17. :process-res="processRes"
  18. :defultpagination-pagesize="50"
  19. />
  20. </div>
  21. </template>
  22. <script>
  23. import { Message } from 'ant-design-vue'
  24. import TableActionTypes from '@/common/services/table-action-types'
  25. import download from '@/common/services/download'
  26. import auditService from './iam-audit-dsc-service'
  27. import components from './_import-components/spic-audit-dsc-three-coverage-list-import'
  28. export default {
  29. name: 'SpicAuditDscThreeCoverageList',
  30. metaInfo: {
  31. title: '审计覆盖情况',
  32. },
  33. components,
  34. data() {
  35. return {
  36. params: null,
  37. columns: [],
  38. year: '',
  39. data: [],
  40. unitName: '',
  41. actions: [
  42. {
  43. label: '导出',
  44. id: 'export',
  45. permission: null,
  46. type: TableActionTypes.primary,
  47. callback: () => {
  48. const params = JSON.parse(this.$route.query.params)
  49. if (this.$route.query.type === 'fourYearCoverage') {
  50. auditService
  51. .exportUnitList(params)
  52. .then((data) => {
  53. const url = URL.createObjectURL(data)
  54. download(url, '审计覆盖情况列表导出.xls')
  55. })
  56. .catch(() => {
  57. Message.error('导出失败')
  58. })
  59. }
  60. },
  61. },
  62. ],
  63. }
  64. },
  65. computed: {
  66. dataUrl() {
  67. return 'api/xcoa-mobile/v1/spicDecisionSupportCenter/getAuditedUnitList'
  68. },
  69. },
  70. mounted() {
  71. const params = this.$route.query.params
  72. setTimeout(() => {
  73. const str = JSON.parse(params).unitNames
  74. this.unitName = '审计覆盖情况:' + str.substring(1, str.length - 1)
  75. }, 1000)
  76. const year = this.$route.query.year
  77. this.columns.push({
  78. title: '序号',
  79. width: '80px',
  80. })
  81. this.columns.push({ title: '单位名称', dataIndex: '' })
  82. this.columns.push({ title: year - 2, dataIndex: '' })
  83. this.columns.push({ title: year - 1, dataIndex: '' })
  84. this.columns.push({ title: year, dataIndex: '' })
  85. },
  86. methods: {
  87. processRes(res) {
  88. return res
  89. },
  90. processReq(req) {
  91. const params = JSON.parse(this.$route.query.params)
  92. req.data = {
  93. ...req.data,
  94. ...params,
  95. }
  96. if (req.data.pageIndex === undefined) {
  97. req.data.pageIndex = req.data.startPosition
  98. }
  99. if (req.data.pageSize === undefined) {
  100. req.data.pageSize = 10
  101. }
  102. return req
  103. },
  104. },
  105. }
  106. </script>
  107. <style module lang="scss">
  108. @use '@/common/design' as *;
  109. .titlepoint {
  110. position: absolute;
  111. top: 12px;
  112. left: 20px;
  113. width: 8px;
  114. height: 27px;
  115. background: #1890ff;
  116. border-radius: 8px;
  117. }
  118. .toptitle {
  119. position: absolute;
  120. top: 9px;
  121. left: 40px;
  122. width: 800px;
  123. font-size: 22px;
  124. font-weight: bold;
  125. color: #404040;
  126. }
  127. </style>