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
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
<!doctype html>
<html class="no-js">
<head>
<meta charset="utf-8">
<title>基本信息</title>
</head>
 
<body>
[#include "/business/pages/include/static.html" /]
[#include "/component/DatePicker.html" /]
<div class="deal_switch_con" style="display:block;">
       <div class="edit_title"><h3>基本信息</h3></div>
            <form id="myform" method="post" action="${base}/business/pages/health/managerDispatch.html">
         <input name="orderId" type="hidden" value="${RequestParameters.orderId}"/>
         <input name="nodeId" type="hidden" value="${RequestParameters.nodeId}"/>
         <input name="project_id" type="hidden" value="${health.project_id}"/>
         <input name="flowId" type="hidden" value="${RequestParameters.flowId}"/>
         <input name="executorIds" id="executorIds" type="hidden"/>
         <input name="executorNames"  id="executorNames" type="hidden"/>
         <input name="main_executorId"  id="main_executorId" type="hidden"/>
         <input name="flowNote"  id="flowNote" type="hidden"/>
         <input name="ciIds"  id="ciIds" type="hidden"/>
         <input name="items"  id="items" type="hidden"/>
         
         <table class="edit_layout2 basicinfo" width="100%">
             <tr>
                 <th><label>${Constants.CUSTOMER_CONSTANTS}名称:</label></th>
                 <td><span class="infotxt">${health.customer_name}</span></td>
                 <th><label>${Constants.UNIT_CONSTANTS}:</label></th>
                 <td><span class="infotxt">${health.sub_customer_name}</span></td>
             </tr>
             
             <tr>
                 <th ><label class="required">联系人:</label></th>
                 <td>
                    <input id="contacts_name" name="contacts_name" value="${health.contacts_name}" class="general" type="text"/>
                     <div id="contacts_nameTip" style="display:inline-block;"></div>
                 </td>
                 <th><label class="required">联系方式:</label></th>
                 <td>
                    <input id="contacts_tel" name="contacts_tel" value="${health.contacts_tel}" class="general" type="text"/>
                     <div id="contacts_telTip" style="display:inline-block;"></div>
                 </td>
             </tr>
             <tr>
                   <th style="width:180px"><label>计划巡检日期:</label></th>
                 <td>
                     ${DateUtil.format("yyyy-MM-dd",health.plan_exe_date)}
                 </td>
                 <th style="width:180px"><label class="required">巡检执行日期:</label></th>
                 <td>
                    [@datepicker id="plan_time" value="${health.plan_time}" class="general" length=8/]
                    <div id="require_dateTip" style="display:inline-block;"></div>
                 </td>
            </tr> 
             
            
             
            
         </table>
        
        <br/>
        <div class="edit_title"><h3>巡检配置</h3><a class="add_associated"  href="javascript:openAddCiDialog();">新增</a></div>
        <div class="table_basic">
        <table id="ciList">
             <tr class="title">
                  <td style="width:17%">分类名称</td>
                  <td style="width:17%">配置名称</td>
                  <td style="width:17%">搜索编号</td>
                  <td style="width:17%">存放位置</td>
                  <td style="width:20%">操作</td>
              </tr>
              
               [#if ciList??&&ciList?size>0]
                   [#list ciList as item]
                   <tr>
                       <td>
                           <input type="hidden" name="ciId" value="${item.CIID}" class="device">
                           <div id="${item.CIID}" class="itemDiv" style="display:none;">
                               [#if item.children??]
                               [#list item.children as ci_item]${ci_item.item_id}-[/#list]
                               [/#if]
                           </div>
                           ${item.CATENAME}
                       </td>
                       <td>${item.CINAME}</td>
                       <td>${item.SEARCHCODE}</td>
                       <td>${item.POSITION}</td>
                       <td>
                       <a class='delete'>删除</a>
                       <a class='edit'>指标配置</a>
                       </td>
                   </tr>
                   [/#list]
               [#else]
                   <td colspan="5" align="center">暂无信息</td>
               [/#if]
              
        </table>
         </form>  
        </div>
           
<script type="text/javascript">
    //添加设备页面
    function openAddCiDialog(){
        var ciIds = "";
        $('input[name=ciId]').each(function(){
            if(ciIds==''){
                ciIds = $(this).val();
            }else{
                ciIds = ciIds +","+ $(this).val();
            }
        });
        window.top.openDialog("1","配置巡检新增",
                 {},
                 {"width":"90","height":"70"},
                 [{btnId:"btnSure", btnName:"确定", btnStyle:"bluebtn"}],
                 "${base}/business/pages/health/addCiDialog.html?"
                +"customerId=${health.customer_id}&subCustomerId=${health.sub_customer_id}&ciIds="+ciIds);
    }
 
    function addPatrolCi(ciJsonList){
        var arr = ciJsonList;
        if(arr.length>0){
            $.each(arr, function(index, ciInfo){
                var htmlStr = "<tr>";
                htmlStr = htmlStr + "<td>" + ciInfo.cateName + "</td>";
                htmlStr = htmlStr + "<td>" + ciInfo.ciName + "<input name='ciId' value='"+ciInfo.ciId+"' type='hidden'><div id='"+ciInfo.ciId+"' class='itemDiv' style='display:none;'>"+ciInfo.itemIds+"</div></td>";
                htmlStr = htmlStr + "<td>" + ciInfo.searchCode + "</td>";
                htmlStr = htmlStr + "<td>" + ciInfo.position + "</td>";
                htmlStr = htmlStr + "<td><a class='delete'>删除</a> <a class='edit'>指标配置</a></td>"; 
                htmlStr = htmlStr + "</tr>";
                $("#ciList").append(htmlStr).show();
            }); 
        }
    }
    
    function formSubmit(executorIds,executorNames,main_executorId,flowNote) {
        $("#executorIds").val(executorIds);
        $("#executorNames").val(executorNames);
        $("#main_executorId").val(main_executorId);
        $("#flowNote").val(flowNote);
        
        var ciIds = ''
        var jsonList=[];
        $("input[name=ciId]").each(function(){
            if(ciIds!=''){
                ciIds = ciIds + ',' + $(this).val();
            }else{
                ciIds = $(this).val();
            }
            var itemJson={};
            var item=$.trim($(this).next().html());
            itemJson["itemId"]=item;
            jsonList.push(itemJson);
        });
        $("#ciIds").val(ciIds);
        var items=JSON.stringify(jsonList);
        $("#items").val(items);
        $("#myform").submit();
    }
 
    $(document).ready(function(){
        $.formValidator.initConfig({formID:"myform",onError:function(msg){window.top.popupTips(msg)},onSuccess:function(){
            document.getElementById("myform").target = window.top.openDialog("1","操作",
                         {},
                         {"width":40,"height":40},
                         [{btnId:"tipBtnSure", btnName:"确定", btnStyle:"bluebtn"}]);
                         return true;
        }});
        $("#contacts_name").formValidator({empty: false, onShow:"请输入联系人",onFocus: "请输入联系人"}).inputValidator({min: 1,onError: "联系人不能为空"});
        $("#contacts_tel").formValidator({empty: false, onShow:"请输入联系方式",onFocus: "请输入联系方式"}).functionValidator({fun:checkPhone});
        $("#require_date").formValidator({empty: false, onShow:"请输入要求完成时间",onFocus: "请输入要求完成时间"}).inputValidator({min: 1,onError: "要求完成时间不能为空"});
        $("#service_content").formValidator({empty: false, onShow:"请填写服务内容说明",onFocus: "请填写服务内容说明"}).inputValidator({min: 1,onError: "服务内容说明不能为空"});
        
        
        //删除设备
        $("a.delete").live("click",function() {
            $(this).parents("tr").remove();
        });
        //指标配置
        $("a.edit").live("click",function() {
                var $checkDiv=$(this).parents("tr").find("input[name=ciId]");
                var id=$checkDiv.val();
                var selectedItem=$.trim($checkDiv.next().html());
                window.top.openDialog("1","指标配置",
                 {},
                 {"width":"60","height":"70"},
                 [{btnId:"btnSure", btnName:"确定", btnStyle:"bluebtn"}],
                 "${base}/business/pages/health/selectItem.html?"
                +"cusId=${health.customer_id}&subCustomerId=${health.sub_customer_id}&id="+id+"&selectedItem="+selectedItem);
        });
    });
    //指标配置回调
    function itemBack(itemsStr,id){
        $("#"+id).html(itemsStr);
    }
    function checkPhone(value) {
        if($.util.isEmpty(value)) {
            return "联系方式不能为空";
        }
        if(!$.util.isMobile(value) && !$.util.isTelphone(value)) {
            return "联系方式格式不正确";
        }
        return true;
    }
</script>
</body>
</html>