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/NewCrossRegionalSalesOpportunity.page | 177 ++++++++++++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 151 insertions(+), 26 deletions(-)
diff --git a/force-app/main/default/pages/NewCrossRegionalSalesOpportunity.page b/force-app/main/default/pages/NewCrossRegionalSalesOpportunity.page
index a879e0f..d1f3d30 100644
--- a/force-app/main/default/pages/NewCrossRegionalSalesOpportunity.page
+++ b/force-app/main/default/pages/NewCrossRegionalSalesOpportunity.page
@@ -2,11 +2,127 @@
<apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/>
<apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
<apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
-
+ <apex:includeScript value="{!URLFOR($Resource.CommonUtilJs)}"/>
+ <apex:includeScript value="{!URLFOR($Resource.AWSService, 'AWSService.js') }" />
+ <apex:includeScript value="/soap/ajax/40.0/connection.js"/>
<script>
+ aws_result = '';
+ AWSService.sfSessionId = '{!GETSESSIONID()}';
+ var staticResource = JSON.parse('{!staticResource}');
+ function GetObj(){
+ if('{!isDealerPage}'=='true'){
+ if('{!ProductSegment}'=='NDT'||'{!ProductSegment}'=='ANT'){
+ return JSON.stringify([{
+ dataId : document.getElementById("Page:mainForm:idSearchSetProduct:DealerInfo:AWS_Data_Id__c").value,
+ dealerSalesStaffName : document.getElementById("Page:mainForm:idSearchSetProduct:DealerInfo2:dssnd2:opp_DealerSalesStaffName").value,
+ dealerService : document.getElementById("Page:mainForm:idSearchSetProduct:DealerInfo2:ds:opp_DealerService").value,
+ }]);
+ }else{
+ return JSON.stringify([{
+ dataId : document.getElementById("Page:mainForm:idSearchSetProduct:DealerInfo:AWS_Data_Id__c").value,
+ dealerSalesStaffName : document.getElementById("Page:mainForm:idSearchSetProduct:DealerInfo2:dssnd1:opp_DealerSalesStaffName").value,
+ dealerService : document.getElementById("Page:mainForm:idSearchSetProduct:DealerInfo2:ds:opp_DealerService").value,
+ }]);
+ }
+ }else{
+ if('{!ProductSegment}'=='NDT'||'{!ProductSegment}'=='ANT'){
+ return JSON.stringify([{
+ dataId : document.getElementById("Page:mainForm:idSearchSetProduct:DealerInfo:AWS_Data_Id__c").value,
+ dealerSalesStaffName : document.getElementById("Page:mainForm:idSearchSetProduct:DealerInfo:dssn2:opp_DealerSalesStaffName").value,
+ dealerService : document.getElementById("Page:mainForm:idSearchSetProduct:DealerInfo:ds:opp_DealerService").value,
+ }]);
+ }else{
+ return JSON.stringify([{
+ dataId : document.getElementById("Page:mainForm:idSearchSetProduct:DealerInfo:AWS_Data_Id__c").value,
+ dealerSalesStaffName : document.getElementById("Page:mainForm:idSearchSetProduct:DealerInfo:dssn1:opp_DealerSalesStaffName").value,
+ dealerService : document.getElementById("Page:mainForm:idSearchSetProduct:DealerInfo:ds:opp_DealerService").value,
+ }]);
+ }
+ }
+ }
+ function ProcessPI(sobjJson, payloadForNewPI,callback) {
+ console.log('---insert---');
+ AWSService.post(staticResource.newUrl, payloadForNewPI, function(result){
+ aws_result = result
+ if(aws_result && aws_result.object && aws_result.object.length > 0){
+ let obj = aws_result.object[0];
+ if(obj){
+ document.getElementById("Page:mainForm:idSearchSetProduct:DealerInfo:AWS_Data_Id__c").value = obj.dataId;
+ if('{!isDealerPage}'=='true'){
+ document.getElementById("Page:mainForm:idSearchSetProduct:DealerInfo2:dssnd1:opp_DealerSalesStaffName").value = obj.dealerSalesStaffName;
+ document.getElementById("Page:mainForm:idSearchSetProduct:DealerInfo2:dsd:opp_DealerService").value = obj.dealerService;
+
+ document.getElementById("Page:mainForm:idSearchSetProduct:DealerInfo:Dealer_Sales_Staff_Name_D_Encrypted__c").value = obj.dealerSalesStaffNameDEncrypt;
+ document.getElementById("Page:mainForm:idSearchSetProduct:DealerInfo:Dealer_Service_D_Encrypted__c").value = obj.dealerServiceDEncrypt;
+ }else{
+ document.getElementById("Page:mainForm:idSearchSetProduct:DealerInfo:dssn1:opp_DealerSalesStaffName").value = obj.dealerSalesStaffName;
+ document.getElementById("Page:mainForm:idSearchSetProduct:DealerInfo:ds:opp_DealerService").value = obj.dealerService;
+
+ document.getElementById("Page:mainForm:idSearchSetProduct:DealerInfo:DealerSalesStaffName_Encrypted__c").value = obj.dealerSalesStaffNameEncrypt;
+ document.getElementById("Page:mainForm:idSearchSetProduct:DealerInfo:DealerService_Encrypted__c").value = obj.dealerServiceEncrypt;
+ }
+ }
+ if(callback){
+ callback();
+ }
+ }
+ }, staticResource.token);
+ }
+ var oppid = '';
+ function Redirect(){
+ window.location.href = '/'+oppid;
+ }
+ function Trans(){
+ let b = HasError();
+ console.log('---HasError---');
+ console.log(b);
+ console.log('---aws_result---');
+ console.log(aws_result);
+ AWSService.post(staticResource.transactionUrl, JSON.stringify({
+ "txId":aws_result.txId,
+ "isSuccess":b ? 0 : 1
+ }), function(result){
+ console.log('---result---');
+ console.log(result);
+ console.log('finish');
+ Redirect();
+ //window.location.reload();
+ }, staticResource.token);
+
+ }
+ function HasError(){
+ let e = document.getElementById("page:mainForm:message");
+ console.log(e);
+ if (!e) {
+ return false;
+ }
+
+ if(j$(e).find(".editListError").length > 0){
+ return true;
+ }
+
+ let divs = j$(e).find("div.message");
+ for (let i = 0; i < divs.length; i++) {
+ for (let j = 0; j < divs[i].classList.length; j++) {
+ for(let cls in divs[i].classList){
+ if (cls.indexOf('error')>-1) {
+ return true;
+ }
+ }
+
+ }
+
+ }
+ return false;
+ }
function saveJs() {
blockme();
- saveBtn();
+ console.log('{!isDealerPage}');
+ console.log('{!ProductSegment}');
+ ProcessPI({},GetObj(),function(){
+ saveBtn();
+ });
+ //
}
function saveYesJs() {
@@ -30,7 +146,10 @@
</script>
<apex:form id="mainForm">
- <apex:actionFunction action="{!saveBtn}" name="saveBtn" reRender="mainForm,message" oncomplete="unblockUI();"/>
+ <script>
+ oppid = '{!oppid}';
+ </script>
+ <apex:actionFunction action="{!saveBtn}" name="saveBtn" reRender="mainForm,message" oncomplete="unblockUI();Trans();"/>
<apex:actionFunction action="{!saveBtnYes}" name="saveBtnYes" reRender="mainForm,message" oncomplete="unblockUI();"/>
<apex:actionFunction action="{!saveBtnNo}" name="saveBtnNo" reRender="mainForm,message" oncomplete="unblockUI();"/>
@@ -130,30 +249,36 @@
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
- <apex:pageBlockSection title="缁忛攢鍟嗙浉鍏充俊鎭�" columns="2">
+ <apex:pageBlockSection id="DealerInfo" title="缁忛攢鍟嗙浉鍏充俊鎭�" columns="2">
<apex:pageBlockSectionItem >
<apex:outputLabel value="浠g悊鍟嗗悕" for="opp_Dealer"/>
<apex:inputField value="{!opp.Dealer__c}" id="opp_Dealer"/>
</apex:pageBlockSectionItem>
- <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: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:pageBlockSectionItem>
+ <apex:pageBlockSectionItem id="dssn1" rendered="{!IF(ProductSegment == 'NDT' || ProductSegment == 'ANI', false, true)}">
+ <apex:outputLabel value="浠g悊鍟嗛攢鍞媴褰撹�呭悕" for="opp_DealerSalesStaffName"/>
+ <apex:inputField value="{!opp.DealerSalesStaffName__c}" id="opp_DealerSalesStaffName"/><!--pi-->
+ </apex:pageBlockSectionItem>
+
+ <apex:pageBlockSectionItem id="dssn2" 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"/><!--pi-->
+ </apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >
<apex:outputLabel value="涓棿鍟嗗悕" for="opp_SubDealer"/>
<apex:inputField value="{!opp.SubDealer__c}" id="opp_SubDealer"/>
</apex:pageBlockSectionItem>
- <apex:pageBlockSectionItem >
+ <apex:pageBlockSectionItem id="ds" >
<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"/><!--pi-->
</apex:pageBlockSectionItem>
+ <apex:inputHidden value="{!opp.AWS_Data_Id__c}" id="AWS_Data_Id__c"/>
+ <apex:inputHidden value="{!opp.DealerSalesStaffName_Encrypted__c}" id="DealerSalesStaffName_Encrypted__c"/>
+ <apex:inputHidden value="{!opp.DealerService_Encrypted__c}" id="DealerService_Encrypted__c"/>
+ <apex:inputHidden value="{!opp.Dealer_Sales_Staff_Name_D_Encrypted__c}" id="Dealer_Sales_Staff_Name_D_Encrypted__c"/>
+ <!-- <apex:inputHidden value="{!opp.Dealer_Service_D_Encrypted__c}" id="Dealer_Service_D_Encrypted__c"/> -->
+ <input id="Page:mainForm:idSearchSetProduct:DealerInfo:Dealer_Service_D_Encrypted__c" type="hidden" name="Page:mainForm:idSearchSetProduct:DealerInfo:Dealer_Service_D_Encrypted__c" value="{!opp.Dealer_Service_D_Encrypted__c}"/>
</apex:pageBlockSection>
<apex:pageBlockSection title="璺ㄥ尯鍩熼攢鍞�" columns="2">
@@ -319,30 +444,30 @@
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
- <apex:pageBlockSection title="缁忛攢鍟嗙浉鍏充俊鎭�" columns="2">
+ <apex:pageBlockSection id="DealerInfo2" title="缁忛攢鍟嗙浉鍏充俊鎭�" columns="2">
<apex:pageBlockSectionItem >
<apex:outputLabel value="浠g悊鍟嗗悕" for="opp_Dealer"/>
<apex:inputField value="{!opp.Dealer__c}" id="opp_Dealer"/>
</apex:pageBlockSectionItem>
<!-- <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:pageBlockSectionItem>
+ <apex:pageBlockSectionItem id="dssnd1" 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"/><!--pi-->
+ </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:pageBlockSectionItem>
+ <apex:pageBlockSectionItem id="dssnd2" 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"/><!--pi-->
+ </apex:pageBlockSectionItem>
<!-- </apex:outputPanel> -->
<apex:pageBlockSectionItem >
<apex:outputLabel value="涓棿鍟嗗悕." for="opp_SubDealer"/>
<apex:inputField value="{!opp.Sub_Dealer_D__c}" id="opp_SubDealer"/>
</apex:pageBlockSectionItem>
- <apex:pageBlockSectionItem >
+ <apex:pageBlockSectionItem id="dsd" >
<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"/><!--pi-->
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
--
Gitblit v1.9.1