Bläddra i källkod

互斥项可以取消1983

zhouna 6 år sedan
förälder
incheckning
fd73c9c40a
2 ändrade filer med 22 tillägg och 13 borttagningar
  1. 9 11
      src/components/preTreat/PubSelect.vue
  2. 13 2
      src/components/preTreat/QuestionTagGroup.vue

+ 9 - 11
src/components/preTreat/PubSelect.vue

@@ -8,7 +8,7 @@
                 <el-checkbox-group size="small">
                     <el-checkbox-button :label="0" :disabled="disableBtn" @change="handlePlaceholder(1)">数字输入框占位符</el-checkbox-button>
                 </el-checkbox-group>
-                <el-checkbox-group size="small" v-if="type==2">
+                <el-checkbox-group size="small" v-if="type==2" v-model="checkedExc">
                     <el-checkbox-button :label="0" @change="handleExclu">互斥项</el-checkbox-button>
                 </el-checkbox-group>
                 <el-button type="danger" size="small" class="del" @click="delRow">删除</el-button>
@@ -149,6 +149,7 @@
     data(){
       return {
         rows:[...initRows],
+        checkedExc:false,
         focusOn:-1,         //聚焦的行index
         focusName:'name',        //是否聚焦医生界面输入框
         disableBtn:false,       //占位符是否禁用
@@ -168,20 +169,13 @@
         this.initData();
       }
     },
-    computed:{
-      showTag:function(){
-        return function(it){
-          let name = Object.keys(this.maps).find((item)=>{
-            return it[item];
-          });
-          return this.maps[name];
-        }
-      },
-    },
     watch: {
       /*ascription(newVal, preVal) {        //永远检测不到,因为归属修改时类型被清空,本组件被销毁
         this.rows = [...utils.getInitRow(initRow,4)];
       },*/
+      focusOn(newVal){
+        this.checkedExc = this.rows[newVal].exclusion===1;
+      },
       type() {
         this.initData();
       },
@@ -234,6 +228,10 @@
           });
           return ;
         }
+        if(this.rows[i].exclusion===1){
+          this.rows[i].exclusion=0;
+          return ;
+        }
         this.rows.map((it,x)=>{
           if(x===i){
             it.exclusion = 1;

+ 13 - 2
src/components/preTreat/QuestionTagGroup.vue

@@ -1,7 +1,7 @@
 <template>
     <div class="symptomTagGroupWrapper commomSymptom clearfix">
         <div class="operation-row">
-            <el-checkbox-group size="small" v-if="qaType==2">
+            <el-checkbox-group size="small" v-if="qaType==2" v-model="checkedExc">
                 <el-checkbox-button :label="0" @change="handleExclu">互斥项</el-checkbox-button>
             </el-checkbox-group>
         </div>
@@ -64,6 +64,7 @@ export default {
     props: ['ascription','sexType','options','type','qaType','relationId'],
     data() {
         return {
+            checkedExc:false,
             leftTagsList: [],
             selectLeftTagsList: [],
             rightTagsList: [],
@@ -106,6 +107,12 @@ export default {
         relationId(newVal, preVal){
           this.ifReflashTagList(newVal, preVal);
         },
+        'selectRightTagsList':{
+          handler:function(newVal){
+            this.checkedExc = newVal[0]&&newVal[0].exclusionType===1;
+          },
+          deep:true
+        }
     },
     methods: {
         handleExclu(){
@@ -119,7 +126,11 @@ export default {
             }
             const arr = this.rightTagsList.map((it)=>{
               if(it.id==this.selectRightTagsList[0].id){
-                it.exclusionType=1;
+                if(it.exclusionType===1){
+                  it.exclusionType = 0
+                }else{
+                  it.exclusionType=1;
+                }
               }else{
                 it.exclusionType=0;
               }