|
@@ -115,7 +115,7 @@
|
|
|
</div>
|
|
</div>
|
|
|
<div class="flex flex-col" style="margin-top: -10px">
|
|
<div class="flex flex-col" style="margin-top: -10px">
|
|
|
<div class="flex flex-align-center">
|
|
<div class="flex flex-align-center">
|
|
|
- <span class="bold ml-20">权限选择</span>
|
|
|
|
|
|
|
+ <span class="bold ml-20">管理股室</span>
|
|
|
<el-checkbox
|
|
<el-checkbox
|
|
|
size="large"
|
|
size="large"
|
|
|
style="margin-left: 33px"
|
|
style="margin-left: 33px"
|
|
@@ -162,7 +162,7 @@
|
|
|
<route>
|
|
<route>
|
|
|
{
|
|
{
|
|
|
name: '用户管理',
|
|
name: '用户管理',
|
|
|
-meta: { keepAlive: true }
|
|
|
|
|
|
|
+meta: { 'back':true}
|
|
|
}
|
|
}
|
|
|
</route>
|
|
</route>
|
|
|
|
|
|
|
@@ -273,8 +273,8 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
|
- this.getJobList()
|
|
|
|
|
this.getOrg()
|
|
this.getOrg()
|
|
|
|
|
+ this.getJobList()
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
onLoad() {
|
|
onLoad() {
|
|
@@ -326,26 +326,27 @@ export default {
|
|
|
this.userInfoForm.realName = this.form.realName
|
|
this.userInfoForm.realName = this.form.realName
|
|
|
this.userInfoForm.phone = this.form.phone
|
|
this.userInfoForm.phone = this.form.phone
|
|
|
this.userInfoForm.password = this.form.password
|
|
this.userInfoForm.password = this.form.password
|
|
|
|
|
+ this.userInfoForm.deptId = this.form.deptId
|
|
|
this.jobs.find(e => {
|
|
this.jobs.find(e => {
|
|
|
const temp = this.form.roleId.split(',').find(sub => sub === e.id)
|
|
const temp = this.form.roleId.split(',').find(sub => sub === e.id)
|
|
|
if (temp) {
|
|
if (temp) {
|
|
|
this.userInfoForm.roleIds = temp
|
|
this.userInfoForm.roleIds = temp
|
|
|
}
|
|
}
|
|
|
|
|
+ return 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)
|
|
|
|
|
- if (tmp > -1) {
|
|
|
|
|
- this.deptList[tmp].checked = true
|
|
|
|
|
|
|
+ this.$api.role.managerList({ userId: this.form.id }).then(res => {
|
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
|
+ res.data.forEach(ele => {
|
|
|
|
|
+ const tmp = this.deptList.findIndex(sub => sub.id === ele.deptId)
|
|
|
|
|
+ if (tmp > -1) {
|
|
|
|
|
+ this.deptList[tmp].checked = true
|
|
|
|
|
+ }
|
|
|
|
|
+ this.userInfoForm.deptIds = this.deptList.map(e => e.id)
|
|
|
|
|
+ })
|
|
|
|
|
+ this.showEdit = true
|
|
|
}
|
|
}
|
|
|
- console.log(this.deptList)
|
|
|
|
|
})
|
|
})
|
|
|
|
|
+ } else if (type === 'add') {
|
|
|
this.showEdit = true
|
|
this.showEdit = true
|
|
|
} else {
|
|
} else {
|
|
|
done()
|
|
done()
|
|
@@ -365,7 +366,7 @@ export default {
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
getOrg() {
|
|
getOrg() {
|
|
|
- this.$api.common.deptList().then(res => {
|
|
|
|
|
|
|
+ this.$api.role.deptList().then(res => {
|
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
|
this.showOrg = true
|
|
this.showOrg = true
|
|
|
this.deptList = res.data.map(e => {
|
|
this.deptList = res.data.map(e => {
|
|
@@ -393,7 +394,9 @@ export default {
|
|
|
const tmp = this.deptList.find(ele => ele.id === item.id)
|
|
const tmp = this.deptList.find(ele => ele.id === item.id)
|
|
|
if (tmp) {
|
|
if (tmp) {
|
|
|
if (tmp.checked) {
|
|
if (tmp.checked) {
|
|
|
- this.userInfoForm.deptIds.push(tmp.id)
|
|
|
|
|
|
|
+ if (this.userInfoForm.deptIds.findIndex(e => e === tmp.id) === -1) {
|
|
|
|
|
+ this.userInfoForm.deptIds.push(tmp.id)
|
|
|
|
|
+ }
|
|
|
} else {
|
|
} else {
|
|
|
this.userInfoForm.deptIds = this.userInfoForm.deptIds.filter(
|
|
this.userInfoForm.deptIds = this.userInfoForm.deptIds.filter(
|
|
|
ele => ele !== tmp.id
|
|
ele => ele !== tmp.id
|
|
@@ -415,6 +418,8 @@ export default {
|
|
|
this.showEdit = false
|
|
this.showEdit = false
|
|
|
this.$message.success(res.msg)
|
|
this.$message.success(res.msg)
|
|
|
this.onLoad()
|
|
this.onLoad()
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message.error(res.msg)
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|