ic-measure-select.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <template>
  2. <!-- 控制点分类树 -->
  3. <a-modal
  4. :visible="catvisible"
  5. title="请选择"
  6. width="700px"
  7. :destroy-on-close="true"
  8. @ok="handlecatOk"
  9. @cancel="handlecatCancel"
  10. >
  11. <ic-measure-catalog-tree
  12. ref="mtxprocesstree"
  13. show-line
  14. top-node-text="内控矩阵"
  15. :is-select-dep="true"
  16. manager-type="view"
  17. :classstyle="true"
  18. :history="true"
  19. :hisv="this.versionId"
  20. :hisorg="this.orgId"
  21. :hisorgn="this.orgName"
  22. :selecttype="this.selecttype"
  23. :selectedKeys="this.selectedKeys"
  24. :single="single"
  25. @treeSelect="treeSelect"
  26. @treeCheck="treeCheck"
  27. ></ic-measure-catalog-tree>
  28. </a-modal>
  29. </template>
  30. <script>
  31. import { Modal, Message } from 'ant-design-vue'
  32. import icMeasureCatalogTree from './ic-measure-catalog-tree.vue'
  33. import components from './_import-components/ic-measure-select-import'
  34. export default {
  35. name: 'IcMeasureSelect',
  36. metaInfo: {
  37. title: 'IcMeasureSelect',
  38. },
  39. components: { ...components, icMeasureCatalogTree },
  40. props: {
  41. // 是否单选
  42. single: {
  43. type: Boolean,
  44. default: false,
  45. },
  46. // 弹出窗标题
  47. title: {
  48. type: String,
  49. default: '请选择',
  50. },
  51. // catvisible: {
  52. // type: Boolean,
  53. // default: false,
  54. // },
  55. versionId: {
  56. type: String,
  57. default: '271',
  58. },
  59. orgId: {
  60. type: String,
  61. default: '364',
  62. },
  63. orgName: {
  64. type: String,
  65. default: '江苏分公司',
  66. },
  67. selecttype: {
  68. type: String,
  69. default: 'control',
  70. },
  71. selectedKeys: {
  72. type: Array,
  73. default: function() {
  74. return []
  75. },
  76. },
  77. },
  78. data() {
  79. return {
  80. cat: null,
  81. catvisible: false,
  82. }
  83. },
  84. methods: {
  85. treeCheck(checked, info) {
  86. const checklist = []
  87. info.forEach((i) => {
  88. if (this.selectedKeys.indexOf(i.data.props.id) === -1) {
  89. let id = i.data.props.id.toString()
  90. if (id.indexOf('1000') > -1) {
  91. id = id.substring(4, id.length)
  92. }
  93. checklist.push(id)
  94. }
  95. })
  96. this.cat = checklist
  97. },
  98. treeSelect(select, info) {
  99. const id = info.selectedNodes[0].data.props.id
  100. this.cat = null
  101. if (info.selectedNodes[0].data.props.props) {
  102. if (info.selectedNodes[0].data.props.props.isEnd === '1') {
  103. if (id !== -1) {
  104. this.cat = id
  105. } else {
  106. this.cat = -1
  107. }
  108. } else {
  109. Modal.info({
  110. content: '请选择末级分类节点',
  111. })
  112. }
  113. }
  114. },
  115. handlecatOk() {
  116. if (this.cat !== null) {
  117. // this.$refs.docform.setFieldValue('mtxPrcPath', this.catpath)
  118. // this.$refs.docform.setFieldValue('mtxPrcId', this.catId)
  119. this.showtree()
  120. this.$emit('fnqd', this.cat)
  121. this.cat = null
  122. } else {
  123. Modal.warning({
  124. title: '提示',
  125. content: '请选择节点!',
  126. })
  127. return false
  128. }
  129. },
  130. handlecatCancel() {
  131. this.showtree()
  132. },
  133. showtree() {
  134. this.catvisible = !this.catvisible
  135. if (this.catvisible) {
  136. setTimeout(() => {
  137. this.$refs.mtxprocesstree.initDeptList('')
  138. }, 1000)
  139. }
  140. },
  141. },
  142. }
  143. </script>
  144. <style module lang="scss">
  145. @use '@/common/design' as *;
  146. </style>