| 
					
				 | 
			
			
				@@ -21,38 +21,67 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </template> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <template #main> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      <div v-loading="!isReady" style="height: 100%"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <iframe 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            height="80%" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            width="100%" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            ref="emrRef" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            src="/emr/runtime/#/editor" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      </div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </template> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   </page-layer> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 </template> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 <script setup name='ResumeMedicalRecords'> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import {getDeleteMedicalRecord, resumeMedicalRecords} from "@/api/zhu-yuan-yi-sheng/emr-patient"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  getDeleteMedicalRecord, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  getInvalidByDocumentId, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  resumeMedicalRecords 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+} from "@/api/zhu-yuan-yi-sheng/emr-patient"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import PageLayer from "@/layout/PageLayer.vue"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import {huanZheXinXi} from "@/views/hospitalization/zhu-yuan-yi-sheng/public-js/zhu-yuan-yi-sheng"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import XcTable from "@/components/xiao-chan/xc-table/XcTable.vue"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import {huanHangXianShi} from "@/utils/date"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import * as net from "net"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import {EMRInteractive} from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-init"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import {BizException, ExceptionEnum} from "@/utils/BizException"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 const deleteData = ref([]) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 const patNo = ref('') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 const rowData = ref({}) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+const emrRef = ref() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+const currentEmr = ref() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+const isReady = ref(false) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 const queryData = () => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   if (!patNo.value) return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   getDeleteMedicalRecord(patNo.value).then((res) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     deleteData.value = res 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    rowData.value = {} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    if (editor != null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      editor.setDocument({}, true, true) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 const recovery = () => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   resumeMedicalRecords(rowData.value.emrDocumentId).then((res) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    console.log(res) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    queryData() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  console.log(rowData.value) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 const rowClick = (val) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  rowData.value = val 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  if (!isReady.value) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    BizException(ExceptionEnum.MESSAGE_ERROR, '请等待编辑器加载完成') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  rowData.value = val; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  getInvalidByDocumentId(rowData.value.emrDocumentId).then((res) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    editor.setDocument(res, true, true) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    editor.setEditorMode('readonly') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 watch(() => huanZheXinXi.value.inpatientNo, () => { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -60,6 +89,20 @@ watch(() => huanZheXinXi.value.inpatientNo, () => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   queryData() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+let editor = null 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+const editorEvents = { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  'ready': (event) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    isReady.value = true 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    editor = currentEmr.value.getEditor() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+onMounted(async () => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  await nextTick(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  currentEmr.value = new EMRInteractive({}, editorEvents); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  emrRef.value.parentElement.emr = currentEmr.value 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+}) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 </script> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 |