liuyn
2024-03-11 a87f1c3df03078814ee97ad0c8ac200a232419e9
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
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
<apex:page controller="NewQuoteIraiController" sidebar="false" action="{!init}" id="Page" lightningStylesheets="true">
<!-- <apex:slds/> -->
<apex:includeLightning />
    <apex:stylesheet value="{!URLFOR($Resource.jquerysuggestcss)}"/>
    <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/>
    <apex:stylesheet value="{!URLFOR($Resource.StyleUtilCss)}"/>
    <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
    <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
    <apex:includeScript value="{!URLFOR($Resource.jquerysuggestjs)}"/>
    <apex:includeScript value="{!URLFOR($Resource.NewQuoteIraiJS)}"/>
    <apex:includeScript value="{!URLFOR($Resource.CommonUtilJs)}"/>
    <apex:includeScript value="{!URLFOR($Resource.connection20)}"/>
    <apex:includeScript value="{!URLFOR($Resource.apex20)}"/>
    <apex:includeScript value="{!URLFOR($Resource.jquerydoubletapjs)}"/>
    <!-- 标准控件弹出页面修改 start -->
    <apex:includeScript value="{!URLFOR($Resource.SelectFieldJs)}"/>
    <!-- 标准控件弹出页面修改 end -->
    <style type="text/css">
        #sbArea{
            /*display: flex;*/
            /*background-color: red;*/
            /*display: none;*/
            
        }
        #sbArea_contentsArea{
            /*display: none;*/
            /*left:50%;*/
        }
 
        #combobox-input-11-0-11{
            /*display: none;*/
        }
        #combobox-input-17-0-17{
            /*display: none;*/
        }
        body .pbTitle .mainTitle,.slds-vf-scope .pbTitle .mainTitle {
            font-weight: 700;
            color: black;
        }
        th {
            font-size: 1em;
            font-weight: bold;
            /*color: black;*/
        }
 
        body .slds-vf-data-table td,body .slds-vf-data-table .dataCell,.slds-vf-scope .slds-vf-data-table td,.slds-vf-scope .slds-vf-data-table .dataCell {
            background: #f2f3f3;
            border-width: 0 0 1px 1px;
            border-color: #e0e3e5;
            font-size: 1em;
            /*font-weight: bold;*/
            color: black;
        }
        body .pbBody table.list tr.headerRow td,body .pbBody table.list tr.headerRow th {
            background: #f2f3f3;
            border-width: 0 0 1px 1px;
            border-color: #e0e3e5;
            font-size: 1em;
            font-weight: bold;
            color: black;
            display: none;
        }
        *,*:before,*:after {
                font-size: 1em;
                /*font-weight: bold;*/
                color: black;
              -webkit-box-sizing: border-box;
              box-sizing: border-box;
          }
      body .pbBody table.list tr th, body .pbBody table.list tr td {
          border-top: 1px solid #ededed;
          border-bottom: 1px solid #ededed;
          white-space: normal;
      }
      body .slds-vf-messages,.slds-vf-scope .slds-vf-messages {
        color: rgb(255, 255, 255);
        position: relative;
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        -ms-flex-direction: column;
        flex-direction: column;
        -webkit-box-pack: center;
        -ms-flex-pack: center;
        justify-content: center;
        margin: .5rem;
        padding: .75rem 3rem .75rem 1.5rem;
        min-width: 30rem;
        min-height: 3.5rem;
        font-weight: 300;
        text-align: left;
        list-style: none;
        border-radius: .25rem;
        background-color: rgb(186,5,23)
 
    }
    body .slds-vf-messages,.slds-vf-scope .slds-vf-messages li{
        color: red;
        font-size: 15px;
    }
    </style>
    <apex:form id="mainForm">
        <apex:outputText id="SelectFieldFlag" />
        <apex:outputText id="hiddenQuoid" value="{!quoid}" style="display:none;"/>
        <apex:inputHidden id="Agency1_entrust__c" value="{!quo.Agency1_entrust__c}"/>
        <apex:inputHidden id="Agency2_entrust__c" value="{!quo.Agency2_entrust__c}"/>
        <apex:inputHidden id="changedAfterPrint" value="{!changedAfterPrint}"/>
        <apex:inputHidden id="productStatusUpdated" value="{!productStatusUpdated}"/>
        <apex:inputHidden id="idHiddenUserStateHospital" value="{!loginUser.State_Hospital__c}" />
        <apex:actionFunction action="{!setProductEntry}" name="setProductEntry" reRender="mainForm" oncomplete="unblockUI();calPriceAll();">
            <apex:param assignTo="{!setProduct_text}" name="setProduct_text" value=""/>
        </apex:actionFunction>
        <apex:actionFunction action="{!excelImport}" name="excelImport" reRender="mainForm" oncomplete="unblockUI();calPriceAll();">
            <apex:param assignTo="{!excel_text}" name="select_index" value=""/>
        </apex:actionFunction>
        <apex:actionFunction action="{!Save}" name="Save" reRender="mainForm,message1" oncomplete="unblockUI();"/>
        <apex:actionFunction action="{!OppReflection}" name="OppReflection" reRender="mainForm" oncomplete="unblockUI();"/>
        <apex:actionFunction action="{!QuoteIrai}" name="QuoteIrai" reRender="mainForm,message1" oncomplete="unblockUI();"/>
        <apex:actionFunction action="{!msgChange}" name="msgChange" reRender="mainForm,message1" oncomplete="unblockUI();"/>
        
        <apex:pageBlock id="block">
            <apex:inputHidden value="{!quo.CurrencyIsoCode}" id="CurrencyIsoCode"/>
            <apex:inputHidden value="{!baseUrl}" id="baseUrl"/>
            <!--  CHAN-BJQ4VZ 精琢技术 2019/12/10 Start -->
            <apex:inputHidden value="{!qb.Estimation_List_Price}" id="hidden_Estimation"/>
            <apex:inputHidden value="{!errorMessage}" id="errorMessage"/>
            <apex:inputHidden value="{!qb.QuoteTotal_Page}" id="hidden_quoTotalPrice"/>
            <apex:inputHidden value="{!qb.MultiYearWarrantyTotalPrice}" id="hidden_MultiYearWarrantyTotalPrice_out"/>
            <!--  CHAN-BJQ4VZ 精琢技术 2019/12/10 END -->
            <apex:outputPanel id="message1">
                <!-- <apex:messages styleClass="editListError"/> -->
            </apex:outputPanel>
            <apex:outputPanel rendered="{!errorflg}" >
                <table width="100%">
                    <tr>
                        <td align="left"><div class="errorMsg" style="color: rgb(186,5,23);">{!errorMessage}</div></td>
                    </tr>
                </table>
            </apex:outputPanel>
            <apex:outputPanel rendered="{!succflg}" >
                <table width="100%">
                    <tr>
                        <td align="left"><div style="color:rgb(46, 132, 74)">{!succMessage}</div></td>
                    </tr>
                </table>
            </apex:outputPanel>
            <apex:outputPanel rendered="{!Messageflg}" >
                <table width="100%">
                    <tr>
                        <td align="left">{!Message}</td>
                    </tr>
                </table>
            </apex:outputPanel>
            <div style="background:rgb(240 238 238);white-space:nowrap;padding:10px;width:1100px;">
                <table border="0">
                    <tr>
                        <th style="text-align:right;width:60px;margin:10px;">{!$ObjectType.QuoteIrai__c.fields.IraiSubject__c.Label}:</th>
                        <td style="text-align:left;width:220px;margin:10px">
                            <div class="requiredInput"><div class="requiredBlock"></div><apex:inputField id="idVisitorPlace" value="{!quo.IraiSubject__c}" onblur="vpClear2_delay();" onfocus="setVisitorPlace();" style="width:210px;"/></div>
                            <apex:inputHidden id="idVisitorPlaceId" value="{!quo.Account__c}"/>
                            <apex:inputHidden id="idVisitorPlaceHidden" value="{!quo.IraiSubject__c}" />
                            <apex:inputHidden id="idVisitorPlaceHiddenId" value="{!quo.Account__c}" />                    
                        </td>
                        <th style="text-align:right;width:60px;margin:10px;">{!$ObjectType.QuoteIrai__c.fields.IraiName__c.Label}:</th>
                        <td style="text-align:left;width:220px;margin:10px;"><apex:inputField value="{!quo.IraiName__c}" style="width:220px;"/></td>
                        <th style="text-align:right;width:60px;margin:10px;padding-left:10px">  {!$ObjectType.QuoteIrai__c.fields.IraiComment__c.Label}:</th>
                        <td style="text-align:left;width:220px;margin:10px;"><apex:inputField value="{!quo.IraiComment__c}" style="width:220px;"/></td>
                        <th style="text-align:right;width:60px;margin:10px;padding-left:10px">{!$ObjectType.QuoteIrai__c.fields.QuoteProportion__c.Label}:</th>
                        <td style="text-align:left;width:60px;margin:10px;"><apex:inputField value="{!quo.QuoteProportion__c}" style="width:70px;text-align:right;"/></td>
                        <th style="text-align:left;width:20px;margin:10px;">%</th>
                        <th style="text-align:right;width:60px;margin:10px;">{!$ObjectType.QuoteIrai__c.fields.QuoteIrai_Status__c.Label}:</th>
                        <td style="text-align:left;width:80px;margin:10px;"><apex:outputField value="{!quo.QuoteIrai_Status__c}" style="width:80px;"/></td>
                    </tr>
                </table>
                 <!-- CHAN-BJQ4VZ 精琢技术 2019/12/10 Start -->
                <table border="0">
                    <tr>
                        <td>&nbsp;</td>
                        <!-- <th style="text-align:right">{!IF(displayFlg,'产品标准定价总额','')}</th> -->
                        <th style="text-align:center;width:50px;white-space:nowrap;padding:20px;">产品标准定价总额 :&nbsp;</th>
                        <td style="width:176px;padding:10px;">
                            <apex:outputText id="Estimation_Price"  value="{0, number, ###,##0.00}"
                            style="text-align:right;width:100px;">
                                <apex:param value="{!qb.Estimation_List_Price}" />
                            </apex:outputText>
                        </td>
                        <th style="text-align:right;width:100px;white-space:nowrap;padding:10px;">报价总额 :&nbsp;</th>
                       <!--  <th style="text-align:right;">{!IF(displayFlg,$Label.Total_Price,'')}</th> -->
                        <td style="width:180px;margin:10px;">
                            <apex:outputtext id="quoTotalPrice" value="{0, number, ###,##0.00}" 
                            style="text-align:right;width:100px;">
                                <apex:param value="{!qb.QuoteTotal_Page}"/>
                            </apex:outputtext>
                        </td>
                        <th style="text-align:right;width:50px;margin:10px;" rowspan="3">
                       {!$ObjectType.QuoteIrai__c.fields.MultiYearWarrantyTotalPrice__c.Label}
                   :&nbsp;</th>
                        <td style="width:100px;" rowspan="3">
                           <!--obsap 新增经销商1字段 fy end-->
                           <apex:outputtext style="width: :100px" id="MultiYearWarrantyTotalPrice_out" value="{0, number, ###,##0.00}" 
                           >
                           <!--obsap 新增经销商1字段 fy start-->
                           <!-- style="text-align:right;width:180px;"> -->
                           <!--obsap 新增经销商1字段 fy end-->
                               <apex:param value="{!qb.MultiYearWarrantyTotalPrice}"/>
                           </apex:outputtext>
                        </td>
                    </tr>
                </table>
                <!-- CHAN-BJQ4VZ 精琢技术 2019/12/10 End -->
 
                <!-- CHAN-BJQ4VZ 精琢技术 2019/12/10 Start -->
                <table>
 
 
               <!--obsap 新增经销商1字段 fy start-->
               <tr>
                <td ></td>
                <th style="width:100px;text-align:right;">{!$Label.Sales_Name1}:</th>
 
 
 
 
                <td colspan="2" style="width:260px;text-align:left;">
                    <apex:inputField style="width:230px;" id="SalesName1"  value="{!quo.Agency1_entrust__c}"   onChange="" />
                </td>
 
 
 
 
 
 
 
