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
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
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
<!doctype html>
<html class="no-js">
<head>
    <meta charset="utf-8">
    [#include "/business/pages/include/static.html" /]
    [#include "/business/pages/include/header.html" /]
    [#include "/component/newupload.html" /]
    [#include "/component/DatePicker.html" /]
    [#include "/component/newsel.html" /]
<script src="${common_static}/static/script/select/chosen.jquery.js"></script>
<script src="${common_static}/static/script/select/chosen.jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="${common_static}/static/script/select/chosen.css"/>
    <title>发布申请</title>
    <script type="text/javascript">
        $(document).ready(function () {
            $.formValidator.initConfig({
                formID: "myform", onError: function (msg) {
                    popupTips(msg)
                }, onSuccess: function () {
                    return true;
                }
            });
            $("#name").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: "领域不能为空"
            });
            $("#sub_customer_id").formValidator({
                empty: false,
                onShow: "请选择${Constants.UNIT_CONSTANTS}",
                onFocus: "请选择${Constants.UNIT_CONSTANTS}"
            }).inputValidator({min: 1, onError: "${Constants.UNIT_CONSTANTS}不能为空"});
 
            $("#source_id").formValidator({empty: false, onShow: "请填写发布来源", onFocus: "请填写发布来源"}).inputValidator({
                min: 1,
                onError: "发布来源不能为空"
            });
            $("#release_type_id").formValidator({
                empty: false,
                onShow: "请填写发布类型",
                onFocus: "请填写发布类型"
            }).inputValidator({min: 1, onError: "发布类型不能为空"});
            $("#serivceListId").formValidator({
                empty: false,
                onShow: "请选择服务目录",
                onFocus: "请选择服务目录"
            }).inputValidator({min: 1, onError: "服务目录不能为空"});
 
            $("#second_part_name").formValidator({
                empty: false,
                onShow: "请填写甲方负责人",
                onFocus: "请填写甲方负责人"
            }).inputValidator({min: 1, onError: "甲方负责人不能为空"});
            
            $("#second_part_tel").formValidator({empty:false,onFocus:"请输入联系方式"}).inputValidator({min:1,onError:"联系方式不能为空"})
        .regexValidator({regExp:"telOrmobile",dataType : "enum", onError:"联系方式为手机号或固定电话"});
            
            $("#plan_start_time").formValidator({
                empty: false,
                onShow: "请填写预计开始时间",
                onFocus: "请填写预计开始时间"
            }).inputValidator({min: 1, onError: "预计开始时间不能为空"});
            $("#plan_end_time").formValidator({
                empty: false,
                onShow: "请填写预计结束时间",
                onFocus: "请填写预计结束时间"
            }).inputValidator({min: 1, onError: "预计结束时间不能为空"});
            $("#release_reason").formValidator({
                empty: false,
                onShow: "请填写发布原因",
                onFocus: "请填写发布原因"
            }).inputValidator({min: 1, onError: "发布原因不能为空"});
            $("#release_range").formValidator({
                empty: false,
                onShow: "请填写发布范围",
                onFocus: "请填写发布范围"
            }).inputValidator({min: 1, onError: "发布范围不能为空"});
            $("#workload").formValidator({empty: false, onShow: "请填写工作量", onFocus: "请填写工作量"}).inputValidator({
                min: 1,
                onError: "工作量不能为空"
            });
        });
    </script>
 
 
    <script type="text/javascript"><!--
 
    //配置库数据新增页面
    function openConfigDataDialog() {
        window.top.openDialog("0", "配置库数据",
            {},
            {"width": "600px", "height": "400px", "mode": "pixel"},
            [{btnId: "btnSure", btnName: "确定", btnStyle: "bluebtn"}],
            "${base}/business/pages/releaseManage/addBusinessSys.html");
    }
 
    //添加配置库数据信息
    function addConfigData(configData) {
        var firstTd = $("#configDataList tr:eq(1)");
        var strHtml = "";
        var index = '1';
 
        if (firstTd.find("td:eq(0)").attr("colspan") == 1) {
            index = parseInt($("#configDataList").find("tr:last").find("td:eq(0)").text()) + 1;
        }
        strHtml += "<tr>";
        strHtml += "<td>" + index;
        strHtml += "<input name='cname' type='hidden' value='" + configData.get("cname") + "'/>";
        strHtml += "<input name='content' type='hidden' value='" + configData.get("content") + "'/>";
        strHtml += "<input name='state' type='hidden' value='" + configData.get("state") + "'/>";
        strHtml += "</td>";
        strHtml += "<td>" + configData.get("cname") + "</td>";
        strHtml += "<td>" + configData.get("content") + "</td>";
        strHtml += "<td>" + configData.get("state") + "</td>";
        strHtml += "<td align='center'><a class='edit' onclick='openEditConfigDataDialog($(this))'>修改</a>";
        strHtml += "&nbsp;&nbsp;&nbsp;&nbsp;<a class='delete'>删除</a></td>";
        strHtml += "</tr>";
        //如果第一行为暂无信息 则删除
        if (firstTd.find("td:eq(0)").attr("colspan") != 1) {
            firstTd.remove();
        }
        $("#configDataList").append(strHtml).show();
    }
 
    //修改配置库数据页面
    function openEditConfigDataDialog(obj) {
        var cname;
        var content;
        var state;
        obj.parent().parent().find("td").each(function (index) {
            if (index == 0) {
                cname = $(this).find("input[name=cname]").val();
                content = $(this).find("input[name=content]").val();
                state = $(this).find("input[name=state]").val();
            }
        });
        var tdIndex = obj.parent().parent().index();
        window.top.openDialog("0", "配置库数据",
            {},
            {"width": "600px", "height": "400px", "mode": "pixel"},
            [{btnId: "btnEdit", btnName: "修改", btnStyle: "bluebtn"}],
            "${base}/business/pages/releaseManage/addBusinessSys.html?cname=" +
            cname + "&content=" + content + "&state=" + state + "&tdIndex=" + tdIndex);
    }
 
    //修改配置库数据信息
    function editConfigData(tdIndex, configData) {
        $("#configDataList tr:eq(" + tdIndex + ")").find("td").each(function (index) {
            if (index == 0) {
                $(this).find("input[name=cname]").val(configData.get("cname"));
                $(this).find("input[name=content]").val(configData.get("content"));
                $(this).find("input[name=state]").val(configData.get("state"));
            } else if (index == 1) {
                $(this).text(configData.get("cname"));
            } else if (index == 2) {
                $(this).text(configData.get("content"));
            } else if (index == 3) {
                $(this).text(configData.get("state"));
            }
        });
    }
 
 
    //获取配置库数据数据
    function getConfigDataJson() {
        var configDataJson = "[";
        var len = $("#configDataList tr").length;
        //第一列不为暂无信息
        if ($("#configDataList").find("tr:eq(1)").find("td:eq(0)").attr("colspan") == 1) {
            $("#configDataList").find("tr").each(function (index) {
                //从第二列开始扫描
                if (index > 0) {
                    configDataJson = configDataJson + "{";
                    $(this).find("td").each(function (index_td) {
                        if (index_td == 0) {
                            var cname = $(this).find("input[name=cname]").val();
                            var content = $(this).find("input[name=content]").val();
                            var state = $(this).find("input[name=state]").val();
 
                            configDataJson = configDataJson + "'cname':'" + cname + "',";
                            configDataJson = configDataJson + "'content':'" + content + "',";
                            configDataJson = configDataJson + "'state':'" + state + "'";
                        }
                    });
                    if (index == len - 1) {
                        configDataJson = configDataJson + "}";
                    } else {
                        configDataJson = configDataJson + "},";
                    }
                }
            });
 
        }
        configDataJson = configDataJson + "]";
        $("#configDataJson").val(configDataJson);
    }
 
    //添加关联配置页面
    function linkDevice() {
        var customerid = $("#customer_id").val();
        var sub_customer_id = $("#sub_customer_id").val();
        var sub_customer_name = $("#sub_customer_name").val();
        if ($.util.isEmpty(customerid)) {
            popupTips("请先选择${Constants.CUSTOMER_CONSTANTS}");
            return;
        }
        var deviceIds = new Array();
        var $deviceId = $(":hidden[name='linkDeviceId']");
        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 + "&subCustomerId=" + sub_customer_id + "&sub_customer_name=" + sub_customer_name);
    }
    //添加关联配置
    function showLinkDeivce(devices) {
        var strHtml = "";
        $.each(devices, function (i, item) {
            var deviceId = item.get("deivceId");
            var searchCode = item.get("searchCode");
            var deviceName = item.get("ciName");
            var position = item.get("position");
            strHtml += "<tr><td><input type='hidden' name='linkDeviceId' 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 linkOrder() {
        var customerid = $("#customer_id").val();
 
        if ($.util.isEmpty(customerid)) {
            popupTips("请先选择${Constants.CUSTOMER_CONSTANTS}");
            return;
        }
        var orderIds = new Array();
        var $orderId = $(":hidden[name='linkOrderId']");
        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?customerid=" + customerid + "&orderids=" + orderids);
    }
 
    //添加关联工单
    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='linkOrderId' 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 () {
        //表单提交事件
        $("#fb_submit").click(function () {
            var firstTd = $("#linkDeviceTable tr:eq(1)");
            if (firstTd.find("td:eq(0)").attr("colspan") == 4) {
                window.top.popupTips('请选择关联配置', 2);
                return;
            }
            getConfigDataJson();
            $("#myform").submit();
        });
 
        //删除按钮点击事件
        $("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();
            }
        });
    });
    --></script>
</head>
 
<body class="fullscreen">
<nav class="fs_nav">
    <div class="fsnav_con">
        <h3>发布工单</h3>
        <a class="focus"
           href="[#if RequestParameters.orderId?? && RequestParameters.flowId??]${base}/business/pages/releaseManage/releaseJump.html.html?orderId=${RequestParameters.orderId}&flowId=${RequestParameters.flowId}&nodeId=${RequestParameters.nodeId}[/#if]"><span>发布处理</span></a>
    </div>
</nav>
<div class="fs_navtitle" id="fsNavtitle">
    <div class="fs_navtitle_con">
        <h2>发布申请</h2>
        <div class="fsnt_btn">
            <a id="fb_submit" class="fb_submit"><span>组织DSL</span></a>
        </div>
    </div>
</div>
 
<div class="fs_main clearfix">
    <form id="myform" method="post">
        <div class="edit_title"><h3>基本信息</h3></div>
        <input type="hidden" id="configDataJson" name="configDataJson" value=""/>
        <input type="hidden" id="orderId" name="orderId" value="${orderId}"/>
        <input type="hidden" id="nodeId" name="nodeId" value="${nodeId}"/>
        <input type="hidden" id="flowId" name="flowId" value="${flowId}"/>
        <input type="hidden" id="oa_id" name="oa_id" value="${release.oa_id}"/>
        <input type="hidden" id="source_change_id" name="source_change_id" value="${release.source_change_id}"/>
        <table class="edit_layout">
            <tr>
                <th class="postop"><label class="required">发布标题:</label></th>
                <td colspan="3">
                    <input id="name" name="name" value="${release.name}" class="general maintitle" type="text"
                           style="width:600px;"/>
                    <div id="nameTip" 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" value="${release.customer_id}" text="${release.customer_name}" source=customers textField="ID" valueField="CUSTOMER_NAME" labelName="customer_name" callback="changeMsg"/]
                </td>
                <th><label class="required">${Constants.UNIT_CONSTANTS}:</label></th>
                <td>
                    <input  class="general" type="text" name="sub_customer_name" id="sub_customer_name" value="${release.sub_customer_name}" readOnly onclick="subCus();"/>
                       <input type="hidden" name="sub_customer_id" id="sub_customer_id" value="${release.sub_customer_id}"/>
                    <div id="sub_customer_idTip" style="display:inline-block;"></div>
                </td>
            </tr>
            
            <tr>
                <th><label class="required">服务目录:</label></th>
                <td colspan="3">
                    <input type="text" id="serivceList" class="general" [#if release.first_category_id!='' ] value="${release.first_category_name}-${release.second_category_name}-${release.third_category_name}" [/#if] readonly name="serivceList" onclick="showSl();" style="width:300px;"/>
                    <input type="hidden" [#if release.first_category_id!='']value="${release.first_category_id}-${release.second_category_id}-${release.third_category_id}" [/#if] id="serivceListId" name="serivceListId">
                    <input type="hidden" id="serivceListName" name="serivceListName" [#if release.first_category_id!='']value="${release.first_category_name}@${release.second_category_name}@${release.third_category_name}" [/#if]>
                    <div id="serivceListIdTip" style="display:inline-block;"></div>
                </td>
            </tr>
 
            <tr>
                <th><label class="required">发布来源:</label></th>
                <td>
                    [@sel id="source_id" name="source_id" value="${release.source_id}" text="${release.source_name}"
                    source=sourceList textField="DATAKEY" valueField="DATAVALUE" labelName="source_name"/]
                    <div id="source_idTip" style="display:inline-block;"></div>
                </td>
                <th><label class="required">发布类型:</label></th>
                <td >
                    [@sel id="release_type_id" name="release_type_id" value="${release.release_type_id}"
                    text="${release.release_type_name}" source=releaseTypeList textField="DATAKEY"
                    valueField="DATAVALUE" labelName="release_type_name"/]
                    <div id="release_type_idTip" style="display:inline-block;"></div>
                </td>
            </tr>
 
            <tr>
                <th><label class="required">甲方负责人:</label></th>
                <td>
                    <input id="second_part_name" name="second_part_name" value="${release.second_part_name}"
                           class="general" type="text"/>
                    <div id="second_part_nameTip" style="display:inline-block;"></div>
                </td>
                <th><label class="required">联系电话:</label></th>
                <td>
                    <input id="second_part_tel" name="second_part_tel" value="${release.second_part_tel}"
                           class="general" type="text"/>
                    <div id="second_part_telTip" style="display:inline-block;"></div>
                </td>
            </tr>
 
 
            <tr>
                <th><label class="required">预计开始时间:</label></th>
                <td>
                    [@datepicker id="plan_start_time" value="${release.plan_start_time}" class="general" length=14/]
                    <div id="plan_start_timeTip" style="display:inline-block;"></div>
                </td>
                <th><label class="required">预计结束时间:</label></th>
                <td>
                    [@datepicker id="plan_end_time" value="${release.plan_end_time}" class="general" length=14/]
                    <div id="plan_end_timeTip" style="display:inline-block;"></div>
                </td>
            </tr>
 
        </table>
 
        <div class="edit_title"><h3>发布申请描述</h3></div>
        <table class="edit_layout">
            <tr>
                <th class="postop"><label class="required">发布原因:</label></th>
                <td colspan="3">
                    <textarea id="release_reason" name="release_reason"
                              class="general">${release.release_reason}</textarea>
                    <div id="release_reasonTip" style="display:inline-block;"></div>
                </td>
            </tr>
 
            <tr>
                <th class="postop"><label class="required">发布范围:</label></th>
                <td colspan="3">
                    <textarea id="release_range" name="release_range"
                              class="general">${release.release_range}</textarea>
                    <div id="release_rangeTip" style="display:inline-block;"></div>
                </td>
            </tr>
 
            <tr>
                <th class="postop"><label class="required">工作量:</label></th>
                <td colspan="3">
                    <textarea id="workload" name="workload" class="general">${release.workload}</textarea>
                    <div id="workloadTip" style="display:inline-block;"></div>
                </td>
            </tr>
 
            <tr>
                <th class="postop"></th>
                <td>
 
                </td>
                <th class="postop"></th>
                <td>
 
                </td>
            </tr>
        </table>
 
        <div class="edit_title"><h3>发布方案</h3></div>
        <table class="edit_layout">
            <tr>
                <th class="postop" nowrap><label>测试方案及测试步骤:</label></th>
                <td colspan="3">
                    <textarea id="test_step" name="test_step" class="general">${release.test_step}</textarea>
                    <div id="descripTip" style="display:inline-block;"></div>
                </td>
            </tr>
 
            <tr>
                <th class="postop" nowrap><label>回退条件及回退步骤:</label></th>
                <td colspan="3">
                    <textarea id="callback_step" name="callback_step"
                              class="general">${release.callback_step}</textarea>
                    <div id="descripTip" style="display:inline-block;"></div>
                </td>
            </tr>
 
            <tr>
                <th class="postop" nowrap><label>培训计划:</label></th>
                <td colspan="3">
                    <textarea id="train_plan" name="train_plan" class="general">${release.train_plan}</textarea>
                    <div id="descripTip" style="display:inline-block;"></div>
                </td>
            </tr>
 
            <tr>
                <th class="postop"><label>通知相关部门:</label></th>
                <td colspan="3">
                    <textarea id="relation_depart" name="relation_depart"
                              class="general">${release.relation_depart}</textarea>
                    <div id="descripTip" style="display:inline-block;"></div>
                </td>
            </tr>
 
        </table>
 
 
        <div class="edit_title"><h3>相关配置库数据</h3><a class="add_associated"
                                                   href="javascript:openConfigDataDialog();">添加数据</a></div>
        <div class="table_basic">
            <table class="display_form" id="configDataList" style="width:95%">
                <tr class="title">
                    <td style="width:5%">序号</td>
                    <td style="width:20%">名称</td>
                    <td style="width:35%">内容</td>
                    <td style="width:20%">状态</td>
                    <td style="width:20%">操作</td>
                </tr>
                [#if configDataList?? && configDataList?size>0]
                [#list configDataList as configData]
                <tr>
                    <td>${configData_index+1}
                        <input name="cname" type="hidden" value="${configData.cname}"/>
                        <input name="content" type="hidden" value="${configData.content}"/>
                        <input name="state" type="hidden" value="${configData.state}"/>
                    </td>
                    <td>${configData.cname}</td>
                    <td>${configData.content}</td>
                    <td>${configData.state}</td>
                    <td align="center">
                        <a class="edit" onclick="openEditConfigDataDialog($(this))">修改</a>
                        &nbsp;&nbsp;&nbsp;&nbsp;<a class='delete'>删除</a>
                    </td>
                </tr>
                [/#list]
                [#else]
                <tr>
                    <td colspan="5" align="center">暂无信息</td>
                </tr>
                [/#if]
            </table>
        </div>
 
        <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>
            [#if linkDeviceList??&&linkDeviceList?size>0]
            [#list linkDeviceList as device]
            <tr>
                <td><input type="hidden" name="linkDeviceId" value="${device.id}">${device.seachcode}</td>
                <td>${device.ciname}</td>
                <td>${device.position}</td>
                <td><a class='delete'>删除</a></td>
            </tr>
            [/#list]
            [#else]
            <tr>
                <td colspan="4" align="center">暂无关联信息</td>
            </tr>
            [/#if]
        </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>
            [#if linkOrderList??&&linkOrderList?size>0]
            [#list linkOrderList as order]
            <tr>
                <td><input type="hidden" name="linkOrderId" value="${order.id}"/>${order.order_code}</td>
                <td>${order.wfname}</td>
                <td>${Constants.mapWORKFLOW_BUSINESS_TYPE_Label(order.businesstype)}</td>
                <td>${Constants.getWORKFLOW_BASE_WFSTATE_Label(order.wfstate)}</td>
                <td><a class='delete'>删除</a></td>
            </tr>
            [/#list]
            [#else]
            <tr align="center">
                <td colspan="5">暂无关联信息</td>
            </tr>
            [/#if]
        </table>
    </form>
</div>
<script type="text/javascript">
    $(function(){
        $("#customer_id").chosen({
            no_results_text: "没有找到结果!",//搜索无结果时显示的提示
            search_contains:true,   //关键字模糊搜索,设置为false,则只从开头开始匹配
            allow_single_deselect:true, //是否允许取消选择
            max_selected_options:1  //当select为多选时,最多选择个数
        });
        $("#customer_id").change(function () {
            $("#sub_customer_id").val($("#customer_id").val());
            $("#sub_customer_name").val($("#customer_id option:selected").text());
        });
    });
 
    //显示服务目录
    function showSl() {
        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/servicelist/slaproject/serviceListTree.html?customerId="+customer_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 showName(labelId, labelName, extendKey) {
        $("#serivceList").val(labelName);
        $("#serivceListId").val(labelId);
        $("#serivceListName").val(labelName.replace(/-/g,"${Constants.splitMark}"));
    }
 
 
 
    function changeMsg(customerId,customerName) {
        //清空服务目录
        $("#serivceListId").val("");
        $("#serivceListName").val("");
        $("#serivceList").val("");
    }
 
   
    function subCus() {
        var customer_id = $("#customer_id").val();
        if ($.util.isEmpty(customer_id)) {
            popupTips("请先选择${Constants.CUSTOMER_CONSTANTS}");
            return;
        }
        var sub_customer_id = $("#sub_customer_id").val();
        var url = "${base}/business/pages/servicelist/slaproject/subCus.html?type=2&customerId=" + customer_id + "&subCustomerId=" + sub_customer_id;
        window.top.openDialog("selectSubCus", "操作",
            {},
            {"width": 80, "height": 80},
            [{btnId: "btnSure", btnName: "确定", btnStyle: "bluebtn"}], url);
    }
    
    function showCus(labelId, labelName) {
        $("#sub_customer_name").val(labelName);
        $("#sub_customer_id").val(labelId);
    }
 
    //格式化日期
    function fomatDate14(date) {
        var year = date.substring(0, 4);
        var month = date.substring(4, 6);
        var day = date.substring(6, 8);
        var hour = date.substring(8, 10);
        var min = date.substring(10, 12);
        var Seconds = date.substring(12, 14);
        return year + '-' + month + '-' + day + ' ' + hour + ':' + min + ':' + Seconds;
    }
</script>
[#include "/business/pages/include/footer.html" /]
</body>
</html>