Kaynağa Gözat

电子病历新增分类以及优化鼠标右键

xiaochan 2 yıl önce
ebeveyn
işleme
3f0af4b951

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

@@ -286,6 +286,15 @@ export function whetherItExistsInTheDepartment(patNo, times) {
     })
 }
 
+export function electronicMedicalRecordSequencing(data) {
+    return request({
+        url: url + 'electronicMedicalRecordSequencing',
+        method: 'post',
+        data
+    })
+}
+
+
 
 
 

+ 34 - 4
src/components/menu-item/RightClickMenu.vue

@@ -8,10 +8,24 @@
             <li v-for="(item,index) in props.config"
                 :style="prohibit(item)"
                 @click="handlingClickEvents(item.click, index)">
-                {{ item.name }}
+                <div class="icon">
+                    <component v-if="item.icon" :is="item.icon"/>
+                </div>
+                <div class="writtenWords">
+                    {{ item.name }}
+                </div>
+                <div class="suffix"/>
             </li>
             <li @click="modal = false">
-                关闭
+                <div class="icon">
+                    <el-icon>
+                        <Close/>
+                    </el-icon>
+                </div>
+                <div class="writtenWords">
+                    关闭
+                </div>
+                <div class="suffix"/>
             </li>
         </ul>
     </div>
