高章伟
2022-03-18 4bfe21c4b5ddc089ae5a95f4b10f6cff148b690d
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
<apex:page Controller="ConInvoiceViewController" showHeader="true" tabStyle="ConInvoiceList__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.connection20)}"/>
<apex:includeScript value="{!URLFOR($Resource.apex20)}"/>
<script>
function searchsearchAgencyI(str){
    openPopup('/customer/apex/searchAgencyHospital?Ctype=' + str, 'setsearch', 800, 600, 'width=800,height=600,scrollbars=yes', true);
}
function clearAgencyI(){
    var agencyname = j$(escapeVfId('allPage:allForm:allBlock:Editable:OEC')).value();
    if (agencyname == '' || agencyname == null) {
        document.getElementById('allPage:allForm:allBlock:Editable:OECId').value = "";
    }
 
}
function checkAll() {
    var productCount = j$(escapeVfId('invoiceOrderRecoedsCount')).value();
    if (j$(escapeVfId('checker')).attr('checked') == 'checked') {
        for (var i = 0; i < productCount; i++) {
            if(j$(escapeVfId('allPage:allForm:allBlock:invoiceOrderRecoedsSection:invoiceOrderRecoeds:' + i + ':variableinfo:consumablesCountproRowCheckbox')).attr('disabled') !='disabled'){
                j$(escapeVfId('allPage:allForm:allBlock:invoiceOrderRecoedsSection:invoiceOrderRecoeds:' + i + ':variableinfo:consumablesCountproRowCheckbox')).attr('checked',true);
            }
        }
    } else {
        for (var i = 0; i < productCount; i++) {
            if(j$(escapeVfId('allPage:allForm:allBlock:invoiceOrderRecoedsSection:invoiceOrderRecoeds:' + i + ':variableinfo:consumablesCountproRowCheckbox')).attr('disabled') !='disabled'){
                j$(escapeVfId('allPage:allForm:allBlock:invoiceOrderRecoedsSection:invoiceOrderRecoeds:' + i + ':variableinfo:consumablesCountproRowCheckbox')).attr('checked',false);
            }
        }
    }
}
//打开报表
function openReportJs(){
    var pv2 = '{!InvoiceName}';
    window.open("/customer/" +'{!URLENCODE($Label.ConsumableInvoice_report)}'+ "?pv1=" + encodeURI(pv2));
}
 
function FilesUaplodJs(){
    //上传文件
    FilesUpload();
}
 
function saveAttachmentJs(){
    saveAttachment();
}
 
function InvoiceorderSearchJs(){
    blockme();
    InvoiceorderSearch();
    //SumCompute();
}
 
//计算已发票金额
function SumComputeOK(){
    var SumPrice = 0;
    var consumablesCounttestPriceJList = j$("span[Id$='needInvoicemoneysum']").value();
    //判断是否为数组 为数组时去掉空值计算
    if (consumablesCounttestPriceJList.constructor == Array) {
        for (var i = 0; i < consumablesCounttestPriceJList.length; i++) {
            var outer = consumablesCounttestPriceJList[i].replace(",","");
            if (isNaN(parseFloat(consumablesCounttestPriceJList[i]))) {
                consumablesCounttestPriceJList.splice(i,1);
                i= i-1;
            }else{
                consumablesCounttestPriceJList.splice(i,1,consumablesCounttestPriceJList[i].replace(/,/g,''));
            }
        }
        var str=consumablesCounttestPriceJList.join("+");
        var SumPrice =eval(str);
    }else{
        var SumPrice = consumablesCounttestPriceJList.replace(/,/g,'');
    }
    //SumPrice = parseFloat(SumPrice).toLocaleString();
    SumPrice = parseFloat(SumPrice).toFixed(2);
    SumPrice = formatNum(SumPrice);
}
 
 
//计算发票金额
function SumCompute(){
    var SumPrice = 0;
    var consumablesCounttestPriceJList = j$("span[Id$='needInvoicemoneysum']").value();
    //判断是否为数组 为数组时去掉空值计算
    if (consumablesCounttestPriceJList.constructor == Array) {
        for (var i = 0; i < consumablesCounttestPriceJList.length; i++) {
            var outer = consumablesCounttestPriceJList[i].replace(",","");
            if (isNaN(parseFloat(consumablesCounttestPriceJList[i]))) {
                consumablesCounttestPriceJList.splice(i,1);
                i= i-1;
            }else{
                consumablesCounttestPriceJList.splice(i,1,consumablesCounttestPriceJList[i].replace(/,/g,''));
            }
        }
        var str=consumablesCounttestPriceJList.join("+");
        var SumPrice =eval(str);
    }else{
        var SumPrice = consumablesCounttestPriceJList.replace(/,/g,'');
    }
    //SumPrice = parseFloat(SumPrice).toLocaleString();
    SumPrice = parseFloat(SumPrice).toFixed(2);
    SumPrice = formatNum(SumPrice);
}
 