<!--                 <td colspan="2" style="width:260px;text-align:left;">
                    <apex:inputField  style="display: none" id="SalesName1"  value="{!quo.Agency1_entrust__c}"   onChange=""/>
                    <div id="lightningPage" style="height:50px;width: 250px;padding-top: 8px;"  onclick="getVal();" onchange="refreshSelectFieldValue(SelectFieldParamList,this)" ></div>
                    <apex:inputHidden id="SalesName1inputHidden" value="{!quo.Agency1_entrust__c}"/>
                </td> -->
 
 
                <th style="width:100px;text-align:right;margin:10px;">{!$Label.Sales_Name2}:</th>
 
                <td colspan="2" style="width:260px;text-align:left;"><apex:inputField style="width:230px;" id="SalesName2"  value="{!quo.Agency2_entrust__c}"   onChange=""/></td>
<!--                 <td colspan="2" style="width:260px;text-align:left;">
                    <apex:inputField style="width:230px;display: none;" id="SalesName2"  value="{!quo.Agency2_entrust__c}"   onChange="" />
                    <div id="lightningPage2" style="height:50px;width: 250px;padding-top: 8px;" onchange="refreshSelectFieldValue(SelectFieldParamList,this)" ></div>
                    <apex:inputHidden id="SalesName2inputHidden" value="{!quo.Agency2_entrust__c}"/>
                </td> -->
