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
<apex:page Controller="ConsumableController" showHeader="true" tabStyle="ConsumableOrderManage__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)}"/>
<script>
//add by rentx 2020-11-17 start 失去焦点
function setFocusOnLoad() {}
function bodyOnLoad(){setFocusOnLoad();}
//add by rentx 2020-11-17 end 失去焦点
function searchContract(str){
    // alert('123');
    j$(escapeVfId('allPage:allForm:allBlock:searchBlock:OEC')).attr('readonly',true);
    openPopup('/customer/searchContract?Ctype=' + str, 'setsearch', 800, 600, 'width=900,height=600,scrollbars=yes,toolbar=no,status=no,directories=no,menubar=no,resizable=1', true);
}
//add by rentx 2020-11-24 start
function searchHospital(){
    j$(escapeVfId('allPage:allForm:allBlock:searchBlock:HOS')).attr('readonly',true);
    openPopup('/customer/searchHospital', 'setsearch', 800, 600, 'width=900,height=600,scrollbars=yes,toolbar=no,status=no,directories=no,menubar=no,resizable=1', true);
}
//add by rentx 2020-11-24 end
 
 
function ClearJs(){
    blockme();
    document.getElementById("allPage:allForm:allBlock:searchBlock:OrderDateSearch").value = "";
    document.getElementById("allPage:allForm:allBlock:searchBlock:category3Search").value = "";
    document.getElementById("allPage:allForm:allBlock:searchBlock:category4Search").value = "";
    document.getElementById("allPage:allForm:allBlock:searchBlock:category5Search").value = "";
    j$(escapeVfId('allPage:allForm:allBlock:searchBlock:SpecialCampaign')).attr('checked',false);
    searchConsumableorderdetails();
}
var selectedSize = 0;
var pageLimit = {!pageLimit};
function checkAll() {
    selectedSize = 0;
    var productCount = j$(escapeVfId('allPage:allForm:allBlock:ConsumableorderdetailsSection:ConsumableorderdetailsCount')).value();
    if (j$(escapeVfId('checker')).attr('checked') == 'checked') {
        //console.log(productCount);
        //var outer = 0;
        for (var i = 0; i < productCount; i++) {
            //outer = Math.floor(i / 1000);
            if(selectedSize >= pageLimit){
                window.alert("页面所选数据不能超过500条");
                return;
            }
            j$(escapeVfId('allPage:allForm:allBlock:ConsumableorderdetailsSection:ConsumableorderdetailsTable:' + i + ':variableinfo' + ':consumablesCountproRowCheckbox')).attr('checked',true);
            selectedSize ++;
            //alert(selectedSize);
        }
    } else {
        //var outer = 0;
        for (var i = 0; i < productCount; i++) {
            //outer = Math.floor(i / 1000);
            j$(escapeVfId('allPage:allForm:allBlock:ConsumableorderdetailsSection:ConsumableorderdetailsTable:' + i + ':variableinfo' + ':consumablesCountproRowCheckbox')).attr('checked',false);
            //selectedSize --;
        }
    }
}
 
function CheckSize(j){
    var a = j.id;
    var productCount = j$(escapeVfId(a)).attr('checked');
    if (productCount == 'checked') {
        if(selectedSize >= pageLimit){
            window.alert("页面所选数据不能超过500条");
            j$(escapeVfId(a)).attr('checked',false);
            return;
        }
        selectedSize ++;
    } else {
        selectedSize --;
    }
    //alert(selectedSize);
}
 
//正常排序
function ordrCopyJs(){
    blockme();
    ordrCopy();
}
 
//正常排序
function SortLimitedJs(key){
    blockme();
    SortLimited(key);
}
//库存排序
function SortStoreJs(key){
    blockme();
    SortStore(key);
}
 
//特价编辑
function OffersPriceJs(){
    blockme();
    OffersPrice();
}
function EditConsumable(){
    //解除不可写状态
    blockme();
    setEditAble();
    //alert("statusEdit"+'{!statusEdit}');
}
 
function backOrderJs(){
    //解除不可写状态
    blockme();
    backOrder();
    //alert("statusEdit"+'{!statusEdit}');
}
function DeleteConsumable(){
    //删除这一单
    if(window.confirm('删除是不可恢复的,你确认要删除吗?')){
        DelConsumable();
    }
}
 
function FilesUploadJs(){
    //上传文件
    FilesUpload();
}
 
function saveJs() {
    blockme();
    beforeSaveJs();
    save();
}
 
