|
@@ -1,19 +1,23 @@
|
|
|
<template>
|
|
|
- 住院号:
|
|
|
- <el-input v-model="query.patNo" @keydown.enter="getMaxTimes" style="width: 120px"/>
|
|
|
- 次数 ({{ query.maxTimes }}) :
|
|
|
- <el-input-number v-model="query.times" @keydown.enter="disPatients"/>
|
|
|
- <el-button @click="disPatients">出院患者</el-button>
|
|
|
- <el-button @click="allPatientsInTheHospital">全院患者</el-button>
|
|
|
- 出院天数:{{ dischargeDays }}
|
|
|
- <span style="color: red">出院七天后就无法编辑患者病历</span>
|
|
|
+ <div ref="headerRef">
|
|
|
+ 住院号:
|
|
|
+ <el-input v-model="query.patNo" @keydown.enter="getMaxTimes" style="width: 120px"/>
|
|
|
+ 次数 ({{ query.maxTimes }}) :
|
|
|
+ <el-input-number v-model="query.times" @keydown.enter="disPatients"/>
|
|
|
+ <el-button @click="disPatients">出院患者</el-button>
|
|
|
+ <el-button @click="allPatientsInTheHospital">全院患者</el-button>
|
|
|
+ <el-button @click="patientListDrawer = !patientListDrawer">患者列表</el-button>
|
|
|
+ 出院天数:{{ dischargeDays }}
|
|
|
+ <span style="color: red">出院七天后就无法编辑患者病历</span>
|
|
|
+ </div>
|
|
|
<div v-if="show">
|
|
|
<div ref="divRef">
|
|
|
- <huan-zhe-xin-xi :huan-zhe-xin-xi="patientInfo"/>
|
|
|
+ <huan-zhe-xin-xi :huan-zhe-xin-xi="patientInfo" @isShow="patientInfoIsShow"/>
|
|
|
</div>
|
|
|
<emr-main :huan-zhe-xin-xi="patientInfo"
|
|
|
:max-height="maxHeight"/>
|
|
|
</div>
|
|
|
+ <emr-patient-list @rowClick="listRowClick" v-model="patientListDrawer"/>
|
|
|
</template>
|
|
|
|
|
|
<script setup name='Home'>
|
|
@@ -30,17 +34,20 @@ import {
|
|
|
query,
|
|
|
resolveRoute
|
|
|
} from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-init";
|
|
|
+import EmrPatientList from "@/components/zhu-yuan-yi-sheng/emr/EmrPatientList.vue";
|
|
|
|
|
|
const divRef = ref(null)
|
|
|
+const headerRef = ref(null)
|
|
|
// 最大高度
|
|
|
let maxHeight = $ref()
|
|
|
// 是否显示页面
|
|
|
let show = $ref(false)
|
|
|
// 获取患者信息
|
|
|
let patientInfo = $ref()
|
|
|
-
|
|
|
// 距离今天的出院天数
|
|
|
let dischargeDays = $ref(0)
|
|
|
+//
|
|
|
+let patientListDrawer = $ref(false)
|
|
|
|
|
|
// 获取最大住院次数
|
|
|
const getMaxTimes = () => {
|
|
@@ -63,11 +70,12 @@ const disPatients = async () => {
|
|
|
pat: window.btoa(te)
|
|
|
}
|
|
|
})
|
|
|
- location.reload()
|
|
|
+ await routerFunc()
|
|
|
}
|
|
|
|
|
|
// 解析路由数据
|
|
|
const routerFunc = async () => {
|
|
|
+ show = false
|
|
|
if (router.currentRoute.value.query.pat) {
|
|
|
resolveRoute(router.currentRoute.value.query.pat)
|
|
|
if (query.value.state === 1) {
|
|
@@ -75,10 +83,12 @@ const routerFunc = async () => {
|
|
|
} else if (query.value.state === 2) {
|
|
|
await queryDisPatient()
|
|
|
} else if (query.value.state === 3) {
|
|
|
- await queryAllPatients()
|
|
|
+ await queryAllPatients(true)
|
|
|
+ } else if (query.value.state === 4) {
|
|
|
+ await queryAllPatients(false)
|
|
|
}
|
|
|
await nextTick()
|
|
|
- maxHeight = window.innerHeight - divRef.value?.clientHeight
|
|
|
+
|
|
|
} else {
|
|
|
show = false
|
|
|
}
|
|
@@ -96,7 +106,6 @@ const queryDisPatient = async () => {
|
|
|
dischargeDays = subtractTime(await getServerDateApi(), patientInfo.disDate)
|
|
|
// 如果患者的出院时间大于 7 天就只能看病历和打印病历了
|
|
|
emrConfig.value.editor = dischargeDays < 7;
|
|
|
- // emrConfig.value.editor = false;
|
|
|
show = true
|
|
|
}
|
|
|
|
|
@@ -113,15 +122,37 @@ const allPatientsInTheHospital = async () => {
|
|
|
pat: window.btoa(te)
|
|
|
}
|
|
|
})
|
|
|
- location.reload()
|
|
|
+ await routerFunc()
|
|
|
}
|
|
|
|
|
|
|
|
|
-const queryAllPatients = async () => {
|
|
|
+const queryAllPatients = async (flag) => {
|
|
|
patientInfo = await getPatientInfo(query.value.patNo)
|
|
|
query.value.times = patientInfo.admissTimes
|
|
|
query.value.maxTimes = patientInfo.admissTimes
|
|
|
show = true
|
|
|
+ emrConfig.value.editor = flag
|
|
|
+}
|
|
|
+
|
|
|
+const listRowClick = async (val) => {
|
|
|
+ let temp = {
|
|
|
+ patNo: val.inpatientNo,
|
|
|
+ times: val.admissTimes,
|
|
|
+ maxTimes: val.admissTimes,
|
|
|
+ state: 4
|
|
|
+ }
|
|
|
+ let te = JSON.stringify(temp)
|
|
|
+ await router.push({
|
|
|
+ name: 'emrEditor',
|
|
|
+ query: {
|
|
|
+ pat: window.btoa(te)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ await routerFunc()
|
|
|
+}
|
|
|
+
|
|
|
+const patientInfoIsShow = (flag, height) => {
|
|
|
+ maxHeight = window.innerHeight - height - 24
|
|
|
}
|
|
|
|
|
|
onMounted(async () => {
|