From 4420517bbbffea48cabe7a7dcdf2e1c4b440fc85 Mon Sep 17 00:00:00 2001
From: GWY <guweiyi@prec-tech.com>
Date: 星期一, 30 五月 2022 16:15:26 +0800
Subject: [PATCH] 两个LS特殊条件在说明的增减
---
force-app/main/default/pages/NewOpportunity.page | 49 +++++++++++++++++++++++++++++++++----------------
1 files changed, 33 insertions(+), 16 deletions(-)
diff --git a/force-app/main/default/pages/NewOpportunity.page b/force-app/main/default/pages/NewOpportunity.page
index 6fab793..e6b049c 100644
--- a/force-app/main/default/pages/NewOpportunity.page
+++ b/force-app/main/default/pages/NewOpportunity.page
@@ -7,14 +7,21 @@
<script>
var staticResource = JSON.parse('{!staticResource}');
var txId = '';
- var DealerSalesStaffNameId = 'Page:mainForm:idSearchSetProduct:j_id53:j_id56:opp_DealerSalesStaffName';
- var DealerServiceId = 'Page:mainForm:idSearchSetProduct:j_id53:j_id62:opp_DealerService';
- var opportunityAWSDataId = 'Page:mainForm:idSearchSetProduct:j_id53:opportunityAWSDataId';
+ // var DealerSalesStaffNameId = 'Page:mainForm:idSearchSetProduct:j_id53:j_id56:opp_DealerSalesStaffName';
+ // var DealerServiceId = 'Page:mainForm:idSearchSetProduct:j_id53:j_id62:opp_DealerService';
+ var DealerSalesStaffNameId = 'PIAPIBACK_opp_DealerSalesStaffName';
+ var DealerServiceId = 'PIAPIBACK_opp_DealerService';
+ var opportunityAWSDataId = 'Page:mainForm:idSearchSetProduct:j_id55:opportunityAWSDataId';
function getPIData(){
let opportunityPayloadList = [];
let opportunityPIData = new Object();
- opportunityPIData.dealerSalesStaffName = document.getElementById(DealerSalesStaffNameId).value
- opportunityPIData.dealerService = document.getElementById(DealerServiceId).value
+
+ if(document.getElementsByClassName(DealerSalesStaffNameId)[0]){
+ opportunityPIData.dealerSalesStaffName = document.getElementsByClassName(DealerSalesStaffNameId)[0].value
+ }
+ if(document.getElementsByClassName(DealerServiceId)[0]){
+ opportunityPIData.dealerService = document.getElementsByClassName(DealerServiceId)[0].value
+ }
opportunityPayloadList.push(opportunityPIData);
return JSON.stringify(opportunityPayloadList);
}
@@ -23,9 +30,15 @@
new Promise(function(resolve,reject){
//鍔犲瘑
let queryPostBack = function(data){
- document.getElementById(DealerSalesStaffNameId).value = data.object[0].dealerSalesStaffName;
- document.getElementById(DealerServiceId).value = data.object[0].dealerService;
- document.getElementById(opportunityAWSDataId).value = data.object[0].dataId;
+ if(document.getElementsByClassName(DealerSalesStaffNameId)[0]){
+ document.getElementsByClassName(DealerSalesStaffNameId)[0].value = data.object[0].dealerSalesStaffName;
+ }
+ if(document.getElementsByClassName(DealerServiceId)[0]){
+ document.getElementsByClassName(DealerServiceId)[0].value = data.object[0].dealerService;
+ }
+ if(document.getElementById(opportunityAWSDataId)){
+ document.getElementById(opportunityAWSDataId).value = data.object[0].dataId;
+ }
txId = data.txId;
resolve('success');
};
@@ -40,8 +53,12 @@
let b = HasError();
if(b){
//娓呯┖浠g悊鍟嗛攢鍞媴褰撹�呭悕
- document.getElementById(DealerSalesStaffNameId).value=''
- document.getElementById(DealerServiceId).value=''
+ if(document.getElementsByClassName(DealerSalesStaffNameId)[0]){
+ document.getElementsByClassName(DealerSalesStaffNameId)[0].value=''
+ }
+ if(document.getElementsByClassName(DealerServiceId)[0]){
+ document.getElementsByClassName(DealerServiceId)[0].value=''
+ }
}
AWSService.post(staticResource.transactionUrl, JSON.stringify({
"txId":txId,
@@ -184,12 +201,12 @@
<apex:pageBlockSectionItem rendered="{!IF(ProductSegment == 'NDT' || ProductSegment == 'ANI', false, true)}">
<apex:outputLabel value="浠g悊鍟嗛攢鍞媴褰撹�呭悕" for="opp_DealerSalesStaffName"/>
- <apex:inputField value="{!opp.DealerSalesStaffName__c}" id="opp_DealerSalesStaffName"/>
+ <apex:inputField value="{!opp.DealerSalesStaffName__c}" id="opp_DealerSalesStaffName" styleClass="PIAPIBACK_opp_DealerSalesStaffName"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem rendered="{!IF(ProductSegment == 'NDT' || ProductSegment == 'ANI', true, false)}">
<apex:outputLabel value="浠g悊鍟嗛攢鍞媴褰撹�呭悕" for="opp_DealerSalesStaffName"/>
- <apex:inputField value="{!opp.DealerSalesStaffName__c}" id="opp_DealerSalesStaffName" required="true"/>
+ <apex:inputField value="{!opp.DealerSalesStaffName__c}" id="opp_DealerSalesStaffName" styleClass="PIAPIBACK_opp_DealerSalesStaffName" required="true"/>
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
@@ -198,7 +215,7 @@
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel value="浠g悊鍟嗘湇鍔℃媴褰撹�呭悕" for="opp_DealerService"/>
- <apex:inputField value="{!opp.DealerService__c}" id="opp_DealerService"/>
+ <apex:inputField value="{!opp.DealerService__c}" id="opp_DealerService" styleClass="PIAPIBACK_opp_DealerService"/>
</apex:pageBlockSectionItem>
<apex:inputHidden id="opportunityAWSDataId" value="{!opp.AWS_Data_Id__c}"/>
</apex:pageBlockSection>
@@ -365,13 +382,13 @@
<!-- <apex:outputPanel layout="none" rendered="{!IF(ProductSegment == 'NDT' || ProductSegment == 'ANI', false, true)}"> -->
<apex:pageBlockSectionItem rendered="{!IF(ProductSegment == 'NDT' || ProductSegment == 'ANI', false, true)}">
<apex:outputLabel value="浠g悊鍟嗛攢鍞媴褰撹�呭悕." for="opp_DealerSalesStaffName"/>
- <apex:inputField value="{!opp.Dealer_Sales_Staff_Name_D__c}" id="opp_DealerSalesStaffName"/>
+ <apex:inputField value="{!opp.Dealer_Sales_Staff_Name_D__c}" id="opp_DealerSalesStaffName" styleClass="PIAPIBACK_opp_DealerSalesStaffName"/>
</apex:pageBlockSectionItem>
<!-- </apex:outputPanel> -->
<!-- <apex:outputPanel rendered="{!IF(ProductSegment == 'NDT' || ProductSegment == 'ANI', true, false)}" layout="inline"> -->
<apex:pageBlockSectionItem rendered="{!IF(ProductSegment == 'NDT' || ProductSegment == 'ANI', true, false)}">
<apex:outputLabel value="浠g悊鍟嗛攢鍞媴褰撹�呭悕." for="opp_DealerSalesStaffName"/>
- <apex:inputField value="{!opp.Dealer_Sales_Staff_Name_D__c}" id="opp_DealerSalesStaffName" required="true"/>
+ <apex:inputField value="{!opp.Dealer_Sales_Staff_Name_D__c}" id="opp_DealerSalesStaffName" required="true" styleClass="PIAPIBACK_opp_DealerSalesStaffName"/>
</apex:pageBlockSectionItem>
<!-- </apex:outputPanel> -->
<apex:pageBlockSectionItem >
@@ -380,7 +397,7 @@
</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel value="浠g悊鍟嗘湇鍔℃媴褰撹�呭悕." for="opp_DealerService"/>
- <apex:inputField value="{!opp.Dealer_Service_D__c}" id="opp_DealerService"/>
+ <apex:inputField value="{!opp.Dealer_Service_D__c}" id="opp_DealerService" styleClass="PIAPIBACK_opp_DealerService"/>
</apex:pageBlockSectionItem>
<apex:inputHidden id="opportunityAWSDataId" value="{!opp.AWS_Data_Id__c}"/>
</apex:pageBlockSection>
--
Gitblit v1.9.1