feat: There is no way the, #56326 #56321

This commit is contained in:
396572590@qq.com
2022-07-05 18:06:02 +08:00
parent e20bed2a8a
commit ec138c9f44
@@ -1100,32 +1100,36 @@
this.modalshowflag2 = true
},
checkedRole2 (data) {
let idList = ''
let nameList = ''
let bmIdList = ''
let bmNameList = ''
data.forEach( item => {
if (nameList.length > 0) {
nameList += ','
idList += ','
bmIdList += ','
bmNameList += ','
}
idList += item.id
nameList += item.name
bmIdList += item.topUnitId
bmNameList += item.topUnit
})
if (this.type === 'resPerson') {
this.addForm.resPerson = idList
this.addForm.resPersonName = nameList
} else if (this.type === 'drafter') {
this.addForm.drafter = idList
this.addForm.drafterName = nameList
this.addForm.unitName = bmNameList
this.addForm.unit = bmIdList
if(data && data.length > 0){
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 () {
this.$refs['addForm'].validate((valid) => {
if (valid) {