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
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
<apex:page Controller="summonsCreatController" showHeader="true" tabStyle="SaleAndDelivery__tab" sidebar="true" id="allPage" action="{!init}" title="出库单管理">
<apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/>
<apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
<apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
<apex:includeScript value="{!URLFOR($Resource.CommonUtilJs)}"/>
<apex:includeScript value="{!URLFOR($Resource.summonsCreatJs)}"/>
<apex:stylesheet value="{!URLFOR($Resource.jquerysuggestcss)}"/>
<apex:includeScript value="{!URLFOR($Resource.jquerysuggestjs)}"/>
<apex:includeScript value="{!URLFOR($Resource.connection20)}"/>
<apex:includeScript value="{!URLFOR($Resource.apex20)}"/>
<script type="text/javascript">
function setFocusOnLoad() {}
function bodyOnLoad(){setFocusOnLoad();}
function searchsearchAgencyH(str){
    //update by rentx 2021-3-1 start
    //先判断当前经销商下是否有维护特价医院 如果没有维护特价医院 那么直接查询所有医院
    var flag = j$(escapeVfId('allPage:allForm:allBlock:Editable:OutPattern01')).value();
    j$(escapeVfId('allPage:allForm:allBlock:Editable:OEC')).attr('readonly',true);
    if ({!hasHos == false}) {
        openPopup('/customer/searchAgencyHospital?Ctype=' + str+'&ishos=', 'setsearch', 800, 600, 'width=800,height=600,scrollbars=yes', true);
    }else{
        var noOfRecords = j$(escapeVfId('allPage:allForm:allBlock:ConsumableorderdetailsSection:consumableorderdetailsCount')).value();
        var ishosNum = 0;
        for (var i = 0; i < noOfRecords; i++) {
            var tempCheckVar = j$(escapeVfId('allPage:allForm:allBlock:ConsumableorderdetailsSection:ConsumableorderdetailsTable:'+i+':variableinfo:consumablesCountproRowCheckbox')).value();
            var tempHosVar = j$(escapeVfId('allPage:allForm:allBlock:ConsumableorderdetailsSection:ConsumableorderdetailsTable:'+i+':hosOffer')).value();
            var tempHosProVar = j$(escapeVfId('allPage:allForm:allBlock:ConsumableorderdetailsSection:ConsumableorderdetailsTable:'+i+':hosPro')).value();
            console.log('tempHosProVar:'+tempHosProVar);
            if (((tempCheckVar == true || tempCheckVar == 'on') || {!Existarrive}) && (tempHosVar == true || tempHosVar == 'true') && (tempHosProVar == true || tempHosProVar == 'true')) {   
                ishosNum ++;   
            }
 
        }
        // alert({!Existarrive} + flag);
        console.log('34:'+ishosNum);
        if (ishosNum > 0 || ({!Existarrive} && flag == 'true')) {
        // if (ishosNum > 0) {
            openPopup('/customer/searchAgencyHospital?Ctype=' + str+'&ishos=true', 'setsearch', 800, 600, 'width=800,height=600,scrollbars=yes', true);
        }else{
            openPopup('/customer/searchAgencyHospital?Ctype=' + str+'&ishos=', 'setsearch', 800, 600, 'width=800,height=600,scrollbars=yes', true);
        }
    }
    //update by rentx 2021-01-29 start
    // j$(escapeVfId('allPage:allForm:allBlock:Editable:OEC')).attr('readonly',true);
    // openPopup('/customer/searchAgencyHospital?Ctype=' + str, 'setsearch', 800, 600, 'width=800,height=600,scrollbars=yes', true);
    // var flag = j$(escapeVfId('allPage:allForm:allBlock:Editable:OutPattern01')).value();
    // j$(escapeVfId('allPage:allForm:allBlock:Editable:OEC')).attr('readonly',true);
    // openPopup('/customer/searchAgencyHospital?Ctype=' + str+'&ishos='+flag, 'setsearch', 800, 600, 'width=800,height=600,scrollbars=yes', true);
    //update by rentx 2021-01-29 end
    //update by rentx 2021-3-1 end
}
function clearAgencyI(){
    var agencyname = j$(escapeVfId('allPage:allForm:allBlock:Editable:OEC')).value();
    if (agencyname == '' || agencyname == null) {
        document.getElementById('allPage:allForm:allBlock:Editable:OECId').value = "";
    }
 
    var accid = j$(escapeVfId('allPage:allForm:allBlock:Editable:OECId')).value();
    if (accid != null && accid != '') {
        checkOutPatternFn();
    }
 
 
}
// vivek update start
function saveConfirmJs(str){
    var msg = "出库价格仅可操作一次变更,保存后将无法修改。\n\n请确认!";
    if(str == '价格未定'){
        if(confirm(msg)==true){
            saveJs();
        }
    }else{
        saveJs();
    }
}
// vivek update end
 
function setVisitorPlace(){
    var x = j$(escapeVfId('allPage:allForm:allBlock:Editable:SummonsForDirction__c')).value();
    if (x == '互相调货') {
        try{
            var str = 'allPage:allForm:allBlock:Editable:Order_ForDealerText';
            var strPage = null;
            var options = {};
            var ros = j$(escapeVfId('allPage:allForm:allBlock:Editable:Order_ForDealerText')).value();
            strPage = '/customer/apex/ConSearchAgencyPlace?r=' + encodeURI(ros);
            options = {minchars:3, minwords:1, resultsClass:'visitorplace_results'};
            jQuery(escapeVfId(str)).unbind();
            if (strPage != null) {
                jQuery(escapeVfId(str)).suggest(strPage,options);
            }
        }catch(e){
            alert(e);
        }
    }
    else{
        var agencytext = j$(escapeVfId('allPage:allForm:allBlock:Editable:Order_ForDealerText')).value();
        j$(escapeVfId('allPage:allForm:allBlock:Editable:Order_ForDealerTextHidden')).val(agencytext);
        //alert('1' + agencytext);
        //alert('2' + j$(escapeVfId('allPage:allForm:allBlock:Editable:Order_ForDealerTextHidden')).value());
    }
 
}
 
function vpClear2_delay(){
    var x = j$(escapeVfId('allPage:allForm:allBlock:Editable:SummonsForDirction__c')).value();
    if (x == '互相调货') {
        var vp = 'allPage:allForm:allBlock:Editable:Order_ForDealerText';
        var vpHidden = 'allPage:allForm:allBlock:Editable:Order_ForDealerTextHidden';
        setTimeout(
            function() {
                if(j$(escapeVfId(vp)).attr("jquerysuggest_skip_flag") == "false") {
                    if (j$(escapeVfId(vp)).value() != j$(escapeVfId(vpHidden)).value()) {
                        vpClear2();
                    }
                }
            },
            200
        );
    }
    else{
        var agencytext = j$(escapeVfId('allPage:allForm:allBlock:Editable:Order_ForDealerText')).value();
        j$(escapeVfId('allPage:allForm:allBlock:Editable:Order_ForDealerTextHidden')).val(agencytext);
    }
}
function vpClear2(){
  var vp = 'allPage:allForm:allBlock:Editable:Order_ForDealerText';
  var vpHidden = 'allPage:allForm:allBlock:Editable:Order_ForDealerTextHidden';
  // alert('vp=' + j$(escapeVfId(vp)).value());
  // alert('vpHidden=' + j$(escapeVfId(vpHidden)).value());
  // if (j$(escapeVfId(vp)).value() != j$(escapeVfId(vpHidden)).value()) {
  //   changeFlg = 'false';
  //   //alert('changeFlg+' +changeFlg);
  //   if(changeFlg == 'true'){
  //       vpBefore = j$(escapeVfId('allPage:allForm:allBlock:Editable:Order_ForDealerTextHidden')).value();
  //       j$(escapeVfId('allPage:allForm:allBlock:Editable:Order_ForDealerText')).val(vpBefore);
  //       document.getElementById('allPage:allForm:allBlock:Editable:Order_ForDealerText').blur();
  //       return;
  //   }
  // }
  resetValue('allPage:allForm:allBlock:Editable:Order_ForDealerText');
}
function FilesUaplodJs(){
    //上传文件
    FilesUpload();
}
 
function refreshPageSizeJs() {
    refreshPageSize();
}
 
function CommitConsumable(){
    //确认提交
    approval();
    //openPDF();
}
function openPDF(){
    window.open("/customer/summonsPDF?ESetid="+'{!URLENCODE(IdCheck)}');
}
 
function openReportJs(){
    //打开报表
    var reportId = '{!IdCheck}';
    reportId = reportId.substring(0,15);
    window.open("/customer/" +'{!URLENCODE($Label.ConsumableOut_report)}'+ "?pv1="+ encodeURI(reportId));
}
 
function openToInvoiceJs(){
    //打开发票
    //upchangeorder();
    var invoiceId = j$(escapeVfId('allPage:allForm:allBlock:unEditable:ConInvoice_Code_lkid')).value();
    if (invoiceId.length > 0 && invoiceId != '000000000000000') {
        window.open("/customer/ConInvoiceView?deliveryId="+'{!URLENCODE(IdCheck)}' + "&invoiceId=" + encodeURI(invoiceId) + "&KeyWords=Redirect","_self");
    }else{
        window.open("/customer/ConInvoiceView?deliveryId="+'{!URLENCODE(IdCheck)}' + "&KeyWords=Redirect","_self");
    }
}
 
function PraseToPDFJs(){
    //打印成PDF
    PraseToPDF();
    window.open("/customer/summonsPDF?ESetid="+'{!URLENCODE(IdCheck)}');
}
 
function ChangeDirction(j){
    var a = j.id;
    var x = j$(escapeVfId(a)).value();
    var productCount = j$(escapeVfId('allPage:allForm:allBlock:ConsumableorderdetailsSection:consumableorderdetailsCount')).value();
    if(x == '直接销售给医院'){
        //医院
        j$(escapeVfId('allPage:allForm:allBlock:Editable:OEC')).prop('disabled',false);
        j$(escapeVfId('allPage:allForm:allBlock:Editable:Order_ForCustomer')).prop('disabled',false);
        //二级经销商
        j$(escapeVfId('allPage:allForm:allBlock:Editable:province')).prop('disabled',true);
        document.getElementById('allPage:allForm:allBlock:Editable:province').value = "";
        j$(escapeVfId('allPage:allForm:allBlock:Editable:Order_ForDealerText')).prop('disabled',true);
        document.getElementById('allPage:allForm:allBlock:Editable:Order_ForDealerText').value = "";
        // for (var i = 0; i < productCount; i++) {
        //     j$(escapeVfId('allPage:allForm:allBlock:ConsumableorderdetailsSection:ConsumableorderdetailsTable:' + i + ':variableMoneyinfo:Unitpriceagency')).prop('disabled',true);
        //     document.getElementById('allPage:allForm:allBlock:ConsumableorderdetailsSection:ConsumableorderdetailsTable:' + i + ':variableMoneyinfo:Unitpriceagency').value = "";
        // }
    }else if(x == '医院试用'){
        //医院
        j$(escapeVfId('allPage:allForm:allBlock:Editable:OEC')).prop('disabled',false);
        j$(escapeVfId('allPage:allForm:allBlock:Editable:Order_ForCustomer')).prop('disabled',false);
        //二级经销商
        j$(escapeVfId('allPage:allForm:allBlock:Editable:province')).prop('disabled',false);
        j$(escapeVfId('allPage:allForm:allBlock:Editable:Order_ForDealerText')).prop('disabled',false);
        // for (var i = 0; i < productCount; i++) {
        //     j$(escapeVfId('allPage:allForm:allBlock:ConsumableorderdetailsSection:ConsumableorderdetailsTable:' + i + ':variableMoneyinfo:Unitpriceagency')).prop('disabled',true);
        //     document.getElementById('allPage:allForm:allBlock:ConsumableorderdetailsSection:ConsumableorderdetailsTable:' + i + ':variableMoneyinfo:Unitpriceagency').value = "";
        // }
    }else if(x == '销售给二级经销商'){
        //医院
        j$(escapeVfId('allPage:allForm:allBlock:Editable:OEC')).prop('disabled',false);
        j$(escapeVfId('allPage:allForm:allBlock:Editable:Order_ForCustomer')).prop('disabled',false);
        //二级经销商
        j$(escapeVfId('allPage:allForm:allBlock:Editable:province')).prop('disabled',false);
        j$(escapeVfId('allPage:allForm:allBlock:Editable:Order_ForDealerText')).prop('disabled',false);
        // for (var i = 0; i < productCount; i++) {
        //     j$(escapeVfId('allPage:allForm:allBlock:ConsumableorderdetailsSection:ConsumableorderdetailsTable:' + i + ':variableMoneyinfo:Unitpriceagency')).prop('disabled',false);
        // }
    }else if(x == '互相调货'){
        //医院
        j$(escapeVfId('allPage:allForm:allBlock:Editable:OEC')).prop('disabled',true);
        document.getElementById('allPage:allForm:allBlock:Editable:OEC').value = "";
        document.getElementById('allPage:allForm:allBlock:Editable:OECId').value = "";
        j$(escapeVfId('allPage:allForm:allBlock:Editable:Order_ForCustomer')).prop('disabled',true);
        document.getElementById('allPage:allForm:allBlock:Editable:Order_ForCustomer').value = "";
        //二级经销商
        j$(escapeVfId('allPage:allForm:allBlock:Editable:province')).prop('disabled',false);
        j$(escapeVfId('allPage:allForm:allBlock:Editable:Order_ForDealerText')).prop('disabled',false);
        // for (var i = 0; i < productCount; i++) {
        //     j$(escapeVfId('allPage:allForm:allBlock:ConsumableorderdetailsSection:ConsumableorderdetailsTable:' + i + ':variableMoneyinfo:Unitpriceagency')).prop('disabled',true);
        //     document.getElementById('allPage:allForm:allBlock:ConsumableorderdetailsSection:ConsumableorderdetailsTable:' + i + ':variableMoneyinfo:Unitpriceagency').value = "";
        // }
    }else{
        //医院
        j$(escapeVfId('allPage:allForm:allBlock:Editable:OEC')).prop('disabled',false);
        j$(escapeVfId('allPage:allForm:allBlock:Editable:Order_ForCustomer')).prop('disabled',false);
        //二级经销商
        j$(escapeVfId('allPage:allForm:allBlock:Editable:province')).prop('disabled',false);
        //document.getElementById('allPage:allForm:allBlock:Editable:province').value = "";
        j$(escapeVfId('allPage:allForm:allBlock:Editable:Order_ForDealerText')).prop('disabled',false);
        //document.getElementById('allPage:allForm:allBlock:Editable:Order_ForDealerText').value = "";
        // for (var i = 0; i < productCount; i++) {
        //     j$(escapeVfId('allPage:allForm:allBlock:ConsumableorderdetailsSection:ConsumableorderdetailsTable:' + i + ':variableMoneyinfo:Unitpriceagency')).prop('disabled',false);
        //     //document.getElementById('allPage:allForm:allBlock:ConsumableorderdetailsSection:ConsumableorderdetailsTable:' + i + ':variableMoneyinfo:Unitpriceagency').value = "";
        // }
    }
}
//页面刷新重新计算金额
function CountCounttestPrice(){
    var numberDetails =j$(escapeVfId('allPage:allForm:allBlock:ConsumableorderdetailsSection:consumableorderdetailsCount')).value();
    for(var i = 0; i < numberDetails ; i++){
        var ckeck = j$(escapeVfId('allPage:allForm:allBlock:ConsumableorderdetailsSection:ConsumableorderdetailsTable:' + i + ':variableinfo' + ':consumablesCountproRowCheckbox')).value();
 
        if (ckeck == 'on') {
            var a=document.getElementById ("allPage:allForm:allBlock:ConsumableorderdetailsSection:ConsumableorderdetailsTable:" + i +":variableAllprice:consumablesCounttestPrice");
            if ({!Existarrive}) {
                z  =  parseFloat(j$(escapeVfId('allPage:allForm:allBlock:ConsumableorderdetailsSection:ConsumableorderdetailsTable:' + i +':consumablesCount_UnEditout:consumablesCount_UnEditin')).value());
            }else{
                z  =  parseFloat(j$(escapeVfId('allPage:allForm:allBlock:ConsumableorderdetailsSection:ConsumableorderdetailsTable:' + i+':variable:consumablesCount')).value());
            }
            //z= z.replace(/,/g,'');
            if(isNaN(z)){z=0.00;}
            //alert(z);
            x = j$(escapeVfId('allPage:allForm:allBlock:ConsumableorderdetailsSection:ConsumableorderdetailsTable:' + i +':variableMoneyinfo:productOrderMoneyinfo')).value().replace(/,/g,'');
            c = parseFloat(z * x).toFixed(2);
            //c = number_format_common (c,2,'.',',');
            a.innerHTML = c;
            SumCompute();
        }
    }
}
 
function ComputePriceCheck(j){ // FIXME lineNo にしてください
    var z,x,c;
    var a = j.id;
    var i=a.substring(0,a.lastIndexOf(':'));// <apex:variable value="{!1}" var="lineNo" />
    i=i.substring(0,i.lastIndexOf(':'));
    var a=document.getElementById (i+":variableAllprice:consumablesCounttestPrice");
    if ({!Existarrive}) {
        z  =  parseFloat(j$(escapeVfId(i+':consumablesCount_UnEditout:consumablesCount_UnEditin')).value());
    }else{
        z  =  parseFloat(j$(escapeVfId(i+':variable:consumablesCount')).value());
    }
    //z= z.replace(/,/g,'');
    if(isNaN(z)){z=0.00;}
    //alert(z);
    x = j$(escapeVfId(i +':variableMoneyinfo:productOrderMoneyinfo')).value().replace(/,/g,'');
    c = parseFloat(z * x).toFixed(2);
    //c = number_format_common (c,2,'.',',');
    a.innerHTML = c;
    SumCompute();
}
 
function showCate() {
    //var productCount = j$(escapeVfId('allPage:allForm:allBlock:searchBlock:category3Search')).value();
    categoryload();
}
 
function showAllCate() {
    categoryAllload();
}
 