function beforeSaveJs() {
    var OffersPrice = j$(escapeVfId('allPage:allForm:allBlock:unEditable:sumPrice_buttom2')).value();
    j$(escapeVfId('allPage:allForm:allBlock:unEditable:theHiddenInput')).val(OffersPrice.replace(/,/g,""));
}
function getParagram(){
    //获取url参数
    var url = location.search; //获取url中"?"符后的字串
    var theRequest = new Object();
    if (url.indexOf("?") != -1) {
        var str = url.substr(1);
        strs = str.split("&");
        for(var i = 0; i < strs.length; i ++) {
            theRequest[strs[i].split("=")[0]]=unescape(strs[i].split("=")[1]);
            }
        }
    return theRequest;
}
//打印订单
function printConsumableJs(){
    window.open("/customer/PrintConsumblePDF?ESetid="+'{!URLENCODE(ESetId)}');
}
function SorderJs() {
    blockme();
    Sorder();
}
 
function searchProductJs() {
    blockme();
    var productCount = j$(escapeVfId('allPage:allForm:allBlock:ConsumableorderdetailsSection:ConsumableorderdetailsCount')).value();
    var isChanged = false;
    for (var i = 0; i < productCount; i++) {
        var nowChk = j$(escapeVfId('allPage:allForm:allBlock:ConsumableorderdetailsSection:ConsumableorderdetailsTable:' + i + ':sumablesCountproRowCheckbox')).attr('checked');
        var oldChk = j$(escapeVfId('allPage:allForm:allBlock:ConsumableorderdetailsSection:ConsumableorderdetailsTable:' + i + ':proRowOldCheckbox')).attr('checked');
        var consumablesCount= j$(escapeVfId('allPage:allForm:allBlock:ConsumableorderdetailsSection:ConsumableorderdetailsTable:' + i + ':consumablesCount')).value();
        var oldConsumableCount= j$(escapeVfId('allPage:allForm:allBlock:ConsumableorderdetailsSection:ConsumableorderdetailsTable:' + i + ':oldConsumableCount')).value();
        if (nowChk != oldChk || (nowChk == 'checked' && consumablesCount != oldConsumableCount)) {
            isChanged = true;
            break;
        }
    }
 
        searchConsumableorderdetails();
}
 
function searchHProductJs() {
    blockme();
    searchorderdetails();
    j$(escapeVfId("allPage:allForm:allBlock:searchBlock:HOSIds")).val('tempId');
}
function searchPProductJs() {
    blockme();
    searchorderdetails();
    j$(escapeVfId("allPage:allForm:allBlock:searchBlock:tempidPp")).val('tempId');
 
}
 
function setDisabled() {
    var productCount = j$(escapeVfId('allPage:allForm:allBlock:ConsumableorderdetailsSection:ConsumableorderdetailsCount')).value();
    for (var i = 0; i < productCount; i++) {
        var canselect = j$(escapeVfId('allPage:allForm:allBlock:ConsumableorderdetailsSection:ConsumableorderdetailsTable:' + i + ':canSelect')).value();
        if (canselect == 'false') {
            j$(escapeVfId('allPage:allForm:allBlock:ConsumableorderdetailsSection:ConsumableorderdetailsTable:' + i + ':shelfnumber')).attr('disabled',true);
        }
    }
}
 
function ComputePrice(j) {
    var z,x,c,v;
    var a = j.id;
    var i=a.substring(0,a.lastIndexOf(':'));
    z  =  parseFloat(j$(escapeVfId(i+':consumablesCount')).value());
    x  =  parseFloat(j$(escapeVfId(i+'allnumber:consumablesallnumber')).value());
    v  =  parseFloat(j$(escapeVfId(i+'in:consumablesinCount')).value());
    c  =  parseFloat(j$(escapeVfId(i+'low:consumablesinCountlow')).value());
    //z= z.replace(/,/g,'');;
    if(isNaN(z)){z=0.00;}
    if(z!=null&&z!=0&&z!=''){
    j$(escapeVfId(i+'info:consumablesCountproRowCheckbox')).attr('checked',true);
    }else{
    j$(escapeVfId(i+'info:consumablesCountproRowCheckbox')).attr('checked',false);
    }
    if (z + x > v){
        window.alert("该产品订购数量超出库存上限!");
    }
    if (z + x < c) {
        window.alert("该产品订购数量低于库存下限!");
    }
}
 
function calonLoad() {
}
 
