DESKTOP-0K9VGFE\hp
2022-03-11 6d766b0c8e9b31e7e03ffd344a94c2851aa9beb9
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
<apex:page controller="TransferAgencyReceivedController" showHeader="false" sidebar="false" id="allPage" action="{!init}" title="办事处到货确认/CDS/回库">
    <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:includeScript value="{!URLFOR($Resource.CommonUtilJs)}"/>
<style type="text/css">
    .hideDropdown select{
        display: none
    }
    .modal {
       display:none;
       position: fixed; /* Stay in place */
       z-index: 10; /* Sit on top */
       left: 0;
       top: 0;
       width: 100%; /* Full width */
       height: 100%; /* Full height */
       overflow: auto; /* Enable scroll if needed */
       background-color: rgb(0,0,0); /* Fallback color */
       background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
    }
 
    /* Modal Content/Box */
    .modal-content {
       background-color: #fefefe;
       margin-left: -100px;
       margin-top: 100px;
       padding: 20px;
       border: 1px solid #888;
       left: 50%;
       position: absolute;
       width: 200px;
    }
    table.list td{
        width:100px;
        border-width: 1px;
    }
    table.list td.col_chk {
        width:30px;
    }
    body .pbBody table.list tr.headerRow td, body .pbBody table.list tr.headerRow th {
        border-width: 1px;
    }
</style>
<script type="text/javascript">
function checkMessage() {
    if (j$(escapeVfId('allPage:allForm:done_flg')).val() == 'true') {
        alert("保存成功");
    }
}
var scanType = 0;
function filljsQR(qrcode) {
    if(!qrcode) return;
    blockme();
    if(scanType == 1){
        j$("input[name$='SlipNo']").val(qrcode);
    }
    else{
        var qrtag = j$("input[name=qrcode][value='"+qrcode+"']");
        var qrtag1 = j$("input[name=qrcode][value='ArrivalResult" + qrcode+"']");
        // var checke = j$("input[name=qrcode][value="+qrcode+"]").parent().parent().children("td.col_Arrival_in_wh__c").children("input[type=checkbox]");
        // var checke1 = j$("input[name=qrcode][value="+qrcode+"]").parent().parent().children("td.col_Arrival_in_wh__c").children("input[type=hidden]");
        var b3 = j$("input[name=qrcode][value='"+qrcode+"']").parent().parent().children("td.onetoone").find("span")[0];
        if(qrtag == undefined) {
            return;
        }
        if(qrtag.size() > 1) {
            alert("数量管理附属品请手动打勾!");
        }
        else if(qrtag.size() == 1) {
            box = qrtag.siblings("input[type=checkbox]")[0];
            box1 = qrtag.siblings("input[type=hidden]")[0];
            box.disabled = false;
            // checke[0].disabled = false;
            box.checked = true;
            box1.value = true;
            select = qrtag1.siblings("select")[0];
            select.value = 'OK';
            //20210517 ljh 1832 add 
            //console.log(qrtag1);
            var b4 = qrtag1.parent().parent().children("td.col_Arrival_NG_Comment__c").find("input[type='text']")[0];
            console.log(b4);
            b4.value = '';
            b4.disabled = true;
            //20210517 ljh 1832 add  end
            // checke[0].checked = true;
            // checke1.value = true;
            b3.style.display = "block";
            var bb = j$(box).parent().parent().children("td.col_chk").children("input[type=checkbox]")[0];
            bb.checked=true;
            checkOnetoOne(bb);
        }
    }
    j$("#scanedqr").append("<li>"+qrcode+"</li>");
    j$("#scanedqr").animate({ scrollTop: j$("#scanedqr").prop("scrollHeight")}, 1000);
    unblockUI();
}
function savejs() {
    // blockme();
    var saveable = true;
    j$("input[name=qrcode]").each(function() {
        j$(this).parent().children("input[type=checkbox]:checked").each(function() {
            j$(this).parent().parent().children(".col_Arrival_in_wh__c").children("input[type=checkbox]")[0].checked = true;
            j$(this).parent().parent().children(".col_chk").children("input[type=checkbox]")[0].checked = true;
        });
    });
    if (saveable) {
        // stockup();
        j$("input#checker").attr('checked',false)
    } else {
        alert("一对一分配附属品不能单独回库!")
        unblockUI();
    }
}
 
function setArrivalResult(sele) {
    // blockme();
    var saveable = true;
    j$("table td.col_chk input[type=checkbox]:checked").each(function(){
        var bx = j$(this).parent().siblings("td.col_ArrivalResult__c").find("select")[0];
        bx.value = sele;
        var b1 = j$(this).parent().siblings("td.col_CDS_complete__c").find("input[type='checkbox']")[0];
        var b11 = j$(this).parent().siblings("td.col_CDS_complete__c").find("input[type='hidden']")[1];
        var b2 = j$(this).parent().siblings("td.col_Arrival_in_wh__c").find("input[type='checkbox']")[0];
        var b21 = j$(this).parent().siblings("td.col_Arrival_in_wh__c").find("input[type='hidden']")[0];
        var b3 = j$(this).parent().siblings("td.onetoone").find("span")[0];
        var b4 = j$(this).parent().siblings("td.col_Arrival_NG_Comment__c").find("input[type='text']")[0];//20210426 ljh 1832 add
        var b41 = j$(this).parent().parent().children("td.col_Arrival_NG_Comment__c").find("span")[0];//20210517 ljh 1832 add
        if (sele == '欠品' || sele == '无' || sele == 'NG') {
            b1.checked = false;
            b11.value = false;
            b2.checked = false;
            b1.disabled = true;
            b2.disabled = true;
            b21.value = false;
            b3.style.display = "none";
            //20210517 ljh 1832 add start
            if(sele == 'NG'){
                b41.style.display = "block";
                b4.disabled = false;
            }else{
                b4.value = '';
                b4.disabled = true;
            }
            //20210517 ljh 1832 add ene
        }
        else if (sele == 'OK') {
            b1.disabled = false;
            b2.disabled = false;
            b3.style.display = "block";
            b1.checked = true;
            b11.value = true;
            b2.checked = true;
            b21.value = true;
            //20210517 ljh 1832 add start
            console.log(b4);
            console.log(b41);
            b4.value = '';
            b4.disabled = true;
            b41.style.display = "none";
            //20210517 ljh 1832 add end
        }
    });
    stopScan();
}
 
function checkAll() {
    j$("table#tableData_L td.col_chk input[type=checkbox]:enabled").each(function(){
        if(!this.disabled) {
            this.checked = j$("input#checker").prop('checked');
            checkOnetoOne(this);
        }
    })
}
var globalChecked = false;
function checkGlobal() {
    globalChecked = !globalChecked;
    j$("table td.col_chk input[type=checkbox]:enabled").each(function(){
        this.checked = globalChecked;
        if (this.id != 'checker') {
            checkOnetoOne(this);
        }
    })
}
function checkOnetoOne(box) {
    // var tasIdTag = j$(box).siblings("input[name=onetoone_main]");
    // if(tasIdTag.size()>0) {
    //     var tasId = tasIdTag.val();
    //     // 同一个一览下的一对一附属品下架打勾
    //     j$("input[type=hidden][value="+tasId+"]").each(function(){
    //         j$(this).siblings("input[type='checkbox']").prop('checked', box.checked);
    //     });
    // }
    if (j$(box).parent().hasClass('col_ArrivalResult__c')) {
        console.log('10');
        var b1 = j$(box).parent().siblings("td.col_CDS_complete__c").find("input[type='checkbox']")[0];
        var b11 = j$(box).parent().siblings("td.col_CDS_complete__c").find("input[type='hidden']")[1];
        var b2 = j$(box).parent().siblings("td.col_Arrival_in_wh__c").find("input[type='checkbox']")[0];
        var b21 = j$(box).parent().siblings("td.col_Arrival_in_wh__c").find("input[type='hidden']")[0];
        var b3 = j$(box).parent().siblings("td.onetoone").find("span")[0];
        var cds = j$(box).parent().siblings("td.col_CDS_complete__c").find("span[name='CDS_complete']")[0];
        var b4 = j$(box).parent().siblings("td.col_Arrival_NG_Comment__c").find("input[type='text']")[0];//20210426 ljh 1832 add
        var b41 = j$(box).parent().parent().children("td.col_Arrival_NG_Comment__c").find("span")[0];//20210517 ljh 1832 add
        var cdsVal = cds.innerText.replace(/\s+/g,"");
        var canReturn = j$(box).parent().parent().attr("canReturn");
        var editable = j$(box).parent().parent().attr("editable");
        if (j$(box).val() == '欠品' || j$(box).val() == '无' || j$(box).val() == 'NG' || j$(box).val() == '') {
            b1.checked = false;
            b11.value = false;
            if(editable == "true" && canReturn == "false"){
                b2.checked = false;
                b2.disabled = true;
            }
            b1.disabled = true;
            b21.value = false;
            b3.style.display = "none";
            //20210426 ljh 1832 add start
            if(j$(box).val() == 'NG'){
                b41.style.display = "block";
                b4.disabled = false;
                // b41.style.display = "none";
            }else{
                b4.value = '';
                b4.disabled = true;
            }
            //20210426 ljh 1832 add end
        }
        else if (j$(box).val() == 'OK') {
            b1.disabled = false;
            // b2.disabled = false;
            // b3.style.display = "block";
            b1.checked = true;
            b11.value = true;
            // b2.checked = true;
            // b21.value = true;
            if ( cdsVal == "true" && canReturn == "false") {
                b2.disabled = false;
                b3.style.display = "block";
                b2.checked = true;
                b21.value = true;
            }
            //20210426 ljh 1832 add start
            b4.value = '';
            b4.disabled = true;
            //20210426 ljh 1832 add end
        }
    }
    else if (j$(box).parent().hasClass('col_CDS_complete__c')) {
        var b1 = j$(box).parent().parent().children("td.col_CDS_complete__c").find("input[type='checkbox']")[0];
        var b2 = j$(box).parent().parent().children("td.col_Arrival_in_wh__c").find("input[type='checkbox']")[0];
        var b21 = j$(box).parent().siblings("td.col_Arrival_in_wh__c").find("input[type='hidden']")[0];
        var b3 = j$(box).parent().parent().children("td.onetoone").find("span")[0];
        var ArrivalResult = j$(box).parent().parent().children("td.col_ArrivalResult__c").find("select")[0];
        var cds = j$(box).parent().parent().children("td.col_CDS_complete__c").find("span[name='CDS_complete']")[0];
        var cdsVal = cds.innerText.replace(/\s+/g,"");
        var canReturn = j$(box).parent().parent().attr("canReturn");
        if (b1.checked) {
            if ( ArrivalResult.value == 'OK' && cdsVal == 'true' && canReturn == 'false')  {
                b2.disabled = false;
                b21.value = false;
            }
        }
        else {
            b2.disabled = true;
            b2.checked = false;
            b21.value = false;
            b3.style.display = "none";
        }
    }
    else if (j$(box).parent().hasClass('col_Arrival_in_wh__c')) {
        var b2 = j$(box).parent().parent().children("td.col_Arrival_in_wh__c").find("input[type='checkbox']")[0];
        var b3 = j$(box).parent().parent().children("td.onetoone").find("span")[0];
        if (b2.checked == true) {
            b3.style.display = "block";
        }
        else {
            b3.style.display = "none";
        }
    }
    else if (j$(box).parent().hasClass('col_chk')) {
        if ((j$(box).parent().parent().children("td.col_ArrivalResult__c").find("select")[0].value== ''
                || j$(box).parent().parent().children("td.col_ArrivalResult__c").find("select")[0].value== null)) {
            j$(box).parent().parent().children("td.col_ArrivalResult__c").find("select")[0].value="OK";
            var b1 = j$(box).parent().siblings("td.col_CDS_complete__c").find("input[type='checkbox']")[0];
            var b11 = j$(box).parent().siblings("td.col_CDS_complete__c").find("input[type='hidden']")[1];
            b1.disabled = false;
            b1.checked = true;
            b11.value = true;
        }
        var cds = j$(box).parent().parent().children("td.col_CDS_complete__c").find("span[name='CDS_complete']")[0];
        var arrival = j$(box).parent().parent().children("td.col_Arrival_in_wh__c").find("input[type='checkbox']")[0];
        var arrival1 = j$(box).parent().parent().children("td.col_Arrival_in_wh__c").find("input[type='hidden']")[0];
        var canReturn = j$(box).parent().parent().attr("canReturn");
        var cdsVal = cds.innerText.replace(/\s+/g,"");
        if (cdsVal == "true" && canReturn == "false") {
            var b21 = j$(box).parent().siblings("td.col_Arrival_in_wh__c").find("input[type='hidden']")[0];
            if (arrival != null && arrival.disabled != true) {
                arrival.checked = true;
                b21.value = true;
            }
        }
        var b3 = j$(box).parent().parent().children("td.onetoone").find("span")[0];
        if ((arrival != null && arrival.checked == true && canReturn == 'false' ) || (arrival1 != null && arrival1.checked == true && canReturn == 'false')) {
            b3.style.display = "block";
        }
        else {
            b3.style.display = "none";
        }
    }
 
    if (j$(box).parent().hasClass('col_chk') == false) {
         j$(box).parent().siblings("td.col_chk").find("input")[0].checked = true;
    }
}
 
