分公司项目部管理
This commit is contained in:
parent
b7a30186bf
commit
97e3e6440b
|
|
@ -119,3 +119,20 @@ export function changeStatus(orgId,reviewerStatus) {
|
||||||
method: 'put'
|
method: 'put'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function listUser(query) {
|
||||||
|
return request({
|
||||||
|
url: '/system/user/listPro',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改用户
|
||||||
|
export function updatePermission(data) {
|
||||||
|
return request({
|
||||||
|
url: '/system/user/updatePermission',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -77,3 +77,13 @@ export function orgTempFile(query) {
|
||||||
params: query
|
params: query
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 查询部门列表
|
||||||
|
export function listDeptUser(query) {
|
||||||
|
return request({
|
||||||
|
url: '/system/attDetails/orgList',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -292,12 +292,68 @@
|
||||||
<el-button @click="cancel">取 消</el-button>
|
<el-button @click="cancel">取 消</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<!-- 单用户的表格 -->
|
||||||
|
<el-dialog :title="title" :visible.sync="openUser" width="65%" append-to-body>
|
||||||
|
<el-form :model="queryParamsUser" ref="queryFormUser" size="small" :inline="true" v-show="showSearchUser" label-width="68px">
|
||||||
|
<el-form-item label="姓名" prop="userName">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParamsUser.userName"
|
||||||
|
placeholder="请输入姓名"
|
||||||
|
clearable
|
||||||
|
style="width: 240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="部门名称" prop="orgId">
|
||||||
|
<treeselect v-model="queryParamsUser.orgId" :options="deptOptionsUser" :normalizer="normalizerUser" placeholder="选择部门" style="width: 240px"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQueryUser">搜索</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQueryUser">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
|
||||||
|
<el-table v-loading="loading" :data="userList" >
|
||||||
|
<el-table-column label="序号" align="center" width="80" type="index">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ (queryParamsUser.pageNum - 1) * queryParamsUser.pageSize + scope.$index + 1 }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="姓名" align="center" prop="userName" />
|
||||||
|
<el-table-column label="所属部门" align="center" prop="orgName" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column label="岗位" align="center" prop="postName" :show-overflow-tooltip="true"/>
|
||||||
|
<el-table-column label="人员角色" align="center" prop="roleName" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column label="身份证号" align="center" prop="idNumber" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column label="手机号(登录名称)" align="center" prop="phone" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column label="操作" align="center" width="230">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="primary"
|
||||||
|
@click="handlePermission(scope.row)"
|
||||||
|
ref="editButton"
|
||||||
|
>分配项目部管理权限</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination
|
||||||
|
v-show="total>0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="queryParamsUser.pageNum"
|
||||||
|
:limit.sync="queryParamsUser.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {listType, getType, delSubOrg, addType, updateType, changeStatus} from "@/api/process/branchPro";
|
import {listType, getType, delSubOrg, addType, updateType, changeStatus,listUser,updatePermission} from "@/api/process/branchPro";
|
||||||
import {listDept, orgPersonSelect} from "@/api/system/dept";
|
import {listDept, orgPersonSelect,listDeptUser} from "@/api/system/dept";
|
||||||
import Treeselect from "@riophae/vue-treeselect";
|
import Treeselect from "@riophae/vue-treeselect";
|
||||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||||
import {treeselect as staffTreeselect} from "@/api/process/tree";
|
import {treeselect as staffTreeselect} from "@/api/process/tree";
|
||||||
|
|
@ -431,11 +487,24 @@ export default {
|
||||||
|
|
||||||
|
|
||||||
oldOrgName: [],
|
oldOrgName: [],
|
||||||
|
|
||||||
|
//用户管理
|
||||||
|
openUser:false,
|
||||||
|
queryParamsUser: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
userName: undefined,
|
||||||
|
orgId: undefined,
|
||||||
|
},
|
||||||
|
showSearchUser: true,
|
||||||
|
deptOptionsUser:[],
|
||||||
|
userList: [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.getPersonSelect();
|
this.getPersonSelect();
|
||||||
|
this.getDeptListUser()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/** 人员选择下拉 */
|
/** 人员选择下拉 */
|
||||||
|
|
@ -744,7 +813,13 @@ export default {
|
||||||
|
|
||||||
/** 权限分配-跳转到人员信息页面*/
|
/** 权限分配-跳转到人员信息页面*/
|
||||||
allocation(){
|
allocation(){
|
||||||
this.$router.push({ path : '/system/userInfo' }); // 使用路由名称进行跳转
|
this.reset();
|
||||||
|
this.resetForm("queryFormUser");
|
||||||
|
this.getListUser();
|
||||||
|
this.openUser=true
|
||||||
|
this.title="权限分配"
|
||||||
|
|
||||||
|
// this.$router.push({ path : '/system/userInfo' }); // 使用路由名称进行跳转
|
||||||
},
|
},
|
||||||
|
|
||||||
/** 刷新缓存按钮操作 */
|
/** 刷新缓存按钮操作 */
|
||||||
|
|
@ -822,6 +897,68 @@ export default {
|
||||||
})
|
})
|
||||||
return data;
|
return data;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
/** 转换部门数据结构 */
|
||||||
|
normalizerUser(node) {
|
||||||
|
if (node.children && !node.children.length) {
|
||||||
|
delete node.children;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
id: node.id,
|
||||||
|
label: node.orgName,
|
||||||
|
children: node.children
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
handleQueryUser() {
|
||||||
|
this.queryParamsUser.pageNum = 1;
|
||||||
|
this.getListUser();
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQueryUser() {
|
||||||
|
this.resetForm("queryFormUser");
|
||||||
|
this.handleQueryUser();
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 查询列表 */
|
||||||
|
getListUser() {
|
||||||
|
this.loading = true;
|
||||||
|
listUser(this.queryParamsUser).then(response => {
|
||||||
|
this.userList = response.rows;
|
||||||
|
this.total = response.total;
|
||||||
|
this.loading = false;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|
||||||
|
getDeptListUser() {
|
||||||
|
listDeptUser().then(response => {
|
||||||
|
this.deptOptionsUser = this.handleTree(response.data, "id");
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
handlePermission(row){
|
||||||
|
var roleIds = row.roleIds;
|
||||||
|
if (!roleIds.some(id => id === 10)) {
|
||||||
|
roleIds.push(10);
|
||||||
|
}
|
||||||
|
var userId = row.userId;
|
||||||
|
var data = {
|
||||||
|
roleIds:roleIds,
|
||||||
|
userId:userId
|
||||||
|
}
|
||||||
|
|
||||||
|
updatePermission(data).then(response => {
|
||||||
|
this.$modal.msgSuccess("更新成功");
|
||||||
|
this.openUser = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue