| | |
| | | <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){ |
| | | //清空代理商销售担当者名 |
| | | 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() { |
| | |
| | | </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();"/> |
| | | |
| | |
| | | <apex:outputLabel value="代理商销售担当者名" 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> |