liuyn
2024-03-11 a87f1c3df03078814ee97ad0c8ac200a232419e9
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
<!-- 20230526 ljh lightning  -->
<!-- <apex:page controller="AccessorySelectController" showHeader="false" sidebar="false" id="allPage" action="{!init}"> -->
    <apex:page controller="AccessorySelectController" showHeader="false" sidebar="false" id="allPage" action="{!init}" lightningStylesheets="true">
 
    <head>
    <title>附属品选择</title>
    <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/>
    <apex:stylesheet value="{!URLFOR($Resource.AccessorySelectCss)}"/>
    <apex:stylesheet value="{!URLFOR($Resource.StyleUtilCss)}"/><!-- 20230624 ljh lightning  -->
    <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
    <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
    <apex:includeScript value="{!URLFOR($Resource.RelationListPagingCmpJS)}"/>
    
    <style>
        /*备品智能化项目对应 20231122 by lc Start*/
        .modal {
           display:none;
           position: fixed; /* Stay in place */
           z-index: 10; /* Sit on top */
           left: 0;
           top: 0;
           width: 100%; /* Full width */
           height: 100%; /* Full height */
           overflow: auto; /* Enable scroll if needed */
           background-color: rgb(0,0,0); /* Fallback color */
           background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
        }
        span.dateFormat {
            display: none;
        }
 
        /* Modal Content/Box */
        .modal-content {
           background-color: #fefefe;
           margin-left: 6px;
           margin-top: 100px;
           padding: 20px;
           border: 1px solid #888;
           right: 5%;
           position: absolute;
           /* 20230628 ljh */
           /* width: 200px; */
           width: 300px;
        }
        .modal-content-cancel {
           background-color: #fefefe;
           margin-left: -150px;
           margin-top: 100px;
           padding: 20px;
           border: 1px solid #888;
           left: 50%;
           position: absolute;
           width: 310px;
        }
        .modal-content-cancel select {
            margin-bottom: 8px;
        }
        /*备品智能化项目对应 20231122 by lc End*/
 
        /* 20240111 贸易合规对应20240111 by sx Start */
        .modal-content-trade {
            background-color: #fefefe;
            margin-left: -150px;
            margin-top: 100px;
            padding: 20px;
            border: 1px solid #888;
            left: 50%;
            position: absolute;
            width: 310px;
        }
        /* 20240111 贸易合规对应20240111 by sx end */
    </style>
    <script type="text/javascript">
    var heightAjustment = 120;
    var widthAjustment = 30;
    
    function saveGoPageJs(lineNo) {
        blockme();
    
        checkEvent(lineNo);
    }
    
    function goPageJs(goUrl) {
        unblockUI();
    
        if (goUrl != "") {
            window.location.href = goUrl;
        }
    }
    
    function clickCancel(){
        if (confirm('是否操作取消?')) {
            blockme();
            cancel();
        }
    }
    function clickunassign(){
        if (confirm('是否操作取消分配?')) {
            checkInterventionReason(2);
            //blockme();
            //unassign();
        }
    }
    // 备品智能化项目对应 20231122 by lc Start
    function checkInterventionReason(kubun) {
        // 其他目的以外的,主体未分配时,附属品不可以进行操作
        if ({!parentObj.Rental_Apply__r.Demo_purpose1__c != '其他' 
            && !isMainAssign 
            && !parentObj.Rental_Apply__r.Manually_Flag__c 
            && parentObj.Rental_Apply__r.Cross_Region_Assign__c == ''}
            && kubun==1) {
            alert("请在主体分配后再处理!");
        } else {
            //检查是否需要输入人工干预理由
            // 协议借用的附属品不走自动分配,所以附属品的人工干预,只有产品试用和维修代用才需要
            if ({!parentObj.Rental_Apply__r.Manually_Flag__c 
                || parentObj.Rental_Apply__r.Cross_Region_Assign__c != ''
                || (parentObj.Rental_Apply__r.Demo_purpose1__c != '产品试用' && parentObj.Rental_Apply__r.Demo_purpose1__c != '维修代用')}) {
                if (kubun==1) {
                    blockme();
                    save();
                } else if (kubun==2) {
                    blockme();
                    unassign();
                }
            } else {
                var isShowReasonFlag = false;
                var cnt = document.getElementById('allPage:allForm:cmpid:cmpinnerid:dataBlock:currentPageRecordCnt').value;
                for (var i = 0; i < cnt; i++) {
                    var lock = j$(escapeVfId('allPage:allForm:cmpid:cmpinnerid:dataBlock:oppTable_L:' + i + ':rowCheck'));
                    if(lock.prop('checked') == true){
                        var ass = j$(escapeVfId('allPage:allForm:cmpid:cmpinnerid:dataBlock:oppTable:' + i + ':j_id157:6:j_id160')).value();
                        var rea = j$("input[name=Intervention_Reason__c][type=hidden]")[i].value;
                        //var ass = j$("input[name=Asset__c][type=hidden]")[i].value;
                        if (rea != null && rea != undefined && rea != "") {
                            // List完后再统一执行
                        } else if (ass != '已分配' && rea == '') {
                            // 附属品不全的设值
                            j$("input[name=Intervention_Reason__c][type=hidden]")[i].value = '附属品不全';
                        } else if (ass == '已分配' && kubun==1) {
                            // 附属品已分配跳过
                        } else {
                            isShowReasonFlag = true;
                        }
                    }
                }
 
                if (isShowReasonFlag) {
                    if (kubun==1) {
                        j$("[id*='interventionType']").val('1');
                    } else if (kubun==2) {
                        j$("[id*='interventionType']").val('2');
                    }
                    j$('#inputReason').show();
                } else {
                    if (kubun==1) {
                        blockme();
                        save();
                    } else if (kubun==2) {
                        blockme();
                        unassign();
                    }
                }
            }
        }
    }
 
    function saveInterventionReasonJs() {
        var reason = j$(escapeVfId('allPage:allForm:Intervention_Reason')).value();
        var kubun = j$(escapeVfId('allPage:allForm:interventionType')).value();
        if(reason == "") {
            j$("#errormessage span").html('请输入人工干预理由!');
            j$("#errormessage").css('display', ''); 
        } else {
            j$("#errormessage").css('display', 'none');
            if (kubun=='1') {
                blockme();
                save();
            } else if (kubun=='2') {
                blockme();
                unassign();
            }
        }
    }
    // 备品智能化项目对应 20231122 by lc End
 
    //贸易合规二期对应 20240111 by sx start
    function showModal(){
        console.log('showModal====' + j$(escapeVfId('allPage:allForm:hgerqi')).val());
        if(j$(escapeVfId('allPage:allForm:hgerqi')).val() == 'true'){
            //打开弹窗
            j$('#cancelModal').show();
        }else{
            //如果合规直接走保存(原有逻辑)
            checkInterventionReason(1);
        }
    }
    function cancelModalConfirm(){
        console.log('=====走原来的逻辑===');
        //贸易合规二期 弹窗确认 点击确认就调原来的保存方法 点取消就不进行保存逻辑
        j$('#cancelModal').hide();
        checkInterventionReason(1);
    }
    //贸易合规二期对应 20240111 by sx end
   
    </script>
    </head>
        <apex:form id="allForm">
            <apex:actionFunction name="checkEvent" action="{!checkEvent}" rerender="allForm,checEventFrame" oncomplete="goPageJs(j$(escapeVfId('{!$Component.checkEventUrl}')).value())">
                <apex:param name="firstParam" assignTo="{!clickLineNo}" value="" />
            </apex:actionFunction>
            <apex:actionFunction action="{!cancel}" name="cancel" rerender="allForm,checEventFrame" oncomplete="unblockUI();"/>
            <apex:actionFunction action="{!unassign}" name="unassign" rerender="allForm,checEventFrame" oncomplete="unblockUI();"/>
            <apex:actionFunction name="save" action="{!save}" rerender="allForm,checEventFrame" oncomplete="unblockUI();" />
            <apex:inputHidden id="checkEventUrl" value="{!goAccessoryAdd}" />
            <apex:inputHidden id="interventionType" value="{!interventionType}"/>
            <!-- 贸易合规二期对应 20240111 by sx start -->
            <apex:inputHidden value="{!hgerqi}" id="hgerqi"/>
            <apex:actionFunction name="tradeCheckTwo" action="{!tradeCheckTwo}" rerender="hgerqi" oncomplete="unblockUI();showModal();"/>
            <!-- 贸易合规二期对应 20240111 by sx end -->
            <!-- 备品智能化项目对应 20231122 by lc Start -->
            <div id="inputReason" class="modal">
                <div class="modal-content-cancel">
                    <table>
                        <tr style="display: none;" id="errormessage">
                            <td colspan="2">
                                <span style="color: #F00; font-weight:bold"></span>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <apex:outputLabel value="{!$ObjectType.Rental_Apply_Equipment_Set_Detail__c.fields.Intervention_Reason__c.label}" />
                            </td>
                            <td>
                                <apex:inputText value="{!interventionReason}" id="Intervention_Reason" />
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" align="center">
                                <apex:commandButton style="margin: 8px 20px;" value="确定" onclick="saveInterventionReasonJs(); return false;" />
                                <apex:commandButton style="margin: 8px 20px;" value="取消" onclick="j$('#inputReason').hide();return false;"/>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
            <!-- 备品智能化项目对应 20231122 by lc End -->
 
            <!-- 20231127 sx add 贸易合规二期 弹窗提醒 start  -->
            <div id="cancelModal" class="modal">
                <div class="modal-content-trade">
                    <table>
                        <tr>
                            <td>
                                <apex:outputText styleClass="title" value="您此次申请的业务可能存在贸易合规风险,是否继续保存,{!$Label.IFTradeComplianceAlert2}(一般需5-10个工作日)。"/>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" test-align="center" style="padding-left: 30px;">
                                <apex:commandButton style="margin: 8px 20px;" value="确定" onclick="cancelModalConfirm(); return false;" oncomplete="j$('#cancelModal').hide();unblockUI();" />
                                <apex:commandButton style="margin: 8px 20px;" value="取消" onclick="j$('#cancelModal').hide(); return false;"/>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
            <!-- 20231127 sx add 贸易合规二期 弹窗提醒 end  -->
 
    
            <apex:outputPanel id="pageallPanel">
                <apex:pageBlock id="searchBlock" tabStyle="Report">
                    <apex:pageBlockSection title="附属品选择" id="fspId" >
                        <apex:outputField value="{!parentObj.Rental_Apply__r.Name}"/>
                        <apex:outputField value="{!parentObj.Rental_Apply__r.Demo_purpose1__c}"/>
                        <apex:outputField value="{!parentObj.Rental_Apply__r.Owner.Name}"/>
                        <apex:outputField value="{!parentObj.Rental_Apply__r.demo_purpose2__c}"/>
                        <apex:outputField value="{!parentObj.Rental_Apply__r.Salesdept__c}"/>
                        <apex:outputField value="{!parentObj.Rental_Apply__r.Product_category__c}"/>
                        <apex:outputField value="{!parentObj.Rental_Apply__r.WorkPlace__c}"/>
                        <apex:outputField value="{!parentObj.Rental_Apply__r.Equipment_Type_F__c}"/>
                        <apex:outputField value="{!parentObj.Rental_Apply__r.Internal_asset_location_F__c}" />
                        <apex:outputField value="{!parentObj.SerialNumber_F__c}"/>
                        <!-- <apex:outputText /> -->
                        <apex:outputField value="{!parentObj.Rental_Apply__r.Request_shipping_day__c}"/>
                        <apex:outputField value="{!parentObj.Rental_Apply__r.Request_return_day__c}"/>
                        <apex:outputField value="{!parentObj.Fixture_Set__r.Fixture_Set_Body_Model_No__c}"/>
                        <apex:outputField value="{!parentObj.Irreplaceable_flag__c}"/>
                        <apex:outputField value="{!parentObj.Fu_Shu_Pin_Fen_Pei_Jia__c}"/>
                        <apex:outputText />
                        <apex:outputField value="{!parentObj.Rental_Start_Date__c}"/>
                        <apex:outputField value="{!parentObj.Rental_End_Date__c}"/>
                        <!-- <apex:outputText /> -->
                        
                    </apex:pageBlockSection>
                        <!-- <apex:pageBlockSectionItem id="pbId"> -->
                        <apex:outputPanel style="float:right;" >
                            <apex:outputLabel value="{!$ObjectType.Rental_Apply_Equipment_Set_Detail__c.fields.Cancel_Reason__c.label}" for="Cancel_Reason"/>
                            <apex:inputField value="{!sonObj.Cancel_Reason__c}" id="Cancel_Reason" onchange="changeCancleReasonJs();" />
                            <!-- 20210817 ljh onchange SFDC-C448KZ pageRaesd.Cancel_Reason__c -->
                            <!--20210803 SFDC-C448KZ you  start-->
                            <apex:outputLabel style="margin-left: 15px;" value="{!$ObjectType.Rental_Apply_Equipment_Set_Detail__c.fields.Loaner_cancel_reason__c.label}" for="Loaner_cancel_reason"/>
                            <apex:inputField value="{!sonObj.Loaner_cancel_reason__c}" id="Loaner_cancel_reason" onchange="changeReasonJs();"/>
                            <!-- 20210817 ljh onchange  SFDC-C448KZ end-->
                            <apex:outputLabel style="margin-left: 15px;" value="{!$ObjectType.Rental_Apply_Equipment_Set_Detail__c.fields.Loaner_cancel_Remarks__c.label}" for="Loaner_cancel_Remarks"/>
                            <!-- <apex:inputField value="{!pageRaesd.Loaner_cancel_Remarks__c}" id="Loaner_cancel_Remarks"/> -->
                            <apex:inputField value="{!sonObj.Loaner_cancel_Remarks__c}" id="Loaner_cancel_Remarks" html-disabled="true"/>
                            <!-- 20210817 ljh html-disabled SFDC-C448KZ -->
                            <!-- 20230909 ljh update -->
                            <!-- <apex:commandButton style="margin-left: 20px;" reRender="allForm,checEventFrame" value="适用" onclick="applyJs()" oncomplete="applyLcr();changeReasonJs()" /> -->
                            <apex:commandButton style="margin-left: 20px;" reRender="cmpid" value="适用" onclick="applyJs()" oncomplete="applyLcr();changeReasonJs()" />
                            <!-- 20210817 ljh  SFDC-C448KZ  add oncomplete  -->
                            <script type="text/javascript">
                                var Cancel_Reason = '';
                                var Loaner_cancel_reason = '';
                                var Loaner_cancel_Remarks = '';
                                function applyJs() {
                                  // var errorFlag = j$(escapeVfId('{!$Component.hasError}')).value();
                                  // if(errorFlag == 'false'){
                                    var cnt = document.getElementById('allPage:allForm:cmpid:cmpinnerid:dataBlock:currentPageRecordCnt').value;
                                    Cancel_Reason = j$(escapeVfId('{!$Component.Cancel_Reason}')).value();
                                    Loaner_cancel_Remarks = j$(escapeVfId('{!$Component.Loaner_cancel_Remarks}')).value();
                                    Loaner_cancel_reason = j$(escapeVfId('{!$Component.Loaner_cancel_reason}')).value();
                                    var cancel_ReasonSZ = [];
                                    j$("td.dataCellBorder1.col_Cancel_Reason__c").each(function () {
                                        cancel_ReasonSZ.push(j$(this))
                                    });
                                    var cancel_Remarks = [];
                                    j$("td.dataCellBorder1.col_Loaner_cancel_Remarks__c").each(function () {
                                      cancel_Remarks.push(j$(this))
                                    });
                                    for (var i = 0; i < cnt; i++) {
                                      var lock = j$(escapeVfId('allPage:allForm:cmpid:cmpinnerid:dataBlock:oppTable_L:' + i + ':rowCheck'));
                                      if(lock.prop('checked') == true){
                                        cancel_ReasonSZ[i].find("Select").val(Cancel_Reason);
                                        cancel_Remarks[i].find("input").val(Loaner_cancel_Remarks);
                                      }
                                    }
                                  // }
                                }
                                //20210817 ljh  SFDC-C448KZ  start
                                function applyLcr(){
                                    var cnt = document.getElementById('allPage:allForm:cmpid:cmpinnerid:dataBlock:currentPageRecordCnt').value;
                                    // var Loaner_cancel_reason = j$(escapeVfId('{!$Component.Loaner_cancel_reason}')).value(); 
                                    console.log('aaaa:'+Loaner_cancel_reason);
                                    var loaner_cancel_reason_SZ = [];
                                    j$("td.dataCellBorder1.col_Loaner_cancel_reason__c").each(function () {
                                        loaner_cancel_reason_SZ.push(j$(this))
                                    });
                                    var cancel_RemarksSZ = [];
                                    j$("td.dataCellBorder1.col_Loaner_cancel_Remarks__c").each(function () {
                                      cancel_RemarksSZ.push(j$(this))
                                    });
                                    for (var i = 0; i < cnt; i++) {
                                      var lock = j$(escapeVfId('allPage:allForm:cmpid:cmpinnerid:dataBlock:oppTable_L:' + i + ':rowCheck'));
                                        if(lock.prop('checked') == true){
                                            loaner_cancel_reason_SZ[i].find("Select").val(Loaner_cancel_reason);
                                            if(Loaner_cancel_reason == '其他'){
                                                cancel_RemarksSZ[i].find("input").attr('disabled',false);
                                            }else{
                                                cancel_RemarksSZ[i].find("input").attr('disabled',true);
                                            }
                                        }
                                    }
                                }
                                //20210817 ljh  SFDC-C448KZ  end 
                                
                              </script>
                        </apex:outputPanel>
                        <!-- </apex:pageBlockSectionItem> -->
                    <!-- 20230526 ljh lightning start outputPanel 新加 pageBlockButtons注释-->
                    <apex:outputPanel style="float:left;">
                        <!-- <apex:pageBlockButtons location="bottom"> -->
                            <!-- <apex:commandButton style="float:left;" value="检索" action="{!searchOpp}" onclick="blockme();" rerender="allForm, checEventFrame" oncomplete="unblockUI();" /> -->
                            <!-- <apex:commandButton style="float:left;" action="{!save}" value="保存" onclick="blockme();" rerender="allForm,checEventFrame" oncomplete="unblockUI();" /> -->
                            <!-- <apex:commandButton style="float:left;" onclick="checkInterventionReason(1);return false;"  value="保存" /> -->
                            <!-- 贸易合规二期修改 sx 添加拦截 start -->
                            <apex:commandButton style="float:left;" onclick="tradeCheckTwo();return false;"  value="保存" />
                            <!-- 贸易合规二期修改 sx 添加拦截 end -->
                            <!-- <apex:commandButton style="float:left;" value="取消分配" onclick="unassign(); return false;" rerender="allForm,checEventFrame"/> -->
                            <apex:commandButton style="float:left;" onclick="clickunassign(); return false;" value="取消分配" rerender="allForm,checEventFrame"/>
                            <apex:commandButton style="float:left;" value="取消" onclick="clickCancel(); return false;" />
                            <apex:commandButton style="float:right;" action="{!turnback}" value="返回" rerender="allForm,checEventFrame"/>
                        <!-- </apex:pageBlockButtons> -->
                    </apex:outputPanel>
                    <!-- 20230526 ljh lightning end-->
                    <div style="clear:both;"></div>
    
                    <apex:outputPanel id="message">
                        <apex:pageMessages />
                    </apex:outputPanel>
                </apex:pageBlock>
                <c:RelationListPagingCmp id="cmpid" pgController="{!this}" hasCheckbox="true"/>
            </apex:outputPanel>
        </apex:form>
        <apex:outputPanel id="checEventFrame">
            <script>
                // 20210817 ljh add 
                function changeCancleReasonJs(){
                    // allPage:allForm:searchBlock:Cancel_Reason
                    // allPage:allForm:searchBlock:Loaner_cancel_Remarks
                    var Cancel_Reason = j$(escapeVfId('allPage:allForm:searchBlock:fspId:Cancel_Reason')).value();
                    if((Cancel_Reason != null && Cancel_Reason == '主动取消') || Cancel_Reason == '' || Cancel_Reason == null){
                        j$(escapeVfId('allPage:allForm:searchBlock:Loaner_cancel_Remarks')).val('');
                        j$(escapeVfId('allPage:allForm:searchBlock:Loaner_cancel_Remarks')).attr('disabled',true);
                    }
                    changeReasonJs();
                    // else if(Cancel_Reason != null && Cancel_Reason == '重新分配'){
                    //     j$(escapeVfId('allPage:allForm:searchBlock:fspId:pbId:Loaner_cancel_Remarks')).attr('disabled',false);
                    // }    
                }
                function changeReasonJs(){
                    var reason = j$(escapeVfId('allPage:allForm:searchBlock:Loaner_cancel_reason')).value();
                    if(reason != null && reason == '其他'){
                        j$(escapeVfId('allPage:allForm:searchBlock:Loaner_cancel_Remarks')).attr('disabled',false);
                    }else{
                        j$(escapeVfId('allPage:allForm:searchBlock:Loaner_cancel_Remarks')).val('');
                        j$(escapeVfId('allPage:allForm:searchBlock:Loaner_cancel_Remarks')).attr('disabled',true);
                    }    
                }
                // 20210817 ljh add end
                //add by rentx 20210813 start SFDC-C448KZ
                //1.默认设置"取消备注理由"不可编辑
                //设置明细行的不可编辑
                j$(".dataCellBorder1.col_Loaner_cancel_Remarks__c input").each(function () {
                    //设置只读
                    j$(this).prop('disabled', true)
                });
                //2.设置只有明细取消理由为 '其他' 时 取消理由备注 可编辑
                //设置当明细取消原因为 其他时可编辑
                j$(".dataCellBorder1.col_Loaner_cancel_reason__c span").each(function () {
                    //判断当前标签下的select标签值是否为取消--
                    // var aaa = j$(this);
                    var Loaner_cancel_reason = j$(this).children()[0].value;
                    if (Loaner_cancel_reason == '其他') {
                        //拿到输入框 设置可以编辑
                        j$(this).parent().parent().find("input[type=text]").prop("disabled",false);
                        j$(this).parent().parent().find("input[type=text]").prop("required","required");
                    }
                });
    
                //为明细取消原因添加change时间 如果变为其他 则设置可编辑 反之设置不可编辑
                j$(".dataCellBorder1.col_Cancel_Reason__c").on("change", function () {
                    //判断当前标签下的select标签值是否为取消--
                    var Cancel_Reason = j$(this).children()[0].value;
                    if((Cancel_Reason != null && Cancel_Reason == '主动取消') || Cancel_Reason == ''|| Cancel_Reason == null ){
                        //清空输入框 设置不可编辑
                        j$(this).parent().find("input[type=text]").val('');
                        j$(this).parent().find("input[type=text]").prop("disabled",true);
                    }
                    // else if(Cancel_Reason != null && Cancel_Reason == '重新分配'){
                    //     j$(this).parent().find("input[type=text]").prop("disabled",false);
                    // }
                });
                j$(".dataCellBorder1.col_Loaner_cancel_reason__c span").on("change", function () {
                    //判断当前标签下的select标签值是否为取消--
                    var Loaner_cancel_reason = j$(this).children()[0].value;
                    if (Loaner_cancel_reason == '其他') {
                        //拿到输入框 设置可以编辑
                        j$(this).parent().parent().find("input[type=text]").prop("disabled",false);
                    }else{
                        //清空输入框 设置不可编辑
                        j$(this).parent().parent().find("input[type=text]").val('');
                        j$(this).parent().parent().find("input[type=text]").prop("disabled",true);
                    }
                });
                //add by rentx 20210813 end SFDC-C448KZ
    
            addlinkbutton();
            function addlinkbutton() {
                // 次の画面遷移click
                var ele = j$(".dataCellBorder1.col_Fu_Shu_Pin_Fen_Pei_Jia__c");
    
                if (ele.length) {
                    var i = 0;
                    var showButton = eval("({!JSENCODE(bodyModelNoJson)})");
    
                    ele.each(function () {
                        if (showButton[i]) {
                            j$(this).css('align-items','center');
                            // 20230908 ljh start
                            // j$(this).append('<input type="button" style="width: auto;" value="分配" disabled onclick="saveGoPageJs('+i+');"/>');
                            // j$(this).append('<input type="button" style="width: auto;" value="分配" disabled onclick="saveGoPageJs('+i+');"/>');
                            j$(this).append('<input type="button" class="btn" style="width: auto;" value="分配" disabled onclick="saveGoPageJs('+i+');"/>');
                            // 20230908 ljh end
                        } else {
                            j$(this).css('align-items','center');
                            // 20230908 ljh start
                            // j$(this).append('<input type="button" style="width: auto;" value="分配" onclick="saveGoPageJs('+i+');"/>');
                            j$(this).append('<input type="button" class="btn" style="width: auto;" value="分配" onclick="saveGoPageJs('+i+');"/>');
                            // 20230908 ljh end
                        }
    
                        i = i + 1;
                    });
                }
            }
            </script>
        </apex:outputPanel>
    </apex:page>