@@ -127,7 +141,6 @@ onMounted(() => {
 <style scoped lang="scss">
 .tabs_item {
   position: fixed;
-  text-align: center;
   margin: 5px;
   padding: 5px;
   z-index: 100;
@@ -139,8 +152,25 @@ onMounted(() => {
     margin: 3px 0;
     border-radius: 5px;
     font-size: 14px;
-    padding: 5px;
+    padding: 5px 10px;
     line-height: 20px;
+    display: flex;
+    align-items: center;
+
+    .icon {
+      width: 20px;
+      display: flex;
+      align-items: center;
+      box-sizing: border-box;
+    }
+
+    .writtenWords {
+      min-width: max-content;
+    }
+
+    .suffix {
+      width: 30px
+    }
 
     &:hover {
       background-color: #c6e2ff;

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

@@ -17,6 +17,10 @@
                      @node-click="handleNodeClick"
                      node-key="_id"
                      ref="treeRef"
+                     draggable
+                     @node-drag-end="dragEnd"
+                     :allow-drag="allowDrag"
+                     :allow-drop="dragLimit"
                      @node-contextmenu="contextmenuItem"
                      highlight-current
                      :filter-node-method="filterNode"
@@ -38,15 +42,18 @@
 
 <script setup name='EmrSidebar'>
 import {
+    electronicMedicalRecordSequencing,
     getEmrTree,
     getPatientDataTree,
-    queryWhetherThePatientHasASpecifiedMedicalRecord, whetherItExistsInTheDepartment
+    queryWhetherThePatientHasASpecifiedMedicalRecord,
+    whetherItExistsInTheDepartment
 } from "@/api/zhu-yuan-yi-sheng/emr-patient";
 import {BizException, ExceptionEnum} from "@/utils/BizException";
 import {
     canIUnlockIt,
     emrConfig,
-    emrMitt, unlockEnum
+    emrMitt,
+    unlockEnum
 } from '@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/emr-init'
 import {stringIsBlank} from "@/utils/blank-utils";
 import {getAllWards} from "@/api/zhu-yuan-yi-sheng/resident-doctor";
@@ -54,7 +61,7 @@ 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";
+import {Folder, Document, Open, Sort} from "@element-plus/icons-vue";
 
 const props = defineProps({
     maxHeight: {
@@ -226,14 +233,10 @@ const deleteTheSpecifiedNode = (id) => {
     }
 }
 
-let courseRecord = true
 let findNode = false
 const diseaseDurationRecordTime = (id, list) => {
-    if (courseRecord) {
-        findNode = false;
-        findMedicalRecordById(id, list, returnData.patientTree)
-        courseRecord = false
-    }
+    findNode = false;
+    findMedicalRecordById(id, list, returnData.patientTree);
 }
 
 const findMedicalRecordById = (id, roundTimes, list) => {
@@ -250,18 +253,16 @@ const findMedicalRecordById = (id, roundTimes, list) => {
         if (item.children) {
             findMedicalRecordById(id, roundTimes, item.children)
         }
+
     }
 }
 
-
 const queryData = () => {
     getPatientDataTree(props.huanZheXinXi.inpatientNo, props.huanZheXinXi.admissTimes).then((res) => {
         if (res?.length > 0) {
-            courseRecord = true
             templateType = 2
             emit('patientMedicalRecord')
         }
-        console.log(res)
         returnData.patientTree = res
     })
 }
@@ -281,13 +282,35 @@ const nullToEmpty = (val) => {
 const mousePosition = ref()
 const opt = [
     {
-        name: '打开已保存的病历', click: (data) => {
+        name: '打开', click: (data) => {
             if (!data.unlock.id) {
                 xcMessage.error('请选中保存的病历。')
                 return
             }
             emit('openAndSaveTheMedicalRecord', data.unlock.id)
-        }
+        },
+        icon: h(ElIcon, {}, () => h(Open))
+    },
+    {
+        name: '确认排序', click: (data) => {
+            let temp = []
+            drag.forEach((value, key) => {
+                if (value.newParent !== value.oldParent) {
+                    temp.push({id: key, parent: value.newParent})
+                }
+            })
+            if (temp.length === 0) {
+                drag.clear()
+                return xcMessage.error('文件夹没有变化,无需点击。')
+            }
+            electronicMedicalRecordSequencing(temp).then(() => {
+                drag.clear()
+            })
+        },
+        validator: () => {
+            return drag.size > 0
+        },
+        icon: h(ElIcon, {}, () => h(Sort))
     }
 ]
 const contextmenuItem = (event, data) => {
@@ -334,11 +357,39 @@ const isItAFolder = (data) => {
     )
 }
 
+const dragLimit = (moveNode, inNode, type) => {
+    if (templateType !== 2) return false;
+    if (moveNode.data.jump) return false;
+    if (inNode.data._id && type === 'inner') {
+        return true;
+    }
+}
+
+const allowDrag = (node) => {
+    if (templateType !== 2) return false;
+    if (node.data.emrCategoryCode === 'shoucibingchengjilu') {
+        return true;
+    }
+    return node.data.type !== "group-category";
+}
+
+let drag = new Map();
+
+const dragEnd = (moveNode, inNode, type, event) => {
+    if (type === 'none') return
+    let temp = {
+        newParent: inNode.data._id,
+        oldParent: moveNode.data.parent
+    }
+    drag.set(moveNode.data.id, temp)
+}
+
 onMounted(() => {
 
     emrMitt.on('患者病区判断', () => {
         return determineWhetherItCanBeCreated()
     })
+
     queryData()
     if (editor) {
         getAllWards().then((res) => {

+ 10 - 4
src/components/zhu-yuan-yi-sheng/yi-zhu-lu-ru/table/YzTableV2.vue

@@ -32,6 +32,8 @@ import {
 import sleep from "@/utils/sleep";
 import RightClickMenu from "@/components/menu-item/RightClickMenu.vue";
 import {nullToEmpty} from "@/utils/public";
+import {ElIcon} from "element-plus";
+import {DocumentCopy} from "@element-plus/icons-vue";
 
 const emits = defineEmits(['rowClick', 'clickAssociate', 'voidOrders'])
 
@@ -277,7 +279,8 @@ const opt = [
     {
         name: '复制', click: (data) => {
             yzMitt.emit('copy', data.actOrderNo, data.frequCode)
-        }
+        },
+        icon: h(ElIcon, null, () => h(DocumentCopy))
     },
     {
         name: '粘贴', click: (data) => {
@@ -285,18 +288,21 @@ const opt = [
         },
         validator: () => {
             return yzMitt.emit('allowReplication')
-        }
+        },
+        icon: h('i', {
+            class: 'iconfont icon-zhantie'
+        })
     },
     {
         name: '关联', click: (data, index) => {
             emits('clickAssociate', data)
         }
     }, {
-        name: '退出关联模式', click: () => {
+        name: '退出关联', click: () => {
             clearAssociate()
         }
     }, {
-        name: '药品说明书', click: (data) => {
+        name: '说明书', click: (data) => {
             if (data.groupNo !== '00') {
                 drugManual.value.open(data.orderCode, data.serial);
             }

+ 19 - 3
src/icons/iconfont.css

@@ -1,8 +1,8 @@
 @font-face {
   font-family: "iconfont"; /* Project id 2473230 */
-  src: url('iconfont.woff2?t=1673837507848') format('woff2'),
-       url('iconfont.woff?t=1673837507848') format('woff'),
-       url('iconfont.ttf?t=1673837507848') format('truetype');
+  src: url('iconfont.woff2?t=1681957496590') format('woff2'),
+       url('iconfont.woff?t=1681957496590') format('woff'),
+       url('iconfont.ttf?t=1681957496590') format('truetype');
 }
 
 .iconfont {
@@ -13,6 +13,18 @@
   -moz-osx-font-smoothing: grayscale;
 }
 
+.icon-zhantie:before {
+  content: "\e636";
+}
+
+.icon-binglizhikongguizedingyi:before {
+  content: "\e751";
+}
+
+.icon-skin:before {
+  content: "\e635";
+}
+
 .icon-yousuojin:before {
   content: "\e64c";
 }
@@ -189,6 +201,10 @@
   content: "\e706";
 }
 
+.icon-jimubaobiao:before {
+  content: "\e606";
+}
+
 .icon-huizhentongji:before {
   content: "\e61b";
 }

BIN
src/icons/iconfont.ttf


BIN
src/icons/iconfont.woff


BIN
src/icons/iconfont.woff2


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

@@ -12,7 +12,7 @@
                     title="提交不是保存"
                     @click="clickToSubmitTheMedicalRecord"
                     :disabled="!documentId || !emrConfig.editor">
-                提交病历
+                提交
             </el-button>
             <el-button :disabled="!emrConfig.editor"
                        icon="Delete" type="danger"