ソースを参照

Merge remote-tracking branch 'origin/dev2/zhangxc' into dev

zhouna 6 年 前
コミット
5aa2bdc477

+ 1 - 1
src/api/config.js

@@ -126,6 +126,6 @@ export default {
     {controlType:[1,2,6,7],tagType:[1,2],notTagType:[8]},  //症状详细(症状尾巴)
     {controlType:[1,2],tagType:[1,2,3,4,10],notTagType:[8]}, //组合项标签(既往史)
     {controlType:[1,6],tagType:[],notTagType:[8]},    //化验组合
-    {controlType:[1,2],tagType:[],notTagType:[8]},   //症状推送类型(添加症状)
+    {controlType:[1,2,99],tagType:[],notTagType:[8]},   //症状推送类型(添加症状)
   ]
 }

+ 2 - 2
src/components/icss/BloodPressTagGroup.vue

@@ -239,8 +239,8 @@ export default {
         searchTagList() {
             let notIds = []
             for (let i = 0; i < this.rightTagsList.length; i++) {
-                if(this.rightTagsList[i].id) {
-                    notIds.push(this.rightTagsList[i].id)
+                 if(typeof this.rightTagsList2[i].id === 'number') {
+                    notIds.push(this.rightTagsList2[i].id)
                 }
                 
             }

+ 77 - 54
src/components/icss/SymptomPush.vue

@@ -34,7 +34,7 @@
       <ul v-for="(item, index) in rightTagsList" 
             :key="index"    
             class="symptomPushTagList symptomPushOperationPool"
-            :class="index === 1 ? 'symptomPushOperationPoolPush':'' "
+            :class="index === 1&&item.id ? 'symptomPushOperationPoolPush':'' "
             :style="currentSelectIndex === index?styles:null"
             @click="SelectList(index)"
       >
@@ -79,7 +79,7 @@ export default {
     data() {
         return {
             leftTagsList: [],
-            selectLeftTagId: '',
+            selectLeftTagId: {},
             rightTagsList: [{}, {}],
             currentSelectIndex: -1,
             searchVal: '',
@@ -89,30 +89,16 @@ export default {
         }
     },
     mounted() {
-        // this.rightTagsList = this.options
-        // let newArr = []
-        // for (let i = 0; i < this.rightTagsList2.length; i++) {
-        //     if(this.rightTagsList2[i].tagType == 8) {
-        //         newArr.push({ text: this.rightTagsList2[i].tagName ,type:'input' ,id: i+',,,'})
-        //     } else {
-        //         if(i === 0 ) {
-        //             newArr.push({ text: '' ,type:'input' ,id: i+',,,'})
-        //         }
-        //         newArr.push(this.rightTagsList2[i])
-        //         if(!this.rightTagsList2[i+1] || this.rightTagsList2[i+1]&&this.rightTagsList2[i+1].tagType != 8) {
-        //             newArr.push({ text: '' ,type:'input' ,id: i+',,,,'})
-        //         }
-        //     }
-        // }
-        // this.rightTagsList2 = newArr
-        console.log('this.options',this.options)
         if(this.options.length) {
-            this.rightTagsList = this.options
-            this.$emit('changeActionData',this.rightTagsList, false);
+            if(this.options.length === 2) {     //当两个模块都有值时
+                this.rightTagsList = this.options
+                this.$emit('changeActionData',this.rightTagsList, false);
+                
+            } else if(this.options.length === 1) {
+                this.options[0].controlType == 99 ? this.rightTagsList.splice(1, 1, this.options[0]) :this.rightTagsList.splice(0, 1, this.options[0])
+            }
+            this.searchTagList()
         }
-        this.searchTagList()
-        // this.leftTagsList = this.pool
-        // console.log('TAGPOOL', this.pool)
     },
     watch: {
         pool(newVal, preVal) {
@@ -163,26 +149,66 @@ export default {
             this.$emit('changeActionData',this.rightTagsList, false);
         },
         toRightList() {
-            
-            if(this.currentSelectIndex === -1) {
-                let fillIndex = -1
+            if(Object.keys(this.selectLeftTagId).length === 0) { //判断标签池有没有选中标签
+                this.$message({
+                    showClose: true,
+                    message: '请选择标签池',
+                    type: 'warning'
+                });
+                return
+            }
+            let fillIndex = -1
+            if(this.currentSelectIndex === -1) {    //操作界面没有选择模块时
                 for(let i = 0; i < this.rightTagsList.length; i++) {
                     if(Object.keys(this.rightTagsList[i]).length === 0) {
                         fillIndex = i
                         break
                      }
-                
                 }
-                if(fillIndex === 0) {
-                    this.getRighDetailsTag(fillIndex)
-                } else if (fillIndex === 1) {
-                    this.getRighDetailsTag(fillIndex)
-                }
-                
+
+            } else {
+                fillIndex = this.currentSelectIndex
+            }
+            if(fillIndex === -1) {
+                this.$message({
+                    showClose: true,
+                    message: '请选择标签池',
+                    type: 'warning'
+                });
+                return;
+            } else {
+                this.getcontrolType(fillIndex)
             }
-            
             
            
+        },
+        getcontrolType(fillIndex) {
+            if(fillIndex === 0) {
+                    if(this.selectLeftTagId.controlType != 99) {
+                        this.getRighDetailsTag(fillIndex)
+                    } else {
+                        this.$message({
+                            showClose: true,
+                            message: '请选择正确的标签类型',
+                            type: 'warning'
+                        });
+                        return;
+                    }  
+                    
+                } else if (fillIndex === 1) {
+                    if(this.selectLeftTagId.controlType == 99) {
+                        this.rightTagsList.splice(fillIndex, 1, this.selectLeftTagId)
+                         this.searchTagList()
+                        this.$emit('changeActionData',this.rightTagsList, false);
+                    } else {
+                        this.$message({
+                            showClose: true,
+                            message: '请选择正确的标签类型',
+                            type: 'warning'
+                        });
+                        return;
+                    }
+                }
         },
         searchTagList() {
             let notIds = []
@@ -215,25 +241,22 @@ export default {
                 // "sexType": 3
             }
              api.detailsTag(param).then((res) =>{
-                //  if (res.data.code === '0') {
-                //      this.selectLeftTagId = res.data.data
-                //      if(this.currentSelectIndex !== -1) {
-                //         console.log('this.selectLeftTagId',this.selectLeftTagId)
-                //         //    this.rightTagsList[this.currentSelectIndex] = this.selectLeftTagId;
-                //         this.rightTagsList.splice(this.currentSelectIndex, 1, this.selectLeftTagId)
-                //     } else {
-                //         console.log(55656,this.selectLeftTagId)
-                //         for(let i = 0; i < this.rightTagsList.length; i++) {
-                //             if(Object.keys(this.rightTagsList[i]).length === 0) {
-                //                 this.rightTagsList.splice(i, 1, this.selectLeftTagId)
-                //                 break;
-                //             }
-                //         }
-                //     }
-                //     this.searchTagList()
-                //     console.log('this.rightTagsList',this.rightTagsList)
-                //     this.$emit('changeActionData',this.rightTagsList, false);
-                //  }
+                 if (res.data.code === '0') {
+                     this.selectLeftTagId = res.data.data
+                     if(this.currentSelectIndex !== -1) {
+                        //    this.rightTagsList[this.currentSelectIndex] = this.selectLeftTagId;
+                        this.rightTagsList.splice(this.currentSelectIndex, 1, this.selectLeftTagId)
+                    } else {
+                        for(let i = 0; i < this.rightTagsList.length; i++) {
+                            if(Object.keys(this.rightTagsList[i]).length === 0) {
+                                this.rightTagsList.splice(i, 1, this.selectLeftTagId)
+                                break;
+                            }
+                        }
+                    }
+                    this.searchTagList()
+                    this.$emit('changeActionData',this.rightTagsList, false);
+                 }
              })
         },
         SelectList(index) {

+ 2 - 1
src/components/icss/SymptomTagGroup.vue

@@ -259,8 +259,9 @@ export default {
         },
         searchTagList() {
             let notIds = []
+            console.log('this.rightTagsList2',this.rightTagsList2)
             for (let i = 0; i < this.rightTagsList2.length; i++) {
-                if(this.rightTagsList2[i].id) {
+                if(typeof this.rightTagsList2[i].id === 'number') {
                     notIds.push(this.rightTagsList2[i].id)
                 }