938 lines
28 KiB
Vue
938 lines
28 KiB
Vue
<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"
|
||
>
|
||
<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="细分类别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 departmentoptions"
|
||
:key="item.dictValue"
|
||
:label="item.dictLabel"
|
||
:value="item.dictValue"
|
||
>
|
||
</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-select
|
||
v-model="form.parentDepartmentId"
|
||
placeholder="请选择"
|
||
style="width: 205px"
|
||
>
|
||
<el-option
|
||
v-for="item in optionsparentDepartment"
|
||
:key="item.id"
|
||
:label="item.departmentName"
|
||
:value="item.departmentCode"
|
||
>
|
||
</el-option>
|
||
</el-select>
|
||
<!-- <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 optionsubdivisionCategory"
|
||
:key="item.subdivisionCategoryCode"
|
||
:label="item.subdivisionCategoryName"
|
||
:value="item.subdivisionCategoryCode"
|
||
>
|
||
</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-select
|
||
v-model="form.normDepartmentCompareId"
|
||
placeholder="请选择"
|
||
style="width: 205px"
|
||
>
|
||
<el-option
|
||
v-for="item in optionnormDepartmentCompare"
|
||
:key="item.value"
|
||
:label="item.label"
|
||
:value="item.value"
|
||
>
|
||
</el-option>
|
||
</el-select>
|
||
<!-- <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,
|
||
getDepartmentList
|
||
} from "@/api/system/department";
|
||
import { agencyList, getAgencytype } from "@/api/system/agency";
|
||
import { getToken } from "@/utils/auth";
|
||
import { listSubdivision, } from "@/api/system/subdivision";
|
||
|
||
export default {
|
||
name: "Department",
|
||
data() {
|
||
return {
|
||
optionsparentDepartment:[],
|
||
// 细分
|
||
optionsubdivisionCategory:[],
|
||
// 标准科室对照4
|
||
optionnormDepartmentCompare:[],
|
||
option: [],
|
||
nodeTypeoptions: [],
|
||
treeOptions: [],
|
||
treeOptionsagencyCategoryId: [],
|
||
departmentoptions:[],
|
||
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();
|
||
this.getinfo();
|
||
this.getinfolist();
|
||
this.infodepartment()
|
||
},
|
||
methods: {
|
||
getinfolist(){
|
||
listSubdivision().then(res=>{
|
||
this.optionsubdivisionCategory=res.rows
|
||
})
|
||
},
|
||
getinfo(){
|
||
getDepartmentList().then(res=>{
|
||
console.log(res,'666')
|
||
this.optionsparentDepartment=res.data
|
||
})
|
||
},
|
||
info() {
|
||
var dictType = "node_type";
|
||
getAgencytype(dictType).then((res) => {
|
||
this.nodeTypeoptions = res.data;
|
||
});
|
||
},
|
||
infodepartment() {
|
||
var dictType = "department_type";
|
||
getAgencytype(dictType).then((res) => {
|
||
this.departmentoptions = 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.agencyId = e[e.length - 1];
|
||
},
|
||
|
||
changeagencyCategoryId(e) {
|
||
this.form.parentDepartmentId = 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>
|