dedsudiyu 2 年 前
コミット
c673c1d91e

+ 8 - 0
src/api/evacuation3_2/index.js

@@ -119,3 +119,11 @@ export function lineVertex(data) {
     data: data
   })
 }
+//获取预案详情
+export function selectRiskPlanLeveList(data) {
+  return request({
+    url: '/zd-laboratory/plan/lists/',
+    method: 'post',
+    data: data
+  })
+}

+ 2 - 2
src/views/comprehensive/laboratoryManagement/building/newIndex.vue

@@ -8,7 +8,7 @@
             <div class="max-name-box">
               <p class="max-name" :class="checkTreeId==item.id?'check-color':''" @click="clickCheckTree(item,1)">
                 {{item.name}}</p>
-              <el-dropdown @command="(command)=>handleCommand(command,item)">
+              <el-dropdown @command="(command)=>handleCommand(command,item)" trigger="click">
                 <img src="@/assets/ZDimages/evacuation3_2/icon_bjgl_gd.png"
                      style="cursor:pointer;width:16px;height:4px;margin-top:7px;">
                 <el-dropdown-menu slot="dropdown">
@@ -241,7 +241,7 @@
               <el-table-column label="房间号" align="left" prop="roomNum" width="100"/>
               <el-table-column label="房间名称" align="left" prop="roomName">
                 <template slot-scope="scope">
-                  <span>{{scope.row.roomType!='-99'?scope.row.subName:scope.row.roomNum}}</span>
+                  <span>{{scope.row.roomType!='-99'?scope.row.subName:scope.row.roomName}}</span>
                   <!--<span>{{scope.row.roomType}}</span>-->
                 </template>
               </el-table-column>

+ 31 - 76
src/views/emergencyManagement/plan/index.vue

@@ -36,14 +36,14 @@
           <!--&gt;</el-date-picker>-->
         <!--</el-form-item>-->
         <el-form-item style="float: right;" v-hasPermi="['laboratory:plan:add']">
-          <p class="inquire-button-one" style="width:130px;" @click="handleClick('', '', 'add')">定制预案</p>
+          <p class="inquire-button-one" style="width:130px;" @click="tableClickButton(4)">定制预案</p>
         </el-form-item>
         <el-form-item>
           <p class="inquire-button-one" @click="onSearch">查询</p>
           <p class="reset-button-one" @click="resetForm">重置</p>
         </el-form-item>
       </el-form>
-      <el-table v-loading="loading" border :data="tableData" @selection-change="handleSelectionChange">
+      <el-table v-loading="loading" border :data="tableData">
         <el-table-column label="预案名称" align="center" prop="name" :show-overflow-tooltip="true"/>
         <el-table-column label="启动条件" align="center" prop="funNum" :show-overflow-tooltip="true" width="340"/>
         <el-table-column label="创建人" align="center" prop="createBy" width="180"/>
@@ -51,29 +51,9 @@
         <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="340" v-if="tableButtonType">
           <template slot-scope="scope">
             <div class="button-box">
-              <p class="table-min-button" style="margin-left:20px!important;" v-hasPermi="['laboratory:planjoin:edit']">关联实验室</p>
-              <p class="table-min-button" style="margin-left:40px!important;" v-show="userId==scope.row.userId" v-hasPermiAnd="['laboratory:plan:query','laboratory:plan:edit']">编辑</p>
-              <p class="table-min-button" style="margin-left:40px!important;color:#FE2B2B;" v-show="userId==scope.row.userId" v-hasPermi="['laboratory:plan:remove']">删除</p>
-
-
-
-              <!--<p class="table-min-button" style="margin-right:10px;" v-hasPermi="['laboratory:plan:query']"-->
-                 <!--@click="handleClick(scope.$index, scope.row,'detail')">查看</p>-->
-              <!--<el-dropdown @command="moreClick">-->
-                <!--<p class="table-min-button">更多>></p>-->
-                <!--<el-dropdown-menu slot="dropdown">-->
-                  <!--<el-dropdown-item style="margin:0 10px;" :command="{index:scope.$index,row:scope.row,command:1}"-->
-                                    <!--v-hasPermi="['laboratory:planjoin:edit']">关联实验室</el-dropdown-item>-->
-                  <!--<el-dropdown-item style="margin:0 10px;" :command="{index:scope.$index,row:scope.row,command:2}"-->
-                                    <!--v-hasPermi="['laboratory:distribution:list']">关联记录</el-dropdown-item>-->
-                  <!--<el-dropdown-item style="margin:0 10px;" :command="{index:scope.$index,row:scope.row,command:3}"-->
-                                    <!--v-show="userId==scope.row.userId"-->
-                                    <!--v-hasPermiAnd="['laboratory:plan:query','laboratory:plan:edit']">编辑</el-dropdown-item>-->
-                  <!--<el-dropdown-item style="margin:0 10px;" :command="{index:scope.$index,row:scope.row,command:4}"-->
-                                    <!--v-show="userId==scope.row.userId"-->
-                                    <!--v-hasPermi="['laboratory:plan:remove']">删除</el-dropdown-item>-->
-                <!--</el-dropdown-menu>-->
-              <!--</el-dropdown>-->
+              <p class="table-min-button" style="margin-left:20px!important;" v-hasPermi="['laboratory:planjoin:edit']" @click="tableClickButton(1,scope.row)">关联实验室</p>
+              <p class="table-min-button" style="margin-left:40px!important;" v-show="userId==scope.row.userId" v-hasPermiAnd="['laboratory:plan:query','laboratory:plan:edit']" @click="tableClickButton(2,scope.row)">编辑</p>
+              <p class="table-min-button" style="margin-left:40px!important;color:#FE2B2B;" v-show="userId==scope.row.userId" v-hasPermi="['laboratory:plan:remove']" @click="tableClickButton(3,scope.row)">删除</p>
             </div>
           </template>
         </el-table-column>
