|
@@ -1,8 +1,8 @@
|
|
|
<template>
|
|
|
- <div class="app-container">
|
|
|
+ <div class="app-container" style="overflow-y: auto;">
|
|
|
<el-form :model="queryParams" ref="queryForm" :inline="true">
|
|
|
<el-form-item label="科室名称" prop="deptName">
|
|
|
- <el-input v-model="queryParams.deptName" placeholder="请输入部门名称" clearable @keyup.enter.native="handleQuery" class="se" />
|
|
|
+ <el-input v-model="queryParams.deptName" placeholder="请输入科室名称" clearable @keyup.enter.native="handleQuery"/>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="科室状态" prop="status">
|
|
|
<el-select v-model="queryParams.status" placeholder="科室状态" clearable class="se">
|
|
@@ -34,29 +34,6 @@
|
|
|
<el-empty></el-empty>
|
|
|
</template>
|
|
|
</el-table>
|
|
|
-
|
|
|
- <!-- 添加或修改部门对话框 -->
|
|
|
- <el-dialog :title="title" :visible.sync="open" v-if="open" :close-on-click-modal="false" width="60%" append-to-body>
|
|
|
- <el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
- <el-form-item label="上级科室" prop="parentId" v-if="form.parentId !== 0">
|
|
|
- <treeselect v-model="form.parentId" :options="deptOptions" :normalizer="normalizer" placeholder="选择上级科室" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="科室名称" prop="deptName"><el-input v-model="form.deptName" placeholder="请输入科室名称" /></el-form-item>
|
|
|
- <el-form-item label="科室介绍" prop="brief" v-if="open && form.parentId != 0 && form.ancestors.length == 3">
|
|
|
- <editor v-model="form.brief" placeholder="请输入"></editor>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="显示排序" prop="orderNum"><el-input-number v-model="form.orderNum" controls-position="right" :min="0" /></el-form-item>
|
|
|
- <el-form-item label="科室状态">
|
|
|
- <el-radio-group v-model="form.status">
|
|
|
- <el-radio v-for="dict in dict.type.sys_normal_disable" :key="dict.value" :label="dict.value">{{ dict.label }}</el-radio>
|
|
|
- </el-radio-group>
|
|
|
- </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>
|
|
|
|
|
@@ -71,11 +48,9 @@ export default {
|
|
|
components: { Treeselect },
|
|
|
data() {
|
|
|
return {
|
|
|
- // 显示搜索条件
|
|
|
- showSearch: true,
|
|
|
// 表格树数据
|
|
|
deptList: [],
|
|
|
- // 部门树选项
|
|
|
+ // 科室树选项
|
|
|
deptOptions: [],
|
|
|
// 弹出层标题
|
|
|
title: '',
|
|
@@ -89,15 +64,6 @@ export default {
|
|
|
queryParams: {
|
|
|
deptName: undefined,
|
|
|
status: undefined
|
|
|
- },
|
|
|
- // 表单参数
|
|
|
- form: {},
|
|
|
- // 表单校验
|
|
|
- rules: {
|
|
|
- parentId: [{ required: true, message: '上级部门不能为空', trigger: 'blur' }],
|
|
|
- deptName: [{ required: true, message: '部门名称不能为空', trigger: 'blur' }],
|
|
|
- brief: [{ required: true, message: '科室介绍不能为空', trigger: 'blur' }],
|
|
|
- orderNum: [{ required: true, message: '显示排序不能为空', trigger: 'blur' }]
|
|
|
}
|
|
|
};
|
|
|
},
|
|
@@ -105,7 +71,7 @@ export default {
|
|
|
this.getList();
|
|
|
},
|
|
|
methods: {
|
|
|
- /** 查询部门列表 */
|
|
|
+ /** 查询科室列表 */
|
|
|
getList() {
|
|
|
listDept(this.queryParams).then((response) => {
|
|
|
response.data.forEach((item) => {
|
|
@@ -118,7 +84,7 @@ export default {
|
|
|
this.deptList = this.handleTree(response.data, 'deptId');
|
|
|
});
|
|
|
},
|
|
|
- /** 转换部门数据结构 */
|
|
|
+ /** 转换科室数据结构 */
|
|
|
normalizer(node) {
|
|
|
if (node.children && !node.children.length) {
|
|
|
delete node.children;
|
|
@@ -159,7 +125,7 @@ export default {
|
|
|
},
|
|
|
/** 新增按钮操作 */
|
|
|
handleAdd(row) {
|
|
|
- this.iframe({ obj: edit, param: { parentId: row.deptId, ancestors: row.ancestors }, title: '新增科室', width: '55%', height: '75%' });
|
|
|
+ this.iframe({ obj: edit, param: { parentId: row.deptId, ancestors: row.ancestors }, title: '新增科室', width: '55%', height: '78%' });
|
|
|
},
|
|
|
/** 展开/折叠操作 */
|
|
|
toggleExpandAll() {
|
|
@@ -171,43 +137,7 @@ export default {
|
|
|
},
|
|
|
/** 修改按钮操作 */
|
|
|
handleUpdate(row) {
|
|
|
- this.iframe({ obj: edit, param: { id: row.deptId }, title: '编辑科室', width: '55%', height: '75%' });
|
|
|
- /* this.reset();
|
|
|
- this.open = true;
|
|
|
- this.title = '修改科室';
|
|
|
- getDept(row.deptId).then((response) => {
|
|
|
- this.form = response.data;
|
|
|
- this.form.ancestors = this.form.ancestors.split(',') || [];
|
|
|
- listDeptExcludeChild(row.deptId).then((response) => {
|
|
|
- this.deptOptions = this.handleTree(response.data, 'deptId');
|
|
|
- if (this.deptOptions.length == 0) {
|
|
|
- const noResultsOptions = { deptId: this.form.parentId, deptName: this.form.parentName, children: [] };
|
|
|
- this.deptOptions.push(noResultsOptions);
|
|
|
- }
|
|
|
- });
|
|
|
- }); */
|
|
|
- },
|
|
|
- /** 提交按钮 */
|
|
|
- submitForm: function () {
|
|
|
- this.$refs['form'].validate((valid) => {
|
|
|
- if (valid) {
|
|
|
- if (this.form.deptId != undefined) {
|
|
|
- let data = JSON.parse(JSON.stringify(this.form));
|
|
|
- data.ancestors = data.ancestors.toString();
|
|
|
- updateDept(data).then((response) => {
|
|
|
- this.$modal.msgSuccess('修改成功');
|
|
|
- this.open = false;
|
|
|
- this.getList();
|
|
|
- });
|
|
|
- } else {
|
|
|
- addDept(this.form).then((response) => {
|
|
|
- this.$modal.msgSuccess('新增成功');
|
|
|
- this.open = false;
|
|
|
- this.getList();
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
+ this.iframe({ obj: edit, param: { id: row.deptId }, title: '编辑科室', width: '55%', height: '78%' });
|
|
|
},
|
|
|
/** 删除按钮操作 */
|
|
|
handleDelete(row) {
|