//页面加载 项目初始化
function onLoadDirction(){
    var x = j$(escapeVfId('allPage:allForm:allBlock:Editable:SummonsForDirction__c')).value();
    var productCount = j$(escapeVfId('allPage:allForm:allBlock:ConsumableorderdetailsSection:consumableorderdetailsCount')).value();
 
    if(x == '直接销售给医院'){
        //医院
        j$(escapeVfId('allPage:allForm:allBlock:Editable:OEC')).prop('disabled',false);
        j$(escapeVfId('allPage:allForm:allBlock:Editable:Order_ForCustomer')).prop('disabled',false);
        //二级经销商
        j$(escapeVfId('allPage:allForm:allBlock:Editable:province')).prop('disabled',true);
        document.getElementById('allPage:allForm:allBlock:Editable:province').value = "";
        j$(escapeVfId('allPage:allForm:allBlock:Editable:Order_ForDealerText')).prop('disabled',true);
        document.getElementById('allPage:allForm:allBlock:Editable:Order_ForDealerText').value = "";
        // for (var i = 0; i < productCount; i++) {
        //     j$(escapeVfId('allPage:allForm:allBlock:ConsumableorderdetailsSection:ConsumableorderdetailsTable:' + i + ':variableMoneyinfo:Unitpriceagency')).prop('disabled',true);
        //     document.getElementById('allPage:allForm:allBlock:ConsumableorderdetailsSection:ConsumableorderdetailsTable:' + i + ':variableMoneyinfo:Unitpriceagency').value = "";
        // }
    }else if(x == '医院试用'){
        //医院
        j$(escapeVfId('allPage:allForm:allBlock:Editable:OEC')).prop('disabled',false);
        j$(escapeVfId('allPage:allForm:allBlock:Editable:Order_ForCustomer')).prop('disabled',false);
        //二级经销商
        j$(escapeVfId('allPage:allForm:allBlock:Editable:province')).prop('disabled',false);
        j$(escapeVfId('allPage:allForm:allBlock:Editable:Order_ForDealerText')).prop('disabled',false);
        // for (var i = 0; i < productCount; i++) {
        //     j$(escapeVfId('allPage:allForm:allBlock:ConsumableorderdetailsSection:ConsumableorderdetailsTable:' + i + ':variableMoneyinfo:Unitpriceagency')).prop('disabled',true);
        //     document.getElementById('allPage:allForm:allBlock:ConsumableorderdetailsSection:ConsumableorderdetailsTable:' + i + ':variableMoneyinfo:Unitpriceagency').value = "";
        // }
    }else if(x == '销售给二级经销商'){
        //医院
        j$(escapeVfId('allPage:allForm:allBlock:Editable:OEC')).prop('disabled',false);
        j$(escapeVfId('allPage:allForm:allBlock:Editable:Order_ForCustomer')).prop('disabled',false);
        //二级经销商
        j$(escapeVfId('allPage:allForm:allBlock:Editable:province')).prop('disabled',false);
        j$(escapeVfId('allPage:allForm:allBlock:Editable:Order_ForDealerText')).prop('disabled',false);
        // for (var i = 0; i < productCount; i++) {
        //     j$(escapeVfId('allPage:allForm:allBlock:ConsumableorderdetailsSection:ConsumableorderdetailsTable:' + i + ':variableMoneyinfo:Unitpriceagency')).prop('disabled',false);
        // }
    }else if(x == '互相调货'){
        //医院
        j$(escapeVfId('allPage:allForm:allBlock:Editable:OEC')).prop('disabled',true);
        document.getElementById('allPage:allForm:allBlock:Editable:OEC').value = "";
        document.getElementById('allPage:allForm:allBlock:Editable:OECId').value = "";
        j$(escapeVfId('allPage:allForm:allBlock:Editable:Order_ForCustomer')).prop('disabled',true);
        document.getElementById('allPage:allForm:allBlock:Editable:Order_ForCustomer').value = "";
        //二级经销商
        j$(escapeVfId('allPage:allForm:allBlock:Editable:province')).prop('disabled',false);
        j$(escapeVfId('allPage:allForm:allBlock:Editable:Order_ForDealerText')).prop('disabled',false);
 
        // for (var i = 0; i < productCount; i++) {
        //     j$(escapeVfId('allPage:allForm:allBlock:ConsumableorderdetailsSection:ConsumableorderdetailsTable:' + i + ':variableMoneyinfo:Unitpriceagency')).prop('disabled',true);
        //     document.getElementById('allPage:allForm:allBlock:ConsumableorderdetailsSection:ConsumableorderdetailsTable:' + i + ':variableMoneyinfo:Unitpriceagency').value = "";
        // }
    }
}
 
window.sfdcPage.appendToOnloadQueue(function() { onLoadDirction(); });
 
</script>
<style>
    .visitorplace_results {
        border: 1px solid gray;
        background-color: white;
        padding: 0;
        margin: 0;
        list-style: none;
        position: absolute;
        z-index: 10000;
        display: none;
        overflow:auto;
        white-space:nowrap;
        width:400px;
        height:250px;
    }
    .visitorplace_results li {
        padding: 2px 5px 2px 0px;
        margin-left : 2px;
        color: #101010;
        text-align: left;
    }
    .panelGridCenter td,.panelGridCenter tr {
        text-align: center;
    }
    .dateFormat  {
        display: none;
    }
    tr.dataRow {
        background-color:white;
    }
    td.columus {
        background-color:white;
        text-align: right;
    }
    tr.dataRow:hover {
        background-color: #e3f3ff;
    }
</style>
    <apex:form id="allForm">
    <!-- //add  by rentx 2021-2-26 -->
        <apex:actionFunction name="checkOutPatternFn" action="{!checkOutPattern}" status="fetchStatus" reRender="ConsumableorderdetailsSection,message,OutPattern01" onComplete="CountCounttestPrice();onLoadDirction();"/>
    <!-- //add by rentx 2021-2-26 -->
        <apex:actionFunction name="refreshPageSize" action="{!refreshPageSize}" status="fetchStatus" reRender="ConsumableorderdetailsSection,message" onComplete="CountCounttestPrice();onLoadDirction();"/>
        <apex:actionFunction name="save" action="{!save}" rerender=" message,Editable,ConsumableorderdetailsSection" onComplete="unblockUI();CountCounttestPrice();onLoadDirction();">
        </apex:actionFunction>
        <apex:actionFunction name="categoryload" action="{!categoryload}" rerender="searchBlock" onComplete="unblockUI();">
        </apex:actionFunction>
         <apex:actionFunction name="categoryAllload" action="{!categoryAllload}" rerender="searchBlock" onComplete="unblockUI();">
        </apex:actionFunction>
        <apex:actionFunction name="searchConsumableorderdetails" action="{!searchConsumableorderdetails}" rerender="ConsumableorderdetailsSection, message" onComplete="unblockUI();CountCounttestPrice();onLoadDirction();">
        </apex:actionFunction>
        <apex:actionFunction name="setEditAble" action="{!setEditAble}" rerender="ConsumableorderdetailsSection, message" onComplete="unblockUI();">
        </apex:actionFunction>
        <apex:actionFunction name="approval" action="{!approval}" rerender="allForm" onComplete="unblockUI();openPDF();">
        </apex:actionFunction>
         <apex:actionFunction name="DelConsumable" action="{!DelConsumable}" rerender="ConsumableorderdetailsSection, message" onComplete="unblockUI();">
        </apex:actionFunction>
        <apex:actionFunction name="PraseToPDF" action="{!PraseToPDF}" rerender="ConsumableorderdetailsSection, message" onComplete="unblockUI();">
        </apex:actionFunction>
        <apex:actionFunction name="GoodsDelivery" action="{!GoodsDelivery}" rerender="ConsumableorderdetailsSection, message" onComplete="unblockUI();">
        </apex:actionFunction>
        <apex:actionFunction name="SortLimited" action="{!SortLimited}" rerender="ConsumableorderdetailsSection, message" onComplete="unblockUI();CountCounttestPrice();onLoadDirction();">
            <apex:param name="firstParam" assignTo="{!sortKey}" value="" />
        </apex:actionFunction>
        <!--<apex:actionFunction name="SortStore" action="{!SortStore}" rerender="ConsumableorderdetailsSection, message" onComplete="unblockUI();">
            <apex:param name="firstParam" assignTo="{!sortKey}" value="" />
        </apex:actionFunction>-->
        <apex:actionFunction name="FilesUpload" action="{!FilesUpload}" rerender="ConsumableorderdetailsSection, message" onComplete="unblockUI();">
        </apex:actionFunction>
 
        <apex:outputPanel id="allPanel">
        <input type="hidden" id="userState" value="{!localuser.State_Hospital__c}"/>
            <apex:pageBlock id="allBlock" >
                <table>
                    <colgroup>
                        <col width="150px"/>
                        <col width="200px"/>
                        <col width="200px"/>
                        <col width="200px"/>
                        <col width="200px"/>
                        <col width="200px"/>
                        <col width="90px"/>
                        <col width="100px"/>
                        <col width="10px"/>
                        <col width="85px"/>
                        <col width="100px"/>
                        <col width="10px"/>
                        <col width="70px"/>
                        <col width="100px"/>
                    </colgroup>
                    <tr>
                        <td></td>
                        <td  colspan="4"><apex:commandButton onclick="saveConfirmJs('{!coc.SummonsStatus_c__c}');" value="保存" style="width:150px" rerender="dummy" rendered="{!(EditDelCommitBtnDisabled||EditAble)}"/></td>
                    </tr>
                    <tr>
                        <td></td>
                        <td ><apex:commandButton onclick="EditConsumable();"   value="编辑出库单" style="width:150px" rerender="dummy" rendered="{!!(EditDelCommitBtnDisabled||EditAble)}" disabled="{!IF(coc.SummonsStatus_c__c='已完成',true,false)}"/></td>
                        <!--CHAN-B65CAZ 20181105 UpdateStart-->
                        <!-- <td ><apex:commandButton onclick="CommitConsumable();" value="提交出库单" style="width:150px" rerender="dummy" rendered="{!!(EditDelCommitBtnDisabled||EditAble)}" disabled="{!IF(coc.SummonsStatus_c__c='批准'||coc.SummonsStatus_c__c='已销售待上传纳品书'||coc.SummonsStatus_c__c='出库单已打印'||coc.SummonsStatus_c__c='已完成',true,false)}"/></td> -->
                        <td ><apex:commandButton onclick="GoodsDeliveryJs();"  value="出货/销售"     style="width:150px" rerender="dummy" rendered="{!!(EditDelCommitBtnDisabled||EditAble)}" disabled="{!IF(coc.SummonsStatus_c__c='已销售待上传纳品书'||coc.SummonsStatus_c__c='已完成'||coc.SummonsStatus_c__c='价格未定',true,false)}"/></td>
                        <!-- CHAN-B65CAZ 20181105 UpdateEnd-->
                        <td ><apex:commandButton onclick="openToInvoiceJs();return false;" value="开票" style="width:150px" rerender="dummy" rendered="{!!(EditDelCommitBtnDisabled||EditAble)}" disabled="{!IF(((coc.Billed_Status__c !='全部开票' &&coc.SummonsStatus_c__c='已完成') || coc.Onchange_order__c = true) && coc.SummonsForDirction__c!='互相调货',false,true)}"/></td>
                    </tr>
                    <tr>
                        <td></td>
                        <!--CHAN-B65CAZ 20181105 UpdateStart-->
                        <td ><apex:commandButton onclick="PraseToPDFJs();" value="打印指示单" style="width:150px" rerender="dummy" rendered="{!!(EditDelCommitBtnDisabled||EditAble)}" disabled="{!IF(coc.SummonsStatus_c__c='已销售待上传纳品书'||coc.SummonsStatus_c__c='批准'||coc.SummonsStatus_c__c='出库单已打印'||coc.SummonsStatus_c__c='草案中',false,true)}"/></td>
                        <!-- CHAN-B65CAZ 20181105 UpdateEnd-->
                        <td ><apex:commandButton onclick="openReportJs(); return false;" value="显示明细" style="width:150px" rerender="dummy" rendered="{!!(EditDelCommitBtnDisabled||EditAble)}" disabled="{!IF(coc.Billed_Status__c !='还没开票' || coc.SummonsStatus_c__c='已完成',false,true)}"/></td>
                        <td ><apex:commandButton onclick="DeleteConsumable();" value="删除" style="width:150px" rerender="dummy" rendered="{!!(EditDelCommitBtnDisabled||EditAble)}" disabled="{!IF(coc.SummonsStatus_c__c='已销售待上传纳品书'||coc.SummonsStatus_c__c='价格未定'||coc.SummonsStatus_c__c='批准'||coc.SummonsStatus_c__c='出库单已打印'||coc.SummonsStatus_c__c='已完成',true,false)}"/></td>
                        <td >
                        </td>
                    </tr>
                </table>
                <apex:outputPanel id="message">
                    <apex:pageMessages />
                 </apex:outputPanel>