function formatNum(str){
var newStr = "";
var count = 0;
if(str.indexOf(".")==-1){
   for(var i=str.length-1;i>=0;i--){
 if(count % 3 == 0 && count != 0){
   newStr = str.charAt(i) + "," + newStr;
 }else{
   newStr = str.charAt(i) + newStr;
 }
 count++;
   }
   str = newStr + ".00"; //自动补小数点后两位
 
   console.log(str)
}
else
{
   for(var i = str.indexOf(".")-1;i>=0;i--){
 if(count % 3 == 0 && count != 0){
   newStr = str.charAt(i) + "," + newStr;
 }else{
   newStr = str.charAt(i) + newStr; //逐个字符相接起来
 }
 count++;
   }
   str = newStr + (str + "00").substr((str + "00").indexOf("."),3);
   document.getElementById("allPage:allForm:allBlock:invoiceOrderRecoedsSection:sumPrice_buttom").innerHTML = str;
   document.getElementById("allPage:allForm:allBlock:unEditable:sumPrice").innerHTML = str;
 }
}
 
 
window.sfdcPage.appendToOnloadQueue(function() {SumCompute();SumComputeOK()});
 
function SaveJs(){
    blockme();
    save();
}
//编辑
function SetEditAbleJs(){
    blockme();
    setEditAble();
}
 
//精琢科技   zxk   2021-11-03  CHAN-C8D86K 添加删除按钮  start
function deleteButtonJs(){
    blockme();
    deleteButton();
}
//精琢科技   zxk   2021-11-03  CHAN-C8D86K 添加删除按钮  end
 
// CHAN-BSS5SQ    update by rentongxiao 2020-08-27  start
function reopenJs(){
    blockme();
    setreopen();
}
// CHAN-BSS5SQ    update by rentongxiao 2020-08-27  end
 
function approvalJs(){
    //blockme();
    approval();
}
 
//排序
function SortLimitedJs(key) {
    blockme();
    SortLimited(key);
}
 
</script>
<style>
    tr.dataRow {
        background-color:white;
    }
    td.columus {
        background-color:white;
        text-align: right;
    }
    tr.dataRow:hover {
        background-color: #e3f3ff;
    }
