|
@@ -38,7 +38,7 @@
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
<el-form-item label="用户角色">
|
|
|
- <el-select v-model="form.roleId" :disabled="isDetail" multiple collapse-tags placeholder="无">
|
|
|
+ <el-select v-model="form.role" multiple collapse-tags placeholder="无">
|
|
|
<el-option v-for="item in roleArr" :key="item.roleId" :label="item.roleName" :value="item.roleId"/>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
@@ -68,7 +68,7 @@
|
|
|
},
|
|
|
methods: {
|
|
|
save() {
|
|
|
- UpdateUserRole(this.$route.params.id, this.form.roleId).then(res => {
|
|
|
+ UpdateUserRole(this.$route.params.id, this.form.role).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
this.$message({type: 'success', message: '保存成功'});
|
|
|
this.$router.push({
|
|
@@ -99,11 +99,12 @@
|
|
|
getUserInfo() {
|
|
|
GetUserInfoById(this.$route.params.id).then(res => {
|
|
|
if(res.code == 200) {
|
|
|
- let formTemp = res.data.Rows[0]
|
|
|
- if(res.data.Rows[0].roleId) {
|
|
|
- formTemp.roleId = [res.data.Rows[0].roleId]
|
|
|
- }else {
|
|
|
- formTemp.roleId = []
|
|
|
+ let formTemp = JSON.parse(JSON.stringify(res.data))
|
|
|
+ formTemp.role = []
|
|
|
+ if(res.data.role[0]) {
|
|
|
+ res.data.role.forEach(i => {
|
|
|
+ formTemp.role.push(i.roleId)
|
|
|
+ })
|
|
|
}
|
|
|
this.form = formTemp
|
|
|
}
|