患者管理页面

This commit is contained in:
shidongli 2024-11-29 17:32:20 +08:00
parent 26c2a9602a
commit 7fae09d0e9
5 changed files with 1581 additions and 94 deletions

View File

@ -49,3 +49,23 @@ export function delDepartment(id) {
method: 'delete'
})
}
// 导入
export function patientUpload(data) {
return request({
url: '/manage/patientInfo/patientUpload',
method: 'post',
data: data
})
}
// 导入提交
export function secondaryUpload(data) {
return request({
url: '/manage/patientInfo/secondaryUpload',
method: 'post',
data: data
})
}

BIN
src/assets/images/jd.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 265 B

BIN
src/assets/images/run.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@ -1,23 +1,431 @@
<template>
<Form ref="form" :label-width="labelWidth" :size="size" style="display: flex;">
<div id="searchFilter" ref="searchFilter" :gutter="10" style="display: flex; flex-wrap: wrap;"
:style="{ width: widths + '%' }">
<Form
ref="form"
:label-width="labelWidth"
:size="size"
style="display: flex"
class="item-search-form"
>
<div
id="searchFilter"
ref="searchFilter"
:gutter="10"
style="display: flex; flex-wrap: wrap"
:style="{ width: widths + '%' }"
>
<slot></slot>
</div>
<div style="width:20%;text-align:right;padding-right:18px;">
<div
style="width: 20%; text-align: right; padding-right: 18px"
:style="{
width:
this.$router.currentRoute.path == '/patient/Patientmanagement'
? '27%'
: '20%',
}"
>
<Button type="primary" @click="handleQuery" size="mini">搜索</Button>
<Button @click="handleReset" size="mini">重置</Button>
<Button v-show="collapsiable" type="text" @click="shiftCollapsiable" size="mini">
<el-button
type="warning"
plain
icon="el-icon-upload2"
size="mini"
@click="handleUpload"
v-if="this.$router.currentRoute.path == '/patient/Patientmanagement'"
>导入</el-button
>
<Button
v-show="collapsiable"
type="text"
@click="shiftCollapsiable"
size="mini"
>
<span>
{{ fold ? '收起' : '展开' }}
{{ fold ? "收起" : "展开" }}
<i :class="fold ? 'el-icon-arrow-up' : 'el-icon-arrow-down'"></i>
</span>
</Button>
</div>
<!-- 导入-->
<el-dialog title="导入" :visible.sync="open" width="600px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item
v-for="(item, index) in form.deptAliasVOS"
:key="index"
:rules="rules.deptAliasVOS.departmentName"
:prop="`deptAliasVOS.${index}.departmentName`"
>
<template slot="label">
{{ item.deptAlias }}
</template>
<el-select
v-model="item.departmentName"
placeholder="请选择科室"
style="width: 208px"
@change="changeway($event, index)"
>
<el-option
v-for="item in form.departments"
:key="item.id"
:label="item.departmentName"
:value="item.id"
>
</el-option>
</el-select>
<!-- <el-button
v-if="!form.departments"
type="primary"
plain
style="margin-left: 8px"
@click="additem(item, index)"
>添加</el-button
> -->
<el-button
type="primary"
plain
style="margin-left: 8px"
@click="additem(item, index)"
>添加</el-button
>
</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="uploadopen"
width="400px"
append-to-body
>
<el-upload
drag
class="upload-demo"
ref="upload"
:action="action.url"
:headers="action.headers"
:on-preview="handlePreview"
:on-remove="handleRemove"
:file-list="fileList"
:auto-upload="false"
:on-success="handleAvatarSuccess"
:data="action.data"
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip" slot="tip" style="line-height: 25px">
<div>
1.
<span
style="color: #1890ff; cursor: pointer"
@click="importTemplate"
>下载导入模板</span
>
</div>
<div>2.最大支持2MB的xls/xlsx文件</div>
<div>3.一次导入患者数量不能超过5000</div>
<el-checkbox v-model="records" style="font-size: 12px;">自动去除当日重复记录</el-checkbox>
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitUpload"> </el-button>
<el-button @click="uploadcancel"> </el-button>
</div>
</el-dialog>
<!-- 添加或修改科室信息对话框 -->
<el-dialog
title="添加"
:visible.sync="openadd"
width="1000px"
append-to-body
>
<el-form
ref="formadd"
:model="formadd"
:rules="rulesadd"
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="hospitalAgencyId">
<el-input v-model="form.hospitalAgencyId" placeholder="请输入所属机构id" />
</el-form-item>
<el-form-item label="所属机构名称" prop="agencyName">
<el-input
v-model="form.agencyName"
placeholder="请输入所属机构名称"
/>
</el-form-item> -->
<div class="nameinformation">基本信息</div>
<div class="content">
<el-form-item label="科室名称" prop="departmentName">
<el-input
maxlength="100"
v-model="formadd.departmentName"
placeholder="请输入科室名称"
/>
</el-form-item>
<el-form-item label="科室代码" prop="departmentCode">
<el-input
maxlength="30"
onKeyUp="value=value.replace(/[\W]/g,'')"
v-model="formadd.departmentCode"
placeholder="请输入科室代码"
/>
</el-form-item>
<el-form-item label="所属机构" prop="hospitalAgencyName">
<el-cascader
clearable
:props="{ checkStrictly: true }"
:options="treeOptions"
@change="change"
style="width: 205px; color: black"
v-model="formadd.hospitalAgencyIdtwo"
:show-all-levels="false"
:placeholder="
formadd.hospitalAgencyName ? formadd.hospitalAgencyName : ''
"
ref="cascader"
:key="isResouceShow"
></el-cascader>
</el-form-item>
<el-form-item label="节点类型" prop="nodeType">
<el-select
v-model="formadd.nodeType"
placeholder="请选择"
style="width: 205px"
clearable
>
<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="departmentAbbreviation">
<el-input
maxlength="100"
v-model="formadd.departmentAbbreviation"
placeholder="请输入科室简称"
/>
</el-form-item>
<el-form-item label="科室类型" prop="departmentType">
<el-select
v-model="formadd.departmentType"
placeholder="请选择"
style="width: 205px"
clearable=""
>
<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
maxlength="20"
v-model="formadd.departmentPersonName"
placeholder="请输入科室负责人姓名"
/>
</el-form-item>
<el-form-item label="上级科室" prop="parentDepartmentId">
<el-select
v-model="formadd.parentDepartmentName"
placeholder="请选择"
style="width: 205px"
@change="changeparentDepartment"
clearable
>
<el-option
v-for="item in optionsparentDepartment"
:key="item.id"
:label="item.departmentName"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
</div>
<div class="nameinformation">扩展信息</div>
<div class="content">
<el-form-item label="提供服务类别" prop="provideServiceCategory">
<el-select
clearable
v-model="formadd.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-form-item>
<el-form-item label="细分类别" prop="subdivisionCategoryId">
<el-select
v-model="formadd.subdivisionCategoryName"
placeholder="请选择"
style="width: 205px"
clearable
@change="optionsubdivision"
>
<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="normDepartmentCompareId">
<el-select
v-model="formadd.normDepartmentCompareId"
placeholder="请选择"
style="width: 205px"
clearable
>
<el-option
v-for="item in compareList"
:key="item.departmentId"
:label="item.departmentName"
:value="item.departmentId"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="编制床位数" prop="prepareBedsCount">
<el-input
maxlength="8"
onKeyUp="value=value.replace(/[\W]/g,'')"
v-model="formadd.prepareBedsCount"
placeholder="请输入编制床位数"
/>
</el-form-item>
<el-form-item label="科室电话" prop="departmentPhone">
<el-input
maxlength="12"
onKeyUp="value=value.replace(/[\W]/g,'')"
v-model="formadd.departmentPhone"
placeholder="请输入科室电话"
/>
</el-form-item>
<el-form-item label="科室邮箱" prop="departmentMail">
<el-input
maxlength="20"
v-model="formadd.departmentMail"
placeholder="请输入科室邮箱"
/>
</el-form-item>
<el-form-item label="成立日期" prop="establishDate">
<el-date-picker
clearable
v-model="formadd.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="formadd.revokeDate"
type="date"
style="width: 205px"
value-format="yyyy-MM-dd"
placeholder="请选择撤销日期"
>
</el-date-picker>
</el-form-item>
</div>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFormadd"> </el-button>
<el-button @click="canceladd"> </el-button>
</div>
</el-dialog>
<el-dialog
title="查看"
:visible.sync="openphone"
width="900px"
append-to-body
>
<el-table v-loading="loading" :data="patientInfoList">
<el-table-column label="科室名称" align="center" prop="patientName" />
<el-table-column label="就诊时间" align="center" prop="patientName" />
<el-table-column label="姓名" align="center" prop="patientName" />
<el-table-column label="联系电话" align="center" prop="patientPhone" width="120" />
<el-table-column label="年龄" align="center" prop="age" />
<el-table-column label="诊断" align="center" prop="mainDiagnosis" />
</el-table>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="cancelphone"> </el-button>
</div>
</el-dialog>
<!-- 遮罩层 -->
<div class="mask" v-if="showMask">
<!-- 图片 -->
<div class="maskimg">
<div class="wrap">
<div class="progress-bar">
<div class="progress"></div>
<div class="inner" :style="{ '--left': progress + '%' }"></div>
<div class="runner" :style="{ '--left': progress + '%' }"></div>
</div>
</div>
<div class="text">导入中请稍等</div>
</div>
</div>
</Form>
</template>
<script>
import { Form, FormItem, Button } from 'element-ui'
import { faL, fas } from '@fortawesome/free-solid-svg-icons'
import { listCompare } from "@/api/system/compare";
import { listSubdivision } from "@/api/system/subdivision";
import { agencyList, getAgencytype } from "@/api/system/agency";
import { getToken } from "@/utils/auth";
import {
addDepartment,
updateDepartment,
patientUpload,
getDepartmentList,
secondaryUpload,
} from "@/api/system/department";
export default {
name: 'SearchFilter',
components: { Form, FormItem, Button },
@ -41,16 +449,92 @@ export default {
},
data() {
return {
loading:false,
patientInfoList:[],
datalist:[],
openphone:false,
form: {},
uploadopen: false,
fileList: [],
records:true,
action: {
data: {
records: '',
},
headers: {
Authorization: "Bearer " + getToken(),
},
url: process.env.VUE_APP_BASE_API + "/manage/patientInfo/patientUpload",
},
open: false,
openadd: false,//
formadd: {},//
collapsiable: false,
fold: false,
// 30
maxShow: undefined,
rules: {
deptAliasVOS: {
departmentName: [
{ required: true, message: "科室不能为空", trigger: "blur" }
]
},
},
treeOptions: [],
//
optionsubdivisionCategory: [],
// 4
compareList: [],
option: [],
options: [],
optionsparentDepartment: [],
departmentoptions: [],
nodeTypeoptions: [],
isResouceShow: 1,
indexadd: "",
showMask: false,//
progress: 0,
// --
rulesadd: {
nodeType: [
{ required: true, message: "节点类型不能为空", trigger: "blur" },
],
hospitalAgencyName: [
{ required: true, message: "所属机构不能为空", trigger: "blur" },
],
departmentName: [
{ required: true, message: "科室名称不能为空", trigger: "blur" },
],
departmentCode: [
{ required: true, message: "科室代码不能为空", trigger: "blur" },
],
departmentPhone: [
{
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
message: "请输入正确的科室电话",
trigger: "blur",
},
],
departmentMail: [
{
type: "email",
message: "请输入正确的邮箱地址",
trigger: ["blur", "change"],
},
],
},
}
},
mounted() {
// /
this.minShowCtrol()
this.$emit('fold',this.fold)
this.$emit('fold', this.fold)
const currentRoute = this.$router.currentRoute;
console.log(currentRoute, 'currentRoute')
},
watch: {
@ -65,6 +549,312 @@ export default {
}
},
methods: {
handleAvatarSuccess(response, file, fileList) {
console.log(response, file, fileList, 'response, file, fileList')
if (response.code == 500) {
this.$modal.msgError(response.msg);
}else if(response.code == 500_2){
this.openphone=true;
}
else if (response.code == 200 && !response.data) {
this.$modal.msgSuccess("导入成功");
this.$emit('handleRules')
} else if (response.code == 200 && response.data) {
this.form = response.data
this.open = true;
}
this.uploadcancel();
this.fileList = [];
},
handleRemove(file, fileList) {
console.log(file, fileList);
},
handlePreview(file) {
console.log(file, '000000');
},
//
submitUpload() {
console.log(this.action,'action')
if(this.records==true){
this.action.data.records=1
}else{
this.action.data.records=0
}
this.$refs.upload.submit();
},
//
uploadcancel() {
this.uploadopen = false;
},
/** 下载模板操作 */
importTemplate() {
this.download(
"/system/importDownload/downloadTemplate?fileType=patientInfoImport",
{},
`门诊随访记录 - 未随访.xlsx`
);
},
//
cancelphone(){
this.openphone=false;
},
//
handleUpload() {
// this.openphone=true;
this.uploadopen = true;
this.records=true;
this.fileList = [];
this.form = {};
// this.showMask = true;
// this.progress = 0;
// this.timer = setInterval(() => {
// if (this.progress < 99) {
// this.progress += 5;
// } else {
// clearInterval(this.timer); //
// // 1
// // setTimeout(() => {
// // this.showMask = false;
// // //
// // }, 1000);
// }
// }, 2000); // 900 0.9 1%
// this.$refs.form.resetFields();
// this.open = true;
},
//
cancel() {
this.open = false;
// this.reset();
},
//
additem(item, index) {
this.indexadd = index
this.reset();
this.gettreelist();
this.infocompare();
this.getinfolist();
this.getinfo();
this.info();
this.infodepartment();
this.infolist();
this.openadd = true
if (localStorage.getItem('roleKey') != 'admin') {
this.getLeafIds(this.treeOptions)
}
console.log(item, index, 'item')
// this.$emit('additem',item,index)
},
//
changeway(e, index) {
console.log(e, index, 'e')
this.form.deptAliasVOS[index].departmentName = this.form.departments.find(f => f.id == e).departmentName
// this.form.deptAliasVOS[index].departmentId = e
this.$nextTick(() => {
this.$forceUpdate()
})
},
getLeafIds(nodes) {
console.log(nodes, ';node')
this.formadd.hospitalAgencyIdtwo = JSON.parse(localStorage.getItem('user')).hospitalAgencyId;
let leafIds = [];
nodes.forEach(node => {
if (node.id == this.formadd.hospitalAgencyIdtwo) {
this.formadd.hospitalAgencyName = node.label;
} else {
if (node.children) {
// getLeafIds
leafIds = leafIds.concat(this.getLeafIds(node.children));
} else {
// id
leafIds.push(node.id);
}
}
});
return leafIds;
},
//
gettreelist() {
agencyList().then((res) => {
//
this.treeOptions = res.data.map((item) => {
return { value: item.id, ...item };
});
});
},
//
change(e) {
console.log(this.formadd.hospitalAgencyIdtwo)
if (e) {
this.formadd.hospitalAgencyId = e[e.length - 1];
if (this.formadd.hospitalAgencyId) {
const arr = this.$refs["cascader"].getCheckedNodes()[0].pathLabels;
this.formadd.hospitalAgencyName = arr.slice(-1).join(",");
this.gethaveinfo(e[e.length - 1])
this.formadd.parentDepartmentId = ''
this.formadd.parentDepartmentName = ''
} else {
this.formadd.parentDepartmentId = ''
this.formadd.hospitalAgencyName = "";
}
} else {
this.getinfo();
}
},
/** 查询标准科室对照信息列表 */
infocompare() {
this.loading = true;
listCompare(this.queryParamscompare).then((response) => {
this.compareList = response.rows;
// this.total = response.total;
this.loading = false;
});
},
//
getinfolist() {
listSubdivision().then((res) => {
this.optionsubdivisionCategory = res.rows;
});
},
//
getinfo() {
getDepartmentList().then((res) => {
this.optionsparentDepartment = res.data;
});
},
//
changeparentDepartment(e) {
this.form.parentDepartmentId = e;
},
//
info() {
var dictType = "department_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;
});
},
//
canceladd() {
this.openadd = false;
this.reset();
},
optionsubdivision(e) {
// this.form.subdivisionCategoryId = this.optionsubdivisionCategory.find(
// (e) => e.id == this.form.subdivisionCategoryId
// ).subdivisionCategoryName;
// console.log(this.form.subdivisionCategoryName)
},
//
reset() {
this.formadd = {
id: null,
parentDepartmentId: null,
hospitalAgencyId: null,
hospitalAgencyIdtwo: null,
hospitalAgencyName: 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,
parentDepartmentName: null,
};
this.resetForm("formadd");
},
/** 提交按钮 --添加*/
submitFormadd() {
let reg = new RegExp("-", "g");
if (this.formadd.establishDate && this.formadd.revokeDate && new Date(this.formadd.establishDate.replace(reg, "/")) >
new Date(this.formadd.revokeDate.replace(reg, "/"))) {
this.$message.error("撤销日期要大于成立日期");
}
else {
this.$refs["formadd"].validate((valid) => {
if (valid) {
if (!this.formadd.hospitalAgencyId) {
this.formadd.hospitalAgencyId = this.formadd.hospitalAgencyIdtwo
}
// this.formadd.hospitalAgencyId = this.formadd.hospitalAgencyIdtwo
var obj = {
departmentName: this.formadd.departmentName,
id: ''
}
this.form.departments.push(obj)
this.form.deptAliasVOS[this.indexadd].departmentName = this.formadd.departmentName
console.log(this.formadd, 'this.formadd')
addDepartment(this.formadd).then((response) => {
this.$modal.msgSuccess("添加成功");
this.openadd = false;
// this.getList();
});
}
});
}
},
/** 提交按钮 */
submitForm() {
console.log(this.form, 'this.form确定')
this.$refs["form"].validate(valid => {
if (valid) {
secondaryUpload(this.form).then(response => {
this.$modal.msgSuccess("保存成功");
this.open = false;
this.$emit('handleRules')
});
}
});
},
// resize
screenChange() {
// resizeresize
@ -78,7 +868,7 @@ export default {
},
shiftCollapsiable() {
this.fold = !this.fold
this.$emit('fold',this.fold)
this.$emit('fold', this.fold)
this.minShowCtrol()
},
// maxShow/
@ -110,7 +900,140 @@ export default {
}
</script>
<style lang="scss" scoped>
::v-deep .el-form-item {
.item-search-form {
::v-deep .el-form-item {
height: 28px !important;
}
}
::v-deep .el-checkbox__label{
font-size: 12px;
}
::v-deep .el-checkbox__inner{
width: 12px;
height: 12px;
}
.el-cascader .el-input input::-webkit-input-placeholder {
color: black;
}
.nameinformation {
border-left: 3px solid #4d9de7;
width: 200px;
height: 20px;
padding-left: 10px;
font-size: 18px;
// margin-top: 8px;
color: black;
}
.content {
margin: 22px;
}
.el-cascader .el-input input::-webkit-input-placeholder {
color: #686a6d;
}
//
.mask {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(255, 255, 255, 0.7); /* 半透明背景 */
// display: flex;
justify-content: center;
align-items: center;
z-index: 1000; /* 确保遮罩层在顶部 */
.maskimg {
position: absolute;
// top: 49%;
top: 45%;
left: 50%;
transform: translate(-50%, -50%);
.text {
position: absolute;
left: 19%;
width: 123px;
// color: #1989fa;
color: #f28e01;
}
//
.newloding {
margin-top: 10px;
}
.wrap {
position: relative;
height: 40px;
// background: beige;
width: 200px;
}
.progress-bar {
position: absolute;
top: 23px;
width: 100%;
height: 12px;
border-radius: 6px;
background-color: rgb(255, 237, 212);
.inner {
position: absolute;
top: 0;
z-index: 10;
border-radius: 6px;
height: 12px;
width: 100px;
background: #f28e01;
transition: left 1s ease-in-out;
// animation: shrink 5s linear infinite;
animation: changeWidth 1s forwards linear, shrink 1s linear infinite;
background-image: url(~@/assets/images/jd.png);
}
}
.progress {
width: 0%;
height: 100%;
background-color: #00aaff;
transition: width 1s ease-in-out;
}
.runner {
width: 60px;
height: 24px;
background-image: url(~@/assets/images/run.gif);
background-size: contain;
position: absolute;
top: -27px;
transition: left 1s ease-in-out;
animation: run 1s forwards linear;
margin-left: -55px;
}
@keyframes run {
0% {
left: 0;
}
100% {
left: var(--left);
}
}
@keyframes changeWidth {
0% {
width: 0;
}
100% {
width: var(--left);
background-position: 40px 0;
}
}
@keyframes shrink {
0% {
background-position: 0 0;
}
100% {
background-position: 40px 0;
}
}
}
}
</style>

View File

@ -0,0 +1,544 @@
<template>
<div class="app-container" ref="layout">
<div ref="topform" class="form">
<SearchFilter :labelWidths="280" labelWidth="90px" size="small" @search="handleQuery"
@reset="resetQuery" @minShowCtrol="getMaxTableHeight" @handleRules="handleRules">
<el-form-item label="患者姓名" prop="patientName">
<el-input v-model="queryParams.patientName" placeholder="请输入患者姓名" clearable @keyup.enter.native="handleQuery"
style="width: 200px" />
</el-form-item>
<el-form-item label="患者电话" prop="patientPhone">
<el-input v-model="queryParams.patientPhone" placeholder="请输入患者电话" clearable @keyup.enter.native="handleQuery"
style="width: 200px" />
</el-form-item>
<el-form-item label="身份证号" prop="cardNo">
<el-input v-model="queryParams.cardNo" placeholder="请输入患者身份证号" clearable @keyup.enter.native="handleQuery"
style="width: 200px" />
</el-form-item>
<el-form-item label="诊断" prop="mainDiagnosis">
<el-input v-model="queryParams.mainDiagnosis" placeholder="请输入诊断" clearable style="width: 200px"
@keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="患者来源" prop="patientSource">
<el-select v-model="queryParams.patientSource" placeholder="请选择患者来源" clearable style="width: 200px">
<el-option v-for="dict in dict.type.patient_source" :key="dict.value" :label="dict.label"
:value="dict.value" />
</el-select>
</el-form-item>
<el-form-item label="就诊方式" prop="visitMethod">
<el-select v-model="queryParams.visitMethod" placeholder="请选择就诊方式" clearable style="width: 200px">
<el-option v-for="dict in dict.type.visit_method" :key="dict.value" :label="dict.label"
:value="dict.value" />
</el-select>
</el-form-item>
<el-form-item label="就诊时间" prop="visitDateStart">
<el-date-picker v-model="visitDate" type="daterange" range-separator="" start-placeholder="开始日期"
style="width: 200px" value-format="yyyy-MM-dd" end-placeholder="结束日期">
</el-date-picker>
</el-form-item>
<el-form-item label="医院" prop="hospitalAgencyId">
<el-select v-model="queryParams.hospitalAgencyId" filterable placeholder="请选择医院" style="width: 200px"
clearable @clear="clearhospitalAgency" @change="changehospitalAgency">
<el-option v-for="item in hospitalAgencylist" :key="item.id" :label="item.agencyName" :value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="院区" prop="campusAgencyId">
<el-select v-model="queryParams.campusAgencyId" filterable placeholder="请选择院区" style="width: 200px" clearable
@clear="clearcampusAgency" @change="changecampusAgency">
<el-option v-for="item in campusAgencylist" :key="item.id" :label="item.agencyName" :value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="科室" prop="departmentId">
<el-select v-model="queryParams.departmentId" filterable placeholder="请选择科室" style="width: 200px" clearable
@clear="cleardepartment" @change="changedepartment">
<el-option v-for="item in departmentlist" :key="item.id" :label="item.departmentName" :value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="病区" prop="wardId">
<el-select v-model="queryParams.wardId" filterable placeholder="请选择病区" style="width: 200px" clearable>
<el-option v-for="item in wardlist" :key="item.id" :label="item.departmentName" :value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="主治医生" prop="attendingPhysicianId">
<el-select v-model="queryParams.attendingPhysicianId" style="width: 200px" filterable placeholder="请选择主治医生"
clearable>
<el-option v-for="item in attendingPhysicianlist" :key="item.userId" :label="item.nickName"
:value="item.userId">
</el-option>
</el-select>
</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> -->
</SearchFilter>
</div>
<div ref="table">
<el-table :max-height="maxTableHeight" v-loading="loading" :data="patientInfoList">
<el-table-column label="序号" type="index" width="48" align="center" />
<el-table-column label="患者姓名" align="center" prop="patientName" />
<el-table-column label="患者电话" align="center" prop="patientPhone" width="120" />
<el-table-column label="性别" align="center" prop="sex">
<template slot-scope="scope">
{{ scope.row.sex == "MALE" ? "男" : "" }}
{{ scope.row.sex == "FEMALE" ? "女" : "" }}
</template>
</el-table-column>
<el-table-column label="年龄" align="center" prop="age" />
<el-table-column label="出生日期" align="center" prop="birthDate" width="130" />
<!-- <el-table-column label="签约状态" align="center" prop="signStatus">
<template slot-scope="scope">
<dict-tag :options="dict.type.sign_status" :value="scope.row.signStatus" />
</template>
</el-table-column>
<el-table-column label="签约时间" align="center" prop="signTime" width='130'>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.signTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column> -->
<!-- <el-table-column label="开证医生" align="center" prop="certificateIssuingDoctor" /> -->
<el-table-column label="就诊时间" align="center" prop="visitDate" width="130">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.visitDate, "{y}-{m}-{d}") }}</span>
</template>
</el-table-column>
<el-table-column label="诊断" align="center" prop="mainDiagnosis" />
<!-- <el-table-column label="入院时间" align="center" prop="admissionTime" width='130' /> -->
<el-table-column label="医院" align="center" prop="hospitalAgencyName" width="130" />
<el-table-column label="院区" align="center" prop="campusAgencyName" width="130" />
<el-table-column label="科室名称" align="center" prop="departmentName" width="130" />
<el-table-column label="病区名称" align="center" prop="wardName" width="130" />
<el-table-column label="住院/门诊号" align="center" prop="inHospitalNumber" width="130" />
<el-table-column label="主治医生" align="center" prop="attendingPhysicianName" />
<el-table-column label="就诊方式" align="center" prop="visitMethod">
<template slot-scope="scope">
<dict-tag :options="dict.type.visit_method" :value="scope.row.visitMethod" />
</template>
</el-table-column>
<!-- <el-table-column label="出院方式" align="center" prop="dischargeMethod" /> -->
<el-table-column label="患者来源" align="center" prop="patientSource">
<template slot-scope="scope">
<dict-tag :options="dict.type.patient_source" :value="scope.row.patientSource" />
</template>
</el-table-column>
<el-table-column label="住址" align="center" prop="address" />
<!-- class-name="small-padding fixed-width" fixed="right" -->
<el-table-column label="操作" align="center" fixed="right">
<template slot-scope="scope">
<!-- <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['manage:patientInfo:edit']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['manage:patientInfo:remove']">删除</el-button> -->
<el-button size="mini" type="text" @click="handleAuthRole(scope.row)">详情</el-button>
<el-button size="mini" type="text" @click="handleedit(scope.row)">画像编辑</el-button>
</template>
</el-table-column>
</el-table>
</div>
<myPagination v-show="total > 0" :total="total" :pageSize="queryParams.pageSize"
:indexFromWrap="queryParams.pageNum" :indexFrom="indexFrom" @updateCPage="updateCPage"></myPagination>
</div>
</template>
<script>
import { getPatientList } from "@/api/manage/patientInfo";
import { getAge } from "@/utils/age";
import {
selectAgencyList,
getDepartmentList,
getAgencyList,
} from "@/api/manage/selectAgencyList";
import { usergetList } from "@/api/unitconfig/patientConfiguration";
import SearchFilter from "../../components/SearchForm.vue";
import cardlist from "../components/cardlist.vue";
export default {
name: "PatientInfo",
dicts: ["patient_type", "visit_method", "sign_status", "patient_source"],
components: { SearchFilter, cardlist },
data() {
return {
indexFrom: "",
searchData: {},
maxTableHeight: undefined,
attendingPhysicianlist: [],
//
loading: true,
//
total: 0,
//
patientInfoList: [],
//
queryParams: {
pageNum: 1,
pageSize: 100,
patientName: null,
patientPhone: null,
birthDate: null,
patientType: null,
visitMethod: null,
mainDiagnosis: null,
attendingPhysicianId: null,
hospitalAgencyId: null,
hospitalAgencyName: null,
campusAgencyId: null,
campusAgencyName: null,
departmentId: null,
departmentName: null,
wardId: null,
wardName: null,
surgicalName: null,
admissionTimeStart: null,
admissionTimeEnd: null,
outpatientNumber: null,
visitDateStart: null,
visitDateEnd: null,
dischargeMethod: null,
patientSource: null,
},
visitDate: [],
admissionTime: [],
//list
hospitalAgencylist: [],
// list
campusAgencylist: [],
//list
departmentlist: [],
//list
wardlist: [],
};
},
watch: {
type: {
handler(val) {
// if (val == "table") {
// this.queryParams.pageSize = 10;
// this.indexFrom = "";
// } else if (val == "card") {
// this.indexFrom = 100;
// }
},
deep: true,
immediate: true,
},
},
created() {
this.getList();
this.selectAgencyinfo();
},
mounted() {
this.getMaxTableHeight();
this.screenChange();
},
methods: {
updateCPage(index, size) {
this.queryParams.pageNum = index;
this.queryParams.pageSize = size;
this.getList();
},
//
usergetListinfo() {
usergetList({
hospitalAgencyId: this.queryParams.hospitalAgencyId,
postName: "DOCTOR",
}).then((res) => {
this.attendingPhysicianlist = res.data;
});
},
/** 详情操作 */
handleAuthRole(row) {
this.$router.push({
path: "/patient/patientdetails",
query: {
path: "/patient/patientInfo",
patientId: row.id,
patientName: row.patientName,
patientPhone: row.patientPhone,
familyMemberPhone: row.familyMemberPhone,
cardNo: row.cardNo,
address: row.address,
mainDiagnosis: row.mainDiagnosis,
hospitalAgencyName: row.hospitalAgencyName,
campusAgencyName: row.campusAgencyName,
departmentName: row.departmentName,
wardName: row.wardName,
certificateIssuingDoctorName: row.certificateIssuingDoctorName,
appointmentTreatmentGroup: row.appointmentTreatmentGroup,
responsibleNurse: row.responsibleNurse,
registrationNo: row.registrationNo,
registrationDate: row.registrationDate,
appointmentDate: row.appointmentDate,
sex: row.sex,
birthDate: row.birthDate,
patientSource: row.patientSource,
createTime: row.createTime,
age: row.birthDate ? getAge(row.birthDate) : "",
},
});
},
//
handleedit(row) {
this.$router.push({
path: "/patient/Portraitedit",
query: {
path: "/patient/patientInfo",
patientId: row.id,
cardNo: row.cardNo,
patientName: row.patientName,
patientPhone: row.patientPhone,
sex: row.sex,
birthDate: row.birthDate,
familyMemberPhone: row.familyMemberPhone,
address: row.address,
patientSource: row.patientSource,
createTime: row.createTime,
hospitalAgencyName: row.hospitalAgencyName,
mainDiagnosis: row.mainDiagnosis,
age: row.birthDate ? getAge(row.birthDate) : "",
},
});
},
/** 查询患者信息列表 */
getList() {
this.loading = true;
this.queryParams.params = {};
const loading = this.$loading({
lock: true,
text: "数据加载中",
spinner: "el-icon-loading",
background: "rgba(0, 0, 0, 0.7)",
});
getPatientList(this.queryParams).then((response) => {
response.rows.forEach((e) => {
e.birthDate ? (e.age = getAge(e.birthDate)) : "";
});
this.patientInfoList = response.rows;
console.log(this.patientInfoList,'this.patientInfoList')
this.total = response.total;
loading.close();
this.loading = false;
});
},
handleRules(){
console.log('this.patientInfoList')
this.getList()
},
/** 搜索按钮操作 */
handleQuery() {
if (this.visitDate?.length > 0) {
this.queryParams.visitDateStart = this.visitDate[0];
this.queryParams.visitDateEnd = this.visitDate[1];
} else {
this.queryParams.visitDateStart = null;
this.queryParams.visitDateEnd = null;
}
if (this.admissionTime?.length > 0) {
this.queryParams.admissionTimeStart = this.admissionTime[0];
this.queryParams.admissionTimeEnd = this.admissionTime[1];
} else {
this.queryParams.admissionTimeStart = null;
this.queryParams.admissionTimeEnd = null;
}
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams = {
pageNum: 1,
pageSize: 10,
};
// if (this.type == "card") {
// this.queryParams = {
// pageNum: 1,
// pageSize: 100,
// };
// } else {
// this.queryParams = {
// pageNum: 1,
// pageSize: 10,
// };
// }
this.admissionTime = [];
this.queryParams.admissionTimeStart = null;
this.queryParams.admissionTimeEnd = null;
this.visitDate = [];
this.queryParams.visitDateStart = null;
this.queryParams.visitDateEnd = null;
this.handleQuery();
},
selectAgencyinfo() {
let query = {
agencyStatus: "ON",
nodeType: "HOSPITAL",
};
selectAgencyList(query).then((res) => {
this.hospitalAgencylist = res.data;
});
},
//
getAgencyListinfo(nodeType, id) {
let query = {
nodeType: nodeType,
};
if (nodeType == "HOSPITAL") {
query.hospitalId = id;
} else if (nodeType == "CAMPUS") {
query.campusId = id;
} else if (nodeType == "DEPARTMENT") {
query.departmentId = id;
}
getAgencyList(query).then((res) => {
if (nodeType == "HOSPITAL") {
this.campusAgencylist = res.data.campusList;
this.departmentlist = res.data.departmentList;
} else if (nodeType == "CAMPUS") {
this.departmentlist = res.data.departmentList;
}
this.wardlist = res.data.wardList;
});
},
//
changehospitalAgency(id) {
this.getAgencyListinfo("HOSPITAL", id);
// let query = {
// agencyStatus: 'ON',
// nodeType: 'CAMPUS',
// parentId: id,
// }
// selectAgencyList(query).then(res => {
// this.campusAgencylist = res.data
this.queryParams.campusAgencyId = null;
this.queryParams.departmentId = null;
this.queryParams.wardId = null;
this.queryParams.attendingPhysicianId = null;
// })
//
this.usergetListinfo();
},
//
changecampusAgency(id) {
this.getAgencyListinfo("CAMPUS", id);
// let query = {
// nodeType: 'DEPARTMENT',
// hospitalAgencyId: id,
// }
// getDepartmentList(query).then(res => {
// this.departmentlist = res.data
this.queryParams.departmentId = null;
this.queryParams.wardId = null;
// })
},
//
changedepartment(id) {
this.getAgencyListinfo("DEPARTMENT", id);
// let query = {
// nodeType: 'WARD',
// parentDepartmentId: id,
// }
// getDepartmentList(query).then(res => {
// this.wardlist = res.data
this.queryParams.wardId = null;
// })
},
//
clearhospitalAgency() {
this.queryParams.campusAgencyId = null;
this.queryParams.departmentId = null;
this.queryParams.wardId = null;
this.queryParams.attendingPhysicianId = null;
setTimeout(() => {
this.attendingPhysicianlist = [];
}, 1000);
},
//
clearcampusAgency() {
this.queryParams.departmentId = null;
this.queryParams.wardId = null;
this.getAgencyListinfo("HOSPITAL", this.queryParams.hospitalAgencyId);
},
//
cleardepartment() {
this.queryParams.wardId = null;
if (this.queryParams.departmentId) {
this.getAgencyListinfo("DEPARTMENT", this.queryParams.departmentId);
} else if (this.queryParams.campusAgencyId) {
this.getAgencyListinfo("CAMPUS", this.queryParams.campusAgencyId);
} else if (this.queryParams.hospitalAgencyId) {
this.getAgencyListinfo("HOSPITAL", this.queryParams.hospitalAgencyId);
}
},
//
getMaxTableHeight() {
const windowInnerHeight = window.innerHeight; //
const layoutDiv = this.$refs.layout;
const formDiv = this.$refs.topform;
const mb8Div = this.$refs.mb8;
this.maxTableHeight =
windowInnerHeight -
134 -
this.getBoxPadding(layoutDiv) -
this.getBoxHeight(mb8Div) -
this.getBoxHeight(formDiv);
},
// resize
screenChange() {
// resizeresize
window.addEventListener("resize", this.getMaxTableHeight, true);
//
//
// beforeDestroy
this.$once("hook:beforeDestroy", () => {
window.removeEventListener("resize", this.getMaxTableHeight, true);
});
},
},
};
</script>
<style lang="scss" scoped>
.cardlist {
display: flex;
flex-wrap: wrap;
align-content: flex-start;
overflow-y: auto;
}
.carditem {
margin-right: 10px;
margin-bottom: 10px;
width: 260px;
min-height: 200px;
border: 1px solid #dcdfe6;
border-radius: 10px;
}
::v-deep .el-table__body-wrapper {
overflow: auto;
}
::v-deep .el-form{
width: 100%;
}
.form {
display: flex;
width: 100%;
}
::v-deep .el-table {
overflow: hidden;
}
</style>