| | |
| | | <apex:page Controller="SLAReportDetailsController" showHeader="false" sidebar="false" id="allPage" action="{!init}" title="信息更新"> |
| | | <apex:stylesheet value="{!URLFOR($Resource.blockUIcss)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.jquery183minjs)}"/> |
| | | <apex:includeScript value="{!URLFOR($Resource.PleaseWaitDialog)}"/> |
| | | <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" /> |
| | | <apex:includeScript value="/soap/ajax/40.0/connection.js"/> |
| | | <script> |
| | | function cancelJs() { |
| | | window.opener=null; |
| | |
| | | window.opener.document.getElementById('Page:mainForm:idDayEdit:idActivities:'+index+':EventCSLAInfoId').value = slaInfoId; |
| | | window.close(); |
| | | } |
| | | } |
| | | |
| | | var slaInfoStr = JSON.parse('{!slaInfoStr}'); |
| | | var staticResourceContact = JSON.parse('{!staticResourceContact}'); |
| | | var ids = []; |
| | | var dataIds = []; |
| | | var condition = ''; |
| | | var contact = {}; |
| | | queryContact(); |
| | | function q1(){ |
| | | var p = new Promise(function(resolve, reject){ |
| | | let queryBack = function queryBack(result) { |
| | | let contacts = result.object; |
| | | if(contacts == null){ |
| | | return; |
| | | } |
| | | for(var i=0;i<result.object.length;i++){ |
| | | if(result.object[i].sfRecordId != null){ |
| | | var o = []; |
| | | o.lastName = result.object[i].lastName; |
| | | o.phone = result.object[i].phone; |
| | | contact[result.object[i].sfRecordId] = o; |
| | | } |
| | | } |
| | | resolve('success'); |
| | | } |
| | | let searchPayload = new Object(); |
| | | searchPayload.dataIds = dataIds; |
| | | searchPayload.contactName = ''; |
| | | AWSService.search(staticResourceContact.searchUrl, JSON.stringify(searchPayload), queryBack, staticResourceContact.token); |
| | | }); |
| | | return p; |
| | | } |
| | | function q2(){ |
| | | var p = new Promise(function(resolve, reject){ |
| | | for(let key in contact){ |
| | | var k = ''+key; |
| | | document.getElementById(k).innerText = contact[k].lastName; |
| | | if(document.getElementById(k+'_Phone')){ |
| | | document.getElementById(k+'_Phone').innerText = contact[k].phone; |
| | | } |
| | | } |
| | | }); |
| | | return p; |
| | | } |
| | | function queryContact(){ |
| | | blockme(); |
| | | ids.push(slaInfoStr.Visitor1__c!=null?slaInfoStr.Visitor1__c:"") |
| | | ids.push(slaInfoStr.Visitor2__c!=null?slaInfoStr.Visitor2__c:"") |
| | | ids.push(slaInfoStr.Visitor3__c!=null?slaInfoStr.Visitor3__c:"") |
| | | ids.push(slaInfoStr.Visitor4__c!=null?slaInfoStr.Visitor4__c:"") |
| | | ids.push(slaInfoStr.Visitor5__c!=null?slaInfoStr.Visitor5__c:"") |
| | | sforce.connection.sessionId = '{!GETSESSIONID()}'; |
| | | for(var i=0;i<ids.length;i++){ |
| | | condition += "," + "\'"+ids[i]+"\'"; |
| | | } |
| | | condition = condition.substr(1); |
| | | console.log('condition = ' + condition); |
| | | var record = sforce.connection.query("select AWS_Data_Id__c from Contact where id in("+condition+")"); |
| | | var records = record.getArray("records"); |
| | | for(var i =0;i<records.length;i++){ |
| | | dataIds.push(records[i].AWS_Data_Id__c); |
| | | } |
| | | q1().then(function(data){ |
| | | return q2(data); |
| | | }); |
| | | unblockUI(); |
| | | } |
| | | </script> |
| | | <apex:form id="allForm"> |
| | |
| | | </apex:pageBlockSectionItem> |
| | | <apex:pageBlockSectionItem labelStyle="text-align:left;"> |
| | | <apex:outputLabel value="访问对象1"></apex:outputLabel> |
| | | <apex:outputField id="Visitor1__c" value="{!slaInfo.Visitor1__c}" /> |
| | | <!-- <apex:outputField id="{!slaInfo.Visitor1__c}" value="{!slaInfo.Visitor1__c}" /> --> |
| | | <span id="{!slaInfo.Visitor1__c}">{!slaInfo.Visitor1__c}</span> |
| | | </apex:pageBlockSectionItem> |
| | | <apex:pageBlockSectionItem labelStyle="text-align:left;"> |
| | | <apex:outputLabel value="访问对象1电话"></apex:outputLabel> |
| | | <apex:outputField id="Visitor1Phone" value="{!slaInfo.Visitor1__r.Phone}" /> |
| | | <!-- <apex:outputField id="{!slaInfo.Visitor1__c}_Phone" value="{!slaInfo.Visitor1__r.Phone}" /> --> |
| | | <span id="{!slaInfo.Visitor1__c}_Phone">{!slaInfo.Visitor1__r.Phone}</span> |
| | | </apex:pageBlockSectionItem> |
| | | <apex:pageBlockSectionItem labelStyle="text-align:left;"> |
| | | <apex:outputLabel value="访问对象2"></apex:outputLabel> |
| | | <apex:outputField id="Visitor2__c" value="{!slaInfo.Visitor2__c}" /> |
| | | <!-- <apex:outputField id="{!slaInfo.Visitor2__c}" value="{!slaInfo.Visitor2__c}" /> --> |
| | | <span id="{!slaInfo.Visitor2__c}">{!slaInfo.Visitor2__c}</span> |
| | | </apex:pageBlockSectionItem> |
| | | <apex:pageBlockSectionItem labelStyle="text-align:left;"> |
| | | <apex:outputLabel value="访问对象3"></apex:outputLabel> |
| | | <apex:outputField id="Visitor3__c" value="{!slaInfo.Visitor3__c}" /> |
| | | <!-- <apex:outputField id="{!slaInfo.Visitor3__c}" value="{!slaInfo.Visitor3__c}" /> --> |
| | | <span id="{!slaInfo.Visitor3__c}">{!slaInfo.Visitor3__c}</span> |
| | | </apex:pageBlockSectionItem> |
| | | <apex:pageBlockSectionItem labelStyle="text-align:left;"> |
| | | <apex:outputLabel value="访问对象4"></apex:outputLabel> |
| | | <apex:outputField id="Visitor4__c" value="{!slaInfo.Visitor4__c}" /> |
| | | <!-- <apex:outputField id="{!slaInfo.Visitor4__c}" value="{!slaInfo.Visitor4__c}" /> --> |
| | | <span id="{!slaInfo.Visitor4__c}">{!slaInfo.Visitor4__c}</span> |
| | | </apex:pageBlockSectionItem> |
| | | <apex:pageBlockSectionItem labelStyle="text-align:left;"> |
| | | <apex:outputLabel value="访问对象5"></apex:outputLabel> |
| | | <apex:outputField id="Visitor5__c" value="{!slaInfo.Visitor5__c}" /> |
| | | <!-- <apex:outputField id="{!slaInfo.Visitor5__c}" value="{!slaInfo.Visitor5__c}" /> --> |
| | | <span id="{!slaInfo.Visitor5__c}">{!slaInfo.Visitor5__c}</span> |
| | | </apex:pageBlockSectionItem> |
| | | </apex:pageBlockSection> |
| | | <apex:commandButton onclick="save()" rerender="goOrNot,inList" value="保存" style="width: 150px;margin-left: 50px;"/> |