|
|
@@ -37,12 +37,12 @@
|
|
|
@click="deleteroledata(scope.row)"></el-button>
|
|
|
<el-button size="small" type="text" style="margin-left:6px" title="用户列表" @click="showUserList(scope.row)"><i
|
|
|
class="icon icon-user"></i></el-button>
|
|
|
- <el-button size="small" type="text" style="margin-left:6px" title="菜单权限" @click="setpower(scope.row)"><i
|
|
|
- class="icon icon-file-text"></i></el-button>
|
|
|
- <el-button size="small" type="text" style="margin-left:6px" title="操作权限" @click="getItemPower(scope.row)"><i
|
|
|
- class="icon icon-lock"></i></el-button>
|
|
|
+ <el-button size="small" type="text" v-if="adminpermission == 1" style="margin-left:6px" title="菜单权限"
|
|
|
+ @click="setpower(scope.row)"><i class="icon icon-file-text"></i></el-button>
|
|
|
+ <el-button size="small" type="text" v-if="adminpermission == 1" style="margin-left:6px" title="操作权限"
|
|
|
+ @click="getItemPower(scope.row)"><i class="icon icon-lock"></i></el-button>
|
|
|
<el-button size="small" type="text" style="margin-left:6px" title="角色" @click="setRoleManage(scope.row.Id)"
|
|
|
- v-if="appclient == 'gfgl'"><i class="icon icon-cog"></i></el-button>
|
|
|
+ v-if="appclient == 'gfgl'&&adminpermission == 1"><i class="icon icon-cog"></i></el-button>
|
|
|
<!-- <el-button size="small" type="text" style="margin-left:3px" title="容器权限" @click="setequipmentpower(scope.row)"
|
|
|
v-if="appclient != 'lims'"><i class="icon icon-cog"></i></el-button> -->
|
|
|
<el-button size="small" type="text" style="margin-left:6px" title="资源权限-部门"
|
|
|
@@ -85,7 +85,11 @@
|
|
|
<el-dialog title="包含用户列表" :visible.sync="userDialogVisible">
|
|
|
<el-button type="primary" size="mini" style="float: right; margin-top: -10px;margin-left :5px"
|
|
|
@click="deleteuserdataall()">删除所有关联用户</el-button>
|
|
|
- <el-button type="primary" size="mini" style="float: right; margin-top: -10px" @click="roleadduser()">添加
|
|
|
+ <el-button type="primary" size="mini" style="float: right; margin-top: -10px" v-if="adminpermission == 0"
|
|
|
+ @click="roleadduser()">添加
|
|
|
+ </el-button>
|
|
|
+ <el-button type="primary" size="mini" style="float: right; margin-top: -10px" v-if="adminpermission == 1"
|
|
|
+ @click="roleadduseradmin()">添加
|
|
|
</el-button>
|
|
|
<br />
|
|
|
<el-table :data="userList" border>
|
|
|
@@ -97,6 +101,7 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="Username" align="center" label="账号" show-overflow-tooltip></el-table-column>
|
|
|
<el-table-column prop="Realname" align="center" label="用户名"></el-table-column>
|
|
|
+ <el-table-column prop="Unit" align="center" label="二级单位名称"></el-table-column>
|
|
|
<el-table-column prop="Departmentname" align="center" label="所属组织"></el-table-column>
|
|
|
<el-table-column prop="Telephone" align="center" label="手机" show-overflow-tooltip></el-table-column>
|
|
|
<el-table-column label="座机" align="center" prop="Mobile" show-overflow-tooltip></el-table-column>
|
|
|
@@ -113,6 +118,41 @@
|
|
|
<el-button @click="userDialogVisible = false">取 消</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+ <!-- 超级添加用户 -->
|
|
|
+ <el-dialog title="添加用户" :visible="adminadduser" top="5vh" width="800px">
|
|
|
+ <el-form label-width="110px">
|
|
|
+ <el-row :gutter="10">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-card style="width: 100%;height: calc(100vh - 283px);overflow: auto;margin-top:0px">
|
|
|
+ <div slot="header" class="clearfix">
|
|
|
+ <span>请选择部门</span>
|
|
|
+ </div>
|
|
|
+ <el-tree :data="orgtreelist" :props="orgtreeprops" @node-click="handleNodeClick"></el-tree>
|
|
|
+ </el-card>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-card style="width: 100%;height: calc(100vh - 283px);overflow: auto;margin-top:0px">
|
|
|
+ <el-table :data="userOptions" style="width: 100%" ref="multipleTable"
|
|
|
+ @selection-change="handleSelectionChange">
|
|
|
+ <el-table-column type="selection" width="55"></el-table-column>
|
|
|
+ <el-table-column prop="realname" label="可选用户">
|
|
|
+ <!-- <template slot="header">
|
|
|
+ <el-button type="primary" style="float: right;" size="small" @click="toggleSelection">
|
|
|
+ 选择用户 <el-icon class="el-icon-d-arrow-right"></el-icon>
|
|
|
+ </el-button>
|
|
|
+ </template> -->
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </el-card>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ <span style="float: right;margin-top:0px;">
|
|
|
+ <el-button size="small" @click="adminadduser = false">取 消</el-button>
|
|
|
+ <el-button type="primary" size="small" @click="toggleSelection()">确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
<!-- 添加用户 -->
|
|
|
<el-dialog title="添加用户" :visible.sync="addUserShow" width="360px">
|
|
|
<el-form label-width="90px">
|
|
|
@@ -231,6 +271,22 @@
|
|
|
}),
|
|
|
data() {
|
|
|
return {
|
|
|
+ //超级管理员添加用户
|
|
|
+ adminadduser: false,
|
|
|
+ orgtreelist: [],
|
|
|
+ orgtreeprops: {
|
|
|
+ value: 'id',
|
|
|
+ label: 'Fullname',
|
|
|
+ children: 'children'
|
|
|
+ },
|
|
|
+ userOptions: [],
|
|
|
+ userselectOptions: [],
|
|
|
+ selectedOptions: {},
|
|
|
+ AuditorForm: {
|
|
|
+ UserId: ''
|
|
|
+ },
|
|
|
+ //是否有超级管理员权限
|
|
|
+ adminpermission: 0,
|
|
|
//角色管理角色
|
|
|
rolesetVisible: false,
|
|
|
roleCheckAll: false,
|
|
|
@@ -310,6 +366,7 @@
|
|
|
this.initData()
|
|
|
//this.getallequipmentlist()
|
|
|
this.getallrolelist()
|
|
|
+ this.getadminpermission()
|
|
|
},
|
|
|
methods: {
|
|
|
initData() {
|
|
|
@@ -336,6 +393,17 @@
|
|
|
_this.exportloading = false
|
|
|
})
|
|
|
},
|
|
|
+ getadminpermission() {
|
|
|
+ this.$axios.get('role/getAdminPermi', {})
|
|
|
+ .then(res => {
|
|
|
+ // response
|
|
|
+ this.adminpermission = res.data.code
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ // handle error
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
getallrolelist() {
|
|
|
this.$axios.get('role/alllist', {})
|
|
|
.then(res => {
|
|
|
@@ -355,7 +423,7 @@
|
|
|
},
|
|
|
getpartuserlist() {
|
|
|
let _this = this
|
|
|
- this.$axios.get('users/list', {})
|
|
|
+ this.$axios.get('users/parlist', {})
|
|
|
.then(res => {
|
|
|
// response
|
|
|
_this.partuserlist = res.data.items
|
|
|
@@ -376,7 +444,7 @@
|
|
|
// }
|
|
|
let rolestring = this.selectedrole.join(',')
|
|
|
let roleidsstring = rolestring.toString()
|
|
|
- console.log("--",rolestring,roleidsstring)
|
|
|
+ console.log("--", rolestring, roleidsstring)
|
|
|
// request
|
|
|
this.$axios.put('role/setmanrole/' + this.selectedroleid + '_' + roleidsstring, {})
|
|
|
.then(res => {
|
|
|
@@ -389,7 +457,7 @@
|
|
|
// 更新界面
|
|
|
this.getRoleManage(this.selectedroleid)
|
|
|
this.rolesetVisible = false
|
|
|
-
|
|
|
+
|
|
|
} else {
|
|
|
_this.$message({
|
|
|
type: 'warning',
|
|
|
@@ -402,6 +470,63 @@
|
|
|
console.error(err)
|
|
|
})
|
|
|
},
|
|
|
+ getorgtreelist() {
|
|
|
+ let _this = this
|
|
|
+ let params = {
|
|
|
+ IsInnerOrganize: 1,
|
|
|
+ }
|
|
|
+ _this.$axios.get('organizes/orgalllist', {
|
|
|
+ params
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ _this.orgtreelist = window.toolfun_gettreejson(res.data.items, 'Id', 'Parentid', 'Id,Fullname')
|
|
|
+ console.log("_-this.orgtreelist--", this.orgtreelist)
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ handleNodeClick(data) {
|
|
|
+ this.userOptions = []
|
|
|
+ this.$axios.get('role/getauditerbydept/' + data.id, ).then(res => {
|
|
|
+ if (res.data.code === 1) {
|
|
|
+ this.userOptions = res.data.item
|
|
|
+ console.log("--this.userOptions1---",this.userOptions)
|
|
|
+ //this.adminuserlistfilter()
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ adminuserlistfilter() {
|
|
|
+ try {
|
|
|
+ let entityArray = this.userOptions
|
|
|
+ let arr = this.partuserlist
|
|
|
+ let seluserOptions = []
|
|
|
+ if (entityArray == null) {
|
|
|
+ seluserOptions = arr
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ for (var i = 0; i < entityArray.length; i++) {
|
|
|
+ for (var j = 0; j < arr.length; j++) {
|
|
|
+ if (entityArray[i].Id === arr[j].Id) {
|
|
|
+ seluserOptions.push(arr[j])
|
|
|
+ arr.splice(j, 1)
|
|
|
+ j--
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.seluserOptions = arr
|
|
|
+ this.userOptions = this.seluserOptions
|
|
|
+ console.log("--this.userOptions2---",this.userOptions)
|
|
|
+ } catch (e) {
|
|
|
+ console.log(e)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ roleadduseradmin() {
|
|
|
+ this.getorgtreelist()
|
|
|
+ this.adminadduser = true
|
|
|
+ },
|
|
|
roleadduser() {
|
|
|
this.addUserShow = true
|
|
|
this.getpartuserlist()
|
|
|
@@ -430,6 +555,44 @@
|
|
|
console.log(e)
|
|
|
}
|
|
|
},
|
|
|
+ handleSelectionChange(val) {
|
|
|
+ this.selectedOptions = val
|
|
|
+ },
|
|
|
+ toggleSelection() {
|
|
|
+ let _this = this
|
|
|
+ _this.userselectOptions = []
|
|
|
+ console.log("--this.selectedOptions---", this.selectedOptions)
|
|
|
+ for (let i = 0; i < this.selectedOptions.length; i++) {
|
|
|
+ this.userselectOptions.push(this.selectedOptions[i].id)
|
|
|
+ }
|
|
|
+ let useridlist = this.userselectOptions.join(',');
|
|
|
+ let useridliststring = useridlist.toString()
|
|
|
+ console.log("=----uselist", useridliststring)
|
|
|
+ debugger
|
|
|
+ // request
|
|
|
+ this.$axios.put('role/setuserrole/' + useridliststring + '_' + this.selectRoleId, {})
|
|
|
+ .then(res => {
|
|
|
+ // response
|
|
|
+ if (res.data.code === 0) {
|
|
|
+ _this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
+ // 更新界面
|
|
|
+ this.initUserList(this.selectRoleId)
|
|
|
+ this.adminadduser = false
|
|
|
+ } else {
|
|
|
+ _this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ // handle error
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
adduerinrole() {
|
|
|
let _this = this
|
|
|
//用户姓名
|
|
|
@@ -485,6 +648,7 @@
|
|
|
.then(res => {
|
|
|
// response
|
|
|
_this.userList = res.data.items
|
|
|
+ console.log("----", this.userList)
|
|
|
_this.currentUserItemCount = res.data.currentItemCount
|
|
|
})
|
|
|
.catch(err => {
|