function checkorce() {
    if (j$(escapeVfId('allPage:allForm:needforceSave')).val() == 'true') {
        if (window.confirm('有未补全附属品,是否需要拆分上架')) {
            j$(escapeVfId('allPage:allForm:forceSave')).val('true');
            setTimeout(function() {
                blockme();
                saveRecord();
            });
        }
    }
}
function cdsSaveJs(){
    cdsSave();
}
</script>
<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>
 
<div id="cancelModal" class="modal">
        <div class="modal-content">
            <span class="close" onclick="stopScan()">&times;</span>
            <div>
                调拨到货确认结果:
                <select id="allselect">
                    <option>无</option>
                    <option>OK</option>
                    <option>NG</option>
                    <option>欠品</option>
                </select>
                <button value="确认" onclick="setArrivalResult(document.getElementById('allselect').value);" >确认</button>
            </div>
        </div>
    </div>
 
<apex:form id="allForm" styleclass="pbBody">
    <apex:actionFunction name="saveRecord" action="{!saveRecord}" rerender="detail,message,done_flg, forceSave, needforceSave"  oncomplete="unblockUI();checkMessage();checEventFrame();"/>
    <apex:actionFunction name="searchSlip" action="{!searchSlip}" reRender="allForm" onComplete="unblockUI();checkMessage();checEventFrame();" />
    <apex:inputHidden value="{!done_flg}" id="done_flg"/>
    <apex:inputHidden value="{!forceSave}" id="forceSave"/>
    <apex:inputHidden value="{!needforceSave}" id="needforceSave"/>
    <apex:inputHidden value="{!readOnly}" id="readOnly"/>
    <apex:pageBlock id="searchBlock" tabStyle="Report" title="到货确认/CDS/回库">
        <apex:pageBlockButtons location="top">
            <apex:commandButton value="全选/取消全选" onclick="checkGlobal(); return false;" disabled="{!readOnly}"/>
            <apex:commandButton value="扫一扫" onclick="qrscan(0);return false;" disabled="{!readOnly}"/>
            <apex:commandButton value="到货确认&CDS" onclick="blockme();" action="{!cdsSave}" rerender="allForm, message" oncomplete="unblockUI();checkMessage();checEventFrame();" disabled="{!readOnly}"/>
            <apex:commandButton value="回库" onclick="blockme();" action="{!arrival_in_whSave}" rerender="allForm, done_flg, message" oncomplete="unblockUI();checkMessage();checEventFrame();" disabled="{!readOnly}"/>
            <apex:commandButton value="回寄" action="{!saveSlip}" onclick="blockme();" rerender="allForm, message" disabled="{!readOnly}" oncomplete="unblockUI();checkMessage();checEventFrame();"/>
            <!-- <apex:commandButton value="保存" action="{!stockup}" onclick="blockme();" reRender="allForm, message" disabled="{!readOnly}" oncomplete="unblockUI();checkMessage();checEventFrame();checkorce();"/> -->
        </apex:pageBlockButtons>
        <apex:pageBlockSection >
            <apex:pageBlockSectionItem >
                <apex:outputLabel value="{!$ObjectType.TransferApply__c.fields.Name.Label}"/>
                <apex:outputText value="{!apply_no}"/>
            </apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem />
            <apex:pageBlockSectionItem >
                <apex:outputLabel value="回寄-{!$ObjectType.FixtureDeliverySlip__c.fields.Name.Label}"/>
                <apex:outputPanel >
                    <apex:inputField value="{!slip.Name}" id="SlipNo"/>
                    <apex:commandButton value="扫运输单" onclick="qrscan(1);return false;" disabled="{!readOnly}"/>
                    <apex:commandButton value="检索" onclick="blockme();searchSlip(); return false;" disabled="{!readOnly}"/>
                </apex:outputPanel>
            </apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem >
                <apex:outputLabel value="回寄-{!$ObjectType.FixtureDeliverySlip__c.fields.DeliveryType__c.Label}"/>
                <apex:inputField value="{!slip.DeliveryType__c}" id="deliveryType"/>
            </apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem >
                <apex:outputLabel value="回寄-{!$ObjectType.FixtureDeliverySlip__c.fields.Distributor_method__c.Label}"/>
                <apex:inputField value="{!slip.Distributor_method__c}" id="distributorMethod"/>
            </apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem >
                <apex:outputLabel value="回寄-{!$ObjectType.FixtureDeliverySlip__c.fields.DeliveryCompany__c.Label}"/>
                <apex:inputField value="{!slip.DeliveryCompany__c}" id="deliveryCompany"/>
            </apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem >
                <apex:outputLabel value="回寄-{!$ObjectType.FixtureDeliverySlip__c.fields.Wh_Staff__c.Label}"/>
                <apex:outputPanel layout="none">
                    <apex:outputPanel layout="none" rendered="{!readOnly}">
                        <apex:outputField value="{!slip.Wh_Staff__c}" styleClass="hideDropdown"/>
                    </apex:outputPanel>
                    <apex:outputPanel layout="none" rendered="{!readOnly == false}">
                        <apex:inputField value="{!slip.Wh_Staff__c}" styleClass="hideDropdown"/>
                    </apex:outputPanel>
                </apex:outputPanel>
            </apex:pageBlockSectionItem>
        </apex:pageBlockSection>
    </apex:pageBlock>
    <apex:outputPanel id="message">
        <apex:pageMessages />
    </apex:outputPanel>
    <div id="out_Div_L">
        <table class="list" style="border-bottom-width: 0px; font-size:11px; border-spacing:0;" border="" id="tableHeader_L">
            <tr class="headerRow" height="30px">
                <td class="col_chk" align="center">
                    <input type='checkbox' onClick='checkAll();' id="checker"/>
                </td>
                <apex:repeat value="{!outputFieldList}" var="info">
                    <td class="col_{!info.value}">
                       <!-- {!IF(info.label=='到货确认结果', '调拨到货确认结果', '到货确认结果')}{!IF(info.label=='下架','结果','')} -->
                       {!info.label}
                    </td>
                </apex:repeat>
                <td class="Arrival_NG_Comment__c">
                    到货NG结果备注
                </td>
                <td class="col_CDS_complete__c">
                    调拨CDS结果
                </td>
                 <td class="col_Arrival_in_wh__c">
                    调拨回库结果
                </td>
                <td style="width: 110px;" class="onetoone">
                   一对一主体
                </td>
                <td style="width: 110px;">
                   调拨单明细状态
                </td>
            </tr>
        </table>
    </div>
    <apex:outputPanel id="detail">
        <div id="in_Div_L">
            <table class="list" style="border-bottom-width: 0px; font-size:11px; border-spacing:0;" border="" id="tableData_L">
                <apex:variable value="{!0}" var="Cnt" />
                    <apex:repeat id="dataline_L" value="{!esdList}" var="esdInfo">
                        <tr style="{!IF(esdInfo.needColor, 'background-color: #cfeef9', '')}" class="" id="tableData_L_{!Cnt}" editable="{!esdInfo.editable}" canReturn = "{!esdInfo.canReturn}">
                            <td class="dataCellBorder1 col_chk" align="center">
                                <apex:inputCheckbox onclick="if(this.checked) {checkOnetoOne(this)}" styleClass="rowchkcls" value="{!esdInfo.checked}" id="rowCheck" disabled="{!!esdInfo.editable}"/>
                            </td>
                            <apex:repeat value="{!outputFieldList}" var="info">
                                <td class="dataCellBorder1 {!'col_' + info.value}">
                                    <apex:outputPanel layout="none" rendered="{!!esdInfo.editable}">
                                        <apex:outputField value="{!esdInfo.rec[info.value]}" />
                                    </apex:outputPanel>
                                    <apex:outputPanel layout="none" rendered="{!esdInfo.editable}">
                                        <apex:outputPanel layout="none" rendered="{!info.value == 'CDS_complete__c'}">
                                            <input type="hidden" name="qrcode" value="{!esdInfo.rec.Fixture_QRCode_F__c}"/>
                                            <apex:inputField onclick="checkOnetoOne(this);" id="inspectionResult" value="{!esdInfo.rec[info.value]}"/>
                                        </apex:outputPanel>
                                        <apex:outputPanel layout="none" rendered="{!info.value != 'CDS_complete__c'}">
                                            <apex:inputField onchange="checkOnetoOne(this);" value="{!esdInfo.rec[info.value]}"/>
                                        </apex:outputPanel>
                                        <apex:outputPanel layout="none" rendered="{!info.value == 'ArrivalResult__c'}">
                                            <input type="hidden" name="qrcode" value="{!'ArrivalResult' + esdInfo.rec.Fixture_QRCode_F__c}"/>
                                        </apex:outputPanel>
                                        <apex:outputPanel layout="none" rendered="{!esdInfo.rec.Main_OneToOne__c}">
                                            <input type="hidden" name="onetoone_main" value="{!esdInfo.rec.TransferApplySummary__c}"/>
                                            <input type="hidden" name="onetoone_main_CDS" value="{!esdInfo.rec.CDS_complete__c}"/>
                                        </apex:outputPanel>
                                        <apex:outputPanel layout="none" rendered="{!esdInfo.rec.OneToOneAccessory__c}">
                                            <input type="hidden" name="onetoone" value="{!esdInfo.rec.TransferApplySummary__c}"/>
                                        </apex:outputPanel>
                                    </apex:outputPanel>
                                </td>
                            </apex:repeat>
                            <!-- 20210423 ljh 1832 add start-->
                            <td class="dataCellBorder1 col_Arrival_NG_Comment__c">
                                <span name="asset" style="display: {!IF(esdInfo.rec.ArrivalResult__c == 'NG', 'block', 'none')}">
                                <apex:InputField value="{!esdInfo.rec.Arrival_NG_Comment__c}" style="width:90px;"  rendered="{!esdInfo.editable}"  />
                                </span>
                            </td>
                            <!-- 20210423 ljh 1832 add end-->
                            <td class="dataCellBorder1 col_CDS_complete__c">
                                <apex:outputPanel layout="none" rendered="{!!esdInfo.editable}">
                                    <apex:outputField value="{!esdInfo.rec.CDS_complete__c}" />
                                    <input type="hidden" checked="{!esdInfo.rec.CDS_complete__c}"/>
                                </apex:outputPanel>
                                <apex:outputPanel layout="none" rendered="{!esdInfo.editable}">
                                    <input type="hidden" name="qrcode" value="{!esdInfo.rec.Fixture_QRCode_F__c}"/>
                                    <apex:inputCheckbox disabled="{!esdInfo.rec.ArrivalResult__c != 'OK'}" onclick="document.getElementById('{!$Component.CDS_complete__c}').value = this.checked;checkOnetoOne(this);" id="inspectionResult" value="{!esdInfo.rec.CDS_complete__c}"/>
                                    <apex:inputHidden id="CDS_complete__c" value="{!esdInfo.rec.CDS_complete__c}"/>
                                </apex:outputPanel>
                                <span name="CDS_complete" style="display: none">
                                    {!esdInfo.rec.CDS_complete__c}
                                </span>
                            </td>
                            <td class="dataCellBorder1 col_Arrival_in_wh__c">
                                <apex:outputPanel layout="none" rendered="{!OR(!esdInfo.editable || esdInfo.canReturn)}">
                                    <apex:outputField value="{!esdInfo.rec.Arrival_in_wh__c}" />
                                    <input type="hidden" checked="{!esdInfo.rec.Arrival_in_wh__c}" />
                                </apex:outputPanel>
                                <apex:outputPanel layout="none" rendered="{!AND(esdInfo.editable, !esdInfo.canReturn)}">
                                    <apex:inputCheckbox disabled="{!esdInfo.rec.CDS_complete__c == false}" onclick="document.getElementById('{!$Component.Arrival_in_wh__c}').value = this.checked; checkOnetoOne(this);"  value="{!esdInfo.rec.Arrival_in_wh__c}" />
                                    <apex:inputHidden id="Arrival_in_wh__c" value="{!esdInfo.rec.Arrival_in_wh__c}"/>
                                </apex:outputPanel>
                            </td>
                            <td style="width: 110px;" class="onetoone">
                                <span name="asset" style="display: {!IF(esdInfo.rec.Arrival_in_wh__c, 'block', 'none')}">
                                    <apex:inputField rendered="{!esdInfo.needsetone}" style="width: 80px;" onclick="checkOnetoOne(this);" id="mainAsset" value="{!esdInfo.rec.OneToOneAsset__c}"/>
                                </span>
                                <apex:outputPanel layout="none" rendered="{!esdInfo.rec.Arrival_in_wh__c && esdInfo.checked == false}">
                                        <apex:outputField rendered="{!esdInfo.needsetone}" style="width: 80px;" value="{!esdInfo.rec.OneToOneAsset__c}"/>
                                </apex:outputPanel>
                            </td>
                            <td style="width: 110px;" class="TAESD_Status">
                                <apex:outputField value="{!esdInfo.rec.TAESD_Status__c}"/>
                            </td>
                        </tr>
                    <apex:variable value="{!Cnt+1}" var="Cnt" />
                </apex:repeat>
            </table>
        </div>
    </apex:outputPanel>
    <apex:outputPanel id="checEventFrame">
        <script>
 
 
        </script>
    </apex:outputPanel>
