spic-audit-dsc-coverage-list.vue 4.0 KB

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