<!--                  <td colspan="2" style="width:260px;text-align:left;">
                    <c:SLDSDynamicLookup SLDSResourceName="{!$Resource.SLDS}" ObjectApiName="Account" DisplayFieldApiNames="Name" DisplayFieldsPattern="Name"  LabelName="Name" SetValueToField="{!quo.Agency1_entrust__c}" setStyleCss="width:230px;"/>
                  </td> -->
                
                
                </tr>
                <tr>
                <td style="height: 10px;"></td>
                </tr>
                <!--obsap 新增经销商1字段 fy end-->
                <!--DB202302464682【报价委托】报价委托改善224 fy start-->
               <tr>
                <td ></td>
 
                <!-- SWAG-CKDATG 【委托】【OBSAP-报价委托】报价委托项目改善1 fy start -->
                <th style="width:100px;text-align:right;">多年保:</th>
                <!-- DB202212304166 【紧急-报价委托与购买意向】请将最后操作的报价委托状态放到购买意向中 fy start -->
                <td colspan="2" style="text-align:left;"><apex:inputField id="cancelMultiyearInsurance"  value="{!quo.cancelMultiyearInsurance__c}"  onChange="cancelMultiyearInsurancechange()"/></td><!-- onChange="cancelMultiyearInsurancechange()"-->
                <!-- DB202212304166 【紧急-报价委托与购买意向】请将最后操作的报价委托状态放到购买意向中 fy end -->
                <!-- SWAG-CKDATG 【委托】【OBSAP-报价委托】报价委托项目改善1 fy end -->
 
                <th style="text-align:right;width:80px;margin:10px;">{!$ObjectType.QuoteIrai__c.fields.IraiUser__c.Label}:</th>
                <!-- fy 20220512 -->
                <!-- <apex:variable value="identif1" var="identif1" rendered="{!!(loginUser !=null&&loginUser.Salesdepartment_text__c != null&&loginUser.Salesdepartment_text__c != ''&&(loginUser.Salesdepartment_text__c == '5.华东' || loginUser.Salesdepartment_text__c == '6.华南'))}"  > -->
 
                <!-- fy 20220512 -->
                <!-- <apex:variable value="identif" var="identif" rendered="{!loginUser !=null&&loginUser.Salesdepartment_text__c != null&&loginUser.Salesdepartment_text__c != ''&&(loginUser.Salesdepartment_text__c == '5.华东' || loginUser.Salesdepartment_text__c == '6.华南')}"  > -->
 
                <!-- <th style="text-align:right;width:20px;">obsap人员</th> -->
<!--                 <td style="text-align:center;width:20px;margin:10px;"><apex:selectList value="{!quo.IraiUser__c}" size="1" style="width:120px" id="IraiUser" onchange="ObsapUsersChange()"><apex:selectOptions value="{!ObsapUsers}" id="obsapUsersList"/></apex:selectList></td> -->
                <td style="text-align:center;width:20px;margin:10px;">OBSAP小组<apex:selectList value="{!quo.IraiUser__c}" size="1" style="width:120px;display: none;" id="IraiUser" onchange="ObsapUsersChange()"><apex:selectOptions value="{!ObsapUsers}" id="obsapUsersList"/></apex:selectList></td>
 
                <!-- 20230104 lt DB202212427301 start-->
                <!-- <th style="text-align:right;width:80px;">{!$ObjectType.QuoteIrai__c.fields.LastIraiUser__c.Label}</th>
                <td style="text-align:center;width:70px;"><apex:outputField id="LastIraiUser" value="{!quo.LastIraiUser__c}"/></td> -->
                <!-- 20230104 lt DB202212427301 end-->
 
                <!-- 20230104 lt DB202212427301 start-->
                <th style="text-align:right;width:190px;margin:10px;">紧急:</th>
                <td style="text-align:center;width:10px;margin:10px;"><apex:inputField id="Urgent" value="{!quo.Urgent__c}"/></td>
                <th style="text-align:right;width:190px;margin:10px;"></th>
                <td style="text-align:center;width:10px;margin:10px;"></td>
               </tr>
                <!--DB202302464682【报价委托】报价委托改善224 fy end-->
                <tr>
 
                    <td>&nbsp;</td>
                </tr>
            </table>
             <!-- CHAN-BJQ4VZ 精琢技术 2019/12/10 End -->
                             <table border="0">
                    <tr>
                        <th style="width:50px;margin:10px;">&nbsp;</th>
                        <!-- 产品配套检索按钮 -->
                        <td style="width:150px;margin:10px;"><apex:commandButton id="SetProduct" onclick="saveOldElm();searchSetProduct();return false;" value="{!$Label.Set_Product}" rerender="dummy"/></td>
                        <!-- excel 导出按钮 -->
                        <td style="width:150px;margin:10px;"><apex:commandButton onclick="openQuoteExcelImport(event);return false;" value="{!$Label.Excel_Import}" rerender="dummy"/></td>
                        <td style="text-align:right;width:90px;margin:10px;padding-right:10px; "><apex:commandButton rerender="dummy" id="Btn_RowDelete" onclick="radioChecker2('del');return false;" value="{!$Label.deleteLabel}" style="width:60px;"/></td>
                        <td style="width:300px;margin:10px;">
                            <apex:commandButton rerender="dummy" id="Btn_RowUp" onclick="radioChecker2('up');return false;" value="{!$Label.Row_Up}" style="width:100px;"/>
                            <apex:commandButton rerender="dummy" id="Btn_RowDown" onclick="radioChecker2('down');return false;" value="{!$Label.Row_Down}" style="width:100px;"/>
                        </td>
                        
                        <!-- 20230104 lt DB202212427301 end-->
 
                        <!-- 2020/02/18  精琢技术  韩部长提出先隐藏 没必要  Start-->
                        <!-- <th style="text-align:right;width:70px;">总计</th>
                        <td style="text-align:right;width:80px;">
                            <apex:outputtext id="Estimation_List_Price" value="{0, number, ###,##0.00}"><apex:param value="{!total_ListPrice}"/></apex:outputtext>
                            <apex:inputHidden id="hidden_Estimation_List" value="{!total_ListPrice}"/>
                        </td> -->
                        <!-- 2020/02/18  精琢技术  韩部长提出先隐藏 没必要  end-->
                    </tr>
                </table>
            </div>
