|
|
|
@ -4,138 +4,141 @@ |
|
|
|
|
<el-breadcrumb-item>{{ targetSysName }}</el-breadcrumb-item> |
|
|
|
|
<el-breadcrumb-item>部门管理</el-breadcrumb-item> |
|
|
|
|
</el-breadcrumb> |
|
|
|
|
<div class="app-container"> |
|
|
|
|
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch"> |
|
|
|
|
<el-form-item label="部门名称" prop="deptNameLike"> |
|
|
|
|
<el-input |
|
|
|
|
v-model="queryParams.deptNameLike" |
|
|
|
|
placeholder="请输入部门名称" |
|
|
|
|
clearable |
|
|
|
|
size="small" |
|
|
|
|
@keyup.enter.native="handleQuery" |
|
|
|
|
/> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="状态" prop="status"> |
|
|
|
|
<el-select v-model="queryParams.status" placeholder="状态" @keyup.enter.native="handleQuery" @change="handleQuery" |
|
|
|
|
size="small" style="width: 90px"> |
|
|
|
|
<el-option :key="-1" label="全部" :value="-1"/> |
|
|
|
|
<el-option :key="0" label="正常" :value="0"/> |
|
|
|
|
<el-option :key="1" label="停用" :value="1"/> |
|
|
|
|
</el-select> |
|
|
|
|
</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-row> |
|
|
|
|
<el-form> |
|
|
|
|
<el-form-item style="margin: 0"> |
|
|
|
|
<el-button |
|
|
|
|
type="primary" |
|
|
|
|
icon="el-icon-plus" |
|
|
|
|
size="mini" |
|
|
|
|
@click="handleAdd(null)" v-hasPermission="['dept:add']">新增 |
|
|
|
|
</el-button> |
|
|
|
|
<div class="app-container"> |
|
|
|
|
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch"> |
|
|
|
|
<el-form-item label="部门名称" prop="deptNameLike"> |
|
|
|
|
<el-input |
|
|
|
|
v-model="queryParams.deptNameLike" |
|
|
|
|
placeholder="请输入部门名称" |
|
|
|
|
clearable |
|
|
|
|
size="small" |
|
|
|
|
@keyup.enter.native="handleQuery" |
|
|
|
|
/> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="状态" prop="status"> |
|
|
|
|
<el-select v-model="queryParams.status" placeholder="状态" @keyup.enter.native="handleQuery" |
|
|
|
|
@change="handleQuery" |
|
|
|
|
size="small" style="width: 90px"> |
|
|
|
|
<el-option :key="-1" label="全部" :value="-1"/> |
|
|
|
|
<el-option :key="0" label="正常" :value="0"/> |
|
|
|
|
<el-option :key="1" label="停用" :value="1"/> |
|
|
|
|
</el-select> |
|
|
|
|
</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-row> |
|
|
|
|
|
|
|
|
|
<el-table |
|
|
|
|
border |
|
|
|
|
v-loading="loading" |
|
|
|
|
:data="deptList" |
|
|
|
|
row-key="deptId" |
|
|
|
|
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"> |
|
|
|
|
<el-table-column fixed prop="deptName" label="部门名称" min-width="180" show-overflow-tooltip></el-table-column> |
|
|
|
|
<el-table-column prop="status" label="状态" align="center" min-width="80" show-overflow-tooltip> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<span v-if="scope.row.status === 0"> <el-tag type="success" size="mini">启用</el-tag></span> |
|
|
|
|
<span v-if="scope.row.status === 1"><el-tag type="danger" size="mini">停用</el-tag></span> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="sortNum" label="显示顺序" align="center" min-width="100" show-overflow-tooltip></el-table-column> |
|
|
|
|
<el-table-column prop="createTime" min-width="165" label="创建时间" align="center"/> |
|
|
|
|
<el-table-column prop="updateTime" min-width="165" label="修改时间" align="center"/> |
|
|
|
|
<el-table-column fixed="right" label="操作" align="center" width="200"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-button |
|
|
|
|
size="mini" |
|
|
|
|
type="text" |
|
|
|
|
icon="el-icon-edit" |
|
|
|
|
@click="handleUpdate(scope.row)" |
|
|
|
|
v-hasPermission="['dept:update']" |
|
|
|
|
>修改 |
|
|
|
|
</el-button> |
|
|
|
|
<el-button |
|
|
|
|
v-if="scope.row.status===0" |
|
|
|
|
size="mini" |
|
|
|
|
type="text" |
|
|
|
|
icon="el-icon-plus" |
|
|
|
|
@click="handleAdd(scope.row)" |
|
|
|
|
v-hasPermission="['dept:add']" |
|
|
|
|
>新增 |
|
|
|
|
</el-button> |
|
|
|
|
<el-button |
|
|
|
|
size="mini" |
|
|
|
|
type="text" |
|
|
|
|
icon="el-icon-delete" |
|
|
|
|
@click="handleDelete(scope.row)" |
|
|
|
|
v-hasPermission="['dept:delete']" |
|
|
|
|
>删除 |
|
|
|
|
</el-button> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table> |
|
|
|
|
|
|
|
|
|
<!-- 添加或修改部门对话框 --> |
|
|
|
|
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body> |
|
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> |
|
|
|
|
<el-row> |
|
|
|
|
<el-col :span="24"> |
|
|
|
|
<el-form-item label="上级部门" prop="deptParentId"> |
|
|
|
|
<treeselect v-model="form.deptParentId" :options="deptOptions" :normalizer="normalizer" |
|
|
|
|
placeholder="选择上级部门"/> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-col> |
|
|
|
|
<el-col :span="12"> |
|
|
|
|
<el-form-item label="部门名称" prop="deptName"> |
|
|
|
|
<el-input v-model="form.deptName" placeholder="请输入部门名称"/> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-col> |
|
|
|
|
<el-col :span="12"> |
|
|
|
|
<el-form-item label="部门状态" prop="status"> |
|
|
|
|
<el-radio-group v-model="form.status"> |
|
|
|
|
<el-radio :label="0">正常</el-radio> |
|
|
|
|
<el-radio :label="1">停用</el-radio> |
|
|
|
|
</el-radio-group> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-col> |
|
|
|
|
<el-col :span="12"> |
|
|
|
|
<el-form-item label="显示顺序" prop="sortNum"> |
|
|
|
|
<el-input-number v-model="form.sortNum" controls-position="right" :min="0" :max="999999999"/> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-col> |
|
|
|
|
</el-row> |
|
|
|
|
<el-row> |
|
|
|
|
<el-col :span="24"> |
|
|
|
|
<el-form-item label="备注" prop="remarks"> |
|
|
|
|
<el-input v-model="form.remarks" type="textarea" |
|
|
|
|
:autosize="{ minRows: 2, maxRows: 5}" |
|
|
|
|
placeholder="请输入内容"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-col> |
|
|
|
|
</el-row> |
|
|
|
|
</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> |
|
|
|
|
<el-row> |
|
|
|
|
<el-form> |
|
|
|
|
<el-form-item style="margin: 0"> |
|
|
|
|
<el-button |
|
|
|
|
type="primary" |
|
|
|
|
icon="el-icon-plus" |
|
|
|
|
size="mini" |
|
|
|
|
@click="handleAdd(null)" v-hasPermission="['dept:add']">新增 |
|
|
|
|
</el-button> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form> |
|
|
|
|
</el-row> |
|
|
|
|
|
|
|
|
|
<el-table |
|
|
|
|
border |
|
|
|
|
v-loading="loading" |
|
|
|
|
:data="deptList" |
|
|
|
|
row-key="deptId" |
|
|
|
|
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"> |
|
|
|
|
<el-table-column fixed prop="deptName" label="部门名称" min-width="180" show-overflow-tooltip></el-table-column> |
|
|
|
|
<el-table-column prop="status" label="状态" align="center" min-width="80" show-overflow-tooltip> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<span v-if="scope.row.status === 0"> <el-tag type="success" size="mini">启用</el-tag></span> |
|
|
|
|
<span v-if="scope.row.status === 1"><el-tag type="danger" size="mini">停用</el-tag></span> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="sortNum" label="显示顺序" align="center" min-width="100" |
|
|
|
|
show-overflow-tooltip></el-table-column> |
|
|
|
|
<el-table-column prop="createTime" min-width="165" label="创建时间" align="center"/> |
|
|
|
|
<el-table-column prop="updateTime" min-width="165" label="修改时间" align="center"/> |
|
|
|
|
<el-table-column fixed="right" label="操作" align="center" width="200"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-button |
|
|
|
|
size="mini" |
|
|
|
|
type="text" |
|
|
|
|
icon="el-icon-edit" |
|
|
|
|
@click="handleUpdate(scope.row)" |
|
|
|
|
v-hasPermission="['dept:update']" |
|
|
|
|
>修改 |
|
|
|
|
</el-button> |
|
|
|
|
<el-button |
|
|
|
|
v-if="scope.row.status===0" |
|
|
|
|
size="mini" |
|
|
|
|
type="text" |
|
|
|
|
icon="el-icon-plus" |
|
|
|
|
@click="handleAdd(scope.row)" |
|
|
|
|
v-hasPermission="['dept:add']" |
|
|
|
|
>新增 |
|
|
|
|
</el-button> |
|
|
|
|
<el-button |
|
|
|
|
v-if="scope.row.children.length<=0" |
|
|
|
|
size="mini" |
|
|
|
|
type="text" |
|
|
|
|
icon="el-icon-delete" |
|
|
|
|
@click="handleDelete(scope.row)" |
|
|
|
|
v-hasPermission="['dept:delete']" |
|
|
|
|
>删除 |
|
|
|
|
</el-button> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table> |
|
|
|
|
|
|
|
|
|
<!-- 添加或修改部门对话框 --> |
|
|
|
|
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body> |
|
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> |
|
|
|
|
<el-row> |
|
|
|
|
<el-col :span="24"> |
|
|
|
|
<el-form-item label="上级部门" prop="deptParentId"> |
|
|
|
|
<treeselect v-model="form.deptParentId" :options="deptOptions" :normalizer="normalizer" |
|
|
|
|
placeholder="选择上级部门"/> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-col> |
|
|
|
|
<el-col :span="12"> |
|
|
|
|
<el-form-item label="部门名称" prop="deptName"> |
|
|
|
|
<el-input v-model="form.deptName" placeholder="请输入部门名称"/> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-col> |
|
|
|
|
<el-col :span="12"> |
|
|
|
|
<el-form-item label="部门状态" prop="status"> |
|
|
|
|
<el-radio-group v-model="form.status"> |
|
|
|
|
<el-radio :label="0">正常</el-radio> |
|
|
|
|
<el-radio :label="1">停用</el-radio> |
|
|
|
|
</el-radio-group> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-col> |
|
|
|
|
<el-col :span="12"> |
|
|
|
|
<el-form-item label="显示顺序" prop="sortNum"> |
|
|
|
|
<el-input-number v-model="form.sortNum" controls-position="right" :min="0" :max="999999999"/> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-col> |
|
|
|
|
</el-row> |
|
|
|
|
<el-row> |
|
|
|
|
<el-col :span="24"> |
|
|
|
|
<el-form-item label="备注" prop="remarks"> |
|
|
|
|
<el-input v-model="form.remarks" type="textarea" |
|
|
|
|
:autosize="{ minRows: 2, maxRows: 5}" |
|
|
|
|
placeholder="请输入内容"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-col> |
|
|
|
|
</el-row> |
|
|
|
|
</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> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|