lct
Your Name
2022-08-23 3c647d3837f7a1c2c146b7d4c39a87174782215f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<template>
    <div class="app-container">
        <div class="filter-container">
            <el-button class="filter-item" type="primary" icon="el-icon-plus" @click="showControlAction()">选择风险管控措施</el-button>
        </div>
        <div class="table_content">
            <el-table
                v-loading="listLoading"
                :key="tableKey"
                :data="inspectionPointData"
                border
                fit
                highlight-current-row
                style="width: 100%;"
            >
                <el-table-column label="序号" type="index" width="150" align="center">
                </el-table-column>
                 <el-table-column label="隐患排查内容" prop="checkContent" align="center" show-overflow-tooltip>
                </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)" v-show="ifEdit">详情</el-button>-->
                        <el-button type="text" style="color:red;" @click="deleteById(scope.$index,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" @closeDialog="closeDialog" @giveRiskControlId="receiveRiskControlId" @keepValue="keepValue"></control-action>
        </el-dialog>
    </div>
</template>
 
<script>
    import controlAction from '../../../riskLevelManage/controlAction/controlActionSelect/index'
    import { addInspectionControlAction, deleteInspectionControlAction ,getInspectionControlAction } from '../../../../../api/inspectionTask'
    export default {
        props:['title','inspectionTaskForm'],
        name: "inpectionPoint",
        data(){
            return{
                tableKey:'',
                listLoading:false,
                ifEdit:false,
                ifShowControl:true,
                controlActionVisible:false,
                riskControlMeasureVisible:false,
                riskControlMeasureForm:[],
                inspectionPointData:[],
                keepValueList:[],
                controlActionForm:{
                    workId:'',
                    measureId:'',
                }
            }
        },
        components:{
            controlAction
        },
        methods:{
            showControlAction (){
                this.controlActionVisible = true
                setTimeout( () => {
                    this.$refs.controlAction.ifShowButton(this.inspectionPointData,this.title)
                })
            },
            showMeasureDetail(val){
                this.controlActionVisible = true
                setTimeout( () => {
                    this.$refs.controlAction.showMeasureDetail(val)
                    this.$refs.controlAction.ifShowSelf = false
                })
            },
            closeDialog(){
                this.controlActionVisible = false
            },
            async receiveRiskControlId(value) {
                this.controlActionVisible  = false
                //     if(value){
                //         this.inspectionPointData = JSON.parse(JSON.stringify(value.map( item => {
                //             return {
                //                 id:item.id,
                //                 checkContent:item.checkContent
                //             }
                //         })))
                this.inspectionPointData = value
                this.$emit('giveToForm',value)
                    // }
            },
            deleteById(value,scope){
                this.inspectionPointData.splice(value,1)
                this.$emit('giveToForm',this.inspectionPointData)
            },
            async getControlActionList(){
                let res = await getInspectionControlAction(this.inspectionTaskForm.workId)
                this.inspectionPointData = res.data.result.checkContents
            },
            keepValue(value){
                this.keepValueList = value
            }
        }
    }
</script>
 
<style scoped>
/deep/.filter-container{
    padding-left: 0px !important;
}
    .analyseUnit_input{
        width:200px;
    }
</style>