lct123456
2022-04-25 70fb6d09d29ca1b4ba29a9299f310e2455301b8c
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<template>
    <div>
        <el-table :data="tasksecurity" border fit highlight-current-row style="width: 100%;" :header-cell-style="{'text-align':'center'}">
            <el-table-column type="index" label="序号" align="center" width="60"/>
            <el-table-column prop="content" label="安全措施" align="left">
                <template slot-scope="scope">
                    <div v-if="scope.row.checktype === '判断'">
                        {{scope.row.content}}
                    </div>
                    <div v-if="scope.row.checktype === '填空'">
                        <span>{{scope.row.content.split('_')[0]}}</span>
                        <el-input style="width:50px" v-model="scope.row.num"></el-input>
                        <span>{{scope.row.content.split('_')[1]}}</span>
                    </div>
                </template>
            </el-table-column>
            <el-table-column prop="checked" label="选项" align="center" width="300">
                <template slot-scope="scope">
                    <el-radio v-model="scope.row.checked" :label="1">是</el-radio>
                    <el-radio v-model="scope.row.checked" :label="0">否</el-radio>
                    <el-radio v-model="scope.row.checked" :label="2">不涉及</el-radio>
                </template>
            </el-table-column>
        </el-table>
        <div align="center" style="padding-top: 20px" v-if="title === '新增' || title === '编辑' || title=== '施工单位确认' || title === '施工单位信息填写' || title === '复制'">
            <el-button type="primary" @click="goNext">下一步</el-button>
        </div>
    </div>
</template>
 
<script>
import { getSafetyActionList } from '@/api/task'
 
export default {
    props:['basicInformation','title'],
    name: 'index',
    data(){
        return{
            currentPage:0,
            pageSize:1000,
            tasksecurity:[],
            safetyActionData:[
                // {id:0,selected:true,action:'动火设备内部构件清理干净,蒸汽吹扫或水洗合格,达到用火条件。',type:0},
                // {id:1,selected:null,actionOne:'',actionTwo:'',type:1},
                // {id:2,selected:null,action:'动火点10m范围内及动火点下部区域严禁同时进行可燃溶剂清洗和喷漆等作业。在受限空间内进行动火作业、临时用电作业时,不得同时进行刷漆、喷漆作业或使用可燃溶剂清洗等其他可能散发易燃气体、可燃液体的作业。',type:0},
                // {id:3,selected:null,action:'动火点周围的下水井、地漏、地沟、电缆沟等已清除易燃物,并已采取覆盖、铺沙、水封等手段进行隔离。',type:0},
                // {id:4,selected:null,action:'动火点周围易燃物已清除。',type:0},
                // {id:5,selected:null,action:'罐区内动火点同一围堰内和防火间距内的储罐不同时进行脱水作业,排凝等作业。',type:0},
                // {id:6,selected:null,action:'距动火点30m内严禁排放可燃气体,15m内严禁排放各类可燃液体。',type:0},
                // {id:7,selected:null,action:'电焊回路线已接在焊件上,把线未穿过下水井或其它设备搭接。',type:0},
                // {id:8,selected:null,action:'高处作业已采取防火花飞溅措施。',type:0},
                // {id:9,selected:null,action:'乙炔气瓶(直立放置)、氧气瓶与火源间的距离大于10m,二者间距不应小于5m。',type:0},
                // {id:10,selected:null,actionOne:'',actionTwo:'',actionThree:'',actionFour:'',type:2},
                // {id:11,selected:null,actionOne:'',type:3},
                ],
        }
    },
    methods:{
        async getSafeTyAction(){
            let typeList = []
            for(let i in this.basicInformation.subTaskInfos){
                typeList.push(this.basicInformation.subTaskInfos[i].type)
            }
            let params = {}
            params['pageIndex'] = this.currentPage
            params['pageSize'] = this.pageSize
            params['type'] = '申请单位负责检查项'
            this.safetyActionData = []
            this.tasksecurity = []
            let res = await getSafetyActionList(params)
            if(res.data.code === '200'){
                this.safetyActionData = res.data.result
                for(let i in this.safetyActionData){
                    if(typeList.indexOf(this.safetyActionData[i].tasktype) !== -1){
                        this.tasksecurity.push({
                            id:this.safetyActionData[i].id,
                            taskcode: this.basicInformation.code,
                            content: this.safetyActionData[i].content,
                            checked: this.safetyActionData[i].check,
                            num: this.safetyActionData[i].number,
                            confirmedby: "test",
                            checktype:this.safetyActionData[i].checktype,
                            tasktype:this.safetyActionData[i].tasktype
                        })
                    }
                }
                // this.safetyActionData.filter(item =>{
                //     if(typeList.indexOf(item.tasktype) !== -1){
                //         return{
                //             id:item.id,
                //             taskcode: this.basicInformation.code,
                //             content: item.content,
                //             checked: item.check,
                //             num: item.number,
                //             confirmedby: "test",
                //             checktype:item.checktype,
                //             tasktype:item.tasktype
                //         }
                //     }
                // })
                // console.log(typeList)
            }else{
                this.$message({
                    message:res.data.message,
                    type:'warning'
                })
            }
        },
        async getConstructionAction(){
            // let typeList = []
            // for(let i in this.basicInformation.subTaskInfos){
            //     typeList.push(this.basicInformation.subTaskInfos[i].type)
            // }
            let params = {}
            params['pageIndex'] = this.currentPage
            params['pageSize'] = this.pageSize
            params['type'] = '施工单位负责检查项'
            this.safetyActionData = []
            this.tasksecurity = []
            let res = await getSafetyActionList(params)
            if(res.data.code === '200'){
                this.safetyActionData = res.data.result
                // for(let i in this.safetyActionData){
                //     if(typeList.indexOf(this.safetyActionData[i].tasktype) !== -1){
                //         this.tasksecurity.push({
                //             id:this.safetyActionData[i].id,
                //             taskcode: this.basicInformation.code,
                //             content: this.safetyActionData[i].content,
                //             checked: this.safetyActionData[i].check,
                //             num: this.safetyActionData[i].number,
                //             confirmedby: "test",
                //             checktype:this.safetyActionData[i].checktype,
                //             tasktype:this.safetyActionData[i].tasktype
                //         })
                //     }
                // }
                this.tasksecurity = this.safetyActionData.map(item =>{
                    return {
                        id:item.id,
                        taskcode: this.basicInformation.code,
                        content: item.content,
                        checked: item.check,
                        num: item.number,
                        confirmedby: "test",
                        checktype:item.checktype,
                    }
                })
            }else{
                this.$message({
                    message:res.data.message,
                    type:'warning'
                })
            }
        },
        goNext(){
            if(this.title === '施工单位确认'){
                this.$emit('changeToConstructionConfirm')
            }else if(this.title === '施工单位信息填写'){
                this.$emit('confirmConstruction')
            }else {
                this.$emit('changeToCardFile')
            }
        },
    }
}
</script>
 
<style scoped>
 
</style>