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 | 79 ++++++++++++++++++++++++++++++++++++---
1 files changed, 72 insertions(+), 7 deletions(-)
diff --git a/force-app/main/default/pages/NewOpportunity.page b/force-app/main/default/pages/NewOpportunity.page
index a31dc35..e6b049c 100644
--- a/force-app/main/default/pages/NewOpportunity.page
+++ b/force-app/main/default/pages/NewOpportunity.page
@@ -1,12 +1,75 @@
<apex:page id="Page" Controller="NewOpportunityController" sidebar="true" showHeader="true" action="{!init}">
+ <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" />
<apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/>
<apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/>
<apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/>
<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 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();
+
+ 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);
+ }
function saveJs() {
blockme();
- saveBtn();
+ new Promise(function(resolve,reject){
+ //鍔犲瘑
+ let queryPostBack = function(data){
+ 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');
+ };
+ AWSService.post(staticResource.newUrl,getPIData(),queryPostBack,staticResource.token);
+ }).then(function(data){
+ saveBtn();
+ Trans();
+ })
+ }
+ //aws 纭
+ function Trans(){
+ let b = HasError();
+ if(b){
+ //娓呯┖浠g悊鍟嗛攢鍞媴褰撹�呭悕
+ 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,
+ "isSuccess":b ? 0 : 1
+ }), function(result){
+ console.log('Trans result = '+ JSON.stringify(result));
+ }, staticResource.token);
+ }
+ function HasError(){
+ let e = document.getElementById("Page:mainForm:message");
+ return e.children[0]!=null;
}
function saveYesJs() {
@@ -138,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 >
@@ -152,8 +215,9 @@
</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>
<apex:pageBlockSection title="绔炰簤鑰呬俊鎭�" columns="2">
@@ -318,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 >
@@ -333,8 +397,9 @@
</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>
<apex:pageBlockSection title="绔炰簤鑰呬俊鎭�" columns="2">
--
Gitblit v1.9.1