<!--==============20160314====INSERT_CODE_END=======================================-->
                <apex:pageBlock title="出库单信息" id="Editable" rendered="{!EditAble}">
                <!-- update start by vivek 2019-7-15 -->
                    <!-- <table>
                        <colgroup>
                            <col width="150px"/>
                            <col width="300px"/>
                            <col width="150px"/>
                            <col width="300px"/>
                            <col width="80px"/>
                            <col width="10px"/>
                            <col width="90px"/>
                            <col width="100px"/>
                            <col width="10px"/>
                            <col width="85px"/>
                            <col width="100px"/>
                            <col width="10px"/>
                            <col width="70px"/>
                            <col width="100px"/>
                        </colgroup> -->
                <!-- update end by vivek 2019-7-15 -->
                        <!-- update start by vivek 2019-7-15 -->
                        <apex:outputPanel rendered="{! If(coc.SummonsStatus_c__c == '价格未定',true,false) }">
                        <table>
                        <colgroup>
                            <col width="150px"/>
                            <col width="300px"/>
                            <col width="150px"/>
                            <col width="300px"/>
                            <col width="80px"/>
                            <col width="10px"/>
                            <col width="90px"/>
                            <col width="100px"/>
                            <col width="10px"/>
                            <col width="85px"/>
                            <col width="100px"/>
                            <col width="10px"/>
                            <col width="70px"/>
                            <col width="100px"/>
                        </colgroup>
                                <tr>
                                <td align="right">出库单号:</td>
                                <td align="left"><apex:outputField id="OrderCode_out2"  value="{!coc.Name}" style="width:300px"/></td>
                                <td align="right">出库单状态:</td>
                                <td align="left"><apex:outputField id="OrderStatus_out2" value="{!coc.SummonsStatus_c__c}" style="width:300px"/></td>
                            </tr>
                            <tr>
                                <td align="right">目的:</td>
                                <td align="left"><apex:outputField id="OrderDirction_out2"  value="{!coc.SummonsForDirction__c}" style="width:300px"/></td>
                                <td align="right">开票状态:</td>
                                <td align="left">
                                <apex:outputField id="SecondDealer_level22" value="{!coc.Billed_Status__c}" style="width:300px"/>
                                </td>
 
                            </tr>
                            <tr style="{!IF(coc.SummonsForDirction__c='销售给二级经销商','','display:none')}">
                                <td align="right">二级经销商:</td>
                                <td align="left"><apex:outputField id="SecondDealer_out2" value="{!coc.Order_Dealer_Info__c}" style="width:300px"/></td>
                                <td align="right"></td>
                                <td align="left"></td>
                            </tr>
                            <tr>
                                <td align="right">客户名:</td>
                                <td align="left"><apex:outputField id="OrderForHospital_out2" value="{!coc.ShipmentAccount__c}" style="width:300px"/></td>
                                <td align="right"><apex:outputText value="发票:" rendered="{!IF(coc.SummonsStatus_c__c='已完成' && coc.SummonsForDirction__c!='互相调货',true,false)}"/></td>
                                <td align="left"><apex:inputField value="{!coc.ConInvoice_Code__c}" rendered="{!IF(coc.SummonsStatus_c__c='已完成' && coc.SummonsForDirction__c!='互相调货',true,false)}" id="ConInvoice_Code2"/>
                                <c:helpicon helpText="已开票的换货的时候,选择已开票的发票。" rendered="{!IF(coc.SummonsStatus_c__c='已完成' && coc.SummonsForDirction__c!='互相调货',true,false)}"/>
                                </td>
                            </tr>
                            <tr>
                                <td align="right">科室:</td>
                                <td align="left">
                                    <apex:outputField id="Order_ForDealerText2" value="{!coc.Order_ForCustomerText__c}" style="width:170px"/>
                                </td>
                                <td align="right">出库金额:</td>
                                <td align="left"><apex:outputField id="sumPrice_buttom2" value="{!coc.Shipment_total_amount__c}" style="width:300px"/> 元</td>
                            </tr>
                            <tr>
                                <td align="right">没有确定价格:</td>
                                <td align="left">
                                    <apex:inputCheckbox id="NoConfirmedPrice_out2" value="{!coc.NoConfirmedPrice__c}" disabled="true" />
                                </td>
 
                                <!-- ===add by rentx 2020-12-04 start -->
                                <!-- <apex:detail rendered="{!agencyProType == 'ENG'}"> -->
                                    <!-- <td align="right">是否医院特价出库 : </td> -->
                                    <!-- <td align="left"> -->
                                        <apex:inputHidden id="OutPattern02" value="{!coc.OutPattern__c}"  />
                                        <!-- <apex:outputField id="OutPattern02" value="{!coc.OutPattern__c}"  /> -->
                                        <!-- <apex:inputCheckbox id="OutPattern02" value="{!coc.OutPattern__c}" disabled="true"  /> -->
 
                                        <!-- <apex:inputField id="OutPattern" value="{!coc.DeliveryMode__c}" style="width:160px"/> -->
                                    <!-- </td> -->
                                <!-- </apex:detail> -->
                                <!-- ===add by rentx 2020-12-04 end -->
                            </tr>
                        </table>
                            </apex:outputPanel>
                        <apex:outputPanel rendered="{! If(coc.SummonsStatus_c__c != '价格未定',true,false) }">
                        <table>
                        <colgroup>
                            <col width="150px"/>
                            <col width="300px"/>
                            <col width="150px"/>
                            <col width="300px"/>
                            <col width="80px"/>
                            <col width="10px"/>
                            <col width="90px"/>
                            <col width="100px"/>
                            <col width="10px"/>
                            <col width="85px"/>
                            <col width="100px"/>
                            <col width="10px"/>
                            <col width="70px"/>
                            <col width="100px"/>
                        </colgroup>
                            <tr id = "SummonsFlag" style="visibility:{!SummonsFlag}">
                                <td align="right">出库单号:</td>
                                <td align="left"><apex:outputField id="OrderCode"  value="{!coc.Name}" style="width:100px"/></td>
                                <td align="right">出库单状态:</td>
                                <td align="left"><apex:outputField id="SummonsStatus_c__c" value="{!coc.SummonsStatus_c__c}" style="width:100px"/></td>
                            </tr>
                            <tr>
                                <td align="right">目的:</td>
                                <td align="left"><div style="width:3px;height:20px;background-color:red; position:absolute;margin-right:5px;"></div>
                                <apex:inputField onchange="ChangeDirction(this)" id="SummonsForDirction__c" value="{!coc.SummonsForDirction__c}" style="width:160px"/></td>
                                <td align="right">二级经销商:</td>
                                <td align="left">
                                <apex:selectList id="province" value="{!SecondDealer}" style="width:160px" size="1" >
                                    <apex:selectOptions value="{!provinceOpts}"/>
                                </apex:selectList>
                                </td>
                            </tr>
                            <tr>
                                <td align="right">客户名:</td>
                                <td align="left">
                                    <apex:inputText id="OEC" value="{!HospitalName}" onclick="searchsearchAgencyH('{!agencyProType}'); return false;" onblur="clearAgencyI();return false;" style="width:155px"  />
                                    <apex:inputHidden value="{!HospitalInfo}" id="OECId" />
                                </td>
                                <td align="right">经销商(录入):</td>
                                <td align="left">
                                    <apex:inputField id="Order_ForDealerText" value="{!coc.Order_ForDealerText__c}" onfocus="setVisitorPlace();" style="width:155px" onblur="if (j$(escapeVfId('allPage:allForm:allBlock:Editable:SummonsForDirction__c')).value() == '互相调货'){vpClear2_delay();}"/>
