audit-selectfind-modal.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. <template>
  2. <a-modal
  3. :body-style="bodyStyle"
  4. :title="title"
  5. :destroy-on-close="true"
  6. :visible="visible"
  7. :width="1800"
  8. @ok="handleOk"
  9. @cancel="handleCancel"
  10. >
  11. <a-card :bordered="false" :class="$style.newcard">
  12. <!-- 列表 -->
  13. <xmDataTableEx
  14. ref="findDataTable"
  15. class="findDataTablexm"
  16. :show-advance-btn="true"
  17. form-id="iamAuditReportFind"
  18. data-url="api/xcoa-mobile/v1/rectPlan-project/find-reportFind"
  19. :filter-expressions="filterExpressions"
  20. :check-type="'checkbox'"
  21. :columns="columns"
  22. :show-advance-query="false"
  23. :search-fields="['findTitle', 'findCode']"
  24. show-selection
  25. :process-res="processRes"
  26. @onChange="onChange"
  27. >
  28. <div slot="auditedUnitNames" slot-scope="text, record">
  29. {{
  30. text !== null
  31. ? text
  32. .split(',')
  33. .filter((item) => item.trim())
  34. .join(',')
  35. : ''
  36. }}
  37. </div>
  38. </xmDataTableEx>
  39. </a-card>
  40. </a-modal>
  41. </template>
  42. <script>
  43. import { Modal } from 'ant-design-vue'
  44. import xmDataTableEx from './table/xm-data-table-ex.vue'
  45. import components from './_import-components/audit-selectfind-modal-import'
  46. const columns = [
  47. {
  48. title: '序号',
  49. dataIndex: 'sortNumber',
  50. customRender: (text, record, index) => `${index + 1}`,
  51. width: '40px',
  52. },
  53. {
  54. title: '问题Id',
  55. dataIndex: 'id',
  56. sdHidden: true,
  57. },
  58. { dataIndex: 'findTitle', title: '问题名称', width: '40%' },
  59. { dataIndex: 'findCode', title: '问题编号' },
  60. {
  61. dataIndex: 'auditedUnitNames',
  62. title: '被审计单位',
  63. scopedSlots: { customRender: 'auditedUnitNames' },
  64. },
  65. { dataIndex: 'issuedUnits', title: '已下发单位' },
  66. ]
  67. export default {
  68. name: 'AuditSelectfindModal',
  69. metaInfo: {
  70. title: 'AuditSelectfindModal',
  71. },
  72. components: {
  73. ...components,
  74. xmDataTableEx,
  75. },
  76. props: {
  77. // 弹出窗标题
  78. title: {
  79. type: String,
  80. default: '请选择',
  81. },
  82. // 弹出窗宽度
  83. modalWidth: {
  84. type: String,
  85. default: '1800px',
  86. },
  87. // 弹出窗显示参数
  88. visible: {
  89. type: Boolean,
  90. default: false,
  91. },
  92. },
  93. data() {
  94. return {
  95. columns,
  96. bodyStyle: {
  97. padding: 0,
  98. minHight: '700px',
  99. },
  100. filterExpressions: [],
  101. }
  102. },
  103. methods: {
  104. handleOk(e) {
  105. if (this.$refs.findDataTable.getSelectedRowKeys().length === 0) {
  106. Modal.warning({
  107. title: '提示',
  108. content: '请选择项目!',
  109. })
  110. return false
  111. }
  112. this.$emit(
  113. 'Selectedfind',
  114. this.$refs.findDataTable.getSelectedRowKeys(),
  115. this.$refs.findDataTable.getSelectedRows()
  116. )
  117. this.$emit('closefind')
  118. },
  119. handleCancel(e) {
  120. // this.$parent.visible = !this.$parent.visible
  121. // this.$parent.visibleY = !this.$parent.visibleY
  122. this.$emit('closefind')
  123. },
  124. processRes(data) {
  125. let index = 0
  126. data.data.forEach((item) => {
  127. item.id = this.$refs.findDataTable.localPagination.current + '-' + index
  128. index++
  129. })
  130. return data
  131. },
  132. // 翻页操作
  133. onChange(pagination, filters, sorter) {
  134. this.pageSize = pagination.pageSize
  135. this.startPosition = (pagination.current - 1) * pagination.pageSize
  136. },
  137. },
  138. }
  139. </script>
  140. <style module lang="scss">
  141. @use '@/common/design' as *;
  142. :global(.findDataTablexm) {
  143. :global(.header_sd-data-table_common) {
  144. padding-right: 15px;
  145. }
  146. }
  147. </style>