morphone1995 4 yıl önce
ebeveyn
işleme
eebf020b7f
1 değiştirilmiş dosya ile 13 ekleme ve 4 silme
  1. 13 4
      src/components/icss/correlation/Correlation.vue

+ 13 - 4
src/components/icss/correlation/Correlation.vue

@@ -5,12 +5,14 @@
       <el-form ref="form" :model="form" label-width="120px">
         <el-form-item label="术语关联:">
           <el-switch
+            v-if="showInfo"
             v-model="form.value"
             active-color="#4BC4D7"
             inactive-color="#ff4949"
             @change="handleChange($event,form.value)"
             :disabled="disabled"
           ></el-switch>
+          <span class="showInfo">{{showInfo}}</span>
         </el-form-item>
       </el-form>
     </div>
@@ -28,15 +30,17 @@ export default {
         value: true
       },
       hospitalId: '',
-      disabled: false
+      disabled: false,
+      showInfo: ''
     };
   },
   created() {
-    this.getHospitalId();
+    this.getHospital();
   },
   methods: {
     // 关联
     handleChange($event, isCorre) {
+      this.showInfo = $event ? '开' : '关'
       this.disabled = true;
       let params = {
         id: this.hospitalId,
@@ -66,10 +70,12 @@ export default {
         });
     },
 
-    // 获取医院id
-    getHospitalId() {
+    // 获取医院信息
+    getHospital() {
       api.getHospitalInfo().then(res => {
         this.hospitalId = res.data.data.id;
+        this.showInfo = res.data.data.connect === 1 ? '开' : '关'
+        this.form.value = res.data.data.connect === 1? true : false
       });
     }
   }
@@ -88,5 +94,8 @@ export default {
     margin: 70px 20px 0 20px;
     background: #fff;
   }
+  .showInfo{
+    margin-left: 10px;
+  }
 }
 </style>