| | |
| | | component.find('select_result').set('v.options', this.conv_selected(res.allselectlist.Result__c)); |
| | | component.find('select_stageName').set('v.options', this.conv_selected(res.allselectlist.StageName__c)); |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start |
| | | component.find('SupportNeeds__c').set('v.options', this.conv_selected(res.allselectlist.SupportNeeds__c)); |
| | | // component.find('SupportNeeds__c').set('v.options', this.conv_selected(res.allselectlist.SupportNeeds__c)); |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 end |
| | | component.set('v.selected_agency_person', res.allselectlist.AgencyPerson__c[0].label); |
| | | component.set('v.dialog_type', '新建'); |
| | |
| | | var Purpose_Type__c = component.find('select_purpose_type').get('v.value'); |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start |
| | | // 支援需求 SupportNeeds__c |
| | | var SupportNeeds__c = component.find('SupportNeeds__c').get('v.value'); |
| | | // var SupportNeeds__c = component.find('SupportNeeds__c').get('v.value'); |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 end |
| | | // 询价 Opportunity__c |
| | | var Opportunity__c = component.get('v.data.Opportunity__c'); |
| | |
| | | "Department_Cateogy" : Department_Cateogy__c, |
| | | "Purpose_Type" : Purpose_Type__c, |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start |
| | | "SupportNeedsc" : SupportNeeds__c, |
| | | // "SupportNeedsc" : SupportNeeds__c, |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 end |
| | | "Agency_Report_Header" : Agency_Report_Header__c, |
| | | "Agency_Hospital" : Agency_Hospital__c, |
| | |
| | | "Department_Cateogy" : Department_Cateogy__c, |
| | | "Purpose_Type" : Purpose_Type__c, |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start |
| | | "SupportNeedsc" : SupportNeeds__c, |
| | | // "SupportNeedsc" : SupportNeeds__c, |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 end |
| | | "Agency_Report_Header" : Agency_Report_Header__c, |
| | | "Agency_Hospital" : Agency_Hospital__c, |
| | |
| | | }, |
| | | |
| | | insert_agencycontact : function(component,token,newUrl,payload,agencyHospitalid,helper) { |
| | | |
| | | AWSService.insert(newUrl,payload,function(result){ |
| | | if(result.status == '0'){ |
| | | $A.getCallback(function(){ |
| | | helper.to_agencycontact(component,result,agencyHospitalid); |
| | | })(); |
| | | |
| | | }else{ |
| | | console.log('AWS status error:' + result) |
| | | component.set('v.login',false); |
| | | component.find('OppMessage').setError('AWS insert error.'); |
| | | } |
| | | },token); |
| | | /* |
| | | fetch(newUrl, { |
| | | method: 'POST', |
| | | body: payload, |
| | |
| | | console.log('AWS insert error:' + error) |
| | | component.set('v.login',false); |
| | | component.find('OppMessage').setError('AWS insert error.'); |
| | | }); |
| | | });*/ |
| | | |
| | | }, |
| | | |
| | |
| | | component.set('v.login',true); |
| | | var action = component.get("c.processData"); |
| | | var selectDate = component.find('select_date').get('v.value'); |
| | | var fieldsList=['Name','Phone','AccountNumber']; //Please write your code dynamic fields |
| | | var fieldsList=['Name','Phone','AccountNumber']; //Please write your code dynamic |
| | | var sss=component.get("v.fileContentData"); |
| | | action.setParams({ |
| | | fileData : component.get("v.fileContentData"), |
| | | //selectDateselectDate :component.find('select_date').get('v.value'), |
| | |
| | | } |
| | | columnDivider = ','; |
| | | lineDivider = '\n'; |
| | | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start ,'SupportNeeds__c' ,'支援需求' |
| | | 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','活动区分','结果'] |
| | | csvStringResult = ''; |
| | |
| | | csvStringResult += '"'+ objectRecords[i].Product_Category2__r.Name+'"'; |
| | | }else if(skey == 'Product_Category3__c'){ |
| | | csvStringResult += '"'+ objectRecords[i].Product_Category3__r.Name+'"'; |
| | | }else{ |
| | | } |
| | | // else if(skey == 'SupportNeeds__c'){//SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start |
| | | // csvStringResult += '"'+ objectRecords[i].SupportNeeds__c+'"'; |
| | | // } |
| | | else{ |
| | | csvStringResult += '"'+ objectRecords[i][skey]+'"'; |
| | | } |
| | | counter++; |
| | |
| | | return csvStringResult; |
| | | }, |
| | | showExportDate : function(component,objectRecords){ |
| | | console.log('进入showexceportdate'+objectRecords); |
| | | console.log('进入showexceportdate'+objectRecords);//SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start ,'SupportNeeds__c' ,'支援需求' |
| | | 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','活动区分','结果'] |
| | | var content = "<table class=\"table slds-table slds-table--bordered slds-table--cell-buffer\">"; |
| | |
| | | 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{ |
| | | } |
| | | // else if(skey == 'SupportNeeds__c'){//SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start |
| | | // content += '<td>'+ objectRecords[i].SupportNeeds__c+'</td>'; |
| | | // } |
| | | else{ |
| | | content += '<td>'+ objectRecords[i][skey]+'</td>'; |
| | | } |
| | | } // inner for loop close |
| | |
| | | var res = response.getReturnValue(); |
| | | console.log('输入的开始日期3'+res); |
| | | component.set('v.login',false); |
| | | this.showExportDate(component,res); |
| | | |
| | | // PI 改造 By Bright 20220328 |
| | | if(true){ |
| | | let awsids = []; |
| | | for (let ri in res) { |
| | | if(res[ri] && res[ri].doctor2__r && res[ri].doctor2__r.AWS_Data_Id__c){ |
| | | awsids.push(res[ri].doctor2__r.AWS_Data_Id__c); |
| | | } |
| | | } |
| | | if(awsids.length > 0){ |
| | | let awsurl = component.get('v.awsurl'); |
| | | |
| | | AWSService.search(awsurl.searchUrl,{ |
| | | dataIds:awsids |
| | | }, function(data){ |
| | | if(data && data.object && data.object.length){ |
| | | let m = {}; |
| | | for(let di in data.object){ |
| | | if(data.object[di] && data.object[di].dataId){ |
| | | m[data.object[di].dataId] = data.object[di]; |
| | | } |
| | | } |
| | | |
| | | for(let ri in res){ |
| | | if(res[ri] && res[ri].doctor2__r && res[ri].doctor2__r.AWS_Data_Id__c && m.hasOwnProperty(res[ri].doctor2__r.AWS_Data_Id__c)){ |
| | | res[ri].doctor2__r.Name = m[res[ri].doctor2__r.AWS_Data_Id__c].name; |
| | | res[ri].visitor_title__c = m[res[ri].doctor2__r.AWS_Data_Id__c].doctorDivision1; |
| | | |
| | | } |
| | | } |
| | | } |
| | | helper.showExportDate(component, res); |
| | | |
| | | component.set('v.login', false); |
| | | }, awsurl.token); |
| | | }else{ |
| | | helper.showExportDate(component, res); |
| | | } |
| | | } |
| | | |
| | | |
| | | component.set('v.reports_date', res); |
| | | |
| | | }else{ |
| | |
| | | // var data = this.search(searchUrl,data,token); |
| | | // return data;searchUrl,requestSearchPayload,token |
| | | // }, |
| | | |
| | | }) |