Li Jun
2022-04-13 5c01ebbfddb6b8674430b47c22977bea2e350084
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
<apex:page applyHtmlTag="false" Controller="FixtureRentalPDFController" showHeader="false" sidebar="false" id="allPage" action="{!init}">
    <!-- renderAs="pdf" -->
    <html>
 
    <head>
        <style type="text/css" media="print">
            @page {
                size: A4;
                margin: 1mm 2.5mm 0mm 2.5mm;
            }
 
            /*td{
                    height: 23px;
                }*/
        </style>
        <style>
            body {
                margin: 0 auto;
                width: 780px;
            }
 
            .title1 {
                height: 35px;
            }
 
            .title2 {
                height: 110px;
            }
        </style>
        <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" />
        <script src="../../soap/ajax/53.0/connection.js" type="text/javascript"></script>
        <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}" />
        <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}" />
        <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}" />
        <apex:includeScript value="{!URLFOR($Resource.jspdf)}" />
        <apex:includeScript value="{!URLFOR($Resource.html2canvas)}" />
 
    </head>
 
 
    <body style="font-family: Arial Unicode MS; page-break-inside: auto;font-size: 14px">
        <div id="pdf-wrapper">
            <apex:outputPanel id="showhidden" rendered="true">
                
                <div class="pdf-page">
                    <div class="title1"></div>
                    <!-- 20201119 LJH OCSM_BP5-61 update start 现地管理和现地管理的主单不显示-->
                    <!-- <apex:outputText style="float:left;font-size:22px;margin-top: 25px;" value="{!centreAddress}" /> -->
                    <apex:outputText style="float:left;font-size:22px;margin-top: 25px;" value="{!IF(IsShowLU,centreAddress,'')}" />
                    <!-- 20201119 LJH OCSM_BP5-61 update end 现地管理和现地管理的主单不显示-->
                    <img style="float: right; width: 55px; height: 55px;padding: 0px;margin-top: 12px;" src="{!qrcode}" />
                    <table border="1" width="100%" style="border-collapse: collapse;margin-top: 18mm;">
                        <colgroup>
                            <col width="50%" />
                            <col width="50%" />
                        </colgroup>
                        <tr>
                            <th style="text-align:center;" colspan="2" height="38">奥林巴斯备品签收单
                                <!-- <img style="float: right; width: 35px; height: 35px;padding: 0px;margin-top: -7px;" src="{!qrcode}" /> -->
                            </th>
                        </tr>
                        <tr>
                            <td style="text-align:left;border-right-style: none;">★填写完整后请自发货日起10天内上传SFDC</td>
                            <td style="text-align:right;border-left-style: none;">备品管理中心申请单号:
                                <apex:outputText value="{!ApplyHeadShow.Name}" />
                            </td>
                        </tr>
                        <!-- <tr style="background-color:#003399;color:white">
                                <th style="text-align:center;" height="40">发货信息</th>
                            </tr> -->
                        <!-- <tr>
                                <td style="text-align:left;font-size:12px">
                    1、本发货确认单共两页。首页中到货确认部分为现场必填项目,填写完整后请回传至备品中心(传真或扫描件即可);<br />
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;末页中清洗消毒灭菌确认栏为现场必填项目,备品回寄时请将此页随备品一同寄回备品中心。<br />
                    2、请对产品进行清洗消毒或灭菌后再使用。<br />
                    3、在使用备品前,敬请仔细阅读背面“备品使用须知”,请明确申请人及申请方责任与义务。
                                </td>
                            </tr> -->
                    </table>
                    <table border="1px" width="100%" style="border-collapse: collapse;">
                        <colgroup>
                            <col width="16%" />
                            <col width="14%" />
                            <col width="36%" />
                            <col width="16%" />
                            <col width="18%" />
                        </colgroup>
                        <tr>
                            <th style="text-align:center;" colspan="5" height="25">发货信息</th>
                        </tr>
                        <tr>
                            <td style="text-align:left;">使用目的</td>
                            <td style="text-align:left;font-size: 13px" colspan="4">
                                <apex:outputText value="{!ApplyHeadShow.Demo_purpose1__c}" />
                            </td>
                        </tr>
                        <tr>
                            <td style="text-align:left;" rowspan="2">申请人信息</td>
                            <td style="text-align:left;">所属本部名</td>
                            <td style="text-align:left;font-size: 13px">
                                <apex:outputText value="{!ApplyHeadShow.Salesdept__c}" />
                            </td>
                            <td style="text-align:left;">所属办事处名</td>
                            <td style="text-align:left;font-size: 13px">
                                <apex:outputText value="{!ApplyHeadShow.WorkPlace__c}" />
                            </td>
                        </tr>
                        <tr>
                            <td style="text-align:left;">姓名 </td>
                            <td style="text-align:left;font-size: 13px">
                                <apex:outputText value="{!ApplyHeadShow.Person_In_Charge__r.name}" />
                            </td>
                            <td style="text-align:left;" colspan="1">联系电话</td>
                            <td style="text-align:left;font-size: 13px">
                                <apex:outputText value="{!ApplyHeadShow.ApplyPerson_Phone__c}" />
                            </td>
                        </tr>
                        <tr>
                            <td style="text-align:left;">医疗机构信息</td>
                            <td style="text-align:left;">医疗机构名</td>
                            <td style="text-align:left;font-size: 13px">
                                <apex:outputText value="{!HospitalName}" />
                            </td>
                            <td style="text-align:left;">科室名</td>
                            <td style="text-align:left;font-size: 13px">
                                <apex:outputText value="{!ApplyHeadShow.Account__r.Department_Name__c}" />
                            </td>
                        </tr>
                        <tr>
                            <td style="text-align:left;" rowspan="3">发货地址</td>
                            <td colspan="2" rowspan="3" style="text-align:left;font-size: 13px">
                                <apex:outputText styleClass="Shippmentadress" value="{!Shippmentadress}" />
                            </td>
                            <td style="text-align:left;" colspan="1">邮编</td>
                            <td style="text-align:left;">
                                <apex:outputText value="{!IF(ApplyHeadShow.Shipment_address__r.Post_Code__c==null,ApplyHeadShow.Post_Code__c,ApplyHeadShow.Shipment_address__r.Post_Code__c)}"
                                />
                            </td>
                        </tr>
                        <tr>
                            <td style="text-align:left;" colspan="1">接收人姓名</td>
                            <td style="text-align:left;font-size: 13px">
                                <apex:outputText value="{!ApplyHeadShow.Loaner_received_staff__c}" />
                            </td>
                        </tr>
                        <tr>
                            <td style="text-align:left;" colspan="1">接收人电话</td>
                            <td style="text-align:left;font-size: 13px">
                                <apex:outputText value="{!ApplyHeadShow.Loaner_received_staff_phone__c}" />
                            </td>
                        </tr>
                    </table>
                    <table border="1" width="100%" style="border-collapse: collapse;">
                        <tr>
                            <th style="text-align:center;" colspan="4" height="25">医院借用期限</th>
                        </tr>
                        <tr>
                            <td style="text-align:left;"> {!IF(BorrowTimeString='null','',BorrowTimeString)}&nbsp;&nbsp;&nbsp;</td>
                        </tr>
                    </table>
                    <table border="1" width="100%" style="border-collapse: collapse;">
                        <colgroup>
 
                            <col width="19%" />
                            <col width="29%" />
                            <col width="29%" />
                            <col width="23%" />
                        </colgroup>
                        <tr>
                            <th style="text-align:center;" colspan="4" height="40"> 奥林巴斯备品借用申请・安装人填写栏
                                <small>(必填)</small>
                                <br/>到货确认部分为奥林巴斯员工必填项目</th>
                        </tr>
                        <tr>
                            <td style="text-align:left;">签收者姓名</td>
                            <td style="text-align:left;"></td>
                            <td style="text-align:left;">备品安装者姓名</td>
                            <td style="text-align:left;"></td>
                        </tr>
                        <tr>
                            <td style="text-align:left;">签收日期</td>
                            <td style="text-align:left;"></td>
                            <td style="text-align:left;">安装及安装说明日期</td>
                            <td style="text-align:left;"> </td>
                        </tr>
                    </table>
                    <table border="1" width="100%" style="border-collapse: collapse;">
                        <colgroup>
 
                            <col width="19%" />
                            <col width="29%" />
                            <col width="29%" />
                            <col width="23%" />
                        </colgroup>
                        <tr>
                            <th style="text-align:center;" colspan="4" height="40"> 医疗机构签收填写栏
                                <small>(必填)</small>
                                <br/>敬请使用备品前仔细阅读下方“奥林巴斯备品借用须知”,以明确使用方的责任与义务</th>
 
                        </tr>
                        <!--根据OLY_OCM-260记载,先注释掉(OLY_OCM-251取消注释) -->
                        <tr>
                            <th style="text-align:center;" height="25" colspan="4">《奥林巴斯备品发货清单》所列备品悉数收到, 共计主机{!mainCnt}件,附属品{!accessoryCnt}件;并已接受产品使用说明和了解借用须知。
                            </th>
                        </tr>
                        <tr>
                            <td style="text-align:left;">签收者姓名</td>
                            <td style="text-align:left;"></td>
                            <td style="text-align:left;" rowspan="2">接收单位(科室)章 </td>
                            <td style="text-align:left;" rowspan="2"> </td>
                        </tr>
                        <tr>
                            <td style="text-align:left;">签收日期</td>
                            <td style="text-align:left;"></td>
 
                        </tr>
                    </table>
                    <table border="1" width="100%" style="border-collapse: collapse;">
                        <colgroup>
                            <col width="100%" />
                        </colgroup>
                        <tr>
                            <th style="text-align:center;" height="25">※奥林巴斯备品借用须知</th>
                        </tr>
                        <tr>
                            <td style="text-align:left;font-size: 12px">
                                1,备品:本须知所指的备品,是指本签收单附件《奥林巴斯备品发货清单》所列的由奥林巴斯(北京)销售服务有限公司(以下简称奥林
                                <br/>巴斯)在规定期限内免费提供给借用单位为实施医疗行为或培训等所使用的设备包括产品及相关附属品,附件是本须知有效组成部分,与本
                                <br/>须知具有同等法律效力。
                                <br/> 2,备品所有权:备品所有权归属于奥林巴斯公司。未经奥林巴斯公司书面同意,借用单位不得以任何理由向任何第三方转借、转让附件所
                                <br/>列备品,或将附件所列备品作为担保抵押给任何第三方。
                                <br/> 3,备品使用权:借用期限内,借用单位对出借的备品享有独立合理的使用权利。若在使用过程中存在不确定情况时,借用单位应及时通知
                                <br/>奥林巴斯公司,奥林巴斯公司将到场给予指导和协助,借用单位不应擅自处理。
                                <br/> 4,备品之日常使用与维护:借用单位在使用备品过程中应按照奥林巴斯公司的要求(“产品使用说明书”)内容尽审慎义务正确操作使用、
                                <br/>爱护使用。备品使用前后都应进行必要的清洗消毒(灭菌)及日常检测工作,以确保备品的正常运作。
                                <br/> 5,备品损坏、遗失之赔偿责任:附件所列备品若因正常损耗而产生的维修或维护费用,由奥林巴斯公司承担;若因借用单位使用不当或超
                                <br/>期借用等原因造成的备品损坏,借用单位应承担相关维修费用。当备品借用中发生故障需要维修时,应联系奥林巴斯进行检测和维修,不得
                                <br/>擅自将相关备品交由任何第三方维修。若因借用单位原因造成备品遗失时,则借用单位应负赔偿责任。
                                <br/> 6,医疗责任事故:备品是符合国家质量标准并经检验合格的医疗器械产品,借用单位应独立依靠其医疗专业水平和能力利用备品进行医疗
                                <br/>活动或培训。借用单位使用备品时所发生的任何问题均由借用单位自行负责、处理。
                                <br/> 7,备品返还:借用单位应按照本单注明的使用期限履行按时返还备品的承诺。返回前,借用单位应对备品进行清洗消毒或灭菌,以保证所
                                <br/>有备品接触者的健康安全,同时借用单位有义务为奥林巴斯公司回收备品提供必要协助。
                                <br/> 8,借用单位知悉且同意,此次备品出借基于正当合理的理由,而非通过出借备品对借用单位购买、推荐奥林巴斯公司产品、服务等产生任
                                <br/>何不正当影响。
                                <br/> 9,借用单位应严格按本单所载使用目的使用备品,禁止将备品用于本单所载使用目的以外的其他用途。
                                <br/> 10,若借用单位选择以加盖实际接收备品的借用单位内部部门章或签收者签名方式确认以上内容,实际接收备品的借用单位内部部门或签
                                <br/>收者确认其具备相应资格代表借用单位进行签收和确认。
                                <br/> 11,其它:其它未尽事宜,双方应本着友好合作的原则进行协商解决。
                            </td>
                            <!-- 20211008 ljh SFDC-C7L4ED 增加8,9,10-->
                        </tr>
                        <tr>
                            <td style="text-align:left;font-size:12px;border-collapse: collapse;" colspan="2" height="80">
                                奥林巴斯 北京备品中心地址:北京市朝阳区酒仙桥路10号恒通商务园B12C座西门1F
                                <br /> 邮编:100015 TEL:010-59756006-1871 FAX: 010-59756534
                                <br /> 奥林巴斯 广州备品中心地址:广州市番禺区东环街番禺大道北537号番山创业中心3号楼1F
                                <br /> 邮编:511400 TEL:020-39198888-8876 FAX:020-39198848
                                <br /> 奥林巴斯 上海备品中心地址:上海市浦东新区金吉路778号3号楼1F
                                <br /> 邮编:201206 TEL:021-60391318-8877 FAX:021-60391316
                                <br />
                            </td>
                            <!-- 20210812 SFDC-C5CC5S 修改地址-->
                        </tr>
                    </table>
                    <apex:outputPanel layout="none">
                        <div style="page-break-after: always;"></div>
                    </apex:outputPanel>
                </div>
                <apex:variable value="{!1}" var="pNcnt" />
                <apex:variable value="{!1}" var="pcnt" />
                <apex:repeat value="{!records}" var="record">
                    <div class="pdf-page">
                        <div class="title1">&nbsp;</div>
                        <!-- 20201119 LJH OCSM_BP5-61 update start 主单是显示办事处和备品中心分来显示且内容不同 -->
                        <!-- <apex:outputText style="float:left;font-size:22px;margin-top: 15px;" value="{!centreAddress}"/> -->
                        <!-- height: 15mm; -->
                        <table border="0" width="100%" style="border-collapse: collapse;margin: 0;">
                            <apex:outputPanel layout="none" rendered="{!IF(!IsShowLU , true, false)}">
                                <tr>
                                    <td style="font-size:22px;">
                                        <apex:outputText value="{!IF(record.isAgencyOrCenter,record.AgencyAddressName,centreAddress)}" />
                                    </td>
                                    <td rowspan="2">
                                        <img style="float: right; width: 55px; height: 55px;padding: 0px;margin-top: 0mm;" src="{!qrcode}"
                                        />
                                    </td>
                                </tr>
                                <tr>
                                    <td style="font-size:15px;">
                                        <c:PDFWbr targetStr="{!IF(record.AgencyOrCenterAddress=='BeiJingCenter','北京市朝阳区酒仙桥路10号恒通商务园B12C座西门1F 电话:010-59756006-1871',IF(record.AgencyOrCenterAddress=='ShangHaiCenter','上海市浦东新区唐镇创业路183号2幢1F 电话:021-60391318-8877',IF(record.AgencyOrCenterAddress=='GuangZhouCenter','广州市番禺区东环街番禺大道北537号番山创业中心3号楼1F 电话:020-39198888-8876',record.AgencyOrCenterAddress)))}"
                                        />
                                    </td>
                                </tr>
                            </apex:outputPanel>
                            <apex:outputPanel layout="none" rendered="{!IF(IsShowLU , true, false)}">
                                <tr>
                                    <td style="font-size:22px;height: 55px;line-height: 55px;">
                                        <apex:outputText value="{!centreAddress}" />
                                    </td>
                                    <td>
                                        <img style="float: right; width: 55px; height: 55px;padding: 0px;margin-top: 0mm;" src="{!qrcode}"
                                        />
                                    </td>
                                </tr>
                            </apex:outputPanel>
                        </table>
                        <!-- 20201119 LJH OCSM_BP5-61 update end 主单是显示办事处和备品中心分来显示且内容不同 -->
                        <!-- margin-top: 15mm; -->
                        <table border="1" width="100%" style="border-collapse: collapse;">
                            <tr>
                                <th style="box-sizing: border-box;text-align:center;font-size:24px;font-weight:900;" height="40">奥林巴斯备品发货清单
                                    <!-- <img style="float: right; width: 35px; height: 35px;padding: 0px;" src="{!qrcode}" /> -->
                                    <!-- <td align="right" valign="top"><apex:outputField value="{!ApplyHeadShow.QRImg__c}" /></td>  -->
                                </th>
                            </tr>
                            <tr>
                                <td style="box-sizing: border-box;text-align:right;font-size:13px;">备品管理中心申请单号:
                                    <apex:outputText value="{!ApplyHeadShow.Name}" />
                                </td>
                                <!-- {!RentalApplyName} 20201119 LJH OCSM_BP5-61  update-->
                            </tr>
                            <tr style="background-color:white;">
                                <td style="box-sizing: border-box;text-align:right;font-size:13px;">本单附件第( {!pNcnt})页/共( {!pageCnt})页</td>
                            </tr>
                            <tr>
                                <th style="box-sizing: border-box;text-align:center;font-size:16px;">
                                    ※提示
                                </th>
                            </tr>
                            <tr>
                                <td style="box-sizing: border-box;text-align:left;font-size:12.3px;">本《奥林巴斯备品发货清单》一式两份,由奥林巴斯备品借用申请人(备品安装人)和医疗机构借用方各执一份,作为出借和归还时双方进
                                    <br/>行清点确认凭证
                                </td>
                            </tr>
                        </table>
 
                        <table border="1" width="100%" style="border-collapse: collapse;">
                            <colgroup>
                                <col width="4%" />
                                <col width="8%" />
                                <col width="20%" />
                                <col width="11%" />
                                <col width="29%" />
                                <col width="9%" />
                                <col width="9%" />
                                <col width="7%" />
                            </colgroup>
                            <tr>
                                <td style="box-sizing: border-box;text-align:center;font-size:13px;height: 16px;" colspan="2">申请人</td>
                                <td style="box-sizing: border-box;text-align:left;font-size: 13px">
                                    <apex:outputText value="{!ApplyHeadShow.Person_In_Charge__r.name}" />
                                </td>
                                <td style="box-sizing: border-box;text-align:center;font-size:13px;border-left: solid 1px;" rowspan="2">医疗机构</td>
                                <!-- 20220124 ljh SFDC-C4U3PH update colspan="4"  -->
                                <td style="box-sizing: border-box;text-align:left;font-size: 13px;" colspan="5" rowspan="2">
                                    <apex:outputText value="{!HospitalName}" />
                                </td>
                            </tr>
                            <tr>
                                <td style="box-sizing: border-box;text-align:center;font-size:13px;" colspan="2">使用目的</td>
                                <td style="box-sizing: border-box;text-align:left;font-size: 13px;border-right: solid 1px">
                                    <apex:outputText value="{!ApplyHeadShow.Demo_purpose1__c}" />
                                </td>
                            </tr>
                            <tr>
                                <td style="box-sizing: border-box;text-align:center;font-size:13px;height: 16px;" colspan="2">收件者姓名</td>
                                <td style="box-sizing: border-box;text-align:left;font-size: 13px">
                                    <apex:outputText value="{!ApplyHeadShow.Loaner_received_staff__c}" />
                                </td>
                                <td style="box-sizing: border-box;text-align:center;font-size:13px;border-left: solid 1px;" rowspan="2">发货地址</td>
                                <!-- 20220124 ljh SFDC-C4U3PH update colspan="4"  -->
                                <td style="box-sizing: border-box;text-align:left;font-size: 13px;" colspan="5" rowspan="2">
                                    <apex:outputText styleClass="address" value="{!if(isblank(ApplyHeadShow.Shippment_adress_detail__c), ApplyHeadShow.direct_shippment_address__c, ApplyHeadShow.Shippment_adress_detail__c)}"
                                    />
                                </td>
                            </tr>
                            <tr>
                                <td style="box-sizing: border-box;text-align:center;font-size:13px;" colspan="2">收件者电话</td>
                                <td style="box-sizing: border-box;text-align:left;font-size: 13px;border-right: solid 1px">
                                    <apex:outputText value="{!ApplyHeadShow.Loaner_received_staff_phone__c}" />
                                </td>
                            </tr>
                            <tr>
                                <!-- 20220124 ljh SFDC-C4U3PH update colspan="8" -->
                                <th style="text-align:center;font-size:13px;height: 7pt;" colspan="9">借用备品发货清单</th>
                            </tr>
                            <tr>
                                <td rowspan="2" style="box-sizing: border-box;text-align:center;font-size: 11px;">序号</td>
                                <td rowspan="2" style="box-sizing: border-box;text-align:center;font-size: 11px;">管理编号</td>
                                <!-- 20220124 ljh SFDC-C4U3PH update colspan="6" -->
                                <td colspan="7" style="box-sizing: border-box;text-align:center;font-size: 11px;">明细</td>
                            </tr>
                            <tr>
                                <!-- <td style="text-align:center;">序号</td>
                            <td style="text-align:center;">备品set型号</td>
                            <td style="text-align:center;">管理编号</td>
                            <td style="text-align:center;">产品型号</td>
                            <td style="text-align:center;">机身号</td>
                            <td style="text-align:center;">附属品明细</td> -->
                                <td style="box-sizing: border-box;text-align:center;font-size: 11px;">明细型号</td>
                                <td style="box-sizing: border-box;text-align:center;font-size: 11px;" colspan="2">中文名称</td>
                                <td style="box-sizing: border-box;text-align:center;font-size: 11px;">机身号</td>
                                <td style="text-align:center;font-size: 11px;">固定资产号</td>
                                <td style="box-sizing: border-box;text-align:center;font-size: 11px;">货位号</td>
                                <!-- 20220124 ljh SFDC-C4U3PH add start -->
                                <td style="box-sizing: border-box;text-align:center;font-size: 11px;min-width:30px">备注</td>
                                <!-- 20220124 ljh SFDC-C4U3PH add end -->
                                <!-- <td style="text-align:center;">二维码</td> -->
                            </tr>
                            <apex:repeat value="{!record.lineList}" var="line">
                                <tr>
                                    <td style="box-sizing: border-box;text-align:center;font-size: 10px;height:30px;padding: 0px;">
                                        <c:PDFWbr targetStr="{!line.index}" />
                                    </td>
                                    <td style="box-sizing: border-box;text-align:left;font-size: 10px;padding: 0px;">
                                        <c:PDFWbr targetStr="{!line.dManagementnumber}" />
                                    </td>
                                    <td style="box-sizing: border-box;text-align:left;font-size: 10px;padding: 0px;">
                                        <c:PDFWbr targetStr="{!line.dModelNo}" />
                                    </td>
                                    <td style="box-sizing: border-box;text-align:left;font-size: 10px;padding: 0px;" colspan="2">
                                        <c:PDFWbr targetStr="{!line.dChinaName}" />
                                    </td>
                                    <td style="box-sizing: border-box;text-align:left;font-size: 10px;padding: 0px;">
                                        <c:PDFWbr targetStr="{!line.dSerialNumber}" />
                                    </td>
                                    <td style="box-sizing: border-box;text-align:left;font-size: 10px;padding: 0px;">
                                        <c:PDFWbr targetStr="{!line.dLoaner_asset_no}" />
                                    </td>
                                    <td style="box-sizing: border-box;text-align:left;font-size: 10px;padding: 0px;">
                                        <c:PDFWbr targetStr="{!line.wh_location}" />
                                    </td>
                                    <!-- 20220124 ljh SFDC-C4U3PH add start -->
                                    <td style="box-sizing: border-box;text-align:left;font-size: 10px;padding: 0px;">
                                        <c:PDFWbr targetStr="" />
                                    </td>
                                    <!-- {!line.Received_ng_detail} -->
                                    <!-- 20220124 ljh SFDC-C4U3PH add end -->
                                    <!-- <td style="text-align:center;font-size: 10px"><c:PDFWbr targetStr="{!line.dQRCode}" /></td> -->
 
                                    <!-- <td style="text-align:left;font-size: 13px"><apex:outputText value="{!IF(pcnt < AllSum +1,pcnt,'')}" /></td> -->
                                    <!-- <td style="text-align:left;font-size: 13px"><apex:outputText value="{!line.index}" /></td>
                                <td style="text-align:left;font-size: 13px"><apex:outputText value="{!line.setName}" /></td>
                                <td style="text-align:left;font-size: 13px"><apex:outputText value="{!line.name1}" /></td>
                                <td style="text-align:left;font-size: 13px"><apex:outputText value="{!line.LoanerCode}" /></td>
                                <td style="text-align:left;font-size: 13px"><apex:outputText value="{!line.serialNumber1}" /></td>
                                <td style="text-align:left;font-size: 13px"><apex:outputText value="{!line.AssetModelNo}" /></td> -->
                                </tr>
                                <apex:variable value="{!pcnt + 1}" var="pcnt" />
                            </apex:repeat>
                        </table>
                        <!-- 20211209 ljh SFDC-C923SR 条形码 -->
                        <img style="float:left;position:absolute;z-index: 99;" src="{!barcode}" />
                        <div style="height:30px"></div>
                        <!-- 20211209 ljh SFDC-C923SR 条形码 -->
                        <div style="{position:absolute;width:100%;height:20px">&nbsp;</div>
                        <apex:outputPanel rendered="{!pNcnt < pageCnt}" layout="none">
                            <!--  <div style="{position:absolute;width:100%;height:30px">&nbsp;</div> 
                        <div style="{position:absolute;width:100%;height:30px">&nbsp;</div>-->
                            <div style="page-break-after: always;" />
                        </apex:outputPanel>
                        <apex:variable value="{!pNcnt+1}" var="pNcnt" />
                    </div>
                </apex:repeat>
 
            </apex:outputPanel>
        </div>
    </body>
    <script>
        console.log('----start----')
        console.log('----{!ApplyHeadShow.AWS_Data_Id__c}----')
        AWSService.sfSessionId = '{!GETSESSIONID()}';
        //sforce.connection.sessionId = '{!GETSESSIONID()}';
        var staticResources = JSON.parse('{!staticResource}');
        //blockme();
        document.body.onload = function () {
            console.log('document.body.onload')
            if ({!addFlag
        } || !'{!ApplyHeadShow.Shippment_adress_detail__c}') {
            AWSService.query(staticResources.queryUrl, '{!ApplyHeadShow.AWS_Data_Id__c}', function (data) {
                console.log('data----------')
                console.log(data);
                //unblockUI();
                if ({!addFlag
            }) {
                jQuery(".Shippmentadress").html(data.object.directShippmentAddress);
            }
            //document.getElementById("Caller_phone__c").innerHTML = data.object.callerPhone;
            if (!'{!ApplyHeadShow.Shippment_adress_detail__c}') {
                jQuery(".address").html(data.object.directShippmentAddress);
                //document.getElementById("allPage:address").innerHTML = data.object.directShippmentAddress;
            }
            jsPdfDownload();
        }, staticResources.token);
                }else {
            jsPdfDownload();
        }
                
                
            }
        function jsPdfDownload() {
 
            let jtargets = jQuery("#pdf-wrapper .pdf-page");
            let j_arr = new Array(jtargets.length + 1).join(0).split('').map(function () { return false });
            let landscape = false;
            let pw = 595.28;
            let ph = 841.89;
            const marginw = 40;
 
            let orientation = '';
            if (landscape) {
                pw += ph; ph = pw - ph; pw = pw - ph;
                orientation = 'l';
            }
            var pdf = new jsPDF(orientation, 'pt', 'a4');// 第一个参数填字母l,注意不是数字1,为横向pdf
            jtargets.each(function (i, e) {
                e.style.background = "#FFFFFF";
            })
 
            let rei = 0;
            let recursion = null;
            recursion = function (i) {
                if (i >= jtargets.length) {
                    Fun(pdf);
                    return;
                }
                e = jtargets[i];
                html2canvas(e, {
                    scale: 2,
                    onrendered: function (canvas) {
 
                        let canvas_max_page_num = 1;
                        let canvas_current_page_num = 0;
                        var contentWidth = canvas.width;
                        var contentHeight = canvas.height;
 
                        //一页pdf显示html页面生成的canvas高度;
                        var pageHeight = contentWidth / pw * ph;
                        //未生成pdf的html页面高度
                        var leftHeight = contentHeight;
                        //页面偏移
                        var position = 0;
                        //a4纸的尺寸[595.28,841.89],html页面生成的canvas在pdf中图片的宽高
                        var imgWidth = pw - 2 * marginw;//595.28//左右边距20
                        var imgHeight = imgWidth / contentWidth * contentHeight;//左右边距20
 
                        var pageData = canvas.toDataURL('image/jpeg', 1.0);
 
 
                        if (i) {
                            pdf.addPage();
                        }
                        //有两个高度需要区分,一个是html页面的实际高度,和生成pdf的页面高度(841.89)
                        //当内容未超过pdf一页显示的范围,无需分页
                        if (leftHeight < pageHeight) {
                            pdf.addImage(pageData, 'JPEG', marginw, 0, imgWidth, imgHeight);//左右边距20
                        } else {
                            while (leftHeight > 0) {
 
                                
                                canvas_current_page_num++;
                                pdf.addImage(pageData, 'JPEG', marginw, position, imgWidth, imgHeight)//左右边距20
                                leftHeight -= pageHeight;
                                position -= ph;
 
                                if (canvas_max_page_num > 0 && canvas_current_page_num >= canvas_max_page_num) {
                                    break;
                                }
 
                                //避免添加空白页
                                if (leftHeight > 0) {
                                    pdf.addPage();
                                }
                            }
                        }
 
                        recursion(i + 1);
                    }
                })
            };
            recursion(rei);
 
 
 
        }
        var staticResourceFile = JSON.parse('{!staticResourceFile}');
        function Fun(pdf) {
 
            var form = jQuery("<form method='post'></form>");
            jQuery(document.body).append(form);
            let href = window.location.href
            let arr = href.split('/')
            form.attr({ "action": staticResourceFile.viewUnifiedContactUrl + "?from=" + encodeURIComponent(href) + "&fileName=" + encodeURIComponent(arr[arr.length - 1].split('?')[0]) });
            // form.attr({"action":"http://127.0.0.1:8080/a/d?from="+encodeURIComponent(window.location.href)});
            let input = jQuery("<input type='hidden'/>");
            input.attr({ "name": "base64Str" });
            input.val(pdf.output('datauristring').substr(28));
            form.append(input);
            form.submit();
 
            // jQuery("body > *").each(function(){
            //     jQuery(this).css('display','none');
            // })
            // jQuery("body").append('<embed style="position:absolute; left: 0; top: 0;" width="100%" height="100%" src="'+pdf.output('datauristring')+'" type="application/pdf"/>')
 
        }
    </script>
 
    </html>
</apex:page>