| | |
| | | <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(){ |
| | | return JSON.stringify([{ |
| | | dataId : document.getElementById("Page:mainForm:idSearchSetProduct:DealerInfo:AWS_Data_Id__c").value, |
| | | dealerSalesStaffName : document.getElementById("Page:mainForm:idSearchSetProduct:DealerInfo:dssn: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; |
| | | |
| | | document.getElementById("Page:mainForm:idSearchSetProduct:DealerInfo:dssn: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:mainfrom: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(); |
| | | ProcessPI({},GetObj(),function(){ |
| | | saveBtn(); |
| | | }); |
| | | } |
| | | |
| | | function saveYesJs() { |
| | |
| | | </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();"/> |
| | | |
| | |
| | | </apex:pageBlockSectionItem> |
| | | </apex:pageBlockSection> |
| | | |
| | | <apex:pageBlockSection title="经销商相关信息" columns="2"> |
| | | <apex:pageBlockSection id="DealerInfo" title="经销商相关信息" columns="2"> |
| | | <apex:pageBlockSectionItem > |
| | | <apex:outputLabel value="代理商名" for="opp_Dealer"/> |
| | | <apex:inputField value="{!opp.Dealer__c}" id="opp_Dealer"/> |
| | | </apex:pageBlockSectionItem> |
| | | |
| | | <apex:pageBlockSectionItem > |
| | | <apex:pageBlockSectionItem id="dssn" > |
| | | <apex:outputLabel value="代理商销售担当者名" for="opp_DealerSalesStaffName"/> |
| | | <apex:inputField value="{!opp.DealerSalesStaffName__c}" id="opp_DealerSalesStaffName"/> |
| | | <apex:inputField value="{!opp.DealerSalesStaffName__c}" id="opp_DealerSalesStaffName"/><!--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="代理商服务担当者名" 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:pageBlockSection> |
| | | |
| | | <apex:pageBlockSection title="跨区域销售" columns="2"> |
| | |
| | | <apex:outputLabel value="合作区域负责人" for="HeadOfCooperationArea__c"/> |
| | | <apex:inputField value="{!opp.HeadOfCooperationArea__c}" id="HeadOfCooperationArea__c"/> |
| | | </apex:pageBlockSectionItem> |
| | | |
| | | </apex:pageBlockSection> |
| | | |
| | | |