buli
2022-05-13 2f4492ee18f90274582fcc2bb06f5e9bf64136e8
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
<apex:page id="Page" Controller="SearchMemberPageController" sidebar="false" showHeader="false" action="{!init}">
    <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/>
    <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
    <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
    <apex:includeScript value="{!URLFOR($Resource.connection20)}"/>
    <apex:includeScript value="{!URLFOR($Resource.apex20)}"/>
    <style type="text/css">
        
    </style>
    <script>
        function doSearchJS(){
            blockme();
            var searchByName = j$(escapeVfId("searchByName")).value();
            var searchByAccount = j$(escapeVfId("searchByAccount")).value();
            DoSearch(searchByName,searchByAccount);
        }
        function saveJS(){
            blockme();
            save();
        }
        //读取数据,调用父页面刷新方法
        function refreshPage(){
            var isError = j$(escapeVfId("isError")).value();
            if(isError == "true"){     
                return;
            }
            var lineNum = j$(escapeVfId("lineNum")).value();
            var memberId = j$(escapeVfId("memberId")).value();
            var memberName = j$(escapeVfId("memberName")).value();
            var memberEmail = j$(escapeVfId("memberEmail")).value();
            window.opener.refreshPage(lineNum,memberId,memberName,memberEmail); 
            window.close();
        }
        function closeJS(){
            /*window.parent.opener=null;
            window.parent.open('', '_self', ''); 
            setTimeout('window.parent.close()', 10000);*/
        }
        function hiddenObj(){
            var memberType = j$(escapeVfId('Page:allData:memberType')).value();
            if(memberType == "User"){
                j$(escapeVfId("accountLable")).attr("style","display:none");
                j$(escapeVfId("dataAccount")).attr("style","display:none");
            }
            if(memberType == "Contact"){
                j$(escapeVfId("accountLable")).attr("style","display:block");
                j$(escapeVfId("dataAccount")).attr("style","display:block");
            }
        }
    </script>
     <div style="width: 100%;height: 100%;">
         <apex:outputPanel id="message1">
            <apex:messages styleClass="editListError"/>
        </apex:outputPanel>
         <apex:form id="allData">
             <apex:actionFunction action="{!SearchMember}" name="DoSearch" reRender="result" oncomplete="unblockUI();">
                 <apex:param assignTo="{!searchByName}" name="searchByName" value=""></apex:param>
                 <apex:param assignTo="{!searchByAccount}" name="searchByAccount" value=""></apex:param>
             </apex:actionFunction>
             <apex:actionFunction action="{!save}" name="save" reRender="allData,message1" oncomplete="unblockUI();refreshPage();closeJS();">
             </apex:actionFunction>
             <input type="hidden" id="isError" value="{!isError}" />
             <input type="hidden" id="lineNum" value="{!lineNum}" />
             <input type="hidden" id="memberId" value="{!memberId}" />
             <input type="hidden" id="memberName" value="{!memberName}" />
             <input type="hidden" id="memberEmail" value="{!memberEmail}" />
                 
                 <table style="width: 100%;">
                     <colgroup>
                         <col style="width: 20%" />
                         <col style="width: 40%" />
                         <col style="width: 40%" />
                     </colgroup>
                     <tr>
                         <th colspan="3">
                             <apex:selectList onchange="hiddenObj()" id="memberType" value="{!memberType}" size="1">
                                 <!-- <apex:selectOptions value="{!items}"></apex:selectOptions> -->
                                 <apex:selectOption itemLabel="外部用户联系人" itemValue="Contact"></apex:selectOption>
                                 <apex:selectOption itemLabel="奥林巴斯内部用户" itemValue="User"></apex:selectOption>
                             </apex:selectList>
                        </th>
                    </tr>
                    <tr>
                         <th style="text-align:center;"><apex:commandButton value="Search" onclick="doSearchJS();return false;" />&nbsp;&nbsp;<apex:commandButton value="Save" onclick="saveJS();return false;"/></th>
 
                         <th id="nameLable" style="text-align:center;">Name:<input id="searchByName"  type="text" value="{!searchByName}" /></th>
 
                        <th style="text-align:center;"><div id="accountLable">Account:<input id="searchByAccount"  type="text" value="{!searchByAccount}" /></div></th>
                         
                     </tr>     
                 </table>
                 <apex:outputPanel id="result">
                     <table>
                         <colgroup>
                             <col style="width: 10%" />
                             <col style="width: 20%" />
                             <col style="width: 30%" />
                             <col style="width: 40%" />
                         </colgroup>
                         <tr>
                             <th style="text-align:center;">
                                 RESULT
                             </th>
                             <th colspan="2">
                             </th>
                         </tr>
                         <tr>
                             <th></th>
                             <th>NAME</th>
                              <th>EMAIL</th>
                              <th>ACCOUNT</th>
                              <!-- <apex:outputPanel layout="none" rendered="{!IF(memberType == 'Contact', true, false)}">
                                 <th>ACCOUNT</th>
                              </apex:outputPanel>
                              <apex:outputPanel layout="none" rendered="{!IF(memberType == 'User', true, false)}">
                                 <th></th>
                              </apex:outputPanel> -->
                         </tr>
                         <apex:repeat value="{!lineList}" var="line">
                             <tr>
                                 <td style="text-align:right;">
                                     <apex:inputCheckbox id="checkbox" value="{!line.check}" />
                                 </td>
                                 <td><apex:outputText value="{!line.name}"></apex:outputText></td>
                                 <td><apex:outputText value="{!line.email}"></apex:outputText></td>
                                 <td><apex:outputText value="{!line.account}"></apex:outputText></td>
                             </tr>
                         </apex:repeat>
                     </table>
                 </apex:outputPanel>
         </apex:form>
     </div>
</apex:page>