From fbac2ed0a87dad3180b3d22a9ed189437e4b7f19 Mon Sep 17 00:00:00 2001
From: 高章伟 <gaozhangwei@prec-tech.com>
Date: 星期二, 07 三月 2023 18:30:19 +0800
Subject: [PATCH] no message

---
 force-app/main/default/pages/EquipmentSetShippmentReceived5.page |   89 ++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 80 insertions(+), 9 deletions(-)

diff --git a/force-app/main/default/pages/EquipmentSetShippmentReceived5.page b/force-app/main/default/pages/EquipmentSetShippmentReceived5.page
index 90eb4a7..588b74d 100644
--- a/force-app/main/default/pages/EquipmentSetShippmentReceived5.page
+++ b/force-app/main/default/pages/EquipmentSetShippmentReceived5.page
@@ -67,10 +67,14 @@
    j$("select[name$='inspectionResult']").val("OK");
    j$("select[name$='inspectionResultNg']").prop("selectedIndex", 0);
    j$("select[name$='inspectionResultNg']").prop("disabled", true);
+   j$("select[name$='inspectionResultNg3']").prop("selectedIndex", 0);
+   j$("select[name$='inspectionResultNg3']").prop("disabled", true);
    
    j$("select[name$='inspectionResult2']").val("OK");
    j$("select[name$='inspectionResultNg2']").prop("selectedIndex", 0);
    j$("select[name$='inspectionResultNg2']").prop("disabled", true);
+   j$("select[name$='inspectionResultNg4']").prop("selectedIndex", 0);
+   j$("select[name$='inspectionResultNg4']").prop("disabled", true);
 }
 function filljsQR(qrcode) {
     blockme();
@@ -265,8 +269,8 @@
                 </apex:outputPanel>
 
                 <apex:outputPanel layout="none" rendered="{!IF(indexloop == 1, true, false)}">
-                        <h3 style="padding: 5px;" class="detailtab">{!esdInfo.rec.Rental_Apply_Equipment_Set__r.Name}锛歿!esdInfo.rec.Rental_Apply_Equipment_Set__r.Fixture_Set__r.Name}</h3>
-                    </apex:outputPanel>
+                    <h3 style="padding: 5px;" class="detailtab">{!esdInfo.rec.Rental_Apply_Equipment_Set__r.Name}锛歿!esdInfo.rec.Rental_Apply_Equipment_Set__r.Fixture_Set__r.Name}</h3>
+                </apex:outputPanel>
                 <div class="rtop">
                     <div class="r1"></div>
                     <div class="r2"></div>
@@ -303,7 +307,7 @@
                             <!-- <span>{!$ObjectType.Rental_Apply_Equipment_Set_Detail__c.fields.Inspection_result_after_F__c.label}锛� </span> -->
                             <span>鏈�缁堟娴嬬粨鏋滐細 </span>
                             <apex:outputPanel layout="none" rendered="{!AND(esdInfo.editable, esdInfo.rec.Inspection_result_after_NG__c='缁翠慨')}">
-                            <apex:inputField id="inspectionResult2" value="{!esdInfo.rec.Inspection_result_after_Final__c}" style="margin:3px;width:75px;" />
+                            <apex:inputField id="inspectionResult2" value="{!esdInfo.rec.Inspection_result_after_Final__c}" style="margin:3px;width:75px;" onchange="changeResultNg('{!indexloop}', 2);" />
                             </apex:outputPanel>
                             <apex:outputPanel layout="none" rendered="{!AND(NOT(esdInfo.editable), esdInfo.rec.Inspection_result_after_NG__c='缁翠慨')}">
                             <span><apex:outputField value="{!esdInfo.rec.Inspection_result_after_Final__c}" style="margin:3px;width:75px;" /></span>
@@ -313,17 +317,37 @@
                             <!-- <span>{!$ObjectType.Rental_Apply_Equipment_Set_Detail__c.fields.Inspection_result_after_NG_F__c.label}锛� </span> -->
                             <span>鏈�缁圢G鍖哄垎锛� </span>
                             <apex:outputPanel layout="none" rendered="{!AND(esdInfo.editable,esdInfo.rec.Inspection_result_after_NG__c='缁翠慨')}"><span>
-                            <apex:inputField id="inspectionResultNg2" value="{!esdInfo.rec.Inspection_result_after_NG_Final__c}" style="margin:3px;width:75px;"/></span>
+                            <apex:inputField id="inspectionResultNg2" value="{!esdInfo.rec.Inspection_result_after_NG_Final__c}" style="margin:3px;width:75px;" onchange="changeResultNg('{!indexloop}', 2);" /></span>
                             </apex:outputPanel>
                             <apex:outputPanel layout="none" rendered="{!AND(NOT(esdInfo.editable), esdInfo.rec.Inspection_result_after_NG__c='缁翠慨')}">
                             <span><apex:outputField value="{!esdInfo.rec.Inspection_result_after_NG_Final__c}" style="margin:3px;width:75px;" /></span>
