xg
This commit is contained in:
parent
e0f1681d34
commit
8d2806315b
@ -1,36 +1,15 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
ref="queryForm"
|
||||
size="small"
|
||||
:inline="true"
|
||||
v-show="showSearch"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="医院名称" prop="hospitalName">
|
||||
<el-input
|
||||
v-model="queryParams.hospitalName"
|
||||
placeholder="请输入医院名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.hospitalName" placeholder="请输入医院名称" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="医院编码" prop="hospitalCode">
|
||||
<el-input
|
||||
v-model="queryParams.hospitalCode"
|
||||
placeholder="请输入医院编码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.hospitalCode" placeholder="请输入医院编码" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="医院地址" prop="hospitalAddress">
|
||||
<el-input
|
||||
v-model="queryParams.hospitalAddress"
|
||||
placeholder="请输入医院地址"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.hospitalAddress" placeholder="请输入医院地址" clearable
|
||||
@keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
@ -38,39 +17,18 @@
|
||||
<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:hospital:add']"
|
||||
>新增</el-button>
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
|
||||
v-hasPermi="['system:hospital: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:hospital:edit']"
|
||||
>修改</el-button>
|
||||
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
|
||||
v-hasPermi="['system:hospital: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:hospital:remove']"
|
||||
>删除</el-button>
|
||||
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
|
||||
v-hasPermi="['system:hospital:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button
|
||||
@ -84,11 +42,17 @@
|
||||
</el-col>-->
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="hospitalList" @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="医院名称" align="center" prop="hospitalName" />
|
||||
<el-table-column label="医院类型" align="center" prop="category">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.category == 1 ? '家医机构' : '' }}
|
||||
{{ scope.row.category == 2 ? '齐鲁名医机构' : '' }}
|
||||
{{ scope.row.category == 3 ? '专病机构' : "" }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="医院编码" align="center" prop="hospitalCode" />
|
||||
<el-table-column label="医院地址" align="center" prop="hospitalAddress" />
|
||||
<el-table-column label="联系电话" align="center" prop="phone" />
|
||||
@ -96,78 +60,42 @@
|
||||
<el-table-column label="显示顺序" align="center" prop="hospitalSort" />
|
||||
<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:hospital:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:hospital:remove']"
|
||||
>删除</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:hospital:edit']">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:hospital: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"
|
||||
/>
|
||||
|
||||
<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="1200px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px" :inline="true">
|
||||
<el-form-item label="医院名称" prop="hospitalName">
|
||||
<el-input
|
||||
v-model="form.hospitalName"
|
||||
style="width:200px"
|
||||
maxlength="50"
|
||||
placeholder="请输入医院名称"
|
||||
/>
|
||||
<el-input v-model="form.hospitalName" style="width:200px" maxlength="50" placeholder="请输入医院名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="医院类型" prop="category">
|
||||
<el-select v-model="form.category" placeholder="请选择医院类型" clearable style="width: 200px;">
|
||||
<el-option v-for="item in categorylist" :key="item.id" :label="item.Name" :value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="医院编码" prop="hospitalCode">
|
||||
<el-input v-model="form.hospitalCode" placeholder="请输入医院编码" />
|
||||
</el-form-item>-->
|
||||
<el-form-item label="医院地址" prop="hospitalAddress">
|
||||
<el-input
|
||||
style="width:200px"
|
||||
v-model="form.hospitalAddress"
|
||||
maxlength="300"
|
||||
placeholder="请输入医院地址"
|
||||
/>
|
||||
<el-input style="width:200px" v-model="form.hospitalAddress" maxlength="300" placeholder="请输入医院地址" />
|
||||
</el-form-item>
|
||||
<el-form-item label="联系电话" prop="phone">
|
||||
<el-input
|
||||
v-model="form.phone"
|
||||
maxlength="11"
|
||||
oninput="value=value.replace(/[^\d]/g,'')"
|
||||
style="width:200px"
|
||||
placeholder="请输入联系电话"
|
||||
/>
|
||||
<el-input v-model="form.phone" maxlength="11" oninput="value=value.replace(/[^\d]/g,'')" style="width:200px"
|
||||
placeholder="请输入联系电话" />
|
||||
</el-form-item>
|
||||
<el-form-item label="显示顺序" prop="hospitalSort">
|
||||
<el-input
|
||||
v-model.number="form.hospitalSort"
|
||||
maxlength="5"
|
||||
style="width:200px"
|
||||
placeholder="值越小,排名越靠前"
|
||||
/>
|
||||
<el-input v-model.number="form.hospitalSort" maxlength="5" style="width:200px" placeholder="值越小,排名越靠前" />
|
||||
</el-form-item>
|
||||
<el-form-item label="医院简介" prop="hospitalIntroduce">
|
||||
<editor
|
||||
@imgs="imgs"
|
||||
:min-height="100"
|
||||
v-model="form.hospitalIntroduce"
|
||||
style="width:1000px;"
|
||||
></editor>
|
||||
<editor @imgs="imgs" :min-height="100" v-model="form.hospitalIntroduce" style="width:1000px;"></editor>
|
||||
<!-- <el-input v-model="form.hospitalIntroduce" type="textarea" placeholder="请输入内容" /> -->
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@ -223,8 +151,21 @@ export default {
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
categorylist: [
|
||||
{
|
||||
Name: '家医机构',
|
||||
id: 1,
|
||||
}, {
|
||||
Name: '齐鲁名医机构',
|
||||
id: 2,
|
||||
}, {
|
||||
Name: '专病机构',
|
||||
id: 3,
|
||||
},
|
||||
],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
category: null,
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
hospitalName: null,
|
||||
@ -238,6 +179,13 @@ export default {
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
category: [
|
||||
{
|
||||
required: true,
|
||||
message: "请选择医院类型",
|
||||
trigger: "blur"
|
||||
}
|
||||
],
|
||||
hospitalName: [
|
||||
{
|
||||
required: true,
|
||||
@ -288,6 +236,9 @@ export default {
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listHospital(this.queryParams).then(response => {
|
||||
response.rows.forEach(e => {
|
||||
e.category = Number(e.category)
|
||||
})
|
||||
this.hospitalList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
@ -342,6 +293,7 @@ export default {
|
||||
this.reset();
|
||||
const id = row.id || this.ids;
|
||||
getHospital(id).then(response => {
|
||||
response.data.category = Number(response.data.category)
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改医院信息管理";
|
||||
@ -354,17 +306,17 @@ export default {
|
||||
if (this.form.id != null) {
|
||||
updateHospital(this.form).then(response => {
|
||||
if (response.code == 200) {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
addHospital(this.form).then(response => {
|
||||
if (response.code == 200) {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -376,14 +328,14 @@ export default {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal
|
||||
.confirm("是否确认删除此医院的信息?")
|
||||
.then(function() {
|
||||
.then(function () {
|
||||
return delHospital(ids);
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
.catch(() => { });
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user