cy
2022-06-21 129904537f66509f97b285e7eb4f42b3dc349dd0
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
<!doctype html>
<html class="no-js">
<head>
<meta charset="utf-8">
<title>工单提交</title>
[#include "/business/pages/include/static.html" /]
[#include "/component/HtmlEditor.html" /]
<link rel="stylesheet" href="${common_static}/static/plugins/ztree/css/zTreeStyle/zTreeStyle.css" type="text/css">
<script type="text/javascript" src="${common_static}/static/plugins/ztree/js/jquery.ztree.all-3.5.min.js"></script>
</head>
 
<body class="personnel_allocation_body">
<div style="margin-top: 20px">
<form id="myform" action="${base}/business/pages/health/doEngineerPatrol.html" method="post">
    <input name="orderId" value="${RequestParameters.orderId}" type="hidden"/>
    <input name="nodeId" value="${RequestParameters.nodeId}" type="hidden"/>
    <input name="flowId" value="${RequestParameters.flowId}" type="hidden"/>
    <input name="isAdmin" value="${RequestParameters.isAdmin}" type="hidden"/>
    <input id="commonJsonList" name="commonJsonList" type="hidden"/>
    <table id="commonList" class="pab_con">
        [#if RequestParameters.isAdmin=='1']
            [#if commonList??&&commonList?size>0]
            <td class="greybg" style="width:30%;">分类名称</td>
            <td class="greybg">指标名称</td>
            <td class="greybg">巡检结果</td>
            <td class="greybg">备注</td>
            
            [#list commonList as commonCate]
                <tr>
                    <td [#if commonCate.children??&&commonCate.children?size>0]rowspan="${commonCate.children?size}"[/#if]>${commonCate.CATEGORY_NAME}</td>
                    [#if commonCate.children??&&commonCate.children?size>0]
                        [#assign item = commonCate.children[0]/]
                        <td>${item.ITEM_NAME}<input type="hidden" name="commonId" value="${item.ID}"/></td>
                        <td>
                            <input type="radio" name="result${item.ITEM_ID}" [#if item.RESULT_TYPE==1]checked="checked"[/#if] value="1"/>&nbsp;正常&nbsp;&nbsp;
                            <input type="radio" name="result${item.ITEM_ID}" [#if item.RESULT_TYPE==2]checked="checked"[/#if]value="2"/>&nbsp;告警&nbsp;&nbsp;
                            <input type="radio" name="result${item.ITEM_ID}" [#if item.RESULT_TYPE==3]checked="checked"[/#if]value="3"/>&nbsp;异常&nbsp;&nbsp;
                        </td>
                        <td><input name="note" value="${item.NOTE}" style="width:95%"/></td>
                    [#else]
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                    [/#if]
                </tr>
                [#if commonCate.children??&&commonCate.children?size>1]
                [#list commonCate.children as item]
                    [#if item_index>0]
                    <tr>
                    <td>${item.ITEM_NAME}<input type="hidden" name="commonId" value="${item.ID}"/></td>
                    <td>
                        <input type="radio" name="result${item.ITEM_ID}" [#if item.RESULT_TYPE==1]checked="checked"[/#if] value="1"/>&nbsp;正常&nbsp;&nbsp;
                        <input type="radio" name="result${item.ITEM_ID}" [#if item.RESULT_TYPE==2]checked="checked"[/#if]value="2"/>&nbsp;告警&nbsp;&nbsp;
                        <input type="radio" name="result${item.ITEM_ID}" [#if item.RESULT_TYPE==3]checked="checked"[/#if]value="3"/>&nbsp;异常&nbsp;&nbsp;
                    </td>
                    <td><input name="note" value="${item.NOTE}" style="width:95%"/></td>
                    </tr>
                    [/#if]
                [/#list]
                [/#if]
            [/#list]
            [/#if]
            <tr>
                <td class="greybg">配置运行情况说明</td>
                <td style="padding:0;" colspan="4">
                    <textarea class="general" id="ciRunNote" name="ciRunNote" style="width:98%;height:100px;border:0;" ></textarea>
                    <div id="ciRunNoteTip" style="display:inline-block;"></div>
                </td>
            </tr>
            <tr>
                <td class="greybg">配置异常情况说明</td>
                <td style="padding:0;" colspan="4">
                    <textarea class="general" id="ciErrorNote" name="ciErrorNote" style="width:98%;height:100px;border:0;" ></textarea>
                    <div id="ciErrorNoteTip" style="display:inline-block;"></div>
                </td>
            </tr>
        [/#if]
        <tr>
            <td class="greybg">备注</td>
            <td style="padding:0;" colspan="4">
                <textarea class="general" id="flowNote" name="flowNote" style="width:98%;height:100px;border:0;" ></textarea>
                <div id="flowNoteTip" style="display:inline-block;"></div>
            </td>
        </tr>
    </table>
</form>
</div>
 
</body>
<script type="text/javascript">
    $(document).ready(function(){
        
        $.formValidator.initConfig({formID:"myform",onError:function(msg){popupTips(msg)},onSuccess:function(){
            document.getElementById("myform").target = window.top.openDialog("1","操作",
                         {},
                         {"width":40,"height":40},
                         [{btnId:"tipBtnSure", btnName:"确定", btnStyle:"bluebtn"}]);
                         return true;
        }});
        $("#ciRunNote").formValidator({
            empty: true,
            onShow: "配置运行情况说明不超过400个字符!",
            onFocus: "配置运行情况说明不超过400个字符!"
        }).inputValidator({max: 400, onError: "配置运行情况说明不超过400个字符"});
        $("#ciErrorNote").formValidator({
            empty: true,
            onShow: "配置异常情况说明不超过400个字符!",
            onFocus: "配置异常情况说明不超过400个字符!"
        }).inputValidator({max: 400, onError: "配置异常情况说明不超过400个字符"});
        $("#flowNote").formValidator({
            empty: true,
            onShow: "流转备注不超过400个字符!",
            onFocus: "流转备注不超过400个字符!"
        }).inputValidator({max: 400, onError: "备注不超过400个字符"});
    });
    
    //点击事件
    function onDialogBtnClick(btnID, dialogID, config){
        if(btnID == "btnSure"){
            [#if RequestParameters.isAdmin=='1']
                setCommonListJson();
            [/#if]
            $("#myform").submit();
        }
    }
    
    //获取选择的通用巡检项信息
    function setCommonListJson(){
        var commonJsonList = "[";
        $("#commonList").find("tr").each(function(index){
            if(index>0){
                if($(this).find("input[type=radio]:checked").length>0){
                    var commonId = $(this).find("input[name=commonId]").val();
                    var result = $(this).find("input[type=radio]:checked").val();
                    var note = $(this).find("input[name=note]").val();
                    var commonJson = "{"
                    commonJson = commonJson + "commonId:'" + commonId + "',"
                    commonJson = commonJson + "result:'" + result + "',"
                    commonJson = commonJson + "note:'" + note + "'"
                    commonJson = commonJson + "}";
                    commonJsonList = commonJsonList + commonJson;
                }
            }
        });
        commonJsonList = commonJsonList + "]";
        commonJsonList = commonJsonList.replace(/}{/g,"},{");
        $("#commonJsonList").val(commonJsonList);
    }
    
</script>
</html>