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
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
<!doctype html>
<html>
<head>
[#include "/business/wechat/include/title.html" /]
[#include "/business/wechat/include/wheader.html" /]
[#include "/component/DatePicker.html" /]
[#include "/component/newsel.html" /]
[#include "/business/wechat/include/mobiscroll.html" /]
</head>
 
<body>
<header class="kltit">
    <!-- <div class="present"><a href="javascript:saveIncident('3');" class="solve">提交并关闭</a></div> -->
    <!-- <div class="present"><a href="javascript:saveIncident('2');">提交并解决</a></div> -->
    <div class="present"><a href="javascript:saveIncident('1');">提交</a></div>
    <a href="${base}/ewyw/ewIncident/ewIncident.html" ><span></span></a>创建事件
 
</header>
<form id="myform" action="" method="post">
<input type="hidden" id="type" name="type">
<input type="hidden" name="selectUser" id="selectUser" value="${selectMap.selectUser}" />
<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>
<div class="swiper-container" id="swiper-pages">
    <div class="swiper-wrapper">
        <div class="swiper-slide">
            <section class="wlresponse">
                <p>
                    <span>事件名称</span>
                    <i><input  placeholder="请输入事件名称" name="name" id="name" type="text" class="enter" value="${resultMap.name}"></i>
                </p>
                <p>
                    <span>事件描述</span>
                    <i><textarea  placeholder="请输入事件描述" name="descrip" id="descrip" cols="" rows="3" class="event-text">${resultMap.descrip}</textarea></i>
                </p>
                <a href="javascript:selectcus();"><p class="next2">
                    <span>${Constants.CUSTOMER_CONSTANTS}名称</span>
                    <label id="showcus"  class="tr">${resultMap.customer_name}</label>
                    <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>
                <p>
                    <span>联系方式</span>
                    <i><input placeholder="请输入联系方式" name="contact_phone" id="contact_phone" type="text" class="enter" value="${resultMap.contact_phone}"></i>
                </p>
                <p>
                    <span>联系人</span>
                     <i><input placeholder="请输入联系人" name="contact_name" id="contact_name" type="text" class="enter" value="${resultMap.contact_name}"></i>
                </p>
                <p>
                    <span>业务科室</span>
                     <i><input placeholder="请输入业务科室" name="keshi" id="keshi" type="text" class="enter" value="${resultMap.keshi}"></i>
                </p>
                <p>
                    <span>申报方式</span>
                    <label>
                    [#if ways?? && ways?size > 0]
                    <select id="apply_type_id" name="apply_type_id"  class="select" >
                    [#list ways as way]
                       <option value="${way.DATAKEY}" [#if resultMap.apply_type_id?? && resultMap.apply_type_id == way.DATAKEY]selected[#elseif wayId == way.DATAKEY]selected[/#if]>${way.DATAVALUE}</option>
                    [/#list]  
                    </select>
                    [/#if]
                    </label>
              </p>
                <p>
                    <span>事件类型</span>
                    <label>
                    [#if types?? && types?size > 0]
                    <select id="type_id" name="type_id" class="select">
                    [#list types as type]
                       <option value="${type.DATAKEY}" [#if resultMap.type_id?? && resultMap.type_id == type.DATAKEY]selected[#elseif typeId == type.DATAKEY]selected[/#if]>${type.DATAVALUE}</option>
                    [/#list]  
                    </select>
                    [/#if]
                    </label>
              </p>
              <p>
                    <span>事件来源</span>
                    <label>
                    [#if froms?? && froms?size > 0]
                    <select id="source_id" name="source_id"  class="select">
                    [#list froms as from]
                       <option value="${from.DATAKEY}" [#if resultMap.source_id?? && resultMap.source_id == from.DATAKEY]selected[#elseif fromId == from.DATAKEY]selected[/#if]>${from.DATAVALUE}</option>
                    [/#list]  
                    </select>
                    [/#if]
                    </label>
              </p>
                <p class="next2">
                    <span>发生时间</span>
                     <label> <input class="enter" type="text" name="happen_time" id="happen_time" value="${DateUtil.format('yyyy-MM-dd HH:mm',resultMap.happen_time)}"/></label> 
                </p>
                 <a href="javascript:showSl();">
                 <p class="next2">
                    <span>服务目录</span>
                    [#if resultMap.serivceList??]
                    <label class="tr">${resultMap.serivceList}</label>
                    [#else]
                    <label class="tr">请选择</label>
                    [/#if]
                    <input type="hidden" id="serivceListId" name="serivceListId" value="${resultMap.serivceListId}" >
                    <input type="hidden" id="serivceList" name="serivceList" value="${resultMap.serivceList}" >
                </p></a>
                 <a href="javascript:showlevel();">
                 <p class="next2">
                    <span>SLA等级</span>
                    <label><em class="org">${resultMap.slaName}</em><br />
                    <em class="responseicon"></em>响应时间:<em class="org">${resultMap.request_answer_time}分钟</em><br />
                    <em class="responseicon"></em>解决时间:<em class="org">${resultMap.request_deal_time}小时</em></label>  
                    <input type="hidden" id="slaId" name="sla_id" value="${resultMap.slaId}" />
                    <input type="hidden" id="slaName" name="sla_name" value="${resultMap.slaName}" />
                    <input type="hidden" id="request_answer_time" name="request_answer_time" value="${resultMap.request_answer_time}"/>
                    <input type="hidden" id="request_deal_time" name="request_deal_time" value="${resultMap.request_deal_time}"/> 
                    <input type="hidden" id="priority_id" name="priority_id" value="${resultMap.priority_id}"/> 
                    <input type="hidden" id="influence_id" name="influence_id" value="${resultMap.influence_id}"/> 
                </p></a>
            </section>
        </div>
      <div class="swiper-slide">
       <button type="button" id="button" class="add" onclick="linkDevice()" /><span>添加关联配置</span></button>
           [#if resultMap.deviceList?? && resultMap.deviceList?size > 0]
           [#list resultMap.deviceList as device]
            <section class="worklist clearfix">
                <h2>
                    <a href="#"><em class="deletes"></em></a>
                    ${device.searchcode}
               </h2>
               <input type="hidden" name="deviceId" value="${device.deivceId}">
               <input type="hidden" name="devices" value="${device.deivceId}&${device.searchcode}&${device.ciname}&${device.position}&${device.lv_name}">
              <div class="worklistcon clearfix">
                     <span class="relaicon"></span>
                     <p>配置名称:${device.ciname}</p>
                     <p>分类名称:${device.lv_name}</p>
                    <p>存放位置:<em>${device.position}</em></p>
              </div>
            </section>
            [/#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="orderId" 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 class="swiper-slide">
              <section class="wlfile clearfix">
                <button class="bluebtn uploadings"><span>上传附件</span></button><button class="bluebtn uploadings photographs"><span>拍照</span></button>
                <a href="#">
                <p>
                    <span class="file_rar"></span>
                     <label class="del2">
                        企业邮箱使用及绑定提醒操作说明.rar
                        <em>1.67MB  2015-06-17 12:30:21</em>
                    </label>
                </p>
                </a>
            </section>
        </div> -->
    </div>
</div>
</form> 
<script type="text/javascript">
n=$('.kltwowrap a').size();                
var wh=100*n+"%";
$('.kltwowrap').width(wh);
var lt=(100/n/3);
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();
});
 
window.onload=function(){  
    var pages = document.getElementById("swiper-pages");  
    var scale = window.screen.height / window.screen.width;  
    pages.style.height = document.body.clientWidth * scale -$('.kltit').height()-$('.kltwo').height() - 20 + "px";  
 
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/3)*sw.width);
    }
});
var time = '${DateUtil.format("yyyy-MM-dd HH:mm",resultMap.happen_time)}';
var tjtype = '${RequestParameters.tjtype}';
$(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//结束年份
    };
 
    $("#happen_time").scroller($.extend(opt['datetime'], opt['default']));
    if(!$.util.isEmpty(time)){
       $("#happen_time").scroller('setDate', new Date(time), true);
    }else{
       $("#happen_time").scroller('setDate', new Date(), true);
    }
 
 
    if(tjtype ==1){
       saveIncident("1");
    }
    
    $("#contact_phone").blur(function() {
        var customer_id = $("#customer_id").val();
        if(!$.util.isEmpty(customer_id)) {
            var contactPhone = $.trim($(this).val());
            $("#loadCycle").show();
            $.post("${base}/ewyw/ewIncident/queryContactInfo.html",{"customer_id":customer_id,"contactPhone":contactPhone},function(data,textStatus) {
                if(data.hasMsg == 1) {
                    var contact_name = data.CONTACT_NAME;
                    if(!$.util.isEmpty(contact_name)) {
                        $("#contact_name").val(contact_name);
                    }
                    var ywks = data.YWKS;
                    if(!$.util.isEmpty(ywks)) {
                        $("#keshi").val(ywks);
                    }
                }
                $("#hasMsg").val(data.hasMsg);
                $("#loadCycle").hide();
            },"json")
            
        }
    });
    $(".deletes").click(function(){
       $(this).parent().parent().parent().remove();
    });
    
})
 
function selectcus() {
    var happen_time = $("#happen_time").val();
    happen_time = happen_time.replace("-","").replace("-","").replace(" ","").replace(":","");
    $("#happen_time").val(happen_time);
   $.post("${base}/ewyw/ewIncident/savetempincident.html",$("#myform").serialize(),function(data,textStatus) {
        var customer_id = $("#customer_id").val();
        window.location.href = "${base}/ewyw/ewIncident/ewsubCus.html?customerId="+customer_id+"&fwt=1";
    });
    
}
 
function showSl() {
       var customer_id = $("#customer_id").val();
        if($.util.isEmpty(customer_id)) {
            popupTips("请先选择${Constants.CUSTOMER_CONSTANTS}");
            return;
        }
        var happen_time = $("#happen_time").val();
       happen_time = happen_time.replace("-","").replace("-","").replace(" ","").replace(":","");
       $("#happen_time").val(happen_time);
       $.post("${base}/ewyw/ewIncident/savetempincident.html",$("#myform").serialize(),function(data,textStatus) {
 
            var serivceList = $("#serivceList").val();
            var serivceListId = $("#serivceListId").val();
            var url = "${base}/ewyw/ewIncident/ewserviceListTree.html?customerId="+customer_id+"&fwt=1";
            if(!$.util.isEmpty(serivceList)&&!$.util.isEmpty(serivceListId)) {
                var names = serivceList.split("-");
                var ids = serivceListId.split("-");
                if(ids.length==3) {
                    url += "&sl="+ids[2];
                }
            }
            window.location.href = url;
        });    
    }
    
    function showlevel() {
       var customer_id = $("#customer_id").val();
        if($.util.isEmpty(customer_id)) {
            popupTips("请先选择${Constants.CUSTOMER_CONSTANTS}");
            return;
        }
        var serivceListId = $("#serivceListId").val();
        if($.util.isEmpty(serivceListId)) {
            popupTips("请先选择服务目录");
            return;
        }
        var happen_time = $("#happen_time").val();
       happen_time = happen_time.replace("-","").replace("-","").replace(" ","").replace(":","");
       $("#happen_time").val(happen_time);
       $.post("${base}/ewyw/ewIncident/savetempincident.html",$("#myform").serialize(),function(data,textStatus) {
            var priority_id = $("#priority_id").val();
            var influence_id = $("#influence_id").val();
            var url = "${base}/ewyw/ewIncident/ewselectlevel.html?customerId="+customer_id+"&serivceListId="+serivceListId+"&priority_id="+priority_id+"&influence_id="+influence_id+"&fwt=1";
            window.location.href = url;
        });    
    }
    
function linkDevice() {
    var customerid = $("#customer_id").val();
    if($.util.isEmpty(customerid)) {
        popupTips("请先选择${Constants.CUSTOMER_CONSTANTS}");
        return;
    }
    var deviceIds = new Array();
    var $deviceId = $(":hidden[name='deviceId']");
    if($deviceId.length>0) {
        $deviceId.each(function() {
            deviceIds.push($(this).val());
        })
    }
    
    var ciIds = deviceIds.join("-");
    var happen_time = $("#happen_time").val();
    happen_time = happen_time.replace("-","").replace("-","").replace(" ","").replace(":","");
    $("#happen_time").val(happen_time);
    $.post("${base}/ewyw/ewIncident/savetempincident.html",$("#myform").serialize(),function(data,textStatus) {
         window.location.href = "${base}/ewyw/ewIncident/ewDevice.html?customerId="+customerid+"&ciIds="+ciIds+"&fwt=1";
     });
}
 
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 happen_time = $("#happen_time").val();
    happen_time = happen_time.replace("-","").replace("-","").replace(" ","").replace(":","");
    $("#happen_time").val(happen_time);
    $.post("${base}/ewyw/ewIncident/savetempincident.html",$("#myform").serialize(),function(data,textStatus) {
         window.location.href =  "${base}/ewyw/ewIncident/ewOrder.html?customerId="+customerid+"&orderids="+orderIds+"&fwt=1";
     })
}
 
function saveIncident(index){
     var name = $("#name").val();
     if($.util.isEmpty(name)) {
        popupTips("事件名称不能为空");
        return;
     } else {
        if(name.length > 50){
           popupTips("事件名称最大50个汉字");
           return;
        }
     }
     var descrip = $("#descrip").val();
     if($.util.isEmpty(descrip)) {
        popupTips("事件描述不能为空");
        return;
     } 
     var customer_id = $("#customer_id").val();
     if($.util.isEmpty(customer_id)) {
        popupTips("${Constants.CUSTOMER_CONSTANTS}不能为空");
        return;
     } 
     var contact_phone = $("#contact_phone").val();
     if($.util.isEmpty(contact_phone)) {
        popupTips("联系方式不能为空");
        return;
     }
     if(!$.util.isMobile(contact_phone) && !$.util.isTelphone(contact_phone)) {
        popupTips("联系方式格式不正确");
        return;
     }
     var contact_name = $("#contact_name").val();
     if($.util.isEmpty(contact_name)) {
        popupTips("联系人不能为空");
        return;
     } else {
        if(contact_name.length > 50){
           popupTips("联系人最大50个汉字");
           return;
        }
     }
     var keshi = $("#keshi").val();
     if(keshi.length > 25){
           popupTips("科室最大25个汉字");
           return;
     } 
     var apply_type_id = $("#apply_type_id").val();
      if($.util.isEmpty(apply_type_id)) {
        popupTips("申报方式不能为空");
        return;
     }
     var type_id = $("#type_id").val();
      if($.util.isEmpty(type_id)) {
        popupTips("事件类型不能为空");
        return;
     }
     var source_id = $("#source_id").val();
      if($.util.isEmpty(source_id)) {
        popupTips("事件来源不能为空");
        return;
     }
     var happen_time = $("#happen_time").val();
      if($.util.isEmpty(happen_time)) {
        popupTips("发生时间不能为空");
        return;
     }
     var serivceListId = $("#serivceListId").val();
      if($.util.isEmpty(serivceListId)) {
        popupTips("服务目录不能为空");
        return;
     }
     var slaId = $("#slaId").val();
     if($.util.isEmpty(slaId)) {
        popupTips("等级协议不能为空");
        return;
     }
     var request_answer_time = $("#request_answer_time").val();
     if($.util.isEmpty(request_answer_time)) {
        popupTips("响应时间不能为空");
        return;
     }
     var request_deal_time = $("#request_deal_time").val();
     if($.util.isEmpty(request_deal_time)) {
        popupTips("解决时间不能为空");
        return;
     }
     $("#type").val(index);
     var selectuser = $("#selectUser").val();
     if(index == 1 && $.util.isEmpty(selectuser)){
         happen_time = happen_time.replace("-","").replace("-","").replace(" ","").replace(":","");
         $("#happen_time").val(happen_time);
         $.post("${base}/ewyw/ewIncident/savetempincident.html",$("#myform").serialize(),function(data,textStatus) {
            window.location.href = "${base}/ewyw/ewIncident/ewusers.html?customerId="+customer_id+"&serivceListId="+serivceListId+"&seltype=1";
         });
     
     }else{
         happen_time = happen_time.replace("-","").replace("-","").replace(" ","").replace(":","");
         $("#happen_time").val(happen_time);
         $.post("${base}/ewyw/ewIncident/ewaddIncidentfwt.html",$("#myform").serialize(),function(data,textStatus) {
              if(index == 1){
                  window.location.href =  "${base}/ewyw/ewIncident/ewoption.html";
               }else{
                   if(index == 2){
                      window.location.href =  "${base}/ewyw/ewIncident/ewEndTask.html?orderId="+data;
                   }else{
                      window.location.href =  "${base}/ewyw/ewIncident/ewCloseReason.html?orderId="+data;
                   }
               }
         });
     
     }
     
 
}
</script>     
</body>
</html>