|
|
@@ -264,6 +264,7 @@
|
|
|
|
|
|
</div>
|
|
|
<EmrRefreshDialog/>
|
|
|
+ <EmrSaveRules ref="emrSaveRulesRef"/>
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
@@ -300,7 +301,7 @@ import EmrPopup from "@/components/zhu-yuan-yi-sheng/emr/EmrPopup.vue";
|
|
|
import EmrAuxiliaryTools from "@/components/zhu-yuan-yi-sheng/emr/auxiliary-tools/EmrAuxiliaryTools.vue";
|
|
|
import sleep from "@/utils/sleep";
|
|
|
import EmrWebSocket from "@/components/zhu-yuan-yi-sheng/emr/web-socket/EmrWebSocket.vue";
|
|
|
-import {stringIsBlank} from "@/utils/blank-utils";
|
|
|
+import {stringIsBlank, stringNotBlank} from "@/utils/blank-utils";
|
|
|
import {isDev} from "@/utils/public";
|
|
|
import {forcedKickingOutOfPersonnelByDocumentId, isThereADoctorEditing} from "@/api/zhu-yuan-yi-sheng/emr-socket";
|
|
|
import {computed, nextTick, onDeactivated, onMounted, ref, watch} from "vue";
|
|
|
@@ -334,6 +335,8 @@ import {
|
|
|
EditType,
|
|
|
EditorMode
|
|
|
} from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/edit";
|
|
|
+import EmrSaveRules
|
|
|
+ from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/components/EmrSaveRules.vue";
|
|
|
|
|
|
const props = defineProps({
|
|
|
huanZheXinXi: {
|
|
|
@@ -692,6 +695,10 @@ const forceTheRecipientToBeKickedOut = (forceRefreshUserInfo: string) => {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+const emrSaveRulesRef = ref<{
|
|
|
+ validData: (data: any) => void,
|
|
|
+ close: () => void
|
|
|
+}>()
|
|
|
|
|
|
// 点击保存病历
|
|
|
const clickSaveData = async () => {
|
|
|
@@ -704,21 +711,23 @@ const clickSaveData = async () => {
|
|
|
if (editor === null) return
|
|
|
// 判断是否有必填项目
|
|
|
waitForLoadingToComplete()
|
|
|
- const documentSocket = emrMitt.emit('getDocumentSocket')
|
|
|
- if (documentSocket === null) {
|
|
|
- await ElMessageBox.alert('和服务区断开连接无法保存', '提示', {
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
- return
|
|
|
+ if (stringNotBlank(editor.documentData._id)) {
|
|
|
+ const documentSocket = emrMitt.emit('getDocumentSocket')
|
|
|
+ if (documentSocket === null) {
|
|
|
+ await ElMessageBox.alert('未连接上服务器,无法保存', '提示', {
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
-
|
|
|
try {
|
|
|
+ emrSaveRulesRef.value.close()
|
|
|
const validator = editor.getValidator();
|
|
|
- const valid = validator.valid();
|
|
|
+ const valid = validator.valid(true);
|
|
|
|
|
|
if (valid) {
|
|
|
- xcMessage.error("有必填项不能为空,请仔细检查,红色输入框。")
|
|
|
+ emrSaveRulesRef.value.validData(valid)
|
|
|
return
|
|
|
}
|
|
|
} catch {
|
|
|
@@ -1592,6 +1601,10 @@ const emrMittInit = () => {
|
|
|
return editor
|
|
|
})
|
|
|
|
|
|
+ emrMitt.on('getIframe', () => {
|
|
|
+ return emrRef.value
|
|
|
+ })
|
|
|
+
|
|
|
emrMitt.on('setShowIframe', (val, id) => {
|
|
|
showIframe.value = val
|
|
|
if (id) {
|
|
|
@@ -1599,6 +1612,8 @@ const emrMittInit = () => {
|
|
|
}
|
|
|
})
|
|
|
|
|
|
+ emrMitt.on('clickSaveData', clickSaveData)
|
|
|
+
|
|
|
emrMitt.on("forceRefresh", forceTheRecipientToBeKickedOut)
|
|
|
emrMitt.on('queryHistoryFunc', queryHistoryFunc)
|
|
|
emrMitt.on('loadDocument', () => {
|