|
|
@@ -294,6 +294,12 @@ export default {
|
|
|
this.userInfoForm.roleIds = temp
|
|
|
}
|
|
|
})
|
|
|
+ this.deptList.find(e => {
|
|
|
+ const dp = this.form.deptId.split(',').find(sub => sub === e.id)
|
|
|
+ if (dp) {
|
|
|
+ this.userInfoForm.deptId = dp
|
|
|
+ }
|
|
|
+ })
|
|
|
// this.form.deptId.split(',').forEach(ele => {
|
|
|
// const tmp = this.deptList.findIndex(sub => sub.id === ele)
|
|
|
// console.log(tmp)
|
|
|
@@ -359,7 +365,9 @@ export default {
|
|
|
},
|
|
|
roleSave() {
|
|
|
let data = this.userInfoForm
|
|
|
- data.deptIds = data.deptIds.join(',')
|
|
|
+ if (data.deptIds.length > 0) {
|
|
|
+ data.deptIds = data.deptIds.join(',')
|
|
|
+ }
|
|
|
this.$api.role.roleSave(data).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
this.showEdit = false
|