双重预防项目-国泰新华二开定制版
SZH
2022-08-20 f9f0687195e0fe349185437d22c495d74c8d4a20
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
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('数据统计')"/>
    <style type='text/css'>
        .control-label {
            width: 22% !important;
            font-size: 25px;
            text-align: center;
            color: white;
            padding: 10px 0px;
            margin: 10px 2px;
            border-radius: 6px;
            cursor: pointer;
        }
 
        #seriesRiskCountLabel {
            background: -webkit-linear-gradient(0deg, #E00C06, #FE6B65); /* Safari 5.1 - 6.0 */
            background: -o-linear-gradient(0deg, #E00C06, #FE6B65); /* Opera 11.1 - 12.0 */
            background: -moz-linear-gradient(0deg, #E00C06, #FE6B65); /* Firefox 3.6 - 15 */
            background: linear-gradient(0deg, #E00C06, #FE6B65); /* 标准的语法 */
        }
 
        #middleRiskCountLabel {
            background: -webkit-linear-gradient(0deg, #F67407, #FFAF2F); /* Safari 5.1 - 6.0 */
            background: -o-linear-gradient(0deg, #F67407, #FFAF2F); /* Opera 11.1 - 12.0 */
            background: -moz-linear-gradient(0deg, #F67407, #FFAF2F); /* Firefox 3.6 - 15 */
            background: linear-gradient(0deg, #F67407, #FFAF2F); /* 标准的语法 */
        }
 
        #normalRiskCountLabel {
            background: -webkit-linear-gradient(0deg, #FFBB2F, #FFDF00); /* Safari 5.1 - 6.0 */
            background: -o-linear-gradient(0deg, #FFBB2F, #FFDF00); /* Opera 11.1 - 12.0 */
            background: -moz-linear-gradient(0deg, #FFBB2F, #FFDF00); /* Firefox 3.6 - 15 */
            background: linear-gradient(0deg, #FFBB2F, #FFDF00); /* 标准的语法 */
        }
 
        #lowRiskCountLabel {
            background: -webkit-linear-gradient(0deg, #008EFF, #00C2FF); /* Safari 5.1 - 6.0 */
            background: -o-linear-gradient(0deg, #008EFF, #00C2FF); /* Opera 11.1 - 12.0 */
            background: -moz-linear-gradient(0deg, #008EFF, #00C2FF); /* Firefox 3.6 - 15 */
            background: linear-gradient(0deg, #008EFF, #00C2FF); /* 标准的语法 */
        }
 
        #thisMonthHighDangerCountLabel {
            background: -webkit-linear-gradient(0deg, #E00C06, #FE6B65); /* Safari 5.1 - 6.0 */
            background: -o-linear-gradient(0deg, #E00C06, #FE6B65); /* Opera 11.1 - 12.0 */
            background: -moz-linear-gradient(0deg, #E00C06, #FE6B65); /* Firefox 3.6 - 15 */
            background: linear-gradient(0deg, #E00C06, #FE6B65); /* 标准的语法 */
        }
 
        #thisMonthNormalDangerCountLabel {
            background: -webkit-linear-gradient(0deg, #FFBB2F, #FFDF00); /* Safari 5.1 - 6.0 */
            background: -o-linear-gradient(0deg, #FFBB2F, #FFDF00); /* Opera 11.1 - 12.0 */
            background: -moz-linear-gradient(0deg, #FFBB2F, #FFDF00); /* Firefox 3.6 - 15 */
            background: linear-gradient(0deg, #FFBB2F, #FFDF00); /* 标准的语法 */
        }
 
        #unRectifyDangerCountLabel {
            background: -webkit-linear-gradient(0deg, #F67407, #FFAF2F); /* Safari 5.1 - 6.0 */
            background: -o-linear-gradient(0deg, #F67407, #FFAF2F); /* Opera 11.1 - 12.0 */
            background: -moz-linear-gradient(0deg, #F67407, #FFAF2F); /* Firefox 3.6 - 15 */
            background: linear-gradient(0deg, #F67407, #FFAF2F); /* 标准的语法 */
        }
 
        #dangerRectifyPercentLabel {
            background: -webkit-linear-gradient(0deg, #3AB77A, #1FECB1); /* Safari 5.1 - 6.0 */
            background: -o-linear-gradient(0deg, #3AB77A, #1FECB1); /* Opera 11.1 - 12.0 */
            background: -moz-linear-gradient(0deg, #3AB77A, #1FECB1); /* Firefox 3.6 - 15 */
            background: linear-gradient(0deg, #3AB77A, #1FECB1); /* 标准的语法 */
        }
    </style>
 
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <th:block
                        th:if="${roleName=='straightRegionUser'}">
                    <div style="display: flow-root;">
                        <div class="form-group">
                            <a onclick="getTotalNumListByRiskLevel('major')">
                                <label class="col-sm-3 control-label" id="seriesRiskCountLabel">重大风险:<span
                                        id="seriesRiskCount"
                                        th:text="${sumDataStatistics.seriesRiskCount}"></span>
 
                                </label>
                            </a>
                            <a onclick="getTotalNumListByRiskLevel('larger')">
                                <label class="col-sm-3 control-label" id="middleRiskCountLabel">较大风险:<span
                                        id="middleRiskCount"
                                        th:text="${sumDataStatistics.middleRiskCount}"></span></label>
                            </a>
                            <a onclick="getTotalNumListByRiskLevel('general')">
                                <label class="col-sm-3 control-label" id="normalRiskCountLabel">一般风险:<span
                                        id="normalRiskCount"
                                        th:text="${sumDataStatistics.normalRiskCount}"></span></label>
                            </a>
                            <a onclick="getTotalNumListByRiskLevel('low')">
                                <label class="col-sm-3 control-label" id="lowRiskCountLabel">低风险:<span
                                        id="lowRiskCount"
                                        th:text="${sumDataStatistics.lowRiskCount}"></span></label>
                            </a>
                        </div>
                        <div class="form-group" style="font-size: 25px;color: #4CAF50;">
 
                            <a onclick="$.modal.openTab('当月重大隐患','/tr/dataStatisticsTotalByApp/dangerLedgerListTotal/thisMonthHighDanger')">
                                <label class="col-sm-3 control-label" id="thisMonthHighDangerCountLabel">当月重大隐患:<span
                                        id="thisMonthHighDangerCount"
                                        th:text="${sumDataStatistics.thisMonthHighDangerCount}"></span></label>
                            </a>
 
                            <a onclick="$.modal.openTab('当月一般隐患','/tr/dataStatisticsTotalByApp/dangerLedgerListTotal/thisMonthNormalDanger')">
                                <label class="col-sm-3 control-label" id="thisMonthNormalDangerCountLabel">当月一般隐患:<span
                                        id="thisMonthNormalDangerCount"
                                        th:text="${sumDataStatistics.thisMonthNormalDangerCount}"></span></label>
                            </a>
                            <a onclick="$.modal.openTab('未整改隐患','/tr/dataStatisticsTotalByApp/dangerLedgerListTotal/unRectifyDanger')">
                                <label class="col-sm-3 control-label" id="unRectifyDangerCountLabel">未整改隐患:<span
                                        id="unRectifyDangerCount"
                                        th:text="${sumDataStatistics.unRectifyDangerCount}"></span></label>
                            </a>
                            <a onclick="$.modal.openTab('隐患台账','/tr/dataStatisticsTotalByApp/dangerLedgerListTotal')">
                                <label class="col-sm-3 control-label" id="dangerRectifyPercentLabel">隐患整改率:<span
                                        id="dangerRectifyPercent"
                                        th:text="${sumDataStatistics.dangerRectifyPercent}"></span></label>
                            </a>
                        </div>
 
                    </div>
                </th:block>
 
 
                <th:block
                        th:if="${roleName=='admin'||roleName=='companyAdminUser'||roleName=='regionUser'}">
                    <div style="display: flow-root;">
                        <div class="form-group">
                            <label class="col-sm-3 control-label" id="seriesRiskCountLabel">重大风险:<span
                                    id="seriesRiskCount"
                                    th:text="${sumDataStatistics.seriesRiskCount}"></span>
 
                            </label>
                            <label class="col-sm-3 control-label" id="middleRiskCountLabel">较大风险:<span
                                    id="middleRiskCount"
                                    th:text="${sumDataStatistics.middleRiskCount}"></span></label>
                            <label class="col-sm-3 control-label" id="normalRiskCountLabel">一般风险:<span
                                    id="normalRiskCount"
                                    th:text="${sumDataStatistics.normalRiskCount}"></span></label>
                            <label class="col-sm-3 control-label" id="lowRiskCountLabel">低风险:<span
                                    id="lowRiskCount"
                                    th:text="${sumDataStatistics.lowRiskCount}"></span></label>
                        </div>
                        <div class="form-group" style="font-size: 25px;color: #4CAF50;">
                            <label class="col-sm-3 control-label" id="thisMonthHighDangerCountLabel">当月重大隐患:<span
                                    id="thisMonthHighDangerCount"
                                    th:text="${sumDataStatistics.thisMonthHighDangerCount}"></span></label>
                            <label class="col-sm-3 control-label" id="thisMonthNormalDangerCountLabel">当月一般隐患:<span
                                    id="thisMonthNormalDangerCount"
                                    th:text="${sumDataStatistics.thisMonthNormalDangerCount}"></span></label>
                            <label class="col-sm-3 control-label" id="unRectifyDangerCountLabel">未整改隐患:<span
                                    id="unRectifyDangerCount"
                                    th:text="${sumDataStatistics.unRectifyDangerCount}"></span></label>
                            <label class="col-sm-3 control-label" id="dangerRectifyPercentLabel">隐患整改率:<span
                                    id="dangerRectifyPercent"
                                    th:text="${sumDataStatistics.dangerRectifyPercent}"></span></label>
                        </div>
 
                    </div>
                </th:block>
 
 
                <div class="select-list">
                    <ul>
                        <li>
                            <label>公司名称:</label>
                            <input type="text" name="companyName"/>
                        </li>
 
                        <th:block
                                th:if="${roleName=='admin'||roleName=='companyAdminUser'||roleName=='straightRegionUser'}">
                            <li>
                                <label>公司区域:</label>
                                <select name="companyRegion" th:with="type=${@dict.getType('tr_region_list')}">
                                    <option value="">--请选择--</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                            th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                        </th:block>
 
                        <li>
                            <label>行业类别:</label>
                            <select name="companyIndustry" th:with="type=${@dict.getType('company_industry_type')}" onChange="changeCompanyIndustry(this)">
                                <option value="">--请选择--</option>
                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                        th:value="${dict.dictValue}"></option>
                            </select>
                        </li>
 
 
                        <li>
                            <label>行业子分类:</label>
                            <select name="companySubIndustry" id="companySubIndustry">
                                <option value="">--请选择--</option>
                            </select>
                        </li>
 
 
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>
 
        <div class="btn-group-sm" id="toolbar" role="group">
            <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="tr:dataStatistics:export">
                <i class="fa fa-download"></i> 导出
            </a>
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var companySubIndustryTypeByWeihua = [[${@dict.getType('company_sub_industry_type_by_weihua')}]];
 
    function changeCompanyIndustry(that) {
        $("#companySubIndustry").empty();
        $("#companySubIndustry").append(new Option("--请选择--", ""));
        var companyIndustry = $(that).val();
        if (companyIndustry) {
            if ("危化" == companyIndustry) {
                for (var i = 0; i < companySubIndustryTypeByWeihua.length; i++) {
                    $("#companySubIndustry").append(new Option((companySubIndustryTypeByWeihua[i]).dictLabel, (companySubIndustryTypeByWeihua[i]).dictValue));
                }
            }
        }
    }
 
    var prefix = ctx + "tr/dataStatistics";
 
    $(function () {
        var options = {
            url: prefix + "/list",
            exportUrl: prefix + "/export",
            pageSize: 50,
            modalName: "数据统计",
            columns: [
                {
                    field: 'companyId',
                    title: '公司ID',
                    align: "center",
                    visible: false
                },
                {
                    field: 'number',
                    title: '序号',
                    width: 5,
                    align: 'center',
                    switchable: false,
                    formatter: function (value, row, index) {
                        //通过表的#id 可以得到每页多少条
                        var pageSize = $('#bootstrap-table').bootstrapTable('getOptions').pageSize;
                        //通过表的#id 可以得到当前第几页
                        var pageNumber = $('#bootstrap-table').bootstrapTable('getOptions').pageNumber;
                        //返回每条的序号: 每页条数 * (当前页 - 1 )+ 序号
                        return pageSize * (pageNumber - 1) + index + 1;
                    }
                },
                {
                    field: 'companyName',
                    title: '公司名称',
                    align: "center"
                },
                {
                    field: 'companyRegion',
                    title: '公司区域',
                    align: "center"
                },
                {
                    field: 'companyIndustry',
                    title: '行业类别',
                    align: "center"
                },
                {
                    field: 'companySubIndustry',
                    title: '行业子分类',
                    align: "center"
                },
                {
                    title: '重大风险',
                    align: "center",
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a onclick="getNumListByRiskLevel(\'' + row.companyName + '\',\'' + row.companyId + '\',\'major\')">' + row.seriesRiskCount + '</a>');
                        return actions.join('');
                    }
                },
                {
                    title: '较大风险',
                    align: "center",
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a onclick="getNumListByRiskLevel(\'' + row.companyName + '\',\'' + row.companyId + '\',\'larger\')">' + row.middleRiskCount + '</a>');
                        return actions.join('');
                    }
                },
                {
                    title: '一般风险',
                    align: "center",
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a onclick="getNumListByRiskLevel(\'' + row.companyName + '\',\'' + row.companyId + '\',\'general\')">' + row.normalRiskCount + '</a>');
                        return actions.join('');
                    }
                },
                {
                    title: '低风险',
                    align: "center",
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a onclick="getNumListByRiskLevel(\'' + row.companyName + '\',\'' + row.companyId + '\',\'low\')">' + row.lowRiskCount + '</a>');
                        return actions.join('');
                    }
                },
                {
                    field: 'thisMonthHighDangerCount',
                    title: '当月重大隐患',
                    align: "center",
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a onclick="$.modal.openTab(\'' + row.companyName + '当月重大隐患\',\'' + 'tr/hiddenDangerCheck/dangerLedger/listByCompanyId/' + row.companyId + '/thisMonthHighDanger\')">' + row.thisMonthHighDangerCount + '</a>');
                        return actions.join('');
                    }
                },
                {
                    field: 'thisMonthNormalDangerCount',
                    title: '当月一般隐患',
                    align: "center",
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a onclick="$.modal.openTab(\'' + row.companyName + '当月一般隐患\',\'' + 'tr/hiddenDangerCheck/dangerLedger/listByCompanyId/' + row.companyId + '/thisMonthNormalDanger\')">' + row.thisMonthNormalDangerCount + '</a>');
                        return actions.join('');
                    }
                },
                {
                    field: 'unRectifyDangerCount',
                    title: '未整改隐患',
                    align: "center",
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a onclick="$.modal.openTab(\'' + row.companyName + '未整改隐患\',\'' + 'tr/hiddenDangerCheck/dangerLedger/listByCompanyId/' + row.companyId + '/unRectifyDanger\')">' + row.unRectifyDangerCount + '</a>');
                        return actions.join('');
                    }
                },
                {
                    field: 'dangerRectifyPercent',
                    title: '隐患整改率',
                    align: "center",
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a onclick="$.modal.openTab(\'' + row.companyName + '隐患台账\',\'' + 'tr/hiddenDangerCheck/dangerLedger/listByCompanyId/' + row.companyId + '\')">' + row.dangerRectifyPercent + '</a>');
                        return actions.join('');
                    }
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-primary btn-xs" href="javascript:void(0)" onclick="$.modal.openNoConfirm(\'' + row.companyName + '四色图\',\'' + '/system/company/detailCompanyFourColorMap/' + row.companyId + '\')"><i class="fa fa-drivers-license"></i>四色图</a> ');
                        actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="$.modal.openNoConfirm(\'' + row.companyName + '柱状图\',\'' + '/system/company/detailPostSafetyRiskBarChartUrl/' + row.companyId + '\')"><i class="fa fa-bar-chart-o"></i>柱状图</a> ');
 
                        actions.push('<a class="btn btn-info btn-xs" href="javascript:void(0)" onclick="$.modal.openTab(\'' + row.companyName + '排查计划\',\'' + 'tr/hiddenDangerCheck/dangerPlanExecute/listByCompanyId/' + row.companyId + '\')"><i class="fa fa-pencil"></i>排查计划</a> ');
 
                        actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="$.modal.openTab(\'' + row.companyName + '定时隐患排查\',\'' + 'tr/hiddenDangerCheck/dangerSchedule/listByCompanyId/' + row.companyId + '\')"><i class="fa fa-diamond"></i>定时隐患排查</a> ');
 
 
                        // actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="$.modal.openTab(row.companyName+\'隐患上报\',\'' + 'tr/hiddenDangerCheck/dangerReport/listByCompanyId/' + row.companyId + '\')"><i class="fa fa-drivers-license"></i>隐患上报</a> ');
                        //
                        //
                        // actions.push('<a class="btn btn-primary btn-xs" href="javascript:void(0)" onclick="$.modal.openTab(row.companyName+\'隐患核查\',\'' + 'tr/hiddenDangerCheck/dangerExamine/listByCompanyId/' + row.companyId + '\')"><i class="fa fa-pencil"></i>隐患核查</a> ');
                        actions.push('<a class="btn btn-warning btn-xs" href="javascript:void(0)" onclick="$.modal.openTab(\'' + row.companyName + '隐患台账\',\'' + 'tr/hiddenDangerCheck/dangerLedger/listByCompanyId/' + row.companyId + '\')"><i class="fa fa-bars"></i>隐患台账</a> ');
                        actions.push('<a class="btn btn-info btn-xs" href="javascript:void(0)" onclick="$.modal.openTab(\'' + row.companyName + '风险台账\',\'' + 'tr/riskCheckPoint/ledger/' + row.companyId + '\')"><i class="fa fa-info"></i>风险台账</a> ');
                        actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="$.modal.openTab(\'' + row.companyName + '公司管理制度\',\'' + 'tr/article/' + row.companyId + '\')"><i class="fa fa-folder"></i>管理制度</a> ');
                        actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="$.modal.openTab(\'' + row.companyName + '法律法规政策\',\'' + 'tr/articleRegulation/' + row.companyId + '\')"><i class="fa fa-gavel"></i>法律法规</a> ');
                        return actions.join('');
                    }
                }
            ]
        };
        $.table.init(options);
    });
</script>
</body>
</html>
 
<script>
    //根据公司id,和风险基本,查询出对应的台账,列表
    function getNumListByRiskLevel(companyName, companyId, level) {
        if (level == "major") {
            $.modal.openTab(companyName + '重大风险列表', "/tr/riskCheckPoint/ledger/" + companyId + "/" + level);
        } else if (level == "larger") {
            $.modal.openTab(companyName + '较大风险列表', "/tr/riskCheckPoint/ledger/" + companyId + "/" + level);
        } else if (level == "general") {
            $.modal.openTab(companyName + '一般风险列表', "/tr/riskCheckPoint/ledger/" + companyId + "/" + level);
        } else if (level == "low") {
            $.modal.openTab(companyName + '低风险列表', "/tr/riskCheckPoint/ledger/" + companyId + "/" + level);
        }
    }
 
 
    //根据风险等级,查询出对应的台账,列表
    function getTotalNumListByRiskLevel(level) {
        if (level == "major") {
            $.modal.openTab('重大风险列表', "/tr/dataStatisticsTotalByApp/riskCheckPoint/ledger/" + level);
        } else if (level == "larger") {
            $.modal.openTab('较大风险列表', "/tr/dataStatisticsTotalByApp/riskCheckPoint/ledger/" + level);
        } else if (level == "general") {
            $.modal.openTab('一般风险列表', "/tr/dataStatisticsTotalByApp/riskCheckPoint/ledger/" + level);
        } else if (level == "low") {
            $.modal.openTab('低风险列表', "/tr/dataStatisticsTotalByApp/riskCheckPoint/ledger/" + level);
        }
    }
</script>