Browse Source

电子病历侧边栏优化

xiaochan 2 years ago
parent
commit
78c87f7cdc

+ 2 - 31
src/api/zhu-yuan-yi-sheng/emr-patient.js

@@ -8,41 +8,12 @@ let url = 'Emr/'
  * @param times 住院次数
  * @returns {*} 返回数
  */
-export async function getPatientDataTree(patNo, times) {
-    let res = await request({
+export function getPatientDataTree(patNo, times) {
+    return request({
         url: url + 'getPatientDataTree',
         method: 'get',
         params: {patNo, times}
     })
-
-    if (res == null) {
-        return []
-    }
-
-    let tempData = []
-
-    let groupingByEmrCategoryCode = new Map();
-
-    res.forEach(item => {
-        let key = item.emrCategoryCode
-        if (groupingByEmrCategoryCode.has(key)) {
-            groupingByEmrCategoryCode.get(key).push(item)
-        } else {
-            groupingByEmrCategoryCode.set(key, [item])
-        }
-    });
-
-    groupingByEmrCategoryCode.forEach((value, key) => {
-        if (value.length === 1) {
-            tempData.push(value[0])
-        } else {
-            let item = {}
-            item.name = value[0].name
-            item.children = value
-            tempData.push(item)
-        }
-    })
-    return tempData
 }
 
 /**

+ 14 - 3
src/components/zhu-yuan-yi-sheng/emr/EmrQualityControlRelieve/EmrDialog.vue

@@ -5,8 +5,7 @@
             @closed="emits('closed')"
             show-button
             @cancel="emits('closed')"
-            @confirm="confirm"
-    >
+            @confirm="confirm">
         <el-form label-width="80" label-position="right">
             <el-form-item label="解除限制:">
                 <el-checkbox-group v-model="data.unlockArray">
@@ -16,6 +15,7 @@
             <el-form-item label="有效时间:">
                 <el-date-picker v-model="data.effectiveTime"
                                 type="datetime"
+                                :disabled-date="disDate"
                                 style="width: 180px"
                                 format="YYYY-MM-DD HH:mm:ss"
                                 value-format="YYYY-MM-DD HH:mm:ss"/>
@@ -43,9 +43,12 @@ import {
     query
 } from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/emr-init";
 
+const props = defineProps({
+    newDate: null
+})
+
 const emits = defineEmits(['closed'])
 const dialog = ref(true)
-let newDate = null
 
 const limit = ['转科创建病历', '出院编辑', '病历质控']
 const data = ref({
@@ -74,6 +77,14 @@ const confirm = async () => {
 }
 
 
+const disDate = (time) => {
+    return time.getTime() < props.newDate.getTime();
+}
+
+onMounted(() => {
+
+})
+
 </script>
 
 <style scoped lang="scss">

+ 7 - 1
src/components/zhu-yuan-yi-sheng/emr/EmrQualityControlRelieve/EmrQualityControlRelieve.vue

@@ -1,13 +1,19 @@
 <template>
     <el-button type="warning" @click="dialog = true">解锁病历质控</el-button>
-    <emr-dialog v-if="dialog" @closed="dialog = false"/>
+    <emr-dialog v-if="dialog" @closed="dialog = false" :new-date="newDate"/>
 </template>
 
 <script setup name="EmrQualityControlRelieve">
 import EmrDialog from './EmrDialog.vue'
+import {getServerDateApi} from "@/api/public-api";
 
 const dialog = ref(false)
 
+const newDate = ref(null)
+
+onMounted(async () => {
+    newDate.value = new Date(await getServerDateApi())
+})
 
 </script>
 

+ 20 - 11
src/components/zhu-yuan-yi-sheng/emr/EmrSidebar.vue

@@ -25,10 +25,7 @@
                     <el-icon v-if="data.submit">
                         <Lock/>
                     </el-icon>
-                    <el-icon v-else>
-                        <Folder v-if="data.children"/>
-                        <Document v-else/>
-                    </el-icon>
+                    <component :is="isItAFolder(data)"/>
                     <span :title="fileName(data)">
                {{ fileName(data) }}
           </span>
@@ -56,6 +53,8 @@ import {getAllWards} from "@/api/zhu-yuan-yi-sheng/resident-doctor";
 import RightClickMenu from "@/components/menu-item/RightClickMenu.vue";
 import {xcMessage} from "@/utils/xiaochan-element-plus";
 import store from "@/store";
+import {ElIcon} from "element-plus";
+import {Folder, Document} from "@element-plus/icons-vue";
 
 const props = defineProps({
     maxHeight: {
@@ -124,6 +123,7 @@ const wardCreationJudgment = async () => {
 }
 
 const handleNodeClick = async (val) => {
+    if (val.type === 'group-category') return
     let temp = {}
     if (templateType === 0 || templateType === 1) {
         temp = {
@@ -193,11 +193,6 @@ const typeChange = (val) => {
     emit("typeChange", val)
 }
 
-const queryHistory = async (times) => {
-    templateType = 2
-    returnData.patientTree = await getPatientDataTree(props.huanZheXinXi.inpatientNo, times)
-}
-
 const filterChange = (val) => {
     treeRef.filter(val)
 }
@@ -234,7 +229,6 @@ const deleteTheSpecifiedNode = (id) => {
 let courseRecord = true
 let findNode = false
 const diseaseDurationRecordTime = (id, list) => {
-    console.log(courseRecord)
     if (courseRecord) {
         findNode = false;
         findMedicalRecordById(id, list, returnData.patientTree)
@@ -248,6 +242,7 @@ const findMedicalRecordById = (id, roundTimes, list) => {
         let item = list[i]
         if (item.emrDocumentId === id) {
             findNode = true
+            item.type = 'group-category'
             item.children = roundTimes
             return
         }
@@ -266,6 +261,7 @@ const queryData = () => {
             templateType = 2
             emit('patientMedicalRecord')
         }
+        console.log(res)
         returnData.patientTree = res
     })
 }
@@ -324,6 +320,20 @@ const contextmenuItem = (event, data) => {
     };
 }
 
+const isItAFolder = (data) => {
+    return h(ElIcon, null,
+        {
+            default: () => {
+                if (data.type === 'category') {
+                    return h(Document)
+                } else {
+                    return h(Folder)
+                }
+            }
+        }
+    )
+}
+
 onMounted(() => {
 
     emrMitt.on('患者病区判断', () => {
@@ -341,7 +351,6 @@ onMounted(() => {
         getEmrTree().then((res) => {
             returnData.emrTree = res.all
             returnData.deptTree = res.dept
-            console.log(res)
         })
     } else {
         templateType = 2

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

@@ -145,7 +145,7 @@
                   <span :style="{'fontFamily':item.font }">
                     {{ item.text }}
                   </span>
-                        </el-option>
+                            </el-option>
                         </el-select>
                         <el-select style="width: 70px;"
                                    @change="textStyleFunc.fontSize()"
@@ -1059,7 +1059,8 @@ const courseSegmentLocking = async () => {
                     jump: true,
                     createName: createName,
                     createDate: values['查房时间']?.value,
-                    createId: createId
+                    createId: createId,
+                    type: 'category'
                 })
                 if (emrConfig.value.editor) {
                     let editorCode = values['编辑者']?.value[0]?.code;