Explorar el Código

病案详情左侧增加收起展开样式和交互,从专家质控模块点击过来的如果是子集,默认展开对应的父集

liyanyan hace 2 semanas
padre
commit
009e3e036c
Se han modificado 1 ficheros con 22 adiciones y 5 borrados
  1. 22 5
      src/views/allcase/caseViews.vue

+ 22 - 5
src/views/allcase/caseViews.vue

@@ -33,14 +33,26 @@
             :key="index"
             :key="index"
             @click="clickTree(item.bllb, item.name, item)"
             @click="clickTree(item.bllb, item.name, item)"
           >
           >
-            <el-row type="flex" justify="space-between" align="middle"><span>{{ item.name }}</span><i v-if="item.bllb == 49 || (Array.isArray(item.list) && !!item.list.length)" class="el-icon-arrow-down"/></el-row>
+            <el-row type="flex" justify="space-between" align="middle">
+              <span>
+                {{ item.name }}
+                <span v-if="item.bllb == 49">(2)</span>
+                <span v-if="(Array.isArray(item.list) && !!item.list.length)">({{item.list.length}})</span>
+              </span>
+              <el-button 
+                type="text"
+                v-if="item.bllb == 49 || (Array.isArray(item.list) && !!item.list.length)" 
+                :class="`el-icon-arrow-${item.collapse ? 'up' : 'down'}`"
+                @click.stop="setTreeCollapse(index)"
+              />
+            </el-row>
             <!-- 医嘱 -->
             <!-- 医嘱 -->
-            <div v-if="item.bllb == 49">
+            <div v-if="item.bllb == 49 && item.collapse">
               <div :class="['li-left-item-li', is_active == '长期医嘱' ? 'is-active' : '']" data-li="49-1" :id="item.bllb" @click.stop="clickTree(item.bllb, '长期医嘱', {}, true)" >长期医嘱</div>
               <div :class="['li-left-item-li', is_active == '长期医嘱' ? 'is-active' : '']" data-li="49-1" :id="item.bllb" @click.stop="clickTree(item.bllb, '长期医嘱', {}, true)" >长期医嘱</div>
               <div :class="['li-left-item-li', is_active == '临时医嘱' ? 'is-active' : '']" data-li="49-2" :id="item.bllb" @click.stop="clickTree(item.bllb, '临时医嘱', {}, true)">临时医嘱</div>
               <div :class="['li-left-item-li', is_active == '临时医嘱' ? 'is-active' : '']" data-li="49-2" :id="item.bllb" @click.stop="clickTree(item.bllb, '临时医嘱', {}, true)">临时医嘱</div>
             </div>
             </div>
             <!-- 报告单 -->
             <!-- 报告单 -->
-            <div v-if="item.bllb == 2000002">
+            <div v-if="item.bllb == 2000002 && item.collapse">
               <div 
               <div 
                 v-for="(jitem, jindex) in item.list" 
                 v-for="(jitem, jindex) in item.list" 
                 :key="jindex" 
                 :key="jindex" 
@@ -52,7 +64,7 @@
               </div>
               </div>
             </div>
             </div>
             <!-- 病程记录、手术记录 -->
             <!-- 病程记录、手术记录 -->
-            <div v-if="[294, 303, 288, 87].includes(item.bllb)">
+            <div v-if="[294, 303, 288, 87].includes(item.bllb) && item.collapse">
               <div
               <div
                 v-for="(jitem, jindex) in item.list"
                 v-for="(jitem, jindex) in item.list"
                 :class="['li-left-item-li', parentType == item.bllb && is_active == jitem.blbh ? 'is-active' : '']"
                 :class="['li-left-item-li', parentType == item.bllb && is_active == jitem.blbh ? 'is-active' : '']"
@@ -387,6 +399,9 @@ export default {
   },
   },
   activated() {},
   activated() {},
   methods: {
   methods: {
+    setTreeCollapse(index) {
+      this.$set(this.treeList[index], 'collapse', !(this.treeList[index].collapse))
+    },
     openAIModel() {
     openAIModel() {
       if(!this.valData) {
       if(!this.valData) {
         this.$message.error('住院号不存在!');
         this.$message.error('住院号不存在!');
@@ -573,8 +588,9 @@ export default {
       const currentTreeRow = this.treeList[this.$route.query.currentKey]
       const currentTreeRow = this.treeList[this.$route.query.currentKey]
       if (this.$route.query.bllb && this.$route.query.bllb != '-1' && !this.$route.query.blbh) {
       if (this.$route.query.bllb && this.$route.query.bllb != '-1' && !this.$route.query.blbh) {
         // this.$message.success('请求多组')
         // this.$message.success('请求多组')
-        if(this.$route.query.specialName) {
+        if(this.$route.query.specialName) { // 如果是医嘱
           this.clickTree(this.$route.query.bllb, this.$route.query.specialName, {}, true)
           this.clickTree(this.$route.query.bllb, this.$route.query.specialName, {}, true)
+          this.setTreeCollapse(this.$route.query.currentKey)
         } else {
         } else {
           this.clickTree(this.$route.query.bllb, currentTreeRow.name, currentTreeRow)
           this.clickTree(this.$route.query.bllb, currentTreeRow.name, currentTreeRow)
         }
         }
@@ -583,6 +599,7 @@ export default {
         if( Array.isArray(currentTreeRow.list) ) {
         if( Array.isArray(currentTreeRow.list) ) {
           let currentChildRow = currentTreeRow.list.find(element => element.blbh == this.$route.query.blbh)
           let currentChildRow = currentTreeRow.list.find(element => element.blbh == this.$route.query.blbh)
           currentChildRow && this.clickTree(this.$route.query.bllb, currentChildRow.name, currentChildRow, true);
           currentChildRow && this.clickTree(this.$route.query.bllb, currentChildRow.name, currentChildRow, true);
+          currentChildRow && this.setTreeCollapse(this.$route.query.currentKey)
         }
         }
       }
       }
     },
     },