panzy
2022-05-21 027c1fcde746ddfea5af9d9e35cf3ac1d12c0bca
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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
<template>
    <div class="app-container">
 
        <el-table :data="tableData" style="width: 100%" @selection-change="changeBox">
            <el-table-column type="selection" width="55" align="center"></el-table-column>
            <el-table-column prop="ht_community" label="单位" align="center" width="120"></el-table-column>
            <el-table-column prop="number" label="编号" align="center" width="120">
                <template slot-scope="scope">
                    <div class="blue-font-color" @click="showDetails(scope.row)">{{ scope.row.number }}</div>
                </template>
            </el-table-column>
            <el-table-column prop="check_branch" label="检查部门" align="center" width="120"></el-table-column>
            <el-table-column prop="check_man" label="检查人" align="center" width="120"></el-table-column>
            <!-- <el-table-column prop="checktype" label="检查类别" align="center"></el-table-column> -->
            <el-table-column label="隐患项目" align="center">
                <el-table-column prop="check_date" label="检查时间" width="120" align="center">
                    <template slot-scope="scope">
                        <label>{{ formatDate(scope.row.check_date) }}</label><br/>
                        <label>{{ scope.row.check_class }}</label>
                    </template>
                </el-table-column>
                <el-table-column prop="address" label="地点" align="center">
                    <template slot-scope="scope">
                        <el-popover trigger="hover" placement="top">
                            <p>{{ scope.row.address }}</p>
                            <div slot="reference" class="name-wrapper">{{
                                    scope.row.address != null && scope.row.address.length > 10 ? scope.row.address.substring(0, 8) + "...." : scope.row.address
                                }}
                            </div>
                        </el-popover>
                    </template>
                </el-table-column>
                <el-table-column prop="ht_content" label="内容" align="center">
                    <template slot-scope="scope">
                        <el-popover trigger="hover" placement="top">
                            <p>{{ scope.row.ht_content }}</p>
                            <div slot="reference" class="name-wrapper">{{
                                    scope.row.ht_content != null && scope.row.ht_content.length > 10 ? scope.row.ht_content.substring(0, 8) + "...." : scope.row.ht_content
                                }}
                            </div>
                        </el-popover>
                    </template>
                </el-table-column>
                <el-table-column prop="ht_typesub" label="类别" align="center"></el-table-column>
                <el-table-column prop="ht_level" label="级别" width="100" align="center"></el-table-column>
            </el-table-column>
            <el-table-column label="整改计划" align="center">
                <el-table-column prop="measure" label="整改措施" width="150" align="center"></el-table-column>
                <el-table-column prop="ht_branch" label="责任单位" align="center"></el-table-column>
                <el-table-column prop="duty_officer" label="责任人" align="center"></el-table-column>
                <el-table-column prop="alter_time" label="限改时间" width="120" :formatter="formatColumnDate" align="center"></el-table-column>
                <!-- <el-table-column prop="ht_level" label="级别" align="center"> </el-table-column> -->
            </el-table-column>
            <el-table-column label="整改情况" align="center">
                <el-table-column prop="ACCOMPLISHTIME" label="完成时间" width="110px" :formatter="formatColumnDate" align="center"></el-table-column>
                <el-table-column prop="CALLBACKRESULT" label="复查结果" align="center"></el-table-column>
                <el-table-column prop="CALLBACKPERSON" label="复查人" align="center"></el-table-column>
                <el-table-column prop="CALLBACKTIME" label="复查时间" width="120" :formatter="formatColumnDate" align="center"></el-table-column>
            </el-table-column>
            <el-table-column label="隐患处理状态" align="center">
                <template slot-scope="scope">
                    <span v-if="scope.row.step =='1'">初始状态</span>
                    <span v-if="scope.row.step =='2'">整改中</span>
                    <span v-if="scope.row.step =='3'">复查中</span>
                    <span v-if="scope.row.step =='end'">处理结束</span>
                </template>
            </el-table-column>
            <el-table-column prop="DTRisk_bankId" label="是否关联" align="center">
                <template slot-scope="scope">
                    <span style="color: red"
                        v-if="scope.row.DTRisk_bankId==0 || scope.row.DTRisk_bankId=='' || scope.row.DTRisk_bankId==null">未关联</span>
                    <span v-else>已关联</span>
                </template>
            </el-table-column>
            <el-table-column prop="DTRisk_level" label="风险等级" align="center"></el-table-column>
            <el-table-column prop="warningLevel" label="初始警情" align="center"></el-table-column>
            <el-table-column prop="curWarningLevel" label="当前警情" align="center"></el-table-column>
            <!-- <el-table-column prop="date" label="流程操作" align="center"  fixed="right">
                <template slot-scope="scope">
                    <el-button @click="handleClick(scope.row)" type="text" size="small">点击发送</el-button>
                </template>
            </el-table-column> -->
            <!-- <el-table-column prop="date" label="操作" align="center"  fixed="right">
                <template slot-scope="scope">
                    <el-button @click="updateClick(scope.row)" type="text" size="small">编辑</el-button>
                    <el-button @click="deleteClick(scope.row)" type="text" size="small">删除</el-button>
                </template>
            </el-table-column> -->
        </el-table>
        <div style="text-align: right">
            <el-pagination
                v-show="recordTotal > 0"
                @size-change="handleSizeChange"
                @current-change="handleCurrentChange"
                :current-page="currentPage"
                :page-sizes="[10, 20, 30, 50]"
                :page-size="pageSize"
                layout="total, sizes, prev, pager, next, jumper"
                :total="recordTotal"
            >
            </el-pagination>
        </div>
        <div class="btn">
            <el-button size="small" @click="close()">关闭</el-button>
        </div>
    </div>