function showCate() {
    //var productCount = j$(escapeVfId('allPage:allForm:allBlock:searchBlock:category3Search')).value();
    categoryload();
}
 
function showAllCate() {
    //var productCount = j$(escapeVfId('allPage:allForm:allBlock:searchBlock:category3Search')).value();
    categoryAllload();
}
function refreshPageSizeJs() {
    refreshPageSize();
}
window.sfdcPage.appendToOnloadQueue(function() { calonLoad() });
</script>
<style>
    .dateFormat  {
        display: none;
    }
    td.columuslowercolour {
        background-color:red;
        text-align: right;
    }
        td.columuscuperolour {
        background-color: yellow;
        text-align: right;
    }
</style>
    <apex:form id="allForm">
        <apex:actionFunction name="refreshPageSize" action="{!refreshPageSize}" reRender="ConsumableorderdetailsSection"/>
        <apex:actionFunction name="ordrCopy" action="{!ordrCopy}" rerender="editAble,ConsumableorderdetailsSection, message,editAble" onComplete="unblockUI();CheckStatusAfter()">
        </apex:actionFunction>
         <apex:actionFunction name="categoryAllload" action="{!categoryAllload}" rerender="searchBlock" onComplete="unblockUI();">
        </apex:actionFunction>
        <apex:actionFunction name="categoryload" action="{!categoryload}" rerender="searchBlock" onComplete="unblockUI();">
        </apex:actionFunction>
        <apex:actionFunction name="save" action="{!save}" rerender="editAble,ConsumableorderdetailsSection, message,editAble" onComplete="unblockUI();CheckStatusAfter();">
        </apex:actionFunction>
         <apex:actionFunction name="printConsumable" action="{!printConsumable}">
        </apex:actionFunction>
        <apex:actionFunction name="Sorder" action="{!Sorder}" rerender="ConsumableorderdetailsSection, message" onComplete="unblockUI();CheckStatusAfter();init();">
        </apex:actionFunction>
        <apex:actionFunction name="searchConsumableorderdetails" action="{!searchConsumableorderdetails}" rerender="ConsumableorderdetailsSection, message" onComplete="unblockUI();CheckStatusAfter();SumCompute()">
        </apex:actionFunction>
        <!-- add by rentx 2020-12-03  -->
        <apex:actionFunction name="searchorderdetails" action="{!searchorderdetails}" rerender="ConsumableorderdetailsSection, message" onComplete="unblockUI();CheckStatusAfter();SumCompute()">
        </apex:actionFunction>
        <!-- add by rentx 2020-12-03  -->
 
        <apex:actionFunction name="setEditAble" action="{!setEditAble}" rerender="ConsumableorderdetailsSection, message" onComplete="unblockUI();CheckStatusAfter()">
        </apex:actionFunction>
         <apex:actionFunction name="DelConsumable" action="{!DelConsumable}" rerender="ConsumableorderdetailsSection, message" onComplete="unblockUI();CheckStatusAfter()">
        </apex:actionFunction>
        <apex:actionFunction name="OffersPrice" action="{!OffersPrice}" rerender="EDCline_1,unEditable, message" onComplete="unblockUI();CheckStatusAfter()">
        </apex:actionFunction>
        <apex:actionFunction name="backOrder" action="{!backOrder}" rerender="ConsumableorderdetailsSection, message" onComplete="unblockUI();CheckStatusAfter()">
        </apex:actionFunction>
        <apex:actionFunction name="FilesUpload" action="{!FilesUpload}" rerender="ConsumableorderdetailsSection, message" onComplete="unblockUI();CheckStatusAfter()">
        </apex:actionFunction>
        <apex:actionFunction name="SortLimited" action="{!SortLimited}" rerender="ConsumableorderdetailsSection" onComplete="unblockUI();CheckStatusAfter();SumCompute()">
            <apex:param name="firstParam" assignTo="{!sortKey}" value="" />
        </apex:actionFunction>
       <apex:actionFunction name="SortStore" action="{!SortStore}" rerender="ConsumableorderdetailsSection" onComplete="unblockUI();CheckStatusAfter();SumCompute()">
            <apex:param name="firstParam" assignTo="{!sortKey}" value="" />
        </apex:actionFunction>
        <apex:outputPanel id="allPanel">
            <apex:pageBlock id="allBlock" >
