|  | @@ -4,63 +4,65 @@ import CyTabPane from "@/components/cy/tabs/src/CyTabPane.vue";
 | 
	
		
			
				|  |  |  import {
 | 
	
		
			
				|  |  |    AuditType,
 | 
	
		
			
				|  |  |    emrAuditRootContextKey,
 | 
	
		
			
				|  |  | -  useEmrAuditV2
 | 
	
		
			
				|  |  | +  useEmrAuditV2,
 | 
	
		
			
				|  |  |  } from "./useEmrAudit";
 | 
	
		
			
				|  |  | -import AuditRecord
 | 
	
		
			
				|  |  | -  from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/components/emr-audit/AuditRecord.vue";
 | 
	
		
			
				|  |  | +import AuditRecord from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/components/emr-audit/AuditRecord.vue";
 | 
	
		
			
				|  |  |  import {
 | 
	
		
			
				|  |  |    emrMitt,
 | 
	
		
			
				|  |  | -  IframeTabs
 | 
	
		
			
				|  |  | +  IframeTabs,
 | 
	
		
			
				|  |  |  } from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/emr-init";
 | 
	
		
			
				|  |  | -import SendAudit
 | 
	
		
			
				|  |  | -  from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/components/emr-audit/SendAudit.vue";
 | 
	
		
			
				|  |  | -import {getLinkQuality} from "@/api/emr/emr-suggestion";
 | 
	
		
			
				|  |  | -import AuditHistory
 | 
	
		
			
				|  |  | -  from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/components/emr-audit/AuditHistory.vue";
 | 
	
		
			
				|  |  | -import {listIsBlank} from "@/utils/blank-utils";
 | 
	
		
			
				|  |  | +import SendAudit from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/components/emr-audit/SendAudit.vue";
 | 
	
		
			
				|  |  | +import { getLinkQuality } from "@/api/emr/emr-suggestion";
 | 
	
		
			
				|  |  | +import AuditHistory from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/components/emr-audit/AuditHistory.vue";
 | 
	
		
			
				|  |  | +import { listIsBlank } from "@/utils/blank-utils";
 | 
	
		
			
				|  |  | +import { BizException, ExceptionEnum } from "@/utils/BizException";
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -const store = useEmrAuditV2()
 | 
	
		
			
				|  |  | +const store = useEmrAuditV2();
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -emrMitt.on('auditV2', (data) => {
 | 
	
		
			
				|  |  | -  if (typeof data === 'undefined') {
 | 
	
		
			
				|  |  | +emrMitt.on("auditV2", data => {
 | 
	
		
			
				|  |  | +  if (typeof data === "undefined") {
 | 
	
		
			
				|  |  |      store.state.currentEmrInfo = {
 | 
	
		
			
				|  |  | -      emrId: null
 | 
	
		
			
				|  |  | -    }
 | 
	
		
			
				|  |  | -    store.state.auditTemplate = []
 | 
	
		
			
				|  |  | -    emrMitt.emit('setShowIframe', IframeTabs.正在编辑)
 | 
	
		
			
				|  |  | +      emrId: null,
 | 
	
		
			
				|  |  | +    };
 | 
	
		
			
				|  |  | +    store.state.auditTemplate = [];
 | 
	
		
			
				|  |  | +    emrMitt.emit("setShowIframe", IframeTabs.正在编辑);
 | 
	
		
			
				|  |  |    } else {
 | 
	
		
			
				|  |  |      store.state.currentEmrInfo = data;
 | 
	
		
			
				|  |  | -    store.queryCurrentAudit()
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -    getLinkQuality(data.emrCategoryCode).then(res => {
 | 
	
		
			
				|  |  | -      store.state.auditTemplate = res
 | 
	
		
			
				|  |  | -      if (listIsBlank(res)) {
 | 
	
		
			
				|  |  | -        emrMitt.emit('setShowIframe', IframeTabs.正在编辑)
 | 
	
		
			
				|  |  | -      }
 | 
	
		
			
				|  |  | -    }).catch(() => {
 | 
	
		
			
				|  |  | -      emrMitt.emit('setShowIframe', IframeTabs.正在编辑)
 | 
	
		
			
				|  |  | -    })
 | 
	
		
			
				|  |  | -  }
 | 
	
		
			
				|  |  | -})
 | 
	
		
			
				|  |  | +    if (store.state.currentEmrInfo.emrId == null) {
 | 
	
		
			
				|  |  | +      BizException(ExceptionEnum.MESSAGE_ERROR, "请刷新页面或重新打开病历。");
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    store.queryCurrentAudit();
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    getLinkQuality(data.emrCategoryCode)
 | 
	
		
			
				|  |  | +      .then(res => {
 | 
	
		
			
				|  |  | +        store.state.auditTemplate = res;
 | 
	
		
			
				|  |  | +        if (listIsBlank(res)) {
 | 
	
		
			
				|  |  | +          emrMitt.emit("setShowIframe", IframeTabs.正在编辑);
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +      })
 | 
	
		
			
				|  |  | +      .catch(() => {
 | 
	
		
			
				|  |  | +        emrMitt.emit("setShowIframe", IframeTabs.正在编辑);
 | 
	
		
			
				|  |  | +      });
 | 
	
		
			
				|  |  | +  }
 | 
	
		
			
				|  |  | +});
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  provide(emrAuditRootContextKey, {
 | 
	
		
			
				|  |  | -  store: store
 | 
	
		
			
				|  |  | -})
 | 
	
		
			
				|  |  | +  store: store,
 | 
	
		
			
				|  |  | +});
 | 
	
		
			
				|  |  |  </script>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  <template>
 | 
	
		
			
				|  |  | -  <CyTabs height="100%"
 | 
	
		
			
				|  |  | -          type="idea"
 | 
	
		
			
				|  |  | -          v-model="store.tabsName.value">
 | 
	
		
			
				|  |  | +  <CyTabs height="100%" type="idea" v-model="store.tabsName.value">
 | 
	
		
			
				|  |  |      <CyTabPane label="记录" :name="AuditType.记录">
 | 
	
		
			
				|  |  | -      <AuditRecord/>
 | 
	
		
			
				|  |  | +      <AuditRecord />
 | 
	
		
			
				|  |  |      </CyTabPane>
 | 
	
		
			
				|  |  |      <CyTabPane label="审核" :name="AuditType.审核">
 | 
	
		
			
				|  |  | -      <SendAudit/>
 | 
	
		
			
				|  |  | +      <SendAudit />
 | 
	
		
			
				|  |  |      </CyTabPane>
 | 
	
		
			
				|  |  |      <CyTabPane label="历史" :name="AuditType.历史">
 | 
	
		
			
				|  |  | -      <AuditHistory/>
 | 
	
		
			
				|  |  | +      <AuditHistory />
 | 
	
		
			
				|  |  |      </CyTabPane>
 | 
	
		
			
				|  |  |    </CyTabs>
 | 
	
		
			
				|  |  |  </template>
 |