From 8b19ecdb7b8f688e88d680262edbb00908e531b0 Mon Sep 17 00:00:00 2001
From: lct123456 <lucht>
Date: 星期二, 19 四月 2022 20:36:58 +0800
Subject: [PATCH] 巡检任务细节

---
 src/views/doublePreventAction/hiddenDanger/inspectionTask/components/inpectionPoint.vue |  102 ++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 85 insertions(+), 17 deletions(-)

diff --git a/src/views/doublePreventAction/hiddenDanger/inspectionTask/components/inpectionPoint.vue b/src/views/doublePreventAction/hiddenDanger/inspectionTask/components/inpectionPoint.vue
index e1a5b76..777f7d5 100644
--- a/src/views/doublePreventAction/hiddenDanger/inspectionTask/components/inpectionPoint.vue
+++ b/src/views/doublePreventAction/hiddenDanger/inspectionTask/components/inpectionPoint.vue
@@ -13,40 +13,43 @@
                 highlight-current-row
                 style="width: 100%;"
             >
-                <el-table-column label="安全风险事件名称" prop="riskEventId" align="center">
+                <el-table-column label="序号" type="index" width="150" align="center">
                 </el-table-column>
-                <el-table-column label="管控方式" prop="dataSrc" align="center">
+                 <el-table-column label="管控方式描述" prop="content" align="center">
                 </el-table-column>
-                <el-table-column label="管控方式描述" prop="riskMeasureDesc" align="center">
-                </el-table-column>
-                <el-table-column label="管控措施分类1" prop="classify1" align="center">
-                </el-table-column>
-                <el-table-column label="管控措施分类2" prop="classify2" align="center">
-                </el-table-column>
-                <el-table-column label="管控措施分类3" prop="classify3" align="center">
-                </el-table-column>
-                <el-table-column label="隐患排查内容" prop="troubleshootContent" align="center">
-                </el-table-column>
-                <el-table-column label="检查类型" prop="hazardLiablePerson" align="center">
+                   <el-table-column label="操作" align="center" width="280" class-name="small-padding fixed-width">
+                    <template slot-scope="scope">
+                        <el-button type="text" @click="showMeasureDetail(scope.row)">详情</el-button>
+                        <el-button type="text" style="color:red;" @click="deleteById(scope.row)">删除</el-button>
+                    </template>
                 </el-table-column>
             </el-table>
         </div>
         <el-dialog :visible.sync="controlActionVisible"  append-to-body :close-on-click-modal="false" width="80%">
-            <control-action ref="controlAction" @giveRiskControlId="receiveRiskControlId"></control-action>
+            <control-action ref="controlAction" @closeDialog="closeDialog" @giveRiskControlId="receiveRiskControlId"></control-action>
         </el-dialog>
     </div>
 </template>
 
 <script>
     import controlAction from '../../../riskLevelManage/controlAction/index'
+    import { addInspectionControlAction, deleteInspectionControlAction ,getInspectionControlAction } from '../../../../../api/inspectionTask'
     export default {
+        props:['title','inspectionTaskForm'],
         name: "inpectionPoint",
         data(){
             return{
                 tableKey:'',
                 listLoading:false,
+                ifShowControl:true,
                 controlActionVisible:false,
+                riskControlMeasureVisible:false,
+                riskControlMeasureForm:[],
                 inspectionPointData:[],
+                controlActionForm:{
+                    workId:'',
+                    measureId:'',
+                }
             }
         },
         components:{
@@ -59,10 +62,72 @@
                     this.$refs.controlAction.ifShowButton()
                 })
             },
-            receiveRiskControlId(value) {
+            showMeasureDetail(val){
+                this.controlActionVisible = true
+                setTimeout( () => {
+                    this.$refs.controlAction.showMeasureDetail(val)    
+                })
+         
+            },
+            closeDialog(){
+                this.controlActionVisible = false
+            },
+            async receiveRiskControlId(value) {
                 this.controlActionVisible  = false
-                this.inspectionPointData = JSON.parse(JSON.stringify(value))
-                this.$emit('giveToForm',this.inspectionPointData)
+                if(this.title === '新建巡检计划设定'){
+                    if(value){
+                        //     this.inspectionPointData = JSON.parse(JSON.stringify(value.map( item => {
+                        //     return {
+                        //         id:item.id,
+                        //         content:item.riskMeasureDesc    
+                        //     }
+                        // })))
+                        this.inspectionPointData.push({id:value.id,content:value.riskMeasureDesc})
+                        this.$emit('giveToForm',this.inspectionPointData)
+                        }
+                }else{
+                    this.controlActionForm.workId = JSON.stringify(this.inspectionTaskForm.workId)
+                    this.controlActionForm.measureId =JSON.stringify(value.id)
+                    let res = await addInspectionControlAction(this.controlActionForm)
+                    if(res.data.code === '200'){
+                        this.getControlActionList()
+                        this.$message({
+                            type:'success',
+                            duretion:2000,
+                            message:'新增管控措施成功',
+                            title:'成功'
+                        })
+                    }else{
+                        this.$message({
+                            type:'warning',
+                            message:res.data.message
+                        })
+                    }
+                }    
+            },
+            deleteById(value){
+                this.$confirm('删除此条措施,是否继续','提示',{
+                    confirmButtonText:'确定',
+                    cancelButtonText:'取消',
+                    type:'warning',
+                }).then(()=> {
+                    deleteInspectionControlAction({workId:value.workId,measureId:value.measureId}).then( (res)=>{
+                        if(res.data.code === '200'){
+                            this.getControlActionList()
+                            this.$notify({
+                            title:'成功',
+                            message:'删除成功',
+                            type:'success',
+                            duration:2000,
+                            })
+                        }
+                  
+                    })
+                })
+            },
+            async getControlActionList(){
+                let res = await getInspectionControlAction(this.inspectionTaskForm.workId)
+                this.inspectionPointData = res.data.result.checkContents
             }
         }
     }
@@ -72,4 +137,7 @@
 /deep/.filter-container{
     padding-left: 0px !important;
 }
+    .analyseUnit_input{
+        width:200px;
+    }
 </style>

--
Gitblit v1.9.2