From ad32b10947b4b94c058ccb9a718d362a1e58d386 Mon Sep 17 00:00:00 2001 From: lyfO_o <764716047@qq.com> Date: 星期五, 29 四月 2022 13:09:30 +0800 Subject: [PATCH] 用户导出 --- src/views/doublePreventAction/hiddenDanger/inspectionTask/components/inpectionPoint.vue | 49 +++++++++++++++++++++++++++++-------------------- 1 files changed, 29 insertions(+), 20 deletions(-) diff --git a/src/views/doublePreventAction/hiddenDanger/inspectionTask/components/inpectionPoint.vue b/src/views/doublePreventAction/hiddenDanger/inspectionTask/components/inpectionPoint.vue index 777f7d5..083b51d 100644 --- a/src/views/doublePreventAction/hiddenDanger/inspectionTask/components/inpectionPoint.vue +++ b/src/views/doublePreventAction/hiddenDanger/inspectionTask/components/inpectionPoint.vue @@ -15,12 +15,12 @@ > <el-table-column label="序号" type="index" width="150" align="center"> </el-table-column> - <el-table-column label="管控方式描述" prop="content" align="center"> + <el-table-column label="隐患排查内容" prop="content" align="center"> </el-table-column> <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> + <el-button type="text" @click="showMeasureDetail(scope.row)" v-show="ifEdit">详情</el-button> + <el-button type="text" style="color:red;" @click="deleteById(scope.$index)">删除</el-button> </template> </el-table-column> </el-table> @@ -41,6 +41,7 @@ return{ tableKey:'', listLoading:false, + ifEdit:false, ifShowControl:true, controlActionVisible:false, riskControlMeasureVisible:false, @@ -65,7 +66,8 @@ showMeasureDetail(val){ this.controlActionVisible = true setTimeout( () => { - this.$refs.controlAction.showMeasureDetail(val) + this.$refs.controlAction.showMeasureDetail(val) + this.$refs.controlAction.ifShowSelf = false }) }, @@ -82,8 +84,10 @@ // content:item.riskMeasureDesc // } // }))) - this.inspectionPointData.push({id:value.id,content:value.riskMeasureDesc}) - this.$emit('giveToForm',this.inspectionPointData) + if(this.inspectionPointData.findIndex(item => item.id === value.id) === -1) { + this.inspectionPointData.push({id:value.id,content:value.riskMeasureDesc}) + this.$emit('giveToForm',this.inspectionPointData) + } } }else{ this.controlActionForm.workId = JSON.stringify(this.inspectionTaskForm.workId) @@ -106,24 +110,29 @@ } }, deleteById(value){ - this.$confirm('删除此条措施,是否继续','提示',{ + if(this.title === '新建巡检计划设定'){ + this.inspectionPointData.splice(value,1) + }else{ + 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, - }) - } - + }).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) -- Gitblit v1.9.2