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
<!-- <apex:page Controller="EquipmentSetShippmentReceived3Controller" showHeader="false" sidebar="false" id="allPage" action="{!init}" title="备品出库入库"> -->
    <apex:page Controller="EquipmentSetShippmentReceived3Controller" showHeader="false" sidebar="false" id="allPage" action="{!init}" lightningStylesheets="true" title="备品出库入库">
        <!-- 2023-04-23   zyh   lightning升级 -->
        <head>
            <meta name="format-detection" content="telephone=no"/>
        </head>
        <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/>
        <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
        <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
        <apex:includeScript value="{!URLFOR($Resource.instascan)}"/>
        <apex:stylesheet value="{!URLFOR($Resource.EquipmentSetShippmentReceivedcss)}"/>
        <apex:includeScript value="{!URLFOR($Resource.SelectFieldJs)}"/>
        <apex:stylesheet value="{!URLFOR($Resource.sldsMy)}"/><!-- 20230925 ljh lightning --> 
        <apex:stylesheet value="{!URLFOR($Resource.StyleUtilColorCss)}"/><!-- 20230619 ljh lightning  -->
        <script type="text/javascript">
        function savejs() {
            blockme();
            save();
        }
        function deleteDetailJs(ele) {
            blockme();
            deleteDetail(j$(ele).next().val());
        }
        var scanType;
        function filljsQR(qrcode) {
            if(!qrcode)return;
            blockme();
            if(scanType == 1){
                j$("input[name$='SlipNo']").val(qrcode);
                unblockUI();
            }
            else{
                var aId = j$(escapeVfId('allPage:allForm:applyId')).val();
                aId = aId + "," + qrcode;
                var resdid = '';
                j$("input[type=checkbox]:checked").each(function() {
                    resdid += j$(this).next().val()+",";
                });
                resdid = resdid.slice(0,-1);
                filljsQRAction(aId, resdid);
            }
            j$("#scanedqr").append("<li>"+qrcode+"</li>");
            j$("#scanedqr").animate({ scrollTop: j$("#scanedqr").prop("scrollHeight")}, 1000);
        }
        function addToDetail() {
            blockme();
            var resdid = '';
            var warning = false;
            j$("input[type=checkbox]:checked").each(function() {
                resdid += j$(this).next().val()+":";
                var applyid = j$(this).next().next().val();
                if (!warning) warning = j$("[data-ngnum='"+applyid+"']").val() > 0;
            });
            resdid = resdid.slice(0,-1);
            if (warning) {
                alert("申请单内存在不符合发货状态的配套,请跟进完成配套后续操作或分割申请单!")
                unblockUI();
                return;
            }
            ShippmentDetail(resdid);
            // resetDetailDivMargintop();
        }
        function checkAllDetail() {
            j$('input[type="checkbox"]').prop("checked",true);
        }
        function ShippmentAddJs() {
            // 20230620 ljh start
            // j$(escapeVfId('allPage:allForm:SlipNo')).prop("disabled", true);
            // j$(escapeVfId('allPage:allForm:DeliveryType')).prop("disabled", true);
            // j$(escapeVfId('allPage:allForm:DistributorMethod')).prop("disabled", true);
            // j$(escapeVfId('allPage:allForm:DeliveryCompany')).prop("disabled", true);
            j$(escapeVfId('allPage:allForm:newHeader:SlipNo')).prop("disabled", true);
            j$(escapeVfId('allPage:allForm:newHeader:DeliveryType')).prop("disabled", true);
            j$(escapeVfId('allPage:allForm:newHeader:DistributorMethod')).prop("disabled", true);
            j$(escapeVfId('allPage:allForm:newHeader:DeliveryCompany')).prop("disabled", true);
            // 20230620 ljh end
            ShippmentAdd();
            // resetDetailDivMargintop();
        }
        function checkMessage() {
            if (j$(escapeVfId('allPage:allForm:done_flg')).val() == 'true') {
                alert("保存完了");
            }
        }
        
        function fixDeliveryType() {
            // 20230620 ljh start
            // j$(escapeVfId('allPage:allForm:DeliveryType')).children().each(function() {
            j$(escapeVfId('allPage:allForm:newHeader:DeliveryType')).children().each(function() {
            // 20230620 ljh end
                if (this.value == '回寄') j$(this).remove();
            })
        }
        
        function resetDetailDivMargintop() {
            var handerHeight = document.getElementById('hander').clientHeight;
            document.getElementById('detailDiv').style.marginTop = handerHeight + 'px';
        }
        
        window.onload = function hiddenName(){
            if( document.getElementById('allPage:allForm:CDS_staff_mlktp')){
                document.getElementById('allPage:allForm:CDS_staff_mlktp').style.visibility="hidden" ;
                document.getElementById('allPage:allForm:CDS_staff_mlktp').style.width="200px" ;
            }
            resetDetailDivMargintop();
        }
 
        // 20231127 sx 贸易合规二期 add 弹窗提醒 start
        function showModal(){
            console.log('showModal====' + j$(escapeVfId('allPage:allForm:trade_fag')).val());
            //贸易合规二期 ax add
            if(j$(escapeVfId('allPage:allForm:trade_fag')).val() == 'true'){
                //打开弹窗
                j$('#cancelModal').show();
            }else{
                //如果合规直接走保存(原有逻辑)
                savejs();
            }
        }
 
        function cancelModalConfirm(){
            //贸易合规二期 弹窗确认 点击确认就调原来的保存方法 点取消就不进行保存逻辑
            savejs();
        }
        // 20231127 sx 贸易合规二期 add 弹窗提醒 end
        
        </script>
        <style type="text/css">
            .hideDropdown select{
                display: none
            }
            .menu div.m_title{
                /*width: 308px;*//*20230619 ljh*/
                text-align: left;
                margin: 0;
                /* background:#95aee5; */
                background:#dcdcdc;
                /*height: 42px;*/
                padding-left: 0.75rem;/*20230721 ljh  */
            }
            .menu div.m_titleg{
                /*width: 308px;*//*20230619 ljh*/
                text-align: left;
                margin: 0;
                background:#DCDCDC;
                /*height: 42px;*/
            }
            .dateFormat {
                display: none;
            }
            #Step_tab {
                list-style-type: none;
                padding: 0;
                /* 2023-04-23   zyh   lightning升级   start */
                /* height: 25px; */
                height: 30px;
                /* 2023-04-23   zyh   lightning升级   end */
                border-bottom: 5px solid #3b5998;
            }
            #Step_tab li {
                position: relative;
                /* 20230619 ljh*/
                /* width: 20%; */
                width: 50%;
                /* 20230619 ljh*/
                float: left;
                margin: 0;
                padding: 0;
                text-align: center;
                cursor: pointer;
                /*20230620 ljh*/
                height:30px;
                line-height: 30px;
                /*20230620 ljh*/
            }
            #Step_tab li span {
                margin: 0;
                padding: 15px 0 11px;
                color: #2daae1;
                font-size: 12px;
                font-weight: bold;
                line-height: 1;
            }
            #Step_tab li.selected {
                background: #3b5998;
            }
            #Step_tab li.selected span {
                color: #fff;
            }
            /*20230620 ljh*/
            /*div#main {
                width: 320px;
            }*/
            /*20230620 ljh*/
            div.rtop, div.rbottom {display:block; background: transparent; font-size:1px;}
            div.rtop div {background:#DCDCDC;}
            /* div.rtop div {background:#95aee5;} */
            div.rtopg div {background:#DCDCDC;}
            div.r1, div.r2, div.r3, div.r4 {display:block; overflow:hidden;}
            div.r1, div.r2, div.r3 {height:1px;}
            div.r2, div.r3, div.r4 {border-left:1px solid silver; border-right:1px solid silver;}
            div.r1 {margin: 0 5px; background:silver;} 
            div.r2 {margin: 0 3px; border-width:0 2px;} 
            div.r3 {margin: 0 2px;}  
            div.r4 {margin: 0 1px; height: 2px;}
            hr {
                border-top: 2px dotted #f00;
                color: #fff;
                background-color: #fff;
                height: 1px;
                /*20230620 ljh start*/
                /*width: 90%;*/
                width: 98%;
                /*20230620 ljh end*/
            }
            .close {
                color: #aaaaaa;
                float: right;
                font-size: 28px;
                font-weight: bold;
            }
            .close:hover,
            .close:focus {
                color: #000;
                text-decoration: none;
                cursor: pointer;
            }
            .menu blockquote{
                margin: 0;
                padding: 1px;
                list-style: none;
                border-top: 1px solid #ddd;
            }
            /*20230621 ljh start*/
            .lookupInput{
                display: inline-block;
                position: relative;
                width: 145px;
                padding: 0;
            }
            .lookupInput input[type="text"]{
                padding: 0;
            }
            /*20230621 ljh end*/
            /*20231101 ljh start*/
            table.mytable tr{
                height:35px !important;
            }
            /*20231101 ljh end*/
            /*     20240125 sx   start 贸易合规二期    */
            .modal-content-trade {
                background-color: #fefefe;
                margin-left: -150px;
                margin-top: 100px;
                padding: 20px;
                border: 1px solid #888;
                left: 50%;
                position: absolute;
                width: 310px;
            }
            /*     20240125 sx   end  贸易合规二期  */
        </style>
        <div id="myModal" class="modal">
        
          <!-- Modal content -->
          <div class="modal-content">
            <span class="close" onclick="stopScan()">&times;</span>
            <p>扫描中</p>
                <p>Code:<input type="text" id="qrcode"/></p>
            <video playsinline="true" id="preview" style="width: 100%;z-index: 11;transform: scaleX(-1);margin-top: 10px;"></video>
              扫码履历:
            <ul id="scanedqr" style="list-style-type: none; text-align: center;padding: 0;width: 100%; height: 100px; overflow: auto">
            </ul>
          </div>
        
        </div>
        <apex:form id="allForm">
            <!-- 20230721 ljh resetDetailDivMargintop() -->
            <apex:actionFunction name="save" action="{!save}" rerender="allForm" onComplete="unblockUI();fixDeliveryType();checkMessage();resetDetailDivMargintop();" />
            <apex:actionFunction name="filljsQRAction" action="{!filljsQRAction}" rerender="detail,message" oncomplete="unblockUI();resetDetailDivMargintop();">
                <apex:param name="firstParam" assignTo="{!ApplyId}" value="" />
                <apex:param name="secondParam" assignTo="{!CheckedId}" value="" />
            </apex:actionFunction>
            <apex:actionRegion >
                <apex:actionFunction name="deleteDetail" action="{!deleteDetail}" rerender="detail,message" oncomplete="unblockUI();resetDetailDivMargintop();">
                    <apex:param name="firstParam" assignTo="{!UnCheckedId}" value="" />
                </apex:actionFunction>
            </apex:actionRegion>
            <!-- <apex:actionFunction name="Shippment" action="{!Shippment}" /> -->
            <!-- 20230722 ljh -->
            <apex:actionFunction name="searchSlip" action="{!searchSlip}" reRender="allForm" onComplete="unblockUI();fixDeliveryType();resetDetailDivMargintop();" />
            <!-- 20230722 ljh -->
            <apex:actionFunction name="ShippmentDetail" action="{!ShippmentDetail}" reRender="allForm" onComplete="unblockUI();fixDeliveryType();resetDetailDivMargintop();" >
                <apex:param name="firstParam" assignTo="{!CheckedId}" value="" />
            </apex:actionFunction>
            <apex:actionFunction name="ShippmentAdd" action="{!ShippmentAdd}" >
                <apex:param name="firstParam" assignTo="{!UnCheckedId}" value="" />
            </apex:actionFunction>
            <apex:inputHidden value="{!done_flg}" id="done_flg"/>
            <!-- 20231127 sx 贸易合规二期 add start -->
            <apex:inputHidden value="{!trade_fag}" id="trade_fag"/>
            <apex:actionFunction name="tradeComplianceTWO" action="{!tradeComplianceTWO}" rerender="trade_fag,trade_String" oncomplete="unblockUI();showModal();"/>
            <!-- 20231127 sx 贸易合规二期 add end -->
            <div id="main">
                <!-- 20231127 sx add 贸易合规二期 弹窗提醒 start  -->
                <div id="cancelModal" class="modal">
                    <div class="modal-content-trade">
                        <table>
                            <tr>
                                <td>
                                    <apex:outputText styleClass="title" value="{!trade_String}" id="trade_String"/>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2" test-align="center" style="padding-left: 30px;">
                                    <apex:commandButton style="margin: 8px 20px;" value="确定" onclick="cancelModalConfirm(); return false;" oncomplete="j$('#cancelModal').hide();unblockUI();" />
                                    <apex:commandButton style="margin: 8px 20px;" value="取消" onclick="j$('#cancelModal').hide(); return false;"/>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
                <!-- 20231127 sx add 贸易合规二期 弹窗提醒 end  -->
                <div id="hander" class="freezehander">
                    <apex:outputPanel id="message">
                        <apex:pageMessages />
                    </apex:outputPanel>
                    <apex:pageBlock id="newHeader">
                        <table style="border-collapse: collapse; font-size:13px;">
                            <colgroup>
                                <col width="20%" />
                                <col width="80%" />
                            </colgroup>
                            <tr>
                                <!-- 状态切换btn -->
                                <th  style="font-size:20px;text-align: center;width:280px;height: 50px;" >
                                    <ul id="Step_tab" style="margin:0;">
                                        <apex:outputPanel layout="none" rendered="{!IF(Step_status='明细', true, false)}">
                                            <li onclick="javascript:ShippmentAddJs();return false"><span class="tabsize">追加</span></li>
                                            <li class="selected"><span>明细</span></li>
                                        </apex:outputPanel>
                                        <apex:outputPanel layout="none" rendered="{!IF(Step_status='追加', true, false)}">
                                            <li class="selected"><span>追加</span></li>
                                            <li onclick="javascript:ShippmentDetail();return false"><span class="tabsize">明细</span></li>
                                        </apex:outputPanel>
        
                                    </ul>
                                </th>
                                <th width="900px;" style="padding-left:50px;" class="myBtn">
                                    <apex:commandButton styleClass="commandbutton" onclick="qrsacn(0)" value="扫一扫申请书" rerender="dummy" rendered="{!IF(Step_status='追加', true, false)}"/>
                                    <apex:commandButton styleClass="commandbutton" onclick="checkAllDetail();return false" value="全选" rerender="dummy" rendered="{!IF(Step_status='追加', true, false)}"/>
                                    <apex:commandButton styleClass="commandbutton" onclick="addToDetail();return false" value="追加" rerender="dummy" rendered="{!IF(Step_status='追加', true, false)}"/>
                                    <apex:outputPanel layout="none" rendered="{!IF(Step_status='明细', true, false)}">
                                        <!-- 贸易合规二期 sx  修改,添加校验 -->
                                        <apex:commandButton styleClass="commandbutton" onclick="tradeComplianceTWO();" value="保存" rerender="dummy" disabled="{!saveBtnDisabled}"/>
                                        <apex:outputText id="saveBtnDisabled" value="{!saveBtnDisabled}" style="display: none;"/>
                                    </apex:outputPanel>
                                </th>
                            </tr>
                        </table>
                        <table style="border-collapse: collapse; font-size:13px;" width="80%" class="mytable">
                            <apex:outputPanel layout="none" rendered="{!IF(Step_status='明细', true, false)}" id="slipPanel">
                                <tr>
                                    <td colspan="2"><apex:outputPanel layout="none" rendered="{!IF(slip.Id=null, true, false)}"><span style="margin-left:30px;font-weight: bold;font-size: 15px;">新建</span></apex:outputPanel><apex:outputPanel layout="none" rendered="{!IF(slip.Id=null, false, true)}"><span style="margin-left:30px;font-weight: bold;">编辑:[{!slip.DeliveryCompany_SlipNo__c}]</span></apex:outputPanel></td>
                                </tr>
                                <tr>
                                    <td style="text-align: right;" class="deliveryslip">发货-运输单号 : </td>
                                    <td align="left">
                                        <!-- 2023-04-23   zyh   lightning升级 -->
                                        <apex:inputField value="{!slip.Name}" style="width:145px;padding: 0;float:left" id="SlipNo"/>
                                        <!-- <apex:inputField value="{!slip.Name}" style="width:120px;float:left" id="SlipNo"/> -->
                                        <apex:commandButton styleClass="commandbutton" onclick="blockme();searchSlip();return false;" style="float:left;" value="检索" rerender="dummy"/>
                                        <!-- <apex:commandButton styleClass="commandbutton" onclick="qrsacn(1)" value="扫运输单号" rerender="dummy"/> -->
                                        <apex:commandButton styleClass="commandbutton" onclick="qrsacn(1)" value="扫运输单号" rerender="dummy" style="margin-left:5px;"/>
                                        <!-- 2023-04-23   zyh   lightning升级 -->
                                    </td>
                                
                                    <td style="text-align: right" class="deliveryslip">发货-{!$ObjectType.FixtureDeliverySlip__c.fields.DeliveryType__c.label} : </td>
                                    <td align="left"><apex:inputField value="{!slip.DeliveryType__c}" style="width:145px;height: 30px;padding: 0;" id="DeliveryType"/></td>
                                </tr>
                                <tr>
                                    <td style="text-align: right" class="deliveryslip">发货-{!$ObjectType.FixtureDeliverySlip__c.fields.Distributor_method__c.label} : </td>
                                    <td align="left"><apex:inputField value="{!slip.Distributor_method__c}" style="width:145px;height: 30px;padding: 0;" id="DistributorMethod"/></td>
                                
                                    <td style="text-align: right" class="deliveryslip">发货-{!$ObjectType.FixtureDeliverySlip__c.fields.DeliveryCompany__c.label} : </td>
                                    <td align="left"><apex:inputField value="{!slip.DeliveryCompany__c}" style="width:145px;height: 30px;padding: 0;" id="DeliveryCompany"/></td>
                                </tr>
                                <tr>
                                    <td style="text-align: right" class="deliveryslip">发货-{!$ObjectType.FixtureDeliverySlip__c.fields.Wh_Staff__c.label}   </td>
                                    <td align="left">
                                        <!-- <apex:inputField  styleClass="hideDropdown" value="{!slip.Wh_Staff__c}" style="width:130px;height: 30px;" /> -->
                                        <apex:inputField styleClass="hideDropdown" style="width:230px;" id="StaffName"  value="{!slip.Wh_Staff__c}"   onChange="" />
                                    </td>
                               
                                    <td style="text-align: right" class="deliveryslip">发货-{!$ObjectType.FixtureDeliverySlip__c.fields.Combine_Pack__c.label}   </td>
                                    <td align="left"><apex:inputField styleClass="hideDropdown" value="{!slip.Combine_Pack__c}" style="width:145px;" /></td>
                                </tr>
                                <!-- <tr>
                                    <td colspan="2"><apex:inputField value="{!slip.Wh_Staff__c}" style="width:130px;" /></td>
                                </tr> -->
                            </apex:outputPanel>
                        </table>
                    </apex:pageBlock>
                    <!-- 20230620 ljh  -->
                </div>
                <apex:outputPanel id="detail">
                <div id="detailDiv" class="detail">
                    <apex:inputHidden value="{!ApplyId}" id="applyId"/>
                    <apex:outputPanel layout="none" rendered="{!IF(Step_status='追加', true, false)}">
                        <apex:variable var="indexloop" value="{!0}" />
                        <apex:variable var="applychange" value="{!0}" />
                        <apex:variable var="SetName" value="" />
                        <apex:variable var="SetName2" value="" />
                        <apex:repeat value="{!esdList}" var="esdInfo" id="esdList2">
                            <apex:outputPanel layout="none" rendered="{!NOT(esdInfo.hasSended)}">
                            <apex:variable var="indexloop" value="{!indexloop+1}"/>
                            <apex:variable var="SetName" value="{!IF(SetName='', esdInfo.rec.Rental_Apply_Equipment_Set__r.Rental_Apply__r.Name, SetName)}" />
                            <apex:variable var="SetName2" value="{!IF(SetName2='', esdInfo.rec.Rental_Apply_Equipment_Set__r.Id, SetName2)}" />
                            <apex:outputPanel layout="none" rendered="{!IF(SetName2=esdInfo.rec.Rental_Apply_Equipment_Set__r.Id && indexloop != 1, true, false)}">
                                <!-- <br/> -->
                                <!-- 20230623 ljh -->
                            </apex:outputPanel>
                            
                            <apex:outputPanel layout="none" rendered="{!IF(SetName=esdInfo.rec.Rental_Apply_Equipment_Set__r.Rental_Apply__r.Name, false, true)}">
                                <hr/>
                                <!-- 20230620 ljh start -->
                                <!-- <h2 style="padding: 5px;" class="detailtab">{!esdInfo.rec.Rental_Apply_Equipment_Set__r.Rental_Apply__r.Name}</h2> -->
                                <span style="padding: 5px 0.75rem;font-weight: bold;" class="detailtab">{!esdInfo.rec.Rental_Apply_Equipment_Set__r.Rental_Apply__r.Name}</span>
                                <br/>
                                <!-- 20230620 ljh end -->
                                <apex:variable var="SetName" value="{!esdInfo.rec.Rental_Apply_Equipment_Set__r.Rental_Apply__r.Name}" />
                                <apex:variable var="applychange" value="{!1}" />
                                <input type="hidden" value="{!esdInfo.rec.Rental_Apply__r.Pre_inspection_ng_num__c}" data-ngnum="{!esdInfo.rec.Rental_Apply__c}"/>
                            </apex:outputPanel>
        
                            <apex:outputPanel layout="none" rendered="{!IF(SetName2=esdInfo.rec.Rental_Apply_Equipment_Set__r.Id, false, true)}">
                                <apex:outputPanel layout="none" rendered="{!IF(applychange=1, false, true)}">
                                <hr/>
                                </apex:outputPanel>
                                <apex:variable var="applychange" value="{!0}" />
                                <apex:outputPanel layout="none" rendered="{!IF(esdInfo.rec.Rental_Apply_Equipment_Set__r.Inspection_not_finish__c > 0, false, true)}">
                                <!-- 20230721 ljh -->
                                <apex:inputCheckbox value="{!esdInfo.isChecked}"  style="margin:0 0 0 0.75rem;"/>
                                <input type="hidden" value="{!esdInfo.rec.Rental_Apply_Equipment_Set__c}"/><input type="hidden" value="{!esdInfo.rec.Rental_Apply__c}"/>
                                    </apex:outputPanel>
                                <!-- 2023-04-26   zyh   lightning升级   start -->
                                <!-- <h2 style="padding: 5px;" class="detailtab">{!esdInfo.rec.Rental_Apply_Equipment_Set__r.Name}:{!esdInfo.rec.Rental_Apply_Equipment_Set__r.Fixture_Set__r.Name}</h2> -->
                                <span style="padding: 5px;font-weight: bold;" class="detailtab">{!esdInfo.rec.Rental_Apply_Equipment_Set__r.Name}:{!esdInfo.rec.Rental_Apply_Equipment_Set__r.Fixture_Set__r.Name}</span>
                                <!-- 2023-04-26   zyh   lightning升级   end -->
                                <apex:variable var="SetName2" value="{!esdInfo.rec.Rental_Apply_Equipment_Set__r.Id}" />
                            </apex:outputPanel>
        
                            <apex:outputPanel layout="none" rendered="{!IF(indexloop == 1, true, false)}">
                                <!-- 2023-04-26   zyh   lightning升级   start -->
                                <!-- <h2 style="padding: 5px;" class="detailtab">{!esdInfo.rec.Rental_Apply_Equipment_Set__r.Rental_Apply__r.Name}</h2>
                                <br/> -->
                                <div style="padding: 5px 0.75rem;font-weight: bold;" class="detailtab">{!esdInfo.rec.Rental_Apply_Equipment_Set__r.Rental_Apply__r.Name}</div>
                                <!-- 2023-04-26   zyh   lightning升级   end -->
                                <input type="hidden" value="{!esdInfo.rec.Rental_Apply__r.Pre_inspection_ng_num__c}" data-ngnum="{!esdInfo.rec.Rental_Apply__c}"/>
                                <apex:outputPanel layout="none" rendered="{!IF(esdInfo.rec.Rental_Apply_Equipment_Set__r.Inspection_not_finish__c > 0, false, true)}">
                                <!-- 20230721 ljh -->
                                <apex:inputCheckbox value="{!esdInfo.isChecked}"  style="margin:0 0 0 0.75rem;"/>
                                <input type="hidden" value="{!esdInfo.rec.Rental_Apply_Equipment_Set__c}"/><input type="hidden" value="{!esdInfo.rec.Rental_Apply__c}"/>
                                </apex:outputPanel>
                                <!-- 2023-04-26   zyh   lightning升级   start -->
                                <span style="padding: 5px; font-weight: bold;" class="detailtab">{!esdInfo.rec.Rental_Apply_Equipment_Set__r.Name}:{!esdInfo.rec.Rental_Apply_Equipment_Set__r.Fixture_Set__r.Name}</span>
                                <!-- <h3 style="padding: 5px;" class="detailtab">{!esdInfo.rec.Rental_Apply_Equipment_Set__r.Name}:{!esdInfo.rec.Rental_Apply_Equipment_Set__r.Fixture_Set__r.Name}</h3> -->
                                <!-- 2023-04-26   zyh   lightning升级   end -->
                            </apex:outputPanel>
                            <div class="rtop">
                                <div class="r1"></div>
                                <div class="r2"></div>
                                <div class="r3"></div>
                                <div class="r4"></div>
                            </div>
                            <div class="menu">
                            <h2><div class="m_title">&nbsp;<apex:outputField value="{!esdInfo.rec.Fixture_Name_F__c}" />&nbsp;&nbsp;
                                <!-- 2023-08-01 zyh 机身编码换位置 start -->
                                <span>(<apex:outputField value="{!esdInfo.rec.SerialNumber_F__c}" style="margin:3px;width:75px;"/>)</span>
                                <!-- 2023-08-01 zyh 机身编码换位置 end -->
                            </div></h2>
                            <!-- TODO 回库はSet単位で、明細一つ一つのquickCheck要らないが、SetのquickCheck要る? -->
                            <!-- 20230721 ljh -->
                            <ul style="padding: 1px 0.75rem;" >
                                <li>
                                    <!-- 20210721 ljh 1719 start -->
                                    <!-- <span>{!$ObjectType.Rental_Apply_Equipment_Set_Detail__c.fields.Inspection_result__c.label}: </span> -->
                                    <span>发货前-检测结果: </span> 
                                    <!-- 20210721 ljh 1719 end -->
                                    <span><apex:outputField value="{!esdInfo.rec.Inspection_result__c}" style="margin:3px;width:150px" /></span>
                                </li>
                                <li><span>{!$ObjectType.Rental_Apply_Equipment_Set_Detail__c.fields.Inspection_result_NG__c.label}: </span>
                                    <span><apex:outputField value="{!esdInfo.rec.Inspection_result_NG__c}" style="margin:3px;width:150px" /></span>
                                </li>
                                <li><span>上次回收后检测时间: </span>
                                    <span><apex:outputField rendered="{!IF(esdInfo.rec.Asset__r.Pre_Reserve_RAES_Detail__c==null, false, true)}" value="{!esdInfo.rec.Asset__r.Pre_Reserve_RAES_Detail__r.After_Inspection_time__c}" style="margin:3px;width:75px;"/></span>
                                </li>
                                <!-- 2023-08-01 zyh 机身编码换位置 start -->
                                <!-- <li>
                                    <span>{!$ObjectType.Rental_Apply_Equipment_Set_Detail__c.fields.SerialNumber_F__c.label}: </span>
                                    <span><apex:outputField value="{!esdInfo.rec.SerialNumber_F__c}" style="margin:3px;width:75px;"/></span>
                                </li> -->
                                <!-- 2023-08-01 zyh 机身编码换位置 end -->
                            </ul>
                            </div>
                            <div class="rbottom">
                                <div class="r4"></div>
                                <div class="r3"></div>
                                <div class="r2"></div>
                                <div class="r1"></div>
                            </div>
                            </apex:outputPanel>
                        </apex:repeat>
                    </apex:outputPanel>
                    <apex:outputPanel layout="none" rendered="{!IF(Step_status='明细', true, false)}">
                        <apex:variable var="indexloop" value="{!0}" />
                        <apex:variable var="SetName" value="" />
                        <apex:repeat value="{!esdList}" var="esdInfo" id="esdList">
                        <apex:outputPanel layout="none" rendered="{!esdInfo.isChecked || esdInfo.hasSended}">
                            <apex:variable var="indexloop" value="{!indexloop+1}"/>
                            <apex:variable var="SetName" value="{!IF(SetName='', esdInfo.rec.Rental_Apply_Equipment_Set__r.Id, SetName)}" />
                            <apex:outputPanel layout="none" rendered="{!IF(SetName=esdInfo.rec.Rental_Apply_Equipment_Set__r.Id && indexloop != 1, true, false)}">
                                <!-- <br/> -->
                                <!-- 20230623 ljh -->
                            </apex:outputPanel>
                            <apex:outputPanel layout="none" rendered="{!IF(SetName=esdInfo.rec.Rental_Apply_Equipment_Set__r.Id, false, true)}">
                                <hr/>
                                <!-- 20230721 ljh -->
                                <h3 style="padding: 5px 0.75rem;" class="detailtab">{!esdInfo.rec.Rental_Apply_Equipment_Set__r.Name}:{!esdInfo.rec.Rental_Apply_Equipment_Set__r.Fixture_Set__r.Name}</h3><apex:outputPanel layout="none" rendered="{!NOT(esdInfo.hasSended)}"><apex:commandButton styleClass="commandbutton" onclick="deleteDetailJs(this)" style="float:right;margin-top: -2px;" value="删除" rerender="dummy"/></apex:outputPanel><input type="hidden" value="{!esdInfo.rec.Rental_Apply_Equipment_Set__c}"/>
                                <apex:variable var="SetName" value="{!esdInfo.rec.Rental_Apply_Equipment_Set__r.Id}" />
                            </apex:outputPanel>
        
                            <apex:outputPanel layout="none" rendered="{!IF(indexloop == 1, true, false)}">
                                <!-- 20230721 ljh -->
                                <h3 style="padding: 5px 0.75rem;" class="detailtab">{!esdInfo.rec.Rental_Apply_Equipment_Set__r.Name}:{!esdInfo.rec.Rental_Apply_Equipment_Set__r.Fixture_Set__r.Name}</h3><apex:outputPanel layout="none" rendered="{!NOT(esdInfo.hasSended)}"><apex:commandButton styleClass="commandbutton" onclick="deleteDetailJs(this)" style="float:right;margin-top: -2px;" value="删除" rerender="dummy"/></apex:outputPanel><input type="hidden" value="{!esdInfo.rec.Rental_Apply_Equipment_Set__c}"/>
                            </apex:outputPanel>
                            <apex:outputPanel layout="none" rendered="{!esdInfo.hasSended}">
                            <div class="rtopg">
                                <div class="r1"></div>
                                <div class="r2"></div>
                                <div class="r3"></div>
                                <div class="r4"></div>
                            </div>
                            </apex:outputPanel>
                            <apex:outputPanel layout="none" rendered="{!NOT(esdInfo.hasSended)}">
                            <div class="rtop">
                                <div class="r1"></div>
                                <div class="r2"></div>
                                <div class="r3"></div>
                                <div class="r4"></div>
                            </div>
                            </apex:outputPanel>
                            <div class="menu">
                            <apex:outputPanel layout="none" rendered="{!esdInfo.hasSended}">
                            <h2><div class="m_titleg">&nbsp;<apex:outputField value="{!esdInfo.rec.Fixture_Name_F__c}" />&nbsp;&nbsp;已发送</div>
                            </h2>
                            </apex:outputPanel>
                            <apex:outputPanel layout="none" rendered="{!NOT(esdInfo.hasSended)}">
                            <h2><div class="m_title">&nbsp;<apex:outputField value="{!esdInfo.rec.Fixture_Name_F__c}" />&nbsp;&nbsp;
                                <!-- 2023-08-01 zyh 机身编码换位置 -->
                                <span>(<apex:outputField value="{!esdInfo.rec.SerialNumber_F__c}" style="margin:3px;width:75px;"/>)</span>
                                <!-- 2023-08-01 zyh 机身编码换位置 -->
                                
                            </div>
                            </h2>
                            </apex:outputPanel>
                            <!-- TODO 回库はSet単位で、明細一つ一つのquickCheck要らないが、SetのquickCheck要る? -->
                            <!-- 20230721 ljh -->
                            <ul style="padding: 1px 0.75rem;">
                                <li>
                                    <!-- 20230626 ljh  start-->
                                    <!-- <span>{!$ObjectType.Rental_Apply_Equipment_Set_Detail__c.fields.Inspection_result__c.label}: </span> -->
                                    <span>发货前-检测结果: </span> 
                                    <!-- 20230626 ljh  end-->
                                    <span><apex:outputField value="{!esdInfo.rec.Inspection_result__c}" style="margin:3px;width:150px" /></span>
                                </li>
                                <li><span>{!$ObjectType.Rental_Apply_Equipment_Set_Detail__c.fields.Inspection_result_NG__c.label}: </span>
                                    <span><apex:outputField value="{!esdInfo.rec.Inspection_result_NG__c}" style="margin:3px;width:150px" /></span>
                                </li>
                                <li><span>上次回收后检测时间: </span>
                                    <span><apex:outputField rendered="{!IF(esdInfo.rec.Asset__r.Pre_Reserve_RAES_Detail__c==null, false, true)}" value="{!esdInfo.rec.Asset__r.Pre_Reserve_RAES_Detail__r.After_Inspection_time__c}" style="margin:3px;width:75px;"/></span>
                                </li>
                                <!-- 2023-08-01 zyh 机身编码换位置 start -->
                                <!-- <li>
                                    <span>{!$ObjectType.Rental_Apply_Equipment_Set_Detail__c.fields.SerialNumber_F__c.label}: </span>
                                    <span><apex:outputField value="{!esdInfo.rec.SerialNumber_F__c}" style="margin:3px;width:75px;"/></span>
                                </li> -->
                                <!-- 2023-08-01 zyh 机身编码换位置 end -->
                            </ul>
                            </div>
                            <div class="rbottom">
                                <div class="r4"></div>
                                <div class="r3"></div>
                                <div class="r2"></div>
                                <div class="r1"></div>
                            </div>
                        </apex:outputPanel>
                        <apex:inputCheckbox value="{!esdInfo.isChecked}" style="display: none"/>
                        </apex:repeat>
                    </apex:outputPanel>
                </div>
                </apex:outputPanel>
            </div>
            <script type="text/javascript">
                var standalone = window.navigator.standalone,
                    userAgent = window.navigator.userAgent.toLowerCase(),
                    safari = /safari/.test( userAgent ),
                    ios = /iphone|ipod|ipad/.test( userAgent ),
                    // 20230619 ljh
                    // ver = (navigator.userAgent).match(/OS (\d)?\d_\d(_\d)?/i)[0].split('_')[0].replace("OS ","");
                    ver = '';
                    if (ios) {
                        ver = (navigator.userAgent).match(/OS (\d)?\d_\d(_\d)?/i)[0].split('_')[0].replace("OS ","");
                    }
                    // 20230619 ljh
                let scanner = new Instascan.Scanner({ video: document.getElementById('preview'), scanPeriod: 5 ,mirror: false});
                scanner.addListener('scan', function (content) {
                  filljsQR(content);
                });
                
                function qrsacn(stype) {
                    scanType = stype;
                    if (!standalone && !safari && ios) {
                        window.location.href="sfqr://scan";
                    } else {
                        j$(".modal").show();
                        Instascan.Camera.getCameras().then(function (cameras) {
                          if (cameras.length > 0) {
                            if (ver >= 13) {
                                scanner.start(cameras[1]);
                            } else {
                                // scanner.start(cameras[0]);
                                // 20231105 zq 设置摄像头 start
                                if(cameras.length > 1){
                                    scanner.start(cameras[1]);
                                }else{
                                    scanner.start(cameras[0]);
                                }
                                // 20231105 zq 设置摄像头 end
                            }
                          } else {
                            console.error('No cameras found.');
                          }
                        }).catch(function (e) {
                          console.error(e);
                        });
                    }
                }
        
                function stopScan() {
                    scanner.stop().then(function () {
                        j$(".modal").hide();
                    });
                    j$("#scanedqr").children().remove();
                }
                j$(document).ready(function(){
                    j$( '#qrcode' ).unbind();
                    j$( '#qrcode' ).keypress( function ( e ) {
                        if ( e.which == 13 ) {
                            filljsQR(j$( '#qrcode' ).val());
                            return false;
                        }
                    });
                });
                 //标准控件弹出页面修改 start
                //查询参数列表
                let SelectFieldParamList=[
                    // 
                    {
                        //原apex:inputField的id值,需要在页面上获取
                        inputFieldId : 'allPage:allForm:newHeader:StaffName',
                        //查找字段所在对象
                        ObjectType : 'FixtureDeliverySlip__c',
                        //查找字段的api名称
                        QueryFieldApiName : 'Wh_Staff__c',
                        //查找字段的查找对象
                        SelectObj : 'User',
                        //搜索时使用的字段
                        SelectFld : 'Name',
 
                    },
                ]
                //初始化
                resetOpenPage(SelectFieldParamList);
            </script>
            <style type="text/css">
                .hideDropdown select{
                    display: none
                }
            </style>
        </apex:form>
        </apex:page>