buli
2022-05-13 08a21f49f2eaf9cfc19ceb67b196cc36ba689305
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 standardController="Quote" extensions="NewQuoteEntryController" sidebar="false" action="{!init}" id="Page">
    <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/>
    <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
    <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
    <apex:includeScript value="{!URLFOR($Resource.connection20)}"/>
    <apex:includeScript value="{!URLFOR($Resource.apex20)}"/>
 
    <script type="text/javascript">
 
        var oppId = '{!oppId}';
        var openQuoteExcelImportWindow = null;
        var baseUrl = '{!baseUrl}';
 
        function searchProduct(i,str,setStr){
            // CNY USDを取得
            //j$(escapeVfId('Page:mainForm:block:lists:' + i + ':ProductName')).attr('readonly',true);
            var openType = j$(escapeVfId('openType')).value();
            openPopup(baseUrl + '/apex/SearchProduct?lineno=' + i + '&val=' + encodeURIComponent(str) + '&set=' + encodeURIComponent(setStr) +'&oppId=' + encodeURIComponent(oppId) + '&openType=' + encodeURIComponent(openType), 'setsearch', 950, 450, 'width=950,height=450,scrollbars=yes,toolbar=no,status=no,directories=no,menubar=no,resizable=1', true);
        }
 
        function openQuoteExcelImport(e) {
            if ( openQuoteExcelImportWindow == null || openQuoteExcelImportWindow.closed) {
                openQuoteExcelImportWindow = window.open(baseUrl + '/apex/QuoteExcelImport', 'xlsdoc', 'width=450,height=210');
            }
            else {
                openQuoteExcelImportWindow.focus();
            }
        }
 
        function getLastLineNoNext(doc) {
            var hasRecordFlg = false;
            var lastLineNo = 0;
            for(var i=99; i>=0; i--){
                if (j$(escapeVfId('Page:mainForm:block:lists:' + i + ':ProductName')).value() != ''){
                    if (!hasRecordFlg) {
                        lastLineNo = i;
                    }
                    hasRecordFlg = true;
                }
                if (hasRecordFlg == true) {
                    if (j$(escapeVfId('Page:mainForm:block:lists:' + i + ':ProductName')).value() == ''){
                        var moveCheckbox = true;
                        //deletelist(i, doc, moveCheckbox);
                        lastLineNo = i;
                    }
                }
            }
            if (hasRecordFlg) {
                lastLineNo = lastLineNo + 1;
            }
            return lastLineNo;
        }
 
        function save2btn() {
            //checkchangedAfterPrint();
            //var changedAfterPrint = j$(escapeVfId('Page:mainForm:changedAfterPrint')).value();
            //var changedAfterBid = j$(escapeVfId('Page:mainForm:changedAfterBid')).value();
            var changedAfterPrint = false;
            var changedAfterBid = false;
 
            if (changedAfterBid == 'true') {
                if (confirm(Confirm_ChangedAfterBid)) {
                    blockme();
                    Save.call();
                    return;
                }
            } else if (changedAfterPrint == 'true') {
                if (confirm(Confirm_ChangedAfterPrint)) {
                    blockme();
                    Save.call();
                    return true;
                }
            } else {
                blockme();
                Save.call();
                return true;
            }
        }
 
        function doRefresh() {
            blockme();
            Refresh.call();
            return true;
 
        }
 
        function oppReflection2btn() {
 
            var changedAfterPrint = false;
 
            if (changedAfterPrint == 'true') {
                if (confirm(Confirm_ChangedAfterPrint)) {
                    blockme();
                    OppReflection.call();
                    return true;
                }
            } else {
                blockme();  
                OppReflection.call();
                return true;
            }
        }
 
        function decidebtn() {
            if (confirm('报价决定后,询价不能同步其他报价,是否决定报价?') == false) {
                return;
            }
            blockme();
            Decide.call();
            return true;
        }
 
        function undecidebtn() {
            if (confirm('是否取消决定?') == false) {
                return;
            }
            blockme();
            unDecide.call();
            return true;
        }
 
        function backbtn() {
            BackBtn.call();
            return true;
        }
 
        function excelImportGateway(str) {
            blockme();
            excelImport(str);
        }
 
        function printPDF() {
            var quoid = j$(escapeVfId('quoid')).value();
            var printPrice = j$(escapeVfId('isPrintPrice')).prop('checked');
            var baseUrl = '{!baseUrl}';
            window.open(baseUrl + '/apex/QuotePDF?id=' + encodeURIComponent(quoid) + '&printprice=' + printPrice);
        }
 
        function setall() {
            var discount = j$('#discount').value();
            if (isNaN(discount) == true) {
                alert('请输入数字。');
                return false;
            }
            var quoteEntryMaxLine = {!quoteEntryMaxLine};
            for (var i = 0; i < quoteEntryMaxLine; i++) {
                if (j$(escapeVfId('Page:mainForm:block:lists:' + i + ':ProductName')).value() != '') {
                    j$(escapeVfId('Page:mainForm:block:lists:' + i + ':Discount')).val(discount);
                }
            }
        }
 
        function setPrice(i) {
            var distingush = j$(escapeVfId('Page:mainForm:block:lists:' + i + ':Distingush')).value();
            if (distingush == 'A') {
                var price = j$(escapeVfId('Page:mainForm:block:lists:' + i + ':price1')).value();
                j$(escapeVfId('Page:mainForm:block:lists:' + i + ':UnitPrice')).val(price);
            } else if (distingush == 'B') {
                var price = j$(escapeVfId('Page:mainForm:block:lists:' + i + ':price2')).value();
                j$(escapeVfId('Page:mainForm:block:lists:' + i + ':UnitPrice')).val(price);
            } else if (distingush == 'C') {
                var price = j$(escapeVfId('Page:mainForm:block:lists:' + i + ':price3')).value();
                j$(escapeVfId('Page:mainForm:block:lists:' + i + ':UnitPrice')).val(price);
            } else {
                var price = j$(escapeVfId('Page:mainForm:block:lists:' + i + ':price0')).value();
                j$(escapeVfId('Page:mainForm:block:lists:' + i + ':UnitPrice')).val(price);
            }
        }
 
        function setTotalPrice(i) {
            if (j$(escapeVfId('Page:mainForm:block:lists:' + i + ':ProductName')).value() != '') {
                var quantity = j$(escapeVfId('Page:mainForm:block:lists:' + i + ':Quantity')).value();
                var unitprice = j$(escapeVfId('Page:mainForm:block:lists:' + i + ':UnitPrice')).value();
                var discount = j$(escapeVfId('Page:mainForm:block:lists:' + i + ':Discount')).value();
                var totalprice = Math.round(quantity * unitprice * (100 - discount)) / 100;
                j$(escapeVfId('Page:mainForm:block:lists:' + i + ':TotalPrice')).text(totalprice);
            }
        }
 
        function changeLimit(i) {
            if (j$(escapeVfId('Page:mainForm:block:lists:' + i + ':ProductName')).value() != '') {
                var unitprice = j$(escapeVfId('Page:mainForm:block:lists:' + i + ':UnitPrice')).value();
                var salesprice = j$(escapeVfId('Page:mainForm:block:lists:' + i + ':price0')).value();
                var ispm = j$(escapeVfId('Page:mainForm:block:lists:' + i + ':isProductModel')).value();
                var isPartsdirect = j$(escapeVfId('isPartsdirect')).value();
                var isPartsdealer = j$(escapeVfId('isPartsdealer')).value();
                var hidset = j$(escapeVfId('Page:mainForm:block:lists:' + i + ':hidSet')).value();
                if (isPartsdirect == 'true') {
                    alert("销售价格根据客户价格自动计算。");
                    var quantity = j$(escapeVfId('Page:mainForm:block:lists:' + i + ':Quantity')).value();
                    var customPrice = j$(escapeVfId('Page:mainForm:block:lists:' + i + ':CustomPrice')).value();
                    if (quantity == 0) {
                        quantity = 1;
                        j$(escapeVfId('Page:mainForm:block:lists:' + i + ':Quantity')).val(quantity);
                    }
                    j$(escapeVfId('Page:mainForm:block:lists:' + i + ':UnitPrice')).val(customPrice / quantity);
                    setTotalPrice(i);
                } else if (ispm == 'true' || (isPartsdealer == 'true' && (hidset == 'set02' || hidset == 'set03'))) {
                    setTotalPrice(i);
                } else {
                    alert("不能手动修改销售价格。");
                    j$(escapeVfId('Page:mainForm:block:lists:' + i + ':UnitPrice')).val(salesprice);
                }
            }
        }
 
        function setUnitPrice(i) {
            if (j$(escapeVfId('Page:mainForm:block:lists:' + i + ':ProductName')).value() != '') {
                var isPartsdirect = j$(escapeVfId('isPartsdirect')).value();
                if (isPartsdirect == 'true') {
                    var quantity = j$(escapeVfId('Page:mainForm:block:lists:' + i + ':Quantity')).value();
                    var customPrice = j$(escapeVfId('Page:mainForm:block:lists:' + i + ':CustomPrice')).value();
                    if (quantity == 0) {
                        quantity = 1;
                        j$(escapeVfId('Page:mainForm:block:lists:' + i + ':Quantity')).val(quantity);
                    }
                    j$(escapeVfId('Page:mainForm:block:lists:' + i + ':UnitPrice')).val(customPrice / quantity);
                }
            }
        }
 
        function setCPD() {
            var quoteEntryMaxLine = {!quoteEntryMaxLine};
            var total = 0;
            var cnt = 0;
            for (var i = 0; i < quoteEntryMaxLine; i++) {
                if (j$(escapeVfId('Page:mainForm:block:lists:' + i + ':ProductName')).value() != '') {
                    var line = j$(escapeVfId('Page:mainForm:block:lists:' + i + ':TotalPrice')).text();
                    total += localParseFloat(line);
                    cnt += localParseFloat(1);
                }
            }
            var totalCP = j$(escapeVfId('totalCustomPrice')).value();
            j$(escapeVfId('totalCustomPrice')).val(toNum(totalCP));
            var totalCPD = 0;
            for (var i = 0; i < cnt - 1; i++) {
                var line = j$(escapeVfId('Page:mainForm:block:lists:' + i + ':TotalPrice')).text();
                line = localParseFloat(line);
                var lineCP = line / total * totalCP;
                lineCP = lineCP.toFixed(0);
                totalCPD += localParseFloat(lineCP);
                j$(escapeVfId('Page:mainForm:block:lists:' + i + ':CustomPrice')).val(toNum(lineCP));
            }
        }
    </script>
 
    <style type="text/css">
        div#iframelike {
            color: #fff;
            height: 300px;
            overflow: auto;
        }
        div#iframelikeheader {
            color: #fff;
            height: 23px;
            overflow: auto;
        }
        input {
            font-size: 10.5px;
        }
        body {
            font-size: 10.5px;
        }
    </style>
    <apex:form id="mainForm">
 
        <apex:actionFunction action="{!Refresh}" name="Refresh" reRender="mainForm,message1" oncomplete="unblockUI();"/>
 
        <apex:actionFunction action="{!excelImport}" name="excelImport" reRender="mainForm" oncomplete="unblockUI();">
            <apex:param assignTo="{!excel_text}" name="select_index" value=""/>
        </apex:actionFunction>
 
        <apex:actionFunction action="{!Save}" name="Save" reRender="mainForm,message1" oncomplete="unblockUI();"/>
 
        <apex:actionFunction action="{!OppReflection}" name="OppReflection" reRender="mainForm" oncomplete="unblockUI();"/>
 
        <apex:actionFunction action="{!Decide}" name="Decide" reRender="mainForm" oncomplete="unblockUI();"/>
 
        <apex:actionFunction action="{!UnDecide}" name="unDecide" reRender="mainForm" oncomplete="unblockUI();"/>
 
        <apex:actionFunction action="{!BackBtn}" name="BackBtn" reRender="mainForm,message1" />
 
        <apex:pageBlock id="block">
 
            <apex:inputHidden value="{!pricebook2Id}" id="pricebook2Id"/>
            <input type="hidden" value="{!quoId}" id="quoid"/>
            <input type="hidden" value="{!openType}" id="openType"/>
            <input type="hidden" value="{!is_Parts_direct}" id="isPartsdirect"/>
            <input type="hidden" value="{!is_Parts_dealer}" id="isPartsdealer"/>
 
            <apex:outputPanel id="message1">
                <apex:messages styleClass="editListError"/>
            </apex:outputPanel>
 
            <apex:outputPanel rendered="{!errorflg}" >
                <table width="100%">
                    <tr>
                        <td align="left"><div class="errorMsg">{!errorMessage}</div></td>
                    </tr>
                </table>
            </apex:outputPanel>
 
            <apex:outputPanel rendered="{!Messageflg}" >
                <table width="100%">
                    <tr>
                        <td align="left">{!Message}</td>
                    </tr>
                </table>
            </apex:outputPanel>
            <div>
                <table border="0">
                    <tr>
                        <th style="text-align:right;width:90px;">{!$ObjectType.Quote.fields.QuoteNumber.label}</th>
                        <td style="text-align:right;width:130px;"><apex:outputLabel value="{!quo.QuoteNumber}"/></td>
                        <th style="text-align:right;width:90px;">{!$ObjectType.Quote.fields.Name.label}</th>
                        <td style="width:130px;"><apex:inputText value="{!quo.Name}"/></td>
                        <th style="text-align:right;width:90px;">{!$ObjectType.Account.fields.name.label}</th>
                        <td style="text-align:right;width:130px;" colspan="2"><apex:outputLabel value="{!quo.Account.name}"/></td>
                        <td style="text-align:right;width:90px;">&nbsp;</td>
                        <td style="text-align:right;width:130px;">&nbsp;</td>
                    </tr>
                    <tr>
                        <th style="text-align:right;width:90px;">{!$ObjectType.Quote.fields.Subtotal.label}</th>
                        <td style="text-align:right;width:130px;">{!quo.currencyISOCode}&nbsp;<apex:outputText value="{0,number,###,###,##0.00}"><apex:param value="{!quo.Subtotal}"/></apex:outputText></td>
                        <th style="text-align:right;width:90px;">{!$ObjectType.Quote.fields.Discount.label}</th>
                        <td style="text-align:right;width:130px;"><apex:outputField value="{!quo.Discount}"/></td>
                        <th style="text-align:right;width:90px;">{!$ObjectType.Quote.fields.TotalPrice.label}</th>
                        <td style="text-align:right;width:130px;">{!quo.currencyISOCode}&nbsp;<apex:outputText value="{0,number,###,###,##0.00}"><apex:param value="{!quo.TotalPrice}"/></apex:outputText></td>
                        <td style="text-align:right;width:90px;">&nbsp;</td>
                        <td style="text-align:right;width:130px;">&nbsp;</td>
                    </tr>
                    <tr>
                        <th style="text-align:right;width:90px;">{!$ObjectType.Quote.fields.PaymentTerms__c.label}</th>
                        <td style="text-align:left;width:310px;" colspan="3"><apex:inputField value="{!quo.PaymentTerms__c}"/></td>
                        <td style="text-align:right;width:90px;">&nbsp;</td>
                        <td style="text-align:left;width:130px;">&nbsp;</td>
                        <td style="text-align:right;width:90px;">&nbsp;</td>
                        <td style="text-align:left;width:130px;">&nbsp;</td>
                        <td style="text-align:left;width:90px;">&nbsp;</td>
                    </tr>
                    <tr>
                        <th style="text-align:right;width:90px;">{!$ObjectType.Quote.fields.DeliveryLeadTime__c.label}</th>
                        <td style="text-align:left;width:130px;"><apex:inputField value="{!quo.DeliveryLeadTime__c}"/></td>
                        <th style="text-align:right;width:90px;">{!$ObjectType.Quote.fields.Warranty__c.label}</th>
                        <td style="text-align:left;width:130px;"><apex:inputField value="{!quo.Warranty__c}"/></td>
                        <th style="text-align:right;width:90px;">报价到期日期</th>
                        <td style="text-align:left;width:130px;" colspan="2"><apex:inputField value="{!quo.ExpirationDate}"/></td>
                        <td style="text-align:right;width:90px;">&nbsp;</td>
                        <td style="text-align:right;width:130px;">&nbsp;</td>
                    </tr>
                    <tr>
                        <th style="text-align:right;">{!$ObjectType.Quote.fields.Main_Model__c.label}</th>
                        <td style="text-align:left;"><apex:inputField value="{!quo.Main_Model__c}"/></td>
                        <th style="text-align:right;">{!$ObjectType.Quote.fields.Main_Serial_Number__c.label}</th>
                        <td style="text-align:left;"><apex:inputField value="{!quo.Main_Serial_Number__c}"/></td>
                        <th style="text-align:right;">{!$ObjectType.Quote.fields.Service_Type__c.label}</th>
                        <td style="text-align:left;"><apex:inputField value="{!quo.Service_Type__c}" style="width: 90%"/></td>
                        <th style="text-align:right;">{!$ObjectType.Quote.fields.Contract_Number__c.label}</th>
                        <td style="text-align:right;"><apex:inputField value="{!quo.Contract_Number__c}"/></td>
                        <th style="text-align:right;width:90px;">&nbsp;</th>
                        <td style="text-align:right;width:130px;"><apex:commandButton onclick="doRefresh();return false;" value="{!$Label.Status_Update}" style="width:110px;" rerender="dummy"/></td>
                    </tr>
                    <tr>
                        <th style="text-align:right;">{!$ObjectType.Quote.fields.Service_Date__c.label}</th>
                        <td style="text-align:right;"><apex:inputField value="{!quo.Service_Date__c}"/></td>
                        <th style="text-align:right;">{!$ObjectType.Quote.fields.Service_Finish_Date__c.label}</th>
                        <td style="text-align:right;"><apex:inputField value="{!quo.Service_Finish_Date__c}"/></td>
                        <th style="text-align:right;">{!$ObjectType.Quote.fields.Service_Location__c.label}</th>
                        <td style="text-align:left;"><apex:inputField value="{!quo.Service_Location__c}" style="width: 90%"/></td>
                    </tr>
                    <tr>
                        <th style="text-align:right;">{!$ObjectType.Quote.fields.Service_Engineer_Sign__c.label}</th>
                        <td style="text-align:left;"><apex:inputField value="{!quo.Service_Engineer_Sign__c}"/></td>
                        <th style="text-align:right;">{!$ObjectType.Quote.fields.Service_Pickup_Sign__c.label}</th>
                        <td style="text-align:left;"><apex:inputField value="{!quo.Service_Pickup_Sign__c}"/></td>
                        <th style="text-align:right;">{!$ObjectType.Quote.fields.Service_Check_Sign__c.label}</th>
                        <td style="text-align:left;"><apex:inputField value="{!quo.Service_Check_Sign__c}"/></td>
                        <td style="text-align:right;">&nbsp;</td>
                        <td style="text-align:right;">&nbsp;</td>
                        <th style="text-align:right;width:90px;">文件名:</th>
                        <td style="text-align:right;width:130px;"><apex:inputText value="{!fileName}" /></td>
                    </tr>
                    <tr>
                        <th style="text-align:right;vertical-align:top;">{!$ObjectType.Quote.fields.Service_Status__c.label}</th>
                        <td style="text-align:left;" colspan="3"><apex:inputField value="{!quo.Service_Status__c}" style="width:95%;resize:none;"/></td>
                        <th style="text-align:right;vertical-align:top;">{!$ObjectType.Quote.fields.Service_Content__c.label}</th>
                        <td style="text-align:left;" colspan="3"><apex:inputField value="{!quo.Service_Content__c}" style="width:95%;resize:none;"/></td>
                        <th style="text-align:right;width:90px;">&nbsp;</th>
                        <td style="text-align:right;vertical-align:top;width:130px;"><apex:commandButton action="{!csvExport}" value="出力CSV" /></td>
                    </tr>
                </table>
            </div>
 
            <br/>
 
            <table style="width:1080px;" border="0">
                <tr>
                    <th style="text-align:right;width:20px;">&nbsp;</th>
                    <th style="text-align:center;width:80px;">&nbsp;</th>
                    <th style="text-align:center;width:190px;">&nbsp;</th>
                    <th style="text-align:center;width:80px;">&nbsp;</th>
                    <th style="text-align:center;width:110px;">&nbsp;</th>
                    <th style="text-align:right;width:70px;">{!$ObjectType.QuoteLineItem.fields.Discount.label}</th>
                    <th style="text-align:center;width:80px;"><input type="text" id="discount" value="{!quo.Discount}" style="width: 65px;text-align: right;"/></th>
                    <th style="text-align:left;width:110px;">% <input type="button" value="适用" onclick="setall();"/>&nbsp;&nbsp;&nbsp;&nbsp;客户总价</th>
                    <th style="text-align:center;width:120px;"><apex:inputField id="totalCustomPrice" value="{!quo.Custom_Price_Total_Text__c}" style="width: 105px;text-align: right;"/></th>
                    <th style="text-align:left;width:220px;"> <input type="button" value="确定" onclick="setCPD();"/></th>
                </tr>
                <tr>
                    <th style="text-align:right;">No</th>
                    <th style="text-align:center;">{!$ObjectType.QuoteLineItem.fields.Set__c.label}</th>
                    <th style="text-align:center;">{!$ObjectType.Product2.fields.name.label}</th>
                    <th style="text-align:center;">{!$ObjectType.Product2.fields.ProductCode.label}</th>
                    <th style="text-align:center;">{!$ObjectType.QuoteLineItem.fields.UnitPrice.label}</th>
                    <th style="text-align:center;">{!$ObjectType.QuoteLineItem.fields.Quantity.label}</th>
                    <th style="text-align:center;">{!$ObjectType.QuoteLineItem.fields.Discount.label} %</th>
                    <th style="text-align:center;">{!$ObjectType.QuoteLineItem.fields.TotalPrice.label}</th>
                    <th style="text-align:center;">{!$ObjectType.QuoteLineItem.fields.Custom_Price__c.label}</th>
                    <th style="text-align:center;">{!$ObjectType.QuoteLineItem.fields.Description.label}</th>
                </tr>
            </table>
 
            <div id="iframelike" style="width:1098px;">
                <table class="list" style="border-bottom-width: 0px; font-size:11px; border-spacing:0; width:1080px; border-collapse: collapse; table-layout: fixed;" border="0">
                    <apex:variable value="{!1}" var="cnt" />
                    <apex:repeat value="{!activities}" var="s" id="lists">
                        <tr class="dataRow {!IF(MOD(cnt, 2)==0, 'odd', 'even')} {!IF(cnt==1, 'first', '')}" onmouseover="if (window.hiOn){hiOn(this);} " onmouseout="if (window.hiOff){hiOff(this);} " onblur="if (window.hiOff){hiOff(this);}" onfocus="if (window.hiOn){hiOn(this);}">
                            <td class="dataCell" style="width:10px;text-align:left;">
                                <apex:inputHidden id="PbeId" value="{!s.pageObject.PricebookEntryId}"/>
                                <apex:inputHidden id="ProId" value="{!s.pageObject.Product2Id}"/>
                                <apex:inputHidden id="price0" value="{!s.salesPrice}"/>
                                <apex:inputHidden id="price1" value="{!s.salesPriceA}"/>
                                <apex:inputHidden id="price2" value="{!s.salesPriceB}"/>
                                <apex:inputHidden id="price3" value="{!s.salesPriceC}"/>
                                <apex:inputHidden id="hidSet" value="{!s.pageObject.Set__c}"/>
                                <apex:outputLabel id="indexNo" value="{!IF(s.productName==null,null,s.lineNo + 1)}" style="width:90%;text-align:center;"/>
                            </td>
 
                            <td class="dataCell" style="text-align:center;width:70px;">
                                <apex:outputText id="Set" style="width:90%;text-align:right;" value="{!s.setName}"/>
                                <apex:inputHidden id="SetName" value="{!s.setName}"/>
                            </td>
 
                            <td class="dataCell" style="text-align:center;width:170px;">
                                <apex:inputText id="ProductName" style="width:90%;" value="{!s.productName}" onclick="searchProduct('{!s.lineNo}',this.value,'{!s.pageObject.Set__c}')" />
                            </td>
 
                            <td class="dataCell" style="text-align:center;width:70px;">
                                <apex:outputText id="ProductCode" style="width:90%;text-align:right;" value="{!s.productCode}"/>
                                <apex:inputHidden id="ProductCodeHidden" value="{!s.productCode}"/>
                            </td>
 
                            <td class="dataCell" style="text-align:center;width:100px;">
                                <apex:inputText id="UnitPrice" style="width:90%;text-align:right;" value="{!s.pageObject.UnitPrice}" onchange="changeLimit({!cnt-1});"/>
                                <apex:inputHidden id="isProductModel" value="{!s.isProductModel}"/>
                            </td>
 
                            <td class="dataCell" style="text-align:center;width:60px;">
                                <apex:inputText id="Quantity" style="width:90%;text-align:right;" value="{!s.pageObject.Quantity}" onchange="setUnitPrice({!cnt-1});setTotalPrice({!cnt-1});"/>
                            </td>
 
                            <td class="dataCell" style="text-align:center;width:70px;">
                                <apex:inputText id="Discount" style="width:90%;text-align:right;" value="{!s.pageObject.Discount}" onchange="setTotalPrice({!cnt-1})"/>
                            </td>
 
                            <td class="dataCell" style="text-align:center;width:100px;">
                                <apex:outputText id="TotalPrice" style="width:90%;text-align:right;" value="{0, number, ###,##0.00}">
                                    <apex:param value="{!s.totalPrice}" />
                                </apex:outputText>
                            </td>
 
                            <td class="dataCell" style="text-align:center;width:110px;">
                                <apex:inputText id="CustomPrice" style="width:90%;text-align:right;" value="{!s.pageObject.Custom_Price__c}" onchange="setUnitPrice({!cnt-1})"/>
                            </td>
 
                            <td class="dataCell" style="text-align:center;width:200px;">
                                <apex:inputText id="Description" style="width:90%;text-align:left;" value="{!s.pageObject.Description}"/>
                            </td>
                        </tr>
                        <apex:variable value="{!cnt + 1}" var="cnt" />
                    </apex:repeat>
                </table>
            </div>
            <BR></BR>
 
            <div>
                <table border="0">
                    <tr>
                        <td colspan="1">&nbsp;</td>
                        <th colspan="7">{!$ObjectType.Quote.fields.Comment__c.label}</th>
                        <td colspan="3">&nbsp;</td>
                    </tr>
                    <tr>
                        <td colspan="1">&nbsp;</td>
                        <td colspan="7"><apex:inputTextarea id="comment" value="{!quo.Comment__c}" rows="5" style="width: 100%;resize: none;"/></td>
                        <th style="text-align:right;width:50px;">&nbsp;</th>
                        <td colspan="2"><apex:commandButton onclick="undecidebtn();" value="{!$Label.UnDecide_Button}" style="width:110px;" rerender="dummy" disabled="{!!isdecide || !isAdmin}" rendered="{!isAdmin}"/></td>
                    </tr>
                    <tr>
                        <th style="text-align:right;width:50px;">&nbsp;</th>
                        <td style="text-align:right;width:110px;"><apex:commandButton onclick="save2btn();return false;" value="{!$Label.Save_Button}" style="width:110px;" rerender="dummy" disabled="{!isdecide}"/></td>
 
                        <th style="text-align:right;width:50px;">&nbsp;</th>
                        <td style="text-align:right;width:110px;"><apex:commandButton onclick="oppReflection2btn();" value="{!$Label.Save_Close_Button}" style="width:110px;" rerender="dummy" disabled="{!isdecide}"/></td>
 
                        <th style="text-align:right;width:50px;">&nbsp;</th>
                        <td style="text-align:right;width:110px;"><apex:commandButton onclick="decidebtn();" value="{!$Label.Decide_Button}" style="width:110px;" rerender="dummy" disabled="{!decideFlg || isdecide}"/></td>
 
                        <th style="text-align:right;width:50px;">&nbsp;</th>
                        <td style="width:110px;" align="right"><apex:commandButton onclick="backbtn();" value="{!$Label.NoSave_Return_Button}" style="width:90px;" rerender="dummy"/></td>
 
                        <th style="text-align:right;width:50px;">&nbsp;</th>
                        <td style="width:110px;" align="right"><apex:commandButton onclick="printPDF();" value="打印PDF" style="width:110px;" rerender="dummy" disabled="{!!printFlg}"/></td>
 
                        <td width="120px">打印明细价格&nbsp;<input type="checkbox" id="isPrintPrice"/></td>
 
                    </tr>
                </table>
            </div>
        </apex:pageBlock>
    </apex:form>
    <apex:form id="fileForm">
        <table border="0">
            <tr>
                <th>报价导入:</th>
                <th>1.<apex:inputFile value="{!contentFile}" filename="{!nameFile}"/></th>
            </tr>
            <tr>
                <th>&nbsp;</th>
                <th>2.&nbsp;<apex:commandButton action="{!csvRead}" value="读取CSV"/></th>
            </tr>
        </table>
    </apex:form>
</apex:page>