沙世明
2023-03-09 99b667bdfd8d4fd4d56c2952510169d7f7be794c
force-app/main/default/aura/NewAgencyOpportunity/NewAgencyOpportunityHelper.js
@@ -56,7 +56,7 @@
        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');
@@ -122,6 +122,7 @@
    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){                
@@ -129,12 +130,16 @@
                    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();
@@ -174,6 +179,7 @@
                                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;
@@ -187,7 +193,8 @@
                        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();
@@ -202,7 +209,12 @@
                                                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'];
                                                    }
                                                }
                                            }
                                        }