Li Jun
2022-03-31 3ba0123db48f8bab81ddf0913e1b95280ef545e8
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
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
<apex:page id="Page" controller="SearchVisitorController" sidebar="false" showHeader="false" >
    <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
    <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
    <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/>
    <!-- 20220217 Li Jun for PIPL start -->
    <apex:includeScript value="{!URLFOR($Resource.AWSService, 'AWSService.js') }" />
    <script src="../../soap/ajax/53.0/connection.js" type="text/javascript"></script>
    <!-- 20220217 Li Jun for PIPL End -->
    <script type="text/javascript">
        AWSService.sfSessionId = '{!GETSESSIONID()}';
        //像医生区分(职务)下拉列表加入****
        // var o = new Option();
        // o.text = '****';
        // document.getElementById('Page:mainForm:idSearchVisitor:updateContactDoctorDivision').add(o);
        function addContact(){
            window.opener.showModal();
            
            var setVisitor = new Array();
 
            setVisitor[0] = new Array();
            setVisitor[0][0] = '{!id1}';
            setVisitor[0][1] = '{!hId1}';
            
            setVisitor[1] = new Array();
            setVisitor[1][0] = '{!id2}';
            setVisitor[1][1] = '{!hId2}';
                
            setVisitor[2] = new Array();
            setVisitor[2][0] = '{!id3}';
            setVisitor[2][1] = '{!hId3}';
 
            setVisitor[3] = new Array();
            setVisitor[3][0] = '{!id4}';
            setVisitor[3][1] = '{!hId4}';
 
            setVisitor[4] = new Array();
            setVisitor[4][0] = '{!id5}';
            setVisitor[4][1] = '{!hId5}';
            
            var sltList = new Array();
            var j = 0;
 
            for(var i=0; i<5; i++){
                if(j$(escapeVfId('Page:mainForm:idSearchVisitor:idAddVisitor:' + i + ':idAddHiddenId')).value() != ''){
                    sltList[j] = new Array();
                    //Add by Li Jun for PIPL 20220218 Start
                    let accountId = j$(escapeVfId('Page:mainForm:idSearchVisitor:idAddVisitor:' + i + ':idAddHiddenId')).value();
                    sltList[j][0] = contactInfo[sfIdToAWSIdMapValue.get(accountId)].lastName;
                    //Add by Li Jun for PIPL 20220218 End
                    //sltList[j][0] = document.getElementById('Page:mainForm:idSearchVisitor:idAddVisitor:' + i + ':idAddName').innerHTML; // Commented by Li Jun for PIPL
                    sltList[j][1] = accountId;
                    j++;
                }
            }
            
            for(var i=j; i<5; i++){
                sltList[j] = new Array();
                sltList[j][0] = '';
                sltList[j][1] = '';
                j++;
            }
            
            for(var a=0; a<5; a++){
                //Updated by Li Jun 20220228
                if(window.opener.document.getElementById(setVisitor[a][0])&&window.opener.document.getElementById(setVisitor[a][1])){
                    window.opener.document.getElementById(setVisitor[a][0]).value = sltList[a][0];
                    window.opener.document.getElementById(setVisitor[a][1]).value = sltList[a][1];
                }               
            }
 
            window.close();
        }
        
        function sltContact(index){
            var addId = j$(escapeVfId('Page:mainForm:idSearchVisitor:idRezultVisitor:' + index + ':idHiddenId')).value();
            var addName = document.getElementById('Page:mainForm:idSearchVisitor:idRezultVisitor:' + index + ':idName').innerHTML;
            var addDep = document.getElementById('Page:mainForm:idSearchVisitor:idRezultVisitor:' + index + ':idDep').innerHTML;
            var addJob = document.getElementById('Page:mainForm:idSearchVisitor:idRezultVisitor:' + index + ':idJob').innerHTML;
            var addPhone = document.getElementById('Page:mainForm:idSearchVisitor:idRezultVisitor:' + index + ':idPhone').innerHTML;
            var addMyDr = document.getElementById('Page:mainForm:idSearchVisitor:idRezultVisitor:' + index + ':idMyDr').innerHTML;
            var addPlease_Delete = document.getElementById('Page:mainForm:idSearchVisitor:idRezultVisitor:' + index + ':idPlease_Delete').innerHTML;
            
            for(var i=0; i<5; i++){
                if(j$(escapeVfId('Page:mainForm:idSearchVisitor:idAddVisitor:' + i + ':idAddHiddenId')).value() == addId){
                    alert('{!$Label.Error_Message45}');
                    return;
                }
            }
                    
            for(var i=0; i<5; i++){
                if(document.getElementById('Page:mainForm:idSearchVisitor:idAddVisitor:' + i + ':idAddName').innerHTML == ' '){
                    j$(escapeVfId('Page:mainForm:idSearchVisitor:idAddVisitor:' + i + ':idAddHiddenId')).val(addId);
                    document.getElementById('Page:mainForm:idSearchVisitor:idAddVisitor:' + i + ':idAddName').innerHTML = addName;
                    document.getElementById('Page:mainForm:idSearchVisitor:idAddVisitor:' + i + ':idAddDep').innerHTML = addDep;
                    document.getElementById('Page:mainForm:idSearchVisitor:idAddVisitor:' + i + ':idAddJob').innerHTML = addJob;
                    document.getElementById('Page:mainForm:idSearchVisitor:idAddVisitor:' + i + ':idAddPhone').innerHTML = addPhone;
                    document.getElementById('Page:mainForm:idSearchVisitor:idAddVisitor:' + i + ':idAddMyDr').innerHTML = addMyDr;                  
                    break;
                }
            }
        }
        
        function delContact(index){
            j$(escapeVfId('Page:mainForm:idSearchVisitor:idAddVisitor:' + index + ':idAddHiddenId')).val("");
            document.getElementById('Page:mainForm:idSearchVisitor:idAddVisitor:' + index + ':idAddName').value = null;
            document.getElementById('Page:mainForm:idSearchVisitor:idAddVisitor:' + index + ':idAddName').innerHTML = ' ';
            document.getElementById('Page:mainForm:idSearchVisitor:idAddVisitor:' + index + ':idAddDep').innerHTML = ' ';
            document.getElementById('Page:mainForm:idSearchVisitor:idAddVisitor:' + index + ':idAddJob').innerHTML = ' ';
            document.getElementById('Page:mainForm:idSearchVisitor:idAddVisitor:' + index + ':idAddPhone').innerHTML = ' ';
            document.getElementById('Page:mainForm:idSearchVisitor:idAddVisitor:' + index + ':idAddMyDr').innerHTML = '<img src=\"/img/checkbox_unchecked.gif\" width=\"16\" height=\"16\" class=\"checkImg\" />';
        }
 
        //Add By Li Jun 20220228 Start for PIPL
        // var sfIdToAWSContact = new Object();
        var staticResources = JSON.parse('{!staticResource}');
        var contactAWSIds = JSON.parse('{!contactAWSIds}');
        var searchByLastName = '';
        var contactInfo = {};
        var sfIdToAWSIdMapValue = new Map();
        var aws_result = {};
        var selectedEditIndex = 0;
        var selectedAwsDataId = '';
        searchContactAll();
        function preparePayloadForSearchContact(){
            let searchPayload = new Object();
            searchPayload.dataIds = contactAWSIds;
            searchPayload.contactName = searchByLastName;
            return JSON.stringify(searchPayload);
        }
 
        //Search Contact From AWS
        function searchContactAll(){
            let data = preparePayloadForSearchContact();
            let searchCallBack = function searchCallBack(result){
                let contacts = result.object;
                if(contacts == null){
                    return;
                }
                for(var i=0;i<contacts.length;i++){
                    let temp = {}
                    temp.lastName = contacts[i].lastName?contacts[i].lastName:'';
                    temp.phone = contacts[i].phone?contacts[i].phone:'';
                    temp.doctorDivision1 = contacts[i].doctorDivision1? contacts[i].doctorDivision1:'';
                    temp.type = contacts[i].type? contacts[i].type:'';
                    contactInfo[contacts[i].dataId] = temp;
                    if(contacts[i].sfRecordId){
                        sfIdToAWSIdMapValue.put(contacts[i].sfRecordId,contacts[i].dataId);
                    }                    
                }
                console.log('AWS Contact Result:'+JSON.stringify(contactInfo));
            };
            AWSService.search(staticResources.searchUrl,data,searchCallBack,staticResources.token);
        }
 
        function queryContactProcess(){
            console.log('Query Contact process.');         
            //1. get contact name from search box     
            let searchByLastName = document.getElementById('Page:mainForm:idSearchVisitor:searchContactName').value; 
            //2. inovke aws service
            let contactAwsIds = new Set();
            for(var key in contactInfo){
                if(contactInfo[key].lastName.indexOf(searchByLastName) != -1){
                    contactAwsIds.add(key);
                }
            }
            if(contactAwsIds.size == 0){
                clearLineInfoList();
                return;
            }
            searchContactAll();
            //3. render the current page 
            serContact(JSON.stringify(Array.from(contactAwsIds)));
        }
 
        function showPIDiv(dataId,obj){ 
            console.log('Selected Record:'+dataId);
            //check sf id
            let awsDataId = dataId;
            if(dataId.length == 1){
                let sfId = j$(escapeVfId('Page:mainForm:idSearchVisitor:idAddVisitor:' + dataId + ':idAddHiddenId')).val()
                awsDataId = sfIdToAWSIdMapValue.get(sfId); 
            }
            if(awsDataId){               
                console.log('AWS Data Id:'+ awsDataId);
                console.log('AWS Data Info:'+ JSON.stringify(contactInfo));
                let parentNode = document.getElementById(obj.id);
                let createDiv = document.createElement("div");  
                createDiv.id = parentNode.id+"_PI";  
                let piInformation = '{!$Label.Visitor_Name}:'+contactInfo[awsDataId].lastName +'\n{!$ObjectType.Contact.fields.Doctor_Division1__c.Label}:'+contactInfo[awsDataId].doctorDivision1+'\n{!$ObjectType.Lead.fields.Phone.Label}:'+contactInfo[awsDataId].phone
                createDiv.innerText = piInformation;
                let x=window.event.x;
                let y=window.event.y; 
                createDiv.style.left=x;  
                createDiv.style.top=y;  
                createDiv.style.marginLeft='20px';
                createDiv.style.marginTop='-40px';
                createDiv.style.height='80px';  
                createDiv.style.width='120px';
                createDiv.style.background = "#dddddd";
                createDiv.style.position = "absolute";
                parentNode.appendChild(createDiv);  
                parentNode.style.position = "relative";
            }            
        }
 
        function hidePIDiv(obj){
            document.getElementById(obj.id+'_PI').remove();
        }
       
        function setSelectedEditIndex(index){          
            selectedEditIndex = index;
            console.log('Selected edit index:'+selectedEditIndex);
        }
    
        function assignDencrypted(){
            let selectedEditSFId = j$(escapeVfId('Page:mainForm:idSearchVisitor:idAddVisitor:' + selectedEditIndex + ':idAddHiddenId')).val()
            selectedAwsDataId = sfIdToAWSIdMapValue.get(selectedEditSFId);
            console.log('edit awsId:'+selectedAwsDataId);
            document.getElementById('Page:mainForm:AWS_Data_Id__c').value = selectedAwsDataId;         
            if(contactInfo.hasOwnProperty(selectedAwsDataId)){
                let selectedAWSData = contactInfo[selectedAwsDataId];
                let contactTypeNode = document.getElementById("Page:mainForm:idSearchVisitor:updateContactType");
                contactTypeNode.value = selectedAWSData.type;
                if(contactTypeNode.value){
                    jQuery(contactTypeNode).change();
                }
                document.getElementById("Page:mainForm:idSearchVisitor:updateContactLastName").value = selectedAWSData.lastName;
                document.getElementById("Page:mainForm:idSearchVisitor:updateContactPhone").value = selectedAWSData.phone;
                document.getElementById("Page:mainForm:idSearchVisitor:updateContactDoctorDivision").value = selectedAWSData.doctorDivision1;
            }
        }
 
        function GetAWSResultObj(){
            if(aws_result && aws_result.object && aws_result.object.length > 0){
                return aws_result.object[0];
            }
            return null;
        }
 
        function SetEditObj(){
            let obj = GetAWSResultObj();
            if(obj){
                console.log('Result from AWS:'+JSON.stringify(obj));
                document.getElementById('Page:mainForm:AWS_Data_Id__c').value = obj.dataId;
                
                document.getElementById("Page:mainForm:idSearchVisitor:updateContactLastName").value = obj.lastName;
                document.getElementById("Page:mainForm:LastName_Encrypted__c").value = obj.lastNameEncrypt;
 
                document.getElementById("Page:mainForm:idSearchVisitor:updateContactPhone").value = obj.phone;
                document.getElementById("Page:mainForm:Phone_Encrypted__c").value = obj.phoneEncrypt;
 
                document.getElementById("Page:mainForm:idSearchVisitor:updateContactType").value = obj.type;
                document.getElementById("Page:mainForm:Type_Encrypted__c").value = obj.typeEncrypt;
 
                document.getElementById("Page:mainForm:idSearchVisitor:updateContactDoctorDivision").value = obj.doctorDivision1;
                document.getElementById("Page:mainForm:Doctor_Division1_Encrypted__c").value = obj.doctorDivision1Encrypt;
            }
            
        }
 
        function ProcessPIForAWS(sobjJson, payloadForNewPI) {
            let url = staticResources.newUrl
            let moduleName = AWSService.insertModule;
            if (selectedAwsDataId) {
                moduleName = AWSService.updateModule;
                url = staticResources.updateUrl
            }
            console.log('Payload for AWS:'+payloadForNewPI + ' Module Name:'+moduleName);
            AWSService.postAWS(url,moduleName, payloadForNewPI, function(result){
                aws_result = result;
                SetEditObj();
                saveNew();
            }, staticResources.token);
        }
 
        function GetEditObj(){
            return JSON.stringify([{
                lastName : document.getElementById("Page:mainForm:idSearchVisitor:updateContactLastName").value,
                phone : document.getElementById("Page:mainForm:idSearchVisitor:updateContactPhone").value,
                type : document.getElementById("Page:mainForm:idSearchVisitor:updateContactType").value,
                doctorDivision1 : document.getElementById("Page:mainForm:idSearchVisitor:updateContactDoctorDivision").value,
                dataId:selectedAwsDataId
            }]);
        }
 
        function saveContactForAWS(){
            document.getElementById("errorMsg").innerHTML = '';
            if(!document.getElementById("Page:mainForm:idSearchVisitor:updateContactLastName").value){
                document.getElementById("errorMsg").innerHTML = '<strong>错误:</strong> 必须填写。';
                return;
            }
            blockme();
            let es = document.getElementsByTagName('select')
            for(let ei in es){
                let e = es[ei];
                for(let opi in e.options){
                    let op = e.options[opi];
                    if(!op)continue;
                    if(op.value == "*****" && op.selected){
                        unblockUI();
                        alert('下拉框不能主动选择密文选项')
                        return;
                    }
                }
            }
            ProcessPIForAWS({},GetEditObj());
        }
        function Trans(){
            console.log('SFRcordId:'+document.getElementById('Page:mainForm:sfContactId').value);
            AWSService.postAWS(staticResources.transactionUrl,AWSService.confirmTrans, JSON.stringify({
                    "txId":aws_result.txId,
                    "sfRecordId":document.getElementById('Page:mainForm:sfContactId').value,
                    "isSuccess":1
            }), function(result){
                window.location.reload();
            }, staticResources.token);
        }
        
        //Add By Li Jun 20220228 for PIPL End
    </script>
    <style type="text/css">
        div#iframelike {
            color: #fff;
            height: 210px;
            overflow-y: auto;
            overflow-x: hidden;
        }
        
        div#iframelike2 {
            color: #fff;
            height: 185px;
            overflow-y: auto;
            overflow-x: hidden;
        }
    </style>
    <apex:outputPanel id="all">
        <apex:form id="mainForm">
        <!-- Search Contact By Li Jun 20220214 Start-->
        <apex:actionFunction name="serContact" action="{!serContact}" rerender="idRezultVisitor">
            <apex:param name="awsContactIds" assignTo="{!awsContactIds}" value="" />
        </apex:actionFunction>
        <apex:actionFunction name="clearLineInfoList" action="{!clearLineInfoList}" rerender="mainForm" onComplete="unblockUI();">
        </apex:actionFunction>
        <!-- Search Contact By Li Jun 20220214 End-->
        <apex:actionFunction name="updContactP" action="{!updContactP}" rerender="idRezultVisitor,idRegistration">
        <apex:param name="index" assignTo="{!index}" value="" />
        </apex:actionFunction>
        <apex:actionFunction name="updContactM" action="{!updContactM}" rerender="idRezultVisitor">
        <apex:param name="index" assignTo="{!index}" value="" />
        </apex:actionFunction>
        <apex:actionFunction name="editVistor" action="{!editVistor}" rerender="idRegistration" oncomplete="assignDencrypted();setButtonDisable(document.getElementById('Page:mainForm:idSearchVisitor:idRegSave'), false);">
            <apex:param name="index" assignTo="{!index}" value=""/>
        </apex:actionFunction>
        <apex:actionFunction name="saveNew" action="{!regContact}" rerender="idRegistration,idRezultVisitor,idAddVisitor,idMessage,sfContactId" onComplete="Trans()">
        </apex:actionFunction>
         <!-- Add By Li Jun for PIPL 20220228 Start -->
         <apex:inputHidden id="LastName_Encrypted__c" value="{!rc.LastName_Encrypted__c}"/>
         <apex:inputHidden id="Phone_Encrypted__c" value="{!rc.Phone_Encrypted__c}"/>
 
         <apex:inputHidden id="Type_Encrypted__c" value="{!rc.Type_Encrypted__c}"/>
         <apex:inputHidden id="Doctor_Division1_Encrypted__c" value="{!rc.Doctor_Division1_Encrypted__c}"/>
 
         <apex:inputHidden id="AWS_Data_Id__c" value="{!rc.AWS_Data_Id__c}"/>
         <apex:inputHidden id="sfContactId" value="{!sfContactId}"/>
         <!-- Add By Li Jun for PIPL 20220221 End -->
            <apex:pageBlock id="idSearchVisitor" >
                <table width="1060" height="50" border="0">
                    <tr>
                      <th style="font-size:15px;">{!$Label.Search_Personnel}</th>
                      <td width="700px" >
                          <apex:outputPanel id="idMessage">
                            <apex:pageMessages />
                          </apex:outputPanel>
                      </td>
                      
                    </tr></table>
                <table width="1060" border="0" style="background-color:#DCDCDC">
                    <colgroup>
                        <col width="20" />
                        <col width="90" />
                        <col width="20" />
                        <col width="90" />
                        <col width="90" />
                        <col width="20" />
                        <col width="145" />
                        <col width="20" />
                        <col width="145" />
                        <col width="20" />
                        <col width="120" />
                        <col width="20" />
                        <col width="95" />
                        <col width="20" />
                        <col width="120" />
                    </colgroup>
                    <tr>
                        <td>&nbsp;</td>
                        <th>{!$Label.Search_Condition}</th>
                        <td>&nbsp;</td>
                        <th>{!$Label.Last_Name}</th>
                        <!-- <th>{!$Label.First_Name}</th> -->
                        <td>&nbsp;</td>
                        <th>{!$Label.Attribute}</th>
                        <td>&nbsp;</td>
                        <th>{!$Label.Post}</th>
                        <td>&nbsp;</td>
                        <th>{!$Label.MyDr}</th>
                        <td>&nbsp;</td>
                        <th>&nbsp;</th>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                    </tr>
                    <tr>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <!-- Add Id for pipl by Li Jun 20220214 -->
                        <td><apex:inputText id="searchContactName" value="{!sc.Search_LastName__c}" style="width:80px" required="false"/></td>
                        <!-- <td><apex:inputText value="{!sc.Search_FirstName__c}" style="width:80px" required="false"/></td>  commented for pipl by Li Jun 20220214--> 
                        <td>&nbsp;</td>
                        <th><apex:inputField value="{!sc.Type__c}" /></th>
                        <td>&nbsp;</td>
                        <th><apex:inputField value="{!sc.Doctor_Division1__c}" /></th>
                        <td>&nbsp;</td>
                        <th><apex:inputField value="{!sc.MyDr_Flg__c}" /></th>
                        <td>&nbsp;</td>
                        <th>&nbsp;</th>
                        <td>&nbsp;</td>
                        <!-- Updated By Li Jun for PIPL 20220214 -->
                        <td><input class="btn" type="Button" value="{!$Label.Search}" onclick="queryContactProcess()" style="width:100px" /></td>
                        <!-- <td><apex:commandButton value="{!$Label.Search}" action="{!serContact}" style="width:100px" rerender="idRezultVisitor" /></td> -->
                    </tr>
                    <tr>
                        <td style="border-bottom: 1px solid #888;" colspan="15">&nbsp;</td>
                    </tr>
                </table>
                <table width="1060" border="0" style="background-color:#DCDCDC">
                    <tr>
                        <td>
                        <div id="iframelike">
                        <apex:pageBlockTable id="idRezultVisitor" value="{!scwl}" var="scw" border="1" columns="8" columnsWidth="47px,90px,,90px,180x,90px,40px,200px">
                            <apex:column >
                                <apex:facet name="header">{!$Label.Selected}</apex:facet>
                                <input type="button" id="idSlt" value="{!$Label.Selected}" onclick="sltContact('{!scw.index}');"  class="btn" style="width:40px"/>
                            </apex:column>
                            <apex:column >
                                <apex:facet name="header">{!$Label.Visitor_Name}</apex:facet>
                                <apex:outputLink onmouseover="showPIDiv('{!scw.con.AWS_Data_Id__c}',this)"  onmouseout="hidePIDiv(this)" value="/{!scw.con.Id}" id="idName" target="_blank">{!scw.con.Name}</apex:outputLink>
                                <apex:inputText id="idHiddenId" value="{!scw.conid}" style="display:none" />
                            </apex:column>
                            <apex:column >
                                <apex:facet name="header">{!$Label.Department_Name}</apex:facet>
                                <apex:outputText id="idDep" value="{!IF(scw.con.Account.Name==null,' ',scw.con.Account.Name)}" />
                            </apex:column>
                            <apex:column >
                                <apex:facet name="header">{!$ObjectType.Contact.fields.Doctor_Division1__c.Label}</apex:facet>
                                <apex:outputText id="idJob" value="{!IF(scw.con.Doctor_Division1__c==null,' ',scw.con.Doctor_Division1__c)}" />
                            </apex:column>
                            <apex:column >
                                <apex:facet name="header">{!$ObjectType.Lead.fields.Phone.Label}</apex:facet>
                                <apex:outputText id="idPhone" value="{!IF(scw.con.Phone==null,' ',scw.con.Phone)}" />
                            </apex:column>
                            <apex:column >
                                <apex:facet name="header">MyDr</apex:facet>
                                <apex:inputField id="idMyDr" value="{!scw.con.MyDr_Flg__c}" onclick="this.disabled=true;updContactM('{!scw.index}');"/>
                            </apex:column>
                            <!--2014/6/16__yu追加-->
                            <apex:column id="Delete">
                                <apex:facet name="header" >Delete</apex:facet>
                                <apex:inputField id="idPlease_Delete" value="{!scw.con.Please_Delete__c}" onclick="this.disabled=true;updContactP('{!scw.index}');" />
                            </apex:column>
                            <!--2016/10/10__ZHAO追加-->
                            <apex:column id="Reason">
                                <apex:facet name="header" >删除理由</apex:facet>
                                <apex:inputField id="DeleteReason" value="{!scw.con.Delete_Reason__c}"/>
                            </apex:column>
                        </apex:pageBlockTable>
                        </div>
                        </td>
                    </tr>
                    <tr>
                        <td>&nbsp;</td>
                    </tr>
                    <tr>
                        <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>{!$Label.Add_List}</b> </td>
                    </tr>
                    <tr>
                        <td>
                        <div id="iframelike2">
                        <apex:pageBlockTable id="idAddVisitor" value="{!acwl}" var="acw" border="1" columns="7" columnsWidth="47px,90px,,90px,180x,90px,40px">
                            <apex:column >
                                <apex:facet name="header">{!$Label.Back}</apex:facet>
                                <input type="button" id="idDel" value="{!$Label.Back}" onclick="delContact('{!acw.index}');" class="btn" style="width:40px"/>
                            </apex:column>
                            <apex:column >
                                <apex:facet name="header">{!$Label.Visitor_Name}</apex:facet>
                                <!-- <apex:outputText id="idAddName" value="{!IF(acw.con.Name==null,' ',acw.con.Name)}" /> -->
                                <apex:outputLink onmouseover="showPIDiv('{!acw.index}',this)"  onmouseout="hidePIDiv(this)" value="/{!acw.conid}" id="idAddName" target="_blank">{!IF(acw.con.Name==null,' ',acw.con.Name)}</apex:outputLink>
                                <apex:inputText id="idAddHiddenId" value="{!acw.conid}" style="display:none" />
                            </apex:column>
                            <apex:column >
                                <apex:facet name="header">{!$Label.Department_Name}</apex:facet>
                                <apex:outputText id="idAddDep" value="{!IF(acw.con.Account.Name==null,' ',acw.con.Account.Name)}" />
                            </apex:column>
                            <apex:column >
                                <apex:facet name="header">{!$ObjectType.Contact.fields.Doctor_Division1__c.Label}</apex:facet>
                                <apex:outputText id="idAddJob" value="{!IF(acw.con.Doctor_Division1__c==null,' ',acw.con.Doctor_Division1__c)}" />
                            </apex:column>
                            <apex:column >
                                <apex:facet name="header">{!$ObjectType.Lead.fields.Phone.Label}</apex:facet>
                                <apex:outputText id="idAddPhone" value="{!IF(acw.con.Phone==null,' ',acw.con.Phone)}" />
                            </apex:column>
                            <apex:column >
                                <apex:facet name="header">MyDr</apex:facet>
                                <apex:outputField id="idAddMyDr" value="{!acw.con.MyDr_Flg__c}" />
                            </apex:column>
                            <apex:column >
                                <apex:facet name="header">{!$Label.Edit}</apex:facet>
                                <input type="button" id="idEdit" value="{!$Label.Edit}" onclick="setSelectedEditIndex('{!acw.index}');setButtonDisable(document.getElementById('Page:mainForm:idSearchVisitor:idRegSave'), true);editVistor('{!acw.index}');" class="btn" style="width:40px"/>
                            </apex:column>
                        </apex:pageBlockTable>
                        </div>
                        </td>
                    </tr>
                    <tr><td>
                        <table width="880" border="0" style="background-color:#DCDCDC"><tr>
                            <td>
                                <apex:commandButton value="{!$Label.Clear}" action="{!clearRC}"  style="width:40px" rerender="idRegistration" />
                            </td>
                            <td style="text-align:center">
                                <input type="button" value="{!$Label.Set}" onclick="addContact();" class="btn"/>
                            </td>
                            <td style="text-align:right">
                                <apex:commandButton id="idRegSave" value="{!$Label.Registration}" onclick="saveContactForAWS();" style="width:60px" rerender="dummy" />
                            </td>
                        </tr></table>
                    </td></tr>
                    <!-- <tr><td align="center"><input type="button" value="{!$Label.Set}" onclick="addContact();" class="btn" style="width:80px" /></td></tr> -->
                </table>
                <br></br>
                
                <apex:outputPanel id="idRegistration">
 
                <table class="formtable" width="1060" border="0">
                    
                    <tr>
                        <td width= "20">&nbsp;</td>
                        <th width= "80">{!$Label.Attribute}</th>
                        <th width= "80" ><apex:inputField id="updateContactType" value="{!rc.Type__c}" style="width:66px"/></th>
                        <th width= "80" style="text-align:right">{!$Label.Last_Name}</th>
                        <td width= "80" ><span><div class="requiredInput"><div class="requiredBlock"></div><apex:inputField id="updateContactLastName" value="{!rc.Search_LastName__c}" style="width:70px" /><div id="errorMsg" class="errorMsg"></div></div></span></td>
                        <!-- <th width= "80" style="text-align:right">{!$Label.First_Name}</th>
                        <td width= "160" colspan="2" rowspan="2"><apex:inputField value="{!rc.FirstName}" style="width:150px" /></td> -->
                        <th width= "80" style="text-align:right">{!$ObjectType.Lead.fields.Phone.Label}</th>
                        <td width= "80"><apex:inputField id="updateContactPhone" value="{!rc.phone}" style="width:110px" /></td>
                        <th width= "80" style="text-align:right">{!$ObjectType.Contact.fields.Supplement__c.Label}</th>
                        <th width= "130" colspan="2" rowspan="3"><apex:inputField value="{!rc.Supplement__c}" style="width:130px" /></th>
                        
                    </tr>
                    <tr></tr>
                    <tr>
                        <td>&nbsp;</td>
                        <th colspan="2">{!$ObjectType.Contact.fields.Doctor_Division1__c.Label}</th>
                        <th colspan="2"><apex:inputField id="updateContactDoctorDivision" value="{!rc.Doctor_Division1__c}" style="width:150px"/></th>
                        <th style="text-align:right">{!$Label.Department_Name}</th>
                        <th colspan="3"><apex:inputField value="{!rc.Account_Visitor_Search__c}" style="width:280px" /></th>
                        <th>{!$Label.MyDr}</th>
                        <th style="text-align: left;"><apex:inputField value="{!rc.MyDr_Flg__c}" /></th>
                        
                        
                    </tr>
                    <tr>
                        <td>&nbsp;</td>
                        <td colspan="3">{!$ObjectType.Contact.fields.Ignore_Same_Name__c.Label}</td>
                        <th style="text-align: left;"><apex:inputField value="{!rc.Ignore_Same_Name__c}" /></th>
                    </tr>
                </table>
            </apex:outputPanel>
            </apex:pageBlock>
        </apex:form>
    </apex:outputPanel>
</apex:page>