Browse Source

优化代码

DESKTOP-0GD05B0\Administrator 2 years ago
parent
commit
8c0ade9f24

+ 0 - 43
src/components/zhu-yuan-yi-sheng/emr/EmrSavedMedicalRecord.vue

@@ -1,43 +0,0 @@
-<template>
-  <el-button @click="openDialog(documentId)">已保存病历</el-button>
-
-  <el-dialog v-model="dialog" fullscreen>
-    <iframe
-        width="100%"
-        :height="getWindowSize.h / 1.1 + 'px'"
-        :src="src"/>
-  </el-dialog>
-</template>
-
-<script setup name='EmrSavedMedicalRecord'>
-
-import {getWindowSize} from "@/utils/window-size";
-import {xcMessage} from "@/utils/xiaochan-element-plus";
-
-const props = defineProps({
-  saveDocumentId: String
-})
-
-
-const dialog = ref(false)
-const src = ref('')
-const documentId = ref('')
-
-const openDialog = (id) => {
-  if (!id) {
-    return xcMessage.error('请先选择病历')
-  }
-  dialog.value = true
-  src.value = `/emr/runtime/?documentId=${id}&categoryCode=&categoryId=&patientId=#/`
-  documentId.value = id
-}
-
-defineExpose({
-  openDialog
-})
-
-</script>
-
-<style scoped lang="scss">
-
-</style>

+ 1 - 3
src/components/zhu-yuan-yi-sheng/emr/EmrSidebar.vue

@@ -247,7 +247,7 @@ const nullToEmpty = (val) => {
 const mousePosition = ref()
 const opt = [
   {
-    name: '解锁', click: (data) => {
+    name: '申请解锁', click: (data) => {
       if (data.jump) {
         xcMessage.error('病程记录,请选中父模板。')
         return
@@ -257,13 +257,11 @@ const opt = [
   },
   {
     name: '打开已保存的病历', click: (data) => {
-      console.log(data)
       if (!data.unlock.id) {
         xcMessage.error('请选中保存的病历。')
         return
       }
       emit('openAndSaveTheMedicalRecord', data.unlock.id)
-
     }
   }
 ]

+ 52 - 39
src/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/EmrMain.vue

@@ -79,7 +79,6 @@
         <el-button icon="RefreshLeft"
                    @click="clickUndo('undo')"
                    title="撤销"/>
-        <el-button icon="Loading" title="刷新病历" @click="reload"/>
         <el-button icon="RefreshRight"
                    @click="clickUndo('redo')"
                    title="重做"/>
@@ -110,7 +109,6 @@
       <el-divider direction="vertical"/>
       <el-checkbox v-model="autoSave" label="自动保存" @change="autoSaveChange"/>
       <el-divider direction="vertical"/>
-      <emr-saved-medical-record ref="saveMedicalRef"/>
     </el-header>
     <el-container>
       <div :class="foldBothSides.isLeft ? 'emr-template-open' : 'emr-template-put-away' ">
@@ -268,39 +266,50 @@
           </el-scrollbar>
         </div>
         <div class="emr-iframe">
-          <emr-popup ref="popupRef"
-                     @fill-data="popupFunc.fillData"/>
-
-          <emr-web-socket :pat-info="props.huanZheXinXi"
-                          :current-editor-user="currentEditorUser"
-                          ref="emrSocket"/>
-
-          <div class="creator_prompt">
-            <div>
-              创建:{{ createName }}
-              <br>
-              当前:{{ userData.name }}
-              <br>
-              现编辑:{{ currentEditorUser?.name }}
-            </div>
-
-            <div>
-              等级:{{ createLevel }}
-              <br>
-              等级:{{ doctorLevel }}
-              <br>
-              科室:{{ currentEditorUser?.deptName }}
-            </div>
+          <div>
+            <el-button @click="showIframe  =1" :type="showIframe === 1 ? 'primary' : ''">正在编辑</el-button>
+            <el-button @click="showIframe  =2" :type="showIframe === 2? 'primary' : ''">已保存病历</el-button>
+          </div>
+          <div v-show="showIframe === 1">
+            <div style="position: relative">
+              <emr-popup ref="popupRef"
+                         @fill-data="popupFunc.fillData"/>
+
+              <emr-web-socket :pat-info="props.huanZheXinXi"
+                              :current-editor-user="currentEditorUser"
+                              ref="emrSocket"/>
+
+              <div class="creator_prompt">
+                <div>
+                  创建:{{ createName }}
+                  <br>
+                  当前:{{ userData.name }}
+                  <br>
+                  现编辑:{{ currentEditorUser?.name }}
+                </div>
+
+                <div>
+                  等级:{{ createLevel }}
+                  <br>
+                  等级:{{ doctorLevel }}
+                  <br>
+                  科室:{{ currentEditorUser?.deptName }}
+                </div>
+
+                <div class="edit_mode">
+                  模式:{{ editorMod ? '只读' : '编辑' }}
+                </div>
 
-            <div class="edit_mode">
-              模式:{{ editorMod ? '只读' : '编辑' }}
+              </div>
+              <iframe ref="emrRef"
+                      :height="maxHeight - 110 + 'px' "
+                      :src="caseHistoryUrl"/>
             </div>
-
           </div>
-
-          <iframe ref="emrRef"
-                  :height="maxHeight - 100 + 'px' "
-                  :src="caseHistoryUrl"/>
+          <div v-show="showIframe ===2 ">
+            <iframe :height="maxHeight - 110 + 'px' "
+                    :src="saveDocumentId"/>
+          </div>
         </div>
       </div>
       <div :class="foldBothSides.isRight ? 'emr-fragment-open' : 'emr-fragment-put-away' ">
@@ -367,7 +376,6 @@ import {stringIsBlank, stringNotBlank} from "@/utils/blank-utils";
 import {createRestrictions} from "@/api/zhu-yuan-yi-sheng/emr-control-rule";
 import {needRule} from "@/utils/public";
 import {isThereADoctorEditing} from "@/api/zhu-yuan-yi-sheng/emr-socket";
-import EmrSavedMedicalRecord from "@/components/zhu-yuan-yi-sheng/emr/EmrSavedMedicalRecord.vue";
 
 const props = defineProps({
   huanZheXinXi: {
@@ -790,10 +798,6 @@ const nodeClick = (val, jumpOrNot, templateType) => {
   }
 }
 
-const reload = () => {
-  emrEvent['loaded']()
-}
-
 const updateCaseHistoryUrl = async (val) => {
   await courseSegmentLocking()
   let temp = `/emr/runtime/?documentId=${val.documentId}&categoryCode=${val.categoryCode}&categoryId=${val.categoryId}&patientId=${patientId}#/`
@@ -1434,11 +1438,14 @@ const medicalRecordQualityControl = async () => {
   }
 }
 
-const saveMedicalRef = ref(null)
 const openAndSaveTheMedicalRecord = (id) => {
-  saveMedicalRef.value.openDialog(id)
+  saveDocumentId.value = `/emr/runtime/?documentId=${id}#/`
+  showIframe.value = 2
 }
 
+const showIframe = ref(1)
+const saveDocumentId = ref()
+
 onMounted(async () => {
   autoSave = store.state.app.emrAutosave;
   autoSaveChange()
@@ -1489,6 +1496,12 @@ defineExpose({
 </script>
 
 <style scoped lang="scss">
+.tabs {
+  padding: 5px 10px;
+  border: 1px solid #000;
+  width: max-content;
+}
+
 .emr-iframe, iframe {
   width: 100%;
   position: relative;