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
[#if info?? && info.datas?? && info.datas?size>0]
    <table class="display_form common_list_table">
       <tr class="title">
               <td width="5%"><input type="checkbox" class="checkAll" /></td>
            <td width="5%">序号</td>
            <td width="20%">联系人名称</td>
            <td width="20%">项目名称</td>
            <td width="14%">联系方式</td>
            <td width="14%">邮箱</td>
       </tr>
       [#list info.datas as cus]
           <tr>
                   <td><input type="checkbox" class="check" id="${cus.ID}" value="${cus.CONTACT_NAME}" [#if cus.check == 1]checked[/#if]/></td>
                <td>${info.rowNum+cus_index+1}</td>
                <td>${cus.CONTACT_NAME}</td>
                <td>${cus.CUSTOMER_NAME}</td>
                <td>${cus.TELEPHONE}</td>
                <td>${cus.EMAIL}</td>
           </tr>
       [/#list]  
    </table>
[#else]
    <div class="loadpos"><span class="nodata"></span></div>
[/#if] 
<script type="text/javascript">
 
$(function() {
    $(".checkAll").on("click",function() {
        $('.check').attr('checked',$(this).prop('checked'));
        var checkTree = $(".check");
        var alreadySelect = "";
        if($(this).is(":checked")){
            checkTree.each(function() {
                var slId = $(this).attr("id");
                var sel = $("."+slId).text();
                if($.util.isEmpty(sel)){
                   alreadySelect += "<span class='selcus "+slId +"' sl='"+slId+"'>"+$(this).parent().next().next().text()+"<img src='${common_static}/static/ui/images/del.png' alt=''/></span>";
                 }    
            });
        $(".checked-now #content").append(alreadySelect);
        }else{
            checkTree.each(function() {
               var slId = $(this).attr("id");
               $("."+slId).remove();
            });
        
        }
        
    });
    
    $(".check").on("click",function() {
        var slId = $(this).attr("id");
        if($(this).is(":checked")){
            var alreadySelect = "";
            
            var sel = $("."+slId).text();
            if($.util.isEmpty(sel)){
                alreadySelect += "<span class='selcus "+slId +"' sl='"+slId+"' p='"+$(this).parent().next().next().text()+"'>"+$(this).parent().next().next().text()+"<img src='${common_static}/static/ui/images/del.png' alt=''/></span>";
            }
            $(".checked-now #content").append(alreadySelect);
        }else{
           $("."+slId).remove();
        }
        
    });
    
    $(".checked-now img").live("click",function() {
        var slId = $(this).parent().attr("sl");
        $("#"+slId).prop("checked",false);
        //$(".checkAll").prop("checked",false);
        $(this).parent().remove();
    });
    
    $(".kong").live('click',function(){
        $(".checked-now #content").empty();
        $(".check,.checkAll").prop("checked",false);
    });
    
})
 
</script>