李彤
2023-05-17 b9055688b13a23f8e445de2bc3d5d0d2b85fec30
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
<apex:page standardcontroller="Lost_cancel_report__c" extensions="PCLLostReportController" showHeader="false" sidebar="false"
    id="allPage" action="{!init}" title="询价失单/取消报告">
    <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}" />
 
    <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}" />
    <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}" />
    <apex:form id="allForm">
        <script>
            // 20230418 ljh DB202304320022 start
            window.onload = function init(){
                clearBrandMannualName();
            }
            // 20230418 ljh DB202304320022 end
            function saveJs() {
                blockme();
                save();
            }
            function addBrandJs() {
                blockme();
                addBrand();
            }
            function submitJS() {
                blockme();
                submit();
            }
            function addProductJs(number) {
                blockme();
                addProduct(number);
            }
            function RemoveJs(number) {
                blockme();
                Remove(number);
            }
            // add tcm 20211118 start
            function searchJs(topNum, secondNum) {
                blockme();
                search(topNum, secondNum);
            }
            // add tcm 20211118 end
            // 20230418 ljh DB202304320022 start
            function edit2JS() {
                blockme();
                edit2();
            }
            // 20230418 ljh DB202304320022 end
            function setLostTotalAmount() {
                //console.log('setLostTotalAmount start:');
                var totalAmount = document.getElementById("allPage:allForm:allBlock:EditPage:LostReport:lstReport:LostTotalAmountOut:LostTotalAmount");
                var totalAmountHidden = document.getElementById("allPage:allForm:allBlock:LostTotalAmount");
                if (!!totalAmount && !!totalAmountHidden) {
                    var tempLostAmount = 0.0;
                    var i = 0;
                    var brandCount = parseInt("{!brandCount}");
                    //console.log(brandCount);
 
                    for (var i = 0; i < brandCount; i++) {
                        var brandAmountObject =
                            document.getElementById("allPage:allForm:allBlock:EditPage:LostBrands:" +
                                i + ":LostBrand:BrandContent:LostPriceOut:LostPrice");
                        var brandCompanyObject =
                            document.getElementById("allPage:allForm:allBlock:EditPage:LostBrands:" +
                                i + ":LostBrand:BrandContent:Lost_By_CompanyOut:Lost_By_Company");
 
                        if (!!brandAmountObject && !!brandCompanyObject) {
 
                            var brandCompanyText = brandCompanyObject.innerText;
                            var brandCompanyValue = brandCompanyObject.value;
 
 
                            if (!!brandCompanyText && brandCompanyText != '--无--' && !!brandCompanyValue) {
                                var brandAmount = localParseFloat(brandAmountObject.value);
                                //console.log('brandAmount:'+brandAmount);
                                tempLostAmount = tempLostAmount + brandAmount;
                            }
                        }
                    }
                    totalAmount.innerHTML = toNumComma(tempLostAmount);
                    totalAmountHidden.value = tempLostAmount;
                }
                //console.log('setLostTotalAmount end');
            }
 
            //20230506 lt DB202304618804  包含超声  start
            function setInclusionUltrasound() {
                debugger
                //包含超声
                // var Inc = document.getElementById("allPage:allForm:allBlock:ReadPage:LostReport:lstReport1:InclusionUltrasoundOut1:InclusionUltrasound");
                // //​失单产品类别
                // var Inc = document.getElementById("allPage:allForm:allBlock:ReadPage:LostReport:lstReport1:InclusionUltrasoundOut1:InclusionUltrasound");
                // //失单产品区分
                // var Inc = document.getElementById("allPage:allForm:allBlock:ReadPage:LostReport:lstReport1:InclusionUltrasoundOut1:InclusionUltrasound");
 
                var Inc = document.getElementById("allPage:allForm:allBlock:EditPage:LostReport:lstReport1:InclusionUltrasoundOut:InclusionUltrasound");
                var IncHidden = document.getElementById("allPage:allForm:allBlock:InclusionUltrasound");
                
                if(Inc == null || Inc == undefined){
                    Inc = '0';
                }
                
                // if (!!Inc && !!IncHidden) {
                    var tempInc = '0';
 
                    //失单品牌
                    var i = 0;
                    var brandCount = parseInt("{!brandCount}");
                    //失单型号
                    var j = 0;
 
                    for (var i = 0; i < brandCount; i++){
                        for (var j = 0; j < 10; j++) {
                            //​失单产品类别
                            //allPage:allForm:allBlock:ReadPage:LostBrands:0:LostBrand:productTable:0:LostPRoductClass
                            // var LostProClassObject =
                            //     document.getElementById("allPage:allForm:allBlock:EditPage:LostBrands:" +
                            //         i + ":LostBrand:productTable:"+ j +":LostPRoductClass1");
                            var LostProClassObject = j$(escapeVfId('allPage:allForm:allBlock:EditPage:LostBrands:' +
                                                     i + ':LostBrand:productTable:'+ j +':LostPRoductClass1')).value();
 
                            var LostProClassObject1 = j$(escapeVfId('allPage:allForm:allBlock:EditPage:LostBrands:' +
                                                     i + ':LostBrand:productTable:'+ j +':LostPRoductClass')).value();
                            //失单产品区分
                            //allPage:allForm:allBlock:ReadPage:LostBrands:0:LostBrand:productTable:0:LostProductCategory
                            // var LostProCategoryObject =
                            //     document.getElementById("allPage:allForm:allBlock:EditPage:LostBrands:" +
                            //         i + ":LostBrand:productTable:"+ j +":LostProductCategory1");
                            var LostProCategoryObject = j$(escapeVfId('allPage:allForm:allBlock:EditPage:LostBrands:' +
                                                     i + ':LostBrand:productTable:'+ j +':LostProductCategory1')).value();
 
                            var LostProCategoryObject1 = j$(escapeVfId('allPage:allForm:allBlock:EditPage:LostBrands:' +
                                                     i + ':LostBrand:productTable:'+ j +':LostProductCategory')).value();
                            
                            if(tempInc != '1'){
                                if((LostProClassObject == '主机' && LostProCategoryObject == '超声主机') || (LostProClassObject1 == '主机' && LostProCategoryObject1 == '超声主机')){
                                    tempInc = '1';
                                }
                            }
 
                            // if (!!LostProClassObject && !!LostProCategoryObject) {
 
                            //     var LostProClassText = LostProClassObject.innerText;
                            //     var LostProClassValue = LostProClassObject.value;
 
                            //     var LostProCategoryText = LostProCategoryObject.innerText;
                            //     var LostProCategoryValue = LostProCategoryObject.value;
 
                            // }
                        }
                    }
                    
                    Inc.innerText = tempInc;
                    IncHidden.value = tempInc;
 
                // }
 
            }
            //20230506 lt DB202304618804  包含超声  end
 
            function setBrandName(brandNumber) {
                blockme();
                setbrand(brandNumber);
            }
            function setBrandMannualName(brandNumber) {
                blockme();
                setbrandmannual(brandNumber);
            }
            // 失单品牌不等于其他时,失单品牌(手动)清空并且不允许填写,失单品牌等于其他时,失单对手型号不可用  thh 2022-01-13 start
            // function clearBrandMannualName(){
            //     if(document.getElementById('allPage:allForm:allBlock:EditPage:LostBrands:0:LostBrand:BrandContent:Lost_By_CompanyOut:Lost_By_Company').value == '其他'){
            //         j$(escapeVfId('allPage:allForm:allBlock:EditPage:LostBrands:0:LostBrand:productTable:0:LostProduct')).attr("disabled", true);
            //     } else{
            //         document.getElementById('allPage:allForm:allBlock:EditPage:LostBrands:0:LostBrand:BrandContent:Lost_By_Company_MannualOut:Lost_By_Company_Mannual').value = '';
            //         j$(escapeVfId('allPage:allForm:allBlock:EditPage:LostBrands:0:LostBrand:BrandContent:Lost_By_Company_MannualOut:Lost_By_Company_Mannual')).attr("disabled", true);
            //     }
            // }
            // 20230418 ljh DB202304320022 start
            function clearBrandMannualName(){ 
                var pageStatus = "{!pageStatus}";
                if(pageStatus == 'Create'|| pageStatus == 'Edit'){
                    var brandCount = parseInt("{!brandCount}");
                    for(var i = 0;i<brandCount;i++){
                        if(document.getElementById('allPage:allForm:allBlock:EditPage:LostBrands:'+i+':LostBrand:BrandContent:Lost_By_CompanyOut:Lost_By_Company').value == '其他'){
                            if(document.getElementById('allPage:allForm:allBlock:EditPage:LostBrands:'+i+':LostBrand:BrandContent:Lost_By_Company_MannualOut:Lost_By_Company_Mannual').value == '' || document.getElementById('allPage:allForm:allBlock:EditPage:LostBrands:'+i+':LostBrand:BrandContent:Lost_By_Company_MannualOut:Lost_By_Company_Mannual').value == null){
                                j$(escapeVfId('allPage:allForm:allBlock:EditPage:LostBrands:'+i+':LostBrand:productTable:0:LostProduct')).attr("disabled", true);
                            }
                        } else{
                            document.getElementById('allPage:allForm:allBlock:EditPage:LostBrands:'+i+':LostBrand:BrandContent:Lost_By_Company_MannualOut:Lost_By_Company_Mannual').value = '';
                            j$(escapeVfId('allPage:allForm:allBlock:EditPage:LostBrands:'+i+':LostBrand:BrandContent:Lost_By_Company_MannualOut:Lost_By_Company_Mannual')).attr("disabled", true);
                        }
                    }
                }
            }
            // 20230418 ljh DB202304320022 end
            // 失单品牌不等于其他时,失单品牌(手动)清空并且不允许填写,失单品牌等于其他时,失单对手型号不可用  thh 2022-01-13 end
        </script>
        <apex:actionFunction name="save" action="{!save}" oncomplete="unblockUI();clearBrandMannualName();" rerender="allForm,EditButton2"></apex:actionFunction>
        <!-- 失单品牌不等于其他时,失单品牌(手动)清空并且不允许填写,失单品牌等于其他时,失单对手型号不可用  thh 2022-01-13 start -->
        <apex:actionFunction name="setbrand" action="{!setbrand}" oncomplete="clearBrandMannualName();unblockUI();" rerender="allForm">
            <apex:param assignTo="{!setBrandNo}" name="setBrandNo" value="" />
        </apex:actionFunction>
        <!-- 失单品牌不等于其他时,失单品牌(手动)清空并且不允许填写,失单品牌等于其他时,失单对手型号不可用  thh 2022-01-13 end -->
 
        <!-- 20230418 ljh DB202304320022 start -->
        <!-- <apex:actionFunction name="setbrandmannual" action="{!setbrandmannual}" oncomplete="unblockUI();" rerender="allForm"> -->
        <apex:actionFunction name="setbrandmannual" action="{!setbrandmannual}" oncomplete="clearBrandMannualName(),unblockUI();" rerender="allForm">
        <!-- 20230418 ljh DB202304320022 end -->
            <apex:param assignTo="{!setBrandNo}" name="setBrandNo" value="" />
        </apex:actionFunction>
 
        <apex:actionFunction name="submit" action="{!submit}" oncomplete="unblockUI();" rerender="allForm,EditButton2"></apex:actionFunction>
        <!-- 20230418 ljh DB202304320022 start -->
        <apex:actionFunction name="edit2" action="{!edit2}" oncomplete="clearBrandMannualName(),unblockUI();" rerender="allForm,EditButton2"></apex:actionFunction>
        <!-- <apex:actionFunction name="addBrand" action="{!addBrand}" oncomplete="unblockUI();" rerender="allForm,EditButton2"></apex:actionFunction> -->
        <apex:actionFunction name="addBrand" action="{!addBrand}" oncomplete="clearBrandMannualName(),unblockUI();" rerender="allForm,EditButton2"></apex:actionFunction>
        
        <!-- <apex:actionFunction action="{!addProduct}" name="addProduct" reRender="allForm" oncomplete="unblockUI();"> -->
        <apex:actionFunction action="{!addProduct}" name="addProduct" reRender="allForm" oncomplete="clearBrandMannualName(),unblockUI();">
        <!-- 20230418 ljh DB202304320022 end -->
            <apex:param assignTo="{!brandNo}" name="brandNo" value="" />
        </apex:actionFunction>
        <!-- 20230418 ljh DB202304320022 start -->
        <!-- <apex:actionFunction action="{!Remove}" name="Remove" reRender="allForm" oncomplete="unblockUI();"> -->
        <apex:actionFunction action="{!Remove}" name="Remove" reRender="allForm" oncomplete="clearBrandMannualName(),unblockUI();">
        <!-- 20230418 ljh DB202304320022 end -->
            <apex:param assignTo="{!RemoveBrandNo}" name="RemoveBrandNo" value="" />
        </apex:actionFunction>
        <!-- add tcm 20211118 start -->
        <!-- 20230418 ljh DB202304320022 start -->
        <!-- <apex:actionFunction action="{!search}" name="search" reRender="allForm" oncomplete="unblockUI();"> -->
        <apex:actionFunction action="{!search}" name="search" reRender="allForm" oncomplete="clearBrandMannualName(),unblockUI();">
        <!-- 20230418 ljh DB202304320022 end -->
            <apex:param assignTo="{!topNum}" name="topNum" value="" />
            <apex:param assignTo="{!secondNum}" name="secondNum" value="" />
        </apex:actionFunction>
        <!-- add tcm 20211118 start -->
        <apex:pageBlock id="allBlock">
            <apex:outputPanel id="message">
                <apex:pageMessages />
            </apex:outputPanel>
            <apex:inputHidden id="LostTotalAmount" value="{!LostReport.lostReport.LostTotalAmount__c}" />
 
            <apex:inputHidden id="InclusionUltrasound" value="{!InclusionUltrasound}" /> <!-- 20230506 lt DB202304618804  包含超声  add -->
            
            <apex:outputPanel rendered="{!IF(pageStatus == 'Create'|| pageStatus == 'Edit' , 'true', 'false')}">
                <apex:pageBlock title="失单报告编辑页面" id="EditPage">
                    <apex:pageBlockSection columns="3" id="LostReport">
                        <apex:pageBlockSectionItem id="lstReport" labelStyle="text-align:left;">
                            <apex:pageBlockSectionItem labelStyle="text-align:left;">
                                <apex:outputLabel value="失单类型: ">
                                    <span style="color:red;font-size: 18px;">* </span>
                                </apex:outputLabel>
                                <apex:inputField id="LostType" value="{!LostReport.lostReport.LostType__c}" />
                            </apex:pageBlockSectionItem>
                            <apex:pageBlockSectionItem id="LostTotalAmountOut" labelStyle="text-align:left;">
                                <apex:outputLabel value="失单总金额(元): "></apex:outputLabel>
                                <apex:outputField id="LostTotalAmount" value="{!LostReport.lostReport.LostTotalAmount__c}" />
                            </apex:pageBlockSectionItem>
                        </apex:pageBlockSectionItem>
 
                    <!-- 20230506 lt DB202304618804  包含超声  start -->
                    <apex:pageBlockSectionItem id="lstReport1" labelStyle="text-align:left;">
 
                        <apex:pageBlockSectionItem id="InclusionUltrasoundOut" labelStyle="text-align:left;">
                            <apex:outputLabel value="包含超声: "></apex:outputLabel>
                            <apex:outputLabel id="InclusionUltrasound" value="{!InclusionUltrasound}" />
                        </apex:pageBlockSectionItem>
 
                        <apex:pageBlockSectionItem id="Report_Statusout" labelStyle="text-align:left;">
                            <apex:outputLabel value="状态: "></apex:outputLabel>
                            <apex:outputField id="Report_Status" value="{!LostReport.lostReport.Report_Status__c}" />
                        </apex:pageBlockSectionItem>
 
                    </apex:pageBlockSectionItem>
                    <!-- 20230506 lt DB202304618804  包含超声  end -->
 
                    </apex:pageBlockSection>
                    <apex:variable value="{!0}" var="BCnt" />
                    <apex:repeat value="{!LostReport.LostBrands}" var="brand" id="LostBrands">
                        <apex:pageBlockSection columns="1" id="LostBrand" collapsible="true" showHeader="true">
                            <apex:facet name="header">
                                <apex:outputPanel >
                                    <apex:outputText id="LostBrandName" value="失单品牌{!brand.lineNo + 1}" />
                                    <apex:commandButton rendered="{!IF(brandCount > 1 , 'true', 'false')}" onclick="RemoveJs({!brand.lineNo});return false;"
                                        value="删除" style="width: 100px;margin-left: 50px;float: right;" />
                                    <apex:commandButton onclick="setInclusionUltrasound();saveJs();return false;" value="保存" style="width: 100px;margin-left: 50px;float: right;" />
                                </apex:outputPanel>
                            </apex:facet>
                            <apex:pageBlockSection id="BrandContent" columns="3">
                                <apex:pageBlockSectionItem id="Lost_By_CompanyOut" dataStyle="width:10%;border-top:2px solid;border-left:2px solid; border-right:2px solid;"
                                    labelStyle="width:23%;white-space:none;text-align:left;border-top:2px solid;border-left:2px solid ">
                                    <apex:outputLabel value="失单品牌:">
                                        <span style="color:red;font-size: 18px;">* </span>
                                    </apex:outputLabel>
                                    <!-- 20230506 lt DB202304618804  包含超声  add setInclusionUltrasound(); -->
                                    <apex:inputField id="Lost_By_Company" onchange="setLostTotalAmount();setInclusionUltrasound();setBrandName({!brand.lineNo});" value="{!brand.lostBrand.Lost_By_Company__c}"/>
                                </apex:pageBlockSectionItem>
 
                                <apex:pageBlockSectionItem dataStyle="width:10%;border-top:2px solid;border-left:2px solid;border-bottom:2px solid;" labelStyle="width:23%;white-space:none;text-align:left;border-top:2px solid; solid ;border-bottom:2px solid;">
                                    <apex:outputLabel value="失单原因(主):">
                                        <span style="color:red;font-size: 18px;">* </span>
                                    </apex:outputLabel>
                                    <apex:inputField id="Lost_reason_main" value="{!brand.lostBrand.Lost_reason_main__c}" />
                                </apex:pageBlockSectionItem>
 
                                <apex:pageBlockSectionItem dataStyle="width:10%;border-top:2px solid;border-left:2px solid;border-bottom:2px solid;border-right:2px solid;"
                                    labelStyle="width:23%;white-space:none;text-align:left;border-top:2px solid ;border-left:2px solid;border-bottom:2px solid;">
                                    <apex:outputLabel value="失单原因(次):"> </apex:outputLabel>
                                    <apex:inputField id="Lost_Reason_Sub" value="{!brand.lostBrand.Lost_Reason_Sub__c}" />
                                </apex:pageBlockSectionItem>
                                <apex:pageBlockSectionItem id="Lost_By_Company_MannualOut" dataStyle="width:10%;border-top:2px solid;border-left:2px solid;border-bottom:2px solid;border-right:2px solid;"
                                    labelStyle="width:23%;text-align:left;border-top:2px solid ;border-left:2px solid;border-bottom:2px solid;">
                                    <apex:outputLabel value="失单品牌(手动):"> 
                                        <!-- fy SWAG-CCC6F6 start-->
                                        <apex:variable value="identif" var="identif" rendered="{!IF(brand.lostBrand.Lost_By_Company__c == '其他', true, false)}" id="identifier2">
                                        <span style="color:red;font-size: 18px;">* </span>
                                        </apex:variable>
                                        <!-- fy SWAG-CCC6F6 end-->
                                    </apex:outputLabel>
                                    <apex:inputField id="Lost_By_Company_Mannual" value="{!brand.lostBrand.Lost_By_Company_Mannual__c}" onchange="setBrandMannualName({!brand.lineNo});"/>
                                </apex:pageBlockSectionItem>
 
                                <apex:pageBlockSectionItem id="LostPriceOut" dataStyle="width:10%;border-left:2px solid;border-bottom:2px solid;" labelStyle="width:23%;text-align:left;border-bottom:2px solid;">
                                    <apex:outputLabel value="失单金额(元):">
                                        <span style="color:red;font-size: 18px;">* </span>
                                    </apex:outputLabel>
                                    <apex:inputField id="LostPrice" onchange="setLostTotalAmount();" value="{!brand.lostBrand.LostPrice__c}" />
                                </apex:pageBlockSectionItem>
 
                                <apex:pageBlockSectionItem id="AgencyOut" dataStyle="width:10%;border-left:2px solid;border-bottom:2px solid;border-right:2px solid;"
                                    labelStyle="width:23%;text-align:left;border-left:2px solid ;border-bottom:2px solid;">
                                    <apex:outputLabel value="中标经销商:">
                                        <span style="color:red;font-size: 18px;">* </span>
                                    </apex:outputLabel>
                                    <apex:inputField id="Agency" value="{!brand.lostBrand.Agency__c}" />
                                </apex:pageBlockSectionItem>
 
                                <apex:pageBlockSectionItem id="AgencyMannualOut" dataStyle="width:10%;border-right:2px solid;border-left:2px solid;border-bottom:2px solid;"
                                    labelStyle="width:23%;text-align:left;border-bottom:2px solid;border-left:2px solid;">
                                    <apex:outputLabel value="中标经销商(手动):"> </apex:outputLabel>
                                    <apex:inputField id="AgencyMannual" value="{!brand.lostBrand.AgencyMannual__c}" />
                                </apex:pageBlockSectionItem>
                                <!-- add tcm 20211124 start -->
                                <apex:pageBlockSectionItem id="AgencyMannualOut1" dataStyle="width:10%;" labelStyle="width:23%;text-align:left;">
                                    <apex:outputLabel value=" "> </apex:outputLabel>
                                    <apex:outputLabel id="AgencyMannual" value=" " />
                                </apex:pageBlockSectionItem>
                                <apex:pageBlockSectionItem id="AgencyMannualOut2" dataStyle="width:10%;" labelStyle="width:23%;text-align:left;">
                                    <apex:outputLabel value=" "> </apex:outputLabel>
                                    <apex:outputLabel id="AgencyMannual" value=" " />
                                </apex:pageBlockSectionItem>
                                <!-- add tcm 20211124 start -->
                            </apex:pageBlockSection>
                            <!-- update tcm 20211119 由于数据重构,product后添加LostProductss start -->
                            <apex:pageBlockTable value="{!brand.LostProducts}" var="product" id="productTable" style="border-bottom-width: 0px; font-size:13px;width:80%"
                                border="0" cellspacing="0" cellpadding="0">
                                <apex:column headerValue="失单品牌">
                                    <!-- test -->
                                    <!-- <apex:outputPanel style="display:none">
                                        <apex:inputField id="CompetitorIn" value="{!product.LostProductss.Competitor__c}" />
                                    </apex:outputPanel>
                                    <apex:outputPanel style="display: inline-block;">
                                        <apex:outputField id="CompetitorOut" value="{!product.LostProductss.Competitor__c}" />
                                    </apex:outputPanel> -->
                                    <apex:inputField id="LostBrandName_1" value="{!product.LostProductss.LostBrandName__c}" />
                                    <script>
                                        j$(escapeVfId('allPage:allForm:allBlock:EditPage:LostBrands:{!brand.lineNo}:LostBrand:productTable:{!product.lineNo2}:LostBrandName_1')).attr("disabled", true);
                                    </script>
                                </apex:column>
                                <apex:column headerValue="失单对手型号">
                                    <apex:inputField id="LostProduct" value="{!product.LostProductss.LostProduct__c}" onchange="searchJs({!brand.lineNo},{!product.lineNo2});"/>
                                </apex:column>
                                <apex:column headerValue="失单数量">
                                    <span style="color:red;font-size: 18px;">* </span>
                                    <!-- 20230506 lt DB202304618804  包含超声  add onclick="setInclusionUltrasound();" -->
                                    <apex:inputField id="Quantity" style="min-width: 150px;" value="{!product.LostProductss.Quantity__c}" onclick="setInclusionUltrasound();" />
                                </apex:column>
                                <!-- SWAG-C6P9PX lt 20210913 add start -->
                                <apex:column headerValue="失单对手型号(手动)">
                                    <apex:inputField id="LostProductMannual" value="{!product.LostProductss.LostProductMannual__c}" />
                                </apex:column>
                                <!-- SWAG-C6P9PX lt 20210913 add end -->
                                <!-- tcm 20211117 add start -->
                                <apex:column headerValue="失单产品类别">
                                    <span style="color:red;font-size: 18px;">* </span>
                                    <apex:outputPanel rendered="{!IF(product.bool=true,true,false)}">
                                        <apex:outputField id="LostPRoductClass1" value="{!product.LostProductss.ProductClass__c}" />
                                    </apex:outputPanel>
                                    <apex:outputPanel rendered="{!!IF(product.bool==true,true,false)}" > 
                                        <apex:inputField id="LostPRoductClass" value="{!product.LostProductss.ProductClass__c}" />
                                    </apex:outputPanel>
                                </apex:column>
                                <apex:column headerValue="失单产品区分">
                                    <span style="color:red;font-size: 18px;">* </span>
                                    <apex:outputPanel rendered="{!IF(product.bool=true,true,false)}">
                                        <apex:outputField id="LostProductCategory1" value="{!product.LostProductss.ProductCategory__c}" />
                                    </apex:outputPanel>
                                    <apex:outputPanel rendered="{!!IF(product.bool==true,true,false)}">
                                        <!-- 20230506 lt DB202304618804  包含超声  add onchange="setInclusionUltrasound();" -->
                                        <apex:inputField id="LostProductCategory" value="{!product.LostProductss.ProductCategory__c}" onchange="setInclusionUltrasound();"/>
                                    </apex:outputPanel>
                                </apex:column>
                                <!-- tcm 20211117 add end -->
                                <apex:column style="width:10%" headerValue="+">
                                    <apex:image id="plusicon" value="{!$Resource.plusicon}" onclick="addProductJs({!brand.lineNo});" />
                                </apex:column>
                            </apex:pageBlockTable>
                            <!-- update tcm 20211119 由于数据重构,product后添加LostProductss end -->
                        </apex:pageBlockSection>
                        <apex:variable value="{!BCnt+1}" var="BCnt" />
                    </apex:repeat>
                    <apex:pageBlockButtons >
                        <apex:commandButton onclick="addBrandJs();return false;" value="追加品牌" style="width: 150px;margin-left: 50px;" />
                        <apex:commandButton onclick="setInclusionUltrasound();saveJs();return false;" value="保存" style="width: 150px;margin-left: 50px;" />
                        <apex:commandButton id="CancelButton" action="{!cancel}" value="返回询价" style="width: 150px;margin-left: 50px;" />
                    </apex:pageBlockButtons>
                </apex:pageBlock>
            </apex:outputPanel>
            <apex:outputPanel rendered="{!IF(pageStatus == 'View', 'true', 'false')}">
                <apex:pageBlock title="失单报告查看页面" id="ReadPage">
                    <apex:pageBlockSection columns="3" id="LostReport">
                        <apex:pageBlockSectionItem labelStyle="text-align:left;">
                            <apex:pageBlockSectionItem labelStyle="text-align:left;">
                                <apex:outputLabel value="失单类型: "></apex:outputLabel>
                                <apex:outputField id="LostType" value="{!LostReport.lostReport.LostType__c}" />
                            </apex:pageBlockSectionItem>
                            <apex:pageBlockSectionItem labelStyle="text-align:left;">
                                <apex:outputLabel value="失单总金额(元): "></apex:outputLabel>
                                <apex:outputField id="LostTotalAmount" value="{!LostReport.lostReport.LostTotalAmount__c}" />
                            </apex:pageBlockSectionItem>
 
                        </apex:pageBlockSectionItem>
 
                        <!-- 20230506 lt DB202304618804  包含超声  start -->
                        <apex:pageBlockSectionItem id="lstReport1" labelStyle="text-align:left;">
 
                            <apex:pageBlockSectionItem id="InclusionUltrasoundOut1" labelStyle="text-align:left;">
                                <apex:outputLabel value="包含超声: "></apex:outputLabel>
                                <apex:outputLabel id="InclusionUltrasound" value="{!InclusionUltrasound}" />
                            </apex:pageBlockSectionItem>
 
                            <apex:pageBlockSectionItem id="Report_Statusout" labelStyle="text-align:left;">
                                <apex:outputLabel value="状态: "></apex:outputLabel>
                                <apex:outputField id="Report_Status" value="{!LostReport.lostReport.Report_Status__c}" />
                            </apex:pageBlockSectionItem>
 
                        </apex:pageBlockSectionItem>
                            
                        <!-- 20230506 lt DB202304618804  包含超声  end -->
 
                        
                    </apex:pageBlockSection>
                    <apex:variable value="{!0}" var="BCnt" />
                    <apex:repeat value="{!LostReport.LostBrands}" var="brand" id="LostBrands">
                        <apex:pageBlockSection columns="1" id="LostBrand" collapsible="true" showHeader="true">
                            <apex:facet name="header">失单品牌{!brand.lineNo + 1}</apex:facet>
                            <apex:pageBlockSection id="BrandContent" columns="3">
                                <apex:pageBlockSectionItem id="Lost_By_CompanyOut" dataStyle="width:10%;border-top:2px solid;border-left:2px solid; border-right:2px solid;"
                                    labelStyle="width:23%;text-align:left;border-top:2px solid;border-left:2px solid ">
                                    <apex:outputLabel value="失单品牌:">
                                        <span style="color:red;font-size: 18px;">* </span>
                                    </apex:outputLabel>
                                    <apex:outputtext style="display: inline-block;min-width: 250px" id="Lost_By_Company" value="{!brand.lostBrand.Lost_By_Company__c}"
                                    />
                                </apex:pageBlockSectionItem>
 
                                <apex:pageBlockSectionItem dataStyle="width:10%;border-top:2px solid;border-left:2px solid;border-bottom:2px solid;" labelStyle="width:23%;text-align:left;border-top:2px solid;border-bottom:2px solid;">
                                    <apex:outputLabel value="失单原因(主):">
                                        <span style="color:red;font-size: 18px;">* </span>
                                    </apex:outputLabel>
                                    <apex:outputtext style="display: inline-block;min-width: 250px" id="Lost_reason_main" value="{!brand.lostBrand.Lost_reason_main__c}"
                                    />
                                </apex:pageBlockSectionItem>
 
                                <apex:pageBlockSectionItem dataStyle="width:10%;border-top:2px solid;border-left:2px solid;border-bottom:2px solid;border-right:2px solid;"
                                    labelStyle="width:23%;text-align:left;border-top:2px solid ;border-left:2px solid;border-bottom:2px solid;">
                                    <apex:outputLabel value="失单原因(次):"> </apex:outputLabel>
                                    <apex:outputtext style="display: inline-block;min-width: 250px" id="Lost_Reason_Sub" value="{!brand.lostBrand.Lost_Reason_Sub__c}"
                                    />
                                </apex:pageBlockSectionItem>
 
                                <apex:pageBlockSectionItem dataStyle="width:10%;border-top:2px solid;border-left:2px solid;border-bottom:2px solid;border-right:2px solid;"
                                    labelStyle="width:23%;text-align:left;border-top:2px solid ;border-left:2px solid;border-bottom:2px solid;">
                                    <apex:outputLabel value="失单品牌(手动):"> </apex:outputLabel>
                                    <apex:outputField id="Lost_By_Company_Mannual" value="{!brand.lostBrand.Lost_By_Company_Mannual__c}" />
                                </apex:pageBlockSectionItem>
 
                                <apex:pageBlockSectionItem id="LostPriceOut" dataStyle="width:10%;border-left:2px solid;border-bottom:2px solid;" labelStyle="width:23%;text-align:left;border-bottom:2px solid;">
                                    <apex:outputLabel value="失单金额(元):">
                                        <span style="color:red;font-size: 18px;">* </span>
                                    </apex:outputLabel>
                                    <apex:outputField id="LostPrice" value="{!brand.lostBrand.LostPrice__c}" />
                                </apex:pageBlockSectionItem>
 
                                <apex:pageBlockSectionItem id="AgencyOut" dataStyle="width:10%;border-left:2px solid;border-bottom:2px solid;border-right:2px solid;"
                                    labelStyle="width:23%;text-align:left;border-left:2px solid ;border-bottom:2px solid;">
                                    <apex:outputLabel value="中标经销商:">
                                        <span style="color:red;font-size: 18px;">* </span>
                                    </apex:outputLabel>
                                    <apex:outputField id="Agency" value="{!brand.lostBrand.Agency__c}" />
                                </apex:pageBlockSectionItem>
 
                                <apex:pageBlockSectionItem id="AgencyMannualOut" dataStyle="width:10%;border-right:2px solid;border-left:2px solid;border-bottom:2px solid;"
                                    labelStyle="width:23%;text-align:left;border-bottom:2px solid;border-left:2px solid;">
                                    <apex:outputLabel value="中标经销商(手动):"> </apex:outputLabel>
                                    <apex:outputField id="AgencyMannual" value="{!brand.lostBrand.AgencyMannual__c}" />
                                </apex:pageBlockSectionItem>
 
                                <apex:pageBlockSectionItem id="AgencyMannualOut1" dataStyle="width:10%;" labelStyle="width:23%;text-align:left;">
                                    <apex:outputLabel value=" "> </apex:outputLabel>
                                    <apex:outputLabel id="AgencyMannual1" value=" " />
                                </apex:pageBlockSectionItem>
                                <apex:pageBlockSectionItem id="AgencyMannualOut2" dataStyle="width:10%;" labelStyle="width:23%;text-align:left;">
                                    <apex:outputLabel value=" "> </apex:outputLabel>
                                    <apex:outputLabel id="AgencyMannual2" value=" " />
                                </apex:pageBlockSectionItem>
 
                            </apex:pageBlockSection>
                            <!-- update tcm 20211119 由于数据重构,product后添加LostProductss start -->
                            <apex:pageBlockTable value="{!brand.LostProducts}" var="product" id="productTable" style="border-bottom-width: 0px; font-size:13px;width:80%"
                                border="0" cellspacing="0" cellpadding="0">
                                <apex:column headerValue="失单品牌">
                                    <!-- test -->
                                    <apex:outputField id="LostBrandNameOut" value="{!product.LostProductss.LostBrandName__c}" />
                                    <!-- <apex:outputPanel style="display: inline-block; min-width: 50px;">
                                        <apex:outputField id="CompetitorOut" value="{!product.LostProductss.Competitor__c}" />
                                    </apex:outputPanel> -->
                                </apex:column>
 
                                <apex:column headerValue="失单对手型号">
                                    <apex:outputField id="LostProduct" value="{!product.LostProductss.LostProduct__c}" />
                                </apex:column>
                                <!-- update tcm 20211118 end -->
                                <apex:column headerValue="失单数量">
                                    <apex:outputField id="Quantity" value="{!product.LostProductss.Quantity__c}" />
                                </apex:column>
                                <!-- SWAG-C6P9PX lt 20210913 add start -->
                                <apex:column headerValue="失单对手型号(手动)">
                                    <apex:outputField id="LostProductMannual" value="{!product.LostProductss.LostProductMannual__c}" />
                                </apex:column>
                                <!-- SWAG-C6P9PX lt 20210913 add end -->
                                <!-- tcm 20211117 add start -->
                                <apex:column headerValue="失单产品类别" style="min-width: 140px;">
                                    <apex:outputtext id="LostPRoductClass" value="{!product.LostProductss.ProductClass__c}" />
                                </apex:column>
                                <apex:column headerValue="失单产品区分" style="min-width: 140px;">
                                    <apex:outputtext id="LostProductCategory" value="{!product.LostProductss.ProductCategory__c}" />
                                </apex:column>
                                <!-- tcm 20211117 add end -->
                            </apex:pageBlockTable>
                            <!-- update tcm 20211119 由于数据重构,product后添加LostProductss end -->
                        </apex:pageBlockSection>
                        <apex:variable value="{!BCnt+1}" var="BCnt" />
                    </apex:repeat>
 
                    <apex:pageBlockButtons >
 
                        <apex:commandButton rendered="{!IF(LostReport.lostReport.Report_Status__c = '草案', 'true', 'false')}" id="SubmitButton" onclick="submitJS();return false;"
                            value="提交" style="width: 150px;margin-left: 50px;" />
                        <!-- 20230418 ljh DB202304320022 start -->
                        <!-- <apex:commandButton rendered="{!IF(LostReport.lostReport.Report_Status__c = '草案' || $Profile.Id = '00e10000000Y3o5AAC', 'true', 'false')}"
                            id="EditButton" reRender="allForm" action="{!edit2}" value="编辑" style="width: 150px;margin-left: 50px;"
                        /> -->
                        <apex:commandButton rendered="{!IF(LostReport.lostReport.Report_Status__c = '草案' || $Profile.Id = '00e10000000Y3o5AAC', 'true', 'false')}"
                            id="EditButton" reRender="allForm"  onclick="edit2JS();return false;" value="编辑" style="width: 150px;margin-left: 50px;"
                        />
                        <!-- 20230418 ljh DB202304320022 end -->
                        <apex:commandButton id="CancelButton" action="{!cancel}" value="返回询价" style="width: 150px;margin-left: 50px;" />
 
                    </apex:pageBlockButtons>
                </apex:pageBlock>
            </apex:outputPanel>
        </apex:pageBlock>
    </apex:form>
    <apex:outputPanel id="approvalProcess" rendered="{!IF(pageStatus == 'View', 'true', 'false')}">
        <apex:relatedList list="ProcessSteps" />
    </apex:outputPanel>
</apex:page>