修改bug 52218 选人组件,针对选择多人的情况,选择的人员按顺序显示

This commit is contained in:
zhangyichen
2022-04-07 15:36:22 +08:00
parent d9d11f5f60
commit dc15b1e391
2 changed files with 18 additions and 1 deletions
+16 -1
View File
@@ -125,6 +125,7 @@
data () {
return {
visible: false,
selectList: [],
nodeList2: [],
delList: [],
roleList: [],
@@ -300,7 +301,21 @@
this.delList = [data]
}
} else { // 多选
this.roleList = this.$refs.tree.getCheckedNodes().concat(this.$refs.tree.getHalfCheckedNodes())
if (this.roleList.length === 0) {
this.roleList.push(data)
} else {
let delFlag = true
this.roleList.forEach((item, index) => {
if (item.id === data.id) {
this.roleList.splice(index, 1)
delFlag = false
}
})
if (delFlag) {
this.roleList.push(data)
}
}
// this.roleList = this.$refs.tree.getCheckedNodes().concat(this.$refs.tree.getHalfCheckedNodes())
}
},
loadNode(node, resolve) {
@@ -2707,6 +2707,7 @@ export default {
this.modalShowRoleFlag = true
},
checkedRole2(data) {
console.log(data, '哈哈哈哈')
let idList = ''
let nameList = ''
data.forEach(item => {
@@ -2717,6 +2718,7 @@ export default {
idList += item.id
nameList += item.name
})
console.log(nameList , '额鹅鹅鹅饿')
if (this.drawerTitle === '选择我司署名人') {
this.sarStandardsInfoEO['WSSMR'] = nameList
} else if (this.drawerTitle === '选择责任工程师') {