+                            </apex:outputPanel>
+                        </li>
+                        <li style="{!IF(esdInfo.rec.Inspection_result_after_NG__c='缁翠慨', '', 'display: none;')}">
+                            <span>{!$ObjectType.Rental_Apply_Equipment_Set_Detail__c.fields.Inspection_NG_abord_reason__c.label}锛�</span>
+                            <apex:outputPanel layout="none" rendered="{!AND(esdInfo.editable,esdInfo.rec.Inspection_result_after_NG__c='缁翠慨')}">
+                            <span>
+                                <apex:inputField id="inspectionResultNg4" value="{!esdInfo.rec.Inspection_NG_abord_reason__c}" style="margin:3px;width:90%;float:left;" />
+                            </span>
+                            <script>
+                                disabledShowNg4();
+                                function disabledShowNg4() {
+                                    var result_after_NG_Final = '{!esdInfo.rec.Inspection_result_after_NG_Final__c}';
+                                    if (result_after_NG_Final != "搴熷純") {
+                                        j$(escapeVfId('allPage:allForm:esdList:' + ('{!indexloop}' - 1) + ':inspectionResultNg4')).prop("disabled", true);
+                                    }
+                                }
+                            </script>
+                            </apex:outputPanel>
+                            <apex:outputPanel layout="none" rendered="{!AND(NOT(esdInfo.editable), esdInfo.rec.Inspection_result_after_NG__c='缁翠慨')}">
+                            <span><apex:outputField value="{!esdInfo.rec.Inspection_NG_abord_reason__c}" style="margin:3px;width:90%;float:left;" /></span>
                             </apex:outputPanel>
                         </li>
                         <li style="{!IF(esdInfo.rec.Inspection_result_after_NG__c='缁翠慨', 'display: none;', '')}" data-qr="{!esdInfo.rec.Fixture_QRCode_F__c}" >
                             <!-- <span>{!$ObjectType.Rental_Apply_Equipment_Set_Detail__c.fields.Inspection_result_after_F__c.label}锛� </span> -->
                             <span>妫�娴嬬粨鏋滐細 </span>
                             <apex:outputPanel layout="none" rendered="{!AND(esdInfo.editable, esdInfo.rec.Inspection_result_after_NG__c!='缁翠慨')}">
-                            <apex:inputField id="inspectionResult" value="{!esdInfo.rec.Inspection_result_after__c}" style="margin:3px;width:75px;" />
+                            <apex:inputField id="inspectionResult" value="{!esdInfo.rec.Inspection_result_after__c}" style="margin:3px;width:75px;" onchange="changeResultNg('{!indexloop}', 1)" />
                             </apex:outputPanel>
                             <apex:outputPanel layout="none" rendered="{!AND(NOT(esdInfo.editable), esdInfo.rec.Inspection_result_after_NG__c!='缁翠慨')}">
                             <span><apex:outputField value="{!esdInfo.rec.Inspection_result_after__c}" style="margin:3px;width:75px;" /></span>
@@ -333,19 +357,39 @@
                             <!-- <span>{!$ObjectType.Rental_Apply_Equipment_Set_Detail__c.fields.Inspection_result_after_NG_F__c.label}锛� </span> -->
                             <span>妫�娴婲G鍖哄垎锛� </span>
                             <apex:outputPanel layout="none" rendered="{!AND(esdInfo.editable, esdInfo.rec.Inspection_result_after_NG__c!='缁翠慨')}"><span>
-                            <apex:inputField id="inspectionResultNg" value="{!esdInfo.rec.Inspection_result_after_NG__c}" style="margin:3px;width:75px;"/></span>
+                            <apex:inputField id="inspectionResultNg" value="{!esdInfo.rec.Inspection_result_after_NG__c}" style="margin:3px;width:75px;" onchange="changeResultNg('{!indexloop}', 1)" /></span>
                             </apex:outputPanel>
                             <apex:outputPanel layout="none" rendered="{!AND(NOT(esdInfo.editable), esdInfo.rec.Inspection_result_after_NG__c!='缁翠慨')}">
                             <span><apex:outputField value="{!esdInfo.rec.Inspection_result_after_NG__c}" style="margin:3px;width:75px;" /></span>
                             </apex:outputPanel>
                         </li>
