From dcfa939ce01163ae736bd8275f93b5ac054bdfdd Mon Sep 17 00:00:00 2001
From: chenjingwu <chenjingwu@prec-tech.com>
Date: 星期四, 25 四月 2024 13:19:56 +0800
Subject: [PATCH] 123

---
 force-app/main/default/pages/MaintenanceProductData.page |   23 +++++++++++++++++------
 1 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/force-app/main/default/pages/MaintenanceProductData.page b/force-app/main/default/pages/MaintenanceProductData.page
index 2ddcb7b..1b89bb5 100644
--- a/force-app/main/default/pages/MaintenanceProductData.page
+++ b/force-app/main/default/pages/MaintenanceProductData.page
@@ -1657,8 +1657,8 @@
                                                 <apex:InputField value="{!exmpdDetailsRecordsMap[mp.mpded.ProductsID__c][0].mpdrdd.AmountWithheld__c}" id="AmountWithheld" />
                                             </td>
                                             <td>
-                                                <apex:commandButton id="add" onclick="addJs();" value="娣诲姞" style="position:relative;width:100px;"/>  
-                                                <apex:commandButton id="delete" onclick="deleteJs();" value="鍒犻櫎" style="position:relative;width:100px;"/>
+                                                <apex:commandButton id="add" onclick="addJs(this);" value="娣诲姞" style="position:relative;width:100px;"/>  
+                                                <apex:commandButton id="delete" onclick="deleteJs(this);" value="鍒犻櫎" style="position:relative;width:100px;"/>
                                             </td>
                                         </tr>
                                         <apex:repeat value="{!exmpdDetailsRecordsMap[mp.mpded.ProductsID__c]}" var="mu" id="bb1" first="1">
@@ -1673,8 +1673,8 @@
                                                     <apex:InputField value="{!mu.mpdrdd.AmountWithheld__c}" id="AmountWithheld" />
                                                 </td>
                                                 <td>
-                                                    <apex:commandButton id="add1" onclick="addJs();" value="娣诲姞" style="position:relative;width:100px;"/>  
-                                                    <apex:commandButton id="delete1" onclick="deleteJs();" value="鍒犻櫎" style="position:relative;width:100px;"/>
+                                                    <apex:commandButton id="add1" onclick="add1Js(this);" value="娣诲姞" style="position:relative;width:100px;"/>  
+                                                    <apex:commandButton id="delete1" onclick="delete1Js(this);" value="鍒犻櫎" style="position:relative;width:100px;"/>
                                                 </td>
                                             </tr>
                                         </apex:repeat>
@@ -1727,8 +1727,19 @@
                     
                 </apex:pageblocksection>
                 <script type="text/javascript">
-                    function addJs(){
-
+                    function addJs(el){
+                        if(el.id){
+                            var index = el.id.substring(el.id.lastIndexOf('aa:') + 3,el.id.length - 4);
+                        }
+                        console.log(index);
+                    }
+                    function add1Js(el){
+                        if(el.id){
+                            var index1 = el.id.substring(el.id.lastIndexOf('aa:') + 3,el.id.lastIndexOf(':bb1'));
+                            var index2 = el.id.substring(el.id.lastIndexOf('bb1:') + 4,el.id.length - 5);
+                        }
+                        console.log(index1);
+                        console.log(index2);
                     }
                 </script>
                 <!-- chenjingwu 20240417 end -->

--
Gitblit v1.9.1