双重预防项目-国泰新华二开定制版
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
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('修改隐患排查计划制定')"/>
    <th:block th:include="include :: datetimepicker-css"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-hiddenDangerCheck-edit" th:object="${hiddenDangerCheck}">
        <input name="checkId" th:field="*{checkId}" type="hidden">
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">计划名称:</label>
            <div class="col-sm-8">
                <input name="planName" class="form-control" type="text" required th:field="*{planName}">
            </div>
        </div>
 
        <!--<div class="form-group">-->
            <!--<label class="col-sm-3 control-label is-required">排查类型:</label>-->
            <!--<div class="col-sm-8">-->
                <!--<select name="troubleshootTypeId" class="form-control m-b" required>-->
                    <!--<option th:each="troubleshootType : ${troubleshootTypeList}" th:field="*{troubleshootTypeId}"-->
                            <!--th:text="${troubleshootType.typeName}" th:value="${troubleshootType.typeId}"></option>-->
                <!--</select>-->
            <!--</div>-->
        <!--</div>-->
 
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">组织单位:</label>
            <div class="col-sm-8">
                <div class="input-group">
                    <input name="organizationDeptId" type="hidden" id="organizationDeptId"
                           th:field="*{organizationDeptId}">
                    <input name="organizationDeptName" onclick="selectOrganizationDeptTree()"
                           th:field="*{organizationDeptName}" id="organizationDeptName" type="text"
                           placeholder="请选择归属部门" class="form-control" required
                           readonly="readonly">
                    <span class="input-group-addon"><i class="fa fa-search"></i></span>
                </div>
            </div>
        </div>
 
 
        <div class="form-group">
            <label class="col-sm-3 control-label">排查方式:</label>
            <div class="col-sm-8">
                <select name="checkType" id="checkType" class="form-control m-b" required  disabled="disabled">
                    <option value="1"
                            th:selected="${hiddenDangerCheck.checkType=='1'}">基础清单排查</option>
                    <option value="2"
                            th:selected="${hiddenDangerCheck.checkType=='2'||hiddenDangerCheck.checkType==null||hiddenDangerCheck.checkType==''}">风险单元清单排查</option>
                </select>
            </div>
        </div>
 
 
        <th:block th:if="${hiddenDangerCheck.checkType=='1'}">
 
            <div class="form-group"  style="display:block;" id="basicRiskListInfo">
                <label class="col-sm-3 control-label is-required">基础清单:</label>
                <div class="col-sm-8">
                    <select  class="form-control m-b"   name="riskId"  th:field="*{riskId}"  id="basicRiskList">
                        <option th:each="basic : ${basicRiskList}"
                                th:text="${basic.riskListName}"
                                th:value="${basic.riskListId}"></option>
                    </select>
                </div>
            </div>
 
        </th:block>
 
 
<th:block th:if="${hiddenDangerCheck.checkType=='2'||hiddenDangerCheck.checkType==null||hiddenDangerCheck.checkType==''}">
 
    <div class="form-group">
        <label class="col-sm-3 control-label is-required">风险单元类型:</label>
        <div class="col-sm-8">
            <select name="riskType"  id="riskType" th:field="*{riskType}"  class="form-control m-b" required>
                <option value="1">设备设施清单</option>
                <option value="2">作业活动清单</option>
                <option value="3">工艺节点清单</option>
            </select>
        </div>
    </div>
 
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">风险单元:</label>
            <div class="col-sm-8">
                <input id="checkPointName" name="riskName" th:field="*{riskName}"  placeholder="选择风险单元" class="form-control" type="text"
                       onclick="selectRiskPoint()" maxlength="30" readonly="true" required>
                <input id="checkPointId" name="riskId" th:field="*{riskId}"  type="hidden">
                <input id="dangerDeptId" name="dangerDeptId" th:field="*{dangerDeptId}"  type="hidden">
                <input id="dangerDeptName" name="dangerDeptName" th:field="*{dangerDeptName}"  type="hidden">
                <input id="dangerPlaceId" name="dangerPlaceId" th:field="*{dangerPlaceId}"  type="hidden">
                <input id="dangerPlaceName" name="dangerPlaceName" th:field="*{dangerPlaceName}"  type="hidden">
            </div>
        </div>
