Merge remote-tracking branch 'origin/jihan_0203_运营管理端功能开发' into jihan_0203_运营管理端功能开发

This commit is contained in:
曹辉 2023-02-15 09:03:22 +08:00
commit f16e8b3fa5
8 changed files with 2606 additions and 0 deletions

View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询资讯分类列表
export function listInformationCategory(query) {
return request({
url: '/system/InformationCategory/list',
method: 'get',
params: query
})
}
// 查询资讯分类详细
export function getInformationCategory(id) {
return request({
url: '/system/InformationCategory/' + id,
method: 'get'
})
}
// 新增资讯分类
export function addInformationCategory(data) {
return request({
url: '/system/InformationCategory/add',
method: 'post',
data: data
})
}
// 修改资讯分类
export function updateInformationCategory(data) {
return request({
url: '/system/InformationCategory/edit',
method: 'post',
data: data
})
}
// 删除资讯分类
export function delInformationCategory(id) {
return request({
url: '/system/InformationCategory/' + id,
method: 'delete'
})
}

View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询医院信息管理列表
export function listHospital(query) {
return request({
url: '/system/hospital/list',
method: 'get',
params: query
})
}
// 查询医院信息管理详细
export function getHospital(id) {
return request({
url: '/system/hospital/' + id,
method: 'get'
})
}
// 新增医院信息管理
export function addHospital(data) {
return request({
url: '/system/hospital/add',
method: 'post',
data: data
})
}
// 修改医院信息管理
export function updateHospital(data) {
return request({
url: '/system/hospital/edit',
method: 'post',
data: data
})
}
// 删除医院信息管理
export function delHospital(id) {
return request({
url: '/system/hospital/' + id,
method: 'delete'
})
}

View File

@ -0,0 +1,53 @@
import request from '@/utils/request'
// 查询科室信息管理列表
export function listHospitalDepartment(query) {
return request({
url: '/system/hospitalDepartment/list',
method: 'get',
params: query
})
}
export function list(query) {
return request({
url: '/system/hospital/list',
method: 'get',
params: query
})
}
// 查询科室信息管理详细
export function getHospitalDepartment(id) {
return request({
url: '/system/hospitalDepartment/' + id,
method: 'get'
})
}
// 新增科室信息管理
export function addHospitalDepartment(data) {
return request({
url: '/system/hospitalDepartment/add',
method: 'post',
data: data
})
}
// 修改科室信息管理
export function updateHospitalDepartment(data) {
return request({
url: '/system/hospitalDepartment/edit',
method: 'post',
data: data
})
}
// 删除科室信息管理
export function delHospitalDepartment(id) {
return request({
url: '/system/hospitalDepartment/' + id,
method: 'delete'
})
}

View File

@ -0,0 +1,52 @@
import request from '@/utils/request'
// 查询资讯信息管理列表
export function listInformationInfo(query) {
return request({
url: '/system/informationInfo/list',
method: 'get',
params: query
})
}
// 查询资讯信息管理详细
export function getInformationInfo(id) {
return request({
url: '/system/informationInfo/' + id,
method: 'get'
})
}
// 新增资讯信息管理
export function addInformationInfo(data) {
return request({
url: '/system/informationInfo/add',
method: 'post',
data: data
})
}
// 修改资讯信息管理
export function updateInformationInfo(data) {
return request({
url: '/system/informationInfo/edit',
method: 'post',
data: data
})
}
// 查询资讯分类列表
export function listInformationCategory(query) {
return request({
url: '/system/InformationCategory/list',
method: 'get',
params: query
})
}
// 删除资讯信息管理
export function delInformationInfo(id) {
return request({
url: '/system/informationInfo/' + id,
method: 'delete'
})
}

View File

