瀏覽代碼

优化判断

DESKTOP-0GD05B0\Administrator 2 年之前
父節點
當前提交
895e80a698
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. 6 1
      src/components/zhu-yuan-yi-sheng/emr/HistoricalEmr.vue

+ 6 - 1
src/components/zhu-yuan-yi-sheng/emr/HistoricalEmr.vue

@@ -46,6 +46,7 @@ import {EMRInteractive} from '@/views/hospitalization/zhu-yuan-yi-sheng/electron
 import {getHistory} from '@/api/zhu-yuan-yi-sheng/emr-patient'
 import {getFormatDatetime} from '@/utils/date'
 import {ElMessageBox} from "element-plus";
+import {BizException, ExceptionEnum} from "@/utils/BizException";
 
 const props = defineProps({
   docunentId: {
@@ -85,12 +86,16 @@ const restoreData = (row) => {
 }
 
 onMounted(async () => {
+  if (!props.docunentId) {
+    emit('closed')
+    BizException(ExceptionEnum.MESSAGE_ERROR, "请先选择已保存的病历模板。");
+  }
   await nextTick()
   currentEmr.value = new EMRInteractive(null, emrEvent);
   emrRef.value.parentElement.emr = currentEmr.value
   getHistory(props.docunentId).then((res) => {
     historicalData.value = res as Array<any>;
-  })
+  });
 })
 </script>