@@ -1100,32 +1100,36 @@
|
|||||||
this.modalshowflag2 = true
|
this.modalshowflag2 = true
|
||||||
},
|
},
|
||||||
checkedRole2 (data) {
|
checkedRole2 (data) {
|
||||||
|
|
||||||
let idList = ''
|
let idList = ''
|
||||||
let nameList = ''
|
let nameList = ''
|
||||||
let bmIdList = ''
|
|
||||||
let bmNameList = ''
|
|
||||||
data.forEach( item => {
|
data.forEach( item => {
|
||||||
if (nameList.length > 0) {
|
if (nameList.length > 0) {
|
||||||
nameList += ','
|
nameList += ','
|
||||||
idList += ','
|
idList += ','
|
||||||
bmIdList += ','
|
|
||||||
bmNameList += ','
|
|
||||||
}
|
}
|
||||||
idList += item.id
|
idList += item.id
|
||||||
nameList += item.name
|
nameList += item.name
|
||||||
bmIdList += item.topUnitId
|
|
||||||
bmNameList += item.topUnit
|
|
||||||
})
|
})
|
||||||
|
|
||||||
if (this.type === 'resPerson') {
|
if (this.type === 'resPerson') {
|
||||||
this.addForm.resPerson = idList
|
this.addForm.resPerson = idList
|
||||||
this.addForm.resPersonName = nameList
|
this.addForm.resPersonName = nameList
|
||||||
} else if (this.type === 'drafter') {
|
} else if (this.type === 'drafter') {
|
||||||
this.addForm.drafter = idList
|
this.addForm.drafter = idList
|
||||||
this.addForm.drafterName = nameList
|
this.addForm.drafterName = nameList
|
||||||
this.addForm.unitName = bmNameList
|
if(data && data.length > 0){
|
||||||
this.addForm.unit = bmIdList
|
const institutionIdList = this.unique(data.map(item => item.topUnitId)).join(",")
|
||||||
|
const institutionNameList = this.unique(data.map(item => item.topUnit)).join(",")
|
||||||
|
this.addForm.unitName = institutionNameList
|
||||||
|
this.addForm.unit = institutionIdList
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
unique(newArr) {
|
||||||
|
const res = new Map();
|
||||||
|
return newArr.filter((newArr) => !res.has(newArr) && res.set(newArr, 1));
|
||||||
|
},
|
||||||
addDrawerSubmit () {
|
addDrawerSubmit () {
|
||||||
this.$refs['addForm'].validate((valid) => {
|
this.$refs['addForm'].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
|||||||
Reference in New Issue
Block a user