</apex:form>
<script type="text/javascript">
    var standalone = window.navigator.standalone,
        userAgent = window.navigator.userAgent.toLowerCase(),
        safari = /safari/.test( userAgent ),
        ios = /iphone|ipod|ipad/.test( userAgent ),
        ver = '';
        if (ios) {
            ver = (navigator.userAgent).match(/OS (\d)?\d_\d(_\d)?/i)[0].split('_')[0].replace("OS ","");
        }
    let scanner = new Instascan.Scanner({ video: document.getElementById('preview'), scanPeriod: 5 ,mirror: false});
    scanner.addListener('scan', function (content) {
      filljsQR(content);
    });
 
    function qrscan(stype) {
        scanType = stype;
        if (!standalone && !safari && ios) {
            window.location.href="sfqr://scan";
        } else {
            j$("#myModal").show();
            Instascan.Camera.getCameras().then(function (cameras) {
              if (cameras.length > 0) {
                if (ver >= 13) {
                    scanner.start(cameras[1]);
                } else {
                    scanner.start(cameras[0]);
                }
              } 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;
            }
        });
    });
    function checEventFrame() {
        j$('select[name$="deliveryType"]').val('回寄');
        j$('select[name$="deliveryType"]').prop('disabled', true);
        // j$("input[name=onetoone]").siblings("input[type=checkbox]").each(function(){
        //     this.disabled = true;
        // })
        if (j$(escapeVfId('allPage:allForm:readOnly')).val() == 'true') {
            j$("input#checker").attr('disabled', 'disabled');
        }
        else {
            j$("input#checker").removeAttr('disabled');
        }
        setTimeout(function() {
            j$('select[name$="distributorMethod"]').children('option[value="空运"]').remove();
            j$('select[name$="deliveryCompany"]').children('option[value="莱比特"],option[value="嘉里大通"]').remove();
            if (j$(escapeVfId('allPage:allForm:readOnly')).val() == 'true') {
                j$("input[type=text],select").each(function(){
                    this.disabled = true;
                })
            }
        }, 500);
 
    }
    checEventFrame();
</script>
</apex:page>