|
@@ -83,6 +83,7 @@
|
|
|
<template slot-scope="scope">
|
|
|
<!-- <el-button size="small" v-if="scope.row.role == 0 && user.role == 1" @click="switchRole(scope.$index)">切换为管理员</el-button>
|
|
|
<el-button size="small" v-if="scope.row.role == 2 && user.role == 1" @click="switchRole(scope.$index)">切换为员工</el-button> -->
|
|
|
+ <el-button size="mini" type="default" v-if="scope.row.role == 1 && user.role == 1" @click="transferRole(scope.row)">转让</el-button>
|
|
|
<el-button size="mini" type="default" v-if="scope.row.role != 1" @click="resetPwd(scope.row)">重置</el-button>
|
|
|
<el-button size="mini" type="primary" v-if="scope.row.role != 1" @click="openInsertDialog(scope.$index)">编辑</el-button>
|
|
|
<el-button size="mini" type="primary" v-if="scope.row.role == 1" @click="openInsertDialog1(scope.$index)">编辑</el-button>
|
|
@@ -251,6 +252,31 @@
|
|
|
<el-button type="primary" @click="exportUsers">导出</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
+ <!-- 转让超级管理员权限 -->
|
|
|
+ <el-dialog title="权限转让" :visible.sync="transferDialog" width="550px" >
|
|
|
+ <el-form label-width="200px">
|
|
|
+ <el-form-item label="转让超级管理员角色至" >
|
|
|
+ <el-select v-model="toUserId" style="width:300px" filterable clearable>
|
|
|
+ <el-option v-for="item in allActiveUsers" :key="item.id" :value="item.id" :label="item.name">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="转让后自己的角色" >
|
|
|
+ <el-select v-model="myRoleId" style="width:300px">
|
|
|
+ <el-option v-for="item in roleDescArray" :label="item.label" :value="item.value" :key="item.name">
|
|
|
+ <span style="float: left">{{item.label}}</span>
|
|
|
+ <span style="float: right; color: #8492a6; font-size: 13px">{{item.desc}}</span>
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="default" @click="transferDialog = false">取消</el-button>
|
|
|
+ <el-button type="primary" @click="showConfirmDialog">确定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+
|
|
|
</section>
|
|
|
</template>
|
|
|
|
|
@@ -259,14 +285,20 @@
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
+ toUserId:null,
|
|
|
+ myRoleId: 2,
|
|
|
+ allActiveUsers:[],
|
|
|
+ transferDialog: false,
|
|
|
containInvalid:1,
|
|
|
exportDialogVisible: false,
|
|
|
- roleArray:["普通员工","超级管理员", "系统管理员", "公司高层","人事管理员", "项目管理员"],
|
|
|
+ roleArray:["普通员工","超级管理员", "系统管理员", "公司高层","人事管理员", "项目管理员","公司领导"],
|
|
|
roleDescArray:[{label:"普通员工",value:0, desc:"填报日报,参与项目协作"},
|
|
|
{label:"系统管理员",value:2, desc:"具有除了创建系统管理员之外的全部功能"},
|
|
|
- {label:"公司高层",value:3, desc:"查阅项目信息,人员工时和成本情况"},
|
|
|
- {label:"人事管理员",value:4, desc:"负责组织架构管理,薪资信息维护"},
|
|
|
- {label:"项目管理员",value:5, desc:"创建和管理项目"}],
|
|
|
+ {label:"公司高层",value:3, desc:"查阅项目信息,人员工时情况"},
|
|
|
+ {label:"人事管理员",value:4, desc:"财务核算成本,负责组织架构和薪资管理"},
|
|
|
+ {label:"项目管理员",value:5, desc:"创建和管理项目"},
|
|
|
+ {label:"公司领导",value:6, desc:"财务核算成本,查阅项目、人员工时和成本情况"},
|
|
|
+ ],
|
|
|
userSalaryList:[],
|
|
|
userSalaryListDialog: false,
|
|
|
value:{},
|
|
@@ -336,11 +368,70 @@
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
+ showConfirmDialog() {
|
|
|
+ if (this.toUserId == null || this.toUserId == '') {
|
|
|
+ this.$message({
|
|
|
+ message: '请选择要转让的人员',
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.$confirm("您将失去超级管理员角色,需要重新登录。确定要转让吗?", "提示", {
|
|
|
+ //type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ this.http.post('/user/changeSysManager', {
|
|
|
+ toUserId: this.toUserId,
|
|
|
+ myRoleId: this.myRoleId
|
|
|
+ },
|
|
|
+ res => {
|
|
|
+ if (res.code == "ok") {
|
|
|
+ sessionStorage.removeItem("user");
|
|
|
+ this.$router.push("/login");
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+ });
|
|
|
+ },
|
|
|
+ transferRole() {
|
|
|
+ this.transferDialog = true;
|
|
|
+ this.http.post(this.port.manage.list, {
|
|
|
+ departmentId: -1,
|
|
|
+ pageIndex: 1,
|
|
|
+ pageSize: 99999
|
|
|
+ },
|
|
|
+ res => {
|
|
|
+ if (res.code == "ok") {
|
|
|
+ this.allActiveUsers = res.data.records.filter(u=>u.isActive == 1);
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
showExportDialog() {
|
|
|
this.exportDialogVisible = true;
|
|
|
},
|
|
|
exportUsers() {
|
|
|
-
|
|
|
this.http.post('/user/exportUsers', {
|
|
|
containInvalid: this.containInvalid
|
|
|
},
|