From 559771a80cf779dc13a84ecd2f178e6ca5a8353a Mon Sep 17 00:00:00 2001
From: FUYU <fuyu@prec-tech.com>
Date: 星期五, 19 五月 2023 15:52:16 +0800
Subject: [PATCH] 备份省目标录入

---
 force-app/main/default/pages/TransferShippmentReceived5.page |  164 +++++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 117 insertions(+), 47 deletions(-)

diff --git a/force-app/main/default/pages/TransferShippmentReceived5.page b/force-app/main/default/pages/TransferShippmentReceived5.page
index 0cae54c..47b09ab 100644
--- a/force-app/main/default/pages/TransferShippmentReceived5.page
+++ b/force-app/main/default/pages/TransferShippmentReceived5.page
@@ -69,6 +69,11 @@
    j$("select[name$='inspectionResult2']").val("OK");
    j$("select[name$='inspectionResultNg2']").prop("selectedIndex", 0);
    j$("select[name$='inspectionResultNg2']").prop("disabled", true);
+
+   j$("select[name$='inspectionResultNg3']").prop("selectedIndex", 0);
+   j$("select[name$='inspectionResultNg3']").prop("disabled", true);
+   j$("select[name$='inspectionResultNg4']").prop("selectedIndex", 0);
+   j$("select[name$='inspectionResultNg4']").prop("disabled", true);
 }
 function filljsQR(qrcode) {
     blockme();
@@ -261,67 +266,132 @@
                             <apex:outputField value="{!esdInfo.rec.Lost_item_giveup__c}" style="margin:3px;width:75px;"/></span>
                         </li>
                         <apex:outputPanel layout="none" rendered="{!esdInfo.rec.Inspection_result_after_ng__c='缁翠慨'}">
-                        <li data-qr="{!esdInfo.rec.Fixture_QRCode_F__c}" >
-                            <span>妫�娴嬬粨鏋滐細 </span><span>
-                            <apex:outputField value="{!esdInfo.rec.Inspection_result_after__c}" style="margin:3px;width:75px;" />
-                            </span>
-                        </li>
-                        <li>
-                            <span>妫�娴婲G鍖哄垎锛� </span><span>
-                            <apex:outputField value="{!esdInfo.rec.Inspection_result_after_ng__c}" style="margin:3px;width:75px;"/></span>
-                        </li>
-                        <li data-qr="{!esdInfo.rec.Fixture_QRCode_F__c}" >
-                            <span>鏈�缁堟娴嬬粨鏋滐細 </span>
-                            <apex:outputPanel layout="none" rendered="{!(esdInfo.editable)}">
-                            <apex:inputField id="inspectionResult2" value="{!esdInfo.rec.Inspection_result_after_Final__c}" style="margin:3px;width:75px;" />
-                            </apex:outputPanel>
-                            <apex:outputPanel layout="none" rendered="{!NOT(esdInfo.editable)}">
-                            <span><apex:outputField value="{!esdInfo.rec.Inspection_result_after_Final__c}" style="margin:3px;width:75px;" /></span>
-                            </apex:outputPanel>
-                        </li>
-                        <li>
-                            <span>鏈�缁圢G鍖哄垎锛� </span>
-                            <apex:outputPanel layout="none" rendered="{!(esdInfo.editable)}"><span>
-                            <apex:inputField id="inspectionResultNg2" value="{!esdInfo.rec.Inspection_result_after_NG_Final__c}" style="margin:3px;width:75px;"/></span>
-                            </apex:outputPanel>
-                            <apex:outputPanel layout="none" rendered="{!NOT(esdInfo.editable)}">
-                            <span><apex:outputField value="{!esdInfo.rec.Inspection_result_after_NG_Final__c}" style="margin:3px;width:75px;" /></span>
-                            </apex:outputPanel>
-                        </li>
+                            <li data-qr="{!esdInfo.rec.Fixture_QRCode_F__c}" >
+                                <span>妫�娴嬬粨鏋滐細 </span><span>
+                                <apex:outputField value="{!esdInfo.rec.Inspection_result_after__c}" style="margin:3px;width:75px;" />
+                                </span>
+                            </li>
+                            <li>
+                                <span>妫�娴婲G鍖哄垎锛� </span><span>
+                                <apex:outputField value="{!esdInfo.rec.Inspection_result_after_ng__c}" style="margin:3px;width:75px;"/></span>
+                            </li>
+                            <li data-qr="{!esdInfo.rec.Fixture_QRCode_F__c}" >
+                                <span>鏈�缁堟娴嬬粨鏋滐細 </span>
+                                <apex:outputPanel layout="none" rendered="{!(esdInfo.editable)}">
+                                <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="{!NOT(esdInfo.editable)}">
+                                <span><apex:outputField value="{!esdInfo.rec.Inspection_result_after_Final__c}" style="margin:3px;width:75px;" /></span>
+                                </apex:outputPanel>
+                            </li>
+                            <li>
+                                <span>鏈�缁圢G鍖哄垎锛� </span>
+                                <apex:outputPanel layout="none" rendered="{!(esdInfo.editable)}"><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="{!NOT(esdInfo.editable)}">
+                                <span><apex:outputField value="{!esdInfo.rec.Inspection_result_after_NG_Final__c}" style="margin:3px;width:75px;" /></span>
+                                </apex:outputPanel>
+                            </li>
+                            <li>
+                                <span>{!$ObjectType.TransferApplyDetail__c.fields.Inspection_NG_abord_reason__c.label}锛�</span>
+                                <apex:outputPanel layout="none" rendered="{!(esdInfo.editable)}"><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="{!NOT(esdInfo.editable)}">
+                                <span><apex:outputField value="{!esdInfo.rec.Inspection_NG_abord_reason__c}" style="margin:3px;width:90%;float:left;" /></span>
+                                </apex:outputPanel>
+                            </li>
                         </apex:outputPanel>
                         <apex:outputPanel layout="none" rendered="{!esdInfo.rec.Inspection_result_after_ng__c!='缁翠慨'}">
-                        <li data-qr="{!esdInfo.rec.Fixture_QRCode_F__c}" >
-                            <span>妫�娴嬬粨鏋滐細 </span>
-                            <apex:outputPanel layout="none" rendered="{!(esdInfo.editable)}">
-                            <apex:inputField id="inspectionResult" value="{!esdInfo.rec.Inspection_result_after__c}" style="margin:3px;width:75px;" />
-                            </apex:outputPanel>
-                            <apex:outputPanel layout="none" rendered="{!NOT(esdInfo.editable)}">
-                            <span><apex:outputField value="{!esdInfo.rec.Inspection_result_after__c}" style="margin:3px;width:75px;" /></span>
-                            </apex:outputPanel>
-                        </li>
-                        <li>
-                            <span>妫�娴婲G鍖哄垎锛� </span>
-                            <apex:outputPanel layout="none" rendered="{!(esdInfo.editable)}"><span>
-                            <apex:inputField id="inspectionResultNg" value="{!esdInfo.rec.Inspection_result_after_ng__c}" style="margin:3px;width:75px;"/></span>
-                            </apex:outputPanel>
-                            <apex:outputPanel layout="none" rendered="{!NOT(esdInfo.editable)}">
-                            <span><apex:outputField value="{!esdInfo.rec.Inspection_result_after_ng__c}" style="margin:3px;width:75px;" /></span>
-                            </apex:outputPanel>
-                        </li>
+                            <li data-qr="{!esdInfo.rec.Fixture_QRCode_F__c}" >
+                                <span>妫�娴嬬粨鏋滐細 </span>
+                                <apex:outputPanel layout="none" rendered="{!(esdInfo.editable)}">
+                                <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="{!NOT(esdInfo.editable)}">
+                                <span><apex:outputField value="{!esdInfo.rec.Inspection_result_after__c}" style="margin:3px;width:75px;" /></span>
+                                </apex:outputPanel>
+                            </li>
+                            <li>
+                                <span>妫�娴婲G鍖哄垎锛� </span>
+                                <apex:outputPanel layout="none" rendered="{!(esdInfo.editable)}"><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="{!NOT(esdInfo.editable)}">
+                                <span><apex:outputField value="{!esdInfo.rec.Inspection_result_after_ng__c}" style="margin:3px;width:75px;" /></span>
+                                </apex:outputPanel>
+                            </li>
+                            <li>
+                                <span>{!$ObjectType.TransferApplyDetail__c.fields.Inspection_NG_abord_reason__c.label}锛�</span>
+                                <apex:outputPanel layout="none" rendered="{!(esdInfo.editable)}"><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="{!NOT(esdInfo.editable)}">
+                                <span><apex:outputField value="{!esdInfo.rec.Inspection_NG_abord_reason__c}" style="margin:3px;width:90%;float:left;" /></span>
+                                </apex:outputPanel>
+                            </li>
                         </apex:outputPanel>
                         <li>
                             <span>{!$ObjectType.TransferApplyDetail__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;"/>
+                            <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>
                             <span>{!$ObjectType.TransferApplyDetail__c.fields.SerialNumber_F__c.label}锛� </span>
                             <span><apex:outputField value="{!esdInfo.rec.SerialNumber_F__c}" style="margin:3px;width:75px;"/></span>
                         </li>
+
+                        <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