dedsudiyu 11 月之前
父节点
当前提交
9fd1ad5d15
共有 2 个文件被更改,包括 14 次插入4 次删除
  1. 5 1
      src/views/emergencyManagement/plan/addPlan.vue
  2. 9 3
      src/views/emergencyManagement/plan/index.vue

+ 5 - 1
src/views/emergencyManagement/plan/addPlan.vue

@@ -469,7 +469,11 @@
       },
       //实验室关联开关
       associatedDialogClick(type){
-        this.$parent.tableClickButton(1,{id:this.addPlanData.id,type:1,})
+        if(!this.form.labRiskPlanLevels[0]){
+          this.msgError('请先添加预案规则');
+        }else{
+          this.$parent.tableClickButton(1,{id:this.addPlanData.id,type:1,})
+        }
       },
       //新增按钮
       addMinData(type){

+ 9 - 3
src/views/emergencyManagement/plan/index.vue

@@ -109,7 +109,7 @@
 <script>
 //                        V3
 import { laboratoryMusicFindByType,laboratoryPlanList,laboratoryPlanAdd,
-  laboratoryPlanDelete } from "@/api/emergencyManagement/index";
+  laboratoryPlanDelete,laboratoryRiskPlanLevelGetRiskPlanLeveList } from "@/api/emergencyManagement/index";
 import { iotAttributeGetByTypeKey } from "@/api/iotDevice/index";
 import addPlanPage from "./addPlan.vue";
 import associationPage from "./associatedPage.vue";
@@ -189,8 +189,14 @@ export default {
     tableClickButton(type,item){
       let self = this;
       if(type == 1){
-        this.$set(this,'associationData',JSON.parse(JSON.stringify(item)));
-        this.$set(this,'pageType',4);
+        laboratoryRiskPlanLevelGetRiskPlanLeveList({riskPlanId:item.id}).then((response) => {
+          if(!response.data[0]){
+            this.msgError('请先添加预案规则');
+          }else{
+            this.$set(this,'associationData',JSON.parse(JSON.stringify(item)));
+            this.$set(this,'pageType',4);
+          }
+        });
       }else if(type == 2){
         this.$set(this,'addPlanData',JSON.parse(JSON.stringify({id:item.id,name:item.name,musicId:item.musicId})));
         this.$set(this,'pageType',1);