cy
2022-06-22 6e06bba1c89f8077e29d0fbf0ce12f89f027d8d2
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
<!doctype html>
<html class="no-js">
<head>
<meta charset="utf-8">
<title>配置列表</title>
[#include "/business/pages/include/static.html" /]
</head>
<body>
<div class="fs_main clearfix">    
    <div id="main">
    <table class="display_form common_list_table">
    <tr class="title">
        <td width="5%"><input type="checkbox" class="all"/></td>
        <td width="5%">序号</td>
        <td width="15%">搜索码</td>
        <td width="15%">配置名称</td>
        <td width="10%">配置分类名称</td>
        <td width="10%">存放位置</td>
    </tr>
    
    [#list list as device]
        <tr>
        <td width="5%">
        <input type="checkbox" class="single"/>
        <input type="hidden" value="${device.ID}">
        <input type="hidden" value="${device.LV3_ID}">
        <input type="hidden" value="${device.LV3_NAME}">
        </td>
        <td width="10%">${device_index+1}</td>
        <td width="15%">${device.SEARCHCODE}</td>
        <td width="15%">${device.CINAME}</td>
        <td width="7%">${device.LV3_NAME}</td>
        <td width="10%">${device.POSITION}</td>
        
        </tr>
    [/#list]
    
    </table>
    </div>
</div>
<script type="text/javascript">
    $(".all").click(function (){
                if($(this).attr("checked")=="checked"){
                    $(".single").attr("checked",true);
                    }
                else{
                    $(".single").attr("checked",false);
                }    
        });
    function onDialogBtnClick(btnID, dialogID, config){
        if(btnID == "btnSure"){
            var devices=new Array();
            var lv3_ids=new Array();
            var lv3_names=new Array();
            $(".single").each(function (){
                    if($(this).attr("checked")=="checked"){
                        var id=$(this).parent().find("input:eq(1)").val();
                        var lv3_id=$(this).parent().find("input:eq(2)").val();
                        var lv3_name=$(this).parent().find("input:eq(3)").val();
                        devices.push(id);
                        lv3_ids.push(lv3_id);
                        lv3_names.push(lv3_name);
                    }
            });
            if(devices.length==0){
                window.top.popupTips("请选择配置!");
                return;
            }
            else{
                $.post("${base}/business/pages/health/doAddDevice.html",{"devices":devices.join(","),"lv3_ids":lv3_ids.join(","),"lv3_names":lv3_names.join(","),"planId":"${RequestParameters.planId}"},function(data){
                    if(data==1){
                    window.top.popupTips("操作成功!");
                    window.parent.query();
                    window.top.hideDialog("0");
                    }
                    else{
                    window.top.popupTips("系统异常!");
                    window.top.hideDialog("0");
                    }
                });
            }
        }
    }    
</script>
</body>
</html>