|
|
@@ -1,10 +1,10 @@
|
|
|
<template>
|
|
|
- <el-row :gutter="5" style="height: 100%;">
|
|
|
- <el-col :span="8" style="height: auto;">
|
|
|
+ <el-row :gutter="5" style="height: 100%">
|
|
|
+ <el-col :span="8" style="height: auto">
|
|
|
<PageLayer>
|
|
|
<template #main class="hd-cl">
|
|
|
<el-row :gutter="5">
|
|
|
- <el-descriptions :column="2" border style="width:100%;">
|
|
|
+ <el-descriptions :column="2" border style="width: 100%">
|
|
|
<el-descriptions-item label="门诊号" width="15%">
|
|
|
{{ crmEmrPatientVo.hisMzNo }}
|
|
|
</el-descriptions-item>
|
|
|
@@ -14,24 +14,26 @@
|
|
|
</el-descriptions>
|
|
|
</el-row>
|
|
|
<el-row :gutter="5">
|
|
|
- <el-descriptions :column="1" border style="width:100%;">
|
|
|
+ <el-descriptions :column="1" border style="width: 100%">
|
|
|
<el-descriptions-item label="证件号" width="30%">
|
|
|
{{ crmEmrPatientVo.socialNo }}
|
|
|
</el-descriptions-item>
|
|
|
</el-descriptions>
|
|
|
</el-row>
|
|
|
<el-row :gutter="5">
|
|
|
- <el-descriptions :column="1" border style="width:100%;">
|
|
|
+ <el-descriptions :column="1" border style="width: 100%">
|
|
|
<el-descriptions-item label="慢病类型" width="30%">
|
|
|
{{
|
|
|
- crmEmrPatientVo.chronicDiseaseName.substring(0,
|
|
|
- crmEmrPatientVo.chronicDiseaseName.lastIndexOf(","))
|
|
|
+ crmEmrPatientVo.chronicDiseaseName.substring(
|
|
|
+ 0,
|
|
|
+ crmEmrPatientVo.chronicDiseaseName.lastIndexOf(",")
|
|
|
+ )
|
|
|
}}
|
|
|
</el-descriptions-item>
|
|
|
</el-descriptions>
|
|
|
</el-row>
|
|
|
<el-row :gutter="5">
|
|
|
- <el-descriptions :column="2" border style="width:100%;">
|
|
|
+ <el-descriptions :column="2" border style="width: 100%">
|
|
|
<el-descriptions-item label="姓名" width="15%">
|
|
|
{{ crmEmrPatientVo.pName }}
|
|
|
</el-descriptions-item>
|
|
|
@@ -41,86 +43,120 @@
|
|
|
</el-descriptions>
|
|
|
</el-row>
|
|
|
<el-row :gutter="5">
|
|
|
- <el-descriptions :column="2" border style="width:100%;">
|
|
|
+ <el-descriptions :column="2" border style="width: 100%">
|
|
|
<el-descriptions-item label="性别" width="15%">
|
|
|
{{ crmEmrPatientVo.sexValue }}
|
|
|
</el-descriptions-item>
|
|
|
<el-descriptions-item label="年龄" width="15%">
|
|
|
- {{ crmEmrPatientVo.age === null ? '' : crmEmrPatientVo.age + '岁' }}
|
|
|
+ {{
|
|
|
+ crmEmrPatientVo.age === null ? "" : crmEmrPatientVo.age + "岁"
|
|
|
+ }}
|
|
|
</el-descriptions-item>
|
|
|
</el-descriptions>
|
|
|
</el-row>
|
|
|
- <el-row :gutter="5" style="padding-top: 5px;">
|
|
|
- <el-tabs type="border-card" v-model="tabType" class="small_tabs" @tab-click="queryCrmEmdrData"
|
|
|
- style="width:100%;">
|
|
|
+ <el-row :gutter="5" style="padding-top: 5px">
|
|
|
+ <el-tabs
|
|
|
+ type="border-card"
|
|
|
+ v-model="tabType"
|
|
|
+ class="small_tabs"
|
|
|
+ @tab-click="queryCrmEmdrData"
|
|
|
+ style="width: 100%"
|
|
|
+ >
|
|
|
<el-tab-pane label="慢病模板" name="0">
|
|
|
<el-table :data="emrTemplateData" @row-click="rowClick">
|
|
|
- <el-table-column type="index" label="序号" width="50"></el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ type="index"
|
|
|
+ label="序号"
|
|
|
+ width="50"
|
|
|
+ ></el-table-column>
|
|
|
<el-table-column label="名称" prop="name"></el-table-column>
|
|
|
</el-table>
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane label="历史模板" name="3">
|
|
|
- <el-input v-model="filterText" placeholder="搜索" style="width: 100%;">
|
|
|
+ <el-input
|
|
|
+ v-model="filterText"
|
|
|
+ placeholder="搜索"
|
|
|
+ style="width: 100%"
|
|
|
+ >
|
|
|
<template #prepend>关键字</template>
|
|
|
</el-input>
|
|
|
- <el-tree style="width: 100%;" ref="treeRef" class="filter-tree" :data="treeData"
|
|
|
- :props="defaultProps" @node-click="handleNodeClick" node-key="id" highlight-current
|
|
|
- default-expand-all :filter-node-method="filterNode"/>
|
|
|
+ <el-tree
|
|
|
+ style="width: 100%"
|
|
|
+ ref="treeRef"
|
|
|
+ class="filter-tree"
|
|
|
+ :data="treeData"
|
|
|
+ :props="defaultProps"
|
|
|
+ @node-click="handleNodeClick"
|
|
|
+ node-key="id"
|
|
|
+ highlight-current
|
|
|
+ default-expand-all
|
|
|
+ :filter-node-method="filterNode"
|
|
|
+ />
|
|
|
</el-tab-pane>
|
|
|
</el-tabs>
|
|
|
</el-row>
|
|
|
</template>
|
|
|
</PageLayer>
|
|
|
</el-col>
|
|
|
- <el-col :span="16" style="height: auto;">
|
|
|
+ <el-col :span="16" style="height: auto">
|
|
|
<PageLayer>
|
|
|
<template #header class="hd-cl">
|
|
|
- <el-input v-model="textCode" placeholder="请输入证件号/门诊号/住院号" style="width: 320px;">
|
|
|
+ <el-input
|
|
|
+ v-model="textCode"
|
|
|
+ placeholder="请输入证件号/门诊号/住院号"
|
|
|
+ style="width: 320px"
|
|
|
+ >
|
|
|
<template #prepend>关键字</template>
|
|
|
</el-input>
|
|
|
- <el-button type="primary" icon="Search" @click="selectCrmPatientMiByCode" style="margin-left: 10px">查询
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ icon="Search"
|
|
|
+ @click="selectCrmPatientMiByCode"
|
|
|
+ style="margin-left: 10px"
|
|
|
+ >查询
|
|
|
</el-button>
|
|
|
<el-button type="success" @click="saveData">保存</el-button>
|
|
|
- <el-button icon="Printer" type="primary" @click="handlePrint"> 打印</el-button>
|
|
|
+ <el-button icon="Printer" type="primary" @click="handlePrint">
|
|
|
+ 打印
|
|
|
+ </el-button>
|
|
|
</template>
|
|
|
<template #main>
|
|
|
- <div ref="emrDivRef" style="width: 100% ; height: 100%">
|
|
|
- </div>
|
|
|
+ <div ref="emrDivRef" style="width: 100%; height: 100%"></div>
|
|
|
</template>
|
|
|
</PageLayer>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</template>
|
|
|
<script setup lang="ts">
|
|
|
-import {onMounted, ref, nextTick, watch, onActivated, onUnmounted} from "vue";
|
|
|
-import PageLayer from '@/layout/PageLayer.vue'
|
|
|
-import {useEmrInit, UseEmrInitReturn} from "@/utils/emr/emr-init-v2";
|
|
|
+import { onMounted, ref, nextTick, watch, onActivated, onUnmounted } from "vue";
|
|
|
+import PageLayer from "@/layout/PageLayer.vue";
|
|
|
+import { useEmrInit, UseEmrInitReturn } from "@/utils/emr/emr-init-v2";
|
|
|
import {
|
|
|
getCrmEmrModel,
|
|
|
queryCrmEmrTree,
|
|
|
queryCrmPatientInfoByCode,
|
|
|
- saveCrmEmrModel
|
|
|
+ saveCrmEmrModel,
|
|
|
} from "@/api/chronic-disease/chronic-disease-questionnaire";
|
|
|
-import {ElMessageBox, ElTree, ElMessage} from 'element-plus'
|
|
|
-import {stringIsBlank} from "@/utils/blank-utils";
|
|
|
-import {getServerDateApi, getUuid} from "@/api/public-api";
|
|
|
+import { ElMessageBox, ElTree, ElMessage } from "element-plus";
|
|
|
+import { stringIsBlank } from "@/utils/blank-utils";
|
|
|
+import { getServerDateApi, getUuid } from "@/api/public-api";
|
|
|
import router from "@/router";
|
|
|
-import {useCompRef} from "@/utils/useCompRef";
|
|
|
-import {onDeactivated} from "@vue/runtime-core";
|
|
|
-import {xcMessage} from "@/utils/xiaochan-element-plus";
|
|
|
-import {useUserStore} from "@/pinia/user-store";
|
|
|
+import { useCompRef } from "@/utils/useCompRef";
|
|
|
+import { onDeactivated } from "@vue/runtime-core";
|
|
|
+import { xcMessage } from "@/utils/xiaochan-element-plus";
|
|
|
+import { useUserStore } from "@/pinia/user-store";
|
|
|
+import env from "@/utils/setting";
|
|
|
|
|
|
-const userInfo = useUserStore().userInfo
|
|
|
+const userInfo = useUserStore().userInfo;
|
|
|
|
|
|
-const textCode = ref('')
|
|
|
-const tabType = ref('0')
|
|
|
+const textCode = ref("");
|
|
|
+const tabType = ref("0");
|
|
|
|
|
|
const emrEvent = {
|
|
|
- 'contextUpdate': (evt, contextMap, component, context) => {
|
|
|
- const element = component.getAttribute('element')
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
+ contextUpdate: (evt, contextMap, component, context) => {
|
|
|
+ const element = component.getAttribute("element");
|
|
|
+ },
|
|
|
+};
|
|
|
|
|
|
export interface Property {
|
|
|
editorVersion?: string;
|
|
|
@@ -138,7 +174,7 @@ export interface Version {
|
|
|
}
|
|
|
|
|
|
export interface emrTemplateType {
|
|
|
- documentId?: string,
|
|
|
+ documentId?: string;
|
|
|
parent?: string;
|
|
|
code?: string;
|
|
|
versions?: Version[];
|
|
|
@@ -150,59 +186,60 @@ export interface emrTemplateType {
|
|
|
labels?: string[];
|
|
|
}
|
|
|
|
|
|
-const emrTemplateData = ref<emrTemplateType[]>()
|
|
|
-const emrTemplateEditData = ref<emrTemplateType[]>()
|
|
|
-const emrDivRef = ref<HTMLDivElement>()
|
|
|
+const emrTemplateData = ref<emrTemplateType[]>();
|
|
|
+const emrTemplateEditData = ref<emrTemplateType[]>();
|
|
|
+const emrDivRef = ref<HTMLDivElement>();
|
|
|
let editor: UseEmrInitReturn;
|
|
|
-const selectionStatus = ref(false)
|
|
|
-const categoryCode = ref<string>('')
|
|
|
-const mzEmrName = ref<string>('')
|
|
|
-const parent = ref<string>('')
|
|
|
+const selectionStatus = ref(false);
|
|
|
+const categoryCode = ref<string>("");
|
|
|
+const mzEmrName = ref<string>("");
|
|
|
+const parent = ref<string>("");
|
|
|
|
|
|
const rowClick = async (row: emrTemplateType) => {
|
|
|
- selectionStatus.value = true
|
|
|
- categoryCode.value = row.code as string
|
|
|
- mzEmrName.value = row.name as string
|
|
|
- parent.value = row.parent as string
|
|
|
- if (tabType.value == '0') {
|
|
|
+ selectionStatus.value = true;
|
|
|
+ categoryCode.value = row.code as string;
|
|
|
+ mzEmrName.value = row.name as string;
|
|
|
+ parent.value = row.parent as string;
|
|
|
+ if (tabType.value == "0") {
|
|
|
await editor.loadAndSetDocument({
|
|
|
categoryId: row._id,
|
|
|
categoryCode: row.code,
|
|
|
- })
|
|
|
+ });
|
|
|
} else {
|
|
|
await editor.loadAndSetDocument({
|
|
|
- documentId: row.documentId
|
|
|
- })
|
|
|
+ documentId: row.documentId,
|
|
|
+ });
|
|
|
}
|
|
|
- editor.editor.setEditorMode('form')
|
|
|
-}
|
|
|
+ editor.editor.setEditorMode("form");
|
|
|
+};
|
|
|
|
|
|
const saveData = () => {
|
|
|
const validator = editor.editor.getValidator();
|
|
|
const valid = validator.valid(true);
|
|
|
|
|
|
if (valid) {
|
|
|
- xcMessage.error('请检查必填项或者填写值是否正确!')
|
|
|
- return
|
|
|
+ xcMessage.error("请检查必填项或者填写值是否正确!");
|
|
|
+ return;
|
|
|
}
|
|
|
|
|
|
- if (!((tabType.value == '0' || tabType.value == '2') && selectionStatus.value)) {
|
|
|
- return ElMessage.error('请选择数据,只有慢病模板才能保存!')
|
|
|
+ if (
|
|
|
+ !((tabType.value == "0" || tabType.value == "2") && selectionStatus.value)
|
|
|
+ ) {
|
|
|
+ return ElMessage.error("请选择数据,只有慢病模板才能保存!");
|
|
|
}
|
|
|
- ElMessageBox.confirm('请确认是否保存', {
|
|
|
- cancelButtonText: '取消',
|
|
|
- confirmButtonText: '确定',
|
|
|
+ ElMessageBox.confirm("请确认是否保存", {
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ confirmButtonText: "确定",
|
|
|
})
|
|
|
- .then(() => {
|
|
|
- clickSaveData()
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- })
|
|
|
-}
|
|
|
+ .then(() => {
|
|
|
+ clickSaveData();
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+};
|
|
|
|
|
|
const clickSaveData = async () => {
|
|
|
// 解析 id
|
|
|
- let id = await analysisIframeSrcSearch()
|
|
|
+ let id = await analysisIframeSrcSearch();
|
|
|
let data: any = {
|
|
|
pId: crmEmrPatientVo.value.pId,
|
|
|
pType: crmEmrPatientVo.value.pType,
|
|
|
@@ -214,218 +251,241 @@ const clickSaveData = async () => {
|
|
|
parent: parent.value,
|
|
|
inputId: crmEmrPatientVo.value.userIdCode,
|
|
|
inputDept: crmEmrPatientVo.value.deptCode,
|
|
|
- documentData: null
|
|
|
- }
|
|
|
+ documentData: null,
|
|
|
+ };
|
|
|
let newDate = await getServerDateApi();
|
|
|
const document = editor.editor.getDocument();
|
|
|
|
|
|
- document.properties.categoryCode = data.emrCategoryCode
|
|
|
+ document.properties.categoryCode = data.emrCategoryCode;
|
|
|
document.properties.patientId = data.pId + "-" + data.visitTimes;
|
|
|
- document._id = data.emrDocumentId
|
|
|
- data.documentData = document
|
|
|
+ document._id = data.emrDocumentId;
|
|
|
+ data.documentData = document;
|
|
|
|
|
|
if (document.properties.creator) {
|
|
|
- document.properties.modifier = crmEmrPatientVo.value.userIdCode
|
|
|
- document.properties.modifierId = crmEmrPatientVo.value.userName
|
|
|
- document.properties.modifyTime = newDate
|
|
|
+ document.properties.modifier = crmEmrPatientVo.value.userIdCode;
|
|
|
+ document.properties.modifierId = crmEmrPatientVo.value.userName;
|
|
|
+ document.properties.modifyTime = newDate;
|
|
|
} else {
|
|
|
- document.properties.creator = crmEmrPatientVo.value.userIdCode
|
|
|
- document.properties.creatorId = crmEmrPatientVo.value.userName
|
|
|
- document.properties.createTime = newDate
|
|
|
+ document.properties.creator = crmEmrPatientVo.value.userIdCode;
|
|
|
+ document.properties.creatorId = crmEmrPatientVo.value.userName;
|
|
|
+ document.properties.createTime = newDate;
|
|
|
}
|
|
|
saveCrmEmrModel(data).then((res: any) => {
|
|
|
- selectCrmPatientMiByCode()
|
|
|
- queryCrmEmdrData(null, null)
|
|
|
- })
|
|
|
-
|
|
|
-}
|
|
|
+ selectCrmPatientMiByCode();
|
|
|
+ queryCrmEmdrData(null, null);
|
|
|
+ });
|
|
|
+};
|
|
|
|
|
|
const analysisIframeSrcSearch = async () => {
|
|
|
- let id = getId()
|
|
|
- let temp: string
|
|
|
+ let id = getId();
|
|
|
+ let temp: string;
|
|
|
if (stringIsBlank(id)) {
|
|
|
// 这个是 唯一 id 调用服务的雪花算法
|
|
|
- temp = await getUuid()
|
|
|
+ temp = await getUuid();
|
|
|
} else {
|
|
|
- temp = id
|
|
|
+ temp = id;
|
|
|
}
|
|
|
- return temp
|
|
|
-}
|
|
|
+ return temp;
|
|
|
+};
|
|
|
|
|
|
const getId = () => {
|
|
|
if (editor) {
|
|
|
- return editor.editor.documentData._id
|
|
|
+ return editor.editor.documentData._id;
|
|
|
}
|
|
|
- return null
|
|
|
-}
|
|
|
-
|
|
|
+ return null;
|
|
|
+};
|
|
|
|
|
|
const appContext = () => {
|
|
|
return {
|
|
|
endpoints: {
|
|
|
app: "http://172.16.32.160:9205/thyy/api/dataEmr/comp",
|
|
|
- his: import.meta.env.VITE_BASE_URL,
|
|
|
+ his: env.VITE_BASE_URL,
|
|
|
},
|
|
|
input: {
|
|
|
user: userInfo.code,
|
|
|
- name: userInfo.name
|
|
|
+ name: userInfo.name,
|
|
|
},
|
|
|
userCode: userInfo.code,
|
|
|
login: {
|
|
|
token: localStorage.token,
|
|
|
user: {
|
|
|
id: userInfo.code,
|
|
|
- name: userInfo.name
|
|
|
- }
|
|
|
+ name: userInfo.name,
|
|
|
+ },
|
|
|
},
|
|
|
data: {
|
|
|
- '姓名': crmEmrPatientVo.value.pName,
|
|
|
- '性别': [{code: crmEmrPatientVo.value.sex, name: crmEmrPatientVo.value.sexValue}],
|
|
|
- '年龄': crmEmrPatientVo.value.age,
|
|
|
- '电话号码': crmEmrPatientVo.value.relTel,
|
|
|
- '住址': crmEmrPatientVo.value.detailAdress,
|
|
|
- '身份证号码': crmEmrPatientVo.value.socialNo,
|
|
|
- '家属电话': crmEmrPatientVo.value.relNameTel,
|
|
|
- '首次建卡时间': crmEmrPatientVo.value.createDate,
|
|
|
- '随访医生': [{code: crmEmrPatientVo.value.userIdCode, name: crmEmrPatientVo.value.userName}],
|
|
|
- '病人来源': [{code: crmEmrPatientVo.value.pType, name: crmEmrPatientVo.value.ptName}],
|
|
|
- '管理医生': [{code: crmEmrPatientVo.value.referPhysician, name: crmEmrPatientVo.value.referPhysicianName}],
|
|
|
- '建卡医生': [{code: crmEmrPatientVo.value.creatId, name: crmEmrPatientVo.value.creatIdName}],
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
+ 姓名: crmEmrPatientVo.value.pName,
|
|
|
+ 性别: [
|
|
|
+ {
|
|
|
+ code: crmEmrPatientVo.value.sex,
|
|
|
+ name: crmEmrPatientVo.value.sexValue,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ 年龄: crmEmrPatientVo.value.age,
|
|
|
+ 电话号码: crmEmrPatientVo.value.relTel,
|
|
|
+ 住址: crmEmrPatientVo.value.detailAdress,
|
|
|
+ 身份证号码: crmEmrPatientVo.value.socialNo,
|
|
|
+ 家属电话: crmEmrPatientVo.value.relNameTel,
|
|
|
+ 首次建卡时间: crmEmrPatientVo.value.createDate,
|
|
|
+ 随访医生: [
|
|
|
+ {
|
|
|
+ code: crmEmrPatientVo.value.userIdCode,
|
|
|
+ name: crmEmrPatientVo.value.userName,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ 病人来源: [
|
|
|
+ {
|
|
|
+ code: crmEmrPatientVo.value.pType,
|
|
|
+ name: crmEmrPatientVo.value.ptName,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ 管理医生: [
|
|
|
+ {
|
|
|
+ code: crmEmrPatientVo.value.referPhysician,
|
|
|
+ name: crmEmrPatientVo.value.referPhysicianName,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ 建卡医生: [
|
|
|
+ {
|
|
|
+ code: crmEmrPatientVo.value.creatId,
|
|
|
+ name: crmEmrPatientVo.value.creatIdName,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ };
|
|
|
+};
|
|
|
|
|
|
const handlePrint = () => {
|
|
|
editor.editor.execute("print", {
|
|
|
value: {
|
|
|
showPreview: false,
|
|
|
- }
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
+ },
|
|
|
+ });
|
|
|
+};
|
|
|
|
|
|
const crmEmrPatientVo = ref<any>({
|
|
|
- pId: '',
|
|
|
- pType: '',
|
|
|
- hisMzNo: '',
|
|
|
- hisZyNo: '',
|
|
|
+ pId: "",
|
|
|
+ pType: "",
|
|
|
+ hisMzNo: "",
|
|
|
+ hisZyNo: "",
|
|
|
visitTimes: null,
|
|
|
- userIdCode: '',
|
|
|
- userName: '',
|
|
|
- deptCode: '',
|
|
|
- deptName: '',
|
|
|
- pName: '',
|
|
|
- sex: '',
|
|
|
- sexValue: '',
|
|
|
+ userIdCode: "",
|
|
|
+ userName: "",
|
|
|
+ deptCode: "",
|
|
|
+ deptName: "",
|
|
|
+ pName: "",
|
|
|
+ sex: "",
|
|
|
+ sexValue: "",
|
|
|
age: null,
|
|
|
- relTel: '',
|
|
|
- socialNo: '',
|
|
|
- relNameTel: '',
|
|
|
- chronicDiseaseName: '',
|
|
|
- detailAdress: '',
|
|
|
- createDate: '',
|
|
|
- ptName: '',
|
|
|
+ relTel: "",
|
|
|
+ socialNo: "",
|
|
|
+ relNameTel: "",
|
|
|
+ chronicDiseaseName: "",
|
|
|
+ detailAdress: "",
|
|
|
+ createDate: "",
|
|
|
+ ptName: "",
|
|
|
type: null,
|
|
|
- referPhysician: '',
|
|
|
- referPhysicianName: '',
|
|
|
- creatId: '',
|
|
|
- creatIdName: '',
|
|
|
-})
|
|
|
+ referPhysician: "",
|
|
|
+ referPhysicianName: "",
|
|
|
+ creatId: "",
|
|
|
+ creatIdName: "",
|
|
|
+});
|
|
|
|
|
|
-const treeData = ref<Tree[]>()
|
|
|
+const treeData = ref<Tree[]>();
|
|
|
|
|
|
const selectCrmPatientMiByCode = () => {
|
|
|
queryCrmPatientInfoByCode(textCode.value).then((res: any) => {
|
|
|
- crmEmrPatientVo.value = res
|
|
|
+ crmEmrPatientVo.value = res;
|
|
|
router.push({
|
|
|
- name: 'chronicDiseaseQuestionnaire',
|
|
|
+ name: "chronicDiseaseQuestionnaire",
|
|
|
query: {
|
|
|
- id: textCode.value
|
|
|
- }
|
|
|
- })
|
|
|
- })
|
|
|
-}
|
|
|
+ id: textCode.value,
|
|
|
+ },
|
|
|
+ });
|
|
|
+ });
|
|
|
+};
|
|
|
|
|
|
const queryCrmEmdrData = async (tab: any, event: any) => {
|
|
|
- tabType.value = tab === null ? '0' : tab.props.name
|
|
|
- let type = Number.parseInt(tabType.value)
|
|
|
- selectionStatus.value = false
|
|
|
+ tabType.value = tab === null ? "0" : tab.props.name;
|
|
|
+ let type = Number.parseInt(tabType.value);
|
|
|
+ selectionStatus.value = false;
|
|
|
if (type == 0) {
|
|
|
await getCrmEmrModel().then((res: any) => {
|
|
|
- let tem = [] as Array<emrTemplateType>
|
|
|
+ let tem = [] as Array<emrTemplateType>;
|
|
|
if (res) {
|
|
|
for (let i = 0; i < res.length; i++) {
|
|
|
if (res[i].parent != null) {
|
|
|
- tem.push(res[i])
|
|
|
+ tem.push(res[i]);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- emrTemplateData.value = tem
|
|
|
- })
|
|
|
+ emrTemplateData.value = tem;
|
|
|
+ });
|
|
|
} else {
|
|
|
- crmEmrPatientVo.value['type'] = type
|
|
|
+ crmEmrPatientVo.value["type"] = type;
|
|
|
queryCrmEmrTree(crmEmrPatientVo.value).then((res: any) => {
|
|
|
- treeData.value = res
|
|
|
- })
|
|
|
+ treeData.value = res;
|
|
|
+ });
|
|
|
}
|
|
|
-}
|
|
|
+};
|
|
|
|
|
|
interface Tree {
|
|
|
- [key: string]: any
|
|
|
+ [key: string]: any;
|
|
|
}
|
|
|
|
|
|
-const filterText = ref('')
|
|
|
-const treeRef = useCompRef(ElTree)
|
|
|
+const filterText = ref("");
|
|
|
+const treeRef = useCompRef(ElTree);
|
|
|
|
|
|
const defaultProps = {
|
|
|
- children: 'children',
|
|
|
- label: 'name',
|
|
|
-}
|
|
|
+ children: "children",
|
|
|
+ label: "name",
|
|
|
+};
|
|
|
|
|
|
-watch(filterText, (val) => {
|
|
|
- treeRef.value!.filter(val)
|
|
|
-})
|
|
|
+watch(filterText, val => {
|
|
|
+ treeRef.value!.filter(val);
|
|
|
+});
|
|
|
|
|
|
const filterNode = (value: string, data: Tree) => {
|
|
|
- if (!value) return true
|
|
|
- return data.name.includes(value)
|
|
|
-}
|
|
|
+ if (!value) return true;
|
|
|
+ return data.name.includes(value);
|
|
|
+};
|
|
|
|
|
|
const handleNodeClick = (node: any, object: any, event: any) => {
|
|
|
- selectionStatus.value = true
|
|
|
- editor.editor.setEditorMode('readonly')
|
|
|
+ selectionStatus.value = true;
|
|
|
+ editor.editor.setEditorMode("readonly");
|
|
|
editor.loadAndSetDocument({
|
|
|
- documentId: node.emrDocumentId
|
|
|
- })
|
|
|
-}
|
|
|
+ documentId: node.emrDocumentId,
|
|
|
+ });
|
|
|
+};
|
|
|
|
|
|
-let tempDocument = null
|
|
|
+let tempDocument = null;
|
|
|
|
|
|
onDeactivated(() => {
|
|
|
- tempDocument = editor.editor.getDocument()
|
|
|
-})
|
|
|
+ tempDocument = editor.editor.getDocument();
|
|
|
+});
|
|
|
|
|
|
onActivated(async () => {
|
|
|
- const id = router.currentRoute.value.query.id as string
|
|
|
+ const id = router.currentRoute.value.query.id as string;
|
|
|
if (id) {
|
|
|
if (textCode.value !== id) {
|
|
|
- tempDocument = null
|
|
|
+ tempDocument = null;
|
|
|
}
|
|
|
- textCode.value = id
|
|
|
- selectCrmPatientMiByCode()
|
|
|
+ textCode.value = id;
|
|
|
+ selectCrmPatientMiByCode();
|
|
|
}
|
|
|
- await nextTick()
|
|
|
- useEmrInit(emrDivRef.value, {appContext, event: emrEvent}).then((res: any) => {
|
|
|
- editor = res
|
|
|
- if (tempDocument) {
|
|
|
- editor.editor.setDocument(tempDocument)
|
|
|
- tempDocument = null
|
|
|
+ await nextTick();
|
|
|
+ useEmrInit(emrDivRef.value, { appContext, event: emrEvent }).then(
|
|
|
+ (res: any) => {
|
|
|
+ editor = res;
|
|
|
+ if (tempDocument) {
|
|
|
+ editor.editor.setDocument(tempDocument);
|
|
|
+ tempDocument = null;
|
|
|
+ }
|
|
|
}
|
|
|
- })
|
|
|
-})
|
|
|
+ );
|
|
|
+});
|
|
|
|
|
|
onMounted(async () => {
|
|
|
- await queryCrmEmdrData(null, null)
|
|
|
-})
|
|
|
-
|
|
|
+ await queryCrmEmdrData(null, null);
|
|
|
+});
|
|
|
</script>
|