From 2f4492ee18f90274582fcc2bb06f5e9bf64136e8 Mon Sep 17 00:00:00 2001 From: buli <137736985@qq.com> Date: 星期五, 13 五月 2022 17:32:14 +0800 Subject: [PATCH] ProdBackup0513 --- force-app/main/default/pages/NewReplacementOpportunity.page | 47 ++--------------------------------------------- 1 files changed, 2 insertions(+), 45 deletions(-) diff --git a/force-app/main/default/pages/NewReplacementOpportunity.page b/force-app/main/default/pages/NewReplacementOpportunity.page index 0b04ed8..9934402 100644 --- a/force-app/main/default/pages/NewReplacementOpportunity.page +++ b/force-app/main/default/pages/NewReplacementOpportunity.page @@ -1,54 +1,12 @@ <apex:page id="Page" Controller="NewReplacementOpportunityController" 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 = ''; - function getPIData(){ - let opportunityPayloadList = []; - let opportunityPIData = new Object(); - opportunityPIData.dealerSalesStaffName = document.getElementById('Page:mainForm:idSearchSetProduct:j_id35:j_id38:opp_DealerSalesStaffName').value - opportunityPayloadList.push(opportunityPIData); - return JSON.stringify(opportunityPayloadList); - } function saveJs() { blockme(); - new Promise(function(resolve,reject){ - //鍔犲瘑 - let queryPostBack = function(data){ - document.getElementById('Page:mainForm:idSearchSetProduct:j_id35:j_id38:opp_DealerSalesStaffName').value = data.object[0].dealerSalesStaffName; - document.getElementById('Page:mainForm:idSearchSetProduct:j_id35: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悊鍟嗛攢鍞媴褰撹�呭悕 - document.getElementById('Page:mainForm:idSearchSetProduct:j_id35:j_id38:opp_DealerSalesStaffName').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; + saveBtn(); } function saveYesJs() { @@ -72,7 +30,7 @@ </script> <apex:form id="mainForm"> - <apex:actionFunction action="{!saveBtn}" name="saveBtn" reRender="mainForm,message" oncomplete="Trans();unblockUI();"/> + <apex:actionFunction action="{!saveBtn}" name="saveBtn" reRender="mainForm,message" oncomplete="unblockUI();"/> <apex:actionFunction action="{!saveBtnYes}" name="saveBtnYes" reRender="mainForm,message" oncomplete="unblockUI();"/> <apex:actionFunction action="{!saveBtnNo}" name="saveBtnNo" reRender="mainForm,message" oncomplete="unblockUI();"/> @@ -141,7 +99,6 @@ <apex:outputLabel value="浠g悊鍟嗛攢鍞媴褰撹�呭悕" for="opp_DealerSalesStaffName"/> <apex:inputField value="{!opp.DealerSalesStaffName__c}" id="opp_DealerSalesStaffName" required="true"/> </apex:pageBlockSectionItem> - <apex:inputHidden id="opportunityAWSDataId" value="{!opp.AWS_Data_Id__c}"/> </apex:pageBlockSection> </apex:pageBlock> -- Gitblit v1.9.1