</th:block>
 
 
 
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">排查人:</label>
            <div class="col-sm-8">
                <input id="checkUserName"  name="checkUserName"  th:field="*{checkUserName}"  placeholder="选择排查人" class="form-control" type="text"  onclick="selectCheckUser()" maxlength="30" readonly="true" required>
                <input id="checkUserId" name="checkUserId"  th:field="*{checkUserId}"  type="hidden">
            </div>
        </div>
 
 
        <div class="form-group">
            <label class="col-sm-3 control-label  is-required">被检查单位:</label>
            <div class="col-sm-8">
                <div class="input-group">
                    <input name="beCheckedDeptId" type="hidden" id="beCheckedDeptId" th:field="*{beCheckedDeptId}">
                    <input name="beCheckedDeptName" onclick="selectBeCheckedDeptTree()" th:field="*{beCheckedDeptName}"
                           id="beCheckedDeptName" type="text" placeholder="请选择归属部门" class="form-control" required
                           readonly="readonly">
                    <span class="input-group-addon"><i class="fa fa-search"></i></span>
                </div>
            </div>
        </div>
 
        <div class="form-group">
            <label class="col-sm-3 control-label  is-required">排查开始日期:</label>
            <div class="col-sm-8">
                <input name="checkBeginTime" placeholder="请选择排查开始日期" th:field="*{checkBeginTime}" class="form-control"
                       type="text" readonly="readonly" required>
            </div>
        </div>
 
        <div class="form-group">
            <label class="col-sm-3 control-label  is-required">排查结束日期:</label>
            <div class="col-sm-8">
                <input name="checkEndTime" placeholder="请选择排查结束日期" th:field="*{checkEndTime}" class="form-control"
                       type="text" readonly="readonly" required>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: datetimepicker-js"/>
<script type="text/javascript">
 
 
    /*排查人  选择 start*/
    function selectCheckUser() {
        var url = ctx + "system/user/selectUserListByParentSonCompany";
        var options = {
            title: '用户选择',
            width: "800",
            url: url,
        };
        $.modal.openOptionsByCallback(options, function (layero, index) {
            var body = layer.getChildFrame('body', index);
            body.on("click", ".selectUser", function () {
                var userId = $(this).data("userid");
                var userName = $(this).data("username");
                $("#checkUserId").val(userId);
                $("#checkUserName").val(userName);
                layer.close(index);
            });
        });
    }
    /*排查人  选择 end*/
 
    // 选择风险单元
    function selectRiskPoint() {
        var riskType = $('#riskType').val();
        var url = "/tr/riskList/selectRiskListByDangerReport/" + riskType;
        $.modal.openNoConfirm("选择风险单元", url, '700', '500');
    }
 
    var prefix = ctx + "tr/hiddenDangerCheck/dangerPlanFormulate";
    $("#form-hiddenDangerCheck-edit").validate({
        focusCleanup: true
    });
 
    function submitHandler() {
        if ($.validate.form()) {
            var data = $('#form-hiddenDangerCheck-edit').serializeArray();
 
            // var troubleshootTypeName = $("select[name='troubleshootTypeId']").find("option:selected").text();//排查类型名称
            // data.push({"name": "troubleshootTypeName", "value": troubleshootTypeName});
 
 
            var checkType = $("#checkType").val();//排查类型
            //基础清单排查
            if(checkType == "1"){
                var riskId = $("#basicRiskList").find("option:selected").val();//基础清单文件risk_id
                var riskName = $("#basicRiskList").find("option:selected").text();//基础清单文件risk_name
                if(riskId==null||riskId==""){
                    $.modal.alertWarning("请选择基础清单文件!");
                    return false;
                }
                data.push({"name": "riskName", "value": riskName});//风险名称
            }
            $.operate.save(prefix + "/editDangerPlanFormulate", data);
        }
    }
 
    /*组织单位 选择 start*/
    function selectOrganizationDeptTree() {
        var treeId = $("#organizationDeptId").val();
        var deptId = $.common.isEmpty(treeId) ? "100" : $("#organizationDeptId").val();
        var url = ctx + "system/dept/selectDeptTreeByCompanyId/" + deptId;
        var options = {
            title: '选择部门',
            width: "380",
            url: url,
            callBack: doSubmitOrganizationDept
        };
        $.modal.openOptions(options);
    }
 
    function doSubmitOrganizationDept(index, layero) {
        var tree = layero.find("iframe")[0].contentWindow.$._tree;
        // if ($.tree.notAllowParents(tree)) {
            var body = layer.getChildFrame('body', index);
            $("#organizationDeptId").val(body.find('#treeId').val());
            $("#organizationDeptName").val(body.find('#treeName').val());
            layer.close(index);
        // }
    }
 
    /*组织单位 选择 end*/
 
 
    /*被检查单位  选择 start*/
    function selectBeCheckedDeptTree() {
        var treeId = $("#beCheckedDeptId").val();
        var deptId = $.common.isEmpty(treeId) ? "100" : $("#beCheckedDeptId").val();
        var url = ctx + "system/dept/selectDeptTreeByCompanyId/" + deptId;
        var options = {
            title: '选择部门',
            width: "380",
            url: url,
            callBack: doSubmitBeCheckedDept
        };
        $.modal.openOptions(options);
    }
 
    function doSubmitBeCheckedDept(index, layero) {
        var tree = layero.find("iframe")[0].contentWindow.$._tree;
        // if ($.tree.notAllowParents(tree)) {
            var body = layer.getChildFrame('body', index);
            $("#beCheckedDeptId").val(body.find('#treeId').val());
            $("#beCheckedDeptName").val(body.find('#treeName').val());
            layer.close(index);
        // }
    }
 
    /*被检查单位  选择 end*/
 
 
    $("input[name='checkBeginTime']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });
 
    $("input[name='checkEndTime']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });
 
</script>
</body>
</html>