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
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
<!doctype html>
<html>
<head>
[#include "/business/wechat/include/title.html" /]
[#include "/business/wechat/include/wheader.html" /]
<script type="text/javascript" src="${common_static}/static/wechat/style/js/project.js"></script>
[#include "/business/wechat/include/mobiscroll.html" /]
 
</head>
 
<body>
<header class="kltit">
    <label class="dropmenu"></label><a href="${base}/ewyw/ewWorkplan/emyDailyCheck.html" ><span></span></a>日常巡检
    <div class="wlsdrop2">
         <a href="javascript:savedaily(1);"><p class="baocun">保存</p></a>
        <a href="javascript:saveshdaily();"><p class="shenhe">提交审核</p></a>
    </div>
</header>
<nav class="kltwo clearfix">
    <div class="kltwowrap">
        <a href="#" hidefocus="true" class="active">基本信息</a>
        <a href="#" hidefocus="true">巡检类型</a>
        <a href="#" hidefocus="true">巡检配置</a>
        <a href="#" hidefocus="true">关联工单</a>       
    </div>
</nav>
<form id="myform" action="" method="post">
<input type="hidden" id="state" name="state"/>
<input type="hidden" id="orderId" name="orderId" value="${resultMap.orderId}"/>
<input type="hidden" id="commonJsonList" name="commonJsonList"/>
<input type="hidden" id="ciJsonList" name="ciJsonList"/>
<input type="hidden" id="note" name="${resultMap.note}"/>
<div class="swiper-container" id="swiper-pages">
    <div class="swiper-wrapper">
        <div class="swiper-slide">
            <section class="wlresponse">
               <a href="javascript:selectcus();"><p class="next2">
                    <span>${Constants.CUSTOMER_CONSTANTS}名称</span>
                    <i id="showcus" >${resultMap.customer_name}</i>
                    <input name="customer_id" id="customer_id" type="hidden" class="enter" value="${resultMap.customer_id}">
                    <input name="customer_name" id="customer_name" type="hidden" class="enter" value="${resultMap.customer_name}">
                </p></a>
                
                <a href="#"><p class="next2">
                    <span>报告日期</span>
                    <i>
                    <input class="enter" type="text" name="patrol_date" id="patrol_date" value="${DateUtil.format('yyyy-MM-dd',resultMap.patrol_date)}"/>
                    </i>
                </p></a>
               <a href="#"><p class="next2">
                    <span>开始时间</span>
                    <i>
                    <input class="enter" type="text" name="begin_time" id="begin_time" value="${DateUtil.format('yyyy-MM-dd HH:mm',resultMap.begin_time)}"/>
                    </i>
                </p></a>
                
               <a href="#"><p class="next2">
                    <span>结束时间</span>
                    <i>
                    <input class="enter" type="text" name="end_time" id="end_time" value="${DateUtil.format('yyyy-MM-dd HH:mm',resultMap.end_time)}"/>
                    </i>
                </p></a>
                <p>
                    <span>联系方式</span>
                     <i><input name="user_phone" id="user_phone" placeholder="请输入联系方式" type="text" class="enter" value="${resultMap.user_phone}"></i>
                </p>
                <p>
                    <span>巡检总结</span>
                    <i><textarea name="summary" id="summary" placeholder="请填写巡检总结" cols="" rows="3" class="event-text">${resultMap.summary}</textarea></i>
                </p>
            </section>
        </div>
      <div class="swiper-slide">
      
      
      [#if resultMap.categoryList??&&resultMap.categoryList?size>0]
      [#list resultMap.categoryList as category]
      <div class="inspection-box">
      <input name="categoryId" type="hidden" value="${category.ID}"/>
      <input name="categoryName" type="hidden" value="${category.NAME}"/>
      <div class="inspection-bg">${category.NAME}</div>
      [#if category.dataList??&&category.dataList?size>0]
      [#list category.dataList as item]
      <a class="category"><p>
          <span>${item.ITEM_NAME}</span>
        <input name="itemId" type="hidden" value="${item.ITEM_ID}"/>
        <input name="itemName" type="hidden" value="${item.ITEM_NAME}"/>
        <input name="${category.ID}" type="hidden" value="${item.ITEM_ID}&${item.ITEM_NAME}"/>
          <label>
            <select class="select tr10" id="${category.ID}-${item.ITEM_ID}" name="${category.ID}-${item.ITEM_ID}">
                <option [#if item.RESULT==1] selected [/#if] value="1">正常</option>
                <option [#if item.RESULT==2] selected [/#if] value="2">告警</option>
                <option [#if item.RESULT==3] selected [/#if] value="3">异常</option>
            </select>
        </label>
        </p>
      </a>
     [/#list]
     [/#if]
      </div>
     [/#list]
     [/#if]
      </div>
      <div class="swiper-slide">
      [#if resultMap.ciList??&&resultMap.ciList?size>0]
      [#list resultMap.ciList as ci]
      <div class="inspection-box">
      <input name="ciId" type="hidden" value="${ci.id}&${ci.ciname}&${ci.searchcode}"/>
      <div class="bg2">${ci.ciname}(${ci.searchcode})</div>
      [#if ci.xjxlist?? && ci.xjxlist?size > 0]
      [#list ci.xjxlist as xjx]
      <a class="ci"><p><span>${xjx.item_name}</span>
      <input class="${ci.id}" v="${xjx.item_name}" name="itemIdresult" type="hidden" value="${ci.id}-${xjx.id}"/>
      <input name="${ci.id}" type="hidden" value="${xjx.id}&${xjx.item_name}"/>
      <label>
            <select class="select tr10" id="${ci.id}-${xjx.id}" name="${ci.id}-${xjx.id}">
                <option [#if xjx.result==1 || xjx.result==''] selected [/#if] value="1">正常</option>
                <option [#if xjx.result==2] selected [/#if] value="2">告警</option>
                <option [#if xjx.result==3] selected [/#if] value="3">异常</option>
            </select>
      </label></p></a>
      [/#list]
      [/#if]
      </div>
      [/#list]
      [/#if]
      </div>       
             <div class="swiper-slide"><button type="button" id="button" class="add" onclick="linkOrder()" /><span>添加关联工单</span></button>
            [#if resultMap.orderList?? && resultMap.orderList?size > 0]
           [#list resultMap.orderList as order]
            <section class="worklist clearfix">
                <h2>
                     <a href="#"><em class="deletes"></em></a>
                    ${order.order_code}
                </h2>
                <input type="hidden" name="linkOrderId" value="${order.orderId}">
                <input type="hidden" name="orders" value="${order.orderId}&${order.businesstype}&${order.order_code}&${order.wfname}&${order.customer_name}&${order.createtime}&${order.creatername}">
                <div class="worklistcon clearfix">
                    <span>${Constants.mapWORKFLOW_BUSINESS_TYPE_Label(order.businesstype+"")}</span>
                    <p>工单名称:${order.wfname}</p>
                    <p>${Constants.CUSTOMER_CONSTANTS}名称:${order.customer_name}</p>
                    <p>创建时间:<em>${DateUtil.format("yyyy-MM-dd HH:mm:ss",order.createtime)}</em></p>
                    <label>${order.creatername}</label>
                </div>
            </section>
            [/#list] 
            [/#if]
   </div>
    </div>
</div>
 </form>
<script type="text/javascript">
n=$('.kltwowrap a').size();                
var wh=100*n+"%";
$('.kltwowrap').width(wh);
var lt=(100/n/4);
var lt_li=lt+"%";
$('.kltwowrap a').width(lt_li);            
$(".kltwowrap a").on('touchstart mousedown',function(e){
    e.preventDefault()
    $(".kltwowrap .active").removeClass('active');
    $(this).addClass('active');
    tabsSwiper.slideTo($(this).index());
});
 
$(".kltwowrap a").click(function(e){
    e.preventDefault();
});
 
var tabsSwiper = new Swiper(".swiper-container",{
    setWrapperSize :true,
    onSlideChangeStart: function(sw){
        $(".kltwowrap .active").removeClass('active');
        $(".kltwowrap a").eq(tabsSwiper.activeIndex).addClass('active');
        
    //sw.width
    var currTab = $(".kltwowrap a").eq(tabsSwiper.activeIndex);
    /*if(currTab.width()*sw.activeIndex +10 > sw.width){
      currTab.parent().css("left",-currTab.width()*sw.activeIndex);
    }else{
      currTab.parent().css("left",0);
    }*/
    currTab.parent().css("left",-parseInt(sw.activeIndex/4)*sw.width);
    }
});
 
function selectcus() {
   var patrol_date = $("#patrol_date").val();
   patrol_date = patrol_date.replace("-","").replace("-","");
   $("#patrol_date").val(patrol_date);
   var begin_time = $("#begin_time").val();
   begin_time = begin_time.replace("-","").replace("-","").replace(" ","").replace(":","");
   $("#begin_time").val(begin_time);
   var end_time = $("#end_time").val();
   end_time = end_time.replace("-","").replace("-","").replace(" ","").replace(":","");
   $("#end_time").val(end_time);
   $.post("${base}/ewyw/ewWorkplan/savetempDailyCheck.html",$("#myform").serialize(),function(data,textStatus) {
        var customer_id = $("#customer_id").val();
        window.location.href = "${base}/ewyw/ewIncident/ewsubCus.html?customerId="+customer_id+"&rcxj=1";
    });
    
}
 
var patrol_date = '${DateUtil.format("yyyy-MM-dd",resultMap.patrol_date)}';
var begin_time = '${DateUtil.format("yyyy-MM-dd HH:mm",resultMap.begin_time)}';
var end_time = '${DateUtil.format("yyyy-MM-dd HH:mm",resultMap.end_time)}';
var sh = '${RequestParameters.sh}';
$(function() {
 
    var currYear = (new Date()).getFullYear();    
    var opt={};
    opt.date = {preset : 'date'};
    opt.datetime = {preset : 'datetime'};
    opt.time = {preset : 'time'};
    opt.default = {
        theme: 'android-ics light', //皮肤样式
        display: 'modal', //显示方式 
        mode: 'scroller', //日期选择模式
        dateFormat: 'yyyy-mm-dd',
        lang: 'zh',
        showNow: true,
        nowText: "今天",
        startYear: currYear - 50, //开始年份
        endYear: currYear + 50//结束年份
    };
 
    $("#patrol_date").scroller($.extend(opt['date'], opt['default']));
    if(!$.util.isEmpty(patrol_date)){
       $("#patrol_date").scroller('setDate', new Date(patrol_date), true);
    }else{
       $("#patrol_date").scroller('setDate', new Date(), true);
    }
    $("#begin_time").scroller($.extend(opt['datetime'], opt['default']));
    if(!$.util.isEmpty(begin_time)){
       $("#begin_time").scroller('setDate', new Date(begin_time), true);
    }else{
       $("#begin_time").scroller('setDate', new Date(), true);
    }
    $("#end_time").scroller($.extend(opt['datetime'], opt['default']));
    if(!$.util.isEmpty(end_time)){
       $("#end_time").scroller('setDate', new Date(end_time), true);
    }else{
       $("#end_time").scroller('setDate', new Date(), true);
    }
    
    $(".deletes").click(function(){
       $(this).parent().parent().parent().remove();
    });
    
    
    if(sh == 1){
       savedaily(2);
    }
    
});
function linkOrder() {
    var customerid = $("#customer_id").val();
    
    if($.util.isEmpty(customerid)) {
        popupTips("请先选择${Constants.CUSTOMER_CONSTANTS}");
        return;
    }
    var orderIds = new Array();
    var $orderId = $(":hidden[name='orderId']");
    if($orderId.length>0) {
        $orderId.each(function() {
            orderIds.push($(this).val());
        })
    }
    var order = orderIds.join("-");
    var patrol_date = $("#patrol_date").val();
    patrol_date = patrol_date.replace("-","").replace("-","");
    $("#patrol_date").val(patrol_date);
    var begin_time = $("#begin_time").val();
    begin_time = begin_time.replace("-","").replace("-","").replace(" ","").replace(":","");
    $("#begin_time").val(begin_time);
    var end_time = $("#end_time").val();
    end_time = end_time.replace("-","").replace("-","").replace(" ","").replace(":","");
    $("#end_time").val(end_time);
     $.post("${base}/ewyw/ewWorkplan/savetempDailyCheck.html",$("#myform").serialize(),function(data,textStatus) {
         window.location.href =  "${base}/ewyw/ewIncident/ewOrder.html?customerId="+customerid+"&orderids="+order+"&rcxj=1";
     });
}
function savedaily(index) {
    var customerid = $("#customer_id").val();
    
    if($.util.isEmpty(customerid)) {
        popupTips("请选择${Constants.CUSTOMER_CONSTANTS}");
        return;
    }
    var begin_time = $("#begin_time").val();
    var end_time = $("#end_time").val();
    if(begin_time!=''&&end_time!=''){
        if(begin_time>end_time){
            popupTips("巡检开始时间不能大于结束时间");
            return;
        }
    }
    var value = $("#user_phone").val();
    if($.util.isEmpty(value)) {
        popupTips("请填写联系方式");
        return;
    }
    if(!$.util.isMobile(value) && !$.util.isTelphone(value)) {
       popupTips("联系方式格式不正确");
        return;
    }
    var summary = $("#summary").val();
    if($.util.isEmpty(summary)) {
        popupTips("请填写巡检总结");
        return;
    }
    $('#state').val(index);
    setCommonListJson();
    setCiListJson();
    var patrol_date = $("#patrol_date").val();
    patrol_date = patrol_date.replace("-","").replace("-","");
    $("#patrol_date").val(patrol_date);
    var begin_time = $("#begin_time").val();
    begin_time = begin_time.replace("-","").replace("-","").replace(" ","").replace(":","");
    $("#begin_time").val(begin_time);
    var end_time = $("#end_time").val();
    end_time = end_time.replace("-","").replace("-","").replace(" ","").replace(":","");
    $("#end_time").val(end_time);
    $.post("${base}/ewyw/ewWorkplan/saveDailyCheck.html",$("#myform").serialize(),function(data,textStatus) {
         window.location.href =  "${base}/ewyw/ewWorkplan/ewoption.html?result="+data;
     });
}
//获取选择的通用巡检项信息
function setCommonListJson(){
    var commonJsonList = [];
    if($(".category").find("input").length>0){ 
        $(".category").each(function(index){
            var categoryId = $(this).parent().find("input[name=categoryId]").val();
            var categoryName = $(this).parent().find("input[name=categoryName]").val();
            var itemId = $(this).find("input[name=itemId]").val();
            var itemName = $(this).find("input[name=itemName]").val();
            var result = $(this).find(".select").val();
            var obj = {};
            obj["categoryId"] = categoryId;
            obj["categoryName"] = categoryName;
            obj["itemId"] = itemId;
            obj["itemName"] = itemName;
            obj["result"] = result;
            commonJsonList.push(obj);
        });
    }
    $("#commonJsonList").val(JSON.stringify(commonJsonList));
}
 
//获取选择的异常配置信息
function setCiListJson(){
    var ciJsonList = [];
    if($(".ci").find("input").length>0){ 
        $(".ci").each(function(index){
            var obj = {};
            var itemId = $(this).find("input[name=itemIdresult]").val();
            var result = $(this).find(".select").val();
            obj["itemId"] = itemId;
            obj["result"] = result;
            ciJsonList.push(obj);
        });
    }
    $("#ciJsonList").val(JSON.stringify(ciJsonList));
}
 
function saveshdaily(){
    var customerid = $("#customer_id").val();
    
    if($.util.isEmpty(customerid)) {
        popupTips("请选择${Constants.CUSTOMER_CONSTANTS}");
        return;
    }
    var begin_time = $("#begin_time").val();
    var end_time = $("#end_time").val();
    if(begin_time!=''&&end_time!=''){
        if(begin_time>end_time){
            popupTips("巡检开始时间不能大于结束时间");
            return;
        }
    }
    var value = $("#user_phone").val();
    if($.util.isEmpty(value)) {
        popupTips("请填写联系方式");
        return;
    }
    if(!$.util.isMobile(value) && !$.util.isTelphone(value)) {
       popupTips("联系方式格式不正确");
        return;
    }
    var summary = $("#summary").val();
    if($.util.isEmpty(summary)) {
        popupTips("请填写巡检总结");
        return;
    }
    var patrol_date = $("#patrol_date").val();
    patrol_date = patrol_date.replace("-","").replace("-","");
    $("#patrol_date").val(patrol_date);
    var begin_time = $("#begin_time").val();
    begin_time = begin_time.replace("-","").replace("-","").replace(" ","").replace(":","");
    $("#begin_time").val(begin_time);
    var end_time = $("#end_time").val();
    end_time = end_time.replace("-","").replace("-","").replace(" ","").replace(":","");
    $("#end_time").val(end_time);
     $.post("${base}/ewyw/ewWorkplan/savetempDailyCheck.html",$("#myform").serialize(),function(data,textStatus) {
         window.location.href =  "${base}/ewyw/ewWorkplan/ewshbz.html";
     });
 
}
</script>     
</body>
</html>