<!--==============20160314====INSERT_CODE_START=======================================-->
                <apex:pageBlock id="EDCline_1" >
                    <apex:commandButton onclick="EditConsumable();"   value="编辑" style="margin-left:30px;width:180px" rerender="dummy" rendered="{!!(editAble || edoffersPrice)}" disabled="{!IF(coc.Order_status__c='已提交'||coc.Order_status__c='批准'||coc.Order_status__c='驳回',true,false)}"/>
                    <apex:commandButton onclick="printConsumableJs();"           value="打印配置单" style="margin-left:30px;width:180px" rerender="dummy" rendered="{!!(EditDelCommitBtnDisabled||editAble ||edoffersPrice)}" />
                    <apex:commandButton onclick="FilesUploadJs();"         value="上传配置单" style="margin-left:30px;width:180px" rerender="dummy" rendered="{!!(EditDelCommitBtnDisabled||editAble ||edoffersPrice)}" disabled="{!IF(coc.Order_status__c='已提交'||coc.Order_status__c='批准'||coc.Order_status__c='驳回',true,false)}"/>
                    <apex:commandButton onclick="SorderJs();"         value="提交订单" style="margin-left:30px;width:180px" rerender="dummy" rendered="{!!(EditDelCommitBtnDisabled||editAble ||edoffersPrice)}" disabled="{!IF(coc.Order_status__c='已提交'||coc.Order_status__c='批准'||coc.Order_status__c='驳回',true,false)}"/>
                    <apex:commandButton onclick="saveJs();"           value="保存订单" style="margin-left:30px;width:180px" rerender="dummy" rendered="{!IF((EditDelCommitBtnDisabled||editAble ||edoffersPrice) && coc.Order_status__c !='驳回',true,false)}" />
                    <apex:commandButton onclick="ordrCopyJs();"           value="保存订单" style="margin-left:30px;width:180px" rerender="dummy" rendered="{!IF(coc.Order_status__c='驳回' && editAble,true,false)}" />
                    <apex:commandButton onclick="DeleteConsumable();" value="删除" style="margin-left:30px;width:180px" rerender="dummy" rendered="{!!(EditDelCommitBtnDisabled||editAble ||edoffersPrice)}" disabled="{!IF(coc.Order_status__c='已提交'||coc.Order_status__c='批准'||coc.Order_status__c='驳回',true,false)}"/>
                    <apex:commandButton onclick="OffersPriceJs();"   value="特价金额录入" style="margin-left:30px;width:180px" rerender="dummy" rendered="{!!(editAble ||edoffersPrice)}" disabled="{!IF(coc.Order_status__c='已提交'||coc.Order_status__c='批准'||coc.Order_status__c='驳回',true,false)}"/>
                    <apex:commandButton onclick="backOrderJs();"   value="再申请" style="margin-left:30px;width:180px" rerender="dummy" rendered="{!IF(coc.Order_status__c='驳回' && !editAble,true,false)}"/>
                </apex:pageBlock>
<!--==============20160314====INSERT_CODE_END=======================================-->
                
                <!--<apex:pageBlock title="订单信息" id="Editabletable" rendered="{!(editAble && ESetId != null && returnOrder)}">
                    <table>
                        <colgroup>
                            <col width="160px"/>
                            <col width="200px"/>
                            <col width="40px"/>
                            <col width="150px"/>
                            <col width="140px"/>
                            <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" style="visibility:hidden"><apex:outputtext id="OrderCode1" rendered="false" value="订单编码" style="width:100px"/></td>
                            <td align="right" style="visibility:hidden"><apex:outputField id="OrderCode" rendered="false" value="{!coc.Name}" style="width:300px" /></td>
                            <td align="right" style="visibility:hidden">状 态</td>
                            <td align="right" style="visibility:hidden"><apex:inputField id="OrderStatus" rendered="false" value="{!coc.Order_status__c}" style="width:100px"/></td>
                            <td style="visibility:hidden"><input id="buffForSorder"/></td>
                        </tr>
                        <tr>
                            <td align="right" ><apex:outputText id="PruductSumPrice1" value="总金额 :"/></td>
                            <td align="left"><apex:outputText id="sumPrice_buttom" value="{!sumPrice}"/></td>
                        </tr>
                        <tr>
                            <td align="right" ><apex:outputText value="特价金额:" /></td>
                            <td align="left"><apex:outputField id="OffersPrice" value="{!coc.Offers_Price__c}"  style="width:100px"/></td>
                           <td/>
                        </tr>
                    </table>
                </apex:pageBlock>-->
 
