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
<!doctype html>
<html class="no-js">
<head>
<meta charset="utf-8">
<title>${Constants.UNIT_CONSTANTS}</title>
<!--(start) public flies-->
 
</head>
 
<body class="select_tree_body">
[#include "/business/pages/include/static.html" /]
<form id="search">
<div class="fs_main clearfix">
            <div class="event_fill list_common_select" >
            <table><tr><th width="85%">
                <div class="fill_item"><label>项目名称:</label>
                    <input class="general" type="text" id="title"/>
                </div>
            </th><td width="15%">
                <a class="retrievebtn" id="reset">重置</a><a class="retrievebtn focus" href="javascript:psearch();">查询</a>
            </td></tr>
            </table>
        </div>
    </div>
</form>
<div class="select_tree">
     <table class="st_title">
         <tr>
             <th width="14%">当前已选择:</th>
             <td id="treeLabel">
             
               [#if checkSl?? && checkSl?size>0]
                   [#list checkSl as sl]
                       <a><span class='removeSelect' sl='${sl.checkId}'>${sl.checkName}</span></a>
                   [/#list]
             [/#if]
             </td>
         </tr>
     </table>
             <div class="first_level" id="xiangmu">
                 <div class="fl_title">
                     <input class="pos tree bigtree" name="treeValue" type="radio"  [#if currCus.checked==1]checked="checked"[/#if] id="${currCus.ID}" value="${currCus.ID}" labelName="${currCus.CUSTOMER_NAME}" style="float:left;margin-top:12px;margin-right:8px;"/><h3>${currCus.CUSTOMER_NAME}</h3>
                     <a class="fl_morebtn"></a>
                 </div>
                 <table class="second_level">
                     [#if customers?? && customers?size>0]
                         [#list customers as customer]
                             <tr class="d">
                             <th width="20%"><input class="pos tree a c" style="margin-right:8px;" name="treeValue" type="radio" [#if customer.checked==1]checked="checked"[/#if] id="${customer.ID}" value="${customer.ID}" labelName="${customer.CUSTOMER_NAME}"><span>${customer.CUSTOMER_NAME}</span>:</th>
                             <td >
                                 <div class="thrid_level">
                                      <div class="thrid_level_con clearfix">
                                          [#if customer.subs?? && customer.subs?size>0]
                                              [#list customer.subs as sub]
                                                 <div class="tl_item">
                                                     <input class="pos tree b c" name="treeValue" type="radio"  [#if sub.checked==1]checked="checked"[/#if] id="${sub.ID}" value="${sub.ID}" labelName="${sub.CUSTOMER_NAME}"/>
                                                    <span>${sub.CUSTOMER_NAME}</span>
                                                 </div>
                                              [/#list]
                                          [/#if]
                                     </div>
                                 </div>
                             </td>
                             <th class="tl_morebtn_wrap"><a class="tl_morebtn">更多</a></th></tr>
                         [/#list]
                     [/#if]
                 </table>
             </div>
</div>
         
         <script type="text/javascript">
             $(function() {
                 $("#reset").click(function () {
                    $("#search")[0].reset();
                });
                 $(".tree").click(function() {
                     var checkTree = $(".tree:checked");
                     var alreadySelect = "";
                     checkTree.each(function() {
                         var slId = $(this).attr("id");
                         alreadySelect += "<a><span class='removeSelect' sl='"+slId+"'>"+$(this).next('span').text()+"</span></a>";
                     });
                     
                     $("#treeLabel").empty().append(alreadySelect);
                 });
                 $(".bigtree").click(function() {
                     var checkTree = $(".bigtree:checked");
                     var alreadySelect = "";
                     checkTree.each(function() {
                         var slId = $(this).attr("id");
                         alreadySelect += "<a><span class='removeSelect' sl='"+slId+"'>"+$(this).next('h3').text()+"</span></a>";
                     });
                     
                     $("#treeLabel").empty().append(alreadySelect);
                 });
                 
                 $(".removeSelect").live("click",function() {
                     var slId = $(this).attr("sl");
                     niceform("#"+slId).prop("checked",false);
                     $(this).parent().remove();
                 })
             })
             
             function onDialogBtnClick(btnID, dialogID, config){
                if(btnID == "btnSure"){
                    var labelId = new Array();
                    var labelName = new Array();
                    var checkTree = $(".tree:checked");
                     var labelIds = "";
                     var labelNames = "";
                     
                     if(checkTree.length!=0) {
                         checkTree.each(function() {
                             labelId.push($(this).val());
                             labelName.push($(this).attr("labelName"));
                         });
                         var labelIds = labelId.join(",");
                         var labelNames = labelName.join(",");
                         
                     }
                     
                     
                     var type = '${RequestParameters.type}';
                     if(type==2) {
                         window.parent.showCus(labelIds,labelNames);
                     } else if(type==1) {
                         window.top.document.getElementById('baseMsgIframe').contentWindow.showCus(labelIds,labelNames);
                     } else if(type==3){
                         window.top.document.getElementById('dialogIframe0').contentWindow.showCus(labelIds,labelNames);
                     }else if(type==100){
                         window.top.document.getElementById('dialogIframe10').contentWindow.showCus(labelIds,labelNames);
                     }
                     
                     window.top.hideDialog(dialogID);
                }
            }
            
            //模糊查询
            function psearch(){
                var customer_id='${customerId}';
                var sub_customer_id='${subCustomerId}';
                var title=$("#title").val();
                if(title!=''){
                    $(".c").each(function(){
                        var text=$(this).next().text();
                        if(text.indexOf(title)>-1){
                            $(this).parent().show();
                        }else{
                            $(this).parent().hide();
                        }
                    });
                    $(".b").each(function(){
                        var text=$(this).next().text();
                        if(text.indexOf(title)>-1){
                            $(this).parent().parent().parent().parent().prev().show();
                        }
                    });
                    $(".d").each(function(){
                        $(this).hide();
                        var flag=false;
                        $(this).find('input').each(function(){
                            var text=$(this).next().text();
                            if(text.indexOf(title)>-1){
                                flag=true;
                            }
                        })
                        if(flag){
                            $(this).show();
                        }
                    });
                }else{
                    var param = {"customerId":customer_id,"subCustomerId":sub_customer_id,"title":title};
                    $("#xiangmu").load("${base}/business/pages/servicelist/slaproject/subCusSearch.html", param, function () {
                        $(".tree").click(function() {
                             var checkTree = $(".tree:checked");
                             var alreadySelect = "";
                             checkTree.each(function() {
                                 var slId = $(this).attr("id");
                                 alreadySelect += "<a><span class='removeSelect' sl='"+slId+"'>"+$(this).next('span').text()+"</span></a>";
                             });
                             
                             $("#treeLabel").empty().append(alreadySelect);
                         });
                         $(".bigtree").click(function() {
                             var checkTree = $(".bigtree:checked");
                             var alreadySelect = "";
                             checkTree.each(function() {
                                 var slId = $(this).attr("id");
                                 alreadySelect += "<a><span class='removeSelect' sl='"+slId+"'>"+$(this).next('h3').text()+"</span></a>";
                             });
                             
                             $("#treeLabel").empty().append(alreadySelect);
                         });
                     
                         $(".removeSelect").live("click",function() {
                             var slId = $(this).attr("sl");
                             niceform("#"+slId).prop("checked",false);
                             $(this).parent().remove();
                         })
                         threeTreeFunc();
                    });
                }
                
            }
         </script>
</body>
</html>