From bdb1a98b64a2cf59bcfd575c579aa0742e0de954 Mon Sep 17 00:00:00 2001
From: chenjingwu <chenjingwu@prec-tech.com>
Date: 星期五, 24 五月 2024 17:21:32 +0800
Subject: [PATCH] 1

---
 force-app/main/default/pages/AssetMaintain.page |  102 +++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 82 insertions(+), 20 deletions(-)

diff --git a/force-app/main/default/pages/AssetMaintain.page b/force-app/main/default/pages/AssetMaintain.page
index 6929f0c..9bd92e1 100644
--- a/force-app/main/default/pages/AssetMaintain.page
+++ b/force-app/main/default/pages/AssetMaintain.page
@@ -489,10 +489,13 @@
                             <td class="labelStyle">璐ф灦鍙�</td>
                             <td class="inputTextStyle"><apex:inputText value="{!searchB.wh_location}" id="shelfNumId" /></td>
                             <td class="blankStyle"></td>
-                            <td class="labelStyle">娑堣�楀搧鏈夋晥鏈熻嚦</td>
+                            <td class="labelStyle">鏈鸿韩鍙�</td>
+                            <td class="inputTextStyle"><apex:inputText value="{!searchB.serialNumber}" id="serialNoId" /></td>
+                            <!-- 20230928 ljh 鍜屾満韬彿鎹綅缃� -->
+                            <!-- <td class="labelStyle">娑堣�楀搧鏈夋晥鏈熻嚦</td>
                             <td class="inputTextStyle">
                                 <apex:inputText id="consumable_Guaranteen_endStr" value="{!searchB.consumable_Guaranteen_endStr}" size="12" onfocus="DatePicker.pickDate(true, '{!$Component.consumable_Guaranteen_endStr}', false)" />
-                            </td>
+                            </td> -->
                         </tr>
                         <tr>
                             <td class="labelStyle">澶囧搧绠$悊缂栫爜</td>  <!-- 銈枫儶銈€儷鐣彿 -->
@@ -507,8 +510,12 @@
                                 <apex:inputText value="{!searchB.internal_Asset_number}" id="fixedAssetNumId2" rendered="{!!internalAssetNumberEditableFlag}" />
                             </td>
                             <td class="blankStyle"></td>
-                            <td class="labelStyle">鏈鸿韩鍙�</td>
-                            <td class="inputTextStyle"><apex:inputText value="{!searchB.serialNumber}" id="serialNoId" /></td>
+                            <!-- <td class="labelStyle">鏈鸿韩鍙�</td>
+                            <td class="inputTextStyle"><apex:inputText value="{!searchB.serialNumber}" id="serialNoId" /></td> -->
+                            <td class="labelStyle">娑堣�楀搧鏈夋晥鏈熻嚦</td>
+                            <td class="inputTextStyle">
+                                <apex:inputText id="consumable_Guaranteen_endStr" value="{!searchB.consumable_Guaranteen_endStr}" size="12" onfocus="DatePicker.pickDate(true, '{!$Component.consumable_Guaranteen_endStr}', false)" />
+                            </td>
                             <td class="blankStyle"></td>
                             <td class="labelStyle">鍒嗗叕鍙稿彿</td>
                             <td class="inputTextStyle">
@@ -626,9 +633,9 @@
                 <apex:outputField styleClass="textStyle" value="{!amHeader.Status__c}"/>
                 <apex:outputField styleClass="textStyle" value="{!amHeader.Submit_Person__c}" rendered="{! amHeader.MaintainType__c=='瀹炵墿鎶ュ簾'|| ISBLANK(amHeader.MaintainType__c) }"/>
             </apex:pageBlockSection>
-            <apex:pageBlockSection columns="1" rendered="{! amHeader.MaintainType__c=='瀹炵墿鎶ュ簾'|| ISBLANK(amHeader.MaintainType__c) }">
-                <apex:pageBlockSection columns="2" rendered="{! editmode}">
-                    <apex:pageBlockSectionItem >
+            <apex:pageBlockSection id="SalesSectionOut1" columns="1" rendered="{! amHeader.MaintainType__c=='瀹炵墿鎶ュ簾'|| ISBLANK(amHeader.MaintainType__c) }">
+                <apex:pageBlockSection id="SalesSectionIn1" columns="2" rendered="{! editmode}">
+                    <apex:pageBlockSectionItem id="SalesSectionItem1">
                         <apex:outputLabel value="{!$ObjectType.AssetMaintainHeader__c.fields.CC_User1__c.Label}"/>
                         <apex:inputField id="SalesName1" value="{!amHeader.CC_User1__c}"/>
                     </apex:pageBlockSectionItem>
@@ -636,7 +643,7 @@
                         <apex:outputLabel value="{!$ObjectType.AssetMaintainHeader__c.fields.CC_Email1__c.Label}"/>
                         <apex:inputField value="{!amHeader.CC_Email1__c}"/>
                     </apex:pageBlockSectionItem>
-                    <apex:pageBlockSectionItem >
+                    <apex:pageBlockSectionItem id="SalesSectionItem2">
                         <apex:outputLabel value="{!$ObjectType.AssetMaintainHeader__c.fields.CC_User2__c.Label}"/>
                         <apex:inputField id="SalesName2" value="{!amHeader.CC_User2__c}"/>
                     </apex:pageBlockSectionItem>
@@ -644,7 +651,7 @@
                         <apex:outputLabel value="{!$ObjectType.AssetMaintainHeader__c.fields.CC_Email2__c.Label}"/>
                         <apex:inputField value="{!amHeader.CC_Email2__c}"/>
                     </apex:pageBlockSectionItem>
-                    <apex:pageBlockSectionItem >
+                    <apex:pageBlockSectionItem id="SalesSectionItem3">
                         <apex:outputLabel value="{!$ObjectType.AssetMaintainHeader__c.fields.CC_User3__c.Label}"/>
                         <apex:inputField id="SalesName3" value="{!amHeader.CC_User3__c}"/>
                     </apex:pageBlockSectionItem>
@@ -652,12 +659,12 @@
                         <apex:outputLabel value="{!$ObjectType.AssetMaintainHeader__c.fields.CC_Email3__c.Label}"/>
                         <apex:inputField value="{!amHeader.CC_Email3__c}"/>
                     </apex:pageBlockSectionItem>
-                    <apex:pageBlockSectionItem >
+                    <apex:pageBlockSectionItem id="SalesSectionItem4">
                         <apex:outputLabel value="{!$ObjectType.AssetMaintainHeader__c.fields.CC_User4__c.Label}"/>
                         <apex:inputField id="SalesName4" value="{!amHeader.CC_User4__c}"/>
                     </apex:pageBlockSectionItem>
                     <apex:pageBlockSectionItem />
-                    <apex:pageBlockSectionItem >
+                    <apex:pageBlockSectionItem id="SalesSectionItem5">
                         <apex:outputLabel value="{!$ObjectType.AssetMaintainHeader__c.fields.CC_User5__c.Label}"/>
                         <apex:inputField id="SalesName5" value="{!amHeader.CC_User5__c}"/>
                     </apex:pageBlockSectionItem>
@@ -707,7 +714,7 @@
 
                        //鍘焌pex:inputField鐨刬d鍊硷紝闇�瑕佸湪椤甸潰涓婅幏鍙� 
 
-                       inputFieldId : 'allPage:allForm:pageBlockButton1:j_id105:j_id106:j_id107:SalesName1', 
+                       inputFieldId : 'allPage:allForm:pageBlockButton1:SalesSectionOut1:SalesSectionIn1:SalesSectionItem1:SalesName1', 
 
                        //鏌ユ壘瀛楁鎵�鍦ㄥ璞� 
 
@@ -731,7 +738,7 @@
 
                        //鍘焌pex:inputField鐨刬d鍊硷紝闇�瑕佸湪椤甸潰涓婅幏鍙� 
 
-                       inputFieldId : 'allPage:allForm:pageBlockButton1:j_id105:j_id106:j_id112:SalesName2', 
+                       inputFieldId : 'allPage:allForm:pageBlockButton1:SalesSectionOut1:SalesSectionIn1:SalesSectionItem2:SalesName2', 
 
                        //鏌ユ壘瀛楁鎵�鍦ㄥ璞� 
 
@@ -753,7 +760,7 @@
 
                    //鍘焌pex:inputField鐨刬d鍊硷紝闇�瑕佸湪椤甸潰涓婅幏鍙� 
 
-                   inputFieldId : 'allPage:allForm:pageBlockButton1:j_id105:j_id106:j_id117:SalesName3', 
+                   inputFieldId : 'allPage:allForm:pageBlockButton1:SalesSectionOut1:SalesSectionIn1:SalesSectionItem3:SalesName3', 
 
                    //鏌ユ壘瀛楁鎵�鍦ㄥ璞� 
 
@@ -775,7 +782,7 @@
 
                    //鍘焌pex:inputField鐨刬d鍊硷紝闇�瑕佸湪椤甸潰涓婅幏鍙� 
 
-                   inputFieldId : 'allPage:allForm:pageBlockButton1:j_id105:j_id106:j_id122:SalesName4', 
+                   inputFieldId : 'allPage:allForm:pageBlockButton1:SalesSectionOut1:SalesSectionIn1:SalesSectionItem4:SalesName4', 
 
                    //鏌ユ壘瀛楁鎵�鍦ㄥ璞� 
 
@@ -797,7 +804,7 @@
 
                    //鍘焌pex:inputField鐨刬d鍊硷紝闇�瑕佸湪椤甸潰涓婅幏鍙� 
 
-                   inputFieldId : 'allPage:allForm:pageBlockButton1:j_id105:j_id106:j_id125:SalesName5', 
+                   inputFieldId : 'allPage:allForm:pageBlockButton1:SalesSectionOut1:SalesSectionIn1:SalesSectionItem5:SalesName5', 
 
                    //鏌ユ壘瀛楁鎵�鍦ㄥ璞� 
 
@@ -832,6 +839,34 @@
                        resetOpenPage(SelectFieldParamList); 
 
                    }
+
+                   function refreshinput1(){
+                    // 澶嶆潅缁勪欢 start
+                    var baseURL = '';
+                            var ObjectType = 'AssetMaintainDetail__c';
+                            var QueryFieldApiName = 'OneToOne_Main__c';
+                            var ObjectType = 'AssetMaintainDetail__c';
+                            var inputFieldId = '';
+                            var inputFieldId_lktp = '';
+                            var SelectObj = 'Asset';
+                            var SelectFld = 'Name';
+                            console.log('xxx');
+                            console.log('123');
+                            var cnt = j$(escapeVfId('count_hidden')).val();
+                            console.log('count_hidden=' + j$(escapeVfId('count_hidden').length));
+                            console.log('count=' + cnt);
+                            for (var i = 0; i < cnt; i++) {
+                                inputFieldId = 'allPage:allForm:dataBlock:dataline_R1:'+ i +':OneToOne';
+                                inputFieldId_lktp = 'allPage:allForm:dataBlock:dataline_R1:'+ i +':OneToOne_lktp';
+                                baseURL = '/apex/SearchContactPageLWC?ObjectType=' + ObjectType + '&QueryFieldApiName=' + QueryFieldApiName +'&QueryFieldApiName=' + QueryFieldApiName +'&ObjectType=' + ObjectType +'&inputFieldId=' + inputFieldId +'&SelectObj=' + SelectObj +'&SelectFld=' + SelectFld;
+                                var obj = document.getElementById('allPage:allForm:dataBlock:dataline_R1:' + i + ':OneToOne_lkwgt');
+                                if (obj != null) {
+                                    obj.setAttribute('href', 'javascript:%20openLookup%28%27' + baseURL + '%26lktp%3D%27%20%2B%20getElementByIdCS%28%27' + inputFieldId_lktp + '%27%29.value%2C670%2C%271%27%2C%27%26lksrch%3D%27%20%2B%20escapeUTF%28getElementByIdCS%28%27' + inputFieldId + '%27%29.value.substring%280%2C%2080%29%29%29');
+                                }
+                            }
+                        // 澶嶆潅缁勪欢 end
+                    }
+                    refreshinput1();
                </script>
             <table border="0">
                 <tr>
@@ -1140,7 +1175,6 @@
                         </tr>
                         <apex:variable value="{!Cnt_L+1}" var="Cnt_L" />
                     </apex:repeat>
-
                     <apex:repeat id="dataline_L2" value="{!assetFromSearchList}" var="eachAssetData">
                         <tr class="dataRow" id="tableData_L_{!Cnt_L}" onmouseover="if (window.hiOn){hiOn(this);} " onmouseout="if (window.hiOff){hiOff(this);} " onblur="if (window.hiOff){hiOff(this);}" onfocus="if (window.hiOn){hiOn(this);}">
                             <!-- 鍏ㄩ�� -->