<!--==============20160314====INSERT_CODE_START=======================================-->
                 <apex:pageBlock title="订单信息" id="unEditable" rendered="{!!(editAble)}">
                    <table>
                        <colgroup>
                            <col width="160px"/>
                            <col width="300px"/>
                            <col width="10px"/>
                            <col width="300px"/>
                            <col width="300px"/>
                        </colgroup>
                        <tr>
                            <td align="right" >订单编码:</td>
                            <td align="left" ><apex:outputField id="OrderCode_out"  value="{!coc.Name}" style="width:300px"/></td>
                            <td/>
                            <td align="right" >状 态:</td>
                            <td align="left" ><apex:outputField id="OrderStatus_out" value="{!coc.Order_status__c}" style="width:100px"/></td>
                            <td/>
                        </tr>
                        <tr>
                            <td align="right" ><apex:outputText id="PruductSumPrice" value="总金额 :" rendered="{!(!editAble)}"/></td>
                            <td align="left"><apex:outputField id="sumPrice_buttom" value="{!coc.Total_amount__c}" rendered="{!(!editAble)}"/></td>
                           <td/>
                            <td align="right" >合 同:</td>
                            <td align="left" ><apex:outputField value="{!coc.Order_effective_contact__r.Name}"/></td>
                            <td/>
                        </tr> 
                        <tr>
                            <td align="right" ><apex:outputText id="PruductSumPrice1" value="特价金额:" rendered="{!!edoffersPrice}"/></td>
                            <td align="left"><apex:outputField id="sumPrice_buttom1" value="{!coc.Offers_Price__c}" rendered="{!!edoffersPrice}"/></td>
                           <td/>
                        </tr>
                        <tr>
                            <td align="right" ><apex:outputText id="pruductSumPrice2" value="特价金额:" rendered="{!edoffersPrice}"/></td>
                            <td align="left"><apex:inputField id="sumPrice_buttom2" value="{!coc.Offers_Price__c}" rendered="{!edoffersPrice}"/>
                            <apex:inputHidden value="{!bargainPrice}" id="theHiddenInput"/></td>
                           <td/>
                        </tr>
                        <tr>
                            <td align="right" ><apex:outputText rendered="{!IF(coc.Consumable_pdf_insert_day__c=null,false,true)}" value="附件上传日期:" id="upLoadDateTitle"/></td>
                            <td align="left"><apex:outputField id="upLoadDate" rendered="{!IF(coc.Consumable_pdf_insert_day__c=null,false,true)}"  value="{!coc.Consumable_pdf_insert_day__c}" style="width:300px;"/></td>
                        </tr>
                        <tr>
                            <td align="right" ><apex:outputText rendered="{!IF(coc.Order_status__c='已提交'||coc.Order_status__c='批准',true,false)}" value="订单日期:" id="Date"/></td>
                            <td align="left" ><apex:outputField rendered="{!IF(coc.Order_status__c='已提交'||coc.Order_status__c='批准',true,false)}" id="OrderDate_out" value="{!coc.Order_date__c}" style="width:100px"/></td>
                            <td><apex:inputHidden id="decisionCode" value="{!decisionCode}"/></td>
                            <td style="visibility:hidden"><input id="buffForSorder"/></td>
                        </tr>
                    </table>
                </apex:pageBlock>
