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
<apex:page id="Page" controller="CM_SearchContactServiceController" sidebar="false" showHeader="false" action="{!init}" lightningStylesheets="true">
 
    <!-- 2022/02/15 张华建 dependency start -->
    <!-- deloitte-zhj 20231115 PIPL还原 -->
    <!-- <apex:includeScript value="{!URLFOR($Resource.AWSService, 'AWSService.js') }" /> -->
    <!-- 2022/02/15 张华建 dependency end -->
    <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/>
    <apex:stylesheet value="{!URLFOR($Resource.StyleUtilCss)}"/>
    <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
    <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
    <!-- deloitte-zhj 20231115 PIPL还原 -->
    <!-- <style>
        .decrypt{position: absolute;
                top: 0;
                left: 100%;
                display: none;
                text-align: left;
                padding-left: 5px;
        }
        a:hover .decrypt{display: block;width: 150px}
        body .pbError,.slds-vf-scope .pbError {
            background-color: rgb(234, 0, 30)!important;
            padding: .5rem;
            color: rgb(255, 255, 255);
            line-height: 35px;
        }
    </style> -->
    <script type="text/javascript">
        var displaySearchName = false;
 
        function hiddenErrorMsgNode() {
            let errorMsgNode = document.getElementById("Page:allForm:editBlock:msgContent");
            errorMsgNode.innerText = '';
            errorMsgNode.className = '';
        }
 
        function editSaveJs() {
            hiddenErrorMsgNode();       //zhj MEBG新方案改造 2022-11-24
 
            document.getElementById("errorMsg").innerHTML = '';
            if(!document.getElementById("Page:allForm:editBlock:Search_LastName__c").value){
                document.getElementById("errorMsg").innerHTML = '<strong>错误:</strong> 必须填写。';
                return;
            }
 
            blockme();
            saveNew();
        }
 
        function editClearJs() {
            blockme();
            editClear();
        }
 
        function editContactJs(conid,unifiedIContactId) {
            blockme();
            console.log('conid = ' + conid);
            console.log('unifiedIContactId = ' + unifiedIContactId);
            if(unifiedIContactId){
                displaySearchName = true
            }else{
                displaySearchName = false
            }
            if(displaySearchName){
                document.getElementById('Page:allForm:editBlock:Search_LastName__c').disabled = true
            }else{
                document.getElementById('Page:allForm:editBlock:Search_LastName__c').disabled = false
            }
            editContact(conid);
            console.log('done');
        }
 
        function setContact(line) {
            var openLine = '{!openLine}';
            var cm = 'allPage:allForm:allBlock:records:'+ (openLine - 1) + ':contact';
            var cmid = 'allPage:allForm:allBlock:records:'+ (openLine - 1) + ':contactId';
            //var conawsid = 'allPage:allForm:allBlock:records:'+ (openLine - 1) + ':contactAWSId';//Add By Li Jun 20231102  //deloitte-zhj 20231115 PIPL还原
            var conid = j$(escapeVfId('Page:allForm:listBlock:lineinfo:' + (line - 1) + ':conId')).value();
            var conname = j$(escapeVfId('Page:allForm:listBlock:lineinfo:' + (line - 1) + ':conName')).value();//deloitte-zhj 20231115 PIPL还原
            //2022/02/15 张华建 赋值成明文 start
            //var conname = contact[awsDataId].lastName;        //deloitte-zhj 20231115 PIPL还原
            //2022/02/15 张华建 赋值成明文 end
 
            // 2018/11/19 HWAG-B399RW 自动设置省和市 start
            var cityName = j$(escapeVfId('Page:allForm:listBlock:lineinfo:' + (line - 1) + ':City')).value();
            var StateName = j$(escapeVfId('Page:allForm:listBlock:lineinfo:' + (line - 1) + ':State')).value();
          
            var city = 'allPage:allForm:allBlock:records:'+ (openLine - 1) + ':City';
            var State = 'allPage:allForm:allBlock:records:'+ (openLine - 1) + ':State';
            j$(escapeVfId(city),window.opener.document).text(cityName);
            j$(escapeVfId(State),window.opener.document).text(StateName);
            // 2018/11/19 HWAG-B399RW 自动设置省和市 end
 
 
            j$(escapeVfId(cmid),window.opener.document).val(conid);
            j$(escapeVfId(cm),window.opener.document).val(conname);
            //j$(escapeVfId(conawsid),window.opener.document).val(awsDataId);//Add By Li Jun 20231102   //deloitte-zhj 20231115 PIPL还原
            window.close();
        }
 
        
        function assignUnencrypted(){
            if(displaySearchName){
                document.getElementById('Page:allForm:editBlock:Search_LastName__c').disabled = true
            }else{
                document.getElementById('Page:allForm:editBlock:Search_LastName__c').disabled = false
            }
            unblockUI();
        }
 
        function searchContactJs() {
            blockme();
            searchContact();
        }
        //deloitte-zhj 20231115 PIPL还原 end
    </script>
 
    <apex:form id="allForm">
        <!-- deloitte-zhj 20231115 PIPL还原 去除Foo() -->
        <apex:actionFunction name="searchContact" action="{!searchContact}" rerender="allForm,allPanel,sfContactId" onComplete="unblockUI();">
            <!-- <apex:param name="awsDataIdArray" assignTo="{!awsDataIdArray}" value="" />  -->
        </apex:actionFunction>
        <!-- deloitte-zhj 20231115 PIPL还原 -->
        <apex:actionFunction name="editContact" action="{!editContact}" rerender="allForm,allPanel,sfContactId" onComplete="assignUnencrypted();unblockUI();">
            <apex:param name="firstParam" assignTo="{!conId}" value="" />
        </apex:actionFunction>
        <apex:actionFunction name="saveNew" action="{!saveNew}" rerender="allForm,allPanel,sfContactId" onComplete="unblockUI();">
        </apex:actionFunction>
        <apex:actionFunction name="editClear" action="{!editClear}" rerender="allForm,allPanel,sfContactId" onComplete="unblockUI();">
        </apex:actionFunction>
        <!-- 2022/02/15 张华建 清空LineInfoList start -->
        <apex:actionFunction name="clearLineInfoList" action="{!clearLineInfoList}" rerender="allForm" onComplete="unblockUI();">
        </apex:actionFunction>
        <apex:inputHidden id="sfContactId" value="{!sfContactId}"/> <!-- zhj 2022-12-02 sfId -->
        <!-- 2022/02/15 张华建 清空LineInfoList end -->
        <apex:outputPanel id="allPanel">
            <apex:pageBlock id="searchBlock" title="检索条件">
                <table class="linetable" border="0" style="border-collapse: collapse;width:600px;table-layout:fixed;">
                    <colgroup>
                        <col width="50px" />
                        <col width="150px" />
                        <col width="50px" />
                        <col width="150px" />
                        <col width="200px" />
                    </colgroup>
                    <tr>
                        <td>{!$ObjectType.Contact.fields.LastName.Label}</td>
                        <td><apex:inputField id="LastName" value="{!searchCon.Search_LastName__c}" style="width: 90%"/></td>
                        <!-- 2022/02/15 张华建 不需要FirstName start -->
                        <!-- <td>{!$ObjectType.Contact.fields.FirstName.Label}</td>
                        <td><apex:inputField id="FirstName" value="{!searchCon.Search_FirstName__c}" style="width: 90%"/></td> -->
                        <!-- 2022/02/15 张华建 不需要FirstName end -->
                        <td><input type="button" value="检索" onclick="searchContactJs(); return null;" /></td>
                    </tr>
                </table>
            </apex:pageBlock>
 
            <apex:pageBlock id="listBlock" title="检索结果">
            <div style="height: 200px; overflow-y: auto; overflow-x: hidden;">
                <table class="edittable" border="0" style="border-collapse: collapse;width:580px;table-layout:fixed;">
                    <colgroup>
                        <col width="50px" />
                        <!-- deloitte-zhj 20231031 加上mobilephone列 -->
                        <col width="150px" />
                        <col width="150px" />
                        <col width="300px" />   
                        <col width="50px" />
                    </colgroup>
                    <tr>
                        <th>No.</th>
                        <th>{!$ObjectType.Contact.fields.Name.Label}</th>
                        <th>{!$ObjectType.Contact.fields.MobilePhone.Label}</th>
                        <th>{!$ObjectType.Contact.fields.AccountName__c.Label}</th>
                        <th>操作</th>
                    </tr>
                    <apex:repeat id="lineinfo" value="{!lineInfoList}" var="lineinfo">
                    <tr>
                        <td>{!lineinfo.lineNo}
                            <apex:inputHidden id="conId" value="{!lineinfo.con.id}"/>
                            <apex:inputHidden id="conName" value="{!lineinfo.con.name}"/>
                            <!--  2018/11/19 HWAG-B399RW  存取客户人员省市数据 start -->
                            <apex:inputHidden id="City" value="{!lineinfo.con.City__c}"/>
                            <apex:inputHidden id="State" value="{!lineinfo.con.State__c}"/>
                            <!--  2018/11/19 HWAG-B399RW  存取客户人员省市数据 end -->
 
                        </td>
                        <!-- <td><a href="#" onclick="setContact('{!lineinfo.lineNo}');" id="943114607025717249" onmouseover="showPIDiv('943114607025717249')" onmouseout="hidePIDiv('943114607025717249')">{!lineinfo.con.Name}</a></td> -->
                        <!-- 2022/02/15 张华建 解密信息 start -->
                        <td>
                            <!-- deloitte-zhj 20231117 PIPL还原  去除aws-id-lastname-->
                            <a target="_blank" onclick="setContact('{!lineinfo.lineNo}');" style="position:relative">
                                <span class="encrypt">{!lineinfo.con.Name}</span>
                                <span class="decrypt"></span>
                            </a>
                            
                        </td>
                        <!-- deloitte-zhj 20231115 PIPL还原 去除 aws-id-mobilephone-->
                        <td><span>{!lineinfo.con.MobilePhone}</span></td>
                        <!-- 2022/02/15 张华建 解密信息 end -->
                        <td>{!lineinfo.con.AccountName__c}</td>
                        <!-- <td><input style="width:90%;" type="button" value="编辑" onclick="editContactJs('{!lineinfo.con.Id}'); return null;" /></td> -->
                        <!-- deloitte-zhj 20231020 加上统一用户Id -->
                        <td><input style="width:90%;" type="button" value="编辑" onclick="editContactJs('{!lineinfo.con.Id}','{!lineinfo.unifiedId}'); return null;" /></td>
                    </tr>
                    </apex:repeat>
                </table>
            </div>
            </apex:pageBlock>
 
            <apex:pageBlock id="editBlock" title="联系人编辑">
                <!-- Error Msg-->
                <div style="text-align: center;">
                    <apex:outputPanel id="errorMsg">
                        <apex:pageMessages id="msgContent" escape="false" />
                    </apex:outputPanel>
                </div>
                <apex:pageBlockButtons location="top">
                    <apex:commandButton onclick="editClearJs();" value="清空" rerender="dummy"/>
                    <apex:commandButton onclick="editSaveJs();" value="保存" rerender="dummy"/>
                </apex:pageBlockButtons>
                <!-- zhj 新方案改造 2022-12-05  start-->
                <!-- <apex:inputHidden id="LastName_Encrypted__c" value="{!newCon.LastName_Encrypted__c}"/>
                <apex:inputHidden id="Phone_Encrypted__c" value="{!newCon.Phone_Encrypted__c}"/> -->
                <!-- zhj 新方案改造 2022-12-05  end-->
                <!-- deloitte-zhj 20231115 PIPL还原 -->
                <!-- <apex:inputHidden id="AWS_Data_Id__c" value="{!newCon.AWS_Data_Id__c}"/> -->
                <table class="edittable" border="0" style="border-collapse: collapse; width:600px; table-layout:fixed;">
                    <colgroup>
                        <col width="50px" />
                        <col width="150px" />
                        <col width="50px" />
                        <col width="150px" />
                        <col width="50px" />
                        <col width="150px" />
                    </colgroup>
                    <tr>
                        <td>{!$ObjectType.Contact.fields.LastName.Label}</td>
                        <td><span><div class="requiredInput"><div class="requiredBlock"></div>
                            <apex:inputField id="Search_LastName__c" value="{!newCon.Search_LastName__c}" style="width: 90%"/>
                            <div id="errorMsg" style="color: red;"></div>
                        </div></span></td>
                        <!-- deloitte-zhj 20231117 PIPL还原 -->
                        <!-- <td>{!$ObjectType.Contact.fields.FirstName.Label}</td>
                        <td><apex:inputField value="{!newCon.Search_FirstName__c}" style="width: 90%"/></td> -->
                    </tr>
                    <tr>
                        <td>{!$ObjectType.Contact.fields.Supplement__c.Label}</td>
                        <td colspan="5"><apex:inputField value="{!newCon.Supplement__c}" style="width: 95%; resize: none; height: 50px"/></td>
                    </tr>
                </table>
            </apex:pageBlock>
 
        </apex:outputPanel>
    </apex:form>
</apex:page>