xiaochan před 2 roky
rodič
revize
5a55ba6245

+ 1 - 1
index.html

@@ -12,7 +12,7 @@
     <script src="https://mapv.baidu.com/build/mapv.min.js"></script>
 
 
-    <title></title>
+    <title>工作集成平台</title>
 </head>
 <body>
 <div id="app"></div>

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 3 - 9233
package-lock.json


+ 7 - 0
src/api/zhu-yuan-yi-sheng/emr-patient.js

@@ -34,3 +34,10 @@ export function existCourseRecord(patNo, times) {
     })
 }
 
+export function queryWhetherThePatientHasASpecifiedMedicalRecord(data) {
+    return request({
+        url: url + 'queryWhetherThePatientHasASpecifiedMedicalRecord',
+        method: 'post',
+        data
+    })
+}

+ 0 - 1
src/components/xc/table-v3/XcTableV3.vue

@@ -411,7 +411,6 @@ let tableHeader = $ref([])
 
 onMounted(() => {
   nextTick(() => {
-
     selectInputRef.value.addEventListener('input', () => {
       performASearch()
       showOptions = true

+ 0 - 100
src/components/zhu-yuan-yi-sheng/emr/EmrMain.vue

@@ -1,100 +0,0 @@
-<template>
-  <div class="emr-iframe" v-loading="loaded">
-    <iframe id="emrIframe"
-            ref="emrRef"
-            :src="caseHistoryUrl"/>
-  </div>
-</template>
-
-<script setup name='EmrMain'>
-import {getEmrInpatientData} from "@/api/dictionary/emr-data-maintenance-api";
-import {huanZheXinXi} from "@/views/hospitalization/zhu-yuan-yi-sheng/public-js/zhu-yuan-yi-sheng";
-import {EMRInteractive} from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-init";
-import store from "@/store";
-
-let caseHistoryUrl = $ref('')
-
-let patientData = $ref({})
-let loaded = $ref(true)
-let patientId = $ref('')
-let isEditorChange = $(false)
-let times = $ref(0)
-
-const emrRef = ref(null)
-const currentEmr = ref(null)
-
-onMounted(() => {
-  nextTick(async () => {
-    patientData = await getEmrInpatientData({
-      patNo: huanZheXinXi.value.inpatientNo,
-      times: huanZheXinXi.value.admissTimes
-    })
-    getCurrentPersonnelInformation(patientData)
-    patientId = huanZheXinXi.value.inpatientNo
-    currentEmr.value = new EMRInteractive(patientData, editorEvents);
-    emrRef.value.parentElement.emr = currentEmr.value
-    window.addEventListener('beforeunload', monitorPageRefresh)
-
-
-  })
-})
-
-
-let test = () => {
-
-}
-
-let emrEvent = [
-  {
-    loaded: (evt, view) => {
-      console.log(evt, view)
-    }
-  }
-]
-
-
-const monitorPageRefresh = (event) => {
-  if (isEditorChange) {
-    event.returnValue = false;
-  }
-}
-
-const editorEvents = ({name}, fragment) => {
-  if (name === 'loaded') {
-    loaded = false
-    if (times !== huanZheXinXi.value.admissTimes) {
-      // 如果住院次数不一致 那么就是历史记录 那就只能只读了
-      currentEmr.value.callMethod('setEditorMode', 'readonly')
-    } else {
-      // 设置成编辑模式
-      currentEmr.value.callMethod('setEditorMode', 'free')
-    }
-    // currentEmr.value.callMethod('setReviewMode', reviewMode)
-
-  } else if (name === 'contentchange') {
-    // 判断内容是否改变
-    isEditorChange = true
-    // emrSidebarRef.changeTemplateType(2)
-  }
-}
-
-const getCurrentPersonnelInformation = (data) => {
-  let userData = store.state.user.info
-
-  patientData.user_selection = [{code: userData.code, name: userData.name}]
-  patientData.user_code = userData.code
-  patientData.user_name = userData.name
-
-  patientData.user_dept_selection = [{code: userData.deptCode, name: userData.deptName}]
-  patientData.user_dept_code = userData.deptCode
-  patientData.user_dept_name = userData.deptName
-
-  patientData.user_token = userData.token
-
-}
-
-</script>
-
-<style scoped>
-
-</style>

+ 52 - 28
src/components/zhu-yuan-yi-sheng/emr/EmrSidebar.vue

@@ -13,17 +13,7 @@
            :filter-node-method="filterNode"
            default-expand-all>
     <template #default="{ node, data }">
-      <span v-if="templateType === 2">
-        <span v-if="data.children">
-        {{ data.name }}
-        </span>
-        <span v-else>
-        {{ data.name }}/{{ data.modifyDate ? data.modifyDate : data.createDate }}
-        </span>
-      </span>
-      <span v-else>
-        {{ data.name }}
-      </span>
+      {{ data.name }}
     </template>
   </el-tree>
 </template>
@@ -31,8 +21,8 @@
 <script setup name='EmrSidebar'>
 import {getEmrTree} from "@/api/zhu-yuan-yi-sheng/emr-api";
 import {huanZheXinXi} from "@/views/hospitalization/zhu-yuan-yi-sheng/public-js/zhu-yuan-yi-sheng";
-import {getPatientData} from "@/api/zhu-yuan-yi-sheng/emr-patient";
-import {courseOfDisease} from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-init";
+import {getPatientData, queryWhetherThePatientHasASpecifiedMedicalRecord} from "@/api/zhu-yuan-yi-sheng/emr-patient";
+import {BizException, ExceptionEnum} from "@/utils/BizException";
 
 const emit = defineEmits(['nodeClick', 'typeChange'])
 
@@ -50,8 +40,24 @@ const defaultProps = {
 
 let templateType = $ref(0)
 
-const handleNodeClick = (val, property, event) => {
+const handleNodeClick = async (val, property, event) => {
   let str = JSON.stringify(val)
+
+  if (val.code) {
+    // 根据 这个编码来限制是不是唯一一个
+    if (val.code.includes('【唯一】') && templateType !== 2) {
+      let flag = await queryWhetherThePatientHasASpecifiedMedicalRecord({
+        patNo: huanZheXinXi.value.inpatientNo,
+        times: huanZheXinXi.value.admissTimes,
+        emrCategoryCode: val.code
+      })
+
+      if (flag) {
+        BizException(ExceptionEnum.LOGICAL_ERROR, '此病历只能填写一次。')
+      }
+    }
+  }
+
   if (val.roundTime) {
     emit('nodeClick', val, property.parent.data, templateType);
   } else {
@@ -114,25 +120,42 @@ const deleteTheSpecifiedNode = (id) => {
   }
 }
 
-const diseaseDurationRecordTime = ({ward_round_time}) => {
-  if (ward_round_time) {
-    let roundTimes = []
-    for (let i = 0; i < ward_round_time.length; i++) {
-      roundTimes.push({
-        name: '查房时间' + ward_round_time[i].value,
-        value: ward_round_time[i].value,
-        roundTime: true
-      })
+let findNode = false
+const diseaseDurationRecordTime = (ward_round_time, name, id) => {
+  if (!ward_round_time) {
+    return
+  }
+  let roundTimes = []
+  for (let i = 0; i < ward_round_time.length; i++) {
+    let item = ward_round_time[i]
+    roundTimes.push({
+      name: item.element.name + item.value,
+      value: item.value,
+      roundTime: true,
+      code: name
+    })
+  }
+  findNode = false
+  寻找病历根据文档id(id, roundTimes, returnData.patientTree)
+}
+
+const 寻找病历根据文档id = (id, roundTimes, list) => {
+  for (let i = 0, len = list.length; i < len; i++) {
+    if (findNode) return;
+    let item = list[i]
+    if (item.emrDocumentId === id) {
+      findNode = true
+      item.children = roundTimes
+      return
     }
-    for (let i = 0; i < returnData.patientTree.length; i++) {
-      let item = returnData.patientTree[i];
-      if (item.emrCategoryCode === courseOfDisease) {
-        item.children = roundTimes
-      }
+
+    if (item.children) {
+      寻找病历根据文档id(id, roundTimes, item.children)
     }
   }
 }
 
+
 const queryData = () => {
   getEmrTree(huanZheXinXi.value.inpatientNo, huanZheXinXi.value.admissTimes).then((res) => {
     if (res.patientTree?.length > 0) {
@@ -142,6 +165,7 @@ const queryData = () => {
       treeData = res.emrTree
     }
     returnData = res
+    console.log(res)
   })
 }
 

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

@@ -39,13 +39,20 @@ let selectedData = {}
 let filterText = $ref('')
 let treeRef = $ref('')
 
-let executeLoad = true
 
 const defaultProps = {
   children: 'children',
   label: 'name',
 }
 
+const editorEvents = {
+  'loaded': (event) => {
+    if (!currentEmr.value) {
+      currentEmr.value.callMethod('setDocument', selectedData, true, true)
+    }
+  }
+}
+
 const emrRef = ref(null)
 const currentEmr = ref(null)
 
@@ -65,7 +72,6 @@ const handleNodeClick = (node, object, event) => {
 }
 
 const fragmentPreview = (event, data, node) => {
-  // console.log(event, data, node)
   selectedData = data
   dialog = true
   if (currentEmr.value) {
@@ -78,15 +84,6 @@ const fragmentPreview = (event, data, node) => {
   }
 }
 
-const editorEvents = ({name}) => {
-  if (executeLoad) {
-    if (name === 'loaded') {
-      executeLoad = false
-      currentEmr.value.callMethod('setDocument', selectedData, true, true)
-    }
-  }
-
-}
 
 onMounted(() => {
   getSnippet().then((res) => {

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

@@ -51,14 +51,11 @@
         </el-col>
         <el-col :span="12">
           <el-form-item label="术前诊断" prop="diagBeforeCode">
-            <!--    TODO  v2 选择器中我绑定了 value 是对象记得搞      -->
-            <XcSelectV2
-                v-model="data"
-                :data="shouShuZhenDuan"
-                value="diagBeforeCode"
-                label="diagBeforeOp"
-                :remote-method="souSuoZhenDuan"
-            />
+            <xc-table-v3 v-model="data"
+                         :data="shouShuZhenDuan"
+                         code="diagBeforeCode"
+                         name="diagBeforeOp"
+                         :remote-method="souSuoZhenDuan"/>
             <el-switch
                 v-model="zhenDuanLaiYuan"
                 :active-value="true"
@@ -85,160 +82,106 @@
         </el-col>
         <el-col :span="12">
           <el-form-item label="手术部位" prop="partCodeObj">
-            <el-select v-model="data.partCodeObj" :remote-method="souSuoBuWei" clearable filterable remote
-                       style="width: 220px" @change="huoQuXialaKuangMing">
-              <el-option v-for="item in shouShuBuWeiShuJu" :key="item.code" :label="item.name"
-                         :value="{label:item.name,value:item.code,laiYuan:'手术部位'}">
-                <span style="color: #8492a6; font-size: 12px">{{ item.code }}</span>
-                <el-divider direction="vertical"></el-divider>
-                <span>{{ item.name }}</span>
-              </el-option>
-            </el-select>
+            <xc-table-v3 v-model="data" code="partCode" name="partCodeName"
+                         :data="shouShuBuWeiShuJu"
+                         :remote-method="souSuoBuWei" clearable/>
           </el-form-item>
         </el-col>
         <el-col :span="12">
           <el-form-item label="手术等级" prop="opScale">
-            <el-select v-model="data.opScale" :remote-method="souSuoBuWei" clearable filterable remote
-                       style="width: 220px" @change="huoQuXialaKuangMing">
-              <el-option v-for="item in shouShuDengJi" :key="item.code" :label="item.name"
-                         :value="item.code">
-                <span style="color: #8492a6; font-size: 12px">{{ item.code }}</span>
-                <el-divider direction="vertical"></el-divider>
-                <span>{{ item.name }}</span>
-              </el-option>
-            </el-select>
+            <xc-table-v3 v-model="data" code="opScale" name="opScaleName" :data="shouShuDengJi">
+              <xc-table-column label="编码" prop="code"/>
+              <xc-table-column label="名称" prop="name"/>
+            </xc-table-v3>
           </el-form-item>
         </el-col>
         <el-col :span="12">
           <el-form-item label="麻醉方式">
-            <el-select v-model="data.hocusCodeObj" clearable filterable style="width: 220px"
-                       @change="huoQuXialaKuangMing">
-              <el-option v-for="item in maZuiFangShiShuJu" :key="item.code" :label="item.name"
-                         :value="{label:item.name,value:item.code,laiYuan:'麻醉方式'}">
-                <span style="color: #8492a6; font-size: 12px">{{ item.code }}</span>
-                <el-divider direction="vertical"></el-divider>
-                <span>{{ item.name }}</span>
-              </el-option>
-            </el-select>
+            <xc-table-v3 v-model="data" code="hocusCode" name="hocusCodeName" :data="maZuiFangShiShuJu"/>
           </el-form-item>
         </el-col>
         <el-col :span="12">
           <el-form-item label="主刀医生" prop="doctorZdObj">
-            <el-select v-model="data.doctorZdObj" :remote-method="suoSouYiShen" clearable filterable remote
-                       style="width: 220px" @change="huoQuXialaKuangMing">
-              <el-option v-for="item in yiShengShuJu" :key="item.code" :label="item.name"
-                         :value="{label:item.name,value:item.code,laiYuan:'主刀医生'}">
-                <span style="color: #8492a6; font-size: 12px">{{ item.code }}</span>
-                <el-divider direction="vertical"></el-divider>
-                <span style="color:#67C23A">{{ item.name }}</span>
-                <el-divider direction="vertical"></el-divider>
-                <span style="color:#E6A23C">{{ item.deptName }}</span>
-                <el-divider direction="vertical"></el-divider>
-                <span style="color:#a5673f">{{ item.empTitName }}</span>
-              </el-option>
-            </el-select>
+            <xc-table-v3 v-model="data" code="doctorZd" name="doctorZdName"
+                         :remote-method="suoSouYiShen" clearable
+                         :data="yiShengShuJu">
+              <xc-table-column label="编码" prop="code"/>
+              <xc-table-column label="姓名" prop="name"/>
+              <xc-table-column label="科室" prop="deptName"/>
+              <xc-table-column label="级别" prop="empTitName"/>
+            </xc-table-v3>
           </el-form-item>
         </el-col>
         <el-col :span="12">
           <el-form-item label="第一助手">
-            <el-select v-model="data.doctor1Obj" :remote-method="suoSouYiShen" clearable filterable remote
-                       style="width: 220px" @change="huoQuXialaKuangMing">
-              <el-option v-for="item in yiShengShuJu" :key="item.code" :label="item.name"
-                         :value="{label:item.name,value:item.code,laiYuan:'第一助手'}">
-                <span style="color: #8492a6; font-size: 12px">{{ item.code }}</span>
-                <el-divider direction="vertical"></el-divider>
-                <span style="color:#67C23A">{{ item.name }}</span>
-                <el-divider direction="vertical"></el-divider>
-                <span style="color:#E6A23C">{{ item.deptName }}</span>
-                <el-divider direction="vertical"></el-divider>
-                <span style="color:#a5673f">{{ item.empTitName }}</span>
-              </el-option>
-            </el-select>
+            <xc-table-v3 v-model="data" code="doctor1" name="doctor1Name"
+                         :remote-method="suoSouYiShen" clearable
+                         :data="yiShengShuJu">
+              <xc-table-column label="编码" prop="code"/>
+              <xc-table-column label="姓名" prop="name"/>
+              <xc-table-column label="科室" prop="deptName"/>
+              <xc-table-column label="级别" prop="empTitName"/>
+            </xc-table-v3>
           </el-form-item>
         </el-col>
         <el-col :span="12">
           <el-form-item label="第二助手">
-            <el-select v-model="data.doctor2Obj" :remote-method="suoSouYiShen" clearable filterable remote
-                       style="width: 220px" @change="huoQuXialaKuangMing">
-              <el-option v-for="item in yiShengShuJu" :key="item.code" :label="item.name"
-                         :value="{label:item.name,value:item.code,laiYuan:'第二助手'}">
-                <span style="color: #8492a6; font-size: 12px">{{ item.code }}</span>
-                <el-divider direction="vertical"></el-divider>
-                <span style="color:#67C23A">{{ item.name }}</span>
-                <el-divider direction="vertical"></el-divider>
-                <span style="color:#E6A23C">{{ item.deptName }}</span>
-                <el-divider direction="vertical"></el-divider>
-                <span style="color:#a5673f">{{ item.empTitName }}</span>
-              </el-option>
-            </el-select>
+            <xc-table-v3 v-model="data" code="doctor2" name="doctor2Name"
+                         :remote-method="suoSouYiShen" clearable
+                         :data="yiShengShuJu">
+              <xc-table-column label="编码" prop="code"/>
+              <xc-table-column label="姓名" prop="name"/>
+              <xc-table-column label="科室" prop="deptName"/>
+              <xc-table-column label="级别" prop="empTitName"/>
+            </xc-table-v3>
           </el-form-item>
         </el-col>
         <el-col :span="12">
           <el-form-item label="第三助手">
-            <el-select v-model="data.doctor3Obj" :remote-method="suoSouYiShen" clearable filterable remote
-                       style="width: 220px" @change="huoQuXialaKuangMing">
-              <el-option v-for="item in yiShengShuJu" :key="item.code" :label="item.name"
-                         :value="{label:item.name,value:item.code,laiYuan:'第三助手'}">
-                <span style="color: #8492a6; font-size: 12px">{{ item.code }}</span>
-                <el-divider direction="vertical"></el-divider>
-                <span style="color:#67C23A">{{ item.name }}</span>
-                <el-divider direction="vertical"></el-divider>
-                <span style="color:#E6A23C">{{ item.deptName }}</span>
-                <el-divider direction="vertical"></el-divider>
-                <span style="color:#a5673f">{{ item.empTitName }}</span>
-              </el-option>
-            </el-select>
+            <xc-table-v3 v-model="data" code="doctor3" name="doctor3Name"
+                         :remote-method="suoSouYiShen" clearable
+                         :data="yiShengShuJu">
+              <xc-table-column label="编码" prop="code"/>
+              <xc-table-column label="姓名" prop="name"/>
+              <xc-table-column label="科室" prop="deptName"/>
+              <xc-table-column label="级别" prop="empTitName"/>
+            </xc-table-v3>
           </el-form-item>
         </el-col>
         <el-col :span="12">
           <el-form-item label="麻醉医生">
-            <el-select v-model="data.doctorMzObj" :remote-method="suoSouYiShen" clearable filterable remote
-                       style="width: 220px" @change="huoQuXialaKuangMing">
-              <el-option v-for="item in yiShengShuJu" :key="item.code" :label="item.name"
-                         :value="{label:item.name,value:item.code,laiYuan:'麻醉医生'}">
-                <span style="color: #8492a6; font-size: 12px">{{ item.code }}</span>
-                <el-divider direction="vertical"></el-divider>
-                <span style="color:#67C23A">{{ item.name }}</span>
-                <el-divider direction="vertical"></el-divider>
-                <span style="color:#E6A23C">{{ item.deptName }}</span>
-                <el-divider direction="vertical"></el-divider>
-                <span style="color:#a5673f">{{ item.empTitName }}</span>
-              </el-option>
-            </el-select>
+            <xc-table-v3 v-model="data" code="doctorMz" name="doctorMzName"
+                         :remote-method="suoSouYiShen" clearable
+                         :data="yiShengShuJu">
+              <xc-table-column label="编码" prop="code"/>
+              <xc-table-column label="姓名" prop="name"/>
+              <xc-table-column label="科室" prop="deptName"/>
+              <xc-table-column label="级别" prop="empTitName"/>
+            </xc-table-v3>
           </el-form-item>
         </el-col>
         <el-col :span="12">
           <el-form-item label="器械护士">
-            <el-select v-model="data.nurseQxObj" :remote-method="suoSouYiShen" clearable filterable remote
-                       style="width: 220px" @change="huoQuXialaKuangMing">
-              <el-option v-for="item in yiShengShuJu" :key="item.code" :label="item.name"
-                         :value="{label:item.name,value:item.code,laiYuan:'器械护士'}">
-                <span style="color: #8492a6; font-size: 12px">{{ item.code }}</span>
-                <el-divider direction="vertical"></el-divider>
-                <span style="color:#67C23A">{{ item.name }}</span>
-                <el-divider direction="vertical"></el-divider>
-                <span style="color:#E6A23C">{{ item.deptName }}</span>
-                <el-divider direction="vertical"></el-divider>
-                <span style="color:#a5673f">{{ item.empTitName }}</span>
-              </el-option>
-            </el-select>
+            <xc-table-v3 v-model="data" code="nurseQx" name="nurseQxName"
+                         :remote-method="suoSouYiShen" clearable
+                         :data="yiShengShuJu">
+              <xc-table-column label="编码" prop="code"/>
+              <xc-table-column label="姓名" prop="name"/>
+              <xc-table-column label="科室" prop="deptName"/>
+              <xc-table-column label="级别" prop="empTitName"/>
+            </xc-table-v3>
           </el-form-item>
         </el-col>
         <el-col :span="12">
           <el-form-item label="巡回护士">
-            <el-select v-model="data.nurseXhObj" :remote-method="suoSouYiShen" clearable filterable remote
-                       style="width: 220px" @change="huoQuXialaKuangMing">
-              <el-option v-for="item in yiShengShuJu" :key="item.code" :label="item.name"
-                         :value="{label:item.name,value:item.code,laiYuan:'巡回护士'}">
-                <span style="color: #8492a6; font-size: 12px">{{ item.code }}</span>
-                <el-divider direction="vertical"></el-divider>
-                <span style="color:#67C23A">{{ item.name }}</span>
-                <el-divider direction="vertical"></el-divider>
-                <span style="color:#E6A23C">{{ item.deptName }}</span>
-                <el-divider direction="vertical"></el-divider>
-                <span style="color:#a5673f">{{ item.empTitName }}</span>
-              </el-option>
-            </el-select>
+            <xc-table-v3 v-model="data" code="nurseXh" name="nurseXhName"
+                         :remote-method="suoSouYiShen" clearable
+                         :data="yiShengShuJu">
+              <xc-table-column label="编码" prop="code"/>
+              <xc-table-column label="姓名" prop="name"/>
+              <xc-table-column label="科室" prop="deptName"/>
+              <xc-table-column label="级别" prop="empTitName"/>
+            </xc-table-v3>
           </el-form-item>
         </el-col>
         <el-col :span="12">
@@ -272,192 +215,178 @@
   </el-dialog>
 </template>
 
-<script>
+<script setup name="BianJiShouShu">
 import {onMounted, ref, unref} from "vue";
 import {huoQuLinChuangZhenDuan} from "@/api/zhu-yuan-yi-sheng/jian-yan-jian-cha-shen-qing";
 import {huoQuShouShuBuWei} from "@/api/zhu-yuan-yi-sheng/shou-shu-shen-qing";
 import {getRenYuan, maZuiFangShi} from "@/api/public-api";
 import moment from "moment";
 import {ElMessage, ElMessageBox} from "element-plus";
+import XcTableV3 from "@/components/xc/table-v3/XcTableV3";
+import XcTableColumn from "@/components/xc/table-v3/XcTableColumn";
 
-export default {
-  name: "BianJiShouShu",
-  emits: ['qu-xiao'],
-  setup(props, cxt) {
-    const data = ref({});
-    const dialog = ref(false)
-    const zhenDuanLaiYuan = ref(1)
-    const zhenDuanDangQianYe = ref(1)
+const emit = defineEmits(['qu-xiao'])
 
-    // 手术部位
-    const shouShuBuWeiShuJu = ref([])
-    // 手术诊断
-    const shouShuZhenDuan = ref([])
-    // 麻醉方式
-    const maZuiFangShiShuJu = ref([])
-    // 医生信息
-    const yiShengShuJu = ref([])
+const data = ref({});
+const dialog = ref(false)
+const zhenDuanLaiYuan = ref(1)
+const zhenDuanDangQianYe = ref(1)
 
+// 手术部位
+const shouShuBuWeiShuJu = ref([])
+// 手术诊断
+const shouShuZhenDuan = ref([])
+// 麻醉方式
+const maZuiFangShiShuJu = ref([])
+// 医生信息
+const yiShengShuJu = ref([])
 
-    // 搜索手术部位
-    const souSuoBuWei = (val) => {
-      if (val.length > 1) {
-        huoQuShouShuBuWei(val).then((res) => {
-          shouShuBuWeiShuJu.value = res
-        })
-      }
-    }
 
-    // 搜索诊断
-    const souSuoZhenDuan = (val) => {
-      if (val.length > 1) {
-        huoQuLinChuangZhenDuan(val, zhenDuanLaiYuan.value).then(res => {
-          shouShuZhenDuan.value = res
-        })
-      }
-    }
-
-    const zhenDuanFanYe = (val) => {
-      zhenDuanDangQianYe.value = val
-    }
-    // 搜索医生
-    const suoSouYiShen = (val) => {
-      if (val.length > 1) {
-        getRenYuan(val).then(res => {
-          yiShengShuJu.value = res
-        })
-      }
-    }
+// 搜索手术部位
+const souSuoBuWei = (val) => {
+  if (val.length > 1) {
+    huoQuShouShuBuWei(val).then((res) => {
+      shouShuBuWeiShuJu.value = res
+    })
+  }
+}
 
-    const huoQuXialaKuangMing = (val) => {
-      switch (val.laiYuan) {
-        case '麻醉方式':
-          data.value.hocusCode = val.value
-          data.value.hocusCodeName = val.label
-          return;
-        case '主刀医生':
-          data.value.doctorZd = val.value
-          data.value.doctorZdName = val.label
-          return;
-        case '第一助手':
-          data.value.doctor1 = val.value
-          data.value.doctor1Name = val.label
-          return;
-        case '第二助手':
-          data.value.doctor2 = val.value
-          data.value.doctor2Name = val.label
-          return;
-        case '第三助手':
-          data.value.doctor3 = val.value
-          data.value.doctor3Name = val.label
-          return;
-        case '麻醉医生':
-          data.value.doctorMz = val.value
-          data.value.doctorMzName = val.label
-          return;
-        case '器械护士':
-          data.value.nurseQx = val.value
-          data.value.nurseQxName = val.label
-          return;
-        case '巡回护士':
-          data.value.nurseXh = val.value
-          data.value.nurseXhName = val.label
-          return;
-        case '手术部位':
-          data.value.partCode = val.value
-          data.value.partCodeName = val.label
-          return;
-      }
-    }
+// 搜索诊断
+const souSuoZhenDuan = (val) => {
+  if (val.length > 1) {
+    huoQuLinChuangZhenDuan(val, zhenDuanLaiYuan.value).then(res => {
+      shouShuZhenDuan.value = res
+    })
+  }
+}
 
-    const huoQuShuJu = (val) => {
-      data.value = val
-      dialog.value = true
-    }
+const zhenDuanFanYe = (val) => {
+  zhenDuanDangQianYe.value = val
+}
+// 搜索医生
+const suoSouYiShen = (val) => {
+  if (val.length > 1) {
+    getRenYuan(val).then(res => {
+      yiShengShuJu.value = res
+    })
+  }
+}
 
-    const shouShuBiaoGe = ref()
+const huoQuXialaKuangMing = (val) => {
+  switch (val.laiYuan) {
+    case '麻醉方式':
+      data.value.hocusCode = val.value
+      data.value.hocusCodeName = val.label
+      return;
+    case '主刀医生':
+      data.value.doctorZd = val.value
+      data.value.doctorZdName = val.label
+      return;
+    case '第一助手':
+      data.value.doctor1 = val.value
+      data.value.doctor1Name = val.label
+      return;
+    case '第二助手':
+      data.value.doctor2 = val.value
+      data.value.doctor2Name = val.label
+      return;
+    case '第三助手':
+      data.value.doctor3 = val.value
+      data.value.doctor3Name = val.label
+      return;
+    case '麻醉医生':
+      data.value.doctorMz = val.value
+      data.value.doctorMzName = val.label
+      return;
+    case '器械护士':
+      data.value.nurseQx = val.value
+      data.value.nurseQxName = val.label
+      return;
+    case '巡回护士':
+      data.value.nurseXh = val.value
+      data.value.nurseXhName = val.label
+      return;
+    case '手术部位':
+      data.value.partCode = val.value
+      data.value.partCodeName = val.label
+      return;
+  }
+}
 
-    // 时间校验
-    const shenQingShiJian = (rule, value, callback) => {
-      const oDate1 = moment(value).format('YYYY-MM-DD HH:mm:ss')
-      const oDate2 = moment(data.value.applyDate).format('YYYY-MM-DD HH:mm:ss')
-      if (moment(oDate1).isBefore(moment(oDate2))) {
-        callback(new Error('手术时间不能小于申请时间'))
-      } else {
-        callback()
-      }
-    }
+const huoQuShuJu = (val) => {
+  data.value = val
+  dialog.value = true
+}
 
-    // 校验数据
-    const jiaoYanGuiZe = ref({
-      opCode: [{required: true, message: '项目编码不能为空', trigger: 'blur'}],
-      opName: [{required: true, message: '项目名称不能为空', trigger: 'blur'}],
-      applyDate: [{required: true, message: '申请时间不能为空', trigger: 'blur'}],
-      opDatetime: [{required: true, message: '手术时间不能为空', trigger: 'blur'},
-        {validator: shenQingShiJian, trigger: 'blur'}],
-      diagBeforeCode: [{required: true, message: '术前诊断不能为空', trigger: 'blur'}],
-      partCodeObj: [{required: true, message: '手术部位不能为空', trigger: 'blur'}],
-      doctorZdObj: [{required: true, message: '主刀医生不能为空', trigger: 'blur'}],
-      opScale: [{required: true, message: '手术等级不能为空', trigger: 'blur'}],
-    })
 
+const shouShuBiaoGe = ref()
 
-    const jiaoYanShuJu = async () => {
-      const form = unref(shouShuBiaoGe);
-      if (!form) return
-      try {
-        await form.validate()
-        dialog.value = false
-      } catch (e) {
-        ElMessage.error('请检查数据。')
-      }
-    }
+// 时间校验
+const shenQingShiJian = (rule, value, callback) => {
+  const oDate1 = moment(value).format('YYYY-MM-DD HH:mm:ss')
+  const oDate2 = moment(data.value.applyDate).format('YYYY-MM-DD HH:mm:ss')
+  if (moment(oDate1).isBefore(moment(oDate2))) {
+    callback(new Error('手术时间不能小于申请时间'))
+  } else {
+    callback()
+  }
+}
 
-    const quXiaoBianJi = async () => {
-      await ElMessageBox.confirm('点击取消您的手术申请将会被删除。', '提示', {
-        type: 'warning',
-        confirmButtonText: '退出并删除',
-      }).then(() => {
-        cxt.emit('qu-xiao', data.value.opCode, -1)
-        dialog.value = false
-      }).catch((e) => {
-      })
+// 校验数据
+const jiaoYanGuiZe = ref({
+  opCode: [{required: true, message: '项目编码不能为空', trigger: 'blur'}],
+  opName: [{required: true, message: '项目名称不能为空', trigger: 'blur'}],
+  applyDate: [{required: true, message: '申请时间不能为空', trigger: 'blur'}],
+  opDatetime: [{required: true, message: '手术时间不能为空', trigger: 'blur'},
+    {validator: shenQingShiJian, trigger: 'blur'}],
+  diagBeforeCode: [{required: true, message: '术前诊断不能为空', trigger: 'blur'}],
+  partCode: [{required: true, message: '手术部位不能为空', trigger: 'blur'}],
+  doctorZd: [{required: true, message: '主刀医生不能为空', trigger: 'blur'}],
+  opScale: [{required: true, message: '手术等级不能为空', trigger: 'blur'}],
+})
 
-    }
 
-    onMounted(() => {
-      maZuiFangShi().then(res => {
-        maZuiFangShiShuJu.value = res
-      })
-    })
-    return {
-      data,
-      dialog,
-      shouShuBuWeiShuJu,
-      souSuoBuWei,
-      shouShuZhenDuan,
-      souSuoZhenDuan,
-      zhenDuanLaiYuan,
-      zhenDuanDangQianYe,
-      zhenDuanFanYe,
-      maZuiFangShiShuJu,
-      yiShengShuJu,
-      suoSouYiShen,
-      huoQuXialaKuangMing,
-      huoQuShuJu,
-      jiaoYanShuJu,
-      jiaoYanGuiZe,
-      shouShuBiaoGe,
-      quXiaoBianJi,
-      shouShuDengJi: [
-        {code: 1, name: '四级'},
-        {code: 2, name: '三级'},
-        {code: 3, name: '二级'},
-        {code: 4, name: '一级'},
-      ]
-    }
+const jiaoYanShuJu = async () => {
+  const form = unref(shouShuBiaoGe);
+  if (!form) return
+  try {
+    await form.validate()
+    dialog.value = false
+  } catch (e) {
+    ElMessage.error('请检查数据。')
   }
 }
+
+const quXiaoBianJi = async () => {
+  await ElMessageBox.confirm('点击取消您的手术申请将会被删除。', '提示', {
+    type: 'warning',
+    confirmButtonText: '退出并删除',
+  }).then(() => {
+    emit('qu-xiao', data.value.opCode, -1)
+    dialog.value = false
+  }).catch((e) => {
+  })
+
+}
+
+onMounted(() => {
+  maZuiFangShi().then(res => {
+    maZuiFangShiShuJu.value = res
+  })
+})
+
+const shouShuDengJi = [
+  {code: 1, name: '四级'},
+  {code: 2, name: '三级'},
+  {code: 3, name: '二级'},
+  {code: 4, name: '一级'},
+]
+
+
+defineExpose({
+  huoQuShuJu
+})
+
 </script>
 
 <style scoped>

+ 50 - 56
src/components/zhu-yuan-yi-sheng/shou-shu-shen-qing/DaYingShouShuShengQingDan.vue

@@ -1,5 +1,5 @@
 <template>
-  <el-main :style="zuJianDaXiao">
+  <div :style="zuJianDaXiao">
     纸张:
     <el-radio v-model="zhiZhang" :label="1" size="large">A4</el-radio>
     <el-radio v-model="zhiZhang" :label="2" size="large">A5</el-radio>
@@ -141,71 +141,65 @@
         </div>
       </div>
     </div>
-  </el-main>
+  </div>
 </template>
 
-<script>
+<script setup name="DaYingShouShuShengQingDan">
 import {computed, onMounted, ref} from "vue";
 import {cptSex} from "@/utils/computed";
 import {getLodop, initLodop} from "@/utils/c-lodop";
 import {ElMessage} from "element-plus";
 
-export default {
-  name: "DaYingShouShuShengQingDan",
-  props: {
-    width: {
-      type: Number,
-      default: 560,
-    },
-    height: {
-      type: Number,
-      default: 500,
-    }
+
+const props = defineProps({
+  width: {
+    type: Number,
+    default: 560,
   },
-  setup(props, ctx) {
-    const zuJianDaXiao = computed(() => {
-      return {
-        width: props.width + 'px',
-        height: props.height + 'px',
-      }
-    })
-    const zhiZhang = ref(2)
-    const data = ref('')
-    const css = '*{font-size:16px}.tanXingHeZiHeng{display:flex;justify-content:space-between;margin-top:3pt;padding:0 3.75pt}.tanXingHeZiHeng2{display:flex;margin-top:3pt;padding:0 3.75pt}.tanXingHeZiShu{display:flex;flex-direction:column}.wen-zi{display:flex;margin-top:3pt;margin-left:5px;height:25px}.wen-zi div:first-child{display:flex;flex-direction:row;justify-content:center;text-align:right}.wen-zi div:nth-child(2){margin-left:3pt;display:table}.ge-zi{display:table-column}'
-
-
-    const daYing = () => {
-      if (!data) {
-        return ElMessage.error('请先选择患者')
-      }
-      let LODOP = getLodop()
-      const strFormHtml = '<style>' + css + '</style>' + '<body>' + document.getElementById('daYing').innerHTML + '</body>';
-      LODOP.PRINT_INIT(0, 0, 522, 333, '检查申请') // 初始化打印机 名字
-      // LODOP.SET_PRINT_MODE("PRINT_PAGE_PERCENT", "Full-Width");
-      // 整宽不变形
-      if (zhiZhang.value === 1) {
-        LODOP.SET_PRINT_PAGESIZE(2, 0, 0, 'A4')   // 设置纸张大小  A
-      } else {
-        LODOP.SET_PRINT_PAGESIZE(1, 0, 0, 'A5')
-      }
-      LODOP.ADD_PRINT_HTM(0, 0, '100%', '100%', strFormHtml) //  参数分别为顶边距,左边距,宽,高,打印项内容。
-      // LODOP.PRINT_DESIGN()
-      LODOP.PREVIEW() // 关闭
-    }
-
-    onMounted(() => {
-      initLodop()
-    })
-
-    return {
-      zuJianDaXiao,
-      zhiZhang,
-      data,
-      cptSex,
-      daYing
-    }
+  height: {
+    type: Number,
+    default: 500,
+  }
+})
+
+const zuJianDaXiao = computed(() => {
+  return {
+    width: props.width + 'px',
+    height: props.height + 'px',
+    overflow: 'auto'
+  }
+})
+const zhiZhang = ref(2)
+const data = ref('')
+const css = '*{font-size:16px}.tanXingHeZiHeng{display:flex;justify-content:space-between;margin-top:3pt;padding:0 3.75pt}.tanXingHeZiHeng2{display:flex;margin-top:3pt;padding:0 3.75pt}.tanXingHeZiShu{display:flex;flex-direction:column}.wen-zi{display:flex;margin-top:3pt;margin-left:5px;height:25px}.wen-zi div:first-child{display:flex;flex-direction:row;justify-content:center;text-align:right}.wen-zi div:nth-child(2){margin-left:3pt;display:table}.ge-zi{display:table-column}'
+
+const daYing = () => {
+  if (!data) {
+    return ElMessage.error('请先选择患者')
   }
+  let LODOP = getLodop()
+  const strFormHtml = '<style>' + css + '</style>' + '<body>' + document.getElementById('daYing').innerHTML + '</body>';
+  LODOP.PRINT_INIT(0, 0, 522, 333, '检查申请') // 初始化打印机 名字
+  // LODOP.SET_PRINT_MODE("PRINT_PAGE_PERCENT", "Full-Width");
+  // 整宽不变形
+  if (zhiZhang.value === 1) {
+    LODOP.SET_PRINT_PAGESIZE(2, 0, 0, 'A4')   // 设置纸张大小  A
+  } else {
+    LODOP.SET_PRINT_PAGESIZE(1, 0, 0, 'A5')
+  }
+  LODOP.ADD_PRINT_HTM(0, 0, '100%', '100%', strFormHtml) //  参数分别为顶边距,左边距,宽,高,打印项内容。
+  // LODOP.PRINT_DESIGN()
+  LODOP.PREVIEW() // 关闭
 }
+
+onMounted(() => {
+  initLodop()
+})
+
+defineExpose({
+  daYing
+})
+
 </script>
 
 <style scoped>

+ 95 - 85
src/views/dictionary/EmrDataMaintenance.vue

@@ -1,91 +1,100 @@
 <template>
-  测试用住院号:
-  <el-input v-model="editData.data.patNo" @blur="editData.data.patNo = $event.target.value.trim()" style="width: 120px;"
-            placeholder="请输入住院号"/>
-  测试用住院次数:
-  <el-input-number style="width: 120px;" :min="1" :precision="0" v-model="editData.data.times"
-                   placeholder="请输入住院次数"/>
-  <el-button @click="openDialog(true,null)">新增数据</el-button>
-  <el-button @click="testWhetherPatientDataIsNormal">测试全部数据</el-button>
-  <xc-table :data="data" @currentChange="queryChange" @sizeChange="queryChange">
-    <el-table-column label="操作" width="120">
-      <template #default="scope">
-        <el-button type="warning" round icon="Edit" @click="openDialog(false,scope.row)"></el-button>
-        <el-button type="danger" round icon="Delete" @click="clickDelete(scope.row)"></el-button>
-      </template>
-    </el-table-column>
-    <!--    <el-table-column prop="delFlag" label="删除" width="30"/>-->
-    <el-table-column prop="id" label="uuid" width="40"/>
-    <el-table-column prop="name" label="数据名称" width="80" show-overflow-tooltip/>
-    <el-table-column prop="sqlSentence" label="语句内容" show-overflow-tooltip/>
-  </xc-table>
-
-  <el-drawer v-model="editData.dialog"
-             :title="editData.title"
-             @closed="close"
-             size="90%">
-    <el-row>
-
-      <el-col :span="12">
-        <el-form :model="editData.data" :label-width="90" :rules="rules" ref="formRef">
-
-          <el-form-item prop="patNo" label="住院号">
-            <el-input v-model="editData.data.patNo" @blur="editData.data.patNo = $event.target.value.trim()"
-                      placeholder="请输入住院号"/>
-          </el-form-item>
-
-          <el-form-item prop="patNo" label="住院次数">
-            <el-input-number style="width: 100%;" :min="1" :precision="0" v-model="editData.data.times"
-                             placeholder="请输入住院次数"/>
-          </el-form-item>
-
-          <el-form-item prop="name" label="名称">
-            <el-input v-model="editData.data.name" @blur="editData.data.name = $event.target.value.trim()"
-                      placeholder="请输入名称"/>
-          </el-form-item>
-
-          <el-form-item prop="dataType" label="数据类型">
-            <el-radio-group v-model="editData.data.dataType">
-              <el-radio :label="0">对象</el-radio>
-              <el-radio :label="1">数组</el-radio>
-            </el-radio-group>
-          </el-form-item>
-
-          <el-form-item prop="groupName" label="分组名称" v-if="editData.data.dataType === 1">
-            <el-input v-model="editData.data.groupName" @blur="editData.data.groupName = $event.target.value.trim()"
-                      placeholder="请输入分组名称"/>
-          </el-form-item>
-
-          <el-form-item prop="sqlSentence" label="语句内容">
-            <el-input v-model="editData.data.sqlSentence" type="textarea"
-                      :autosize="{ minRows: 30, maxRows: 40 }"
-                      placeholder="请输入sql语句" @change="editData.passedTheTest = false"/>
-          </el-form-item>
-
-        </el-form>
-      </el-col>
-
-      <el-col :span="12">
-        <JsonViewer :value="checkData" style="height: 100%" copyable :expandDepth="3"/>
-      </el-col>
-
-    </el-row>
-
-
-    <template #footer>
-      <div>
-        <el-button type="primary" plain @click="testSql">测试sql</el-button>
-        <el-button type="primary" @click="confirm">确认</el-button>
-        <el-button @click="close">取消</el-button>
-      </div>
+  <page-layer>
+    <template #header>
+      测试用住院号:
+      <el-input v-model="editData.data.patNo" @blur="editData.data.patNo = $event.target.value.trim()"
+                style="width: 120px;"
+                placeholder="请输入住院号"/>
+      测试用住院次数:
+      <el-input-number style="width: 120px;" :min="1" :precision="0" v-model="editData.data.times"
+                       placeholder="请输入住院次数"/>
+      <el-button @click="openDialog(true,null)">新增数据</el-button>
+      <el-button @click="testWhetherPatientDataIsNormal">测试全部数据</el-button>
+    </template>
+
+    <template #main>
+      <xc-table :data="data" @currentChange="queryChange" @sizeChange="queryChange" :height="200">
+        <el-table-column label="默认值">
+          <el-table-column label="操作" width="120">
+            <template #default="scope">
+              <el-button type="warning" round icon="Edit" @click="openDialog(false,scope.row)"></el-button>
+              <el-button type="danger" round icon="Delete" @click="clickDelete(scope.row)"></el-button>
+            </template>
+          </el-table-column>
+          <!--    <el-table-column prop="delFlag" label="删除" width="30"/>-->
+          <el-table-column prop="id" label="uuid" width="40"/>
+          <el-table-column prop="name" label="数据名称" width="80" show-overflow-tooltip/>
+          <el-table-column prop="sqlSentence" label="语句内容" show-overflow-tooltip/>
+        </el-table-column>
+      </xc-table>
     </template>
-  </el-drawer>
 
+    <el-drawer v-model="editData.dialog"
+               :title="editData.title"
+               @closed="close"
+               size="90%">
+      <el-row>
+
+        <el-col :span="12">
+          <el-form :model="editData.data" :label-width="90" :rules="rules" ref="formRef">
+
+            <el-form-item prop="patNo" label="住院号">
+              <el-input v-model="editData.data.patNo" @blur="editData.data.patNo = $event.target.value.trim()"
+                        placeholder="请输入住院号"/>
+            </el-form-item>
+
+            <el-form-item prop="patNo" label="住院次数">
+              <el-input-number style="width: 100%;" :min="1" :precision="0" v-model="editData.data.times"
+                               placeholder="请输入住院次数"/>
+            </el-form-item>
+
+            <el-form-item prop="name" label="名称">
+              <el-input v-model="editData.data.name" @blur="editData.data.name = $event.target.value.trim()"
+                        placeholder="请输入名称"/>
+            </el-form-item>
+
+            <el-form-item prop="dataType" label="数据类型">
+              <el-radio-group v-model="editData.data.dataType">
+                <el-radio :label="0">对象</el-radio>
+                <el-radio :label="1">数组</el-radio>
+              </el-radio-group>
+            </el-form-item>
+
+            <el-form-item prop="groupName" label="分组名称" v-if="editData.data.dataType === 1">
+              <el-input v-model="editData.data.groupName" @blur="editData.data.groupName = $event.target.value.trim()"
+                        placeholder="请输入分组名称"/>
+            </el-form-item>
+
+            <el-form-item prop="sqlSentence" label="语句内容">
+              <el-input v-model="editData.data.sqlSentence" type="textarea"
+                        :autosize="{ minRows: 30, maxRows: 40 }"
+                        placeholder="请输入sql语句" @change="editData.passedTheTest = false"/>
+            </el-form-item>
+
+          </el-form>
+        </el-col>
+
+        <el-col :span="12">
+          <JsonViewer :value="checkData" style="height: 100%" copyable :expandDepth="3"/>
+        </el-col>
+
+      </el-row>
+
+
+      <template #footer>
+        <div>
+          <el-button type="primary" plain @click="testSql">测试sql</el-button>
+          <el-button type="primary" @click="confirm">确认</el-button>
+          <el-button @click="close">取消</el-button>
+        </div>
+      </template>
+    </el-drawer>
 
-  <el-dialog v-model="returnValue.dialog" title="该患者的数据" draggable>
-    <JsonViewer :value="returnValue.data" style="height: 100%" copyable :expandDepth="3"/>
-  </el-dialog>
+    <el-dialog v-model="returnValue.dialog" title="该患者的数据" draggable>
+      <JsonViewer :value="returnValue.data" style="height: 100%" copyable :expandDepth="3"/>
+    </el-dialog>
 
+  </page-layer>
 </template>
 
 <script setup name='EmrDataMaintenance'>
@@ -97,6 +106,7 @@ import {
   testSqlAPi, updateData
 } from "@/api/dictionary/emr-data-maintenance-api";
 import {ElMessage, ElMessageBox} from "element-plus";
+import PageLayer from "@/layout/PageLayer";
 
 let data = $ref({
   data: [],
@@ -115,8 +125,8 @@ let editData = $ref({
     delFlag: '',
     name: '',
     sqlSentence: '',
-    patNo: '014807',
-    times: 3,
+    patNo: '0409327',
+    times: 1,
     dataType: 0,
     groupName: ''
   }

+ 81 - 0
src/views/hospitalization/zhu-yuan-yi-sheng/Home.vue

@@ -75,6 +75,87 @@ const currentPagePosition = (val) => {
   }
 }
 
+
+const data = [
+  {
+    label: 'Level one 1',
+    children: [
+      {
+        label: 'Level two 1-1',
+        children: [
+          {
+            label: 'Level three 1-1-1',
+          },
+        ],
+      },
+    ],
+  },
+  {
+    label: 'Level one 2',
+    children: [
+      {
+        label: 'Level two 2-1',
+        children: [
+          {
+            label: 'Level three 2-1-1',
+          },
+        ],
+      },
+      {
+        label: 'Level two 2-2',
+        children: [
+          {
+            label: 'Level three 2-2-1',
+          },
+        ],
+      },
+    ],
+  },
+  {
+    label: 'Level one 3',
+    children: [
+      {
+        label: 'Level two 3-1',
+        children: [
+          {
+            label: 'Level three 3-1-1',
+          },
+        ],
+      },
+      {
+        label: 'Level two 3-2',
+        children: [
+          {
+            label: 'Level three 3-2-1',
+          },
+        ],
+      },
+    ],
+  },
+]
+
+let 找到 = false
+
+const 查找 = (id, data) => {
+  if (找到) return;
+  for (let i = 0, len = data.length; i < len; i++) {
+    if (找到) return;
+    let item = data[i]
+    if (item.label === id) {
+      找到 = true
+    }
+
+    if (item.children) {
+      查找(id, item.children)
+    }
+  }
+}
+
+查找('Level three 2-1-1', data)
+
+console.log(data)
+
+
 </script>
 
 <style lang="scss" scoped>

+ 2 - 7
src/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-init.js

@@ -10,15 +10,11 @@ export function EMRInteractive(data, endiorEvent) {
         this.runtime = runtime;
 
         editor.on('loaded', function (event) {
-            endiorEvent(event)
+            endiorEvent[event.name](event)
         })
 
         editor.on('contentchange', function (event) {
-            endiorEvent(event)
-        })
-
-        editor.on('入院诊断', (evt, view) => {
-            console.log(evt, view)
+            endiorEvent[event.name](event)
         })
 
     };
@@ -70,7 +66,6 @@ export function EMRInteractive(data, endiorEvent) {
             BizException(ExceptionEnum.MESSAGE_ERROR, "没有通过校验")
         }
 
-
         this.runtime.saveDocument(data, (res) => {
             insertEmrData(value).then(() => {
                 successfullySaved()

+ 58 - 42
src/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/index.vue

@@ -30,7 +30,6 @@
         <el-row>
 
           <el-col :span="20">
-            <!--            <emr-main/>-->
             <div class="emr-iframe">
               <iframe id="emrIframe"
                       ref="emrRef"
@@ -60,7 +59,7 @@ import {
   courseOfDisease,
   EMRInteractive
 } from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-init";
-import {ElMessage, ElMessageBox} from "element-plus";
+import {ElMessageBox} from "element-plus";
 import {uuid} from "@/utils/getUuid";
 import {BizException, ExceptionEnum} from "@/utils/BizException";
 import router from '@/router'
@@ -74,6 +73,7 @@ const currentEmr = ref(null)
 const emrRef = ref(null)
 
 let categoryCode = $ref('')
+// 文档 id 唯一值
 let documentId = $ref('')
 let patientId = $ref('')
 let categroyId = $ref('')
@@ -91,8 +91,12 @@ let isEditorChange = $ref(false)
 let patientData = $ref({})
 // 是否开启审阅模式
 let reviewMode = $ref(false)
-// 病程记录定位时间
-let localizationDurationTime = $ref('')
+// 跳转定位
+let jumpPositioning = {
+  value: '',
+  // 这里是业务编码
+  code: null
+}
 
 const updateCaseHistoryUrl = (val) => {
   let valCode = val.code ? val.code : val.emrCategoryCode;
@@ -120,6 +124,7 @@ const clickSaveData = async () => {
   waitForLoadingToComplete()
 
   let data = {
+    // 这个是 唯一 id 我是在本地生成的
     emrDocumentId: documentId ? documentId : uuid(31, 62),
     emrCategoryCode: categoryCode,
     patNo: huanZheXinXi.value.inpatientNo,
@@ -176,12 +181,10 @@ const clickDelete = () => {
   ElMessageBox.alert('是否要删除该模板。', '提示', {
     type: 'warning'
   }).then(() => {
-    emrSidebarRef.deleteTheSpecifiedNode(documentId)
-    nodeClick({}, 2)
-    // currentEmr.value.deleteDocument(documentId, function () {
-    //   emrSidebarRef.deleteTheSpecifiedNode(documentId)
-    //   nodeClick({}, 2)
-    // });
+    currentEmr.value.deleteDocument(documentId, function () {
+      emrSidebarRef.deleteTheSpecifiedNode(documentId)
+      nodeClick({}, 2)
+    });
   }).catch(() => {
 
   })
@@ -227,10 +230,13 @@ const checkEmrChange = (cb) => {
 const nodeClick = (val, parent, templateType) => {
   if (val.roundTime) {
     if (documentId === parent.emrDocumentId) {
-      positioningTime(val.value)
+      positioningTime(val.value, val.code)
     } else {
       updateCaseHistoryUrl(parent);
-      localizationDurationTime = val.value
+      jumpPositioning = {
+        value: val.value,
+        code: val.code
+      }
     }
   } else {
     checkEmrChange(() => {
@@ -239,8 +245,8 @@ const nodeClick = (val, parent, templateType) => {
   }
 }
 
-const positioningTime = (val) => {
-  let componentView = currentEmr.value.callMethod('getElementByValue', 'ward_round_time', val);
+const positioningTime = (val, code) => {
+  let componentView = currentEmr.value.callMethod('getElementByValue', code, val);
   if (componentView) {
     componentView.focusEnter();
     currentEmr.value.callMethod('scrollToCursor')
@@ -250,31 +256,6 @@ const positioningTime = (val) => {
 }
 
 
-const editorEvents = ({name}, fragment) => {
-  if (name === 'loaded') {
-    loaded = false
-    if (times !== huanZheXinXi.value.admissTimes) {
-      // 如果住院次数不一致 那么就是历史记录 那就只能只读了
-      currentEmr.value.callMethod('setEditorMode', 'readonly')
-    } else {
-      // 设置成编辑模式
-      currentEmr.value.callMethod('setEditorMode', 'free')
-    }
-    if (localizationDurationTime) {
-      positioningTime(localizationDurationTime)
-      localizationDurationTime = ''
-    }
-    if (categoryCode === courseOfDisease && documentId) {
-      emrSidebarRef.diseaseDurationRecordTime(currentEmr.value.callMethod('getElementsData'));
-    }
-
-  } else if (name === 'contentchange') {
-    // 判断内容是否改变
-    isEditorChange = true
-    emrSidebarRef.changeTemplateType(2)
-  }
-}
-
 const clickBack = () => {
   checkEmrChange(() => {
     router.go(-1)
@@ -291,6 +272,11 @@ const clickSnippet = ({content, styles}) => {
   currentEmr.value.insertSnippet(content, styles, patientData)
 }
 
+
+/**
+ * 获取当前用户的信息
+ * @param data
+ */
 const getCurrentPersonnelInformation = (data) => {
   let userData = store.state.user.info
 
@@ -304,9 +290,39 @@ const getCurrentPersonnelInformation = (data) => {
 
   patientData.user_token = userData.token
 
-  console.log(data)
 }
 
+const emrEvent = {
+  'loaded': (event) => {
+    loaded = false
+    if (times !== huanZheXinXi.value.admissTimes) {
+      // 如果住院次数不一致 那么就是历史记录 那就只能只读了
+      currentEmr.value.callMethod('setEditorMode', 'readonly')
+    } else {
+      // 设置成编辑模式
+      currentEmr.value.callMethod('setEditorMode', 'free')
+    }
+    if (jumpPositioning.code) {
+      positioningTime(jumpPositioning.value, jumpPositioning.code)
+      jumpPositioning.code = null
+    }
+    let whetherToLocate = categoryCode.match(/【锚点-(\S*)】/)
+    if (whetherToLocate && whetherToLocate.length > 1) {
+      let elName = whetherToLocate[1]
+      let emrElData = currentEmr.value.callMethod('getElementsData')
+      console.log(emrElData)
+      emrSidebarRef.diseaseDurationRecordTime(emrElData[elName], elName, documentId);
+    }
+
+  },
+  'contentchange': (event) => {
+    // 判断内容是否改变
+    isEditorChange = true
+    emrSidebarRef.changeTemplateType(2)
+  }
+}
+
+
 onMounted(() => {
 
   nextTick(async () => {
@@ -318,13 +334,13 @@ onMounted(() => {
 
     getCurrentPersonnelInformation(patientData)
 
+
     patientId = huanZheXinXi.value.inpatientNo
-    currentEmr.value = new EMRInteractive(patientData, editorEvents);
+    currentEmr.value = new EMRInteractive(patientData, emrEvent);
     emrRef.value.parentElement.emr = currentEmr.value
 
     window.addEventListener('beforeunload', monitorPageRefresh)
 
-
   })
 
 })

+ 130 - 143
src/views/hospitalization/zhu-yuan-yi-sheng/shou-shu-shen-qing/ShouShuShenQing.vue

@@ -2,18 +2,19 @@
   <el-container>
     <el-header style="height: 30px">
       检查名称:
-      <el-autocomplete v-model="orderName" :fetch-suggestions="querySearchAsync" clearable style="width: 220px" @keyup.enter="dianJiChaXunShouShu(0)"></el-autocomplete>
+      <el-autocomplete v-model="orderName" :fetch-suggestions="querySearchAsync" clearable style="width: 220px"
+                       @keyup.enter="dianJiChaXunShouShu(0)"></el-autocomplete>
       申请时间:
       <el-date-picker
-        v-model="dateRange"
-        :shortcuts="shortcuts"
-        end-placeholder="结束日期"
-        placeholder="选择日期"
-        range-separator="至"
-        size="small"
-        start-placeholder="开始日期"
-        style="width: 280px"
-        type="daterange"
+          v-model="dateRange"
+          :shortcuts="shortcuts"
+          end-placeholder="结束日期"
+          placeholder="选择日期"
+          range-separator="至"
+          size="small"
+          start-placeholder="开始日期"
+          style="width: 280px"
+          type="daterange"
       ></el-date-picker>
       <el-button icon="Search" type="primary" @click="dianJiChaXunShouShu(0)">查询</el-button>
       <el-button icon="Plus" type="success" @click="dianJiXinZhenShouShu">新增</el-button>
@@ -32,11 +33,13 @@
                 <template #dropdown>
                   <el-dropdown-menu>
                     <el-dropdown-item>
-                      <el-button icon="Printer" type="warning" @click="dianJiDaYing(scope.row, scope.$index)">打印 </el-button>
+                      <el-button icon="Printer" type="warning" @click="dianJiDaYing(scope.row, scope.$index)">打印
+                      </el-button>
                     </el-dropdown-item>
-                    <br />
+                    <br/>
                     <el-dropdown-item>
-                      <el-button icon="Delete" type="danger" @click="dianJiShanChu(scope.row, scope.$index)"> 删除 </el-button>
+                      <el-button icon="Delete" type="danger" @click="dianJiShanChu(scope.row, scope.$index)"> 删除
+                      </el-button>
                     </el-dropdown-item>
                   </el-dropdown-menu>
                 </template>
@@ -45,166 +48,150 @@
           </el-table-column>
         </el-table>
         <el-pagination
-          :current-page="shouShuShuJu.currentPage"
-          :page-size="shouShuShuJu.pageSize"
-          :total="shouShuShuJu.total"
-          layout="total,prev, pager, next"
-          small
-          @current-change="handleCurrentChange"
+            :current-page="shouShuShuJu.currentPage"
+            :page-size="shouShuShuJu.pageSize"
+            :total="shouShuShuJu.total"
+            layout="total,prev, pager, next"
+            small
+            @current-change="handleCurrentChange"
         >
         </el-pagination>
       </el-aside>
       <el-main>
-        <da-ying-shou-shu-sheng-qing-dan ref="daYing" :height="windowSize.h / 1.4"></da-ying-shou-shu-sheng-qing-dan>
+        <da-ying-shou-shu-sheng-qing-dan ref="daYing" :height="windowSize.h / 1.2"></da-ying-shou-shu-sheng-qing-dan>
       </el-main>
     </el-container>
   </el-container>
 </template>
 
-<script>
-import { computed, ref, watch } from 'vue'
-import { huoQuShouShu, huoQuShouShuMingCheng, huoQuShouShuShenQingDaYing, shanChuShouShu } from '@/api/zhu-yuan-yi-sheng/shou-shu-shen-qing'
-import { huanZheXinXi, youWuXuanZheHuanZhe } from '@/views/hospitalization/zhu-yuan-yi-sheng/public-js/zhu-yuan-yi-sheng'
-import { shortcuts } from '@/data/shortcuts'
+<script setup name="ShouShuShenQing">
+import {computed, ref, watch} from 'vue'
+import {
+  huoQuShouShu,
+  huoQuShouShuMingCheng,
+  huoQuShouShuShenQingDaYing,
+  shanChuShouShu
+} from '@/api/zhu-yuan-yi-sheng/shou-shu-shen-qing'
+import {huanZheXinXi, youWuXuanZheHuanZhe} from '@/views/hospitalization/zhu-yuan-yi-sheng/public-js/zhu-yuan-yi-sheng'
+import {shortcuts} from '@/data/shortcuts'
 import store from '@/store'
 import DaYingShouShuShengQingDan from '@/components/zhu-yuan-yi-sheng/shou-shu-shen-qing/DaYingShouShuShengQingDan.vue'
-import { stringNotBlank } from '@/utils/blank-utils'
+import {stringNotBlank} from '@/utils/blank-utils'
 import router from '@/router'
-import { ElMessageBox } from 'element-plus'
+import {ElMessageBox} from 'element-plus'
 
-export default {
-  name: 'ShouShuShenQing',
-  components: { DaYingShouShuShengQingDan },
-  setup() {
-    const windowSize = computed(() => {
-      return store.state.app.windowSize
-    })
+const windowSize = computed(() => {
+  return store.state.app.windowSize
+})
 
-    const orderName = ref('')
-    const dateRange = ref([])
-    const daYing = ref()
-    const tableIndex = ref(-1)
+const orderName = ref('')
+const dateRange = ref([])
+const daYing = ref()
+const tableIndex = ref(-1)
 
-    const shouShuShuJu = ref({
-      data: [],
-      currentPage: 1,
-      pageSize: 20,
-      total: 0,
-    })
+const shouShuShuJu = ref({
+  data: [],
+  currentPage: 1,
+  pageSize: 20,
+  total: 0,
+})
 
-    const dianJiChaXunShouShu = (val) => {
-      const data = {
-        patNo: huanZheXinXi.value.inpatientNo,
-        times: huanZheXinXi.value.admissTimes,
-        currentPage: shouShuShuJu.value.currentPage,
-        pageSize: shouShuShuJu.value.pageSize,
-        total: val,
-      }
-      huoQuShouShu(data).then((res) => {
-        if (val === 0) {
-          shouShuShuJu.value.total = res.total
-        }
-        shouShuShuJu.value.data = res.records
-      })
+const dianJiChaXunShouShu = (val) => {
+  const data = {
+    patNo: huanZheXinXi.value.inpatientNo,
+    times: huanZheXinXi.value.admissTimes,
+    currentPage: shouShuShuJu.value.currentPage,
+    pageSize: shouShuShuJu.value.pageSize,
+    total: val,
+  }
+  huoQuShouShu(data).then((res) => {
+    if (val === 0) {
+      shouShuShuJu.value.total = res.total
     }
+    shouShuShuJu.value.data = res.records
+  })
+}
 
-    const querySearchAsync = (val, cd) => {
-      if (youWuXuanZheHuanZhe()) return
-      if (val.length > 1) {
-        huoQuShouShuMingCheng(huanZheXinXi.value.inpatientNo, huanZheXinXi.value.admissTimes, val).then((res) => {
-          cd(res)
-        })
-      }
-    }
+const querySearchAsync = (val, cd) => {
+  if (youWuXuanZheHuanZhe()) return
+  if (val.length > 1) {
+    huoQuShouShuMingCheng(huanZheXinXi.value.inpatientNo, huanZheXinXi.value.admissTimes, val).then((res) => {
+      cd(res)
+    })
+  }
+}
 
-    const handleCurrentChange = (val) => {
-      shouShuShuJu.value.currentPage = val
-      dianJiChaXunShouShu(shouShuShuJu.value.total)
-    }
+const handleCurrentChange = (val) => {
+  shouShuShuJu.value.currentPage = val
+  dianJiChaXunShouShu(shouShuShuJu.value.total)
+}
 
-    const dianJiDaYing = (row, index) => {
-      huoQuShouShuShenQingDaYing(huanZheXinXi.value.inpatientNo, huanZheXinXi.value.admissTimes, row.recordId).then((res) => {
-        daYing.value.data = res
-        tableIndex.value = index
-        if (stringNotBlank(res.applyDate)) {
-          res.applyDate = res.applyDate.split(' ')[0]
-        }
-        if (stringNotBlank(res.opDatetime)) {
-          res.opDatetime = res.opDatetime.split(' ')[0]
-        }
-        setTimeout(() => {
-          daYing.value.daYing()
-        }, 500)
-      })
+const dianJiDaYing = (row, index) => {
+  huoQuShouShuShenQingDaYing(huanZheXinXi.value.inpatientNo, huanZheXinXi.value.admissTimes, row.recordId).then((res) => {
+    daYing.value.data = res
+    tableIndex.value = index
+    if (stringNotBlank(res.applyDate)) {
+      res.applyDate = res.applyDate.split(' ')[0]
     }
-
-    const dianJiChaKanShouShu = (row, index) => {
-      huoQuShouShuShenQingDaYing(huanZheXinXi.value.inpatientNo, huanZheXinXi.value.admissTimes, row.recordId).then((res) => {
-        daYing.value.data = res
-        tableIndex.value = index
-        if (stringNotBlank(res.applyDate)) {
-          res.applyDate = res.applyDate.split(' ')[0]
-        }
-        if (stringNotBlank(res.opDatetime)) {
-          res.opDatetime = res.opDatetime.split(' ')[0]
-        }
-      })
+    if (stringNotBlank(res.opDatetime)) {
+      res.opDatetime = res.opDatetime.split(' ')[0]
     }
+    setTimeout(() => {
+      daYing.value.daYing()
+    }, 500)
+  })
+}
 
-    const dianJiShanChu = (row, index) => {
-      ElMessageBox.confirm(`您确定要删除【${row.opName}】吗?`, '提示', {})
-        .then(() => {
-          shanChuShouShu(row.recordId)
-        })
-        .catch(() => {})
+const dianJiChaKanShouShu = (row, index) => {
+  huoQuShouShuShenQingDaYing(huanZheXinXi.value.inpatientNo, huanZheXinXi.value.admissTimes, row.recordId).then((res) => {
+    daYing.value.data = res
+    tableIndex.value = index
+    if (stringNotBlank(res.applyDate)) {
+      res.applyDate = res.applyDate.split(' ')[0]
     }
-
-    watch(
-      () => huanZheXinXi.value,
-      () => {
-        dianJiChaXunShouShu(0)
-      }
-    )
-
-    const rowClass = ({ rowIndex }) => {
-      if (rowIndex === tableIndex.value) {
-        return 'success-row'
-      } else {
-        return ''
-      }
+    if (stringNotBlank(res.opDatetime)) {
+      res.opDatetime = res.opDatetime.split(' ')[0]
     }
+  })
+}
 
-    const dianJiXinZhenShouShu = () => {
-      router.push({
-        name: 'xinZengShuJu',
-        params: {
-          name: '手术',
-          passRule: true,
-        },
-        query: {
-          path: '/inpatient/zhuYuanYiSheng/shouShuShenQing',
-        },
+const dianJiShanChu = (row, index) => {
+  ElMessageBox.confirm(`您确定要删除【${row.opName}】吗?`, '提示', {})
+      .then(() => {
+        shanChuShouShu(row.recordId)
       })
-    }
+      .catch(() => {
+      })
+}
 
-    return {
-      orderName,
-      dianJiChaXunShouShu,
-      dateRange,
-      shortcuts,
-      querySearchAsync,
-      shouShuShuJu,
-      windowSize,
-      handleCurrentChange,
-      dianJiChaKanShouShu,
-      dianJiDaYing,
-      daYing,
-      rowClass,
-      dianJiXinZhenShouShu,
-      dianJiShanChu,
+watch(
+    () => huanZheXinXi.value,
+    () => {
+      dianJiChaXunShouShu(0)
     }
-  },
+)
+
+const rowClass = ({rowIndex}) => {
+  if (rowIndex === tableIndex.value) {
+    return 'success-row'
+  } else {
+    return ''
+  }
 }
+
+const dianJiXinZhenShouShu = () => {
+  router.push({
+    name: 'xinZengShuJu',
+    params: {
+      name: '手术',
+      passRule: true,
+    },
+    query: {
+      path: '/inpatient/zhuYuanYiSheng/shouShuShenQing',
+    },
+  })
+}
+
 </script>
 
 <style scoped>

+ 6 - 4
vite.config.js

@@ -47,14 +47,16 @@ export default defineConfig({
         host: '0.0.0.0',
         proxy: {
             '/emr/runtime': {
-                target: 'http://172.16.32.122:8001', //这里配置运行时服务地址  这个是新虚拟机地址 http://172.16.32.124:8001
+                //这里配置运行时服务地址
+                target: 'http://172.16.32.125:8001',
                 secure: false, //如果运行时服务是https,此处配置为true
                 changeOrigin: true //支持跨域调用,这里配置为true
             },
             '/bdp/dataservice/api': {
-                target: 'http://172.16.32.183:8888', //这里配置运行时服务地址
-                secure: false, //如果运行时服务是https,此处配置为true
-                changeOrigin: true //支持跨域调用,这里配置为true
+                // 这个地址是,创智和宇的查询电子病历下拉框的接口
+                target: 'http://172.16.32.183:8888',
+                secure: false,
+                changeOrigin: true
             },
         }
     },

Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů