|
|
|
@ -1,16 +1,16 @@
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
|
<div class="app-container">
|
|
|
|
<div class="app-container">
|
|
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
|
|
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
|
|
|
|
<el-form-item label="部门名称" prop="deptName">
|
|
|
|
<el-form-item label="组织名称" prop="deptName">
|
|
|
|
<el-input
|
|
|
|
<el-input
|
|
|
|
v-model="queryParams.deptName"
|
|
|
|
v-model="queryParams.deptName"
|
|
|
|
placeholder="请输入部门名称"
|
|
|
|
placeholder="请输入组织名称"
|
|
|
|
clearable
|
|
|
|
clearable
|
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="状态" prop="status">
|
|
|
|
<el-form-item label="状态" prop="status">
|
|
|
|
<el-select v-model="queryParams.status" placeholder="部门状态" clearable>
|
|
|
|
<el-select v-model="queryParams.status" placeholder="组织状态" clearable>
|
|
|
|
<el-option
|
|
|
|
<el-option
|
|
|
|
v-for="dict in dict.type.sys_normal_disable"
|
|
|
|
v-for="dict in dict.type.sys_normal_disable"
|
|
|
|
:key="dict.value"
|
|
|
|
:key="dict.value"
|
|
|
|
@ -56,7 +56,7 @@
|
|
|
|
:default-expand-all="isExpandAll"
|
|
|
|
:default-expand-all="isExpandAll"
|
|
|
|
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
|
|
|
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<el-table-column prop="deptName" label="部门名称" width="260"></el-table-column>
|
|
|
|
<el-table-column prop="deptName" label="组织名称" width="260"></el-table-column>
|
|
|
|
<el-table-column prop="orderNum" label="排序" width="200"></el-table-column>
|
|
|
|
<el-table-column prop="orderNum" label="排序" width="200"></el-table-column>
|
|
|
|
<el-table-column prop="status" label="状态" width="100">
|
|
|
|
<el-table-column prop="status" label="状态" width="100">
|
|
|
|
<template slot-scope="scope">
|
|
|
|
<template slot-scope="scope">
|
|
|
|
@ -96,20 +96,20 @@
|
|
|
|
</el-table-column>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table>
|
|
|
|
</el-table>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 添加或修改部门对话框 -->
|
|
|
|
<!-- 添加或修改组织对话框 -->
|
|
|
|
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
|
|
|
|
<el-dialog :title="title" :visible.sync="open" width="600px" 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-row>
|
|
|
|
<el-row>
|
|
|
|
<el-col :span="24" v-if="form.parentId !== 0">
|
|
|
|
<el-col :span="24" v-if="form.parentId !== 0">
|
|
|
|
<el-form-item label="上级部门" prop="parentId">
|
|
|
|
<el-form-item label="上级组织" prop="parentId">
|
|
|
|
<treeselect v-model="form.parentId" :options="deptOptions" :normalizer="normalizer" placeholder="选择上级部门" />
|
|
|
|
<treeselect v-model="form.parentId" :options="deptOptions" :normalizer="normalizer" placeholder="选择上级组织" />
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
</el-row>
|
|
|
|
<el-row>
|
|
|
|
<el-row>
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item label="部门名称" prop="deptName">
|
|
|
|
<el-form-item label="组织名称" prop="deptName">
|
|
|
|
<el-input v-model="form.deptName" placeholder="请输入部门名称" />
|
|
|
|
<el-input v-model="form.deptName" placeholder="请输入组织名称" />
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-col :span="12">
|
|
|
|
@ -137,7 +137,7 @@
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-form-item label="部门状态">
|
|
|
|
<el-form-item label="组织状态">
|
|
|
|
<el-radio-group v-model="form.status">
|
|
|
|
<el-radio-group v-model="form.status">
|
|
|
|
<el-radio
|
|
|
|
<el-radio
|
|
|
|
v-for="dict in dict.type.sys_normal_disable"
|
|
|
|
v-for="dict in dict.type.sys_normal_disable"
|
|
|
|
@ -174,7 +174,7 @@ export default {
|
|
|
|
showSearch: true,
|
|
|
|
showSearch: true,
|
|
|
|
// 表格树数据
|
|
|
|
// 表格树数据
|
|
|
|
deptList: [],
|
|
|
|
deptList: [],
|
|
|
|
// 部门树选项
|
|
|
|
// 组织树选项
|
|
|
|
deptOptions: [],
|
|
|
|
deptOptions: [],
|
|
|
|
// 弹出层标题
|
|
|
|
// 弹出层标题
|
|
|
|
title: "",
|
|
|
|
title: "",
|
|
|
|
@ -194,10 +194,10 @@ export default {
|
|
|
|
// 表单校验
|
|
|
|
// 表单校验
|
|
|
|
rules: {
|
|
|
|
rules: {
|
|
|
|
parentId: [
|
|
|
|
parentId: [
|
|
|
|
{ required: true, message: "上级部门不能为空", trigger: "blur" }
|
|
|
|
{ required: true, message: "上级组织不能为空", trigger: "blur" }
|
|
|
|
],
|
|
|
|
],
|
|
|
|
deptName: [
|
|
|
|
deptName: [
|
|
|
|
{ required: true, message: "部门名称不能为空", trigger: "blur" }
|
|
|
|
{ required: true, message: "组织名称不能为空", trigger: "blur" }
|
|
|
|
],
|
|
|
|
],
|
|
|
|
orderNum: [
|
|
|
|
orderNum: [
|
|
|
|
{ required: true, message: "显示排序不能为空", trigger: "blur" }
|
|
|
|
{ required: true, message: "显示排序不能为空", trigger: "blur" }
|
|
|
|
@ -223,7 +223,7 @@ export default {
|
|
|
|
this.getList();
|
|
|
|
this.getList();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
/** 查询部门列表 */
|
|
|
|
/** 查询组织列表 */
|
|
|
|
getList() {
|
|
|
|
getList() {
|
|
|
|
this.loading = true;
|
|
|
|
this.loading = true;
|
|
|
|
listDept(this.queryParams).then(response => {
|
|
|
|
listDept(this.queryParams).then(response => {
|
|
|
|
@ -231,7 +231,7 @@ export default {
|
|
|
|
this.loading = false;
|
|
|
|
this.loading = false;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
/** 转换部门数据结构 */
|
|
|
|
/** 转换组织数据结构 */
|
|
|
|
normalizer(node) {
|
|
|
|
normalizer(node) {
|
|
|
|
if (node.children && !node.children.length) {
|
|
|
|
if (node.children && !node.children.length) {
|
|
|
|
delete node.children;
|
|
|
|
delete node.children;
|
|
|
|
@ -277,7 +277,7 @@ export default {
|
|
|
|
this.form.parentId = row.deptId;
|
|
|
|
this.form.parentId = row.deptId;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.open = true;
|
|
|
|
this.open = true;
|
|
|
|
this.title = "添加部门";
|
|
|
|
this.title = "添加组织";
|
|
|
|
listDept().then(response => {
|
|
|
|
listDept().then(response => {
|
|
|
|
this.deptOptions = this.handleTree(response.data, "deptId");
|
|
|
|
this.deptOptions = this.handleTree(response.data, "deptId");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
@ -296,7 +296,7 @@ export default {
|
|
|
|
getDept(row.deptId).then(response => {
|
|
|
|
getDept(row.deptId).then(response => {
|
|
|
|
this.form = response.data;
|
|
|
|
this.form = response.data;
|
|
|
|
this.open = true;
|
|
|
|
this.open = true;
|
|
|
|
this.title = "修改部门";
|
|
|
|
this.title = "修改组织";
|
|
|
|
listDeptExcludeChild(row.deptId).then(response => {
|
|
|
|
listDeptExcludeChild(row.deptId).then(response => {
|
|
|
|
this.deptOptions = this.handleTree(response.data, "deptId");
|
|
|
|
this.deptOptions = this.handleTree(response.data, "deptId");
|
|
|
|
if (this.deptOptions.length == 0) {
|
|
|
|
if (this.deptOptions.length == 0) {
|
|
|
|
|