+                        <li style="{!IF(esdInfo.rec.Inspection_result_after_NG__c='缁翠慨', 'display: none;', '')}">
+                            <span>{!$ObjectType.Rental_Apply_Equipment_Set_Detail__c.fields.Inspection_NG_abord_reason__c.label}锛�</span>
+                            <apex:outputPanel layout="none" rendered="{!AND(esdInfo.editable, esdInfo.rec.Inspection_result_after_NG__c!='缁翠慨')}">
+                            <span>
+                                <apex:inputField id="inspectionResultNg3" value="{!esdInfo.rec.Inspection_NG_abord_reason__c}" style="margin:3px;width:90%;float:left;"/>
+                            </span>
+                            <script>
+                                disabledShowNg3();
+                                function disabledShowNg3() {
+                                    var result_after_NG = '{!esdInfo.rec.Inspection_result_after_NG__c}';
+                                    if (result_after_NG != "搴熷純") {
+                                        j$(escapeVfId('allPage:allForm:esdList:' + ('{!indexloop}' - 1) + ':inspectionResultNg3')).prop("disabled", true);
+                                    }
+                                }
+                            </script>
+                            </apex:outputPanel>
+                            <apex:outputPanel layout="none" rendered="{!AND(NOT(esdInfo.editable), esdInfo.rec.Inspection_result_after_NG__c!='缁翠慨')}">
+                            <span><apex:outputField value="{!esdInfo.rec.Inspection_NG_abord_reason__c}" style="margin:3px;width:90%;float:left;" /></span>
+                            </apex:outputPanel>
+                        </li>
                         <li>
                             <span>{!$ObjectType.Rental_Apply_Equipment_Set_Detail__c.fields.Inspection_Comment__c.label}锛� </span>
-                            <apex:outputPanel layout="none" rendered="{!(esdInfo.editable)}">
-                            <apex:inputField value="{!esdInfo.rec.Inspection_Comment__c}" style="margin:3px;width:75px;"/>
+                            <apex:outputPanel layout="none" rendered="{!(esdInfo.editable)}"><span>
+                            <apex:inputField value="{!esdInfo.rec.Inspection_Comment__c}" style="margin:3px;width:90%;float:left;"/></span>
                             </apex:outputPanel>
                             <apex:outputPanel layout="none" rendered="{!(NOT(esdInfo.editable))}">
-                            <span><apex:outputField value="{!esdInfo.rec.Inspection_Comment__c}" style="margin:3px;width:75px;"/></span>
+                            <span><apex:outputField value="{!esdInfo.rec.Inspection_Comment__c}" style="margin:3px;width:90%;float:left;"/></span>
                             </apex:outputPanel>
                         </li>
                         <li>
@@ -353,6 +397,33 @@
                             <span><apex:outputField value="{!esdInfo.rec.SerialNumber_F__c}" style="margin:3px;width:75px;"/></span>
                         </li>
                         <!-- </div> -->
+
+                        <script>
+                            function changeResultNg(index, kubun) {
+                                var num = index - 1;
+                                if (kubun==1) {
+                                    var resultNgStr = document.getElementById('allPage:allForm:esdList:' + num + ':inspectionResultNg').value;
+                                    var resultStr = document.getElementById('allPage:allForm:esdList:' + num + ':inspectionResult').value;
+                                    if (resultNgStr != "搴熷純" || resultStr != "NG") {
+                                        j$(escapeVfId('allPage:allForm:esdList:' + num + ':inspectionResultNg3')).prop("selectedIndex", 0);
+                                        j$(escapeVfId('allPage:allForm:esdList:' + num + ':inspectionResultNg3')).prop("disabled", true);
+                                    } else {
+                                        j$(escapeVfId('allPage:allForm:esdList:' + num + ':inspectionResultNg3')).prop("selectedIndex", 0);
+                                        j$(escapeVfId('allPage:allForm:esdList:' + num + ':inspectionResultNg3')).prop("disabled", false);
+                                    }
+                                } else if (kubun==2) {
+                                    var resultNg2Str = document.getElementById('allPage:allForm:esdList:' + num + ':inspectionResultNg2').value;
+                                    var result2Str = document.getElementById('allPage:allForm:esdList:' + num + ':inspectionResult2').value;
+                                    if (resultNg2Str != "搴熷純" || result2Str != "NG") {
+                                        j$(escapeVfId('allPage:allForm:esdList:' + num + ':inspectionResultNg4')).prop("selectedIndex", 0);
+                                        j$(escapeVfId('allPage:allForm:esdList:' + num + ':inspectionResultNg4')).prop("disabled", true);
+                                    } else {
+                                        j$(escapeVfId('allPage:allForm:esdList:' + num + ':inspectionResultNg4')).prop("selectedIndex", 0);
+                                        j$(escapeVfId('allPage:allForm:esdList:' + num + ':inspectionResultNg4')).prop("disabled", false);
+                                    }
+                                }
+                            }
+                        </script>
                     </apex:outputPanel>
                 </ul>
                 </div>

--
Gitblit v1.9.1