<!--==============20160314====INSERT_CODE_END=======================================-->
                <apex:pageBlock id="searchBlock" rendered="{!editAble}">
                    <table>
                        <colgroup>
                            <col width="10px"/>
                            <col width="10px"/>
                            <col width="60px"/>
                            <col width="220px"/>
                            <col width="60px"/>
                            <col width="60px"/>
                            <col width="180px"/>
                            <col width="60px"/>
                            <col width="60px"/>
                            <col width="180px"/>
                            <col width="60px"/>
                            <col width="60px"/>
                            <col width="180px"/>
                            <col width="60px"/>
                            <col width="80px"/>
                            <col width="80px"/>
                            <col width="80px"/>
                            <col width="35px"/>
                            <col width="90px"/>
                            <col width="100px"/>
                            <col width="10px"/>
                            <col width="85px"/>
                        </colgroup>
                        <!-- //add by rentx 2020-11-23 start -->
                        <tr>
                            <td align="right"></td>
                            <td></td>
                            <td/>
                            <td align="right">
                                <apex:detail rendered="{!methodType == 'hospitalorder' && agencyProType != 'ET'}">
                                    <apex:outputText value="医 院: "  ></apex:outputText>
                                </apex:detail>
                            </td>
                            <td width="100px"><apex:inputText id="HOS" value="{!hospitalName}" rendered="{!methodType == 'hospitalorder' && agencyProType != 'ET'}" style="width:100px" onclick="searchHospital()" onfocus="if (j$(escapeVfId('allPage:allForm:allBlock:searchBlock:HOSIds')).value() != 'tempId' && j$(escapeVfId('allPage:allForm:allBlock:searchBlock:HOSIds')).value() != ''){searchHProductJs('0');return false;}"/>
                                <apex:inputHidden id="HOSIds" value="{!tempidHp}" />
                                <apex:inputHidden id="HOSId" value="{!hospitalId}" /></td>
                            <td colspan="17" />
                        </tr>
                        <!-- //add by rentx 2020-11-23 end -->
 
                        <tr>
                            <td align="right"></td>
                            <td></td>
                            <td/>
                            <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/>
                            <td></td>
                            <td></td>
                            <td/>
                            <!--<td align="right">促销</td>
                            <td  align="left">
                                <apex:inputCheckbox value="{!specialCampaign}" id="SpecialCampaign"  style="width:20px"/>
                            </td>
                            <td/>-->
                            <td align="right"></td>
                            <td><apex:commandButton value="消耗品搜索" style="width: 100px;" onclick="searchProductJs('0');return false;" /></td>
                            <td><input type="button" value="清空" style="width: 100px;" onclick="ClearJs();return false;" class="btn"/></td>
                            <td/>
                        </tr>
                        <tr>
                            <td colspan="22"></td>
                        </tr>
                        <tr>
                            <td colspan="17"></td>
                            <td colspan="2">合 同:</td>
                            <td colspan="2">
                                <div style="width:2px;height:20px;background-color:red; position:absolute;margin-right:5px;"></div>
                                <apex:inputText id="OEC" value="{!contractName}" onclick="searchContract('{!agencyProType}')" style="width:200px" onfocus="if (j$(escapeVfId('allPage:allForm:allBlock:searchBlock:tempidPp')).value() != 'tempId' && j$(escapeVfId('allPage:allForm:allBlock:searchBlock:tempidPp')).value() != '' && j$(escapeVfId('allPage:allForm:allBlock:searchBlock:OECid')).value() != '' && '{!methodType}' == 'promotionorder'){searchPProductJs('0');return false;}"/>
                                <apex:inputHidden id="OECid" value="{!contractId}" />
                                <apex:inputHidden id="tempidPp" value="{!tempidPp}" />
                            </td>
                            <td/>
                        </tr>
                    </table>
                </apex:pageBlock>
                <apex:outputPanel id="message">
                    <apex:pageMessages />
                 </apex:outputPanel>
                <apex:pageBlock title="消耗品明细" id="ConsumableorderdetailsSection">
                <input type="hidden" id="allPage:allForm:allBlock:ConsumableorderdetailsSection:ConsumableorderdetailsCount" value="{!ConsumableorderdetailsviewCount}" />
                    <table class="list" border="0" cellpadding="0" cellspacing="0">
                        <tr class="headerRow">
                            <apex:variable var="v" value="" rendered="{!editAble}">
                                <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>-->
                            <th>规格</th>
                            <th>CFDA状态</th>
                            <th>注册证编码号</th>
                            <th>注册证效期</th>
                            <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>
                            <!--20170925 促销暂时不上线
                            <th>促销单价</th>
                            <th>促销结束日</th>-->
                            <apex:variable var="v" value="" rendered="{!cansee}">
                                <th><a href="#" onclick="SortLimitedJs('2');return false;" style="text-decoration: underline;"><apex:outputText value="标准单价    (元)" rendered="{!cansee}"/></a>{!sortOrder[2]}</th>
                            </apex:variable>
                            <!--<apex:variable var="v" value="" rendered="false" >
                                <th>经销商定价    (元)</th>
                            </apex:variable>
                            <apex:variable var="v" value="" rendered="false">
                                <th>经销商定价    (元)</th>
                            </apex:variable>-->
                            <apex:variable var="v" value="" rendered="{!editAble}">
                                <th>{!$ObjectType.Consumable_Orderdetails__c.fields.Consumable_count__c.label}</th>
                            </apex:variable>
                            <apex:variable var="v" value="" rendered="{!!editAble}">
                            <th>{!$ObjectType.Consumable_Orderdetails__c.fields.Consumable_count__c.label}</th>
                            </apex:variable>
                            <apex:variable var="v" value="" >
                                <th>在库数下限</th>
                            </apex:variable>
                            <apex:variable var="v" value="" >
                                <th>在库数上限</th>
                            </apex:variable>
                            <apex:variable var="v" value="" rendered="false">
                                <th>实际金额    (元)</th>
                            </apex:variable>
                            <th><a href="#" onclick="SortStoreJs('3');return false;" style="text-decoration: underline;">有效期库存(盒)</a>{!sortOrder[3]}</th>
                            <th>有效期库存(个)</th>
 
                        </tr>
                        <!-- <apex:repeat value="{!ConsumableorderdetailsRecordsview}" var="Recordsview" id="ConsumableorderdetailsTableOuter"> -->
                            <apex:repeat value="{!consumableorderdetailsRecordsview}" var="records" id="ConsumableorderdetailsTable">
                            <tr class="dataRow">
                                <apex:variable var="v" value="" rendered="{!editAble}" id="variableinfo">
                                    <td>
                                    <apex:inputCheckbox value="{!records.check}" onclick="CheckSize(this);" id="consumablesCountproRowCheckbox" disabled="{!!records.canSelect}"/>
                                     <apex:inputCheckbox value="{!records.oldCheck}" id="proRowOldCheckbox" style="display:none"/></td>
                                 </apex:variable>
                                <td class="dataCell">
                                    <apex:outputText value="{!IF(records.oldCheck=false,records.Prod.Name__c,records.esd.Consumable_Product__r.Name__c)}"/>
                                </td>
                            <!--    <td>{!records.Prod.Asset_Model_No__c}</td>-->
                                <td class="dataCell" style="text-align: right;">{!records.packing_list}</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>
                                <td class="dataCell">{!records.Prod.Category3__c}</td>
                                <td class="dataCell">{!records.Prod.Category4__c}</td>
                                <td class="dataCell">{!records.Prod.Category5__c}</td>
                                <!--<td class="dataCell" style="text-align: right;">{!records.SpecialCampaignPrice}</td>
                                <td class="dataCell">
                                    <apex:outputText value="{0, date, yyyy/MM/dd}">
                                        <apex:param value="{!records.Campaign_EndDate}" />
                                    </apex:outputText>
                                </td>-->
                                <apex:variable var="v" value="" rendered="{!cansee}">
                                    <td>{!records.Prod.Intra_Trade_List_RMB__c}</td>
                                </apex:variable>
                                <!--<apex:variable var="v" value="" rendered="{false}" id="DealerCustomPrice">
                                    <td class="dataCell" ><apex:inputField id="consumablesCoun"  onblur="ComputePriceCheck(this)" value="{!records.esd.Dealer_Custom_Price__c}"/></td>
                                </apex:variable>
                                <apex:variable var="v" value="" rendered="false">
                                    <td class="dataCell">{!records.esd.Dealer_Custom_Price__c}</td>
                                </apex:variable>-->
                                <apex:variable var="v" value="" rendered="{!editAble}" id="variable">
                                <td class="dataCell">
                                    <apex:inputField onblur="ComputePrice(this)"  value="{!records.esd.Consumable_count__c}" id="consumablesCount" style="width: 100px;"/>
                                    <apex:inputHidden id="oldConsumableCount" value="{!records.oldConsumableCount}"/></td>  
                                 </apex:variable>
                                <apex:variable var="v" value="" rendered="{!!editAble}">
                                <td class="dataCell" style="text-align: right;">{!records.esd.Consumable_count__c}</td>
                                </apex:variable>
                                <apex:variable var="v" value=""  id="variablelow">
                                    <td class="dataCell" style="text-align: right;"><apex:outputText id="consumablesinCountlow" value="{!records.lowerlimit}"/></td>
                                </apex:variable>
                                <apex:variable var="v" value=""  id="variablein">
                                    <td class="dataCell" style="text-align: right;"><apex:outputText id="consumablesinCount" value="{!records.upperlimit}"/></td>
                                </apex:variable>
                                <apex:variable var="v" value="" rendered="false">
                                    <td class="dataCell">{!records.esd.Sum_of_money__c}</td>
                                </apex:variable>
                                <apex:variable var="v" value="" id="variableallnumber">
                                    <td Class="{!IF(records.upperlimit != null && records.upperlimit != null,IF(records.allnumber > records.upperlimit,'columuscuperolour', IF(records.allnumber < records.lowerlimit,'columuslowercolour', 'dataCell')), 'dataCell')}" style="text-align: right;"><apex:outputText id="consumablesallnumber"  value="{!records.allnumber}"/></td> 
                                </apex:variable>
                                <apex:variable var="v" value=""  id="variableallnumber_piece">
                                    <td class="dataCell" style="text-align: right;"><apex:outputText id="consumablesallnumber_piece" value="{!records.allnumber_piece}"/></td>
                                </apex:variable>
                            </tr>
                            </apex:repeat>
                        <!-- </apex:repeat> -->
                    </table>
 
                    <div class="paginator line1">
                        <span class ="left">
                            <apex:outputText >{!(con.pageNumber * size)+1-size}-{!IF((con.pageNumber * size)>noOfRecords, noOfRecords,
                                (con.pageNumber * size))} 共 {!noOfRecords}个
                            </apex:outputText>
                        </span>
                        
                        <span class="prevNextLinks">
                            <!-- 有上一页-->
                            <apex:outputPanel rendered="{!con.hasPrevious}">
                            <span class="prevNext">
                                <apex:commandLink reRender="ConsumableorderdetailsSection" action="{!con.first}" oncomplete="refreshPageSizeJs();" title="首页">
                                    <img src="/s.gif" title="首页" alt="首页" class="{!IF(con.hasPrevious,'first', 'firstoff')}"/>
                                </apex:commandLink>
                            </span>
                            <span class="prevNext">
                                <apex:commandLink reRender="ConsumableorderdetailsSection" action="{!con.previous}" oncomplete="refreshPageSizeJs();" title="上一页">
                                    <img src="/s.gif" title="上一页" alt="上一页" class="{!IF(con.hasPrevious,'prev', 'prevoff')}"/>上一页
                                </apex:commandLink>
                            </span>
                            </apex:outputPanel>
                            
                            <!-- 无上一页-->
                            <apex:outputPanel rendered="{!!con.hasPrevious}">
                            <span class="prevNext">
                                <apex:commandLink reRender="ConsumableorderdetailsSection" title="首页">
                                    <img src="/s.gif" title="首页" alt="首页" class="firstoff"/>
                                </apex:commandLink>
                            </span>
                            <span class="prevNext">
                                <apex:commandLink reRender="ConsumableorderdetailsSection" title="上一页">
                                    <img src="/s.gif" title="上一页" alt="上一页" class="prevoff"/>上一页
                                </apex:commandLink>
                            </span>
                            </apex:outputPanel>
                            <!-- 有下一页-->
                            <apex:outputPanel rendered="{!con.hasNext}">
                            <span class="prevNext">
                                <apex:commandLink reRender="ConsumableorderdetailsSection" action="{!con.next}" oncomplete="refreshPageSizeJs();" title="下一页">下一页
                                    <img src="/s.gif" title="下一页" alt="下一页" class="{!IF(con.hasNext,'next', 'nextoff')}"/>
                                </apex:commandLink>
                            </span>
                            <span class="prevNext">
                                <apex:commandLink reRender="ConsumableorderdetailsSection" action="{!con.last}" oncomplete="refreshPageSizeJs();" title="尾页">
                                    <img src="/s.gif" title="尾页" alt="尾页" class="{!IF(con.hasNext,'last', 'lastoff')}"/>
                                </apex:commandLink>
                            </span>
                            </apex:outputPanel>
 
                            <!-- 无下一页-->
                            <apex:outputPanel rendered="{!!con.hasNext}">
                            <span class="prevNext">
                                <apex:commandLink reRender="ConsumableorderdetailsSection" title="下一页">下一页
                                    <img src="/s.gif" title="下一页" alt="下一页" class="nextoff"/>
                                </apex:commandLink>
                            </span>
                            <span class="prevNext">
                                <apex:commandLink reRender="ConsumableorderdetailsSection" title="尾页">
                                    <img src="/s.gif" title="尾页" alt="尾页" class="lastoff"/>
                                </apex:commandLink>
                            </span>
                            </apex:outputPanel>
                        </span>
                    </div>
                </apex:pageBlock>
            </apex:pageBlock>
        </apex:outputPanel>
    </apex:form>
    <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}?retURL={!URLENCODE('/Consumable?ESetId='+ESetId)}" target="_self">
            {!a.Concc.name}
        </apex:outputLink>
        </apex:column>
        <apex:column headerValue="创建人">
            <apex:outputField value="{!a.Concc.OwnerId}"/>
        </apex:column>
        </apex:pageBlockTable>
    </apex:pageBlock>
<script>
</script>
</apex:page>