浏览代码

优化提示

xiaochan 2 年之前
父节点
当前提交
792bf46f47

+ 11 - 4
src/components/zhu-yuan-yi-sheng/YzTag.vue

@@ -70,10 +70,17 @@ let pathList = $ref([
         let te = JSON.stringify(query)
         window.open(window.location.origin + '/myEmrEditor/' + window.btoa(te) + '/refresh', '_blank');
       } else {
-        ElMessageBox.alert('请先选择一个患者,出院患者可以在患者信息查询中看到。', '提示', {
-          type: 'error'
-        }).finally(() => {
-
+        ElMessageBox.confirm('请先选择一个患者,出院患者可以在【患者信息查询】页面中查询到,如果患者出院时间未超过七天,且管床医生是你,那么点击前面的病历,默认是用编辑模式打开。', '提示', {
+          type: 'error',
+          cancelButtonText: '患者查询页面',
+          confirmButtonText: '确认',
+          distinguishCancelAndClose: true
+        }).then(() => {
+
+        }).catch((value) => {
+          if (value === 'cancel') {
+            router.push('/inpatient/patientInformationInquiry')
+          }
         })
       }
     }

+ 1 - 1
src/router/modules/dashboard.js

@@ -573,7 +573,7 @@ const route = [
             {
                 path: 'patientInformationInquiry',
                 component: createNameComponent(() => import('@/views/hospitalization/zhu-yuan-yi-sheng/PatientInformationInquiry.vue')),
-                meta: {title: '患者信息查询'},
+                meta: {title: '患者信息查询', passRule: true},
             },
             {
                 path: 'level3DoctorSetup',

+ 9 - 2
src/views/hospitalization/zhu-yuan-yi-sheng/PatientInformationInquiry.vue

@@ -133,7 +133,7 @@
   </page-layer>
 </template>
 
-<script setup name='PatientInformationInquiry'>
+<script setup lang="ts">
 import PageLayer from "@/layout/PageLayer.vue";
 import {getHospWardAndDept, getPatientInfo, diagnosis, employeeList} from "@/api/zhu-yuan-yi-sheng/pat-info-query";
 import SelectV4 from "@/components/xiao-chan/select-v4/SelectV4.vue";
@@ -151,6 +151,8 @@ import {
 } from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/emr-init";
 import {subtractTime} from "@/utils/date";
 import {getServerDateApi} from "@/api/public-api";
+import {ref, onMounted} from 'vue'
+import {userInfoStore} from "@/utils/store-public";
 
 const param = ref({
   patNo: '',
@@ -208,7 +210,12 @@ const openEmr = async (data) => {
   if (param.value.leaveHospital) {
     const dischargeDays = subtractTime(await getServerDateApi(), data.disDate)
     if (dischargeDays <= 7) {
-      window.open(getInEmrUrl(data.inpatientNo, data.admissTimes, emrStateEnum.出院编辑), '_blank')
+      // 时间小于 7 天 ,且是自己的患者就是出院编辑状态
+      if (userInfoStore.value.code === data.referPhysician) {
+        window.open(getInEmrUrl(data.inpatientNo, data.admissTimes, emrStateEnum.出院编辑), '_blank')
+      } else {
+        window.open(getInEmrUrl(data.inpatientNo, data.admissTimes, emrStateEnum.出院只读), '_blank')
+      }
     } else {
       window.open(getInEmrUrl(data.inpatientNo, data.admissTimes, emrStateEnum.出院只读), '_blank')
     }

+ 17 - 3
src/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/Home.vue

@@ -130,19 +130,33 @@ const disPatients = async () => {
   await routerFunc()
 }
 
+const noPatient = () => {
+  ElMessageBox.confirm('请先选择一个患者,出院患者可以在【患者信息查询】页面中查询到,如果患者出院时间未超过七天,且管床医生是你,那么点击前面的病历,默认是用编辑模式打开。', '提示', {
+    type: 'error',
+    cancelButtonText: '患者查询页面',
+    confirmButtonText: '确认',
+    distinguishCancelAndClose: true
+  }).then(() => {
+  }).catch(async (value) => {
+    if (value === 'cancel') {
+      await router.push('/inpatient/patientInformationInquiry')
+      location.reload()
+    }
+  })
+}
+
 // 解析路由数据
 const routerFunc = async () => {
   emrMainRef.value?.closeWebSocket()
   show.value = false
   if (!router.currentRoute.value.params.pat) {
+    noPatient()
     return
   }
   try {
     resolveRoute(router.currentRoute.value.params.pat)
   } catch {
-    ElMessageBox.alert('请先选择一个患者', '提示', {
-      type: 'error'
-    })
+    noPatient()
     return
   }
   console.log('查询数据 %o', query.value)