123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- <template>
- <!-- 控制点分类树 -->
- <a-modal
- :visible="catvisible"
- title="请选择"
- width="700px"
- :destroy-on-close="true"
- @ok="handlecatOk"
- @cancel="handlecatCancel"
- >
- <ic-measure-catalog-tree
- ref="mtxprocesstree"
- show-line
- top-node-text="内控矩阵"
- :is-select-dep="true"
- manager-type="view"
- :classstyle="true"
- :history="true"
- :hisv="this.versionId"
- :hisorg="this.orgId"
- :hisorgn="this.orgName"
- :selecttype="this.selecttype"
- :selectedKeys="this.selectedKeys"
- :single="single"
- @treeSelect="treeSelect"
- @treeCheck="treeCheck"
- ></ic-measure-catalog-tree>
- </a-modal>
- </template>
- <script>
- import { Modal, Message } from 'ant-design-vue'
- import icMeasureCatalogTree from './ic-measure-catalog-tree.vue'
- import components from './_import-components/ic-measure-select-import'
- export default {
- name: 'IcMeasureSelect',
- metaInfo: {
- title: 'IcMeasureSelect',
- },
- components: { ...components, icMeasureCatalogTree },
- props: {
- // 是否单选
- single: {
- type: Boolean,
- default: false,
- },
- // 弹出窗标题
- title: {
- type: String,
- default: '请选择',
- },
- // catvisible: {
- // type: Boolean,
- // default: false,
- // },
- versionId: {
- type: String,
- default: '271',
- },
- orgId: {
- type: String,
- default: '364',
- },
- orgName: {
- type: String,
- default: '江苏分公司',
- },
- selecttype: {
- type: String,
- default: 'control',
- },
- selectedKeys: {
- type: Array,
- default: function() {
- return []
- },
- },
- },
- data() {
- return {
- cat: null,
- catvisible: false,
- }
- },
- methods: {
- treeCheck(checked, info) {
- const checklist = []
- info.forEach((i) => {
- if (this.selectedKeys.indexOf(i.data.props.id) === -1) {
- let id = i.data.props.id.toString()
- if (id.indexOf('1000') > -1) {
- id = id.substring(4, id.length)
- }
- checklist.push(id)
- }
- })
- this.cat = checklist
- },
- treeSelect(select, info) {
- const id = info.selectedNodes[0].data.props.id
- this.cat = null
- if (info.selectedNodes[0].data.props.props) {
- if (info.selectedNodes[0].data.props.props.isEnd === '1') {
- if (id !== -1) {
- this.cat = id
- } else {
- this.cat = -1
- }
- } else {
- Modal.info({
- content: '请选择末级分类节点',
- })
- }
- }
- },
- handlecatOk() {
- if (this.cat !== null) {
- // this.$refs.docform.setFieldValue('mtxPrcPath', this.catpath)
- // this.$refs.docform.setFieldValue('mtxPrcId', this.catId)
- this.showtree()
- this.$emit('fnqd', this.cat)
- this.cat = null
- } else {
- Modal.warning({
- title: '提示',
- content: '请选择节点!',
- })
- return false
- }
- },
- handlecatCancel() {
- this.showtree()
- },
- showtree() {
- this.catvisible = !this.catvisible
- if (this.catvisible) {
- setTimeout(() => {
- this.$refs.mtxprocesstree.initDeptList('')
- }, 1000)
- }
- },
- },
- }
- </script>
- <style module lang="scss">
- @use '@/common/design' as *;
- </style>
|