@@ -1167,7 +1201,7 @@
                                 <apex:outputField value="{!eachAssetData.amd.SerialNumber__c}" />
                             </td>
                         </tr>
-                        <apex:variable value="{!Cnt_L+1}" var="Cnt_L" />
+                        <apex:variable id="Cnt_L" value="{!Cnt_L+1}" var="Cnt_L" />
                     </apex:repeat>
                 </table>
             </div>
@@ -1264,7 +1298,7 @@
                                 <apex:outputField value="{!eachAssetData.amd.Is_OneToOne_Accessory__c}"/>
                             </td>
                             <td class="col_OneToOne_Main__c dataCellBorder1 OneToOne_Main__c" style="word-wrap:break-word">
-                                <apex:inputField value="{!eachAssetData.amd.OneToOne_Main__c}"
+                                <apex:inputField id="OneToOne" value="{!eachAssetData.amd.OneToOne_Main__c}"
                                                 onchange="j$(escapeVfId('allPage:allForm:dataBlock:dataline_L1:' + '{!Cnt_R}' + ':rowCheck')).prop('checked', true); setChangeFlg(); blockAbandon('{!Cnt_R}');"
                                                 rendered="{!editmode && eachAssetData.editable && eachAssetData.amd.Is_OneToOne_Accessory__c  && eachAssetData.amd.Manage_type__c == '鏁伴噺绠$悊'}"
                                 />
@@ -1282,8 +1316,36 @@
                                 />
                             </td>
                         </tr>
-                        <apex:variable value="{!Cnt_R+1}" var="Cnt_R" />
+                        <apex:variable id="Cnt_R" value="{!Cnt_R+1}" var="Cnt_R" />
                     </apex:repeat>
+                    <script>
+                    function refreshinput1(){
+                    // 澶嶆潅缁勪欢 start
+                    var baseURL = '';
+                            var ObjectType = 'AssetMaintainDetail__c';
+                            var QueryFieldApiName = 'OneToOne_Main__c';
+                            var ObjectType = 'AssetMaintainDetail__c';
+                            var inputFieldId = '';
+                            var inputFieldId_lktp = '';
+                            var SelectObj = 'Asset';
+                            var SelectFld = 'Name';
+                            console.log('xxx');
+                            console.log('123');
+                            var cnt = j$(escapeVfId('Cnt_L')).val();
+                            console.log('count=' + cnt);
+                            for (var i = 0; i < cnt; i++) {
+                                inputFieldId = 'allPage:allForm:dataBlock:dataline_R1:'+ i +':OneToOne';
+                                inputFieldId_lktp = 'allPage:allForm:dataBlock:dataline_R1:'+ i +':OneToOne_lktp';
+                                baseURL = '/apex/SearchContactPageLWC?ObjectType=' + ObjectType + '&QueryFieldApiName=' + QueryFieldApiName +'&QueryFieldApiName=' + QueryFieldApiName +'&ObjectType=' + ObjectType +'&inputFieldId=' + inputFieldId +'&SelectObj=' + SelectObj +'&SelectFld=' + SelectFld;
+                                var obj = document.getElementById('allPage:allForm:dataBlock:dataline_R1:' + i + ':OneToOne_lkwgt');
+                                if (obj != null) {
+                                    obj.setAttribute('href', 'javascript:%20openLookup%28%27' + baseURL + '%26lktp%3D%27%20%2B%20getElementByIdCS%28%27' + inputFieldId_lktp + '%27%29.value%2C670%2C%271%27%2C%27%26lksrch%3D%27%20%2B%20escapeUTF%28getElementByIdCS%28%27' + inputFieldId + '%27%29.value.substring%280%2C%2080%29%29%29');
+                                }
+                            }
+                        // 澶嶆潅缁勪欢 end
+                    }
+                    refreshinput1();
+                    </script>
                     <apex:variable value="{!Cnt_R}" var="Cnt_R_Start" />
                     <apex:repeat id="dataline_R2" value="{!assetFromSearchList}" var="eachAssetData">
                         <tr id="tableData_R_{!Cnt_R}" class="dataRow" onmouseover="if (window.hiOn){hiOn(this);} " onmouseout="if (window.hiOff){hiOff(this);} " onblur="if (window.hiOff){hiOff(this);}" onfocus="if (window.hiOn){hiOn(this);}" >

--
Gitblit v1.9.1