| | |
| | | let tableBody = document.createElement('TBODY'); |
| | | table.appendChild(tableBody); |
| | | let headerTR = document.createElement('TR'); |
| | | let colsHeader = ['姓名','经销商医院', '医生区分(职务)','分类']; |
| | | let colsHeader = ['姓名','医院', '医生区分(职务)','分类']; |
| | | tableBody.appendChild(headerTR); |
| | | for (let i = 0; i < colsHeader.length; i++) { |
| | | let td = document.createElement('TH'); |
| | |
| | | preparePayloadForSearchAgencyContact : function(component, event, helper){ |
| | | let that = this; |
| | | let agencyHospitalId = ''; |
| | | let accountId = ''; |
| | | let layout = component.get('v.layout'); |
| | | for(let s of layout){ |
| | | for(let c of s.layoutColumns){ |
| | |
| | | if(item.field == 'Agency_Hospital__c'){ |
| | | agencyHospitalId = item.value; |
| | | } |
| | | if(item.field == 'Account_Opp__c'){ |
| | | accountId = item.value; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | var action = component.get('c.getAWSDataIds'); |
| | | action.setParams({ |
| | | "agencyHospitalId" : agencyHospitalId, |
| | | "accountId" : accountId |
| | | }); |
| | | action.setCallback(this,function(response){ |
| | | var state = response.getState(); |
| | |
| | | let contactInfo = new Object(); |
| | | //需要修改 |
| | | contactInfo.Name = data.object[i].name; |
| | | contactInfo.AgencyHospital = ''; |
| | | contactInfo.DoctorDivision1 = data.object[i].doctorDivision1; |
| | | contactInfo.AWSDataId = data.object[i].dataId; |
| | | contactInfo.Type = data.object[i].type; |
| | |
| | | var searchAgencyContacts = component.get('c.searchAgencyContacts'); |
| | | searchAgencyContacts.setParams({ |
| | | "awsAgencyContactIds" : JSON.stringify(awsDataIds), |
| | | "accountId" : agencyHospitalId |
| | | "agencyHospitalId" : agencyHospitalId, |
| | | "accountId" : accountId |
| | | }); |
| | | searchAgencyContacts.setCallback(this,function(response){ |
| | | var state = response.getState(); |
| | |
| | | let contactFromSF = contactsInfo[contactInfoList[i]['AWSDataId']]; |
| | | if(contactFromSF){ |
| | | contactInfoList[i].sfRecordId = contactFromSF['Id']; |
| | | contactInfoList[i].AgencyHospital = contactFromSF['Agency_Hospital__r']['Name']; |
| | | if(contactFromSF['Agency_Hospital__r']){ |
| | | contactInfoList[i].AgencyHospital = contactFromSF['Agency_Hospital__r']['Name']; |
| | | } |
| | | if(contactFromSF['Department_Class__r']){ |
| | | contactInfoList[i].AgencyHospital = contactFromSF['Department_Class__r']['Parent']['Name']; |
| | | } |
| | | } |
| | | } |
| | | } |