@@ -122,6 +102,7 @@ import {listDepartments} from "@/api/system/dept";
 import {listClassifiedAll} from "@/api/laboratory/classified";
 import {listClasstypeAll} from "@/api/laboratory/classtype";
 import {authListSubject} from "@/api/laboratory/subject";
+import { selectRiskPlanLeveList } from "@/api/evacuation3_2/index";
 
 
 export default {
@@ -161,7 +142,6 @@ export default {
       dialogVisible:false,
       //关联记录
       dialogVisible2:false,
-      deptOptions:[],
       typeList:[],
       levelList:[],
       dialogTable:[],
@@ -172,9 +152,32 @@ export default {
     };
   },
   methods: {
+    // 操作按钮 1.关联 2.编辑 3.删除 4.新增
+    tableClickButton(type,item){
+      if(type == 1){
+
+      }else if(type == 2){
+        this.$set(this,'pageData',item);
+        this.$set(this,'pageType',1);
+      }else if(type == 3){
+        this.$confirm('是否确认删除该预案?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+
+        }).then(() => {
+        }).catch(() => {});
+      }else if(type == 4){
+        this.$set(this,'pageData',null);
+        this.$set(this,'pageType',1);
+      }else if(type == 5){
+        this.$set(this,'pageType',0);
+      }
+    },
     //查询
     onSearch() {
-      this.param.pageNo = 1;
+      // this.param.pageNo = 1;
       this.getListPlan();
     },
     //重置
@@ -187,47 +190,6 @@ export default {
       this.param.endTime = '';
       this.onSearch();
     },
-    moreClick(data){
-      if(data.command=='3'){//编辑
-        this.pageType = 1;
-        this.pageData = data.row;
-      }else if(data.command=='4'){//删除
-        const ids = data.row.id || this.ids;
-        this.$confirm('是否确认删除风险预案?', "警告", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(function() {
-          return delPlan(ids);
-        }).then(() => {
-          this.getListPlan();
-          this.msgSuccess("删除成功");
-        }).catch(() => {});
-      }else if(data.command=='1'){
-        this.pageType = 4;
-        this.$set(this,'associationData',data)
-      }else if(data.command=='2'){//关联记录
-        this.dialogVisible2=true;
-        this.pageData3.id=data.row.id
-        this.pageType=3;
-      }
-    },
-    handleClick(index, row, doType) {
-      let _this = this;
-      if(doType == 'add'){//定制预案
-        this.pageType = 1;
-        this.pageData = null
-      }else if(doType=='detail'){//查看
-        this.pageType = 2;
-        this.pageData2.id = row.id
-      }else if(doType=='back'){
-        this.dialogVisible=false;
-        this.pageType = 0;
-        this.propsType = true;
-        this.getListPlan();
-      }
-      this.$forceUpdate();
-    },
     //监听关联记录弹窗关闭
     handleClose(){
       this.pageType=0
@@ -259,14 +221,7 @@ export default {
     getListPlan() {
       let _this=this;
       this.loading = true;
-      if(this.dateRange&&this.dateRange.length>0){
-        this.param.beginTime=this.dateRange[0]
-        this.param.endTime=this.dateRange[1]
-      }else{
-        this.param.beginTime=null;
-        this.param.endTime=null
-      }
-      listPlan(this.param).then(response => {
+      selectRiskPlanLeveList(this.param).then(response => {
         this.$set(this,'tableData',response.rows)
         // this.tableData = response.rows;
         this.total = response.total;

+ 54 - 17
src/views/emergencyManagement/plan/newAddPlan.vue

@@ -2,7 +2,7 @@
   <div class="newAddPlan">
     <div class="newAddPlan-title-box">
       <p>定制预案</p>
-      <p class="add-button-two-90" @click="backPage">返回</p>
+      <p class="add-button-two-90" @click="backButton">返回</p>
       <p class="inquire-button-one">不关联仅保存</p>
       <p class="inquire-button-one" @click="associatedDialogClick(1)">保存并关联实验室</p>
     </div>
@@ -17,9 +17,9 @@
             maxLength="50"
           />
         </el-form-item>
-        <div class="for-plan-box" v-for="(item,index) in form.list" :key="index">
-          <p class="position-title-type" :class="item.type==1?'type-color-a':(item.type==2?'type-color-b':(item.type==3?'type-color-c':(item.type==4?'type-color-d':'')))">
-            {{item.type==1?'低风险':(item.type==2?'中风险':(item.type==3?'较高风险':(item.type==4?'高风险':'')))}}
+        <div class="for-plan-box" v-for="(item,index) in form.labRiskPlanLevels" :key="index">
+          <p class="position-title-type" :class="item.riskPlanLevel==1?'type-color-a':(item.riskPlanLevel==2?'type-color-b':(item.riskPlanLevel==3?'type-color-c':(item.riskPlanLevel==4?'type-color-d':'')))">
+            {{item.riskPlanLevel==1?'低风险':(item.riskPlanLevel==2?'中风险':(item.riskPlanLevel==3?'较高风险':(item.riskPlanLevel==4?'高风险':'')))}}
           </p>
           <div class="for-plan-img-box">
             <p class="for-plan-img-null-p"></p>
@@ -28,21 +28,21 @@
                 <img src="@/assets/ZDimages/evacuation3_2/img_dzya_ldss.png">
                 <p>联动疏散</p>
               </div>
-              <div class="for-plan-img-box-two">
-                <img src="@/assets/ZDimages/evacuation3_2/img_dzya_hzyj.png">
-                <p>火灾预案</p>
-              </div>
+              <!--<div class="for-plan-img-box-two">-->
+                <!--<img src="@/assets/ZDimages/evacuation3_2/img_dzya_hzyj.png">-->
+                <!--<p>火灾预案</p>-->
+              <!--</div>-->
             </div>
             <p class="for-plan-img-null-p"></p>
           </div>
           <div class="min-for-text-box">
-            <div class="min-for-text-box-one">
+            <div class="min-for-text-box-one" v-for="(minItemOne,minIndexOne) in item.riskPlanSensorList" :key="minIndexOne">
               <div>
                 <p>启动条件:</p>
-                <p>监测区间:</p>
+                <p>监测区间:{{minItemOne.minMonitor}}-{{minItemOne.maxMonitor}}</p>
               </div>
             </div>
-            <div class="min-for-text-box-two">
+            <div class="min-for-text-box-two" v-for="(minItemTwo,minIndexTwo) in item.riskPlanHardwareList" :key="minIndexTwo">
               <div>
                 <p>执行动作:</p>
                 <p>执行办法:</p>
@@ -279,8 +279,13 @@
 </template>
 
 <script>
+  import { optionHardware } from "@/api/laboratory/hardware";
+  import { optionSensor } from "@/api/laboratory/sensor";
   export default {
     name: "newAddPlan",
+    props:{
+      pageData:{},
+    },
     data() {
       return {
         form:{
@@ -318,10 +323,44 @@
         //关联实验室
         dialogAssociatedOpen:false,
         tableData:[{}],
+        //选择数据
+        sensorList:[],
+        sensorListData:[],
+        hardwareList:[],
         /***************关联危险源结束****************/
       }
     },
+    created(){
+      if(this.pageData){
+        this.$set(this,'form',this.pageData);
+      }else{
+        this.$set(this,'form',{
+          name:"",
+          labRiskPlanLevels:[],
+        });
+      }
+      console.log('pageData',this.pageData)
+    },
+    mounted(){
+      this.getOptionData();
+    },
     methods: {
+      getOptionData(){
+        optionSensor({}).then(response => {
+          this.sensorList = response.data;
+          this.sensorListData = JSON.parse(JSON.stringify(response.data))
+        });
+        optionHardware({}).then(response => {
+          var allDate = new Array();
+          for(let key=0 ;key<response.data.length;key++){
+            allDate.push({"id":response.data[key].hardwareTypeEnum.code,"name":response.data[key].hardwareTypeEnum.name})
+          }
+          this.hardwareList = allDate;
+        });
+      },
+      backButton(){
+        this.$parent.tableClickButton(5)
+      },
       /***************关联危险源开始****************/
       // 开关
       associatedDialogClick(type){
@@ -363,10 +402,6 @@
       cancel(){
         this.$set(this,'dialogOpen',false);
       },
-      //切换页面
-      backPage() {
-        this.$parent.handleClick('', '', 'back');
-      },
       //新增/编辑预案
       buttonClick(type){
         if(type == 1){
@@ -465,7 +500,7 @@
           background:  rgba(248,206,205);;
         }
         .for-plan-img-box{
-          width:411px;
+          width:284px;
           display: flex;
           flex-direction: column;
           .for-plan-img-null-p{
@@ -482,6 +517,7 @@
                 width:50px;
               }
               p{
+                margin-left:20px;
                 line-height:50px;
                 font-size:14px;
                 color:#333;
@@ -502,7 +538,7 @@
           }
         }
         .min-for-text-box{
-          width:900px;
+          width:1030px;
           padding-top:21px;
           .min-for-text-box-one{
             width:400px;
@@ -529,6 +565,7 @@
             border-radius:6px;
             color:#333;
             background:rgb(253,242,227);
+            display: inline-block;
             div{
               display: flex;
               p:nth-child(1){