cy
2022-06-28 2ba5c891b24d4d0cd6ce7ef833592e4f576ee5e8
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
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
<!doctype html>
<html class="no-js">
<head>
<meta charset="utf-8">
<title>项目服务台-创建事件</title>
 
 
</head>
 
<body class="fullscreen">
[#include "/business/pages/include/static.html" /]
[#include "/business/pages/include/header.html" /]
[#include "/component/webupload.html" /]
[#include "/component/DatePicker.html" /]
[#include "/component/newsel.html" /]
[#assign focusLabel = Constants.WORKFLOW_BASE_BUSINESS_TYPE_INCIDENT]
[#include "/business/pages/include/cusHeader.html" /]
<script type="text/javascript">
$(document).ready(function() {
        $.formValidator.initConfig({formID:"myform",onError:function(msg){popupTips(msg)},onSuccess:function(){
            
            var type = $("#type").val();
            if(type==1 && $.util.isEmpty($("#selectUser").val())) {
                    selectPerson();
            } else {
                document.getElementById("myform").target = window.top.openDialog("0","操作",
                             {},
                             {"width":40,"height":40,"noclose":true},
                             [{btnId:"tipBtnSure", btnName:"确定", btnStyle:"bluebtn"}]);
                             return true;
            }
            
            
            // return true;
        }});
        
        $("#name").formValidator({empty: false, onShow:"请输入事件名称!",onFocus: "请输入事件名称"}).inputValidator({min: 1,max:100, onError: "事件名称为1到50个汉字"});
        $("#descrip").formValidator({empty: false, onShow:"请输入事件内容!",onFocus: "请输入事件内容"}).inputValidator({min: 1,onError: "事件内容不能为空"});
        $("#customer_id").formValidator({empty: false, onShow:"请选择${Constants.CUSTOMER_CONSTANTS}!",onFocus: "请选择${Constants.CUSTOMER_CONSTANTS}"}).inputValidator({min: 1,onError: "${Constants.CUSTOMER_CONSTANTS}不能为空"});
        $("#project_id").formValidator({empty: false, onShow:"请选择项目!",onFocus: "请选择项目"}).inputValidator({min: 1,onError: "项目不能为空"});
        $("#contact_name").formValidator({empty: false, onShow:"请输入联系人!",onFocus: "联系人不能为空"}).inputValidator({min: 1,onError: "联系人不能为空"});
        $("#contact_phone").formValidator({empty:false,onShow:"请输入联系方式!",onFocus:"联系方式不能为空!"}).regexValidator({regExp:"mobile", dataType:"enum", onError:"联系方式格式不正确"});
        $("#apply_type_id").formValidator({empty: false, onShow:"请选择申报方式!",onFocus: "申报方式不能为空"}).inputValidator({min: 1,onError: "申报方式不能为空"});
        $("#type_id").formValidator({empty: false, onShow:"请选择事件类型!",onFocus: "事件类型不能为空"}).inputValidator({min: 1,onError: "事件类型不能为空"});
        $("#source_id").formValidator({empty: false, onShow:"请选择事件来源!",onFocus: "事件来源不能为空"}).inputValidator({min: 1,onError: "事件来源不能为空"});
        $("#happen_time").formValidator({empty: false, onShow:"请选择发生时间!",onFocus: "事件发生时间不能为空"}).inputValidator({min: 1,onError: "发生时间不能为空"});
        $("#serivceListId").formValidator({empty: false, onShow:"请选择服务目录!",onFocus: "服务目录不能为空"}).inputValidator({min: 1,onError: "服务目录不能为空"});
        $("#priority_id").formValidator({empty: false, onShow:"请选择优先级!",onFocus: "优先级不能为空"}).inputValidator({min: 1,onError: "优先级不能为空"});
        $("#influence_id").formValidator({empty: false, onShow:"请选择影响度!",onFocus: "影响度不能为空"}).inputValidator({min: 1,onError: "影响度不能为空"});
        
    });
</script>
 
<div class="fs_navpath">
    <h3>当前位置</h3>
    <span></span>
    <a>事件管理 </a>
    <span></span>
    <em>新增事件</em>
</div>
<div class="fs_navtitle" id="fsNavtitle">
    <div class="fs_navtitle_con">
        <h2>新增事件</h2>
        <div class="fsnt_btn">
            <a class="fb_submit" href="javascript:doSubmit(1);"><span>提交</span></a>
            <a class="mainbtn close" href="javascript:doSubmit(2);" id="submitAndClose"><span>提交并解决</span></a>
            <a class="mainbtn close" href="javascript:doSubmit(3);" id="submitAndClose"><span>提交并关闭</span></a>
        </div>
    </div>
</div>
<form id="myform" action="${base}/business/pages/incident/addIncidentForDesk.html" method="post">
<input type="hidden" id="type" name="type">
<div class="fs_main clearfix">
    <div class="fsm_left" id="fsmLeft">
        <div class="edit_title"><h3>基本信息</h3></div>
        <table class="edit_layout">
            <tr>
                <th><label class="required">事件名称:</label></th>
                <td colspan="3">
                <input class="general maintitle" type="text" id="name" name="name" style="width:600px;"/>
                <div id="nameTip" style="display:inline-block;"></div>
                </td>
            </tr>
            <tr>
                <th class="postop"><label class="required">事件描述:</label></th>
                <td colspan="3"><textarea class="general" id="descrip" name="descrip"></textarea>
                 <div id="descripTip" style="display:inline-block;"></div>
                </td>
            </tr>
            
            <tr>
                
                    
                    
                <th><label class="required">${Constants.CUSTOMER_CONSTANTS}名称:</label></th>
                <td>
                    [@sel id="customer_id" name="customer_id"  source=customers textField="ID" valueField="CUSTOMER_NAME" labelName="customer_name" callback="changeProject"/]
                    
                    <!--
                    <select class="els" id="customer_id" name="customer_id" >
                    <option value="">请选择</option>
                    [#if customers?? && customers?size>0]
                        [#list customers as customer]
                            <option value="${customer.CUSTOMER_ID}">${customer.CUSTOMER_NAME}</option>
                        [/#list]
                    [/#if]
                    </select>
                    <input type="hidden" name="customer_name" id="customer_name">
                    -->
                    <a class="csm_info"> </a>
                    <div id="customer_idTip" style="display:inline-block;"></div>
                    </td>
            </tr>
            
            <tr>
                <th><label class="required">项目名称:</label></th>
                <td>
                    [@sel id="project_id" name="project_id"  source=projects textField="ID" valueField="PROJECT_NAME" labelName="project_name" callback="changeMsg"/]
                    <div id="project_idTip" style="display:inline-block;"></div>
                    </td>
                <th><label class="required">联系人:</label></th>
                <td>
                    <input class="general" type="text" name="contact_name" id="contact_name"/>
                    <div id="contact_nameTip" style="display:inline-block;"></div>
                </td>
            </tr>
            <tr>
                <th><label class="required">${Constants.CUSTOMER_CONSTANTS}联系方式:</label></th>
                <td>
                    <input class="general" type="text" name="contact_phone" id="contact_phone"/>
                    <div id="contact_phoneTip" style="display:inline-block;"></div>
                </td>
                
                
                <th><label class="required">申报方式:</label></th>
                <td>
                    [@sel id="apply_type_id" name="apply_type_id" source=ways textField="DATAKEY" valueField="DATAVALUE" labelName="apply_type_name"/]
                    
                    <!-- 
                    <select class="els" id="apply_type_id" name="apply_type_id">
                    <option value="">请选择</option>
                    [#if ways?? && ways?size>0]
                        [#list ways as way]
                            <option value="${way.DATAKEY}">${way.DATAVALUE}</option>
                        [/#list]
                    [/#if]
                    </select>
                    <input type="hidden" name="apply_type_name" id="apply_type_name"> -->
                    <div id="apply_type_idTip" style="display:inline-block;"></div>
                </td>
                
            </tr>
            <tr>
            
                <th><label class="required">事件类型:</label></th>
                <td>
                    [@sel id="type_id" name="type_id" source=types textField="DATAKEY" valueField="DATAVALUE" labelName="type_name" /]
                    <!-- <select class="els" id="type_id" name="type_id">
                    <option value="">请选择</option>
                    [#if types?? && types?size>0]
                        [#list types as type]
                            <option value="${type.DATAKEY}">${type.DATAVALUE}</option>
                        [/#list]
                    [/#if]
                    </select>
                    <input type="hidden" name="type_name" id="type_name"> -->
                    <div id="type_idTip" style="display:inline-block;"></div>
                </td>
                
                
                <th><label class="required">事件来源:</label></th>
                <td>
                    [@sel id="source_id" name="source_id" source=froms textField="DATAKEY" valueField="DATAVALUE" labelName="source_name" /]
                    <!-- <select class="els" id="source_id" name="source_id">
                        <option value="">请选择</option>
                        [#if froms?? && froms?size>0]
                            [#list froms as from]
                                <option value="${from.DATAKEY}">${from.DATAVALUE}</option>
                            [/#list]
                        [/#if]
                    </select>
                    <input type="hidden" name="source_name" id="source_name"> -->
                    <div id="source_idTip" style="display:inline-block;"></div>
                </td>
                
                
            </tr>
            <tr>
                
                <th><label class="required">事件发生时间:</label></th>
                <td>
                    [@datepicker id="happen_time" value="" class="general" length=14/]<div id="happen_timeTip" style="display:inline-block;"></div>
                </td>
                
                <th><label class="required">服务目录:</label></th>
                <td>
                    <div class="icon_search">
                        <input type="text" id="serivceList" readonly name="serivceList" onclick="showSl();"/>
                        <input type="hidden" id="serivceListId" name="serivceListId">
                        <a></a>
                    </div>
                        <input type="hidden" name="selectUser" id="selectUser" />
                        <div id="serivceListIdTip" style="display:inline-block;"></div>
                </td>
                
                
                
            </tr>
            <!--<tr>
                <th><label>分配给:</label></th>
                <td>
                    <select class="els" id="share" name="share">
                        <option value="">请选择</option>
                    </select>
                    <div id="shareTip" style="display:inline-block;"></div>
                </td>
                
                <th class="userLabel" style="display:none;"><label>人员:</label></th>
                <td class="userLabel" style="display:none;">
                    <select class="els" id="engineerId" name="engineerId">
                        <option value="">请选择</option>
                    </select>
                    <input type="hidden" name="engineerName" id="engineerName">
                    <div id="engineerNameTip" style="display:inline-block;"></div>
                </td>
                
                <th><label>申请人:</label></th>
                <td>
                    <input class="general" type="text" id="apply_user_name" name="apply_user_name"/>
                    <div id="apply_user_nameTip" style="display:inline-block;"></div>
                </td>
                
            </tr>-->
            <tr>
                <th class="postop"><label>附件:</label></th>
                <td>
                    <div class="upload_file">
                        [@webupload id="files" multiple="true" extensions="*"/]
                    </div>
                </td>
                <!--<th><label>申请人联系方式:</label></th>
                <td>
                    <input class="general" type="text" id="apply_user_phone" name="apply_user_phone"/>
                    <div id="apply_user_phoneTip" style="display:inline-block;"></div>
                </td>-->
            </tr>
        </table>
        <div class="edit_title"><h3>SLA等级</h3></div>
        <table class="edit_layout">
            <tr>
                <th><label class="required">优先级:</label></th>
                <td>
                    [@sel id="priority_id" name="priority_id" source=eventPri textField="DATAKEY" valueField="DATAVALUE" labelName="priority_name" callback="queryLevel"/]
                    <div id="priority_idTip" style="display:inline-block;"></div>
                    <!-- [#if eventPri?? && eventPri?size>0]
                        <select class="els" id="priority_id" name="priority_id">
                            <option value="">请选择</option>
                            [#list eventPri as pri]
                                <option value="${pri.DATAKEY}">${pri.DATAVALUE}</option>
                            [/#list]
                        </select>
                        <input type="hidden" name="priority_name" id="priority_name">
                    [/#if]-->
                </td>
                <th><label class="required">影响度:</label></th>
                <td>
                    [@sel id="influence_id" name="influence_id" source=eventDg textField="DATAKEY" valueField="DATAVALUE" labelName="influence_name" callback="queryLevel"/]
                    <div id="influence_idTip" style="display:inline-block;"></div>
                    <!-- [#if eventDg?? && eventDg?size>0]
                        <select class="els" id="influence_id" name="influence_id">
                            <option value="">请选择</option>
                            [#list eventDg as dg]
                                <option value="${dg.DATAKEY}">${dg.DATAVALUE}</option>
                            [/#list]
                        </select>
                        <input type="hidden" name="influence_name" id="influence_name">
                    [/#if]
                     -->
                </td>
            </tr>
            
            <tr id="level" style="display:none;">
                <input type="hidden" id="slaId" name="sla_id" />
                <input type="hidden" id="slaName" name="sla_name" />
                <input type="hidden" id="request_answer_time" name="request_answer_time" />
                <input type="hidden" id="request_deal_time" name="request_deal_time" />
                <th><label class="required">服务等级:</label></th>
                <td colspan="3" class="scores_con">
                    <!--<a class="scores_star focus"></a>
                    <a class="scores_star focus"></a>
                    <a class="scores_star"></a>
                    <a class="scores_star"></a>
                    <a class="scores_star"></a>
                    --><h4 id="levelName"></h4>
                    <p>(<span>响应时间:</span><em class="first" id="responseTime"></em><span>解决时间:</span><em id="resovleTime"></em>)</p>
                </td>
            </tr>
        </table>
        <div class="edit_title"><h3>关联配置信息</h3><a class="add_associated" href="javascript:linkDevice();">添加关联配置</a></div>
        <table class="display_form" id="linkDeviceTable" >
            <tr class="title">
                <td>搜索码</td>
                <td>配置名称</td>
                <td>存放位置</td>
                <td>操作</td>
            </tr>
            <tr>
                <td colspan="4" align="center">暂无关联信息</td>
            </tr>
        </table>
        <div class="edit_title"><h3>关联工单信息</h3><a class="add_associated" href="javascript:linkOrder();">添加关联工单</a></div>
        <table class="display_form" id="linkOrderTable">
            <tr class="title">
                <td>工单编号</td>
                <td>工单名称</td>
                <td>工单类型</td>
                <td>当前状态</td>
                <td>操作</td>
            </tr>
            <tr align="center">
                <td colspan="5">暂无关联信息</td>
            </tr>
        </table>
    </div>
    <div class="fsm_right" id="fsmRight">
         <div class="fsr_list">
             <div class="fsrl_title"><h3>历史工单</h3><a>更多>></a></div>
             <div class="fsrl_con">
                 <dl>
                     <dt><a>1.[<span class="blue_txt">进行中</span>]信号灯故障硬盘灯不亮</a></dt>
                     <dd>运维一般是指对大型组织已经建立好的网络软硬件的维护,其中传统的运维是指信息技术运维(IT运维)。所谓IT运维管理,是指单位 IT 部门采用相关方法...</dd>
                 </dl>
                 <dl>
                     <dt><a>1.[<span class="yellow_txt">已完成</span>]信号灯故障硬盘灯不亮</a></dt>
                     <dd>运维一般是指对大型组织已经建立好的网络软硬件的维护,其中传统的运维是指信息技术运维(IT运维)。所谓IT运维管理,是指单位 IT 部门采用相关方法...</dd>
                 </dl>
                 <dl>
                     <dt><a>1.[<span class="yellow_txt">已完成</span>]信号灯故障硬盘灯不亮</a></dt>
                     <dd>运维一般是指对大型组织已经建立好的网络软硬件的维护,其中传统的运维是指信息技术运维(IT运维)。所谓IT运维管理,是指单位 IT 部门采用相关方法...</dd>
                 </dl>
                 <dl>
                     <dt><a>1.[<span class="yellow_txt">已完成</span>]信号灯故障硬盘灯不亮</a></dt>
                     <dd>运维一般是指对大型组织已经建立好的网络软硬件的维护,其中传统的运维是指信息技术运维(IT运维)。所谓IT运维管理,是指单位 IT 部门采用相关方法...</dd>
                 </dl>
             </div>
         </div>
         <div class="fsr_list">
             <div class="fsrl_title"><h3>历史工单</h3><a>更多>></a></div>
             <div class="fsrl_con">
                 <span class="loading"></span>
             </div>
         </div>
         <div class="fsr_list">
             <div class="fsrl_title"><h3>历史工单</h3><a>更多>></a></div>
             <div class="fsrl_con">
                 <span class="nodata"></span>
             </div>
         </div>
    </div>
</div>
</form>
[#include "/business/pages/include/footer.html" /]
 
<script type="text/javascript">
$("input:text,select,textarea,input:hidden").val("");
function showSl() {
        var project_id = $("#project_id").val();
        if($.util.isEmpty(project_id)) {
            popupTips("请先选择项目");
            return;
        }
        var customer_id = $("#customer_id").val();
        if($.util.isEmpty(customer_id)) {
            popupTips("请先选择${Constants.CUSTOMER_CONSTANTS}");
            return;
        }
 
        var serivceList = $("#serivceList").val();
        var serivceListId = $("#serivceListId").val();
        var url = "${base}/business/pages/incident/serviceListTree.html?customerId="+customer_id+"&projectId="+project_id+"&type=2";
        if(!$.util.isEmpty(serivceList)&&!$.util.isEmpty(serivceListId)) {
            var names = serivceList.split("-");
            var ids = serivceListId.split("-");
            if(ids.length==3) {
                url += "&sl="+ids[2];
            }
        }
        
        window.top.openDialog("selectSl","操作",
                             {},
                             {"width":80,"height":80},
                             [{btnId:"btnSure", btnName:"确定", btnStyle:"bluebtn"}],url);
    }
 
function queryLevel(a,b) {
    var priority_id = $("#priority_id").val();
    var influence_id = $("#influence_id").val();
    var serivceListId = $("#serivceListId").val();
    var project_id = $("#project_id").val();
    var customer_id = $("#customer_id").val();
    if(!$.util.isEmpty(priority_id) && !$.util.isEmpty(influence_id) && !$.util.isEmpty(serivceListId) && !$.util.isEmpty(project_id) && !$.util.isEmpty(customer_id)) {
        $.post("${base}/business/pages/incident/queryLevel.html",{"priority_id":priority_id,"influence_id":influence_id,"serivceListId":serivceListId,"project_id":project_id,"customer_id":customer_id},function(data,textStatus) {
                $("#slaId").val(data.levelId);
                $("#slaName").val(data.levelName);
                $("#levelName").text(data.levelName);
                $("#request_answer_time").val(data.responseTime);
                $("#request_deal_time").val(data.resolveTime);
                $("#responseTime").text(data.responseTime+"分钟");
                $("#resovleTime").text(data.resolveTime+"小时");
                $("#level").show();
        },"json")
    }
}
 
 
function showName(labelId,labelName) {
    $("#serivceList").val(labelName);
    $("#serivceListId").val(labelId);
    queryLevel();
}
 
function changeMsg() {
    $("#serivceListId,#serivceList").val("");
    $("#level").hide();
}
 
 
$(function() {
    var customerId = $('#customer_id');
    var typeId = $('#type_id');
    var applyTypeId = $('#apply_type_id');
    var sourceId = $('#source_id');
    var priority_id = $('#priority_id');
    var influence_id = $('#influence_id');
    
    $("a.delete").live("click",function() {
        var $table = $(this).parents("table");
        if($table.find("tr").length==2) {
            var $str = $(this).parents("tr");
            var length = $str.find("td").length;
            $str.find("td:gt(0)").remove();
            $str.find("td:first").attr({"colspan":length,"align":"center"}).html("暂无关联信息");
        } else {
            $(this).parents("tr").remove();
        }
    })
    
})
 
 
 
function linkDevice() {
    var customerid = $("#customer_id").val();
    var projectId = $("#project_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("-");
    window.top.openDialog("0","添加关联配置",
                         {},
                         {"width":80,"height":80},
                         [{btnId:"btnSure", btnName:"选择", btnStyle:"bluebtn"}],
                         "${base}/business/pages/incident/linkDevice.html?customerid="+customerid+"&ciIds="+ciIds);
}
 
function showLinkDeivce(devices) {
    var strHtml = "";
    $.each(devices,function(i,item) {
        var deviceId = item.get("deivceId");
        var searchCode = item.get("searchCode");
        var deviceName = item.get("deviceName");
        var position = item.get("position");
        strHtml += "<tr><td><input type='hidden' name='deviceId' value='"+deviceId+"'>"+searchCode+"</td><td>"+deviceName+"</td><td>"+position+"</td><td><a class='delete'>删除</a></td></tr>";
    })
    
    
    var firstTd = $("#linkDeviceTable tr:eq(1)");
    if(firstTd.find("td:eq(0)").attr("colspan")!=1) {
        firstTd.remove();
    }
    $("#linkDeviceTable").append(strHtml).show();
}
 
 
function showLinkOrder(devices) {
    var strHtml = "";
    $.each(devices,function(i,item) {
        var orderId = item.get("orderId");
        var businesstype = item.get("businesstype");
        var orderCode = item.get("orderCode");
        var wfname = item.get("wfname");
        var createTime = item.get("createTime");
        var customerName = item.get("customerName");
        var wfstateText = item.get("wfstateText");
        strHtml += "<tr><td><input type='hidden' name='orderId' value='"+orderId+"'>"+orderCode+"</td><td>"+wfname+"</td><td>"+businesstype+"</td><td>"+wfstateText+"</td><td><a class='delete'>删除</a></td></tr>";
    })
    
    
    var firstTd = $("#linkOrderTable tr:eq(1)");
    if(firstTd.find("td:eq(0)").attr("colspan")!=1) {
        firstTd.remove();
    }
    
    $("#linkOrderTable").append(strHtml).show();
}
 
function linkOrder() {
    var projectId = $("#projectId").val();
    var customerid = $("#customer_id").val();
    
    
    if($.util.isEmpty(projectId)) {
        popupTips("请先选择项目");
        return;
    }
    
    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 orderids = orderIds.join("-");
    window.top.openDialog("0","添加关联工单",
                         {},
                         {"width":80,"height":80},
                         [{btnId:"btnSure", btnName:"选择", btnStyle:"bluebtn"}],
                         "${base}/business/pages/incident/linkOrder.html?projectId="+projectId+"&customerid="+customerid+"&orderids="+orderids);
}
 
function doSubmit(type) {
    $("#type").val(type);
    $("#myform").submit();
}
 
 
function selectPerson() {
            var serivceListId = $("#serivceListId").val();
            var customerId = $("#customer_id").val();
            var projectId = $("#project_id").val();
            
            
            window.top.openDialog("personList","人员分配",
                     {},
                     {"width":60,"height":90},
                     [{btnId:"btnSure", btnName:"选择", btnStyle:"bluebtn"}],"${base}/business/pages/incident/users.html?customerId="+customerId+"&projectId="+projectId+"&serivceListId="+serivceListId);
}
 
 
function selectUser(userMsg,bz) {
    $("#selectUser").val(userMsg);
    $("#myform").submit();
}
 
 
function changeProject(customerId,customerName) {
    $.post("${base}/business/pages/incident/queryProByCusId.html",{"customerId":customerId},function(data,textStatus) {
        var optionHtml = "<option value=''>请选择</option>";
        $.each(data,function(i,item) {
            optionHtml += "<option value='"+item.ID+"'>"+item.PROJECT_NAME+"</option>";
        })
        $('#project_id').html(optionHtml);
        changeMsg();
        
    },"json")
}
 
</script>
 
<input type="button" value="选择人员" onclick="selectPerson();" />
</body>
</html>