@ -0,0 +1,548 @@
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="100px"
>
<el-form-item label="资讯分类编码" prop="informationCategoryCode">
<el-input
v-model="queryParams.informationCategoryCode"
placeholder="请输入资讯分类编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="资讯分类名称" prop="informationCategoryName">
<el-input
v-model="queryParams.informationCategoryName"
placeholder="请输入资讯分类名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<!-- <el-form-item label="资讯分类排序" prop="sort">
<el-input
v-model="queryParams.sort"
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:InformationCategory: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:InformationCategory: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:InformationCategory: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:InformationCategory:export']"
>导出</el-button>
</el-col> -->
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="InformationCategoryList"
@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="informationCategoryCode"
/>
<el-table-column
label="资讯分类名称"
align="center"
prop="informationCategoryName"
/>
<el-table-column
label="资讯分类类型"
align="center"
prop="informationCategoryType"
>
<template slot-scope="scope">
{{
scope.row.informationCategoryType == "HEALTH_NOUS" ? "健康咨询" : ""
}}
{{ scope.row.informationCategoryType == "OTHER" ? "其他" : "" }}
</template>
</el-table-column>
<el-table-column label="资讯分类排序" align="center" prop="sort" />
<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:InformationCategory:edit']"
>修改</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:InformationCategory: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="addopen"
width="1100px"
append-to-body
>
<el-form
ref="form"
:model="form"
:rules="rules"
label-width="110px"
:inline="true"
>
<div
v-for="(item, index) in form.informationCategoryList"
:key="index"
style="margin-top: 20px; border-bottom: 1px solid #f3f3f3"
>
<el-form-item
label="资讯分类名称"
:rules="rules.informationCategoryList.informationCategoryName"
:prop="`informationCategoryList.${index}.informationCategoryName`"
>
<el-input
style="width: 200px"
v-model="item.informationCategoryName"
placeholder="请输入资讯分类名称"
/>
</el-form-item>
<el-form-item
label="资讯分类排序"
:rules="rules.informationCategoryList.sort"
:prop="`informationCategoryList.${index}.sort`"
>
<el-input
v-model="item.sort"
style="width: 200px"
placeholder="请输入资讯分类排序"
/>
</el-form-item>
<el-form-item
label="资讯分类类型"
:rules="rules.informationCategoryList.informationCategoryType"
:prop="`informationCategoryList.${index}.informationCategoryType`"
>
<el-select
v-model="item.informationCategoryType"
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-button
type="primary"
circle
plain
icon="el-icon-circle-plus-outline"
@click="adddisease"
v-if="index == 0"
></el-button>
<el-button
type="danger"
icon="el-icon-delete"
circle
plain
@click="deldisease(index)"
v-if="index != 0"
>
</el-button>
</div>
</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>
<!-- 修改 -->
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="110px">
<el-form-item label="资讯分类名称" prop="informationCategoryName">
<el-input
v-model="form.informationCategoryName"
placeholder="请输入资讯分类名称"
style="width: 250px"
maxlength="15"
/>
</el-form-item>
<el-form-item label="资讯分类排序" prop="sort">
<el-input
v-model="form.sort"
placeholder="请输入分类排序"
style="width: 250px"
/>
</el-form-item>
<el-form-item label="资讯分类类型" prop="informationCategoryType">
<el-select
v-model="form.informationCategoryType"
placeholder="请选择"
>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
<!-- <el-radio v-model="form.informationCategoryType" label="HEALTH_NOUS"
>健康咨询</el-radio
>
<el-radio v-model="form.informationCategoryType" label="OTHER"
>其他</el-radio
> -->
</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 {
listInformationCategory,
getInformationCategory,
delInformationCategory,
addInformationCategory,
updateInformationCategory,
} from "@/api/system/InformationCategory";
export default {
name: "InformationCategory",
data() {
return {
options: [{
value: 'HEALTH_NOUS',
label: '健康咨询'
}, {
value: 'OTHER',
label: '其他'
}],
value:"",
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
InformationCategoryList: [],
//
title: "",
//
open: false,
addopen: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
informationCategoryCode: null,
informationCategoryName: null,
informationCategoryType: null,
sort: null,
},
//
form: {},
//
rules: {
informationCategoryList: {
informationCategoryName: [
{
required: true,
message: "请选择资讯分类名称",
trigger: "blur",
},
],
informationCategoryType: [
{
required: true,
message: "请选择资讯分类类型",
trigger: "blur",
},
],
sort: [
{
required: true,
message: "请选择资讯分类排序",
trigger: "blur",
},
],
},
informationCategoryName: [
{
required: true,
message: "请选择资讯分类名称",
trigger: "blur",
},
],
informationCategoryType: [
{
required: true,
message: "请选择资讯分类类型",
trigger: "blur",
},
],
sort: [
{
required: true,
message: "请选择资讯分类排序",
trigger: "blur",
},
],
},
};
},
created() {
this.getList();
},
methods: {
//deldisease
deldisease(index) {
this.form.informationCategoryList.splice(index, 1);
},
adddisease() {
var obj = {
informationCategoryName: "",
informationCategoryType: "",
sort: "",
};
if (this.form.informationCategoryList.length == 5) {
this.$message.error("最多只能5条");
} else {
this.form.informationCategoryList.push(obj);
}
},
/** 查询资讯分类列表 */
getList() {
this.loading = true;
listInformationCategory(this.queryParams).then((response) => {
this.InformationCategoryList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.addopen = false;
this.open = false;
this.reset();
},
//
// reset() {
// this.form = {
// id: null,
// informationCategoryCode: null,
// informationCategoryName: null,
// informationCategoryType: null,
// sort: null,
// createBy: null,
// createTime: null,
// updateBy: null,
// updateTime: null
// };
// this.resetForm("form");
// },
//
reset() {
this.form = {
informationCategoryList: [
{
// id: null,
// informationCategoryCode: null,
informationCategoryName: null,
informationCategoryType: null,
sort: 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.addopen = true;
this.title = "添加资讯分类";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids;
getInformationCategory(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) {
updateInformationCategory(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addInformationCategory(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.addopen = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal
.confirm('是否确认删除资讯分类编号为"' + ids + '"的数据项?')
.then(function () {
return delInformationCategory(ids);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download(
"system/InformationCategory/export",
{
...this.queryParams,
},
`InformationCategory_${new Date().getTime()}.xlsx`
);
},
},
};
</script>

View File

@ -0,0 +1,357 @@
<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="医院名称" prop="hospitalName">
<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-form-item>
<el-form-item label="医院地址" prop="hospitalAddress">
<el-input
v-model="queryParams.hospitalAddress"
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: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-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-col>
<!-- <el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:hospital:export']"
>导出</el-button>
</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="hospitalCode" />
<el-table-column label="医院地址" align="center" prop="hospitalAddress" />
<el-table-column label="联系电话" align="center" prop="phone" />
<!-- <el-table-column label="医院简介" align="center" prop="hospitalIntroduce" /> -->
<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>
</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="700px" 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" placeholder="请输入医院名称" />
</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" placeholder="请输入医院地址" />
</el-form-item>
<el-form-item label="联系电话" prop="phone">
<el-input v-model="form.phone" style="width:200px" placeholder="请输入联系电话" />
</el-form-item>
<el-form-item label="显示顺序" prop="hospitalSort">
<el-input v-model="form.hospitalSort" style="width:200px" placeholder="请输入显示顺序" />
</el-form-item>
<el-form-item label="医院简介" prop="hospitalIntroduce">
<editor
@imgs="imgs"
:min-height="100"
v-model="form.hospitalIntroduce"
></editor>
<!-- <el-input v-model="form.hospitalIntroduce" type="textarea" 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 { listHospital, getHospital, delHospital, addHospital, updateHospital } from "@/api/system/hospital";
import editor from "@/components/Editor";
export default {
components: { editor },
name: "Hospital",
data() {
//
var checkMobile = (rule, value, cb) => {
//
const regMobile =
/^(0|86|17951)?(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57]|19[0-9])[0-9]{8}$/;
if (regMobile.test(value)) {
return cb();
}
cb(new Error("请输入正确的联系电话"));
};
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
imgsurl: { pictureUrlList: [] },
//
showSearch: true,
//
total: 0,
//
hospitalList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
hospitalName: null,
hospitalCode: null,
hospitalAddress: null,
phone: null,
hospitalIntroduce: null,
hospitalSort: null,
},
//
form: {},
//
rules: {
hospitalName: [
{
required: true,
message: "请选择医院名称",
trigger: "blur",
},
],
hospitalSort: [
{
required: true,
message: "请选择显示排序",
trigger: "blur",
},
],
phone: [
{
required: true,
validator: checkMobile,
message: "",
trigger: "blur",
},
],
hospitalIntroduce: [
{
required: true,
message: "请选择医院简介",
trigger: "blur",
},
],
hospitalAddress: [
{
required: true,
message: "请选择医院地址",
trigger: "blur",
},
],
}
};
},
created() {
this.getList();
},
methods: {
imgs(item) {
console.log(item)
this.imgsurl.pictureUrlList.push(item);
},
/** 查询医院信息管理列表 */
getList() {
this.loading = true;
listHospital(this.queryParams).then(response => {
this.hospitalList = response.rows;
console.log(this.hospitalList)
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
hospitalName: null,
hospitalCode: null,
hospitalAddress: null,
phone: null,
hospitalIntroduce: null,
hospitalSort: 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
getHospital(id).then(response => {
this.form = response.data;
console.log(this.form)
this.open = true;
this.title = "修改医院信息管理";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateHospital(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addHospital(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 delHospital(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('system/hospital/export', {
...this.queryParams
}, `hospital_${new Date().getTime()}.xlsx`)
}
}
};
</script>

View File

@ -0,0 +1,811 @@
<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="医院名称" prop="hospitalName">
<el-input
v-model="queryParams.hospitalName"
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 label="科室名称" prop="departmentName">
<el-input
v-model="queryParams.departmentName"
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:hospitalDepartment: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:hospitalDepartment: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:hospitalDepartment: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:hospitalDepartment:export']"
>导出</el-button>
</el-col> -->
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="hospitalDepartmentList"
@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="parentId" />
<el-table-column label="医院表id" align="center" prop="hospitalId" /> -->
<el-table-column label="医院名称" align="center" prop="hospitalName" />
<el-table-column label="科室编码" align="center" prop="departmentCode" />
<el-table-column label="科室名称" align="center" prop="departmentName" />
<el-table-column
label="科室联系电话"
align="center"
prop="departmentPhone"
/>
<el-table-column
label="科室负责人"
align="center"
prop="departmentPerson"
/>
<el-table-column
label="科室地址"
align="center"
prop="departmentAddress"
/>
<!-- <el-table-column label="科室显示级别" align="center" prop="departmentLevel" /> -->
<el-table-column
label="科室显示顺序"
align="center"
prop="departmentSort"
/>
<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:hospitalDepartment:edit']"
>修改</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:hospitalDepartment: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="addopen"
width="600px"
append-to-body
:before-close="cancel"
>
<el-form
ref="form"
:model="form"
:rules="rules"
label-width="110px"
:inline="true"
>
<div
v-for="(item, index) in form.hospitalDepartmentInfoList"
:key="index"
style="margin-top: 20px; border-bottom: 1px solid #f3f3f3"
>
<el-form-item
label="所属医院"
:rules="rules.hospitalDepartmentInfoList.hospitalId"
:prop="`hospitalDepartmentInfoList.${index}.hospitalId`"
>
<el-button
type=""
v-if="item.hospitalName == '请选择所属医院'"
@click="clickinnerVisible(item, index)"
style="
width: 250px;
text-align: left;
height: 36px;
color: #c0c4cc;
overflow: hidden;
"
>{{ item.hospitalName }}</el-button
>
<el-button
@click="clickinnerVisible(item, index)"
type=""
v-else
style="
width: 250px;
text-align: left;
height: 36px;
padding-left: -10px;
overflow: hidden;
"
>{{ item.hospitalName }}</el-button
>
</el-form-item>
<el-form-item
label="科室名称"
:rules="rules.hospitalDepartmentInfoList.departmentName"
:prop="`hospitalDepartmentInfoList.${index}.departmentName`"
>
<el-input
style="width: 250px"
v-model="item.departmentName"
placeholder="请输入科室名称"
/>
</el-form-item>
<el-form-item
label="科室联系电话"
:rules="rules.hospitalDepartmentInfoList.departmentPhone"
:prop="`hospitalDepartmentInfoList.${index}.departmentPhone`"
>
<el-input
style="width: 250px"
v-model="item.departmentPhone"
placeholder="请输入科室联系电话"
/>
</el-form-item>
<el-form-item
label="科室负责人"
:rules="rules.hospitalDepartmentInfoList.departmentPerson"
:prop="`hospitalDepartmentInfoList.${index}.departmentPerson`"
>
<el-input
style="width: 250px"
v-model="item.departmentPerson"
placeholder="请输入科室负责人名称"
/>
</el-form-item>
<el-form-item
label="科室地址"
:rules="rules.hospitalDepartmentInfoList.departmentAddress"
:prop="`hospitalDepartmentInfoList.${index}.departmentAddress`"
>
<el-input
style="width: 250px"
v-model="item.departmentAddress"
placeholder="请输入科室地址"
/>
</el-form-item>
<el-form-item
label="科室显示顺序"
:rules="rules.hospitalDepartmentInfoList.departmentSort"
:prop="`hospitalDepartmentInfoList.${index}.departmentSort`"
>
<el-input
v-model="item.departmentSort"
placeholder="请输入科室显示顺序"
/>
</el-form-item>
<el-button
type="primary"
circle
plain
icon="el-icon-circle-plus-outline"
@click="adddisease"
v-if="index == 0"
></el-button>
<el-button
type="danger"
icon="el-icon-delete"
circle
plain
@click="deldisease(index)"
v-if="index != 0"
></el-button></div
></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>
<!-- 选择医院 -->
<el-dialog
title="选择医院"
:visible.sync="innerVisible"
width="1000px"
append-to-body
:before-close="innerVisiblecancel"
>
<el-form
ref="queryForm"
:model="nurseStationqueryParams"
:rules="rules"
label-width="80px"
:inline="true"
>
<el-form-item label="医院编码" prop="hospitalCode" label-width="120">
<el-input
v-model="nurseStationqueryParams.hospitalCode"
placeholder="请输入科室编码"
clearable
/>
</el-form-item>
<el-form-item label="医院名称" prop="hospitalName" label-width="120">
<el-input
v-model="nurseStationqueryParams.hospitalName"
placeholder="请输入医院名称"
clearable
/>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="info"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="addresetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<el-table
:data="infolist"
@cell-dblclick="nurseclick"
v-loading="loading"
>
<el-table-column label="请选择" width="100" align="center">
<template slot-scope="scope">
<el-button
type="primary"
style="width: 15px; height: 15px"
v-if="form.hospitalId == scope.row.id"
circle
@click="nurseclick(scope.row)"
></el-button>
<el-button
v-else
style="width: 15px; height: 15px"
circle
@click="nurseclick(scope.row)"
></el-button>
</template>
</el-table-column>
<el-table-column
property="hospitalCode"
label="医院编码"
align="center"
>
</el-table-column>
<el-table-column
property="hospitalName"
label="医院名称"
align="center"
:show-overflow-tooltip="true"
>
</el-table-column>
<el-table-column
property="hospitalAddress"
label="医院地址"
align="center"
>
</el-table-column>
<!-- <el-table-column
property="hospitalIntroduce"
label="医院介绍"
align="center"
:show-overflow-tooltip="true"
>
</el-table-column> -->
<el-table-column
property="phone"
label="联系电话"
align="center"
:show-overflow-tooltip="true"
>
</el-table-column>
</el-table>
<pagination
v-show="total2 > 0"
:total="total2"
:page.sync="nurseStationqueryParams.pageNum"
:limit.sync="nurseStationqueryParams.pageSize"
@pagination="info"
/>
</el-dialog>
<!-- 修改护理站部门信息对话框 -->
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="110px">
<el-form-item label="所属医院" prop="hospitalName">
<el-input
v-model="form.hospitalName"
disabled
placeholder="请输入科室名称"
style="width: 250px"
maxlength="15"
/>
</el-form-item>
<el-form-item label="科室名称" prop="departmentName">
<el-input
v-model="form.departmentName"
placeholder="请输入科室名称"
style="width: 250px"
maxlength="15"
/>
</el-form-item>
<el-form-item label="科室负责人" prop="departmentPerson">
<el-input
v-model="form.departmentPerson"
placeholder="请输入科室负责人"
style="width: 250px"
/>
</el-form-item>
<el-form-item label="科室联系电话" prop="departmentPhone">
<el-input
v-model="form.departmentPhone"
placeholder="请输入联系电话"
maxlength="11"
style="width: 250px"
/>
</el-form-item>
<el-form-item label="科室联系电话" prop="departmentAddress">
<el-input
v-model="form.departmentAddress"
placeholder="请输入科室地址"
style="width: 250px"
/>
</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 {
list,
listHospitalDepartment,
getHospitalDepartment,
delHospitalDepartment,
addHospitalDepartment,
updateHospitalDepartment,
} from "@/api/system/hospitalDepartment";
import { get } from "http";
export default {
name: "HospitalDepartment",
data() {
//
var checkMobile = (rule, value, cb) => {
//
const regMobile =
/^(0|86|17951)?(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57]|19[0-9])[0-9]{8}$/;
if (regMobile.test(value)) {
return cb();
}
cb(new Error("请输入正确的联系电话"));
};
return {
//
loading: true,
//
ids: [],
nurseStationqueryParams: {
pageNum: 1,
pageSize: 10,
hospitalCode:"",
hospitalName:"",
},
infolist: [],
//
single: true,
addopen: false,
//
multiple: true,
//
showSearch: true,
//
total: 0,
total2: 0,
//
hospitalDepartmentList: [],
//
title: "",
//
open: false,
innerVisible: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
parentId: null,
hospitalId: null,
hospitalName: null,
hospitalCode: null,
departmentCode: null,
departmentName: null,
departmentPhone: null,
departmentPerson: null,
departmentAddress: null,
departmentLevel: null,
departmentSort: null,
},
homenumber: null,
//
form: {},
//
nnerVisibleindex: "",
//
rules: {
hospitalDepartmentInfoList: {
hospitalId: [
{
required: true,
message: "请选择所属医院",
trigger: "blur",
},
],
departmentSort: [
{
required: true,
message: "请选择科室显示排序",
trigger: "blur",
},
],
departmentName: [
{
required: true,
message: "请选择科室名称",
trigger: "blur",
},
],
departmentPerson: [
{
required: true,
message: "请选择科室负责人",
trigger: "blur",
},
],
departmentPhone: [
{
required: true,
validator: checkMobile,
trigger: "blur",
message: "",
},
],
departmentAddress: [
{
required: true,
message: "请选择科室地址",
trigger: "blur",
},
],
},
departmentName: [
{
required: true,
message: "请选择科室名称",
trigger: "blur",
},
],
departmentPerson: [
{
required: true,
message: "请选择科室负责人",
trigger: "blur",
},
],
departmentPhone: [
{
required: true,
validator: checkMobile,
trigger: "blur",
message: "",
},
],
departmentAddress: [
{
required: true,
message: "请选择科室地址",
trigger: "blur",
message: "",
},
],
},
};
},
created() {
this.getList();
this.info();
},
methods: {
//
cancel() {
this.addopen = false;
// this.reset();
},
innerVisiblecancel() {
this.innerVisible = false;
},
// add
nurseclick(row) {
console.log(row);
// if (this.homenumber) {
// console.log(this.homenumber);
// this.form.hospitalName = row.hospitalName;
// this.form.hospitalId = row.id;
// } else {
this.form.hospitalDepartmentInfoList[
this.nnerVisibleindex
].hospitalName = row.hospitalName;
this.form.hospitalDepartmentInfoList[this.nnerVisibleindex].hospitalId =
row.id;
// }
this.innerVisible = false;
},
//deldisease
deldisease(index) {
this.form.hospitalDepartmentInfoList.splice(index, 1);
},
adddisease() {
var obj = {
hospitalId: "",
departmentCode: "",
departmentName: "",
departmentPerson: "",
departmentPhone: "",
hospitalName: "请选择所属医院",
};
if (this.form.hospitalDepartmentInfoList.length == 5) {
this.$message.error("最多只能5条");
} else {
this.form.hospitalDepartmentInfoList.push(obj);
}
},
//
clickinnerVisible(item, index) {
this.addresetQuery();
this.form.hospitalId = item.hospitalId;
this.nnerVisibleindex = index;
console.log(this.nnerVisibleindex);
this.innerVisible = true;
// this.homenumber = item;
},
//
clickitem() {
this.addresetQuery();
// this.form.hospitalId = item.hospitalId;
this.innerVisible = true;
},
addresetQuery() {
this.nurseStationqueryParams = {
pageNum: 1,
pageSize: 10,
hospitalCode:"",
hospitalName:"",
};
this.info();
},
/** 查询科室信息管理列表 */
getList() {
this.loading = true;
listHospitalDepartment(this.queryParams).then((response) => {
this.hospitalDepartmentList = response.rows;
this.total = response.total;
this.loading = false;
});
},
info() {
list(this.nurseStationqueryParams,).then((response) => {
this.infolist = response.rows;
console.log(this.infolist)
this.total2 = response.total;
this.loading = false;
});
},
//
cancel() {
this.addopen = false;
this.open = false;
this.reset();
},
//
reset() {
this.form = {
hospitalDepartmentInfoList: [
{
hospitalId: "",
departmentCode: "",
departmentName: "",
departmentPerson: "",
departmentPhone: "",
departmentSort: "",
departmentAddress: "",
hospitalName: "请选择所属医院",
},
],
};
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.addopen = true;
this.title = "添加科室信息管理";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids;
this.form.hospitalId = row.id;
getHospitalDepartment(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) {
updateHospitalDepartment(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addHospitalDepartment(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.addopen = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal
.confirm('是否确认删除科室信息管理编号为"' + ids + '"的数据项?')
.then(function () {
return delHospitalDepartment(ids);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download(
"system/hospitalDepartment/export",
{
...this.queryParams,
},
`hospitalDepartment_${new Date().getTime()}.xlsx`
);
},
},
};
</script>

View File

@ -0,0 +1,697 @@
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="100px"
>
<!-- <el-form-item label="资讯所属分类id" prop="informationCategoryId">
<el-input
v-model="queryParams.informationCategoryId"
placeholder="请输入资讯所属分类id"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item> -->
<el-form-item label="资讯标题" prop="informationTitle">
<el-input
v-model="queryParams.informationTitle"
placeholder="请输入资讯标题"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="资讯编码" prop="informationCode">
<el-input
v-model="queryParams.informationCode"
placeholder="请输入资讯编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<!-- <el-form-item label="资讯点击次数" prop="informationClickCount">
<el-input
v-model="queryParams.informationClickCount"
placeholder="请输入资讯点击次数"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item> -->
<!-- <el-form-item label="资讯跳转路径" prop="informationJumpLink">
<el-input
v-model="queryParams.informationJumpLink"
placeholder="请输入资讯跳转路径"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="资讯来源,枚举类型" prop="informationSource">
<el-input
v-model="queryParams.informationSource"
placeholder="请输入资讯来源,枚举类型"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="资讯主缩略图地址" prop="leadThumbnailUrl">
<el-input
v-model="queryParams.leadThumbnailUrl"
placeholder="请输入资讯主缩略图地址"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="资讯负缩略图1地址" prop="negativeOneThumbnailUrl">
<el-input
v-model="queryParams.negativeOneThumbnailUrl"
placeholder="请输入资讯负缩略图1地址"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="资讯负缩略图2地址" prop="negativeTwoThumbnailUrl">
<el-input
v-model="queryParams.negativeTwoThumbnailUrl"
placeholder="请输入资讯负缩略图2地址"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item> -->
<!-- <el-form-item label="资讯大图地址" prop="largePictureUrl">
<el-input
v-model="queryParams.largePictureUrl"
placeholder="请输入资讯大图地址"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item> -->
<!-- <el-form-item label="显示顺序" prop="informationSort">
<el-input
v-model="queryParams.informationSort"
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:informationInfo: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:informationInfo: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:informationInfo: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:informationInfo:export']"
>导出</el-button
>
</el-col> -->
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="informationInfoList"
@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="informationCategoryId" /> -->
<el-table-column
label="资讯标题"
align="center"
prop="informationTitle"
/>
<el-table-column label="资讯编码" align="center" prop="informationCode" />
<el-table-column label="显示顺序" align="center" prop="informationSort" />
<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:informationInfo:edit']"
>修改</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:informationInfo: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="900px" append-to-body>
<el-form
ref="form"
:model="form"
:rules="rules"
label-width="140px"
:inline="true"
>
<el-form-item label="资讯标题" prop="informationTitle">
<el-input
v-model="form.informationTitle"
placeholder="请输入资讯标题"
/>
</el-form-item>
<el-form-item label="资讯分类" prop="informationCategoryId">
<el-button
type=""
v-if="form.informationCategoryName == '请选择资讯分类'"
@click="clickinnerVisible()"
style="
width: 250px;
text-align: left;
height: 36px;
color: #c0c4cc;
overflow: hidden;
"
>{{ form.informationCategoryName }}</el-button
>
<el-button
@click="clickinnerVisible()"
type=""
v-else
style="
width: 250px;
text-align: left;
height: 36px;
padding-left: -10px;
overflow: hidden;
"
>{{ form.informationCategoryName }}</el-button
>
</el-form-item>
<el-form-item label="资讯主缩略图上传" prop="leadThumbnailUrl">
<stationAcatar
style="width: 208px"
@imgUrl="imgUrl"
:img="form.leadThumbnailUrl"
:type="'leadThumbnailUrl'"
/>
<!-- <el-input v-model="form.leadThumbnailUrl" placeholder="请输入资讯主缩略图地址" /> -->
</el-form-item>
<el-form-item label="显示顺序" prop="informationSort">
<el-input
v-model="form.informationSort"
placeholder="请输入显示顺序"
/>
</el-form-item>
<el-form-item label="资讯图文内容" prop="informationContent">
<editor
@imgs="imgs"
maxlength="300"
:min-height="102"
placeholder="请输入资讯图文内容"
style="width: 80%;margin-left:18%;margin-top: -5%;"
v-model="form.informationContent"
/>
</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>
<!-- 选择资讯 -->
<el-dialog
title="选择资讯"
:visible.sync="innerVisible"
width="1000px"
append-to-body
:before-close="innerVisiblecancel"
>
<el-form
ref="queryForm"
:model="nurseStationqueryParams"
:rules="rules"
label-width="80px"
:inline="true"
>
<el-form-item
label="资讯分类编码"
prop="informationCategoryCode"
label-width="120"
>
<el-input
v-model="nurseStationqueryParams.informationCategoryCode"
placeholder="请输入资讯分类编码"
clearable
/>
</el-form-item>
<el-form-item
label="资讯分类名称"
prop="informationCategoryName"
label-width="120"
>
<el-input
v-model="nurseStationqueryParams.informationCategoryName"
placeholder="请输入资讯分类名称"
clearable
/>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="informationInfoinfo"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="addresetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<el-table
:data="infolist"
@cell-dblclick="nurseclick"
v-loading="loading"
>
<el-table-column label="请选择" width="100" align="center">
<template slot-scope="scope">
<el-button
type="primary"
style="width: 15px; height: 15px"
v-if="form.informationCategoryId == scope.row.id"
circle
@click="nurseclick(scope.row)"
></el-button>
<el-button
v-else
style="width: 15px; height: 15px"
circle
@click="nurseclick(scope.row)"
></el-button>
</template>
</el-table-column>
<el-table-column
property="informationCategoryCode"
label="资讯分类编码"
align="center"
>
</el-table-column>
<el-table-column
property="informationCategoryName"
label="资讯名称"
align="center"
:show-overflow-tooltip="true"
>
</el-table-column>
<!-- <el-table-column
property="hospitalAddress"
label="医院地址"
align="center"
>
</el-table-column> -->
<!-- <el-table-column
property="hospitalIntroduce"
label="医院介绍"
align="center"
:show-overflow-tooltip="true"
>
</el-table-column> -->
<!-- <el-table-column
property="phone"
label="联系电话"
align="center"
:show-overflow-tooltip="true"
>
</el-table-column> -->
</el-table>
<pagination
v-show="total2 > 0"
:total="total2"
:page.sync="nurseStationqueryParams.pageNum"
:limit.sync="nurseStationqueryParams.pageSize"
@pagination="informationInfoinfo"
/>
</el-dialog>
</div>
</template>
<script>
import {
listInformationInfo,
getInformationInfo,
delInformationInfo,
addInformationInfo,
updateInformationInfo,
listInformationCategory,
} from "@/api/system/informationInfo";
import stationAcatar from "../stationAvatar/index.vue";
export default {
components: { stationAcatar },
name: "InformationInfo",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
innerVisible: false,
nurseStationqueryParams: {
pageNum: 1,
pageSize: 10,
informationCategoryCode: "",
informationCategoryName: "",
},
//
showSearch: true,
//
total: 0,
//
informationInfoList: [],
//
title: "",
total2: 0,
imgsurl: { pictureUrlList: [] },
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
informationCategoryId: null,
informationTitle: null,
informationCode: null,
informationContent: null,
informationClickCount: null,
informationJumpLink: null,
informationSource: null,
leadThumbnailUrl: null,
negativeOneThumbnailUrl: null,
negativeTwoThumbnailUrl: null,
largePictureUrl: null,
informationSort: null,
},
//
form: {},
//
rules: {
informationCategoryId: [
{
required: true,
message: "请选择资讯分类",
trigger: "blur",
},
],
informationTitle: [
{
required: true,
message: "请选择资讯标题",
trigger: "blur",
},
],
leadThumbnailUrl: [
{
required: true,
trigger: "blur",
message: "请选择缩略图",
},
],
informationSort: [
{
required: true,
trigger: "blur",
message: "请输入显示顺序",
},
],
informationContent: [
{ required: true, message: "请输入资讯图文内容", trigger: "blur" },
],
// informationContent: [
// {
// required: true,
// message: "",
// trigger: "blur",
// message: "",
// },
// ],
},
infolist: [],
};
},
created() {
this.getList();
},
methods: {
//
cancel() {
this.addopen = false;
// this.reset();
},
innerVisiblecancel() {
this.innerVisible = false;
},
addresetQuery() {
this.nurseStationqueryParams = {
pageNum: 1,
pageSize: 10,
informationCategoryCode: "",
informationCategoryName: "",
};
this.informationInfoinfo();
},
informationInfoinfo() {
listInformationCategory(this.nurseStationqueryParams).then((response) => {
this.infolist = response.rows;
console.log(this.infolist);
this.total2 = response.total;
this.loading = false;
});
},
//
clickinnerVisible() {
this.informationInfoinfo();
// this.form.informationCategoryId =
// this.nurseStationqueryParams.informationCategoryId;
// this.nnerVisibleindex = index;
// console.log(this.nnerVisibleindex);
this.innerVisible = true;
},
imgUrl(imgUrl) {
this.form.leadThumbnailUrl = imgUrl;
},
imgs(item) {
this.imgsurl.pictureUrlList.push(item);
},
/** 查询资讯信息管理列表 */
getList() {
this.loading = true;
listInformationInfo(this.queryParams).then((response) => {
this.informationInfoList = response.rows;
console.log(this.informationInfoList);
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
nurseclick(row) {
console.log(row);
// if (this.homenumber) {
// console.log(this.homenumber);
// this.form.hospitalName = row.hospitalName;
// this.form.hospitalId = row.id;
// } else {
this.form.informationCategoryId = row.id;
this.form.informationCategoryName = row.informationCategoryName;
// }
this.innerVisible = false;
},
//
reset() {
this.form = {
id: null,
informationCategoryId: null,
informationTitle: null,
informationCode: null,
informationContent: null,
informationClickCount: null,
informationJumpLink: null,
informationSource: null,
leadThumbnailUrl: null,
negativeOneThumbnailUrl: null,
negativeTwoThumbnailUrl: null,
largePictureUrl: null,
informationSort: 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.form.informationCategoryName="请选择资讯分类";
this.title = "添加资讯信息管理";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids;
getInformationInfo(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) {
updateInformationInfo(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addInformationInfo(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 delInformationInfo(ids);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download(
"system/informationInfo/export",
{
...this.queryParams,
},
`informationInfo_${new Date().getTime()}.xlsx`
);
},
},
};
</script>