|
|
|
@ -88,11 +88,11 @@ |
|
|
|
|
<el-form-item prop="userName" label="用户姓名"> |
|
|
|
|
<el-input v-model="form.userName" placeholder="请输入员工姓名"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item prop="roleId" label="账号角色"> |
|
|
|
|
<el-checkbox-group v-model="form.roleId" :max="2"> |
|
|
|
|
<el-form-item prop="roleIds" label="账号角色"> |
|
|
|
|
<el-checkbox-group v-model="form.roleIds"> |
|
|
|
|
<el-checkbox label="user" disabled>用户</el-checkbox> |
|
|
|
|
<template v-for="(item,index) in roleList"> |
|
|
|
|
<el-checkbox v-if="item.roleName != '超级管理员'" :key="index" :label="item.id" :disabled="item.id == 'user'" @change="changeRole">{{item.roleName}}</el-checkbox> |
|
|
|
|
<el-checkbox v-if="item.roleName != '超级管理员'" :key="index" :label="item.id" :disabled="item.id == 'user'">{{item.roleName}}</el-checkbox> |
|
|
|
|
</template> |
|
|
|
|
</el-checkbox-group> |
|
|
|
|
</el-form-item> |
|
|
|
@ -187,7 +187,7 @@ export default { |
|
|
|
|
userId: '', |
|
|
|
|
accountId: '', |
|
|
|
|
userName: '', |
|
|
|
|
roleId: ['user'], |
|
|
|
|
roleIds: ['user'], |
|
|
|
|
phone: '', |
|
|
|
|
uniqueIdentification: '', |
|
|
|
|
workNumber: '', |
|
|
|
@ -305,6 +305,7 @@ export default { |
|
|
|
|
this.page = 1 |
|
|
|
|
this.getData() |
|
|
|
|
}, |
|
|
|
|
// 获取全部角色 |
|
|
|
|
getRole(){ |
|
|
|
|
this.$get(`${this.api.listRole}?page=1&size=1000&name=&platformId=${Setting.platformId}`).then(res => { |
|
|
|
|
this.roleList = res.rolePage.records |
|
|
|
@ -388,9 +389,6 @@ export default { |
|
|
|
|
this.isDetail = true |
|
|
|
|
this.getDetail(row.accountId) |
|
|
|
|
}, |
|
|
|
|
changeRole(val){ |
|
|
|
|
console.log(11,val) |
|
|
|
|
}, |
|
|
|
|
confirm(){ |
|
|
|
|
this.$refs.form.validate((valid) => { |
|
|
|
|
if (valid) { |
|
|
|
@ -404,11 +402,11 @@ export default { |
|
|
|
|
|
|
|
|
|
// 每个用户都有个默认的角色,就是"用户",这是个基础角色,而"用户"的roleId是0,这是写死的 |
|
|
|
|
// 如果没选择任何角色,则只有一个不可勾选的"用户"角色,则把roleId赋值为0 |
|
|
|
|
if(data.roleId.length == 1){ |
|
|
|
|
data.roleId = '0' |
|
|
|
|
if(data.roleIds.length == 1){ |
|
|
|
|
data.roleIds = ['0'] |
|
|
|
|
}else{ |
|
|
|
|
// 目前的用户角色只支持勾选一个角色,如果固定取索引为1的角色id |
|
|
|
|
data.roleId = data.roleId[1] |
|
|
|
|
// 第一个角色是用户,该角色不用传给后端,只需要传非用户的角色 |
|
|
|
|
data.roleIds = data.roleIds.slice(1) |
|
|
|
|
} |
|
|
|
|
if(this.form.userId){ |
|
|
|
|
this.$post(this.api.modifyUser,data).then(res => { |
|
|
|
@ -441,7 +439,7 @@ export default { |
|
|
|
|
account: row.account, |
|
|
|
|
accountId: row.accountId, |
|
|
|
|
isEnable: val, |
|
|
|
|
roleId: row.roleId, |
|
|
|
|
roleIds: row.roleId, |
|
|
|
|
userId: row.userId, |
|
|
|
|
userName: row.userName, |
|
|
|
|
workNumber: row.workNumber, |
|
|
|
|