</style>
    <apex:form id="allForm">
        <apex:actionFunction name="saveAttachment" action="{!saveAttachment}" rerender="allBlock, message" onComplete="unblockUI();">
        </apex:actionFunction>
        <apex:actionFunction name="nvoiceorderremind" action="{!nvoiceorderremind}" rerender="allBlock, message" onComplete="unblockUI();">
        </apex:actionFunction>
        <apex:actionFunction name="FilesUpload" action="{!FilesUpload}" rerender="allBlock, message" onComplete="unblockUI();">
        </apex:actionFunction>
        <apex:actionFunction name="save" action="{!save}" rerender="allBlock, message" onComplete="unblockUI();SumCompute();SumComputeOK();">
        </apex:actionFunction>
        <apex:actionFunction name="nvoiceorderremind" action="{!nvoiceorderremind}" rerender="allBlock, message" onComplete="unblockUI();">
        </apex:actionFunction>
        <apex:actionFunction name="InvoiceorderSearch" action="{!InvoiceorderSearch}" rerender="invoiceOrderRecoedsSection, message" onComplete="unblockUI();SumCompute();SumComputeOK();">
        </apex:actionFunction>
        <apex:actionFunction name="setEditAble" action="{!setEditAble}" rerender="allBlock, message" onComplete="unblockUI();">
        </apex:actionFunction>
         <!-- CHAN-BSS5SQ    update by rentongxiao 2020-08-26  start -->
        <apex:actionFunction name="setreopen" action="{!setreopen}" rerender="allBlock, message" onComplete="unblockUI();">
        </apex:actionFunction>
         <!-- CHAN-BSS5SQ    update by rentongxiao 2020-08-26  end -->
         <!-- 精琢科技   zxk   2021-11-03  CHAN-C8D86K 添加删除按钮  start -->
        <apex:actionfunction action="{!deleteButton}" name="deleteButton" oncomplete="unblockUI();" rerender="allBlock, message">
        </apex:actionfunction>
        <!-- 精琢科技   zxk   2021-11-03  CHAN-C8D86K 添加删除按钮  start -->
        <apex:actionFunction name="approval" action="{!approval}" rerender="allBlock,btnStatus,message" onComplete="unblockUI();SumCompute();SumComputeOK();">
        </apex:actionFunction>
        <apex:actionFunction name="SortLimited" action="{!SortLimited}" rerender="allBlock, message" onComplete="unblockUI();SumCompute();SumComputeOK();">
        <apex:param name="firstParam" assignTo="{!sortKey}" value="" />
    </apex:actionFunction>
        <apex:outputPanel id="allPanel">
            <apex:outputPanel id="message">
                <apex:pageMessages />
            </apex:outputPanel>
            <apex:pageBlock id="allBlock" >
            <apex:inputHidden id="orderRemindValue" value="{!orderRemind}"/>
            <!--<input type="hidden" id="orderRemindValue" value="{!orderRemind}" />-->
                <apex:pageBlock id="btnStatus">
                <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></td>
                        <td  colspan="2"><apex:commandButton onclick="SaveJs();return false;" value="确定" style="width:150px" rerender="dummy" rendered="{!(EditAble)}"/></td>
                        <td></td>
                    </tr>
                    <tr>
                        <td></td>
                        <td ><apex:commandButton onclick="SetEditAbleJs();return false;"   value="编辑" style="width:150px" rerender="dummy" rendered="{!!(EditAble)}" disabled="{!IF(coc.Invoice_status__c='提交' ||coc.Invoice_status__c='已完成',true,false)}"/></td>
                        <td ><apex:commandButton onclick="approvalJs();return false;" value="提交" style="width:150px" rerender="dummy" rendered="{!!(EditAble)}" disabled="{!IF(coc.Invoice_status__c='提交' ||coc.Invoice_status__c='已完成',true,false)}"/></td>
                        <td><apex:commandButton onclick="openReportJs(); return false;" value="显示明细" style="width:150px" rerender="dummy" rendered="{!!(EditAble)}"/></td>
                        <!-- CHAN-BSS5SQ    update by rentongxiao 2020-08-26  start -->
                        <td ><apex:commandButton onclick="reopenJs();return false;" value="作废重开" style="width:150px" rerender="dummy" rendered="{!!(EditAble)}" disabled="{!IF(coc.Invoice_status__c=='提交',false,true)}"/></td>
                        <!-- CHAN-BSS5SQ    update by rentongxiao 2020-08-26  end -->
                        <!-- 精琢科技   zxk   2021-11-03 CHAN-C8D86K 添加删除按钮  start-->
                        <td> <apex:commandbutton disabled="{!IF(coc.Invoice_status__c='草案中',false,true)}" onclick="deleteButtonJs();return false;" rendered="{!!(EditAble)}" rerender="dummy" style="width:150px" value="删除"> </apex:commandbutton></td>
                        <!-- 精琢科技   zxk   2021-11-03 CHAN-C8D86K 添加删除按钮  end-->
 
                    </tr>
                </table>
                </apex:pageBlock>
                <!--发票信息 显示用 -->
                <apex:pageBlock title="发票信息" id="unEditable" rendered="{!(!EditAble || isChange)}">
                    <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" >
                            <td align="right">发票号:</td>
                            <td align="left"><apex:outputField id="OrderCode_out"  value="{!coc.Name}" style="width:155px"/></td>
                            <td align="right">状态:</td>
                            <td align="left"><apex:outputField id="Invoice_status_out" value="{!coc.Invoice_status__c}" style="width:100px"/></td>
                        </tr>
                        <tr>
                            <td align="right">发票日期:</td>
                            <td align="left"><apex:outputField id="SummonsForDirction_out" value="{!coc.Invoice_Date__c}" style="width:155px"/></td>
                            <td align="right"></td>
                            <td align="left">
                            </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="ShipmentAccount_out" value="{!coc.ShipmentAccount__c}" style="width:155px"/></td>
                            <td align="right"></td>
                            <td align="left">
                            </td>
                        </tr>
                        <tr>
                            <td align="right">科室:</td>
                            <td align="left">
                                <apex:outputField id="Order_ForCustomer" value="{!coc.Order_ForCustomerText__c}" style="width:155px" />
                            </td>
                            <td align="right">发票票面金额(元):</td>
                            <td align="left">
                                <apex:outputText id="sumPrice" value="{!sumPrice}" style="width:155px"/>
                            </td>
                        </tr>
                        <tr>
                            <td align="right">备注:</td>
                            <td align="left">
                                <apex:outputField id="Invoice_Note" value="{!coc.Invoice_Note__c}" style="width:155px" />
                            </td>
                            <td align="right"></td>
                            <td align="left"></td>
                        </tr>
                        <tr>
                            <td align="right">发票附件:</td>
                            <td align="left">
                                <apex:outputField value="{!coc.Invoice_attachment__c}" style="width:155px"/>
                            </td>
                            <td align="right">明细附件:</td>
                            <td align="left">
                                <apex:outputField value="{!coc.Invoicedet_attachment__c}" style="width:155px"/>
                            </td>
                        </tr>
                    </table>
                </apex:pageBlock>
                <!--发票信息 编辑用 -->
                <apex:pageBlock title="发票信息" id="Editable" rendered="{!!(!EditAble || isChange)}">
                    <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" >
                            <td align="right">发票号:</td>
                            <td align="left"><div style="width:1px;height:20px;background-color:red; position:absolute;margin-right:5px;"></div><apex:inputField id="OrderCode"  value="{!coc.Name}" style="width:155px"/></td>
                            <td align="right">状态:</td>
                            <td align="left"><apex:outputField id="Invoice_status" value="{!coc.Invoice_status__c}" style="width:175px"/></td>
                        </tr>
                        <tr>
                            <td align="right">发票日期:</td>
                            <td align="left"><div style="width:1px;height:20px;background-color:red; position:absolute;margin-right:5px;"></div><apex:inputField id="SummonsForDirction__c" value="{!coc.Invoice_Date__c}" style="width:155px"/></td>
                            <td align="right"></td>
                            <td align="left">
                            </td>
                        </tr>
                        <tr>
                            <td align="right">客户名:</td>
                            <td align="left">
                                <apex:inputText id="OEC" value="{!HospitalName}" onclick="searchsearchAgencyI('{!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:selectList id="province" value="{!SecondDealer}" style="width:174px" size="1">
                                <apex:selectOptions value="{!provinceOpts}"/>
                            </apex:selectList>
                            </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">
                                <!-- CHAN-BSS5SQ    update by rentongxiao 2020-08-26  end-->
                                <!-- <apex:inputField id="Order_ForDealerText" value="{!coc.Order_ForDealerText__c}" style="width:170px"/> -->
                                <apex:outputField id="Order_ForDealerText" value="{!coc.Order_ForDealerText__c}" style="width:170px"/>
                                <!-- CHAN-BSS5SQ    update by rentongxiao 2020-08-26  end-->
                            
                            </td>
                        </tr>
                        <tr>
                            <td align="right">备注:</td>
                            <td align="left">
                                <apex:inputField id="Invoice_Note" value="{!coc.Invoice_Note__c}" style="width:155px"/>
                            </td>
                            <td align="right"></td>
                            <td align="left"></td>
                        </tr>
                    </table>
                </apex:pageBlock>
 
                <apex:pageBlock id="invoiceOrderRecoedsSection" title="出库单一览">
                    <apex:pageBlockButtons location="top" rendered="{!IF(deliveryId ='' && ExistOutbound = false && EditAble,true,false)}">
                        <apex:commandButton onclick="InvoiceorderSearchJs();return false;" value="检索" style="width: 150px;" rerender="dummy"/>
                    </apex:pageBlockButtons>
 
                    <input type="hidden" id="invoiceOrderRecoedsCount" value="{!invoiceOrderRecoedsCount}" />
                    <table class="list" border="0" cellpadding="0" cellspacing="0">
                        <tr class="headerRow">
                        <apex:variable var="v" value="" rendered="{!IF(deliveryId ='' && ExistOutbound = false && EditAble,true,false)}" id="variableinfo">
                            <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>
                        <apex:variable var="v" value="" rendered="{!editAble}" >
                            <th><a href="#" onclick="SortLimitedJs('2');return false;" style="text-decoration: underline;">{!$ObjectType.Consumable_order__c.fields.ShipmentAccount__c.label}</a>{!sortOrder[2]}</th>
                            <th>出货金额(元)</th>
                            <th>返品金额(元)</th>
                        </apex:variable>
                            <!--<th>出库单合计发票金额(元)</th> -->
                            <th>未发票金额(元)</th>
                            <th>发票票面金额(元)</th>
                        </tr>
                    <apex:repeat value="{!invoiceOrderRecoeds}" var="records" id="invoiceOrderRecoeds">
                        <tr class="dataRow">
                        <apex:variable var="v" value="" rendered="{!IF(deliveryId ='' && ExistOutbound = false && EditAble,true,false)}" id="variableinfo">
                            <td>
                                <apex:inputCheckbox value="{!records.check}" id="consumablesCountproRowCheckbox"/>
                                <apex:inputCheckbox value="{!records.oldCheck}" id="proRowOldCheckbox" style="display:none"/></td>
                        </apex:variable>
                            <td Class="dataCell">
                                <apex:outputField value="{!records.esd.Outbound_Date__c}"/></td>
                            <td class="dataCell"><apex:outputLink value="/summonsCreat?ESetid={!records.esd.Id}" target="_blank"><apex:outputField value="{!records.esd.Name}"/></apex:outputLink></td>
                        <apex:variable var="v" value="" rendered="{!editAble}" >
                            <td class="dataCell"><apex:outputField value="{!records.esd.ShipmentAccount__c}" id="ShipmentAccount"/></td>
                            <td class="dataCell" style="text-align: right;"><apex:outputField value="{!records.esd.Shipment_total_amount__c}"/></td>
                            <td class="dataCell" style="text-align: right;"><apex:outputField value="{!records.esd.RrturnPro_total_amount__c}"/></td>
                        </apex:variable>
                            <!--<td class="dataCell" style="text-align: right;"><apex:outputField value="{!records.esd.InvoicedPro_money_sum__c}" id="InvoicedPromoney"/></td>-->
                            <td class="dataCell" style="text-align: right;"><apex:outputField value="{!records.esd.InvoiceNotPro_money__c}" id="Invoicemoneysum"/></td>
                            <td class="dataCell" style="text-align: right;">
                            <apex:outputLink value="/ConInvoicedetails?orderId={!records.esd.Id}&invoiceId={!invoiceId}" target="_self" disabled="{!IF(records.esd.Billed_Status__c = '全部开票' || editAble || coc.Invoice_status__c !='草案中',true,false)}">
                                <apex:outputText value="{0, number, ###,##0.00}" id="needInvoicemoneysum">
                                    <apex:param value="{!records.needInvoiceCount}" />
                                </apex:outputText>
                            </apex:outputLink>
                            </td>
                        </tr>
                    </apex:repeat>
                    </table>
                    <table class="list" cellpadding="0" cellspacing="0" border="none" id="tablecount" style="display: {!IF(editAble= false,'none','')};">
                        <tr>
                            <td style="border: none;"></td>
                            <td style="border: none;"></td>
                            <td style="border: none;"></td>
                            <td style="border: none;"></td>
                            <td style="border: none;"></td>
                            <td style="border: none;"></td>
                            <td style="border: none;"></td>
                            <td style="border: none;"></td>
                            <td style="border: none;text-align: right;"><apex:outputText id="sumPrice_buttom" value="{!sumPrice}"/></td>
                        </tr>
                    </table>
               </apex:pageBlock>
 
               <apex:pageBlock title="发票明细" rendered="{!done}">
                     <apex:pageblocksection columns="1" id="invoiceOrderdetail1RecoedsSection">
                        <apex:pageblocktable value="{!invoiceOrderdetail1Recoeds}" var="records" id="ConsumableorderdetailsTable">
                            <apex:column width="80">
                                 <apex:facet name="header">出库日期</apex:facet>
                                 <apex:outputField value="{!records.esdet.Product_OutDate__c}"/>
                             </apex:column>
                            <apex:column width="80">
                                <apex:facet name="header">出库单编码</apex:facet>
                                <apex:outputField value="{!records.esdet.Invoicedet1_OD_link__r.Name}"/>
                            </apex:column>
                            <apex:column width="80">
                                <apex:facet name="header">产品型号</apex:facet>
                                <apex:outputField value="{!records.esdet.Asset_Model_No__c}"/>
                            </apex:column>
                            <apex:column width="80">
                                <apex:facet name="header">单位</apex:facet>
                                <apex:outputField value="{!records.esdet.Invoice_Unit__c}"/>
                            </apex:column>
                            <apex:column width="80" style="text-align:right;">
                                <apex:facet name="header">发票单价</apex:facet>
                                <apex:outputField value="{!records.esdet.Invoice_Unitprice__c}"/>
                            </apex:column>
                            <apex:column width="80" style="text-align:right;">
                                <apex:facet name="header">发票数量</apex:facet>
                                <apex:outputField value="{!records.esdet.Invoiced_Count__c}"/>
                            </apex:column>
                            <apex:column width="80" style="text-align:right;">
                                <apex:facet name="header">发票票面金额(元)</apex:facet>
                                <apex:outputField value="{!records.esdet.InvoicedProCost_RMB__c}"/>
                            </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.attach.Id}" target="LINK_{!a.attach.Id}">
                {!a.attach.name}
            </apex:outputLink>
            </apex:column>
            <apex:column headerValue="创建人">
                <apex:outputField value="{!a.attach.OwnerId}"/>
            </apex:column>
            <apex:column headerValue="上传日期">
                <apex:outputField value="{!a.attach.CreatedDate}"/>
            </apex:column>
            <apex:column headerValue="附件类型">
                <apex:selectList id="province" value="{!a.mailSelectOptsin}" size="1" disabled="{!IF(coc.Invoice_status__c ='已完成',true,false)}">
                    <apex:selectOptions value="{!a.mailSelectOpts}"/>
                </apex:selectList>
            </apex:column>
            </apex:pageBlockTable>
            <apex:pageBlockButtons location="top" >
                <apex:commandButton onclick="FilesUaplodJs();" value="上传附件" style="margin-left:30px;width:100px" rerender="dummy" disabled="{!IF(coc.Invoice_status__c !='提交',true,false)}"/>
                <apex:commandButton onclick="saveAttachmentJs();" value="保存附件" style="margin-left:30px;width:100px" rerender="dummy" disabled="{!IF(coc.Invoice_status__c !='提交',true,false)}"/>
            </apex:pageBlockButtons>
        </apex:pageBlock>
    </apex:form>
</apex:page>