</template>
<script>
import {getPageList} from "@/api/sgyhpczl/safetyHazardAccount";
import {initJCBM, initYHLX, initBC, initJCLB, initYHBM, initYHJB, initLlr} from "@/api/sgyhpczl/initSelect";
 
export default {
    data() {
        return {
            radio1: '超期整改',
            selectedList: [],
            reList: [{label: "未关联", value: 0}],
            llrList: [],
            options: [],
            form: {},
 
            JCDWList: [{label: "众泰煤焦化", value: 0}, {label: "上级单位", value: 1}],
            JCBMList: [],
            YHLXList: [],
            BCList: [],
            JCLBList: [],
            YHBMList: [],
            YHJBList: [],
            tableData: [],
            listQuery: {
 
 
                page: 1,
                limit: 10,
                type: 0,
                form: {
                    // ht_community:"众泰煤焦化"
                },
            },
            currentPage: 1,
            pageSize: 10,
            recordTotal: 0,
        };
    },
    mounted() {
        if(this.$route.query.searchData.query_condition!=null){
            var searchData = this.$route.query.searchData;
            for (const argumentsKey in searchData) {
                this.listQuery.form[argumentsKey] = searchData[argumentsKey];
            }
            this.getPageList()
        }
        this.initYHLX()
        this.initYHJB()
        this.initBC()
        this.initJCLB()
        this.initLlr()
        this.initYHBM()
 
    },
    methods: {
        deleteBatch() {
            if (this.selectedList == null || this.selectedList.length == 0) {
                this.$message({type: 'warning', message: '至少选中一条数据', duration: 3000})
                return
            }
            var ids = this.selectedList.map((obj) => {
                return obj.id
            }).join(",")
            this.$confirm('确认删除吗', '提示', {
                confirmButtonText: '确认',
                cancelButtonText: '取消',
                type: 'warning'
            })
                .then(() => {
                    delDanger(ids).then(() => {
                        this.getPageList()
                        this.$notify({
                            title: "成功",
                            message: "删除成功",
                            type: "success",
                            duration: 2000,
                        });
                    });
                })
                .catch(error => {
                });
        },
        changeBox(val) {
            this.selectedList = []
            val.forEach((item) => {
                this.selectedList.push(item)
            })
        },
        initLlr() {
            initLlr().then(res => {
                if (res.data.ok == 1) {
                    this.llrList = res.data.data
                } else {
                    this.$message({type: 'error', message: res.data.msg, duration: 3000})
                }
            })
        },
        initYHBM() {
            initYHBM().then(res => {
                if (res.data.ok == 1) {
                    this.YHBMList = res.data.data
                } else {
                    this.$message({type: 'error', message: res.data.msg, duration: 3000})
                }
            })
        },
        changeJCDW(val) {
            initJCBM(val).then(res => {
                if (res.data.ok == 1) {
                    this.JCBMList = res.data.data
                } else {
                    this.$message({type: 'error', message: res.data.msg, duration: 3000})
                }
            })
        },
        checkTime() {
            if (this.listQuery.form.check_dateStart != null && this.listQuery.form.check_dateStart != '') {
                if (this.listQuery.form.check_dateEnd != null && this.listQuery.form.check_dateEnd != '') {
                } else {
                    this.$message({type: 'error', message: "请选择检查结束时间", duration: 3000})
                    return
                }
 
            }
            if (this.listQuery.form.check_dateEnd != null && this.listQuery.form.check_dateEnd != '') {
                if (this.listQuery.form.check_dateStart != null && this.listQuery.form.check_dateStart != '') {
                } else {
                    this.$message({type: 'error', message: "请选择检查开始时间", duration: 3000})
                    return
                }
            }
            if (this.listQuery.form.alter_timeStart != null && this.listQuery.form.alter_timeStart != '') {
                if (this.listQuery.form.alter_timeEnd != null && this.listQuery.form.alter_timeEnd != '') {
                } else {
                    this.$message({type: 'error', message: "请选择限改结束时间", duration: 3000})
                    return
                }
 
            }
            if (this.listQuery.form.alter_timeEnd != null && this.listQuery.form.alter_timeEnd != '') {
                if (this.listQuery.form.alter_timeStart != null && this.listQuery.form.alter_timeStart != '') {
                } else {
                    this.$message({type: 'error', message: "请选择改开始时间", duration: 3000})
                    return
                }
            }
        },
        getPageList() {
            this.listQuery.page = 1
            this.checkTime()
            getPageList(this.listQuery).then(res => {
                if (res.data.ok == 1) {
                    this.tableData = res.data.data.items
                    this.recordTotal = res.data.data.total
                } else {
                    this.$message({type: 'error', message: res.data.msg, duration: 3000})
                }
            })
        },
        reset() {
            this.listQuery.form = {ht_community: "众泰煤焦化"}
            this.getPageList()
        },
        handleSizeChange(val) {
            this.listQuery.limit = val
            this.getPageListForPagination();
        },
        handleCurrentChange(val) {
            this.listQuery.page = val
            this.getPageListForPagination();
        },
        getPageListForPagination() {
            this.checkTime()
            getPageList(this.listQuery).then(res => {
                if (res.data.ok == 1) {
                    this.tableData = res.data.data.items
                    this.recordTotal = res.data.data.total
                } else {
                    this.$message({type: 'error', message: res.data.msg, duration: 3000})
                }
            })
        },
        initYHLX() {
            initYHLX().then(res => {
                if (res.data.ok == 1) {
                    this.YHLXList = res.data.data
                } else {
                    this.$message({type: 'error', message: res.data.msg, duration: 3000})
                }
            })
        },
        initYHJB() {
            initYHJB().then(res => {
                if (res.data.ok == 1) {
                    this.YHJBList = res.data.data
                } else {
                    this.$message({type: 'error', message: res.data.msg, duration: 3000})
                }
            })
        },
        initBC() {
            initBC().then(res => {
                if (res.data.ok == 1) {
                    this.BCList = res.data.data
                } else {
                    this.$message({type: 'error', message: res.data.msg, duration: 3000})
                }
            })
        },
        initJCLB() {
            initJCLB().then(res => {
                if (res.data.ok == 1) {
                    this.JCLBList = res.data.data
                } else {
                    this.$message({type: 'error', message: res.data.msg, duration: 3000})
                }
            })
        },
        //方法区
        formatDate(data) {
            // 获取单元格数据
            if (data == null) {
                return null
            }
            let dt = new Date(data)
            return dt.getFullYear() + '-' + (dt.getMonth() + 1) + '-' + dt.getDate()
        },
        //方法区
        formatColumnDate(row, column) {
            // 获取单元格数据
            let data = row[column.property]
            if (data == null) {
                return null
            }
            let dt = new Date(data)
            return dt.getFullYear() + '-' + (dt.getMonth() + 1) + '-' + dt.getDate() + ' '
        },
        showDetails(row){
            this.$router.push({
                path: "/dangerDetails",
                query:{"id":row.id,"route":"/summaryList"}
            })
        },
        close(){
            this.$router.push({
                path: "/summaryPotentialSafetyHzards"
            })
 
        }
    }
};
</script>
<style scoped>
.inquire {
    display: flex;
    justify-content: left;
    flex-wrap: wrap;
}
 
.inquire .el-form-item {
    padding: 0 30px;
}
 
.title-center {
    padding: 20px 0;
}
 
.btns {
    background-color: #034ea2;
    border: 1px solid #034ea2;
}
 
.title-center /deep/ .el-radio-button:first-child .el-radio-button__inner {
    border: none;
}
 
.title-center /deep/ .el-radio-button__inner {
    border: none;
    border-radius: 0px;
}
 
.title-center /deep/ .el-radio-button__orig-radio:checked + .el-radio-button__inner {
    background-color: #034ea2;
    background-color: #034ea2;
}
.btn{
    text-align: center;
    margin-top: 20px;
}
.blue-font-color:hover{
    cursor: pointer;
    color: blue;
}
</style>