Procházet zdrojové kódy

修改名称以及修复电子病历强制改变值的问题

xiaochan před 2 roky
rodič
revize
9b8bf7b504

+ 8 - 0
src/api/inpatient/patient.js

@@ -16,6 +16,14 @@ export function getPatientInfo(inpatientNo) {
     })
 }
 
+export function getPatientAll(patNo, times) {
+    return request({
+        url: '/patient/getPatientAll',
+        method: 'get',
+        params: {patNo, times},
+    })
+}
+
 export function getDisPatient(patNo, times) {
     return request({
         url: '/patient/getDisPatient',

+ 7 - 5
src/components/zhu-yuan-yi-sheng/emr/EmrSidebar.vue

@@ -1,12 +1,12 @@
 <template>
-  <div style="width: 215px">
+  <div>
     <el-input v-model="filterText"
               placeholder="节点过滤"
               style="width: 100%"
               @input="filterChange" clearable/>
     <el-radio-group v-model="templateType" @change="typeChange">
-      <el-radio-button :disabled="!editor" :label="0">全院</el-radio-button>
-      <el-radio-button :disabled="!editor" :label="1">科室</el-radio-button>
+      <el-radio-button v-if="props.isCreate" :disabled="!editor" :label="0">全院</el-radio-button>
+      <el-radio-button v-if="props.isCreate" :disabled="!editor" :label="1">科室</el-radio-button>
       <el-radio-button :label="2">当前</el-radio-button>
       <el-radio-button :label="3">历史</el-radio-button>
     </el-radio-group>
@@ -19,7 +19,6 @@
                :filter-node-method="filterNode"
                :data="hisData"
                @node-click="hisClick">
-
       </el-tree>
       <el-tree v-show="templateType !== 3"
                :data="treeData"
@@ -93,6 +92,10 @@ const props = defineProps({
   },
   doctorGrade: {
     type: Number
+  },
+  isCreate: {
+    type: Boolean,
+    default: true
   }
 })
 
@@ -526,7 +529,6 @@ onMounted(() => {
     getEmrTree().then((res) => {
       returnData.emrTree = res.all
       returnData.deptTree = res.dept
-      console.log(returnData.emrTree)
     })
   } else {
     templateType = 2

+ 65 - 65
src/components/zhu-yuan-yi-sheng/emr/EmrSnippet.vue

@@ -1,52 +1,52 @@
 <template>
-    <div style="height: max-content">
-        <el-input v-model="filterText" placeholder="节点过滤" @input="filterChange" clearable/>
-        <div :style="{maxHeight : maxHeight - 50 + 'px'}"
-             style="overflow: auto;max-width: 294px" class="down-tree">
-            <el-tree :data="snippetData"
-                     :props="defaultProps"
-                     @node-click="handleNodeClick"
-                     node-key="_id"
-                     ref="treeRef"
-                     highlight-current
-                     :filter-node-method="filterNode"
-                     @node-contextmenu="fragmentPreview"
-                     :expand-on-click-node="false"
-                     default-expand-all>
-                <template #default="{ node, data }">
-                    <el-icon>
-                        <Folder v-if="data.children"/>
-                        <Document v-else/>
-                    </el-icon>
-                    {{ data.name }}
-                </template>
-            </el-tree>
-        </div>
-        <el-dialog v-model="dialog" title="效果预览" top="2%" width="60%">
-            <div>
-                <iframe src="/emr/runtime/#/editor"
-                        style="width: 100%"
-                        :style="{height: getWindowSize.h / 1.2 + 'px'}"
-                        ref="emrRef"/>
-            </div>
-        </el-dialog>
+  <div style="height: max-content">
+    <el-input v-model="filterText" placeholder="节点过滤" @input="filterChange" clearable/>
+    <div :style="{maxHeight : maxHeight - 50 + 'px'}"
+         style="overflow: auto;max-width: 294px" class="down-tree">
+      <el-tree :data="snippetData"
+               :props="defaultProps"
+               @node-click="handleNodeClick"
+               node-key="_id"
+               ref="treeRef"
+               highlight-current
+               :filter-node-method="filterNode"
+               @node-contextmenu="fragmentPreview"
+               :expand-on-click-node="false"
+               default-expand-all>
+        <template #default="{ node, data }">
+          <el-icon>
+            <Folder v-if="data.children"/>
+            <Document v-else/>
+          </el-icon>
+          {{ data.name }}
+        </template>
+      </el-tree>
     </div>
+    <el-dialog v-model="dialog" title="效果预览" top="2%" width="60%">
+      <div>
+        <iframe src="/emr/runtime/#/editor"
+                style="width: 100%"
+                :style="{height: getWindowSize.h / 1.2 + 'px'}"
+                ref="emrRef"/>
+      </div>
+    </el-dialog>
+  </div>
 </template>
 
 <script setup name='EmrSnippet'>
 
 import {getWindowSize} from "@/utils/window-size";
 import {
-    emrConfig,
-    EMRInteractive
+  emrConfig,
+  EMRInteractive
 } from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/emr-init";
 import {getSnippetTree} from "@/api/zhu-yuan-yi-sheng/emr-patient";
 
 
 const props = defineProps({
-    maxHeight: {
-        type: Number
-    }
+  maxHeight: {
+    type: Number
+  }
 })
 
 const emit = defineEmits(['nodeClick'])
@@ -60,64 +60,64 @@ let treeRef = $ref('')
 
 
 const defaultProps = {
-    children: 'children',
-    label: 'name',
+  children: 'children',
+  label: 'name',
 }
 
 
 const editorEvents = {
-    'ready': (event) => {
-        currentEmr.value.callMethod('setDocument', selectedData, true, true)
-    }
+  'ready': (event) => {
+    currentEmr.value.callMethod('setDocument', selectedData, true, true)
+  }
 }
 
 const emrRef = ref(null)
 const currentEmr = ref(null)
 
 const filterChange = (val) => {
-    treeRef.filter(val)
+  treeRef.filter(val)
 }
 
 const filterNode = (value, data) => {
-    if (!value) return true
-    return data.name.includes(value)
+  if (!value) return true
+  return data.name.includes(value)
 }
 
 const handleNodeClick = (node, object, event) => {
-    if (node.content) {
-        emit('nodeClick', node)
-    }
+  if (node.content) {
+    emit('nodeClick', node)
+  }
 }
 
 const fragmentPreview = (event, data, node) => {
-    selectedData = data
-    dialog = true
-    if (currentEmr.value !== null) {
-        currentEmr.value.callMethod('setDocument', selectedData, true, true)
-    } else {
-        nextTick(() => {
-            currentEmr.value = new EMRInteractive(patientData, editorEvents);
-            emrRef.value.parentElement.emr = currentEmr.value
-        });
-
-    }
+  selectedData = data
+  dialog = true
+  if (currentEmr.value !== null) {
+    currentEmr.value.callMethod('setDocument', selectedData, true, true)
+  } else {
+    nextTick(() => {
+      currentEmr.value = new EMRInteractive(patientData, editorEvents);
+      emrRef.value.parentElement.emr = currentEmr.value
+    });
+
+  }
 }
 
 const setPatientData = (val) => {
-    patientData = val
+  patientData = val
 }
 
 
 onMounted(() => {
-    if (emrConfig.value.editor) {
-        getSnippetTree().then((res) => {
-            snippetData = res
-        })
-    }
+  if (emrConfig.value.editor) {
+    getSnippetTree().then((res) => {
+      snippetData = res
+    })
+  }
 })
 
 defineExpose({
-    setPatientData
+  setPatientData
 })
 
 </script>

+ 3 - 3
src/components/zhu-yuan-yi-sheng/emr/auxiliary-tools/fluorescence-test/FluorescenceTest.vue

@@ -1,7 +1,7 @@
 <script setup name='FluorescenceTest'>
 import {getFluorescenceSpecimenResult} from "@/api/zhu-yuan-yi-sheng/emr-patient";
 import {getWindowSize} from "@/utils/window-size";
-import {encrypt} from "@/utils/public";
+import {chineseEncrypt} from "@/utils/public";
 import {emrCopyFunc} from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/emr-init";
 
 const {patNo, times} = defineProps({
@@ -47,7 +47,7 @@ const copyClick = () => {
   for (const key in refMap) {
     let item = refMap[key]
     if (item.checked) {
-      let data = encrypt.decrypt(item.getAttribute("data"))
+      let data = chineseEncrypt.decrypt(item.getAttribute("data"))
       temp += `检测项目:${data.CheckItem} 结果值:${data.Result} 参考值:${data.Reference},`
     }
   }
@@ -163,7 +163,7 @@ onMounted(() => {
                            style="cursor: pointer"
                            @click.stop
                            :ref="(el) => setRefMap(el, value + index)"
-                           :data="encrypt.encrypt(item)"/>
+                           :data="chineseEncrypt.encrypt(item)"/>
                   </td>
                   <td>
                     {{ item.CheckItem }}

+ 10 - 10
src/components/zhu-yuan-yi-sheng/shou-shu-shen-qing/BianJiShouShu.vue

@@ -223,6 +223,7 @@ import XcComboGrid from "@/components/xiao-chan/combo-grid/XcComboGrid.vue";
 import XcElOption from "@/components/xiao-chan/xc-el-option/XcElOption.vue";
 import XEUtils from 'xe-utils'
 import {xcMessage} from "@/utils/xiaochan-element-plus";
+import {isDev} from "@/utils/public";
 
 const props = defineProps({
   anestheticMode: {
@@ -246,26 +247,25 @@ const queryOperation = (val) => {
 
 const selectOpRow = ref({})
 const designateASurgeonInChief = ref([])
-const clickToSelectSurgery = (val) => {
+const clickToSelectSurgery = async (val) => {
   disabledOpScale.value = false
-  // 01.5922
-  // 39.5000x031
   selectOpRow.value = val
 
-  getDoctorByOpCode(val.code).then(res => {
+  if (isDev) {
+    let res = await getDoctorByOpCode(val.code)
     designateASurgeonInChief.value = res
     yiShengShuJu.value = res
     if (designateASurgeonInChief.value.length > 0) {
       xcMessage.warning('医务部锁定手术主刀医生无法修改');
     }
-  })
-
-  if (val.opScale !== null) {
-    disabledOpScale.value = true
-    props.data.opScale = gradeToCode(val.opScale)
-    xcMessage.warning('医务部锁定手术等级无法修改')
+    if (val.opScale !== null) {
+      disabledOpScale.value = true
+      props.data.opScale = gradeToCode(val.opScale)
+      xcMessage.warning('医务部锁定手术等级无法修改')
+    }
   }
 
+
   buildOrderName()
 }
 

+ 6 - 1
src/router/modules/dashboard.js

@@ -14,7 +14,12 @@ const route = [
         hideMenu: true,
         meta: {title: '电子病历', hideTabs: true},
     },
-
+    {
+        path: '/myEmrView/:patNo?/:times?/:inTheHospital?',
+        component: createNameComponent(() => import('@/views/emr-view/EmrView.vue')),
+        hideMenu: true,
+        meta: {title: '电子病历查阅', hideTabs: true, passRule: true},
+    },
     {
         path: '/triageRoomScreen',
         component: createNameComponent(() => import('@/views/clinic/triage/RoomScreen.vue')),

+ 1 - 1
src/utils/public.js

@@ -79,7 +79,7 @@ export function compareVersion(version1, version2) {
 }
 
 
-export const encrypt = {
+export const chineseEncrypt = {
     encrypt: (val) => {
         if (stringIsBlank(val)) {
             return "";

+ 112 - 114
src/views/emr-manage/EmrSuggestion.vue

@@ -1,68 +1,66 @@
 <template>
-    <page-layer>
-        <template #header>
-            <el-select v-model="select" @change="query">
-                <el-option v-for="item in selectList"
-                           :key="item.code"
-                           :label="item.name"
-                           :value="item.code"/>
+  <page-layer>
+    <template #header>
+      <el-select v-model="select" @change="query">
+        <el-option v-for="item in selectList"
+                   :key="item.code"
+                   :label="item.name"
+                   :value="item.code"/>
+      </el-select>
+      <el-button @click="querySelectClick" type="primary">查询</el-button>
+    </template>
+
+    <template #main="{size}">
+      <xc-table :local-data="suggestionList"
+                :final-height="size.height - 50"
+                @row-click="rowClick">
+        <el-table-column prop="linkName" label="环节名称">
+          <template #default="{row}">
+            <el-input v-model="row.linkName" v-if="row.$edit" maxlength="20"/>
+          </template>
+        </el-table-column>
+
+        <el-table-column prop="name" label="名称">
+          <template #default="{row}">
+            <el-input v-model="row.name" v-if="row.$edit" maxlength="100"/>
+          </template>
+        </el-table-column>
+
+        <el-table-column prop="emrCode" label="病历编码">
+          <template #default="{row}">
+            <el-input v-model="row.emrCode" v-if="row.$edit" maxlength="100"/>
+          </template>
+        </el-table-column>
+
+        <el-table-column prop="scoringCriteriaName" label="评分">
+          <template #default="{row}">
+            <el-select v-model="row.scoringCriteria"
+                       v-if="row.$edit">
+              <el-option v-for="item in scoringCriteriaList"
+                         :key="item.code"
+                         :label="item.name"
+                         :value="item.code"/>
             </el-select>
-            <el-button @click="querySelectClick" type="primary">查询</el-button>
-        </template>
-
-        <template #main="{size}">
-            <xc-table :local-data="suggestionList"
-                      :final-height="size.height - 50"
-                      @row-click="rowClick"
-            >
-                <el-table-column prop="linkName" label="环节名称">
-                    <template #default="{row}">
-                        <el-input v-model="row.linkName" v-if="row.$edit" maxlength="20"/>
-                    </template>
-                </el-table-column>
-
-                <el-table-column prop="name" label="名称">
-                    <template #default="{row}">
-                        <el-input v-model="row.name" v-if="row.$edit" maxlength="100"/>
-                    </template>
-                </el-table-column>
-
-                <el-table-column prop="emrCode" label="病历编码">
-                    <template #default="{row}">
-                        <el-input v-model="row.emrCode" v-if="row.$edit" maxlength="100"/>
-                    </template>
-                </el-table-column>
-
-                <el-table-column prop="scoringCriteriaName" label="评分">
-                    <template #default="{row}">
-                        <el-select v-model="row.scoringCriteria"
-                                   v-if="row.$edit">
-                            <el-option v-for="item in scoringCriteriaList"
-                                       :key="item.code"
-                                       :label="item.name"
-                                       :value="item.code"/>
-                        </el-select>
-                        <span v-else>
+            <span v-else>
                             {{ getScoringCriteriaName(row.scoringCriteria) }}
                         </span>
-                    </template>
-                </el-table-column>
-
-                <el-table-column>
-                    <template #header>
-                        <el-button text type="primary" @click="newClick">新增</el-button>
-                    </template>
-                    <template #default="{row,$index}">
-                        <el-button v-if="row.id" @click="reviseClick(row)" type="warning">修改</el-button>
-                        <el-button v-else @click="addToClick(row)" type="primary">添加</el-button>
-                        <el-button @click="delClick(row,$index)" type="danger">删除</el-button>
-                    </template>
-                </el-table-column>
-
-            </xc-table>
-        </template>
-
-    </page-layer>
+          </template>
+        </el-table-column>
+
+        <el-table-column>
+          <template #header>
+            <el-button text type="primary" @click="newClick">新增</el-button>
+          </template>
+          <template #default="{row,$index}">
+            <el-button v-if="row.id" @click="reviseClick(row)" type="warning">修改</el-button>
+            <el-button v-else @click="addToClick(row)" type="primary">添加</el-button>
+            <el-button @click="delClick(row,$index)" type="danger">删除</el-button>
+          </template>
+        </el-table-column>
+      </xc-table>
+    </template>
+
+  </page-layer>
 </template>
 
 <script setup name='EmrSuggestion'>
@@ -79,91 +77,91 @@ const select = ref('')
 const suggestionList = ref([])
 
 const query = () => {
-    getLinkQuality(select.value).then(res => {
-        suggestionList.value = res
-    })
+  getLinkQuality(select.value).then(res => {
+    suggestionList.value = res
+  })
 }
 
 let tempData = {
-    $edit: false
+  $edit: false
 }
 const rowClick = (val) => {
-    tempData.$edit = false
-    val.$edit = true
-    tempData = val
+  tempData.$edit = false
+  val.$edit = true
+  tempData = val
 }
 
 const reviseClick = (val) => {
-    verifyTheData(val)
-    revise(val)
+  verifyTheData(val)
+  revise(val)
 }
 
 const newClick = () => {
-    let temp = {
-        id: null,
-        name: '',
-        emrCode: select.value,
-        scoringCriteria: 1,
-        linkName: suggestionList.value[0].linkName
-    }
-    suggestionList.value.push(temp)
-    rowClick(temp)
+  let temp = {
+    id: null,
+    name: '',
+    emrCode: select.value,
+    scoringCriteria: 1,
+    linkName: suggestionList.value[0].linkName
+  }
+  suggestionList.value.push(temp)
+  rowClick(temp)
 }
 
 const addToClick = (val) => {
-    verifyTheData(val)
-    addTo(val).then(() => {
-        query()
-    })
+  verifyTheData(val)
+  addTo(val).then(() => {
+    query()
+  })
 }
 
 const delClick = (row, index) => {
-    if (row.id) {
-        deleteById(row).then(() => {
-            query()
-        })
-    } else {
-        suggestionList.value.splice(index, 1)
-    }
+  if (row.id) {
+    deleteById(row).then(() => {
+      query()
+    })
+  } else {
+    suggestionList.value.splice(index, 1)
+  }
 
 }
 
 const verifyTheData = (val) => {
-    if (stringIsBlank(val.name)) {
-        BizException(ExceptionEnum.MESSAGE_ERROR, '名称,不能为空');
-    }
-    if (stringIsBlank(val.emrCode)) {
-        BizException(ExceptionEnum.MESSAGE_ERROR, '病历编码,不能为空');
-    }
-    if (stringIsBlank(val.linkName)) {
-        BizException(ExceptionEnum.MESSAGE_ERROR, '病历编码,不能为空');
-    }
+  if (stringIsBlank(val.name)) {
+    BizException(ExceptionEnum.MESSAGE_ERROR, '名称,不能为空');
+  }
+  if (stringIsBlank(val.emrCode)) {
+    BizException(ExceptionEnum.MESSAGE_ERROR, '病历编码,不能为空');
+  }
+  if (stringIsBlank(val.linkName)) {
+    BizException(ExceptionEnum.MESSAGE_ERROR, '病历编码,不能为空');
+  }
 }
 
 
 function getScoringCriteriaName(val) {
-    if (val == null) return "";
-    switch (val) {
-        case 1:
-            return "轻";
-        case 2:
-            return "中";
-        case 3:
-            return "重";
-        default:
-            return "";
-    }
+  if (val == null) return "";
+  switch (val) {
+    case 1:
+      return "轻";
+    case 2:
+      return "中";
+    case 3:
+      return "重";
+    default:
+      return "";
+  }
 }
 
 const querySelectClick = () => {
-    getLinkSelect().then(res => {
-        selectList.value = res
-    })
+  getLinkSelect().then(res => {
+    selectList.value = res
+  })
 }
 
 
 onMounted(() => {
-    querySelectClick()
+  querySelectClick()
 })
 
 </script>

+ 90 - 0
src/views/emr-view/EmrView.vue

@@ -0,0 +1,90 @@
+<script setup lang="ts">
+import {nextTick, onMounted, ref} from "vue";
+import {useRouter} from "vue-router";
+import {getPatientAll} from '../../api/inpatient/patient'
+import HuanZheXinXi from "@/components/zhu-yuan-yi-sheng/HuanZheXinXi.vue";
+import EmrSidebar from "@/components/zhu-yuan-yi-sheng/emr/EmrSidebar.vue";
+import {EMRInteractive} from "@/views/emr-view/emr-initialize";
+import EmrAuxiliaryTools from "@/components/zhu-yuan-yi-sheng/emr/auxiliary-tools/EmrAuxiliaryTools.vue";
+
+const router = useRouter()
+const patInfo = ref({})
+const isShow = ref(false)
+const iframeRef = ref<HTMLHtmlElement>()
+
+let editor = null
+let nodeVal = null
+
+enum message {
+  '页面准备完成' = "页面准备完成",
+  "病历切换" = "病历切换",
+}
+
+const emrEvent = {
+  'loaded': (event) => {
+    if (nodeVal != null) {
+      sendAMessage(message.病历切换, nodeVal);
+    }
+  },
+  'ready': () => {
+    // @ts-ignore
+    editor = iframeRef.value.parentElement.emr.editor
+  }
+}
+
+const winHeight = ref(window.innerHeight)
+let caseHistoryUrl = ref('/emr/runtime/#/editor')
+
+const patientInfoIsShow = (val) => {
+  winHeight.value = window.innerHeight - (val ? 124 : 16)
+}
+
+const sendAMessage = (str, data = null) => {
+  window.parent.postMessage({name: str, data}, '*');
+}
+
+const nodeClick = (val) => {
+  nodeVal = val
+  caseHistoryUrl.value = `/emr/runtime/?documentId=${val.documentId}`
+}
+
+
+onMounted(async () => {
+  patInfo.value = await getPatientAll(router.currentRoute.value.params.patNo, router.currentRoute.value.params.times)
+  isShow.value = true
+  sendAMessage(message.页面准备完成)
+  await nextTick()
+  // @ts-ignore
+  iframeRef.value.parentElement.emr = new EMRInteractive({}, emrEvent)
+})
+
+
+</script>
+
+<template>
+  <el-container v-if="isShow">
+    <el-header style="height: max-content;">
+      <huan-zhe-xin-xi
+          :huan-zhe-xin-xi="patInfo"
+          @isShow="patientInfoIsShow"/>
+    </el-header>
+    <el-container>
+      <el-aside style="width: 200px">
+        <emr-sidebar ref="emrSidebarRef"
+                     @nodeClick="nodeClick"
+                     :maxHeight="winHeight"
+                     :isCreate="false"
+                     :huan-zhe-xin-xi="patInfo"/>
+      </el-aside>
+      <el-main>
+        <emr-auxiliary-tools :pat-info="patInfo"/>
+        <iframe ref="iframeRef" :src="caseHistoryUrl" style="width: 100%; height: 100%"/>
+      </el-main>
+    </el-container>
+
+  </el-container>
+</template>
+
+<style scoped lang="scss">
+
+</style>

+ 22 - 0
src/views/emr-view/emr-initialize.ts

@@ -0,0 +1,22 @@
+export function EMRInteractive(data, editorEvent) {
+    this.setEditor = (editor, runtime) => {
+        this.editor = editor;
+        this.runtime = runtime;
+        if (editorEvent !== null) {
+            for (let key in editorEvent) {
+                editor.on(key, function (...args) {
+                    editorEvent[key](...args)
+                })
+            }
+        }
+    };
+
+    this.getEditor = () => {
+        return this.editor
+    }
+
+    this.getAppContext = () => {
+        return {}
+    };
+
+}

+ 4 - 17
src/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/EmrMain.vue

@@ -33,6 +33,7 @@
       <emr-auxiliary-tools :pat-info="props.huanZheXinXi"
                            @to-fill-in-data="clickToFillInData"
                            :emr-data="patientData"/>
+
       <el-button @click="drgIntelligentGrouping"
                  type="primary"
                  title="drg的预分组">
@@ -1046,6 +1047,7 @@ const clickSnippet = async ({content, styles, code}) => {
   // 移动到文档结尾
   editor.setCursor('DOCUMENT_END');
   editor.scrollToCursor()
+  console.log(data)
   let insertContent = {
     // 内容
     value: content,
@@ -1055,6 +1057,7 @@ const clickSnippet = async ({content, styles, code}) => {
     // 就是在这里填充的值
     defaultData: data,
   }
+  console.log(insertContent)
   editor.setRevisionMode('off')
   editor.execute("insertContents", insertContent);
   if (isReadonly) {
@@ -1231,7 +1234,7 @@ const reQueryPatientInformation = () => {
   // 如果是只读模式就不触发这个
   if (!readonlyPattern()) {
     // 如果没有文档 id 就说明是
-    if (documentId) {
+    if (documentId && extractData) {
       editor.setValues(extractData, true, true)
     }
   }
@@ -1293,22 +1296,6 @@ const doctorLevelFunc = () => {
   createLevel = emrEditCreateLimit.getDoctorLevelById(createId)
 }
 
-function grade(userCode) {
-  if (needRule(1)) {
-    doctorLevel = 3
-  }
-  if (extractFields('管床医生编码') === userCode) {
-    return 1;
-  }
-  if (extractFields('主治医生编码') === userCode) {
-    return 2
-  }
-  if (extractFields('主任医生编码') === userCode) {
-    return 3
-  }
-  return 1
-}
-
 
 // 提取字段
 const extractFields = (val) => {

+ 7 - 7
src/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/emr-edit-create-limit.js

@@ -17,17 +17,17 @@ export class EmrEditCreateLimit {
      */
     getDoctorLevelById(userCode) {
         let pat = this.patInfo
-        if (userCode === pat.referPhysician) {
-            return 1;
-        }
-        if (userCode === pat.consultPhysician) {
-            return 2;
+        if (needRule(1)) {
+            return 3;
         }
         if (userCode === pat.deptDirector) {
             return 3;
         }
-        if (needRule(1)) {
-            return 3;
+        if (userCode === pat.consultPhysician) {
+            return 2;
+        }
+        if (userCode === pat.referPhysician) {
+            return 1;
         }
         return 1;
     }

+ 4 - 1
src/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/emr-init.js

@@ -119,7 +119,10 @@ export const emrConfig = ref({
 // 默认查询的是全部的患者  state == 1 自己科室的患者
 export function getEmrUrl(patNo, times, state = 3) {
     let query = {
-        patNo, times, state: state, maxTimes: 1
+        patNo,
+        times,
+        state,
+        maxTimes: 1
     }
     let temp = JSON.stringify(query)
     return window.location.origin + '/myEmrEditor/' + window.btoa(temp) + '/refresh'