Merge branch 'dev' of http://192.168.0.56:3000/zzyuan/gz-att-web
This commit is contained in:
commit
7764efb935
|
|
@ -1,12 +1,20 @@
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 查询角色列表
|
// 查询角色列表
|
||||||
export function listRole(query) {
|
export function getRoleUserList(query) {
|
||||||
return request({
|
return request({
|
||||||
url: '/system/role/list',
|
url: '/system/proDeptRole/getRoleUserList',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 修改角色列表
|
||||||
|
export function proDeptRole(data) {
|
||||||
|
return request({
|
||||||
|
url: '/system/proDeptRole',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询角色列表
|
||||||
|
export function getRoleCheckList(query) {
|
||||||
|
return request({
|
||||||
|
url: '/system/proDeptRole/getRoleCheckList',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 审核角色列表
|
||||||
|
export function userDistributionCheck(data) {
|
||||||
|
console.log("data,",data)
|
||||||
|
return request({
|
||||||
|
url: '/system/proDeptRole',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询角色列表
|
||||||
|
export function getRoleUserList(query) {
|
||||||
|
return request({
|
||||||
|
url: '/system/proDeptRole/getRoleUserList',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改角色列表
|
||||||
|
export function proDeptRole(data) {
|
||||||
|
return request({
|
||||||
|
url: '/system/proDeptRole',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询人员下拉树结构
|
||||||
|
export function treeselect(query) {
|
||||||
|
return request({
|
||||||
|
url: '/system/proDeptRole/selectOrgUserList',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 根据人员ID查询菜单下拉树结构
|
||||||
|
export function staffTreeselect(query) {
|
||||||
|
return request({
|
||||||
|
url: '/system/proDeptRole/selectOrgUserList',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
@ -1,113 +1,82 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
<el-form-item label="字典名称" prop="dictName">
|
<el-form-item label="部门名称" prop="orgName">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.dictName"
|
v-model="queryParams.orgName"
|
||||||
placeholder="请输入字典名称"
|
maxlength="28"
|
||||||
|
placeholder="请输入部门名称"
|
||||||
clearable
|
clearable
|
||||||
style="width: 240px"
|
style="width: 200px"
|
||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="角色名称" prop="deptRoleName">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.deptRoleName"
|
||||||
|
maxlength="28"
|
||||||
|
placeholder="请输入角色名称"
|
||||||
|
clearable
|
||||||
|
style="width: 200px"
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="人员名称" prop="userName">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.userName"
|
||||||
|
maxlength="28"
|
||||||
|
placeholder="请输入人员名称"
|
||||||
|
clearable
|
||||||
|
style="width: 200px"
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-table v-loading="loading" :data="typeList" :span-method="objectSpanMethod">
|
||||||
<el-col :span="1.5">
|
<el-table-column label="序号" align="center" width="80" type="index">
|
||||||
<el-button
|
|
||||||
type="primary"
|
|
||||||
plain
|
|
||||||
icon="el-icon-plus"
|
|
||||||
size="mini"
|
|
||||||
@click="handleAdd"
|
|
||||||
>新增</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="success"
|
|
||||||
plain
|
|
||||||
icon="el-icon-edit"
|
|
||||||
size="mini"
|
|
||||||
:disabled="single"
|
|
||||||
@click="handleUpdate"
|
|
||||||
>修改</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="danger"
|
|
||||||
plain
|
|
||||||
icon="el-icon-delete"
|
|
||||||
size="mini"
|
|
||||||
:disabled="multiple"
|
|
||||||
@click="handleDelete"
|
|
||||||
>删除</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="warning"
|
|
||||||
plain
|
|
||||||
icon="el-icon-download"
|
|
||||||
size="mini"
|
|
||||||
@click="handleExport"
|
|
||||||
>导出</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="danger"
|
|
||||||
plain
|
|
||||||
icon="el-icon-refresh"
|
|
||||||
size="mini"
|
|
||||||
@click="handleRefreshCache"
|
|
||||||
>刷新缓存</el-button>
|
|
||||||
</el-col>
|
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="typeList" @selection-change="handleSelectionChange">
|
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
|
||||||
<el-table-column label="字典编号" align="center" prop="dictId" />
|
|
||||||
<el-table-column label="字典名称" align="center" prop="dictName" :show-overflow-tooltip="true" />
|
|
||||||
<el-table-column label="字典类型" align="center" :show-overflow-tooltip="true">
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<router-link :to="'/system/dict-data/index/' + scope.row.dictId" class="link-type">
|
<span>{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}</span>
|
||||||
<span>{{ scope.row.dictType }}</span>
|
|
||||||
</router-link>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="状态" align="center" prop="status">
|
<el-table-column label="部门名称" align="center" prop="orgName" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column label="角色名称" align="center" prop="deptRoleName" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column label="人员名称" align="center" prop="userName" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column label="审批状态" align="center" prop="reviewerStatus" :show-overflow-tooltip="true" >
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
|
<span v-if="scope.row.reviewerStatus == 0">待审核</span>
|
||||||
</template>
|
<span v-else-if="scope.row.reviewerStatus == 1">已审核</span>
|
||||||
</el-table-column>
|
<span v-else-if="scope.row.reviewerStatus == 2">未通过</span>
|
||||||
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
|
|
||||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
@click="handleUpdate(scope.row)"
|
v-if="scope.row.reviewerStatus == null"
|
||||||
>修改</el-button>
|
@click="handleAllocation(scope.row)"
|
||||||
|
>分配人员</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-delete"
|
icon="el-icon-edit"
|
||||||
@click="handleDelete(scope.row)"
|
v-if="scope.row.reviewerStatus == 1 || scope.row.reviewerStatus == 2"
|
||||||
>删除</el-button>
|
@click="handleChange(scope.row)"
|
||||||
|
>人员变更</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination
|
<pagination
|
||||||
v-show="total>0"
|
v-show="total>0"
|
||||||
:total="total"
|
:total="total"
|
||||||
|
|
@ -115,27 +84,29 @@
|
||||||
:limit.sync="queryParams.pageSize"
|
:limit.sync="queryParams.pageSize"
|
||||||
@pagination="getList"
|
@pagination="getList"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- 添加或修改参数配置对话框 -->
|
<!-- 添加或修改参数配置对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
<el-form-item label="字典名称" prop="dictName">
|
<el-form-item label="部门名称" prop="orgName">
|
||||||
<el-input v-model="form.dictName" placeholder="请输入字典名称" />
|
<el-input v-model="form.orgName" readonly />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="字典类型" prop="dictType">
|
<el-form-item label="角色名称" prop="deptRoleName">
|
||||||
<el-input v-model="form.dictType" placeholder="请输入字典类型" />
|
<el-input v-model="form.deptRoleName" readonly />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="状态" prop="status">
|
|
||||||
<el-radio-group v-model="form.status">
|
<el-form-item label="人员" >
|
||||||
<el-radio
|
<el-tree
|
||||||
v-for="dict in dict.type.sys_normal_disable"
|
class="tree-border"
|
||||||
:key="dict.value"
|
:data="staffOptions"
|
||||||
:label="dict.value"
|
show-checkbox
|
||||||
>{{dict.label}}</el-radio>
|
ref="staff"
|
||||||
</el-radio-group>
|
node-key="id"
|
||||||
</el-form-item>
|
empty-text="加载中,请稍候"
|
||||||
<el-form-item label="备注" prop="remark">
|
:props="defaultProps"
|
||||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>
|
default-expand-all
|
||||||
|
:default-checked-keys="defaultCheckedKeys"
|
||||||
|
></el-tree>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
|
|
@ -145,14 +116,14 @@
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listType, getType, delType, addType, updateType, refreshCache } from "@/api/system/dict/type";
|
import {getRoleUserList, proDeptRole} from "@/api/process/roles";
|
||||||
import { listRole } from "@/api/process/roles";
|
import { treeselect as staffTreeselect, roleStaffTreeselect } from "@/api/process/tree";
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Dict",
|
name: "Roles",
|
||||||
dicts: ['sys_normal_disable'],
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
|
|
@ -173,43 +144,67 @@
|
||||||
title: "",
|
title: "",
|
||||||
// 是否显示弹出层
|
// 是否显示弹出层
|
||||||
open: false,
|
open: false,
|
||||||
// 日期范围
|
|
||||||
dateRange: [],
|
|
||||||
// 查询参数
|
// 查询参数
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
dictName: undefined,
|
deptRoleName: undefined,
|
||||||
dictType: undefined,
|
orgName: undefined,
|
||||||
status: undefined
|
userName: undefined
|
||||||
},
|
},
|
||||||
|
// 人员列表
|
||||||
|
staffOptions: [],
|
||||||
|
// 默认选中的节点 id 数组
|
||||||
|
defaultCheckedKeys: [],
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
form: {},
|
||||||
// 表单校验
|
defaultProps: {
|
||||||
rules: {
|
children: "children",
|
||||||
dictName: [
|
label: "name",
|
||||||
{ required: true, message: "字典名称不能为空", trigger: "blur" }
|
disabled: "disabled" // 添加 disabled 属性
|
||||||
],
|
},
|
||||||
dictType: [
|
|
||||||
{ required: true, message: "字典类型不能为空", trigger: "blur" }
|
|
||||||
]
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/** 查询字典类型列表 */
|
/** 查询列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
listType(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
getRoleUserList(this.queryParams).then(response => {
|
||||||
this.typeList = response.rows;
|
this.typeList = response.rows;
|
||||||
this.total = response.total;
|
this.total = response.total;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
|
||||||
|
this.getSpanArray(this.typeList);
|
||||||
|
if (columnIndex === 1) {
|
||||||
|
const _row = this.spanArray[rowIndex];
|
||||||
|
const _col = _row > 0 ? 1 : 0;
|
||||||
|
return {
|
||||||
|
rowspan: _row,
|
||||||
|
colspan: _col
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getSpanArray(data) {
|
||||||
|
this.spanArray = [];
|
||||||
|
let count = 1;
|
||||||
|
for (let i = 0; i < data.length; i++) {
|
||||||
|
if (i < data.length - 1 && data[i].orgId === data[i + 1].orgId) {
|
||||||
|
count++;
|
||||||
|
} else {
|
||||||
|
for (let j = 0; j < count; j++) {
|
||||||
|
this.spanArray.push(j === 0 ? count : 0);
|
||||||
|
}
|
||||||
|
count = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
// 取消按钮
|
// 取消按钮
|
||||||
cancel() {
|
cancel() {
|
||||||
this.open = false;
|
this.open = false;
|
||||||
|
|
@ -218,12 +213,20 @@
|
||||||
// 表单重置
|
// 表单重置
|
||||||
reset() {
|
reset() {
|
||||||
this.form = {
|
this.form = {
|
||||||
dictId: undefined,
|
orgId: undefined,
|
||||||
dictName: undefined,
|
orgName: undefined,
|
||||||
dictType: undefined,
|
departmentId: undefined,
|
||||||
status: "0",
|
deptRoleId: undefined,
|
||||||
remark: undefined
|
deptRoleName: undefined,
|
||||||
|
userId: undefined,
|
||||||
|
userName: undefined,
|
||||||
|
reviewerStatus: undefined,
|
||||||
|
reviewerTime: undefined,
|
||||||
|
reviewerUserId: undefined,
|
||||||
|
roleType: undefined,
|
||||||
|
staffOptions:[]
|
||||||
};
|
};
|
||||||
|
this.defaultCheckedKeys = []; // 重置默认选中的节点
|
||||||
this.resetForm("form");
|
this.resetForm("form");
|
||||||
},
|
},
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
|
|
@ -233,75 +236,85 @@
|
||||||
},
|
},
|
||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
resetQuery() {
|
resetQuery() {
|
||||||
this.dateRange = [];
|
|
||||||
this.resetForm("queryForm");
|
this.resetForm("queryForm");
|
||||||
this.handleQuery();
|
this.handleQuery();
|
||||||
},
|
},
|
||||||
/** 新增按钮操作 */
|
/** 分配人员按钮操作 */
|
||||||
handleAdd() {
|
handleAllocation(row) {
|
||||||
this.reset();
|
this.reset();
|
||||||
|
this.getStaffTreeselect(row);
|
||||||
|
this.form = row;
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "添加字典类型";
|
this.title = "分配人员";
|
||||||
},
|
},
|
||||||
// 多选框选中数据
|
|
||||||
handleSelectionChange(selection) {
|
/** 人员变更按钮操作 */
|
||||||
this.ids = selection.map(item => item.dictId)
|
handleChange(row) {
|
||||||
this.single = selection.length!=1
|
|
||||||
this.multiple = !selection.length
|
|
||||||
},
|
|
||||||
/** 修改按钮操作 */
|
|
||||||
handleUpdate(row) {
|
|
||||||
this.reset();
|
this.reset();
|
||||||
const dictId = row.dictId || this.ids
|
this.getStaffTreeselect(row);
|
||||||
getType(dictId).then(response => {
|
this.form = row;
|
||||||
this.form = response.data;
|
this.open = true;
|
||||||
this.open = true;
|
this.title = "分配人员";
|
||||||
this.title = "修改字典类型";
|
},
|
||||||
|
|
||||||
|
/** 查询员工树结构 */
|
||||||
|
getStaffTreeselect(data) {
|
||||||
|
staffTreeselect(data).then(response => {
|
||||||
|
this.staffOptions = response.data;
|
||||||
|
this.setDefaultCheckedKeys();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/** 设置默认选中的节点 */
|
||||||
|
setDefaultCheckedKeys() {
|
||||||
|
this.defaultCheckedKeys = this.getCheckedKeys(this.staffOptions);
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 递归获取默认选中的节点 id */
|
||||||
|
getCheckedKeys(nodes) {
|
||||||
|
const keys = [];
|
||||||
|
console.log(nodes)
|
||||||
|
nodes.forEach(node => {
|
||||||
|
if (node.isCheck === 1) {
|
||||||
|
keys.push(node.id);
|
||||||
|
}
|
||||||
|
if (node.children) {
|
||||||
|
keys.push(...this.getCheckedKeys(node.children));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return keys;
|
||||||
|
},
|
||||||
|
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
submitForm: function() {
|
submitForm: function() {
|
||||||
this.$refs["form"].validate(valid => {
|
this.$refs["form"].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.form.dictId != undefined) {
|
const checkedKeys = this.getStaffAllCheckedKeys();
|
||||||
updateType(this.form).then(response => {
|
if (checkedKeys.length === 0) {
|
||||||
this.$modal.msgSuccess("修改成功");
|
this.$message.error("请至少选择一个人员");
|
||||||
this.open = false;
|
return;
|
||||||
this.getList();
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
addType(this.form).then(response => {
|
|
||||||
this.$modal.msgSuccess("新增成功");
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
this.form.userId = checkedKeys.join(",");
|
||||||
|
console.log("form",this.form)
|
||||||
|
proDeptRole(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/** 删除按钮操作 */
|
|
||||||
handleDelete(row) {
|
// 所有菜单节点数据
|
||||||
const dictIds = row.dictId || this.ids;
|
getStaffAllCheckedKeys() {
|
||||||
this.$modal.confirm('是否确认删除字典编号为"' + dictIds + '"的数据项?').then(function() {
|
// 目前被选中的菜单节点
|
||||||
return delType(dictIds);
|
let checkedKeys = this.$refs.staff.getCheckedKeys();
|
||||||
}).then(() => {
|
// 半选中的菜单节点
|
||||||
this.getList();
|
// let halfCheckedKeys = this.$refs.staff.getHalfCheckedKeys();
|
||||||
this.$modal.msgSuccess("删除成功");
|
// checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys);
|
||||||
}).catch(() => {});
|
checkedKeys.unshift.apply(checkedKeys);
|
||||||
|
return checkedKeys;
|
||||||
},
|
},
|
||||||
/** 导出按钮操作 */
|
},
|
||||||
handleExport() {
|
|
||||||
this.download('system/dict/type/export', {
|
|
||||||
...this.queryParams
|
|
||||||
}, `type_${new Date().getTime()}.xlsx`)
|
|
||||||
},
|
|
||||||
/** 刷新缓存按钮操作 */
|
|
||||||
handleRefreshCache() {
|
|
||||||
refreshCache().then(() => {
|
|
||||||
this.$modal.msgSuccess("刷新成功");
|
|
||||||
this.$store.dispatch('dict/cleanDict');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,230 @@
|
||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
|
<el-form-item label="部门名称" prop="orgName">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.orgName"
|
||||||
|
maxlength="28"
|
||||||
|
placeholder="请输入部门名称"
|
||||||
|
clearable
|
||||||
|
style="width: 200px"
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="角色名称" prop="deptRoleName">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.deptRoleName"
|
||||||
|
maxlength="28"
|
||||||
|
placeholder="请输入角色名称"
|
||||||
|
clearable
|
||||||
|
style="width: 200px"
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="人员名称" prop="userName">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.userName"
|
||||||
|
maxlength="28"
|
||||||
|
placeholder="请输入人员名称"
|
||||||
|
clearable
|
||||||
|
style="width: 200px"
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-table v-loading="loading" :data="typeList" >
|
||||||
|
<el-table-column label="序号" align="center" width="80" type="index">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="申请人" align="center" prop="userName" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column label="变更部门名称" align="center" prop="orgName" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column label="变更角色名称" align="center" prop="deptRoleName" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column label="变更人员" align="center" prop="userName" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column label="审批状态" align="center" prop="reviewerStatus" :show-overflow-tooltip="true" >
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span v-if="scope.row.reviewerStatus == 0">待审核</span>
|
||||||
|
<span v-else-if="scope.row.reviewerStatus == 1">已审核</span>
|
||||||
|
<span v-else-if="scope.row.reviewerStatus == 2">未通过</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
@click="handleAllocation(scope.row)"
|
||||||
|
>审核</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination
|
||||||
|
v-show="total>0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="queryParams.pageNum"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- 添加或修改参数配置对话框 -->
|
||||||
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
|
<el-form-item label="部门名称" prop="orgName">
|
||||||
|
<el-input v-model="form.orgName" readonly />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="角色名称" prop="deptRoleName">
|
||||||
|
<el-input v-model="form.deptRoleName" readonly />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="人员" prop="userName">
|
||||||
|
<el-input v-model="form.userName" readonly></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="handleAgree">同 意</el-button>
|
||||||
|
<el-button type="danger" @click="handleReject">驳 回</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {getRoleCheckList, userDistributionCheck} from "@/api/process/rolesExamine";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "RolesExamine",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
// 选中数组
|
||||||
|
ids: [],
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
// 显示搜索条件
|
||||||
|
showSearch: true,
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// 字典表格数据
|
||||||
|
typeList: [],
|
||||||
|
// 弹出层标题
|
||||||
|
title: "",
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
deptRoleName: undefined,
|
||||||
|
orgName: undefined,
|
||||||
|
userName: undefined
|
||||||
|
},
|
||||||
|
// 表单参数
|
||||||
|
form: {},
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/** 查询列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
getRoleCheckList(this.queryParams).then(response => {
|
||||||
|
this.typeList = response.rows;
|
||||||
|
this.total = response.total;
|
||||||
|
this.loading = false;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.open = false;
|
||||||
|
this.reset();
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
departmentId: undefined,
|
||||||
|
deptRoleId: undefined,
|
||||||
|
deptRoleName: undefined,
|
||||||
|
orgId: undefined,
|
||||||
|
orgName: undefined,
|
||||||
|
reviewerStatus: undefined,
|
||||||
|
reviewerTime: undefined,
|
||||||
|
reviewerUserId: undefined,
|
||||||
|
userId: undefined,
|
||||||
|
userIds: undefined,
|
||||||
|
userName: undefined,
|
||||||
|
};
|
||||||
|
this.resetForm("form");
|
||||||
|
},
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
handleQuery() {
|
||||||
|
this.queryParams.pageNum = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery() {
|
||||||
|
this.resetForm("queryForm");
|
||||||
|
this.handleQuery();
|
||||||
|
},
|
||||||
|
/** 审核人员按钮操作 */
|
||||||
|
handleAllocation(row) {
|
||||||
|
this.reset();
|
||||||
|
this.form = row;
|
||||||
|
this.open = true;
|
||||||
|
this.title = "项目部角色配置";
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审核同意
|
||||||
|
*/
|
||||||
|
handleAgree(){
|
||||||
|
this.form.reviewerStatus = "1";
|
||||||
|
this.submitForm();
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审核驳回
|
||||||
|
*/
|
||||||
|
handleReject(){
|
||||||
|
this.form.reviewerStatus = "2";
|
||||||
|
this.submitForm();
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm: function() {
|
||||||
|
this.$refs["form"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
userDistributionCheck(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
@ -0,0 +1,251 @@
|
||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
|
<el-form-item label="部门名称" prop="orgName">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.orgName"
|
||||||
|
maxlength="28"
|
||||||
|
placeholder="请输入部门名称"
|
||||||
|
clearable
|
||||||
|
style="width: 200px"
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="角色名称" prop="deptRoleName">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.deptRoleName"
|
||||||
|
maxlength="28"
|
||||||
|
placeholder="请输入角色名称"
|
||||||
|
clearable
|
||||||
|
style="width: 200px"
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="人员名称" prop="userName">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.userName"
|
||||||
|
maxlength="28"
|
||||||
|
placeholder="请输入人员名称"
|
||||||
|
clearable
|
||||||
|
style="width: 200px"
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-table v-loading="loading" :data="typeList" >
|
||||||
|
<el-table-column label="序号" align="center" width="80" type="index">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="部门名称" align="center" prop="orgName" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column label="角色名称" align="center" prop="deptRoleName" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column label="人员名称" align="center" prop="userName" :show-overflow-tooltip="true" />
|
||||||
|
|
||||||
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
v-if="scope.row.reviewerStatus == null"
|
||||||
|
@click="handleAllocation(scope.row)"
|
||||||
|
>分配人员</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination
|
||||||
|
v-show="total>0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="queryParams.pageNum"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- 添加或修改参数配置对话框 -->
|
||||||
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
|
<el-form-item label="部门名称" prop="orgName">
|
||||||
|
<el-input v-model="form.orgName" readonly />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="角色名称" prop="deptRoleName">
|
||||||
|
<el-input v-model="form.deptRoleName" readonly />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="人员" >
|
||||||
|
<el-tree
|
||||||
|
class="tree-border"
|
||||||
|
:data="staffOptions"
|
||||||
|
show-checkbox
|
||||||
|
ref="staff"
|
||||||
|
node-key="id"
|
||||||
|
empty-text="加载中,请稍候"
|
||||||
|
:props="defaultProps"
|
||||||
|
default-expand-all
|
||||||
|
:default-checked-keys="defaultCheckedKeys"
|
||||||
|
></el-tree>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {getRoleUserList, proDeptRole} from "@/api/process/rolesRemind";
|
||||||
|
import { treeselect as staffTreeselect, roleStaffTreeselect } from "@/api/process/tree";
|
||||||
|
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "Roles",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
// 选中数组
|
||||||
|
ids: [],
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
// 显示搜索条件
|
||||||
|
showSearch: true,
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// 字典表格数据
|
||||||
|
typeList: [],
|
||||||
|
// 弹出层标题
|
||||||
|
title: "",
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
deptRoleName: undefined,
|
||||||
|
orgName: undefined,
|
||||||
|
userName: undefined,
|
||||||
|
departmentId:"-1"
|
||||||
|
},
|
||||||
|
// 人员列表
|
||||||
|
staffOptions: [],
|
||||||
|
// 默认选中的节点 id 数组
|
||||||
|
defaultCheckedKeys: [],
|
||||||
|
// 表单参数
|
||||||
|
form: {},
|
||||||
|
defaultProps: {
|
||||||
|
children: "children",
|
||||||
|
label: "name",
|
||||||
|
disabled: "disabled" // 添加 disabled 属性
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/** 查询列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
getRoleUserList(this.queryParams).then(response => {
|
||||||
|
this.typeList = response.rows;
|
||||||
|
this.total = response.total;
|
||||||
|
this.loading = false;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.open = false;
|
||||||
|
this.reset();
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
orgId: undefined,
|
||||||
|
orgName: undefined,
|
||||||
|
departmentId: undefined,
|
||||||
|
deptRoleId: undefined,
|
||||||
|
deptRoleName: undefined,
|
||||||
|
userId: undefined,
|
||||||
|
userName: undefined,
|
||||||
|
reviewerStatus: undefined,
|
||||||
|
reviewerTime: undefined,
|
||||||
|
reviewerUserId: undefined,
|
||||||
|
roleType: undefined,
|
||||||
|
staffOptions:[]
|
||||||
|
};
|
||||||
|
this.defaultCheckedKeys = []; // 重置默认选中的节点
|
||||||
|
this.resetForm("form");
|
||||||
|
},
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
handleQuery() {
|
||||||
|
this.queryParams.pageNum = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery() {
|
||||||
|
this.resetForm("queryForm");
|
||||||
|
this.handleQuery();
|
||||||
|
},
|
||||||
|
/** 分配人员按钮操作 */
|
||||||
|
handleAllocation(row) {
|
||||||
|
this.reset();
|
||||||
|
this.getStaffTreeselect(row);
|
||||||
|
this.form = row;
|
||||||
|
this.open = true;
|
||||||
|
this.title = "分配人员";
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 查询员工树结构 */
|
||||||
|
getStaffTreeselect(data) {
|
||||||
|
staffTreeselect(data).then(response => {
|
||||||
|
this.staffOptions = response.data;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm: function() {
|
||||||
|
this.$refs["form"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
const checkedKeys = this.getStaffAllCheckedKeys();
|
||||||
|
if (checkedKeys.length === 0) {
|
||||||
|
this.$message.error("请至少选择一个人员");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.form.userId = checkedKeys.join(",");
|
||||||
|
console.log("form",this.form)
|
||||||
|
proDeptRole(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
// 所有菜单节点数据
|
||||||
|
getStaffAllCheckedKeys() {
|
||||||
|
// 目前被选中的菜单节点
|
||||||
|
let checkedKeys = this.$refs.staff.getCheckedKeys();
|
||||||
|
// 半选中的菜单节点
|
||||||
|
// let halfCheckedKeys = this.$refs.staff.getHalfCheckedKeys();
|
||||||
|
// checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys);
|
||||||
|
checkedKeys.unshift.apply(checkedKeys);
|
||||||
|
return checkedKeys;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
@ -35,7 +35,7 @@ module.exports = {
|
||||||
proxy: {
|
proxy: {
|
||||||
// detail: https://cli.vuejs.org/config/#devserver-proxy
|
// detail: https://cli.vuejs.org/config/#devserver-proxy
|
||||||
[process.env.VUE_APP_BASE_API]: {
|
[process.env.VUE_APP_BASE_API]: {
|
||||||
target: `http://192.168.0.32:8100`,
|
target: `http://192.168.0.137:8100`,
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
pathRewrite: {
|
pathRewrite: {
|
||||||
['^' + process.env.VUE_APP_BASE_API]: ''
|
['^' + process.env.VUE_APP_BASE_API]: ''
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue