修改人员选择的限制
This commit is contained in:
@@ -132,7 +132,7 @@
|
|||||||
this.treeVisible = false
|
this.treeVisible = false
|
||||||
},
|
},
|
||||||
handleSubmit() {
|
handleSubmit() {
|
||||||
if (this.userIds && this.userIds.length > 0) {
|
// if (this.userIds && this.userIds.length > 0) {
|
||||||
if (this.isSingleChoice) {
|
if (this.isSingleChoice) {
|
||||||
if (this.userIds.length > 1) {
|
if (this.userIds.length > 1) {
|
||||||
this.$message.warning(this.$t('onlyOnePersonCanBeSelected'))
|
this.$message.warning(this.$t('onlyOnePersonCanBeSelected'))
|
||||||
@@ -145,9 +145,9 @@
|
|||||||
this.$emit('change', this.query.db_field_name, userIds.join(','))
|
this.$emit('change', this.query.db_field_name, userIds.join(','))
|
||||||
this.visible = false
|
this.visible = false
|
||||||
this.treeVisible = false
|
this.treeVisible = false
|
||||||
} else {
|
// } else {
|
||||||
this.$message.warning(this.$t('pleaseSelectPersonFirst'))
|
// this.$message.warning(this.$t('pleaseSelectPersonFirst'))
|
||||||
}
|
// }
|
||||||
},
|
},
|
||||||
indexclick(event) {
|
indexclick(event) {
|
||||||
this.$emit('input', event.target.value)
|
this.$emit('input', event.target.value)
|
||||||
|
|||||||
@@ -56,6 +56,8 @@
|
|||||||
userIds: [],
|
userIds: [],
|
||||||
departId: '',
|
departId: '',
|
||||||
defaultExpandedKeys: [],
|
defaultExpandedKeys: [],
|
||||||
|
content: [],
|
||||||
|
userName: [],
|
||||||
submitLoading: false,
|
submitLoading: false,
|
||||||
visibleTree: false
|
visibleTree: false
|
||||||
}
|
}
|
||||||
@@ -66,6 +68,8 @@
|
|||||||
methods: {
|
methods: {
|
||||||
getPush(data) {
|
getPush(data) {
|
||||||
this.tableKey = data
|
this.tableKey = data
|
||||||
|
this.userName = []
|
||||||
|
this.content = []
|
||||||
this.searchModel = ''
|
this.searchModel = ''
|
||||||
this.visible = true
|
this.visible = true
|
||||||
this.visibleTree = false
|
this.visibleTree = false
|
||||||
@@ -95,7 +99,7 @@
|
|||||||
handleSubmit() {
|
handleSubmit() {
|
||||||
let query = {
|
let query = {
|
||||||
id: this.tableKey,
|
id: this.tableKey,
|
||||||
createBy: this.userIds.join(','),
|
createBy: this.userName.join(',')
|
||||||
}
|
}
|
||||||
this.submitLoading = true
|
this.submitLoading = true
|
||||||
this.confirmLoading = true
|
this.confirmLoading = true
|
||||||
@@ -152,8 +156,41 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
checkChange(e) {
|
checkChange(e, info) {
|
||||||
this.userIds = e
|
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 {
|
.drawer-bootom-button {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
z-index:100;
|
z-index: 100;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border-top: 1px solid #e8e8e8;
|
border-top: 1px solid #e8e8e8;
|
||||||
padding: 10px 16px;
|
padding: 10px 16px;
|
||||||
|
|||||||
Reference in New Issue
Block a user