<!--                                    <apex:inputField id="Order_ForDealerText" value="{!coc.Order_ForDealerText__c}"  style="width:155px" onblur="if (j$(escapeVfId('allPage:allForm:allBlock:Editable:SummonsForDirction__c')).value() == '互相调货'){vpClear2_delay();}"/>-->
                                    <apex:inputHidden id="Order_ForDealerTextHidden" value="{!coc.Order_ForDealerText__c}" />
                                    <apex:inputHidden id="Order_ForDealerTextId" value="{!coc.Order_ForDealerTextID__c}" />
                                    <apex:inputHidden id="Order_ForDealerTextHiddenId" value="{!coc.Order_ForDealerTextID__c}" />
                                </td>
                            </tr>
                            <tr>
                                <td align="right">科室:</td>
                                <td align="left">
                                    <apex:inputField id="Order_ForCustomer" value="{!coc.Order_ForCustomerText__c}" style="width:155px"/>
                                </td>
                                <td align="right">总金额:</td>
                                <td align="left"><apex:outputText id="sumPrice_buttom" value="{!sumPrice}"/> 元</td>
                            </tr>
                            <tr>
                                <td align="right">没有确定价格:</td>
                                <td align="left">
                                    <apex:inputCheckbox id="NoConfirmedPrice" value="{!coc.NoConfirmedPrice__c}" />
                                </td>
 
                                <!-- ===add by rentx 2020-12-04 start 因为目前维护了特价产品的医院都是ENG医院,所以只有ENG的时候展示 是否医院特价出库 即可-->
                                <!-- <apex:detail rendered="{!agencyProType == 'ENG'}"> -->
                                    <!-- <td align="right" >是否医院特价出库 : </td> -->
                                    <!-- <td align="left"> -->
                                        <!-- <apex:outputField id="OutPattern01" value="{!coc.OutPattern__c}" /> -->
                                        <apex:inputHidden id="OutPattern01" value="{!coc.OutPattern__c}" />
 
                                    <!-- </td> -->
                                <!-- </apex:detail> -->
                                <!-- ===add by rentx 2020-12-04 end -->
 
                            </tr>
                        </table>
                        </apex:outputPanel>
 
                    <!-- <tr id = "SummonsFlag" style="visibility:{!SummonsFlag}">
                            <td align="right">出库单号:</td>
                            <td align="left"><apex:outputField id="OrderCode"  value="{!coc.Name}" style="width:100px"/></td>
                            <td align="right">出库单状态:</td>
                            <td align="left"><apex:outputField id="SummonsStatus_c__c" value="{!coc.SummonsStatus_c__c}" style="width:100px"/></td>
                        </tr>
                        <tr>
                            <td align="right">目的:</td>
                            <td align="left"><div style="width:3px;height:20px;background-color:red; position:absolute;margin-right:5px;"></div>
                            <apex:inputField onchange="ChangeDirction(this)" id="SummonsForDirction__c" value="{!coc.SummonsForDirction__c}" style="width:160px"/></td>
                            <td align="right">二级经销商:</td>
                            <td align="left">
                            <apex:selectList id="province" value="{!SecondDealer}" style="width:160px" size="1" >
                                <apex:selectOptions value="{!provinceOpts}"/>
                            </apex:selectList>
                            </td>
                        </tr>
                        <tr>
                            <td align="right">客户名:</td>
                            <td align="left">
                                <apex:inputText id="OEC" value="{!HospitalName}" onclick="searchsearchAgencyH('{!agencyProType}'); return false;" onblur="clearAgencyI();return false;" style="width:155px"/>
                                <apex:inputHidden value="{!HospitalInfo}" id="OECId"/>
                            </td>
                            <td align="right">经销商(录入):</td>
                            <td align="left">
                                <apex:inputField id="Order_ForDealerText" value="{!coc.Order_ForDealerText__c}" onfocus="setVisitorPlace();" style="width:155px" onblur="if (j$(escapeVfId('allPage:allForm:allBlock:Editable:SummonsForDirction__c')).value() == '互相调货'){vpClear2_delay();}"/>
                                <apex:inputHidden id="Order_ForDealerTextHidden" value="{!coc.Order_ForDealerText__c}" />
                                <apex:inputHidden id="Order_ForDealerTextId" value="{!coc.Order_ForDealerTextID__c}" />
                                <apex:inputHidden id="Order_ForDealerTextHiddenId" value="{!coc.Order_ForDealerTextID__c}" />
                            </td>
                        </tr>
                        <tr>
                            <td align="right">科室:</td>
                            <td align="left">
                                <apex:inputField id="Order_ForCustomer" value="{!coc.Order_ForCustomerText__c}" style="width:155px"/>
                            </td>
                            <td align="right">总金额:</td>
                            <td align="left"><apex:outputText id="sumPrice_buttom" value="{!sumPrice}"/> 元</td>
 
                           <td align="right" style="visibility:hidden">出库单日期</td>
                            <td align="right" style="visibility:hidden"><apex:inputField rendered="false" id="OrderDate" value="{!coc.Order_date__c}" style="width:100px"/></td>
                        </tr>
 
                    </table> -->
                    <!-- update end by vivek2019-7-12 -->
                </apex:pageBlock>
<!--==============20160314====INSERT_CODE_START=======================================-->
                 <apex:pageBlock title="出库单信息" id="unEditable" rendered="{!!EditAble}">
                    <table>
                        <colgroup>
                            <col width="150px"/>
                            <col width="300px"/>
                            <col width="150px"/>
                            <col width="300px"/>
                            <col width="100px"/>
                            <col width="70px"/>
                            <col width="90px"/>
                            <col width="100px"/>
                            <col width="10px"/>
                            <col width="85px"/>
                            <col width="100px"/>
                            <col width="10px"/>
                            <col width="70px"/>
                            <col width="100px"/>
                        </colgroup>
                        <tr>
                            <td align="right">出库单号:</td>
                            <td align="left"><apex:outputField id="OrderCode_out"  value="{!coc.Name}" style="width:300px"/></td>
                            <td align="right">出库单状态:</td>
                            <td align="left"><apex:outputField id="OrderStatus_out" value="{!coc.SummonsStatus_c__c}" style="width:300px"/></td>
                        </tr>
                        <tr>
                            <td align="right">目的:</td>
                            <td align="left"><apex:outputField id="OrderDirction_out"  value="{!coc.SummonsForDirction__c}" style="width:300px"/></td>
                            <td align="right">开票状态:</td>
                            <td align="left">
                            <apex:outputField id="SecondDealer_level2" value="{!coc.Billed_Status__c}" style="width:300px"/>
                            </td>
 
                        </tr>
                        <tr style="{!IF(coc.SummonsForDirction__c='销售给二级经销商','','display:none')}">
                            <td align="right">二级经销商:</td>
                            <td align="left"><apex:outputField id="SecondDealer_out" value="{!coc.Order_Dealer_Info__c}" style="width:300px"/></td>
                            <td align="right"></td>
                            <td align="left"></td>
                        </tr>
                        <tr>
                            <td align="right">客户名:</td>
                            <td align="left"><apex:outputField id="OrderForHospital_out" value="{!coc.ShipmentAccount__c}" style="width:300px"/></td>
                            <td align="right"><apex:outputText value="发票:" rendered="{!IF(coc.SummonsStatus_c__c='已完成' && coc.SummonsForDirction__c!='互相调货',true,false)}"/></td>
                            <td align="left"><apex:inputField value="{!coc.ConInvoice_Code__c}" rendered="{!IF(coc.SummonsStatus_c__c='已完成' && coc.SummonsForDirction__c!='互相调货',true,false)}" id="ConInvoice_Code"/>
                            <c:helpicon helpText="已开票的换货的时候,选择已开票的发票。" rendered="{!IF(coc.SummonsStatus_c__c='已完成' && coc.SummonsForDirction__c!='互相调货',true,false)}"/>
                            </td>
                        </tr>
                        <tr>
                            <td align="right">科室:</td>
                            <td align="left">
                                <apex:outputField id="Order_ForDealerText" value="{!coc.Order_ForCustomerText__c}" style="width:170px"/>
                            </td>
                            <td align="right">出库金额:</td>
                            <td align="left"><apex:outputField id="sumPrice_buttom" value="{!coc.Shipment_total_amount__c}" style="width:300px"/> 元</td>
                        <!--    <td/>
 
                            <td align="right" style="visibility:hidden">出库单日期:</td>
                            <td align="right" style="visibility:hidden"><apex:outputField id="OrderDate_out" value="{!coc.Order_date__c}" style="width:300px"/></td> -->
 
                        </tr>
                        <!-- update start by vivek2019-7-12 -->
                        <tr>
                            <td align="right">没有确定价格:</td>
                            <td align="left">
                                <apex:inputCheckbox id="NoConfirmedPrice_out" value="{!coc.NoConfirmedPrice__c}" disabled="true" />
                            </td>
 
                            <!-- ===add by rentx 2020-12-04 start -->
                            <!-- <apex:detail rendered="{!agencyProType == 'ENG'}"> -->
                                <!-- <td align="right">是否医院特价出库 : </td> -->
                                <!-- <td align="left"> -->
                                    <!-- <apex:outputField id="OutPattern" value="{!coc.OutPattern__c}"/> -->
                                    <apex:inputHidden id="OutPattern" value="{!coc.OutPattern__c}"/>
                                <!-- </td> -->
                            <!-- </apex:detail> -->
                            <!-- ===add by rentx 2020-12-04 end -->
                        </tr>
                        <!-- update end by vivek2019-7-12 -->
                    </table>
                </apex:pageBlock>
