|  |  |  | 
|---|
|  |  |  | component.set('v.allselectlist',res.allselectlist); | 
|---|
|  |  |  | component.set('v.doclist',res.doclist); | 
|---|
|  |  |  | // PIPL update Yin Mingjie 21/02/2022 start | 
|---|
|  |  |  | component.find('select_agency_person').set('v.options', this.conv_selected(res.allselectlist.AgencyPerson__c)); | 
|---|
|  |  |  | // this.search_contact(component, event, helper,res.allselectlist.AgencyPerson__c); | 
|---|
|  |  |  | // component.find('select_agency_person').set('v.options', this.conv_selected(res.allselectlist.AgencyPerson__c)); | 
|---|
|  |  |  | this.search_contact(component, event, helper,res.allselectlist.AgencyPerson__c); | 
|---|
|  |  |  | // PIPL update Yin Mingjie 21/02/2022 end | 
|---|
|  |  |  | component.find('select_department').set('v.options', this.conv_selected(res.allselectlist.Department_Cateogy__c)); | 
|---|
|  |  |  | component.find('select_purpose_type').set('v.options', this.conv_selected(res.allselectlist.Purpose_Type__c)); | 
|---|
|  |  |  | 
|---|
|  |  |  | saveRecords : function(component,event){ | 
|---|
|  |  |  | component.set('v.login',true); | 
|---|
|  |  |  | var action = component.get("c.processData"); | 
|---|
|  |  |  | debugger; | 
|---|
|  |  |  | var selectDate = component.find('select_date').get('v.value'); | 
|---|
|  |  |  | var fieldsList=['Name','Phone','AccountNumber']; //Please write your code dynamic fields | 
|---|
|  |  |  | var sss=component.get("v.fileContentData"); | 
|---|
|  |  |  | action.setParams({ | 
|---|
|  |  |  | fileData : component.get("v.fileContentData"), | 
|---|
|  |  |  | //selectDateselectDate :component.find('select_date').get('v.value'), | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | columnDivider = ','; | 
|---|
|  |  |  | lineDivider =  '\n'; | 
|---|
|  |  |  | keys = ['Submit_date__c','Person_In_Charge2__c','Report_Date__c','Agency_Hospital__c','Department_Cateogy__c','doctor2__c','visitor_title__c','Product_Category1__c','Product_Category2__c','Product_Category3__c','Purpose_Type__c','Result__c']; | 
|---|
|  |  |  | thkeys = ['周','担当','活动日','医院','科室','拜访人','职位','产品区分1','产品区分2','产品区分3','活动区分','结果'] | 
|---|
|  |  |  | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start | 
|---|
|  |  |  | keys = ['Submit_date__c','Person_In_Charge2__c','Report_Date__c','Agency_Hospital__c','Department_Cateogy__c','doctor2__c','visitor_title__c','Product_Category1__c','Product_Category2__c','Product_Category3__c','Purpose_Type__c','Result__c','SupportNeeds__c']; | 
|---|
|  |  |  | thkeys = ['周','担当','活动日','医院','科室','拜访人','职位','产品区分1','产品区分2','产品区分3','活动区分','结果','支援需求'] | 
|---|
|  |  |  | csvStringResult = ''; | 
|---|
|  |  |  | csvStringResult += thkeys.join(columnDivider); | 
|---|
|  |  |  | csvStringResult += lineDivider; | 
|---|
|  |  |  | 
|---|
|  |  |  | csvStringResult += '"'+ objectRecords[i].Product_Category2__r.Name+'"'; | 
|---|
|  |  |  | }else if(skey == 'Product_Category3__c'){ | 
|---|
|  |  |  | csvStringResult += '"'+ objectRecords[i].Product_Category3__r.Name+'"'; | 
|---|
|  |  |  | }else if(skey == 'SupportNeeds__c'){//SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start | 
|---|
|  |  |  | csvStringResult += '"'+ objectRecords[i].SupportNeeds__c+'"'; | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | csvStringResult += '"'+ objectRecords[i][skey]+'"'; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | return csvStringResult; | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | showExportDate : function(component,objectRecords){ | 
|---|
|  |  |  | console.log('进入showexceportdate'+objectRecords); | 
|---|
|  |  |  | var keys = ['Submit_date__c','Person_In_Charge2__c','Report_Date__c','Agency_Hospital__c','Department_Cateogy__c','doctor2__c','visitor_title__c','Product_Category1__c','Product_Category2__c','Product_Category3__c','Purpose_Type__c','Result__c']; | 
|---|
|  |  |  | var headers = ['周','担当','活动日','医院','科室','拜访人','职位','产品区分1','产品区分2','产品区分3','活动区分','结果'] | 
|---|
|  |  |  | console.log('进入showexceportdate'+objectRecords);//SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start | 
|---|
|  |  |  | var keys = ['Submit_date__c','Person_In_Charge2__c','Report_Date__c','Agency_Hospital__c','Department_Cateogy__c','doctor2__c','visitor_title__c','Product_Category1__c','Product_Category2__c','Product_Category3__c','Purpose_Type__c','Result__c','SupportNeeds__c']; | 
|---|
|  |  |  | var headers = ['周','担当','活动日','医院','科室','拜访人','职位','产品区分1','产品区分2','产品区分3','活动区分','结果','支援需求'] | 
|---|
|  |  |  | var content = "<table class=\"table slds-table slds-table--bordered slds-table--cell-buffer\">"; | 
|---|
|  |  |  | content += "<thead><tr class=\"slds-text-title--caps\">"; | 
|---|
|  |  |  | for(i=0;i<headers.length; i++){ | 
|---|
|  |  |  | 
|---|
|  |  |  | content += '<td>'+ objectRecords[i].Product_Category2__r.Name+'</td>'; | 
|---|
|  |  |  | }else if(skey == 'Product_Category3__c'){ | 
|---|
|  |  |  | content += '<td>'+ objectRecords[i].Product_Category3__r.Name+'</td>'; | 
|---|
|  |  |  | }else if(skey == 'SupportNeeds__c'){//SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start | 
|---|
|  |  |  | content += '<td>'+ objectRecords[i].SupportNeeds__c+'</td>'; | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | content += '<td>'+ objectRecords[i][skey]+'</td>'; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | //     var data = this.search(searchUrl,data,token); | 
|---|
|  |  |  | //     return data;searchUrl,requestSearchPayload,token | 
|---|
|  |  |  | // }, | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }) | 
|---|