机构 科室
This commit is contained in:
parent
f485c42d04
commit
fbdfa42cbf
79
src/api/system/agency.js
Normal file
79
src/api/system/agency.js
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询机构信息列表
|
||||||
|
export function listAgency(id) {
|
||||||
|
return request({
|
||||||
|
url: '/system/agency/'+ id,
|
||||||
|
method: 'get',
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export function getFirstLevelInfo() {
|
||||||
|
return request({
|
||||||
|
url: '/system/area/getFirstLevelInfo',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export function getSecondaryLevelInfo(id) {
|
||||||
|
return request({
|
||||||
|
url: `/system/area/getSecondaryLevelInfo?parentId=${id}`,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 机构树
|
||||||
|
export function agencyList() {
|
||||||
|
return request({
|
||||||
|
url: '/system/agency/agencyList',
|
||||||
|
method: 'get',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 类别
|
||||||
|
export function agencyCategoryList() {
|
||||||
|
return request({
|
||||||
|
url: '/system/agencyCategory/agencyCategoryList ',
|
||||||
|
method: 'get',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 查询机构信息详细
|
||||||
|
export function getAgency(id) {
|
||||||
|
return request({
|
||||||
|
url: '/system/agency/' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增机构信息
|
||||||
|
export function addAgency(data) {
|
||||||
|
return request({
|
||||||
|
url: '/system/agency',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改机构信息
|
||||||
|
export function updateAgency(data) {
|
||||||
|
return request({
|
||||||
|
url: '/system/agency',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除机构信息
|
||||||
|
export function delAgency(id) {
|
||||||
|
return request({
|
||||||
|
url: '/system/agency/' + id,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getAgencytype(dictType) {
|
||||||
|
return request({
|
||||||
|
url: '/system/dict/data/type/' + dictType,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
44
src/api/system/agencyCategory.js
Normal file
44
src/api/system/agencyCategory.js
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询机构类别列表
|
||||||
|
export function listAgencyCategory(query) {
|
||||||
|
return request({
|
||||||
|
url: '/system/agencyCategory/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询机构类别详细
|
||||||
|
export function getAgencyCategory(id) {
|
||||||
|
return request({
|
||||||
|
url: '/system/agencyCategory/' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增机构类别
|
||||||
|
export function addAgencyCategory(data) {
|
||||||
|
return request({
|
||||||
|
url: '/system/agencyCategory',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改机构类别
|
||||||
|
export function updateAgencyCategory(data) {
|
||||||
|
return request({
|
||||||
|
url: '/system/agencyCategory',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除机构类别
|
||||||
|
export function delAgencyCategory(id) {
|
||||||
|
return request({
|
||||||
|
url: '/system/agencyCategory/' + id,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
44
src/api/system/department.js
Normal file
44
src/api/system/department.js
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询科室信息列表
|
||||||
|
export function listDepartment(query) {
|
||||||
|
return request({
|
||||||
|
url: '/system/department/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询科室信息详细
|
||||||
|
export function getDepartment(id) {
|
||||||
|
return request({
|
||||||
|
url: '/system/department/' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增科室信息
|
||||||
|
export function addDepartment(data) {
|
||||||
|
return request({
|
||||||
|
url: '/system/department/add',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改科室信息
|
||||||
|
export function updateDepartment(data) {
|
||||||
|
return request({
|
||||||
|
url: '/system/department/edit',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除科室信息
|
||||||
|
export function delDepartment(id) {
|
||||||
|
return request({
|
||||||
|
url: '/system/department/' + id,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
1047
src/views/system/agency/index.vue
Normal file
1047
src/views/system/agency/index.vue
Normal file
File diff suppressed because it is too large
Load Diff
503
src/views/system/agencyCategory/index.vue
Normal file
503
src/views/system/agencyCategory/index.vue
Normal file
@ -0,0 +1,503 @@
|
|||||||
|
<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="父级类别id" prop="parentCategoryId">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.parentCategoryId"
|
||||||
|
placeholder="请输入父级类别id"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item> -->
|
||||||
|
<el-form-item label="类别名称" prop="categoryName">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.categoryName"
|
||||||
|
placeholder="请输入类别名称"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="类别编码" prop="categoryCode">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.categoryCode"
|
||||||
|
placeholder="请输入类别编码"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="类别等级" prop="categoryLevel">
|
||||||
|
<!-- <el-input v-model="form.categoryLevel" placeholder="请选择类别等级" /> -->
|
||||||
|
<el-select v-model="form.categoryLevel" placeholder="请选择">
|
||||||
|
<el-option
|
||||||
|
v-for="item in options"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<!-- <el-form-item label="类别等级,1:一级类型,2:二级类别,3:三级类别等" prop="categoryLevel">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.categoryLevel"
|
||||||
|
placeholder="请输入类别等级,1:一级类型,2:二级类别,3:三级类别等"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item> -->
|
||||||
|
<el-form-item label="类别排序" prop="categorySort">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.categorySort"
|
||||||
|
placeholder="请输入类别排序"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="类别概述" prop="categoryRemark">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.categoryRemark"
|
||||||
|
placeholder="请输入类别概述"
|
||||||
|
clearable
|
||||||
|
@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-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
icon="el-icon-plus"
|
||||||
|
size="mini"
|
||||||
|
@click="handleAdd"
|
||||||
|
v-hasPermi="['system:agencyCategory:add']"
|
||||||
|
>新增</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
plain
|
||||||
|
icon="el-icon-edit"
|
||||||
|
size="mini"
|
||||||
|
:disabled="single"
|
||||||
|
@click="handleUpdate"
|
||||||
|
v-hasPermi="['system:agencyCategory:edit']"
|
||||||
|
>修改</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="danger"
|
||||||
|
plain
|
||||||
|
icon="el-icon-delete"
|
||||||
|
size="mini"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="handleDelete"
|
||||||
|
v-hasPermi="['system:agencyCategory:remove']"
|
||||||
|
>删除</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="warning"
|
||||||
|
plain
|
||||||
|
icon="el-icon-download"
|
||||||
|
size="mini"
|
||||||
|
@click="handleExport"
|
||||||
|
v-hasPermi="['system:agencyCategory:export']"
|
||||||
|
>导出</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar
|
||||||
|
:showSearch.sync="showSearch"
|
||||||
|
@queryTable="getList"
|
||||||
|
></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table
|
||||||
|
v-loading="loading"
|
||||||
|
:data="agencyCategoryList"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
>
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<!-- <el-table-column label="主键id" align="center" prop="id" />
|
||||||
|
<el-table-column label="父级类别id" align="center" prop="parentCategoryId" /> -->
|
||||||
|
<el-table-column label="类别名称" align="center" prop="categoryName" />
|
||||||
|
<el-table-column label="类别编码" align="center" prop="categoryCode" />
|
||||||
|
<el-table-column label="类别等级" align="center" prop="categoryLevel">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.status == "1" ? "一级类别" : "" }}
|
||||||
|
{{ scope.row.status == "2" ? "二级类别" : "" }}
|
||||||
|
{{ scope.row.status == "3" ? "三级类别" : "" }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="类别排序" align="center" prop="categorySort" />
|
||||||
|
<el-table-column label="类别概述" align="center" prop="categoryRemark" />
|
||||||
|
<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="handleUpdate(scope.row)"
|
||||||
|
v-hasPermi="['system:agencyCategory:edit']"
|
||||||
|
>修改</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['system:agencyCategory:remove']"
|
||||||
|
>删除</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="parentCategoryId">
|
||||||
|
<el-cascader
|
||||||
|
:props="props"
|
||||||
|
@change="change"
|
||||||
|
style="width: 250px"
|
||||||
|
:show-all-levels="false"
|
||||||
|
ref="cascader"
|
||||||
|
:placeholder="
|
||||||
|
form.parentCategoryId ? form.parentCategoryId : '主分类'
|
||||||
|
"
|
||||||
|
:key="isResouceShow"
|
||||||
|
></el-cascader>
|
||||||
|
<!-- <el-input v-model="form.parentCategoryId" placeholder="请输入父级类别id" /> -->
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="类别名称" prop="categoryName">
|
||||||
|
<el-input
|
||||||
|
v-model="form.categoryName"
|
||||||
|
style="width: 250px"
|
||||||
|
placeholder="请输入类别名称"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="类别编码" prop="categoryCode">
|
||||||
|
<el-input
|
||||||
|
v-model="form.categoryCode"
|
||||||
|
style="width: 250px"
|
||||||
|
placeholder="请输入类别编码"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="类别等级" prop="categoryLevel">
|
||||||
|
<!-- <el-input v-model="form.categoryLevel" placeholder="请选择类别等级" /> -->
|
||||||
|
<el-select
|
||||||
|
v-model="form.categoryLevel"
|
||||||
|
placeholder="请选择"
|
||||||
|
style="width: 250px"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in options"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="类别排序" prop="categorySort">
|
||||||
|
<el-input
|
||||||
|
v-model="form.categorySort"
|
||||||
|
style="width: 250px"
|
||||||
|
placeholder="请输入类别排序"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="类别概述" prop="categoryRemark">
|
||||||
|
<el-input
|
||||||
|
v-model="form.categoryRemark"
|
||||||
|
style="width: 250px"
|
||||||
|
placeholder="请输入类别概述"
|
||||||
|
/>
|
||||||
|
</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 {
|
||||||
|
listAgencyCategory,
|
||||||
|
getAgencyCategory,
|
||||||
|
delAgencyCategory,
|
||||||
|
addAgencyCategory,
|
||||||
|
updateAgencyCategory,
|
||||||
|
} from "@/api/system/agencyCategory";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "AgencyCategory",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
isResouceShow: 1,
|
||||||
|
|
||||||
|
treeOption: {
|
||||||
|
lazy: true,
|
||||||
|
checkStrictly: true, // 是否可选择任意一级
|
||||||
|
lazyLoad(node, resolve) {
|
||||||
|
console.log(node, resolve);
|
||||||
|
const id = node.level === 0 ? 0 : node.data.id;
|
||||||
|
setTimeout(() => {
|
||||||
|
if (id == 9999999) {
|
||||||
|
getStationCategoryList(0).then((res) => {
|
||||||
|
// 接口请求
|
||||||
|
res.data.forEach((e) => {
|
||||||
|
e.value = e.id;
|
||||||
|
e.label = e.goodsCategoryName;
|
||||||
|
});
|
||||||
|
resolve(
|
||||||
|
res.data.map((item) => {
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
};
|
||||||
|
})
|
||||||
|
);
|
||||||
|
});
|
||||||
|
} else if (id == 0) {
|
||||||
|
var data = [
|
||||||
|
{
|
||||||
|
label: "商品主分类",
|
||||||
|
children: [],
|
||||||
|
id: 9999999,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
resolve(
|
||||||
|
data.map((item) => {
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
};
|
||||||
|
})
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
getStationCategoryList(id).then((res) => {
|
||||||
|
// 接口请求
|
||||||
|
res.data.forEach((e) => {
|
||||||
|
e.value = e.id;
|
||||||
|
e.label = e.goodsCategoryName;
|
||||||
|
});
|
||||||
|
resolve(
|
||||||
|
res.data.map((item) => {
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
};
|
||||||
|
})
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, 300);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
// 选中数组
|
||||||
|
ids: [],
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
value: "1",
|
||||||
|
label: "一级类别",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "2",
|
||||||
|
label: "二级类别",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "3",
|
||||||
|
label: "三级类别",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
// 显示搜索条件
|
||||||
|
showSearch: true,
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// 机构类别表格数据
|
||||||
|
agencyCategoryList: [],
|
||||||
|
// 弹出层标题
|
||||||
|
title: "",
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
parentCategoryId: null,
|
||||||
|
categoryName: null,
|
||||||
|
categoryCode: null,
|
||||||
|
categoryLevel: null,
|
||||||
|
categorySort: null,
|
||||||
|
categoryRemark: null,
|
||||||
|
},
|
||||||
|
// 表单参数
|
||||||
|
form: {},
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
parentCategoryId: [
|
||||||
|
{ required: true, message: "父级类别id不能为空", trigger: "blur" },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
change(e) {
|
||||||
|
this.form.parentId = e[e.length - 1];
|
||||||
|
},
|
||||||
|
/** 查询机构类别列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
listAgencyCategory(this.queryParams).then((response) => {
|
||||||
|
this.agencyCategoryList = response.rows;
|
||||||
|
this.total = response.total;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.open = false;
|
||||||
|
this.reset();
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
id: null,
|
||||||
|
parentCategoryId: null,
|
||||||
|
categoryName: null,
|
||||||
|
categoryCode: null,
|
||||||
|
categoryLevel: null,
|
||||||
|
categorySort: null,
|
||||||
|
categoryRemark: null,
|
||||||
|
createBy: null,
|
||||||
|
createTime: null,
|
||||||
|
updateBy: null,
|
||||||
|
updateTime: null,
|
||||||
|
};
|
||||||
|
this.resetForm("form");
|
||||||
|
},
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
handleQuery() {
|
||||||
|
this.queryParams.pageNum = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery() {
|
||||||
|
this.resetForm("queryForm");
|
||||||
|
this.handleQuery();
|
||||||
|
},
|
||||||
|
// 多选框选中数据
|
||||||
|
handleSelectionChange(selection) {
|
||||||
|
this.ids = selection.map((item) => item.id);
|
||||||
|
this.single = selection.length !== 1;
|
||||||
|
this.multiple = !selection.length;
|
||||||
|
},
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
handleAdd() {
|
||||||
|
this.reset();
|
||||||
|
this.open = true;
|
||||||
|
this.title = "添加机构类别";
|
||||||
|
},
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.reset();
|
||||||
|
const id = row.id || this.ids;
|
||||||
|
getAgencyCategory(id).then((response) => {
|
||||||
|
this.form = response.data;
|
||||||
|
this.open = true;
|
||||||
|
this.title = "修改机构类别";
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm() {
|
||||||
|
this.$refs["form"].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.form.id != null) {
|
||||||
|
updateAgencyCategory(this.form).then((response) => {
|
||||||
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
this.open = false;
|
||||||
|
++this.isResouceShow;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addAgencyCategory(this.form).then((response) => {
|
||||||
|
this.$modal.msgSuccess("新增成功");
|
||||||
|
this.open = false;
|
||||||
|
++this.isResouceShow;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(row) {
|
||||||
|
const ids = row.id || this.ids;
|
||||||
|
this.$modal
|
||||||
|
.confirm('是否确认删除机构类别编号为"' + ids + '"的数据项?')
|
||||||
|
.then(function () {
|
||||||
|
return delAgencyCategory(ids);
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
},
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
handleExport() {
|
||||||
|
this.download(
|
||||||
|
"system/agencyCategory/export",
|
||||||
|
{
|
||||||
|
...this.queryParams,
|
||||||
|
},
|
||||||
|
`agencyCategory_${new Date().getTime()}.xlsx`
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
879
src/views/system/department/index.vue
Normal file
879
src/views/system/department/index.vue
Normal file
@ -0,0 +1,879 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<!--部门数据-->
|
||||||
|
<el-col :span="4" :xs="24">
|
||||||
|
<!-- <div class="head-container">
|
||||||
|
<el-input
|
||||||
|
v-model="goodsCategoryName"
|
||||||
|
placeholder="请输入区域名称"
|
||||||
|
clearable
|
||||||
|
size="small"
|
||||||
|
prefix-icon="el-icon-search"
|
||||||
|
style="margin-bottom: 20px"
|
||||||
|
/>
|
||||||
|
</div>-->
|
||||||
|
<div class="head-container" style="height: 580px; width: 100%">
|
||||||
|
<el-tree
|
||||||
|
:data="deptOptions"
|
||||||
|
:props="defaultProps"
|
||||||
|
:expand-on-click-node="false"
|
||||||
|
:filter-node-method="filterNode"
|
||||||
|
ref="tree"
|
||||||
|
default-expand-all
|
||||||
|
highlight-current
|
||||||
|
@node-click="handleNodeClick"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
<!--用户数据-->
|
||||||
|
<el-col :span="20" :xs="24">
|
||||||
|
<el-form
|
||||||
|
:model="queryParams"
|
||||||
|
ref="queryForm"
|
||||||
|
size="small"
|
||||||
|
:inline="true"
|
||||||
|
v-show="showSearch"
|
||||||
|
label-width="68px"
|
||||||
|
>
|
||||||
|
<el-form-item label="科室名称" prop="departmentName">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.departmentName"
|
||||||
|
placeholder="请输入科室名称"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="科室代码" prop="departmentCode">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.departmentCode"
|
||||||
|
placeholder="请输入科室代码"
|
||||||
|
clearable
|
||||||
|
@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-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
icon="el-icon-plus"
|
||||||
|
size="mini"
|
||||||
|
@click="handleAdd"
|
||||||
|
v-hasPermi="['system:department:add']"
|
||||||
|
>新增</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
plain
|
||||||
|
icon="el-icon-edit"
|
||||||
|
size="mini"
|
||||||
|
:disabled="single"
|
||||||
|
@click="handleUpdate"
|
||||||
|
v-hasPermi="['system:department:edit']"
|
||||||
|
>修改</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="danger"
|
||||||
|
plain
|
||||||
|
icon="el-icon-delete"
|
||||||
|
size="mini"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="handleDelete"
|
||||||
|
v-hasPermi="['system:department:remove']"
|
||||||
|
>删除</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="info"
|
||||||
|
plain
|
||||||
|
icon="el-icon-upload2"
|
||||||
|
size="mini"
|
||||||
|
@click="handleImport"
|
||||||
|
v-hasPermi="['system:person:importStationPerson']"
|
||||||
|
>导入</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="warning"
|
||||||
|
plain
|
||||||
|
icon="el-icon-download"
|
||||||
|
size="mini"
|
||||||
|
@click="handleExport"
|
||||||
|
v-hasPermi="['system:department:export']"
|
||||||
|
>导出</el-button
|
||||||
|
>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar
|
||||||
|
:showSearch.sync="showSearch"
|
||||||
|
@queryTable="getList"
|
||||||
|
></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table
|
||||||
|
v-loading="loading"
|
||||||
|
:data="departmentList"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
>
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<!-- <el-table-column label="主键id" align="center" prop="id" /> -->
|
||||||
|
<!-- <el-table-column label="上级科室id" align="center" prop="parentDepartmentId" />
|
||||||
|
<el-table-column label="所属机构id" align="center" prop="agencyId" /> -->
|
||||||
|
<!-- <el-table-column label="所属机构名称" align="center" prop="agencyName" /> -->
|
||||||
|
<el-table-column
|
||||||
|
label="科室名称"
|
||||||
|
align="center"
|
||||||
|
prop="departmentName"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="科室代码"
|
||||||
|
align="center"
|
||||||
|
prop="departmentCode"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="科室类型"
|
||||||
|
align="center"
|
||||||
|
prop="departmentType"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="提供服务类别"
|
||||||
|
align="center"
|
||||||
|
prop="provideServiceCategory"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope"
|
||||||
|
>{{
|
||||||
|
scope.row.provideServiceCategory == "OUTPATIENT_SERVICE"
|
||||||
|
? "门诊"
|
||||||
|
: ""
|
||||||
|
}}
|
||||||
|
{{
|
||||||
|
scope.row.provideServiceCategory == "EMERGENCY_TREATMENT"
|
||||||
|
? "急诊"
|
||||||
|
: ""
|
||||||
|
}}
|
||||||
|
{{
|
||||||
|
scope.row.provideServiceCategory == "BE_HOSPITALIZED"
|
||||||
|
? "住院"
|
||||||
|
: ""
|
||||||
|
}}
|
||||||
|
|
||||||
|
{{ scope.row.provideServiceCategory == "WARD" ? "病区" : "" }}
|
||||||
|
{{
|
||||||
|
scope.row.provideServiceCategory == "MEDICAL_TECHNOLOGY"
|
||||||
|
? "医技"
|
||||||
|
: ""
|
||||||
|
}}
|
||||||
|
|
||||||
|
{{ scope.row.provideServiceCategory == "DRUG" ? "药剂" : "" }}
|
||||||
|
{{ scope.row.provideServiceCategory == "FINANCE" ? "财务" : "" }}
|
||||||
|
{{
|
||||||
|
scope.row.provideServiceCategory == "ADMINISTRATION"
|
||||||
|
? "行政"
|
||||||
|
: ""
|
||||||
|
}}
|
||||||
|
{{ scope.row.provideServiceCategory == "PHARMACY" ? "药房" : "" }}
|
||||||
|
{{
|
||||||
|
scope.row.provideServiceCategory == "DRUG_STORAGE" ? "药库" : ""
|
||||||
|
}}
|
||||||
|
{{
|
||||||
|
scope.row.provideServiceCategory == "PUBLIC_HEALTH"
|
||||||
|
? "公卫"
|
||||||
|
: ""
|
||||||
|
}}
|
||||||
|
</template></el-table-column
|
||||||
|
>
|
||||||
|
<!-- <el-table-column label="细分类别id" align="center" prop="subdivisionCategoryId" />
|
||||||
|
<el-table-column label="细分类别名称" align="center" prop="subdivisionCategoryName" />
|
||||||
|
<el-table-column label="标准科室对照id" align="center" prop="normDepartmentCompareId" />
|
||||||
|
<el-table-column label="标准科室对照名称" align="center" prop="normDepartmentCompareName" />
|
||||||
|
<el-table-column label="编制床位数" align="center" prop="prepareBedsCount" /> -->
|
||||||
|
<el-table-column
|
||||||
|
label="科室电话"
|
||||||
|
align="center"
|
||||||
|
prop="departmentPhone"
|
||||||
|
/>
|
||||||
|
<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="handleUpdate(scope.row)"
|
||||||
|
v-hasPermi="['system:department:edit']"
|
||||||
|
>修改</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['system:department:remove']"
|
||||||
|
>删除</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-col>
|
||||||
|
</el-row>
|
||||||
|
<!-- 导入 -->
|
||||||
|
<el-dialog
|
||||||
|
:title="upload.title"
|
||||||
|
:visible.sync="upload.open"
|
||||||
|
width="400px"
|
||||||
|
append-to-body
|
||||||
|
>
|
||||||
|
<el-upload
|
||||||
|
ref="upload"
|
||||||
|
:limit="1"
|
||||||
|
accept=".xlsx, .xls"
|
||||||
|
:headers="upload.headers"
|
||||||
|
:action="upload.url"
|
||||||
|
:disabled="upload.isUploading"
|
||||||
|
:on-progress="handleFileUploadProgress"
|
||||||
|
:on-success="handleFileSuccess"
|
||||||
|
:auto-upload="false"
|
||||||
|
drag
|
||||||
|
>
|
||||||
|
<i class="el-icon-upload"></i>
|
||||||
|
<div class="el-upload__text">
|
||||||
|
将文件拖到此处,或
|
||||||
|
<em>点击上传</em>
|
||||||
|
</div>
|
||||||
|
<div class="el-upload__tip text-center" slot="tip">
|
||||||
|
<span>仅允许导入xls、xlsx格式文件。</span>
|
||||||
|
<el-link
|
||||||
|
type="primary"
|
||||||
|
:underline="false"
|
||||||
|
style="font-size: 12px; vertical-align: baseline"
|
||||||
|
@click="importTemplate"
|
||||||
|
>下载模板</el-link
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</el-upload>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitFileForm">确 定</el-button>
|
||||||
|
<el-button @click="upload.open = false">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
<!-- 添加或修改科室信息对话框 -->
|
||||||
|
<el-dialog
|
||||||
|
:title="title"
|
||||||
|
:visible.sync="open"
|
||||||
|
width="1000px"
|
||||||
|
append-to-body
|
||||||
|
>
|
||||||
|
<el-form
|
||||||
|
ref="form"
|
||||||
|
:model="form"
|
||||||
|
:rules="rules"
|
||||||
|
label-width="120px"
|
||||||
|
:inline="true"
|
||||||
|
>
|
||||||
|
<!-- <el-form-item label="上级科室id" prop="parentDepartmentId">
|
||||||
|
<el-input
|
||||||
|
v-model="form.parentDepartmentId"
|
||||||
|
placeholder="请输入上级科室id"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="所属机构id" prop="agencyId">
|
||||||
|
<el-input v-model="form.agencyId" placeholder="请输入所属机构id" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="所属机构名称" prop="agencyName">
|
||||||
|
<el-input
|
||||||
|
v-model="form.agencyName"
|
||||||
|
placeholder="请输入所属机构名称"
|
||||||
|
/>
|
||||||
|
</el-form-item> -->
|
||||||
|
<el-form-item label="科室名称" prop="departmentName">
|
||||||
|
<el-input
|
||||||
|
v-model="form.departmentName"
|
||||||
|
placeholder="请输入科室名称"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="科室代码" prop="departmentCode">
|
||||||
|
<el-input
|
||||||
|
v-model="form.departmentCode"
|
||||||
|
placeholder="请输入科室代码"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="科室简称" prop="departmentAbbreviation">
|
||||||
|
<el-input
|
||||||
|
v-model="form.departmentAbbreviation"
|
||||||
|
placeholder="请输入科室简称"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="科室类型" prop="departmentType">
|
||||||
|
<el-select
|
||||||
|
v-model="form.departmentType"
|
||||||
|
placeholder="请选择"
|
||||||
|
style="width: 205px"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in optionstype"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<!-- <el-form-item label="科室负责人id" prop="departmentPersonId">
|
||||||
|
<el-input
|
||||||
|
v-model="form.departmentPersonId"
|
||||||
|
placeholder="请输入科室负责人id"
|
||||||
|
/>
|
||||||
|
</el-form-item> -->
|
||||||
|
<el-form-item label="科室负责人姓名" prop="departmentPersonName">
|
||||||
|
<el-input
|
||||||
|
v-model="form.departmentPersonName"
|
||||||
|
placeholder="请输入科室负责人姓名"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="节点类型" prop="nodeType">
|
||||||
|
<el-select
|
||||||
|
v-model="form.nodeType"
|
||||||
|
placeholder="请选择"
|
||||||
|
style="width: 205px"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in nodeTypeoptions"
|
||||||
|
:key="item.dictValue"
|
||||||
|
:label="item.dictLabel"
|
||||||
|
:value="item.dictValue"
|
||||||
|
>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="所属机构" prop="agencyName">
|
||||||
|
<el-cascader
|
||||||
|
:props="{ checkStrictly: true }"
|
||||||
|
:options="treeOptions"
|
||||||
|
@change="change($event)"
|
||||||
|
style="width: 205px; color: black"
|
||||||
|
v-model="form.agencyId"
|
||||||
|
:show-all-levels="false"
|
||||||
|
:placeholder="
|
||||||
|
form.agencyName ? form.agencyName : '请选择上级机构'
|
||||||
|
"
|
||||||
|
ref="cascader"
|
||||||
|
:key="isResouceShow"
|
||||||
|
></el-cascader>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="上级科室" prop="parentDepartmentId`">
|
||||||
|
<el-cascader
|
||||||
|
:props="{ checkStrictly: true }"
|
||||||
|
:options="treeOptionsagencyCategoryId"
|
||||||
|
@change="changeagencyCategoryId($event)"
|
||||||
|
style="width: 205px"
|
||||||
|
:placeholder="
|
||||||
|
form.parentDepartmentName
|
||||||
|
? form.parentDepartmentName
|
||||||
|
: '请选择上级科室'
|
||||||
|
"
|
||||||
|
v-model="form.parentDepartmentId"
|
||||||
|
:show-all-levels="false"
|
||||||
|
ref="cascader"
|
||||||
|
:key="isResouceShows"
|
||||||
|
></el-cascader>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="提供服务类别" prop="provideServiceCategory">
|
||||||
|
<el-select
|
||||||
|
v-model="form.provideServiceCategory"
|
||||||
|
placeholder="请选择"
|
||||||
|
style="width: 205px"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in options"
|
||||||
|
:key="item.dictValue"
|
||||||
|
:label="item.dictLabel"
|
||||||
|
:value="item.dictValue"
|
||||||
|
>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
<!-- <el-input
|
||||||
|
v-model="form.provideServiceCategory"
|
||||||
|
placeholder="请输入提供服务类别,门诊:OUTPATIENT_SERVICE,急诊:EMERGENCY_TREATMENT,住院:BE_HOSPITALIZED,病区:WARD,医技:MEDICAL_TECHNOLOGY,
|
||||||
|
药剂:DRUG,财务:FINANCE,行政:ADMINISTRATION,药房:PHARMACY,药库:DRUG_STORAGE,公卫:PUBLIC_HEALTH"
|
||||||
|
/> -->
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="细分类别" prop="subdivisionCategoryId">
|
||||||
|
<el-select
|
||||||
|
v-model="form.subdivisionCategoryId"
|
||||||
|
placeholder="请选择"
|
||||||
|
style="width: 205px"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in option"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<!-- <el-form-item label="细分类别名称" prop="subdivisionCategoryName">
|
||||||
|
<el-input
|
||||||
|
v-model="form.subdivisionCategoryName"
|
||||||
|
placeholder="请输入细分类别名称"
|
||||||
|
/>
|
||||||
|
</el-form-item> -->
|
||||||
|
<el-form-item label="标准科室对照" prop="normDepartmentCompareId">
|
||||||
|
<el-input
|
||||||
|
v-model="form.normDepartmentCompareId"
|
||||||
|
placeholder="请输入标准科室对照id"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<!-- <el-form-item label="标准科室对照名称" prop="normDepartmentCompareName">
|
||||||
|
<el-input
|
||||||
|
v-model="form.normDepartmentCompareName"
|
||||||
|
placeholder="请输入标准科室对照名称"
|
||||||
|
/>
|
||||||
|
</el-form-item> -->
|
||||||
|
<el-form-item label="编制床位数" prop="prepareBedsCount">
|
||||||
|
<el-input
|
||||||
|
v-model="form.prepareBedsCount"
|
||||||
|
placeholder="请输入编制床位数"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="科室电话" prop="departmentPhone">
|
||||||
|
<el-input
|
||||||
|
v-model="form.departmentPhone"
|
||||||
|
placeholder="请输入科室电话"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="科室邮箱" prop="departmentMail">
|
||||||
|
<el-input
|
||||||
|
v-model="form.departmentMail"
|
||||||
|
placeholder="请输入科室邮箱"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="成立日期" prop="establishDate">
|
||||||
|
<el-date-picker
|
||||||
|
clearable
|
||||||
|
v-model="form.establishDate"
|
||||||
|
type="date"
|
||||||
|
style="width: 205px"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
placeholder="请选择成立日期"
|
||||||
|
>
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="撤销日期" prop="revokeDate">
|
||||||
|
<el-date-picker
|
||||||
|
clearable
|
||||||
|
v-model="form.revokeDate"
|
||||||
|
type="date"
|
||||||
|
style="width: 205px"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
placeholder="请选择撤销日期"
|
||||||
|
>
|
||||||
|
</el-date-picker>
|
||||||
|
</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 {
|
||||||
|
listDepartment,
|
||||||
|
getDepartment,
|
||||||
|
delDepartment,
|
||||||
|
addDepartment,
|
||||||
|
updateDepartment,
|
||||||
|
} from "@/api/system/department";
|
||||||
|
import { agencyList, getAgencytype } from "@/api/system/agency";
|
||||||
|
import { getToken } from "@/utils/auth";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "Department",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
option: [],
|
||||||
|
nodeTypeoptions: [],
|
||||||
|
treeOptions: [],
|
||||||
|
treeOptionsagencyCategoryId: [],
|
||||||
|
optionstype:[],
|
||||||
|
options: [
|
||||||
|
// {
|
||||||
|
// value: "PUBLIC_HEALTH",
|
||||||
|
// label: "公卫",
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// value: "DRUG_STORAGE",
|
||||||
|
// label: "药库",
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// value: "ADMINISTRATION",
|
||||||
|
// label: "行政",
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// value: "PHARMACY",
|
||||||
|
// label: "药房",
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// value: "FINANCE",
|
||||||
|
// label: "财务",
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// value: "DRUG",
|
||||||
|
// label: "药剂",
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// value: "WARD",
|
||||||
|
// label: "病区",
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// value: "BE_HOSPITALIZED",
|
||||||
|
// label: "住院",
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// value: "EMERGENCY_TREATMENT",
|
||||||
|
// label: "急诊",
|
||||||
|
// },
|
||||||
|
],
|
||||||
|
deptOptions: undefined,
|
||||||
|
defaultProps: {
|
||||||
|
children: "children",
|
||||||
|
label: "label",
|
||||||
|
},
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
// 选中数组
|
||||||
|
ids: [],
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
// 显示搜索条件
|
||||||
|
showSearch: true,
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// 科室信息表格数据
|
||||||
|
departmentList: [],
|
||||||
|
// 弹出层标题
|
||||||
|
title: "",
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
parentDepartmentId: null,
|
||||||
|
agencyId: null,
|
||||||
|
agencyName: null,
|
||||||
|
departmentName: null,
|
||||||
|
departmentCode: null,
|
||||||
|
departmentType: null,
|
||||||
|
departmentAbbreviation: null,
|
||||||
|
departmentPersonId: null,
|
||||||
|
departmentPersonName: null,
|
||||||
|
nodeType: null,
|
||||||
|
provideServiceCategory: null,
|
||||||
|
subdivisionCategoryId: null,
|
||||||
|
subdivisionCategoryName: null,
|
||||||
|
normDepartmentCompareId: null,
|
||||||
|
normDepartmentCompareName: null,
|
||||||
|
prepareBedsCount: null,
|
||||||
|
departmentPhone: null,
|
||||||
|
departmentMail: null,
|
||||||
|
establishDate: null,
|
||||||
|
revokeDate: null,
|
||||||
|
},
|
||||||
|
// 表单参数
|
||||||
|
form: {},
|
||||||
|
// 用户导入参数
|
||||||
|
upload: {
|
||||||
|
// 是否显示弹出层(用户导入)
|
||||||
|
open: false,
|
||||||
|
// 弹出层标题(用户导入)
|
||||||
|
title: "",
|
||||||
|
// 是否禁用上传
|
||||||
|
isUploading: false,
|
||||||
|
// 设置上传的请求头部
|
||||||
|
headers: { Authorization: "Bearer " + getToken() },
|
||||||
|
// 上传的地址
|
||||||
|
url:
|
||||||
|
process.env.VUE_APP_BASE_API +
|
||||||
|
"/system/agency/insertAgencyImportList",
|
||||||
|
},
|
||||||
|
isResouceShow: 1,
|
||||||
|
isResouceShows: 1,
|
||||||
|
id:'',
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
// parentDepartmentId: [
|
||||||
|
// { required: true, message: "上级科室id不能为空", trigger: "blur" },
|
||||||
|
// ],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
this.gettreelist();
|
||||||
|
// this.gettreelistitem();
|
||||||
|
this.info();
|
||||||
|
this.infolist();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
info() {
|
||||||
|
var dictType = "node_type";
|
||||||
|
getAgencytype(dictType).then((res) => {
|
||||||
|
this.nodeTypeoptions = res.data;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
infolist() {
|
||||||
|
var dictType = "provide_service_category";
|
||||||
|
getAgencytype(dictType).then((res) => {
|
||||||
|
this.options = res.data;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
change(e) {
|
||||||
|
console.log(e, "78");
|
||||||
|
// console.log(this.$refs.cascader)
|
||||||
|
// this.form.parentId = e;
|
||||||
|
this.form.parentId = e[e.length - 1];
|
||||||
|
},
|
||||||
|
|
||||||
|
changeagencyCategoryId(e) {
|
||||||
|
this.form.agencyCategoryId = e[e.length - 1];
|
||||||
|
},
|
||||||
|
// gettreelistitem() {
|
||||||
|
// agencyCategoryList().then((res) => {
|
||||||
|
// // 接口请求
|
||||||
|
// this.treeOptionsagencyCategoryId = res.data.map((item) => {
|
||||||
|
// return { value: item.id, ...item };
|
||||||
|
// });
|
||||||
|
// });
|
||||||
|
// },
|
||||||
|
gettreelist() {
|
||||||
|
agencyList().then((res) => {
|
||||||
|
// 接口请求
|
||||||
|
this.deptOptions = res.data;
|
||||||
|
|
||||||
|
this.treeOptions = res.data.map((item) => {
|
||||||
|
return { value: item.id, ...item };
|
||||||
|
});
|
||||||
|
// this.treeOption = {
|
||||||
|
// lazy: true,
|
||||||
|
// checkStrictly: true,
|
||||||
|
// lazyLoad: this.lazyLoad,
|
||||||
|
// };
|
||||||
|
console.log(res.data, "58", this.treeOptions);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 导入按钮操作 */
|
||||||
|
handleImport() {
|
||||||
|
this.upload.open = true;
|
||||||
|
this.upload.title = "机构导入";
|
||||||
|
},
|
||||||
|
/** 下载模板操作 */
|
||||||
|
importTemplate() {
|
||||||
|
this.download(
|
||||||
|
"/system/importDownload/downloadTemplate?fileType=agency",
|
||||||
|
{},
|
||||||
|
`机构导入模板.xlsx`
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|
||||||
|
// 提交上传文件
|
||||||
|
submitFileForm() {
|
||||||
|
this.$refs.upload.submit();
|
||||||
|
},
|
||||||
|
// 文件上传成功处理
|
||||||
|
handleFileSuccess(response, file, fileList) {
|
||||||
|
this.upload.open = false;
|
||||||
|
this.upload.isUploading = false;
|
||||||
|
this.$refs.upload.clearFiles();
|
||||||
|
this.$alert(
|
||||||
|
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
|
||||||
|
response.msg +
|
||||||
|
"</div>",
|
||||||
|
"导入结果",
|
||||||
|
{ dangerouslyUseHTMLString: true }
|
||||||
|
);
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
// 文件上传中处理
|
||||||
|
handleFileUploadProgress(event, file, fileList) {
|
||||||
|
this.upload.isUploading = true;
|
||||||
|
},
|
||||||
|
// /** 查询部门下拉树结构 */
|
||||||
|
// getTreeselect() {
|
||||||
|
// agencyList().then((response) => {
|
||||||
|
// this.deptOptions = response.data;
|
||||||
|
// });
|
||||||
|
// },
|
||||||
|
|
||||||
|
// 筛选节点
|
||||||
|
filterNode(value, data) {
|
||||||
|
if (!value) return true;
|
||||||
|
return data.label.indexOf(value) !== -1;
|
||||||
|
},
|
||||||
|
// 节点单击事件
|
||||||
|
handleNodeClick(data) {
|
||||||
|
console.log(data, "5");
|
||||||
|
this.queryParams.agencyId = data.id;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
/** 查询科室信息列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
listDepartment(this.queryParams).then((response) => {
|
||||||
|
this.departmentList = response.rows;
|
||||||
|
this.total = response.total;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.open = false;
|
||||||
|
this.reset();
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
id: null,
|
||||||
|
parentDepartmentId: null,
|
||||||
|
agencyId: null,
|
||||||
|
agencyName: null,
|
||||||
|
departmentName: null,
|
||||||
|
departmentCode: null,
|
||||||
|
departmentType: null,
|
||||||
|
departmentAbbreviation: null,
|
||||||
|
departmentPersonId: null,
|
||||||
|
departmentPersonName: null,
|
||||||
|
nodeType: null,
|
||||||
|
provideServiceCategory: null,
|
||||||
|
subdivisionCategoryId: null,
|
||||||
|
subdivisionCategoryName: null,
|
||||||
|
normDepartmentCompareId: null,
|
||||||
|
normDepartmentCompareName: null,
|
||||||
|
prepareBedsCount: null,
|
||||||
|
departmentPhone: null,
|
||||||
|
departmentMail: null,
|
||||||
|
establishDate: null,
|
||||||
|
revokeDate: null,
|
||||||
|
createBy: null,
|
||||||
|
createTime: null,
|
||||||
|
updateBy: null,
|
||||||
|
updateTime: null,
|
||||||
|
};
|
||||||
|
this.resetForm("form");
|
||||||
|
},
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
handleQuery() {
|
||||||
|
this.queryParams.pageNum = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery() {
|
||||||
|
this.resetForm("queryForm");
|
||||||
|
this.handleQuery();
|
||||||
|
},
|
||||||
|
// 多选框选中数据
|
||||||
|
handleSelectionChange(selection) {
|
||||||
|
this.ids = selection.map((item) => item.id);
|
||||||
|
this.single = selection.length !== 1;
|
||||||
|
this.multiple = !selection.length;
|
||||||
|
},
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
handleAdd() {
|
||||||
|
this.reset();
|
||||||
|
this.open = true;
|
||||||
|
this.title = "添加科室信息";
|
||||||
|
},
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.reset();
|
||||||
|
const id = row.id || this.ids;
|
||||||
|
getDepartment(id).then((response) => {
|
||||||
|
this.form = response.data;
|
||||||
|
this.open = true;
|
||||||
|
this.title = "修改科室信息";
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm() {
|
||||||
|
this.$refs["form"].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.form.id != null) {
|
||||||
|
updateDepartment(this.form).then((response) => {
|
||||||
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addDepartment(this.form).then((response) => {
|
||||||
|
this.$modal.msgSuccess("新增成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(row) {
|
||||||
|
const ids = row.id || this.ids;
|
||||||
|
this.$modal
|
||||||
|
.confirm('是否确认删除科室信息编号为"' + ids + '"的数据项?')
|
||||||
|
.then(function () {
|
||||||
|
return delDepartment(ids);
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
},
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
handleExport() {
|
||||||
|
this.download(
|
||||||
|
"system/department/export",
|
||||||
|
{
|
||||||
|
...this.queryParams,
|
||||||
|
},
|
||||||
|
`department_${new Date().getTime()}.xlsx`
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
Loading…
Reference in New Issue
Block a user