postdischarge-ui/src/views/system/department/index.vue

820 lines
30 KiB
Vue
Raw Normal View History

2024-02-28 09:11:37 +08:00
<template>
2024-06-14 15:30:24 +08:00
<div class="app-container" ref="layout">
2024-02-28 09:11:37 +08:00
<el-row :gutter="20">
2024-06-14 15:30:24 +08:00
<el-col :span="5" :xs="24">
2024-02-28 09:11:37 +08:00
<!-- <div class="head-container">
<el-input
v-model="goodsCategoryName"
placeholder="请输入区域名称"
clearable
size="small"
prefix-icon="el-icon-search"
style="margin-bottom: 20px"
/>
</div>-->
2024-06-14 15:30:24 +08:00
<div class="head-container">
2024-05-07 17:13:06 +08:00
<el-tree :data="deptOptions" :props="defaultProps" :expand-on-click-node="false"
:filter-node-method="filterNode" ref="tree" highlight-current @node-click="handleNodeClick" />
2024-02-28 09:11:37 +08:00
</div>
</el-col>
2024-06-14 15:30:24 +08:00
<el-col :span="19" :xs="24">
2024-06-16 15:31:29 +08:00
<div ref="topform" class="form">
2024-06-14 15:30:24 +08:00
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
label-width="68px">
<el-form-item label="科室名称" prop="departmentName">
<el-input maxlength="100" v-model="queryParams.departmentName" placeholder="请输入科室名称" clearable
@keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="科室代码" prop="departmentCode">
<el-input maxlength="30" v-model="queryParams.departmentCode" placeholder="请输入科室代码" clearable
@keyup.enter.native="handleQuery" />
</el-form-item>
2024-02-28 09:11:37 +08:00
2024-06-14 15:30:24 +08:00
<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>
</div>
<div ref="mb8" class="mb8">
<el-row :gutter="10" class="">
<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"
2024-05-07 17:13:06 +08:00
v-hasPermi="['system:department:edit']">修改</el-button>
2024-06-14 15:30:24 +08:00
</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>
</div>
<div ref="table">
<el-table :max-height="maxTableHeight" v-loading="loading" :data="departmentList"
@selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="科室名称" align="center" prop="departmentName" />
2024-06-17 09:32:11 +08:00
<el-table-column label="科室代码" align="center" prop="departmentCode" :show-overflow-tooltip="true" />
2024-06-14 15:30:24 +08:00
<el-table-column label="科室类型" align="center" prop="departmentType">
<template slot-scope="scope">
{{ scope.row.departmentType == "ADMINISTRATION_LOGISTICS" ? "行政后勤类" : "" }}
{{ scope.row.departmentType == "MEDICAL_ASSISTANCE" ? "医疗辅助类" : "" }}
{{ scope.row.departmentType == "MEDICAL_TECHNOLOGY" ? "医疗技术类" : "" }}
{{ scope.row.departmentType == "CLINICAL_SERVICES" ? "临床服务类" : "" }}
</template>
</el-table-column>
<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="科室电话" 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>
</div>
2024-05-07 17:13:06 +08:00
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" @pagination="getList" />
2024-02-28 09:11:37 +08:00
</el-col>
</el-row>
<!-- 导入 -->
2024-05-07 17:13:06 +08:00
<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>
2024-02-28 09:11:37 +08:00
<i class="el-icon-upload"></i>
<div class="el-upload__text">
将文件拖到此处
<em>点击上传</em>
</div>
<div class="el-upload__tip text-center" slot="tip">
<span>仅允许导入xlsxlsx格式文件</span>
2024-05-07 17:13:06 +08:00
<el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline"
@click="importTemplate">下载模板</el-link>
2024-02-28 09:11:37 +08:00
</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>
<!-- 添加或修改科室信息对话框 -->
2024-05-07 17:13:06 +08:00
<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">
2024-02-28 09:11:37 +08:00
<!-- <el-form-item label="上级科室id" prop="parentDepartmentId">
<el-input
v-model="form.parentDepartmentId"
placeholder="请输入上级科室id"
/>
</el-form-item>
2024-04-29 15:03:51 +08:00
<el-form-item label="所属机构id" prop="hospitalAgencyId">
<el-input v-model="form.hospitalAgencyId" placeholder="请输入所属机构id" />
2024-02-28 09:11:37 +08:00
</el-form-item>
<el-form-item label="所属机构名称" prop="agencyName">
<el-input
v-model="form.agencyName"
placeholder="请输入所属机构名称"
/>
</el-form-item> -->
2024-02-28 17:26:28 +08:00
<div class="nameinformation">基本信息</div>
<div class="content">
<el-form-item label="科室名称" prop="departmentName">
2024-05-07 17:13:06 +08:00
<el-input maxlength="100" v-model="form.departmentName" placeholder="请输入科室名称" />
2024-02-28 17:26:28 +08:00
</el-form-item>
<el-form-item label="科室代码" prop="departmentCode">
2024-05-07 17:13:06 +08:00
<el-input maxlength="30" onKeyUp="value=value.replace(/[\W]/g,'')" v-model="form.departmentCode"
placeholder="请输入科室代码" />
2024-02-28 17:26:28 +08:00
</el-form-item>
<el-form-item label="科室简称" prop="departmentAbbreviation">
2024-05-07 17:13:06 +08:00
<el-input maxlength="100" v-model="form.departmentAbbreviation" placeholder="请输入科室简称" />
2024-02-28 17:26:28 +08:00
</el-form-item>
<el-form-item label="科室类型" prop="departmentType">
2024-05-07 17:13:06 +08:00
<el-select v-model="form.departmentType" placeholder="请选择" style="width: 205px" clearable="">
<el-option v-for="item in departmentoptions" :key="item.dictValue" :label="item.dictLabel"
:value="item.dictValue">
2024-02-28 17:26:28 +08:00
</el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="科室负责人id" prop="departmentPersonId">
2024-02-28 09:11:37 +08:00
<el-input
v-model="form.departmentPersonId"
placeholder="请输入科室负责人id"
/>
</el-form-item> -->
2024-02-28 17:26:28 +08:00
<el-form-item label="科室负责人姓名" prop="departmentPersonName">
2024-05-07 17:13:06 +08:00
<el-input maxlength="20" v-model="form.departmentPersonName" placeholder="请输入科室负责人姓名" />
2024-02-28 17:26:28 +08:00
</el-form-item>
<el-form-item label="节点类型" prop="nodeType">
2024-05-07 17:13:06 +08:00
<el-select v-model="form.nodeType" placeholder="请选择" style="width: 205px" clearable>
<el-option v-for="item in nodeTypeoptions" :key="item.dictValue" :label="item.dictLabel"
:value="item.dictValue">
2024-02-28 17:26:28 +08:00
</el-option>
</el-select>
</el-form-item>
2024-04-29 16:35:54 +08:00
<el-form-item label="所属机构" prop="hospitalAgencyName">
2024-05-07 17:13:06 +08:00
<el-cascader clearable :props="{ checkStrictly: true }" :options="treeOptions" @change="change"
style="width: 205px; color: black" v-model="form.hospitalAgencyIdtwo" :show-all-levels="false"
:placeholder="form.hospitalAgencyName ? form.hospitalAgencyName : ''" ref="cascader"
:key="isResouceShow"></el-cascader>
2024-02-28 17:26:28 +08:00
</el-form-item>
<el-form-item label="上级科室" prop="parentDepartmentId">
2024-05-07 17:13:06 +08:00
<el-select v-model="form.parentDepartmentName" placeholder="请选择" style="width: 205px"
@change="changeparentDepartment" clearable>
<el-option v-for="item in optionsparentDepartment" :key="item.id" :label="item.departmentName"
2024-05-07 17:24:41 +08:00
:value="item.id">
2024-02-28 17:26:28 +08:00
</el-option>
</el-select>
<!-- <el-cascader
2024-02-28 09:11:37 +08:00
: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"
2024-02-28 11:37:03 +08:00
></el-cascader> -->
2024-02-28 17:26:28 +08:00
</el-form-item>
</div>
<div class="nameinformation">扩展信息</div>
<div class="content">
<el-form-item label="提供服务类别" prop="provideServiceCategory">
2024-05-07 17:13:06 +08:00
<el-select clearable v-model="form.provideServiceCategory" placeholder="请选择" style="width: 205px">
<el-option v-for="item in options" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue">
2024-02-28 17:26:28 +08:00
</el-option>
</el-select>
</el-form-item>
<el-form-item label="细分类别" prop="subdivisionCategoryId">
2024-05-07 17:13:06 +08:00
<el-select v-model="form.subdivisionCategoryName" placeholder="请选择" style="width: 205px" clearable
@change="optionsubdivision">
<el-option v-for="item in optionsubdivisionCategory" :key="item.subdivisionCategoryCode"
:label="item.subdivisionCategoryName" :value="item.subdivisionCategoryCode">
2024-02-28 17:26:28 +08:00
</el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="细分类别名称" prop="subdivisionCategoryName">
2024-02-28 09:11:37 +08:00
<el-input
v-model="form.subdivisionCategoryName"
placeholder="请输入细分类别名称"
/>
</el-form-item> -->
2024-02-28 17:26:28 +08:00
<el-form-item label="标准科室对照" prop="normDepartmentCompareId">
2024-05-07 17:13:06 +08:00
<el-select v-model="form.normDepartmentCompareId" placeholder="请选择" style="width: 205px" clearable>
<el-option v-for="item in compareList" :key="item.departmentId" :label="item.departmentName"
:value="item.departmentId">
2024-02-28 17:26:28 +08:00
</el-option>
</el-select>
<!-- <el-input
2024-02-28 09:11:37 +08:00
v-model="form.normDepartmentCompareId"
placeholder="请输入标准科室对照id"
2024-02-28 10:06:29 +08:00
/> -->
2024-02-28 17:26:28 +08:00
</el-form-item>
<!-- <el-form-item label="标准科室对照名称" prop="normDepartmentCompareName">
2024-02-28 09:11:37 +08:00
<el-input
v-model="form.normDepartmentCompareName"
placeholder="请输入标准科室对照名称"
/>
</el-form-item> -->
2024-02-28 17:26:28 +08:00
<el-form-item label="编制床位数" prop="prepareBedsCount">
2024-05-07 17:13:06 +08:00
<el-input maxlength="8" onKeyUp="value=value.replace(/[\W]/g,'')" v-model="form.prepareBedsCount"
placeholder="请输入编制床位数" />
2024-02-28 17:26:28 +08:00
</el-form-item>
<el-form-item label="科室电话" prop="departmentPhone">
2024-05-07 17:13:06 +08:00
<el-input maxlength="12" onKeyUp="value=value.replace(/[\W]/g,'')" v-model="form.departmentPhone"
placeholder="请输入科室电话" />
2024-02-28 17:26:28 +08:00
</el-form-item>
<el-form-item label="科室邮箱" prop="departmentMail">
2024-05-07 17:13:06 +08:00
<el-input maxlength="20" v-model="form.departmentMail" placeholder="请输入科室邮箱" />
2024-02-28 17:26:28 +08:00
</el-form-item>
<el-form-item label="成立日期" prop="establishDate">
2024-05-07 17:13:06 +08:00
<el-date-picker clearable v-model="form.establishDate" type="date" style="width: 205px"
value-format="yyyy-MM-dd" placeholder="请选择成立日期">
2024-02-28 17:26:28 +08:00
</el-date-picker>
</el-form-item>
<el-form-item label="撤销日期" prop="revokeDate">
2024-05-07 17:13:06 +08:00
<el-date-picker clearable v-model="form.revokeDate" type="date" style="width: 205px"
value-format="yyyy-MM-dd" placeholder="请选择撤销日期">
2024-02-28 17:26:28 +08:00
</el-date-picker>
</el-form-item>
</div>
2024-02-28 09:11:37 +08:00
</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,
2024-02-28 17:26:28 +08:00
getDepartmentList,
2024-02-28 09:11:37 +08:00
} from "@/api/system/department";
import { agencyList, getAgencytype } from "@/api/system/agency";
import { getToken } from "@/utils/auth";
2024-02-28 17:26:28 +08:00
import { listSubdivision } from "@/api/system/subdivision";
2024-02-28 17:43:16 +08:00
import { listCompare } from "@/api/system/compare";
2024-02-28 09:11:37 +08:00
export default {
name: "Department",
data() {
return {
2024-02-28 17:26:28 +08:00
optionsparentDepartment: [],
queryParamscompare: {
pageNum: 1,
pageSize: 10,
departmentId: null,
departmentName: null,
normCompareName: null,
normCompareCode: null,
normCompareSort: null,
normCompareRemark: null,
},
2024-02-28 10:06:29 +08:00
// 细分
2024-02-28 17:26:28 +08:00
optionsubdivisionCategory: [],
2024-02-28 10:06:29 +08:00
// 标准科室对照4
2024-02-28 17:26:28 +08:00
compareList: [],
2024-02-28 09:11:37 +08:00
option: [],
nodeTypeoptions: [],
treeOptions: [],
treeOptionsagencyCategoryId: [],
2024-02-28 17:26:28 +08:00
departmentoptions: [],
2024-02-28 09:11:37 +08:00
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,
2024-04-29 15:03:51 +08:00
hospitalAgencyId: null,
2024-04-29 16:35:54 +08:00
hospitalAgencyName: null,
2024-02-28 09:11:37 +08:00
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 +
2024-02-28 17:26:28 +08:00
"/system/department/insertDepartmentList",
2024-02-28 09:11:37 +08:00
},
isResouceShow: 1,
isResouceShows: 1,
2024-06-14 15:30:24 +08:00
maxTableHeight: undefined,
2024-02-28 17:26:28 +08:00
id: "",
2024-02-28 09:11:37 +08:00
// 表单校验
rules: {
2024-04-29 16:35:54 +08:00
hospitalAgencyName: [
2024-04-09 15:47:00 +08:00
{ required: true, message: "所属机构不能为空", trigger: "blur" },
],
2024-03-06 11:31:55 +08:00
departmentName: [
{ required: true, message: "科室名称不能为空", trigger: "blur" },
],
2024-03-29 10:51:34 +08:00
departmentCode: [
{ required: true, message: "科室代码不能为空", trigger: "blur" },
],
2024-03-28 10:35:04 +08:00
departmentPhone: [
{
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
2024-03-28 11:13:27 +08:00
message: "请输入正确的科室电话",
2024-03-28 10:35:04 +08:00
trigger: "blur",
},
],
departmentMail: [
{
type: "email",
message: "请输入正确的邮箱地址",
2024-03-28 11:13:27 +08:00
trigger: ["blur", "change"],
},
2024-03-28 10:35:04 +08:00
],
2024-02-28 09:11:37 +08:00
},
};
},
2024-04-09 15:47:00 +08:00
// 默认选中第一行
watch: {
deptOptions: {
handler(val) {
if (val) {
this.$nextTick(() => {
document.querySelector(".el-tree-node__content").click();
});
}
},
immediate: true,
},
},
2024-06-14 15:30:24 +08:00
mounted() {
this.getMaxTableHeight()
this.screenChange()
},
2024-02-28 09:11:37 +08:00
created() {
this.getList();
this.gettreelist();
this.info();
this.infolist();
2024-02-28 11:37:03 +08:00
this.getinfo();
this.getinfolist();
2024-02-28 17:26:28 +08:00
this.infodepartment();
this.infocompare();
2024-02-28 09:11:37 +08:00
},
methods: {
2024-04-09 15:47:00 +08:00
optionsubdivision(e) {
// this.form.subdivisionCategoryId = this.optionsubdivisionCategory.find(
// (e) => e.id == this.form.subdivisionCategoryId
// ).subdivisionCategoryName;
2024-05-07 17:13:06 +08:00
// console.log(this.form.subdivisionCategoryName)
2024-04-09 15:47:00 +08:00
},
2024-03-07 16:47:56 +08:00
// 上级科室
2024-02-28 17:43:16 +08:00
changeparentDepartment(e) {
this.form.parentDepartmentId = e;
2024-02-28 17:26:28 +08:00
},
/** 查询标准科室对照信息列表 */
infocompare() {
this.loading = true;
listCompare(this.queryParamscompare).then((response) => {
this.compareList = response.rows;
// this.total = response.total;
this.loading = false;
});
},
2024-03-07 16:47:56 +08:00
// 细分类别
2024-02-28 17:26:28 +08:00
getinfolist() {
listSubdivision().then((res) => {
this.optionsubdivisionCategory = res.rows;
});
2024-02-28 11:37:03 +08:00
},
2024-03-07 16:47:56 +08:00
// 上级科室
2024-02-28 17:26:28 +08:00
getinfo() {
getDepartmentList().then((res) => {
this.optionsparentDepartment = res.data;
});
2024-02-28 11:37:03 +08:00
},
2024-03-07 16:47:56 +08:00
// 节点类型
2024-02-28 09:11:37 +08:00
info() {
2024-02-28 17:26:28 +08:00
var dictType = "department_node_type";
2024-02-28 09:11:37 +08:00
getAgencytype(dictType).then((res) => {
this.nodeTypeoptions = res.data;
});
},
2024-03-07 16:47:56 +08:00
// 科室类型
2024-02-28 11:37:03 +08:00
infodepartment() {
var dictType = "department_type";
getAgencytype(dictType).then((res) => {
this.departmentoptions = res.data;
});
},
2024-03-07 16:47:56 +08:00
// 服务类别
2024-02-28 09:11:37 +08:00
infolist() {
var dictType = "provide_service_category";
getAgencytype(dictType).then((res) => {
this.options = res.data;
});
},
2024-03-07 16:47:56 +08:00
// 所属机构
2024-02-28 09:11:37 +08:00
change(e) {
2024-05-07 17:13:06 +08:00
console.log(this.form.hospitalAgencyIdtwo)
2024-03-28 11:13:27 +08:00
if (e) {
2024-04-29 15:03:51 +08:00
this.form.hospitalAgencyId = e[e.length - 1];
if (this.form.hospitalAgencyId) {
2024-03-28 11:13:27 +08:00
const arr = this.$refs["cascader"].getCheckedNodes()[0].pathLabels;
2024-04-29 16:35:54 +08:00
this.form.hospitalAgencyName = arr.slice(-1).join(",");
2024-05-07 17:13:06 +08:00
this.gethaveinfo(e[e.length - 1])
this.form.parentDepartmentId = ''
this.form.parentDepartmentName = ''
2024-03-28 11:13:27 +08:00
} else {
2024-05-07 17:13:06 +08:00
this.form.parentDepartmentId = ''
2024-04-29 16:35:54 +08:00
this.form.hospitalAgencyName = "";
2024-03-28 11:13:27 +08:00
}
2024-05-07 17:13:06 +08:00
} else {
this.getinfo();
2024-03-28 11:13:27 +08:00
}
2024-02-28 09:11:37 +08:00
},
2024-05-07 17:13:06 +08:00
gethaveinfo(id) {
getDepartmentList({ hospitalAgencyId: id }).then((res) => {
this.optionsparentDepartment = res.data;
});
},
2024-03-07 16:47:56 +08:00
// changeagencyCategoryId(e) {
// this.form.parentDepartmentId = e[e.length - 1];
// },
2024-02-28 09:11:37 +08:00
// gettreelistitem() {
// agencyCategoryList().then((res) => {
// // 接口请求
// this.treeOptionsagencyCategoryId = res.data.map((item) => {
// return { value: item.id, ...item };
// });
// });
// },
2024-03-07 16:47:56 +08:00
// 所属机构
2024-02-28 09:11:37 +08:00
gettreelist() {
agencyList().then((res) => {
// 接口请求
this.deptOptions = res.data;
this.treeOptions = res.data.map((item) => {
return { value: item.id, ...item };
});
});
},
/** 导入按钮操作 */
handleImport() {
this.upload.open = true;
2024-02-28 10:06:29 +08:00
this.upload.title = "科室导入";
2024-02-28 09:11:37 +08:00
},
/** 下载模板操作 */
importTemplate() {
this.download(
2024-02-28 17:26:28 +08:00
"/system/importDownload/downloadTemplate?fileType=department",
2024-02-28 09:11:37 +08:00
{},
2024-02-28 17:26:28 +08:00
`科室下载模板.xlsx`
2024-02-28 09:11:37 +08:00
);
},
// 提交上传文件
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;'>" +
2024-05-07 17:13:06 +08:00
response.msg +
"</div>",
2024-02-28 09:11:37 +08:00
"导入结果",
{ dangerouslyUseHTMLString: true }
);
this.getList();
2024-05-15 10:23:48 +08:00
this.gettreelist();
2024-02-28 09:11:37 +08:00
},
// 文件上传中处理
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
// 筛选节点
filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
// 节点单击事件
handleNodeClick(data) {
console.log(data, "5");
2024-04-29 15:03:51 +08:00
this.queryParams.hospitalAgencyId = data.id;
2024-02-28 09:11:37 +08:00
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,
2024-04-29 15:03:51 +08:00
hospitalAgencyId: null,
2024-05-07 17:13:06 +08:00
hospitalAgencyIdtwo: null,
2024-04-29 16:35:54 +08:00
hospitalAgencyName: null,
2024-02-28 09:11:37 +08:00
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 = "添加科室信息";
2024-05-07 17:13:06 +08:00
this.getinfo()
2024-02-28 09:11:37 +08:00
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids;
getDepartment(id).then((response) => {
this.form = response.data;
2024-05-07 17:13:06 +08:00
this.form.hospitalAgencyIdtwo = this.form.hospitalAgencyId
2024-02-28 17:43:16 +08:00
this.form.parentDepartmentName = response.data.parentDepartmentName;
2024-02-28 09:11:37 +08:00
this.open = true;
2024-05-07 17:13:06 +08:00
this.gethaveinfo(this.form.hospitalAgencyId)
2024-02-28 09:11:37 +08:00
this.title = "修改科室信息";
});
},
/** 提交按钮 */
submitForm() {
2024-04-09 15:47:00 +08:00
let reg = new RegExp("-", "g");
if (this.form.establishDate && this.form.revokeDate && new Date(this.form.establishDate.replace(reg, "/")) >
2024-05-07 17:13:06 +08:00
new Date(this.form.revokeDate.replace(reg, "/"))) {
this.$message.error("撤销日期要大于成立日期");
}
else {
2024-04-09 15:47:00 +08:00
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();
});
}
}
});
}
2024-02-28 09:11:37 +08:00
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal
.confirm('是否确认删除科室信息编号为"' + ids + '"的数据项?')
.then(function () {
return delDepartment(ids);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
2024-05-07 17:13:06 +08:00
.catch(() => { });
2024-02-28 09:11:37 +08:00
},
/** 导出按钮操作 */
handleExport() {
this.download(
"system/department/export",
{
...this.queryParams,
},
2024-05-13 17:11:48 +08:00
`科室信息_${new Date().getTime()}.xlsx`
2024-02-28 09:11:37 +08:00
);
},
2024-06-14 15:30:24 +08:00
// 获取表格最高高度
getMaxTableHeight() {
const windowInnerHeight = window.innerHeight // 屏幕可视高度
const layoutDiv = this.$refs.layout
2024-06-16 15:31:29 +08:00
const formDiv = this.$refs.topform
2024-06-14 15:30:24 +08:00
const mb8Div = this.$refs.mb8
this.maxTableHeight =
windowInnerHeight - 134 -
this.getBoxPadding(layoutDiv) -
this.getBoxHeight(mb8Div) -
this.getBoxHeight(formDiv)
},
// 屏幕resize监听
screenChange() {
// 屏幕resize监听事件一旦屏幕宽高发生变化就会执行resize
window.addEventListener('resize', this.getMaxTableHeight, true)
// 将屏幕监听事件移除
// 这步是必须的。离开页面时不移除,再返回,或者进入到别的有相同元素的页面会报错
// 或者将这里的方法直接写在beforeDestroy函数中也可以
this.$once('hook:beforeDestroy', () => {
window.removeEventListener('resize', this.getMaxTableHeight, true)
})
},
2024-02-28 09:11:37 +08:00
},
};
</script>
2024-02-28 17:26:28 +08:00
<style lang="scss">
.el-cascader .el-input input::-webkit-input-placeholder {
color: black;
}
2024-05-07 17:13:06 +08:00
2024-02-28 17:26:28 +08:00
.nameinformation {
border-left: 3px solid #4d9de7;
width: 200px;
height: 20px;
padding-left: 10px;
font-size: 18px;
// margin-top: 8px;
color: black;
}
2024-05-07 17:13:06 +08:00
2024-02-28 17:26:28 +08:00
.content {
margin: 22px;
}
</style>
<style lang="scss" scoped>
2024-03-07 14:19:14 +08:00
.el-cascader .el-input input::-webkit-input-placeholder {
color: #686a6d;
}
2024-06-14 15:30:24 +08:00
.app-container {
padding: 20px 0 0 20px !important;
}
::v-deep .el-row {
height: 100% !important;
}
2024-06-17 09:32:11 +08:00
.head-container {
2024-06-14 15:30:24 +08:00
height: calc(100vh - 119px);
2024-06-17 09:18:44 +08:00
overflow-y: auto;
2024-06-14 15:30:24 +08:00
}
2024-03-07 14:19:14 +08:00
</style>