<!--             <table>
                <tr>
                    <td>&nbsp;</td>
                </tr>
            </table> -->
            <table style="height:30px;width:1100px;background:rgb(240 238 238);width:1100px;border-top: 1px solid #ccc;border-bottom: 1px solid #ccc;color:rgb(76 76 76);" border="0">
                <tr >
                    <th style="text-align:center;width:30px;color:rgb(76 76 76);">&nbsp;<input type="checkbox" id="checkAll" onclick="selectAll()" style="height:15px;width:15px;"/></th>
                    <th style="text-align:center;width:30px;color:rgb(76 76 76);">No</th>
                    <th style="text-align:center;width:150px;color:rgb(76 76 76);">{!$Label.Asset_No}</th>
                    <th style="text-align:center;width:100px;color:rgb(76 76 76);">{!$Label.SFDA_Status}</th>
                    <th style="text-align:center;width:300px;color:rgb(76 76 76);">{!$Label.Product_Name}</th>
                    <th style="text-align:center;width:100px;color:rgb(76 76 76);">{!$Label.Quantity}</th>
                    <!-- CHAN-BHNBX6 2019/11/20 START -->
                    <th style="text-align:center;width:70px;color:rgb(76 76 76);">保修年限</th>
                    <!-- CHAN-BHNBX6 2019/11/20 END -->
                    <th style="text-align:center;width:85px;padding-right: 7px;color:rgb(76 76 76);">ListPrice</th>
                    <th style="text-align:center;width:100px;padding-right: 15px;color:rgb(76 76 76);">小计</th>
                    <!-- CHAN-BHNBX6 2019/11/20 START -->
                    <th style="text-align:center;width:100px;padding-right: 20px;color:rgb(76 76 76);">NoDiscount小计</th>
                    <!-- CHAN-BHNBX6 2019/11/20 END -->
                </tr>
            </table>
            <div id="iframelike" style="width:1100px;">
                <input type="hidden" id="ListPriceTotal" value="0" />
                <input type="hidden" id="UnitPriceTotal" value="0" />
                <apex:pageblocktable value="{!activities}" var="s" id="lists" style="width:1050px;text-align:center;background-color: white;">
                    <apex:column style="width:30px;text-align:center;" >
                        <input type="checkbox" name="checklist" value="{!s.lineNo}" style="height:15px;width:15px;"/>
                    </apex:column>
                    <!-- No -->
                    <apex:column style="width:20px;text-align:center;" >
                        <apex:outputLabel id="indexNo" value="{!IF(s.PageObject.Product2__c==null,null,s.lineNo + 1)}" style="width:10px;"/>
                    </apex:column>
                    <!-- 产品编号-->
                    <apex:column style="text-align:center;width:150px;">
                        <apex:inputText id="Assert" style="width:120px;" value="{!s.Asset_Model}" onclick="searchProduct('{!s.lineNo}',this.value)" />
                        <!-- DB202212304166 【紧急-报价委托与购买意向】请将最后操作的报价委托状态放到购买意向中 fy start -->
                        <apex:inputHidden id="CanNotCancelledGurantee__c" value="{!s.CanNotCancelledGurantee}" />
                        <!-- DB202212304166 【紧急-报价委托与购买意向】请将最后操作的报价委托状态放到购买意向中 fy start -->
                    </apex:column>
                    <!-- NMPA状态 -->
                    <apex:column style="width:100px;text-align:center;">
                        <apex:outputField style="width:75px;" id="Status__c" value="{!s.PageObject.SFDA_Status__c}"/>
                        <apex:inputHidden id="SFDA" value="{!s.PageObject.SFDA_Status__c}"/>
                    </apex:column>
                    <!-- 产品名称 -->
                    <apex:column style="width:300px;text-align:center;">
                        <div id="Page:mainForm:block:lists:{!s.lineNo}:NameLink"><apex:outputLink style="width:300px;" value="{!baseUrl}/{!s.PageObject.Product2__c}" id="Nametext1" target="_blank">{!s.PageObject.Name__c}</apex:outputLink></div>
                        <apex:inputHidden id="Name__c" value="{!s.PageObject.Name__c}"/>
                    </apex:column>
                    <!-- 数量 -->
                    <apex:column style="text-align:center;width:100px;">
                        <apex:inputField id="Quantity" style="width:70px;text-align:right;" value="{!s.PageObject.Quantity__c}" onChange="calPrice('{!s.lineNo}')"/>
                    </apex:column>
                    <!--    2019/11/12 保修年限 CHAN-BHNBX6  start -->
                    <apex:column style="width:50px;text-align:center;" >
                        <apex:outputLabel id="itemGuaranteePeriod" value="{!s.PageObject.GuaranteePeriod__c}" style="width:50px;"/>
                    </apex:column>
                    <!--    2019/11/12 保修年限 CHAN-BHNBX6  end -->
                    <!-- ListPrice-->
                    <apex:column style="width:85px;text-align:center;">
                        <apex:outputPanel layout="none" rendered="{!$ObjectType.QuoteIraiLineItem__c.fields.ListPrice__c.accessible}" >
                            <apex:outputText style="width:85px;" id="ListPricetext" value="{0, number, ###,##0.00}">
                                <apex:param value="{!s.ListPrice_Page}" />
                            </apex:outputText>
                        </apex:outputPanel>
                        <apex:inputHidden id="ListPrice" value="{!s.ListPrice_Page}"/>
                        <apex:outputPanel layout="none" rendered="{!!$ObjectType.QuoteIraiLineItem__c.fields.ListPrice__c.accessible}" >
                            <span style="width:85px;text-align:right;" id="Page:mainForm:block:lists:{!s.lineNo}:ListPricetext">{!IF(s.PageObject.Product2__c == null, ' ', 0.00)}</span>
                            <script type="text/javascript">
                                j$(escapeVfId('Page:mainForm:block:lists:'+ {!s.lineNo} + ':ListPrice')).val(toNum(0));
                            </script>
                        </apex:outputPanel>
                    </apex:column>
                    <!-- 小计 -->
 
                    <apex:column style="width:100px;text-align:center;">
                        <apex:outputPanel layout="none" rendered="{!$ObjectType.QuoteIraiLineItem__c.fields.ListPrice__c.accessible}" >
                            <apex:outputText style="width:80px;" id="ListPriceTotalText" value="{0, number, ###,##0.00}">
                                <apex:param value="{!s.ListPriceTotal_Page}" />
                            </apex:outputText>
                        </apex:outputPanel>
                        <apex:inputHidden id="ListPriceTotal" value="{!s.ListPriceTotal_Page}"/>
                        <apex:outputPanel layout="none" rendered="{!!$ObjectType.QuoteIraiLineItem__c.fields.ListPrice__c.accessible}" >
                            <span style="width:80px;text-align:right;" id="Page:mainForm:block:lists:{!s.lineNo}:ListPriceTotalText">{!IF(s.PageObject.Product2__c == null, ' ', 0.00)}</span>
                            <script type="text/javascript">
                                j$(escapeVfId('Page:mainForm:block:lists:'+ {!s.lineNo} + ':ListPriceTotal')).val(toNum(0));
                            </script>
                        </apex:outputPanel>
                        <apex:inputHidden id="Product_Id" value="{!s.PageObject.Product2__c}"/>
                        <apex:inputHidden id="lineNo" value="{!s.lineNo}"/>
                    </apex:column>
                    <!-- CHAN-BHNBX6  NodisCount 小计  2019/11/20 START -->
                    <apex:column style="width:100px;text-align:center;">
                        <apex:outputPanel layout="none" rendered="{!$ObjectType.QuoteIraiLineItem__c.fields.ServicePrice__c.accessible}" >
                            <apex:outputText style="width:80px;text-align:center;" id="NoDiscountTotalText" value="{0, number, ###,##0.00}">
                                <apex:param value="{!s.NoDiscountTotal_Page}" />
                            </apex:outputText>
                        </apex:outputPanel>
                        <apex:inputHidden id="NoDiscountTotal" value="{!s.NoDiscountTotal_Page}"/>
                        <apex:inputHidden id="NoDiscount" value="{!s.NoDiscount_Page}"/>
                        <apex:outputPanel layout="none" rendered="{!!$ObjectType.QuoteIraiLineItem__c.fields.ServicePrice__c.accessible}" >
                            <span style="width:80px;text-align:right;" id="Page:mainForm:block:lists:{!s.lineNo}:NoDiscountTotalText">{!IF(s.PageObject.Product2__c == null, ' ', 0.00)}</span>
                            <script type="text/javascript">
                                j$(escapeVfId('Page:mainForm:block:lists:'+ {!s.lineNo} + ':NoDiscountTotal')).val(toNum(0));
                            </script>
                        </apex:outputPanel>
                        
                        
                    </apex:column>
                    <!-- DB202212304166 【紧急-报价委托与购买意向】请将最后操作的报价委托状态放到购买意向中 fy start -->
                    <!-- <apex:column style="width:100px;text-align:right;">
                        <apex:outputPanel layout="none" rendered="{!IF(quo.cancelMultiyearInsurance__c =='要' ||(quo.cancelMultiyearInsurance__c =='不要' && s.CanNotCancelledGurantee == 'true' ),true,false)}" >
                            <apex:outputText style="width:80px;" id="NoDiscountTotalText" value="{0, number, ###,##0.00}">
                                <apex:param value="{!s.NoDiscountTotal_Page}" />
                            </apex:outputText>
                        </apex:outputPanel>
                        <apex:inputHidden id="NoDiscountTotal" value="{!s.NoDiscountTotal_Page}"/>
                        <apex:inputHidden id="NoDiscount" value="{!s.NoDiscount_Page}"/>
                        <apex:outputPanel layout="none" rendered="{!IF(quo.cancelMultiyearInsurance__c =='不要'&& s.CanNotCancelledGurantee == 'false'  ,true,false)}" >
                            <span style="width:80px;text-align:right;" id="Page:mainForm:block:lists:{!s.lineNo}:NoDiscountTotalText">{!IF(s.PageObject.Product2__c == null, ' ', 0.00)}</span>
                            <script type="text/javascript">
                                j$(escapeVfId('Page:mainForm:block:lists:'+ {!s.lineNo} + ':NoDiscountTotal')).val(toNum(0));
                            </script>
                        </apex:outputPanel>
                    </apex:column> -->
                    <!-- DB202212304166 【紧急-报价委托与购买意向】请将最后操作的报价委托状态放到购买意向中 fy end -->
                    <!-- CHAN-BHNBX6  NodisCount 小计  2019/11/20 END -->
                </apex:pageBlockTable>
            </div>
 
            <BR></BR>
            <table border="0">
                <tr>
                    <td style="width:550px;" align="right">
                        <apex:inputField value="{!quo.Note__c}" style="width:550px;height:55px;"/>
                    </td>
                    <td>
                        <table border="0">
                            <tr>
                                <th style="width:15px">&nbsp;</th>
                                <!-- SWAG-CKDATG 【委托】【OBSAP-报价委托】报价委托项目改善1 fy start -->
                                <td style="width:10px;" align="right"><apex:commandButton id="QuoteIraiBtn" action="{!checkIraiUser}" reRender="IraiUserId,message1" onclick="blockme();" oncomplete="iraiJs();return false;" value="发送委托邮件" style="white-space:nowrap;" disabled="{!Save_button}"/></td>
                                <th style="width:15px">&nbsp;</th>
                                <!-- <td style="width: 10px;"></td> -->
                                <!-- SWAG-CKDATG 【委托】【OBSAP-报价委托】报价委托项目改善1 fy end -->
                                <td style="width:10px;" align="right"><apex:commandButton action="{!checkIraiUser}" reRender="IraiUserId,hiddenQuoid,message1" onclick="blockme();" oncomplete="save2btn();return false;" value="{!$Label.Save_Button}" style="width:100px;" disabled="{!Save_button}" /></td>
                                <th style="width:1000px">&nbsp;</th>
                                <!-- 20230109 lt DB202212427301 start  注释 -->
                                <!-- <td style="width:100px;" align="right"><apex:commandButton onclick="oppReflection2btn();return false;" rerender="hiddenQuoid" value="{!$Label.Opp_Button}" style="width:90px;" disabled="{!Save_button}"/></td>
                                <td style="width:100px;" align="right"><apex:commandButton action="{!Back}" rerender="hiddenQuoid" value="不保存(返回)" style="width:90px;"/></td>
                                <td style="width:100px;" align="right"><apex:commandButton value="产品试用评价OPD" style="width:95px;" onclick="openpdf('OPD');return false;" disabled="{!pdf_button}"/></td>
                                <td style="width:100px;" align="right"><apex:commandButton value="产品试用评价SIS" style="width:95px;" onclick="openpdf('SIS');return false;" disabled="{!pdf_button}"/></td> -->
                                <!-- 20230109 lt DB202212427301 end  注释 -->
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </apex:pageBlock>
    </apex:form>
    <script type="text/javascript">
        var QuoteEntryMaxLine = {!QuoteEntryMaxLine};
        var displayCost = '{!displayCost}';
        var quoid = '{!quoid}';
        var Session_ID = '{!$Api.Session_ID}';
        var Price_Valid_Period = '{!$Label.Price_Valid_Period}';
        var Message_001 = '{!$Label.Message_001}';
        var Message_Please_Save_Quote = '{!$Label.Please_Save_Quote}';
        var Message_Check_Your_Clipboard = '{!$Label.Check_Your_Clipboard}';
        var Error_Message3 = '{!$Label.Error_Message3}';
        var Error_Message11 = '{!$Label.Error_Message11}';
        var Error_Message29 = '{!$Label.Error_Message29}';
        var Error_Message33 = '{!$Label.Error_Message33}';
        var Error_Message34 = '{!$Label.Error_Message34}';
        var Error_Message35 = '{!$Label.Error_Message35}';
        var Error_Message36 = '{!$Label.Error_Message36}';
        var Error_Message40 = '{!$Label.Error_Message40}';
        var Confirm_ChangedAfterPrint = '打印后行信息有变化,是否继续操作(报价编码会变新)?';
        var Confirm_PriceRefresh = '报价作成后{!$Label.Price_Valid_Period}天,还没有更新过价格,需要执行{!$Label.Status_Update}?';
        var Confirm_saveBtn = '您选择了委托人员,确定只是保存吗(不进行委托)?';
        window.sfdcPage.appendToOnloadQueue(function() { calonLoad() });
        var openQuoteExcelImportWindow = null;
        
        function vpClear2_delay(){
            var vp = 'Page:mainForm:block:idVisitorPlace';
            var vpHidden = 'Page:mainForm:block:idVisitorPlaceHidden';
            setTimeout(
                function() {
                    if(j$(escapeVfId(vp)).attr("jquerysuggest_skip_flag") == "false") {
                        if (j$(escapeVfId(vp)).value() != j$(escapeVfId(vpHidden)).value()) {
                            vpClear2();
                        }
                    }
                },
                200
            );
        }
        
        function vpClear2(){
          resetValue('Page:mainForm:block:idVisitorPlace');
        }
        
        //訪問場所インスタント検索
        function setVisitorPlace(){
            try{
                var str = 'Page:mainForm:block:idVisitorPlace';
                var strPage = null;
                var options = {};
                
                var us = j$(escapeVfId('Page:mainForm:idDayEdit:idHiddenUserStateHospital')).value();
                
                strPage = '/apex/Xin_SearchVisitorPlace?r=' + encodeURI(us);
                options = {minchars:3, minwords:2, resultsClass:'visitorplace_results'};
                    
                jQuery(escapeVfId(str)).unbind();
                if (strPage != null) {
                    jQuery(escapeVfId(str)).suggest(strPage,options);
                }
            }catch(e){
                alert(e);
            }
        }
        
        function selectAll() {
            var checklist = j$("input[name='checklist']");
            var all = j$(escapeVfId("checkAll"));
            for(var i = 0; i < checklist.length; i++){
                if (all[0].checked == true) {
                    checklist[i].checked = true;
                } else {
                    checklist[i].checked = false;
                }
            }
        }
        
        function iraiJs() {
            console.log('====jinlaile-==');
            // var username = j$(escapeVfId("Page:mainForm:block:IraiUser")).val();
            // var userid = j$(escapeVfId("Page:mainForm:block:IraiUser_lkid")).val();
            var username1 = j$(escapeVfId("Page:mainForm:block:IraiUser")).val();
            var userid = j$(escapeVfId("Page:mainForm:block:IraiUser_lkid")).val();
            //var username2 = j$(escapeVfId("Page:mainForm:block:j_id46:IraiUser")).val();
            var username2 = j$(escapeVfId("Page:mainForm:block:IraiUser")).val();
            //obsap 新增经销商1字段 fy start
            var Agency1entrustc = j$(escapeVfId("Page:mainForm:block:SalesName1")).val();
            console.log('Agency1entrustc  =  ' + Agency1entrustc);
            // if(Agency1entrustc==null){
            //     Agency1entrustc = document.getElementById("Page:mainForm:block:SalesName1").value;
            // }
            //obsap 新增经销商1字段 fy end
            sforce.connection.sessionId = Session_ID;
            if(!userid&&username2){
                userid=username2;
            }
            // userid='0051000000CevhnAAB';
            console.log(username2+'====userid-=='+userid);
            var resultSet = sforce.connection.query( "SELECT Email,SFDCPosition_C__c FROM User WHERE Id = '" + userid + "'");
            var records = resultSet.getArray("records");
            console.log('====records -=='+records );
            var mail = null;
            var SFDCPosition;
            if (records != null && records.length > 0) {
                var iraiUser = records[0];
                mail = iraiUser.Email;
                SFDCPosition = iraiUser.SFDCPosition_C__c;
            }
            console.log('====Agency1entrustc -=='+Agency1entrustc );
            //obsap 新增经销商1字段 fy start
            if(Agency1entrustc != null&&Agency1entrustc !=""&&Agency1entrustc.length > 0){
                if (mail != null && mail.length > 0) {
                    // var Salesdepartment = '{!loginUser.Salesdepartment_text__c}';
                    //fy 20220512
                    var Salesdepartment = true;
                    console.log('Salesdepartment:' + Salesdepartment);
                    var positioncheck = true;
                    // if (Salesdepartment == '5.华东' || Salesdepartment == '6.华南') {
                    //fy 20220512
                    if (Salesdepartment) {
                        mail = '{!obsap_mail}';
                        positioncheck = false;
                    }
                    if (positioncheck && SFDCPosition != '营业助理'){
                        alert('请选择对应的营业助理.');
                        unblockUI();              
                    }
                    // 20230104 lt DB202212427301 start  注释
                    // else if (window.confirm('确定要委托该人员吗?\n' + mail)) {
                        // QuoteIrai();
                    // } 
                    // 20230104 lt DB202212427301 end
                    else {
                        QuoteIrai();   // 20230104 lt DB202212427301 end
                        // unblockUI(); // 20230104 lt DB202212427301 end
                    }
                } else {
                    alert('请选择委托人员.');
                    unblockUI();
                }
            }else {
                alert('请选择第一经销商.');
                unblockUI();
            }
            //obsap 新增经销商1字段 fy end
        }
                     
 
 
        //标准控件修改 start
 
        // //查询参数列表
        // let SelectFieldParamList=[
        //     //第一个输入框参数
        //     {
        //         //原输入框id
        //         inputFieldId:'Page:mainForm:block:SalesName1',
        //         //隐藏输入框id,用于修改后台值
        //         inputHiddenId:'Page:mainForm:block:SalesName1inputHidden',
        //         //新增lightning组件id
        //         lightningId:'lightningPage',
        //         //查询对象
        //         objType:'QuoteIrai__c',
        //         //查询字段
        //         field:'Agency1_entrust__c',
        //         //id
        //         recordId:'{!quo.Id}'
        //     },
        //     //第二个输入框参数
        //     {
        //         inputFieldId:'Page:mainForm:block:SalesName2',
        //         inputHiddenId:'Page:mainForm:block:SalesName2inputHidden',
        //         lightningId:'lightningPage2',
        //         objType:'QuoteIrai__c',
        //         field:'Agency2_entrust__c',
        //         recordId:'{!quo.Id}'
        //     },
        // ]
        // initLwc(SelectFieldParamList);
 
 
        //标准控件弹出页面修改 start
        //查询参数列表
        let SelectFieldParamList=[
            // 
            {
                //原apex:inputField的id值,需要在页面上获取
                inputFieldId : 'Page:mainForm:block:SalesName1',
                //查找字段所在对象
                ObjectType : 'QuoteIrai__c',
                //查找字段的api名称
                QueryFieldApiName : 'Agency1_entrust__c',
                //查找字段的查找对象
                SelectObj : 'Account',
                //搜索时使用的字段
                SelectFld : 'Name',
 
            },
            {
                //原apex:inputField的id值,需要在页面上获取
                inputFieldId : 'Page:mainForm:block:SalesName2',
                //查找字段所在对象
                ObjectType : 'QuoteIrai__c',
                //查找字段的api名称
                QueryFieldApiName : 'Agency2_entrust__c',
                //查找字段的查找对象
                SelectObj : 'Account',
                //搜索时使用的字段
                SelectFld : 'Name',
            },
        ]
        //初始化
        resetOpenPage(SelectFieldParamList);
        function unblockUI(){
            j$("#sbArea").fadeOut(500, function(){
                j$("#sbArea").remove();
            });
            resetOpenPage(SelectFieldParamList);
        }
        //标准控件弹出页面修改 end
 
        function getVal(){
            const inputFields = document.getElementById('lightningPage').querySelectorAll('input');
            console.log(inputFields);
        }
        function saveOldElm(){
            for (var i = SelectFieldParamList.length - 1; i >= 0; i--) {
                // SelectFieldParamList[i].oldParentElm=document.getElementById(SelectFieldParamList[i].inputFieldId).parentNode;
            }
        }
        // function initLwc(SelectFieldParamList){
        //     SelectFieldParamList.forEach(function(parm){
        //         $Lightning.use("c:LexSelectFieldApp", function() {
        //             $Lightning.createComponent(
        //                 "c:LexSelectFieldCmp",
        //                 {
        //                     "objApiName": parm.objType,
        //                     "fieldApiName": parm.field,
        //                     "recordId" : parm.recordId,
        //                 },
        //                 parm.lightningId,
        //                 function(cmp) {
        //                     console.log(cmp);
        //                     unblockUI();
        //                     setTimeout(()=>{
        //                         initLwcData(parm,0);
        //                     },1000);
        //                 }
        //             );
        //         });
        //     })
        // }
        // function initLwcData(parm,count){
        //     if(count>10)return;
        //     try{
        //         console.log(document.getElementById(parm.lightningId));
        //         console.log(document.getElementById(parm.lightningId).querySelectorAll('input'));
        //         if(!document.getElementById(parm.lightningId).querySelectorAll('input')){
        //             return;
        //         }
        //         let inp=document.getElementById(parm.lightningId).querySelectorAll('input')[0].id.replace('combobox-input-','');
        //         console.log('combobox-input-'+inp+'-0-' + inp);
        //         let comboxId='#combobox-input-'+inp+'-0-' + inp;
        //         let style = document.createElement('style');
        //         style.innerHTML=
        //             comboxId+'{'+
        //             'display:none'+
        //             '}';
        //         let ref=document.querySelector('style');
        //         ref.parentNode.insertBefore(style, ref);
        //         console.log(style);
 
        //         let objId=document.getElementById(parm.inputFieldId + '_lkid').value;
        //         if(objId==null||objId=='000000000000000AAA'||objId=='000000000000000'){
        //             return;
        //         }
 
        //         const inputFields = document.getElementById(parm.lightningId).querySelectorAll('input');
        //         let objName=document.getElementById(parm.inputFieldId + '_lkold').value;
        //         inputFields[0].click();
        //         setTimeout(()=>{
        //             lwcItem=document.getElementById(parm.lightningId);
        //             let liIrtem=lwcItem.querySelectorAll('lightning-base-combobox-item');
        //             console.log(liIrtem);
        //             let objId=document.getElementById(parm.inputFieldId + '_lkid').value;
        //             setNodeValue(liIrtem[1],objId).then(function (){
        //                 console.log(liIrtem[1].attributes.getNamedItem('data-value'));
        //                 liIrtem[1].click();
        //             })
        //         },1000);
        //         // inputFields[0].value = objName;
        //         // inputFields[1].value = objId;
        //         // let objId=document.getElementById(parm.inputFieldId + '_lkid').value;
        //         // if(objId==null||objId=='000000000000000AAA'||objId=='000000000000000'){
        //         //     return;
        //         // }
        //         // let lwcItem=document.getElementById(parm.lightningId);
        //         // let inputCmp=lwcItem.querySelectorAll('input');
        //         // console.log("initLwcData");
        //         // console.log(inputCmp);
        //         // console.log(objId);
        //         // if(inputCmp[0].name=='hiddenName'){
        //         //     setTimeout(()=>{
        //         //         initLwcData(parm);
        //         //     },1000);
        //         //     return;
        //         // }
        //         // inputCmp[0].click();
        //         // setTimeout(()=>{
        //         //     lwcItem=document.getElementById(parm.lightningId);
        //         //     let liIrtem=lwcItem.querySelectorAll('lightning-base-combobox-item');
        //         //     console.log(liIrtem);
        //         //     let objId=document.getElementById(parm.inputFieldId + '_lkid').value;
        //         //     setNodeValue(liIrtem[1],objId).then(function (){
        //         //         console.log(liIrtem[1].attributes.getNamedItem('data-value'));
        //         //         liIrtem[1].click();
        //         //     })
        //         // },1000);
        //     }catch(e){
        //         console.log("初始化失败:00");
        //         console.log(e);
        //         setTimeout(()=>{
        //             initLwcData(parm,count+1);
        //         },1000);
        //     }
        // }
        // function setNodeValue(node,setid){
        //     return new Promise(function(resolve, reject) {
        //         node.attributes.getNamedItem('data-value').value=setid;
        //         resolve();
        //     });
            
        // }
        // initLwc(SelectFieldParamList);
 
        
 
        // // let selectFieldFlag = 'Page:mainForm:SelectFieldFlag';
        // // //输入框id
        // // let inputFieldId='Page:mainForm:block:SalesName1';
        // // //存储值id,inputHidden,用于接收返回数值
        // // let inputHiddenId='Page:mainForm:Agency1_entrust__c';
        // // //输入框的值
        // // let accountValue = '{!quo.Agency1_entrust__c}';
        // // //查询对象api
        // // let ObjectType = 'Account';
        // // //查询结果字段名称
        // // let FieldNameList = '客户名,Id';
        // // //查询结果字段Api,与上列对应
        // // let FieldApiNameList = 'Name,Id';
        // // //查询查询条件名称
        // // let QueryFieldName = '姓名';
        // // //查询查询条件api
        // // let QueryFieldApiName = 'Name';
        // // //筛选器
        // // let QuertLimit='';
        // // let SelectObj='QuoteIrai__c';
        // // let SelectFld='Agency1_entrust__c';
        
 
 
        // function refreshSelectFieldValue(SelectFieldParamParam,p){
        //     let lwcItem=document.getElementById(SelectFieldParamParam.lightningId);
        //     console.log("temL:");
        //     let fla=false;
        //     console.log(lwcItem.children.length==0);
        //     if(lwcItem.children.length==0&&!lock1){
        //         lock1=true;
        //         fla=true;
        //         $Lightning.use("c:LexSelectFieldApp", function() {
        //             $Lightning.createComponent(
        //                 "c:LexSelectFieldCmp",
        //                 {
        //                     "objApiName": SelectFieldParamParam.objType,
        //                     "fieldApiName": SelectFieldParamParam.field,
        //                     "recordId" : SelectFieldParamParam.recordId,
        //                 },
        //                 SelectFieldParamParam.lightningId,
        //                 function(cmp) {
        //                     lock1=false;
        //                 }
        //             );
        //         });
        //     }
        //     if(fla){
        //         setTimeout(()=>{
        //             refreshSelectFieldValue(SelectFieldParamParam,true);
        //         },1000);                
        //     }
 
        //     try{
        //         let show=lwcItem.querySelectorAll('lightning-base-combobox-item');
        //         console.log('in!:');
        //         console.log(show);
        //         console.log(show[0]);
        //         console.log(show[0].dataset);
        //         console.log(show[0].dataset.value);
        //         console.log('out!:');
        //         if(show[0].dataset.value=="actionAdvancedSearch"){
        //             console.log("close!");
 
        //             show[0].onclick = function() {
        //                 // setSearchPage();
        //             };
        //             // show[0].hidden=true;
        //             // show[0].style.display='none';
 
        //         }
        //     }catch(e){
        //         console.log(e);
        //     }
        //     let lcm=document.getElementById(SelectFieldParamParam.lightningId);
        //     const inputFields = lcm.querySelectorAll('input');
        //     console.log("++++++++++++++++++++++++++++++++++");
        //     if (inputFields) {
        //         try{
        //             setTimeout(()=>{
        //                 let objName=inputFields[0].attributes.getNamedItem('data-value');
        //                 objName=objName.value;
        //                 let objId=inputFields[1].value;
        //                 if(objId=='000000000000000AAA'){
        //                     return;
        //                 }
        //                 j$(escapeVfId(SelectFieldParamParam.inputFieldId)).val(objName);
        //                 j$(escapeVfId(SelectFieldParamParam.inputFieldId + '_lkold')).val(objName);
        //                 j$(escapeVfId(SelectFieldParamParam.inputFieldId + '_lkid')).val(objId);
        //                 console.log('更新数值:');
        //                 console.log(objName);
        //                 console.log(objId);
        //             },100); 
        //         }catch(e){
        //             console.log(e);
        //         }
        //     } 
        // }
        // //标准控件修改 end
 
 
 
 
 
        function openpdf(type) {
            var qid = j$(escapeVfId("Page:mainForm:hiddenQuoid")).value();
            if (qid == '') {
                alert('请先做成报价委托。');
                return false;
            }
            if (window.confirm('是否新建'+type+'报告书?')) {
                try {
                    sforce.connection.sessionId = "{!GETSESSIONID()}";
                    var accid = j$(escapeVfId("Page:mainForm:block:idVisitorPlaceId")).value();
                    var recordType = type;
                    var repOwnerId = '{!$User.Id}';
                    
                    var pdfno = sforce.apex.execute("ControllerUtil", "selectCommonSequence", {valueField: 'EvaluationPDF_NextValue__c', formatField: 'EvaluationPDF_Format__c'});
                    
                    //新建OPD报告书
                    var rtn = sforce.apex.execute("Add_Report", "addReportOPWithEvaluationPDF", 
                        {repOwnerId: repOwnerId,
                         reportId: null,
                         dailyReportId: null,
                         eventId: null,
                         recordType: recordType,
                         aId: accid,
                         visitor1: null,
                         visitor2: null,
                         visitor3: null,
                         visitor4: null,
                         visitor5: null,
                         opp1: null,
                         opp2: null,
                         opp3: null,
                         opp4: null,
                         opp5: null,
                         reportDate: null,
                         evaluationPDFNumber: pdfno,
                         pro1: null
                        }
                    );
                    window.open('/apex/BeforeOPDPDF?qid=' + encodeURI(qid) + '&pdfNo=' + encodeURI(pdfno), 'BeforeOPDPDF');
                } catch(e) {
                    alert(e); 
                }
            } else {
                window.open('/apex/BeforeOPDPDF?qid=' + encodeURI(qid), 'BeforeOPDPDF');
            }
        }
        function blockme(){
            j$("body").prepend("<div id='sbArea'><div id='sbArea_contentsArea'><div id='sbArea_contentsArea_msg'>Please wait...</div></div><div id='sbArea_backArea'></div></div>");
            j$("#sbArea_contentsArea").css({"opacity":"0"}).fadeTo(500, 0.8);
            j$("#sbArea_backArea").css({"opacity":"0"}).fadeTo(500, 0.4);
            resizeShadowBox();
        }
        //ウィンドのサイズにあわせて位置を調整
        function resizeShadowBox(){
            var h = j$(document);
            var winH = j$(window).height();
            var winW = j$(window).width();
            console.log('调整位置============================');
            console.log(winH);
            console.log(winW);
 
            var screanWidth = window.screen.width;
            // if (screanWidth < winW) {
            //     winH = winH * winW / screanWidth;
            //     winW = winW * winW / screanWidth;
            // }
            var contents = j$("#sbArea_contentsArea")
            contents.css({"width":"auto","height":"auto"});
            var iSaBoxH = contents.outerHeight();
            var iSaBoxW = contents.outerWidth();
            
            if(winH >= iSaBoxH+10*2){
                var innerT = (winH-iSaBoxH)/2;
            }else{
                var innerT = 10;
                iSaBoxH = winH-10*2;
                iSaBoxW += 20;
            }
            if(winW >= iSaBoxW+10*2){
                var innerL = (winW-iSaBoxW)/2;
            }else{
                var innerL =10;
                iSaBoxW = winW-10*2;
            }
            var sbTop = h.scrollTop()
            
            var IE6browser = (navigator.userAgent.indexOf("MSIE 6")>=0) ? true : false;
            if(!IE6browser){
                j$("#sbArea").css({"width":winW+"px","height":winH+"px","position":"fixed"});
            }else{
                j$("#sbArea").css({"width":winW+"px","height":winH+"px","top":h.scrollTop()+"px","left":h.scrollLeft()+"px"});
            }
            j$("#sbArea_contentsArea").css({"left":innerL+"px","top":innerT+"px","height":iSaBoxH+"px","width":iSaBoxW+"px"});
            j$("#sbArea_backArea").css({"width":winW+"px","height":winH+"px"});
        }
        calonLoad();
    </script>
    <style type="text/css">
        div#iframelike {
            height: 300px;
            overflow: auto;
        }
        div#iframelikeheader {
            height: 23px;
            overflow: auto;
        }
        input {
            font-size: 10.5px;
        }
        body {
            font-size: 10.5px;
        }
        
        .visitorplace_results {
            border: 1px solid gray;
            background-color: white;
            padding: 0;
            margin: 0;
            list-style: none;
            position: absolute;
            z-index: 10000;
            display: none;
            overflow:auto;
            white-space:nowrap;
            width:400px;
            height:250px;
        }
        .visitorplace_results li {
            padding: 2px 5px 2px 0px;
            margin-left : 2px;
            color: #101010;
            text-align: left;
        }
/*        #auraErrorMessage{
            display: none
        }
        .slds-scope .slds-has-error .slds-form-element__help {
            display: none;
        }*/
    </style>
</apex:page>