diff --git a/jero-web/src/components/PersonnelSelection/index.vue b/jero-web/src/components/PersonnelSelection/index.vue index 3d3740b2c..41d1778c0 100644 --- a/jero-web/src/components/PersonnelSelection/index.vue +++ b/jero-web/src/components/PersonnelSelection/index.vue @@ -132,7 +132,7 @@ this.treeVisible = false }, handleSubmit() { - if (this.userIds && this.userIds.length > 0) { + // if (this.userIds && this.userIds.length > 0) { if (this.isSingleChoice) { if (this.userIds.length > 1) { this.$message.warning(this.$t('onlyOnePersonCanBeSelected')) @@ -145,9 +145,9 @@ this.$emit('change', this.query.db_field_name, userIds.join(',')) this.visible = false this.treeVisible = false - } else { - this.$message.warning(this.$t('pleaseSelectPersonFirst')) - } + // } else { + // this.$message.warning(this.$t('pleaseSelectPersonFirst')) + // } }, indexclick(event) { this.$emit('input', event.target.value) diff --git a/jero-web/src/components/setCreator/index.vue b/jero-web/src/components/setCreator/index.vue index 244e64594..259c808b4 100644 --- a/jero-web/src/components/setCreator/index.vue +++ b/jero-web/src/components/setCreator/index.vue @@ -56,6 +56,8 @@ userIds: [], departId: '', defaultExpandedKeys: [], + content: [], + userName: [], submitLoading: false, visibleTree: false } @@ -66,6 +68,8 @@ methods: { getPush(data) { this.tableKey = data + this.userName = [] + this.content = [] this.searchModel = '' this.visible = true this.visibleTree = false @@ -95,7 +99,7 @@ handleSubmit() { let query = { id: this.tableKey, - createBy: this.userIds.join(','), + createBy: this.userName.join(',') } this.submitLoading = true this.confirmLoading = true @@ -152,8 +156,41 @@ } }) }, - checkChange(e) { + checkChange(e, info) { this.userIds = e + this.userName = [] + if (info.checkedNodes && info.checkedNodes.length > 0) { + info.checkedNodes.forEach(res => { + if (res.data.props.dataRef.key) { + this.content.push({ + id: res.data.props.dataRef.key, + title: res.data.props.dataRef.title + }) + } else { + this.content.push({ + id: res.data.props.id, + title: res.data.props.title + }) + } + }) + } + if (this.content && this.content.length > 0) { + for (let i = 0; i < this.content.length; i++) { + for (let j = i + 1; j < this.content.length; j++) { + if (this.content[i].id == this.content[j].id) { + this.content.splice(j, 1) + j-- + } + } + } + this.userIds.forEach(res => { + this.content.forEach(val => { + if (res == val.id) { + this.userName.push(val.title) + } + }) + }) + } } } } @@ -181,7 +218,7 @@ .drawer-bootom-button { position: absolute; bottom: 0; - z-index:100; + z-index: 100; width: 100%; border-top: 1px solid #e8e8e8; padding: 10px 16px;