<!--==============20160314====INSERT_CODE_END=======================================-->
 
<!--==============20160310====到货联动时不需要检索====================================-->
                <!-- update start by vivek 2019-7-15 -->
                <apex:pageBlock id="searchBlock" rendered="{!IF(!Existarrive && EditAble && coc.SummonsStatus_c__c != '价格未定',true,false)}">
                <!-- apex:pageBlock id="searchBlock" rendered="{!IF(!Existarrive && EditAble,true,false)}"> -->
                <!-- update end by vivek 2019-7-15 -->
                    <table>
                        <colgroup>
                            <col width="160px"/>
                            <col width="200"/>
                            <col width="15px"/>
                            <col width="120px"/>
                            <col width="200px"/>
                            <col width="20px"/>
                            <col width="120px"/>
                            <col width="200px"/>
                            <col width="20px"/>
                            <col width="120px"/>
                            <col width="200px"/>
                            <col width="20px"/>
                            <col width="90px"/>
                            <col width="100px"/>
                            <col width="10px"/>
                            <col width="85px"/>
                            <col width="100px"/>
                            <col width="10px"/>
                            <col width="70px"/>
                            <col width="100px"/>
                        </colgroup>
                        <tr>
                            <td align="right">消耗品名称</td>
                            <td><apex:inputText id="OrderDateSearch" value="{!category1}" style="width:100px"/></td>
                            <td/>
                            <td align="right">第3分类</td>
                            <td>
                             <apex:selectList id="category3Search" value="{!category3}" style="width:100px" size="1" onchange="showAllCate();">
                                <apex:selectOptions value="{!categoryOptionList}"/>
                            </apex:selectList>
                            </td>
                            <td/>
                             <td align="right">第4分类</td>
                            <td>
                             <apex:selectList id="category4Search" value="{!category4}" style="width:100px" size="1" onchange="showCate();">
                                <apex:selectOptions value="{!category4OptionList}"/>
                            </apex:selectList>
                            </td>
                            <td/>
                             <td align="right">第5分类</td>
                             <td>
                             <apex:selectList id="category5Search" value="{!category5}" style="width:100px" size="1">
                                <apex:selectOptions value="{!category5OptionList}"/>
                            </apex:selectList>
                            </td>
                            <td/>
                            <!-- //add by rentx start -->
                            <apex:detail rendered="{!hasHosPro}">
                                <td align="right" width="120px">医院特价</td>
                                 <td>
                                 <apex:selectList id="outOutPattern" value="{!outOutPattern}" style="width:100px" size="1">
                                    <apex:selectOptions value="{!outOutPatternOptionList}"/>
                                </apex:selectList>
                                </td>
                                </apex:detail>
                            <td/>
                            <!-- //add by rentx end -->
 
                            <!-- <td align="right">产品型号</td>
                            <td><apex:inputText id="OrderCodeSearch" value="{!category_Goods}" style="width:100px"/></td> -->
                            <td align="right"></td>
                            <td><apex:commandButton value="检索" style="width: 100px;" onclick="searchProductJs(); return false;" /></td>
                            <td><input type="button" value="清空" style="width: 100px;" onclick="ClearJs()" class="btn"/></td>
                            <td/>
                        </tr>
                        <tr>
                            <td></td>
                        </tr>
                    </table>
                </apex:pageBlock>
                <div id="ErrorName" style="color: red;font-weight: bold;">{!alertMessage}</div>
                <apex:pageBlock title="出库单明细" id="ConsumableorderdetailsSection">
                    <!--<apex:inputHidden id="consumableorderdetailsCnt" value="{!consumableorderdetailsCount}"/>-->
                    <input type="hidden" id="allPage:allForm:allBlock:ConsumableorderdetailsSection:consumableorderdetailsCount" value="{!consumableorderdetailsCount}" />
                    <table class="list" border="0" cellpadding="0" cellspacing="0" id="ConsumableorderdetailsTable">
                         <tr class="headerRow">
                            <!-- update start by vivek 2019-7-15 -->
                            <apex:variable var="v" value="" rendered="{!IF(!Existarrive && EditAble && coc.SummonsStatus_c__c != '价格未定',true,false)}">
                            <!-- <apex:variable var="v" value="" rendered="{!IF(!Existarrive && EditAble,true,false)}"> -->
                            <!-- update start by vivek 2019-7-15 -->
                                <th><input type='checkbox' onClick='checkAll()' id='checker'/>选择</th>
                            </apex:variable>
                            <th><a href="#" onclick="SortLimitedJs('0');return false;" style="text-decoration: underline;">消耗品名称</a>{!sortOrder[0]}</th>
                        <!--    <th><a href="#" onclick="SortLimitedJs('1');return false;" style="text-decoration: underline;">产品型号</a>{!sortOrder[1]}</th>-->
 
                            <!-- TODO 本番暂不显示 -->
                            <apex:variable var="v" value="">
                            <th style="width: 80px;text-align:center;">规格</th>
                            </apex:variable>
                            <th>CFDA状态</th>
                            <th>注册证编码号</th>
                            <th>注册证效期</th>
 
                            <apex:variable var="v" value="" rendered="{!IF(arriveorder ='' && Existarrive = false && EditAble,true,false)}">
                             <th><a href="#" onclick="SortLimitedJs('5');return false;" style="text-decoration: underline;">第3分类</a>{!sortOrder[5]}</th>
                            <th><a href="#" onclick="SortLimitedJs('6');return false;" style="text-decoration: underline;">第4分类</a>{!sortOrder[6]}</th>
                            <th><a href="#" onclick="SortLimitedJs('7');return false;" style="text-decoration: underline;">第5分类</a>{!sortOrder[7]}</th>
                            </apex:variable>
                            <th>单位</th>
                            <th>出货数量</th>
 
                            <th>出货单价(元)</th>
                            <!-- <th>二级经销商给客户单价</th> -->
                            <!--<apex:variable var="v" value="" rendered="{!NOT(IF(arriveorder ='' && Existarrive = false && EditAble,true,false))}">
                                <th>单位</th>
                                <th>出货数量</th>
                            </apex:variable>
                             <apex:variable var="v" value="" rendered="{!!EditAble}">
                                <th>二级经销商给客户单价</th>
                                <th>出货单价(元)</th>
                            </apex:variable>-->
 
                            <apex:variable var="v" value="" rendered="{!NOT(IF(arriveorder ='' && Existarrive = false && EditAble,true,false))}" id="BoxPiece_UnEditout">
                            </apex:variable>
                            <apex:variable var="v" value="" rendered="{!if(EditAble,true,false)}">
                            <th>出货金额(元)</th>
                            <!--<th><a href="#" onclick="SortStoreJs('3');return false;" style="text-decoration: underline;width: 100px;text-align: center;">有效期内库存</a>{!sortOrder[3]}</th>-->
                            <th>有效期内库存(盒)</th>
                            <th>有效期内库存(个)</th>
                            </apex:variable>
 
                            <apex:variable var="v" value="" rendered="{!!EditAble}">
                                <th>{!$ObjectType.Consumable_Orderdetails__c.fields.InvoiceProNot_count__c.label}</th>
                            </apex:variable>
                            <apex:variable var="v" value="" rendered="{!!EditAble}">
                                <th>{!$ObjectType.Consumable_Orderdetails__c.fields.RrturnPro_count__c.label}</th>
                            </apex:variable>
                            <apex:variable var="v" value="" rendered="{!!EditAble}">
                                <th>{!$ObjectType.Consumable_Orderdetails__c.fields.Invoiced_Procount__c.label}</th>
                            </apex:variable>
 
                            <!-- //add by rentx 2020-11-27 start -->
                            <apex:detail rendered="{!hasHosPro}">
                                <th>医院特价</th>
                            </apex:detail>
                            <!-- //add by rentx 2020-11-27 end -->
                        </tr>
                        <apex:repeat value="{!pageRecords}" var="records" id="ConsumableorderdetailsTable">
                            <tr class="dataRow">
                                <!-- update start by vivek 2019-7-15 -->
                                <!-- <apex:variable var="v" value="" rendered="{!IF(!Existarrive && EditAble,true,false)}" id="variableinfo"> -->
                                <apex:variable var="v" value="" rendered="{!IF(!Existarrive && EditAble && coc.SummonsStatus_c__c != '价格未定',true,false)}" id="variableinfo">
                                <!-- update end by vivek 2019-7-15 -->
                                    <td>
                                    <apex:inputCheckbox value="{!records.check}" id="consumablesCountproRowCheckbox" disabled="{!!records.canSelect}"/>
                                     <apex:inputCheckbox value="{!records.oldCheck}" id="proRowOldCheckbox" style="display:none"/></td>
                                 </apex:variable>
                                <td class="dataCell">
                                    <apex:outputText id="ProductName" value="{!IF(records.oldCheck=false,records.Prod.Name__c,records.orderdetails1.Consumable_Product__r.Name__c)}"/>
                                </td>
                            <!--    <td>{!records.Prod.Asset_Model_No__c}</td>
                                 -->
                                <td style="width: 80px;text-align:center;">{!records.packinglist}</td>
                                <td class="dataCell">{!records.Prod.SFDA_Status__c}</td>
                                <td class="dataCell">{!records.approbation_No}</td>
                                <td class="dataCell">
                                    <apex:outputText value="{0, date, yyyy/MM/dd}">
                                        <apex:param value="{!records.expiration_Date}" />
                                    </apex:outputText>
                                </td>
                                <apex:variable var="v" value="" rendered="{!IF(arriveorder ='' && Existarrive = false && EditAble,true,false)}" id="variableCategory3">
                                 <td class="dataCell">{!records.Prod.Category3__c}</td>
                                 <td class="dataCell">{!records.Prod.Category4__c}</td>
                                 <td class="dataCell">{!records.Prod.Category5__c}</td>
                                <!-- update start by vivek 2019-7-15 -->
                                <apex:variable var="v" value="" rendered="{!IF(arriveorder ='' && Existarrive = false && EditAble && coc.SummonsStatus_c__c != '价格未定',true,false)}" id="BoxPiece_UnEditout1">
                                 <td class="dataCell">
                                    <apex:selectList value="{!records.orderdetails1.Box_Piece__c}" size="1" style="width:60px;" id="BoxPiece">
                                    <apex:selectOptions value="{!records.boxorpiece}"/>
                                    </apex:selectList>
                                </td>
                                </apex:variable>
                                <!-- update end by vivek 2019-7-15 -->
                                 </apex:variable>
 
                                <!-- update start by vivek 2019-7-15 -->
                                <apex:variable var="v" value="" rendered="{!NOT(IF(arriveorder ='' && Existarrive = false && EditAble && coc.SummonsStatus_c__c != '价格未定',true,false))}" id="BoxPiece_UnEditout1">
                                <!-- <apex:variable var="v" value="" rendered="{!NOT(IF(arriveorder ='' && Existarrive = false && EditAble,true,false))}" id="BoxPiece_UnEditout"> -->
                                <!-- update end by vivek 2019-7-15 -->
                                <td><apex:outputField id="BoxPiece_UnEditin" value="{!records.orderdetails1.Box_Piece__c}"/></td>
                                </apex:variable>
                                <!-- update start by vivek 2019-7-15 -->
                                <apex:variable var="v" value="" rendered="{!NOT(IF(arriveorder ='' && Existarrive = false && EditAble && coc.SummonsStatus_c__c != '价格未定',true,false))}" id="consumablesCount_UnEditout">
                                <!-- <apex:variable var="v" value="" rendered="{!NOT(IF(arriveorder ='' && Existarrive = false && EditAble,true,false))}" id="consumablesCount_UnEditout"> -->
                                <!-- update start by vivek 2019-7-15 -->
                                <!--<td style="text-align:right;"><apex:outputField id="consumablesCount_Unagency" value="{!records.orderdetails1.Unitprice_To_agency__c}"/></td>-->
                                <td style="text-align:center;"><apex:outputField id="consumablesCount_UnEditin" value="{!records.orderdetails1.Shipment_Count__c}"/></td>
                                </apex:variable>
                                <!-- update start by vivek 2019-7-15 -->
                                <apex:variable var="v" value="" rendered="{!IF(arriveorder ='' && Existarrive = false && EditAble && coc.SummonsStatus_c__c != '价格未定',true,false)}" id="variable">
                                 <!-- <apex:variable var="v" value="" rendered="{!IF(arriveorder ='' && Existarrive = false && EditAble,true,false)}" id="variable"> -->
                                <!-- update end by vivek 2019-7-15 -->
                                <td class="dataCell">
                                    <div style="width:2px;height:20px;background-color:red; position:absolute;margin-right:5px;"></div>
                                    <apex:inputField onblur="ComputePrice(this)" id="consumablesCount" value="{!records.orderdetails1.Shipment_Count__c}" style="width: 100px;" /></td>
                                 </apex:variable>
                                <apex:variable var="v" value="" rendered="{!EditAble}" id="variableMoneyinfo">
                                    <td class="dataCell">
                                    <div style="width:2px;height:20px;background-color:red; position:absolute;margin-right:5px;"></div>
                                    <apex:inputField onblur="ComputePriceCheck(this)" value="{!records.orderdetails1.Delivery_List_RMB__c}" style="width: 100px;" id="productOrderMoneyinfo"/>
                                    </td>
                                    <!-- <td class="dataCell">
                                    <apex:inputField id="Unitpriceagency" value="{!records.orderdetails1.Unitprice_To_agency__c}"  style="width: 100px;"/>
                                    </td> -->
                                </apex:variable>
                                <apex:variable var="v" value="" rendered="{!!EditAble}">
                                    <td class="dataCell" style="text-align:center;">
                                    <apex:outputText id="consumablesCountDealerPrice_Unedit" value="{!IF(records.orderdetails1.Delivery_List_RMB__c==null,0.00,records.orderdetails1.Delivery_List_RMB__c)}"/>
                                    </td>
                                    <!-- <td style="text-align:center;"><apex:outputField id="consumablesCount_Unagency" value="{!records.orderdetails1.Unitprice_To_agency__c}"/></td> -->
                                </apex:variable>
 
                                <apex:variable var="v" value="" id="variableAllprice" rendered="{!EditAble}">
                                <td class="dataCell" style="text-align:center;">
                                    <apex:outputField id="consumablesCounttestPrice" value="{!records.orderdetails1.Shipment_amount__c}"/>
                                </td>
                                <!--<td class="dataCell" style="text-align:right;width: 50px;">{!records.allnumber}</td>-->
                                <td class="dataCell" style="text-align:center;width: 50px;">{!records.Boxnumber}</td>
                                <td class="dataCell" style="text-align:center;width: 50px;">{!records.Piecenumber}</td>
                                </apex:variable>
                                <apex:variable var="v" value="" rendered="{!!EditAble}">
                                    <td class="dataCell" style="text-align:center;"><apex:outputField value="{!records.orderdetails1.InvoiceProNot_count__c}"/></td>
                                    <td class="dataCell" style="text-align:center;"><apex:outputField value="{!records.orderdetails1.RrturnPro_count__c}"/></td>
                                    <td class="dataCell" style="text-align:center;"><apex:outputField value="{!records.orderdetails1.Invoiced_Procount__c}"/></td>
                                </apex:variable>
                                    <!-- add by rentx 2020-11-26 start -->
                                <apex:detail rendered="{!hasHosPro}" >
                                    <td>
                                        <!-- <apex:outputField value="{!records.orderdetails2.hospitalSpecialOffer__c}"/> -->
                                        <apex:detail rendered="{!records.hospitalSpecialOffer}" >
                                            <apex:inputHidden value="{!records.hospitalSpecialOffer}"  id="hosOffer"/>
                                            <apex:inputHidden value="{!records.hosPro}"  id="hosPro"/>
                                            √
                                        </apex:detail>
                                    </td>
                                </apex:detail>
                            <!-- add by rentx 2020-11-26 end -->
                            </tr>
                        </apex:repeat>
                    </table>
                    <table style="width: 100%">
                         <tr>
                            <td>
                                <!-- Page X of Y -->
                                <!-- PageNumber:当前页面所在位置,ResultSize:记录总条数,PageSize:每页记录条数 -->
                                <apex:outputText value="{!(setCon.pageNumber * size)+1-size}-{!IF((setCon.pageNumber * size)>noOfRecords, noOfRecords,
                                 (setCon.pageNumber * size))} 共 {!noOfRecords} 个" />
                                 <!--<apex:outputPanel >
                                    <apex:actionStatus id="fetchStatus" >
                                        <apex:facet name="start" >
                                          <img src="/img/loading.gif" />
                                        </apex:facet>
                                    </apex:actionStatus>
                                </apex:outputPanel>-->
                            </td>
                            <td align="center">
                                <div class="paginator line1">
                                <span class="prevNextLinks">
                                <!-- 有连接 -->
                                <apex:outputPanel rendered="{!setCon.hasPrevious}">
                                <span class="prevNext">
                                <apex:commandLink status="fetchStatus" reRender="ConsumableorderdetailsSection" action="{!setCon.first}" oncomplete="refreshPageSizeJs();" title="首页" >
                                <img src="/s.gif" title="首页" alt="首页" class="{!if((setCon.hasPrevious),'first','firstoff')}"/>
                                </apex:commandLink>
                                </span>
                                <span class="prevNext">
                                <apex:commandLink status="fetchStatus" reRender="ConsumableorderdetailsSection"  action="{!setCon.previous}" oncomplete="refreshPageSizeJs();"  title="上一页">
                                <img src="/s.gif" title="上一页" alt="上一页" class="{!if((setCon.hasPrevious),'prev','prevoff')}"/>上一页
                                </apex:commandLink>
                                </span>
                                </apex:outputPanel>
                                <!-- 无连接 -->
                                <apex:outputPanel rendered="{!!setCon.hasPrevious}">
                                <span class="prevNext">
                                <apex:commandLink status="fetchStatus" oncomplete="onLoadDirction();" reRender="ConsumableorderdetailsSection" title="首页" >
                                <img src="/s.gif" title="首页" alt="首页" class="{!if((setCon.hasPrevious),'first','firstoff')}"/>
                                </apex:commandLink>
                                </span>
                                <span class="prevNext">
                                <apex:commandLink status="fetchStatus" oncomplete="onLoadDirction();" reRender="ConsumableorderdetailsSection"  title="上一页">
                                <img src="/s.gif" title="上一页" alt="上一页" class="{!if((setCon.hasPrevious),'prev','prevoff')}"/>上一页
                                </apex:commandLink>
                                </span>
                                </apex:outputPanel>
                                <!-- 有连接 -->
                                <apex:outputPanel rendered="{!setCon.hasNext}">
                                <span class="prevNext" rendered = "{!!setCon.hasNext}">
                                <apex:commandLink status="fetchStatus" reRender="ConsumableorderdetailsSection" action="{!setCon.next}" oncomplete="refreshPageSizeJs();" title="下一页" rendered="{!setCon.hasNext}">下一页
                                <img src="/s.gif" title="下一页" alt="下一页" class="{!if((setCon.hasNext),'next','nextoff')}" />
                                </apex:commandLink>
                                </span>
                                <span class="prevNext">
                                <apex:commandLink status="fetchStatus" reRender="ConsumableorderdetailsSection" action="{!setCon.last}"  oncomplete="refreshPageSizeJs();" title="尾页">
                                <img src="/s.gif" title="尾页" alt="尾页" class="{!if((setCon.hasNext),'last','lastoff')}"/>
                                </apex:commandLink>
                                </span>
                                </apex:outputPanel>
                                <!-- 无连接 -->
                                <apex:outputPanel rendered="{!!setCon.hasNext}">
                                <span class="prevNext" rendered = "{!setCon.hasNext}">
                                <apex:commandLink status="fetchStatus" oncomplete="onLoadDirction();" reRender="ConsumableorderdetailsSection"  title="下一页">下一页
                                <img src="/s.gif" title="下一页" alt="下一页" class="{!if((setCon.hasNext),'next','nextoff')}" />
                                </apex:commandLink>
                                </span>
                                <span class="prevNext">
                                <apex:commandLink status="fetchStatus" oncomplete="onLoadDirction();" reRender="ConsumableorderdetailsSection" title="尾页">
                                <img src="/s.gif" title="尾页" alt="尾页" class="{!if((setCon.hasNext),'last','lastoff')}"/>
                                </apex:commandLink>
                                </span>
                                </apex:outputPanel>
                                </span>
                                </div>
                             </td>
                             <td align="right" width="20%">
                            </td>
                        </tr>
                    </table>
                    <!--
                    <div class="paginator line1">
                        <span class="prevNextLinks"><span class="prevNext"><apex:commandLink status="fetchStatus" reRender="ConsumableorderdetailsSection" action="{!setCon.first}" oncomplete="refreshPageSizeJs();" title="首页" rendered="{!!setCon.hasPrevious}"><img src="/s.gif" title="首页" alt="首页" class="first"/></apex:commandLink></span>
                        <span class="prevNext"><apex:commandLink status="fetchStatus" reRender="ConsumableorderdetailsSection"  action="{!setCon.previous}" oncomplete="refreshPageSizeJs();"  title="上一页"><img src="/s.gif" title="上一页" alt="上一页" class="prev"/>上一页</apex:commandLink></span>
                        <span class="prevNext"><apex:commandLink status="fetchStatus" reRender="ConsumableorderdetailsSection" action="{!setCon.next}" oncomplete="refreshPageSizeJs();" title="下一页">下一页<img src="/s.gif" title="下一页" alt="下一页" class="next"/></apex:commandLink></span>
                        <span class="prevNext"><apex:commandLink status="fetchStatus" reRender="ConsumableorderdetailsSection" action="{!setCon.last}"  oncomplete="refreshPageSizeJs();" title="尾页"><img src="/s.gif" title="尾页" alt="尾页" class="last"/></apex:commandLink></span></span>
                    </div>
                    <apex:panelGrid columns="8" styleClass="panelGridCenter">
                <apex:commandButton status="fetchStatus" reRender="ConsumableorderdetailsSection" value="首页" action="{!setCon.first}" oncomplete="refreshPageSizeJs();" disabled="{!!setCon.hasPrevious}" title="首页"/>
                <apex:commandButton status="fetchStatus" reRender="ConsumableorderdetailsSection" value="上一页" action="{!setCon.previous}" oncomplete="refreshPageSizeJs();"  disabled="{!!setCon.hasPrevious}" title="上一页"/>
 
                <apex:commandButton status="fetchStatus" reRender="ConsumableorderdetailsSection" value="下一页" action="{!setCon.next}" disabled="{!!setCon.hasNext}" oncomplete="refreshPageSizeJs();" title="下一页"/>
                <apex:commandButton status="fetchStatus" reRender="ConsumableorderdetailsSection" value="尾页" action="{!setCon.last}" disabled="{!!setCon.hasNext}" oncomplete="refreshPageSizeJs();" title="尾页"/>
                <apex:outputText >{!(setCon.pageNumber * size)+1-size}-{!IF((setCon.pageNumber * size)>noOfRecords, noOfRecords,
                     (setCon.pageNumber * size))} 共 {!noOfRecords} 个
                </apex:outputText>
                <apex:outputPanel >
                    <apex:actionStatus id="fetchStatus" >
                        <apex:facet name="start" >
                          <img src="/img/loading.gif" />
                        </apex:facet>
                    </apex:actionStatus>
                </apex:outputPanel>
 
            </apex:panelGrid>-->
                </apex:pageBlock>
 
                <apex:pageBlock title="发票明细" rendered="{!IF((coc.Billed_Status__c !='还没开票') && IdCheck != null,true,false)}">
                     <apex:pageblocksection columns="1" id="consumableInvoiceRecordsSection">
                        <apex:pageblocktable value="{!consumableInvoiceRecords}" var="records" id="consumableInvoiceRecordsTable">
                             <apex:column width="80">
                                 <apex:facet name="header">发票号</apex:facet>
                                 <apex:outputField value="{!records.Name}"/>
                             </apex:column>
                              <apex:column width="80">
                                 <apex:facet name="header">发票日</apex:facet>
                                 <apex:outputField value="{!records.Invoice_Date__c}"/>
                             </apex:column>
                             <apex:column width="80" style="text-align: center;">
                                 <apex:facet name="header">发票票面金额(元)</apex:facet>
                                 <apex:outputField value="{!records.Invoice_total_amount__c}"/>
                             </apex:column>
                             <apex:column width="80">
                                 <apex:facet name="header">发票状态</apex:facet>
                                 <apex:outputField value="{!records.Invoice_status__c}"/>
                             </apex:column>
                        </apex:pageblocktable>
                    </apex:pageblocksection>
                </apex:pageBlock>
 
                <apex:pageBlock title="出库产品明细" rendered="{!IF(consumableorderdetails2Count > 0,true,false)}">
                <apex:pageblocksection columns="1" id="Consumableorderdetails2Section">
                    <apex:pageblocktable value="{!consumableorderdetails2Records}" var="records" id="Consumableorderdetails2Table">
                         <apex:column width="80">
                             <apex:facet name="header">消耗品名称</apex:facet>
                             <apex:outputField value="{!records.Prod.name}"/>
                         </apex:column>
                          <apex:column width="80">
                             <apex:facet name="header">批次号</apex:facet>
                             <apex:outputField value="{!records.orderdetails2.SerialLotNo__c}" />
                         </apex:column>
                          <apex:column width="80">
                             <apex:facet name="header">管理编码</apex:facet>
                             <apex:outputField value="{!records.orderdetails2.TracingCode__c}"/>
                         </apex:column>
                          <apex:column width="80">
                             <apex:facet name="header">使用期限</apex:facet>
                             <apex:outputField value="{!records.orderdetails2.Sterilization_limit__c}"/>
                         </apex:column>
                        <!-- <apex:column width="80">
                             <apex:facet name="header">开票日</apex:facet>
                             <apex:outputField value="{!records.orderdetails2.Invoice_Date__c}" />
                         </apex:column>
                          <apex:column width="80">
                             <apex:facet name="header">发票号</apex:facet>
                             <apex:outputLink value="/ConInvoiceView?invoiceId={!records.orderdetails2.Invoice_No__c}" target="_blank">
                                <apex:outputText value="{!records.orderdetails2.Invoice_No__r.Name}" />
                             </apex:outputLink>
                         </apex:column> -->
                    </apex:pageblocktable>
                </apex:pageblocksection>
            </apex:pageBlock>
            </apex:pageBlock>
        </apex:outputPanel>
        <apex:pageBlock title="附件" id="ConsumableConsumeSection" rendered="{!!editAble}">
        <apex:pageBlockTable value="{!AttachmentRecoeds}" var="a" >
        <apex:column headerValue="标题" style="width: 33%">
        <apex:outputLink value="{!a.Concc.Id}" target="LINK_{!a.Concc.Id}">
            {!a.Concc.name}
        </apex:outputLink>
        </apex:column>
        <apex:column headerValue="创建人">
            <apex:outputField value="{!a.Concc.OwnerId}"/>
        </apex:column>
        </apex:pageBlockTable>
        <apex:pageBlockButtons location="top" >
            <apex:commandButton onclick="FilesUaplodJs();" value="上传附件" style="margin-left:30px;width:100px" rerender="dummy" rendered="{!!(EditDelCommitBtnDisabled||EditAble)}"/>
        </apex:pageBlockButtons>
    </apex:pageBlock>
    </apex:form>
<script>
 
</script>
</apex:page>