|  |  |  | 
|---|
|  |  |  | <!-- <force:inputField value="{!v.data.Product_Category3__c}" aura:id="input-product-category3"/> --> | 
|---|
|  |  |  | <ui:inputSelect aura:id="select_Product3" class="slds-select" change="{!c.productcategoryChange3}"/> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <!--SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start--> | 
|---|
|  |  |  | <!-- 支援需求 --> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <!--SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start--> | 
|---|
|  |  |  | <!-- 支援需求 change="{!c.SupportNeeds__c}"--> | 
|---|
|  |  |  | <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6"> | 
|---|
|  |  |  | {!v.fieldsmap.SupportNeeds__c} | 
|---|
|  |  |  | <ui:inputSelect aura:id="SupportNeeds__c" class="slds-select" /> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <!--SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 end--> | 
|---|
|  |  |  | <div aura:id="result" class="disp_none slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--3-of-12 slds-large-size--3-of-12"> | 
|---|
|  |  |  | {!v.fieldsmap.Result__c} | 
|---|
|  |  |  | 
|---|
|  |  |  | 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', '新建'); | 
|---|
|  |  |  | 
|---|
|  |  |  | this.set_selected(component, 'select_purpose_type', select_data['Purpose_Type__c']); | 
|---|
|  |  |  | this.select_purpose_type(component); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start | 
|---|
|  |  |  | // 支援需求 | 
|---|
|  |  |  | if (select_data['SupportNeeds__c'] != '') { | 
|---|
|  |  |  | this.set_selected(component, 'SupportNeeds__c', select_data['SupportNeeds__c']); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 end | 
|---|
|  |  |  | // 結果 | 
|---|
|  |  |  | if (select_data['Result__c'] != '' && typeof select_data['Result__c'] !== "undefined") { | 
|---|
|  |  |  | component.find('select_result').set('v.value', select_data['Result__c']); | 
|---|
|  |  |  | 
|---|
|  |  |  | var Department_Cateogy__c = component.find('select_department').get('v.value'); | 
|---|
|  |  |  | var doctor2__c = component.find('select_doctor').get('v.value'); | 
|---|
|  |  |  | var Purpose_Type__c = component.find('select_purpose_type').get('v.value'); | 
|---|
|  |  |  | var SupportNeeds__c = component.find('SupportNeeds__c').get('v.value'); | 
|---|
|  |  |  | var Opportunity__c = component.get('v.data.Opportunity__c'); | 
|---|
|  |  |  | var Product_Category1__c = component.find('select_Product1').get('v.value'); | 
|---|
|  |  |  | var Product_Category2__c = component.find('select_Product2').get('v.value'); | 
|---|
|  |  |  | 
|---|
|  |  |  | !Department_Cateogy__c && | 
|---|
|  |  |  | !doctor2__c && | 
|---|
|  |  |  | !Purpose_Type__c && | 
|---|
|  |  |  | !SupportNeeds__c&&//WAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 | 
|---|
|  |  |  | !Opportunity__c && | 
|---|
|  |  |  | !Product_Category1__c && | 
|---|
|  |  |  | !Product_Category2__c && | 
|---|
|  |  |  | 
|---|
|  |  |  | select_report_data['Department_Cateogy__c'] == Department_Cateogy__c && | 
|---|
|  |  |  | select_report_data['doctor2__c'] == doctor2__c && | 
|---|
|  |  |  | select_report_data['Purpose_Type__c'] == Purpose_Type__c && | 
|---|
|  |  |  | select_report_data['SupportNeeds__c'] == SupportNeeds__c &&//WAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 | 
|---|
|  |  |  | select_report_data['Opportunity__c'] == Opportunity__c && | 
|---|
|  |  |  | select_report_data['Product_Category1__c'] == Product_Category1__c && | 
|---|
|  |  |  | select_report_data['Product_Category2__c'] == Product_Category2__c && | 
|---|
|  |  |  | 
|---|
|  |  |  | select_report_data['Department_Cateogy__c'] == Department_Cateogy__c && | 
|---|
|  |  |  | select_report_data['doctor2__c'] == doctor2__c && | 
|---|
|  |  |  | select_report_data['Purpose_Type__c'] == Purpose_Type__c && | 
|---|
|  |  |  | select_report_data['SupportNeeds__c'] == SupportNeeds__c &&//WAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 | 
|---|
|  |  |  | select_report_data['Opportunity__c'] == Opportunity__c && | 
|---|
|  |  |  | select_report_data['Product_Category1__c'] == Product_Category1__c && | 
|---|
|  |  |  | select_report_data['Product_Category2__c'] == Product_Category2__c && | 
|---|
|  |  |  | 
|---|
|  |  |  | 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, | 
|---|
|  |  |  | 
|---|
|  |  |  | component.set('v.doctor_title', ''); | 
|---|
|  |  |  | component.find('select_department').set('v.options', this.conv_selected(component.get('v.allselectlist.Department_Cateogy__c'))); | 
|---|
|  |  |  | component.find('select_purpose_type').set('v.options', this.conv_selected(component.get('v.allselectlist.Purpose_Type__c'))); | 
|---|
|  |  |  | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start | 
|---|
|  |  |  | component.find('SupportNeeds__c').set('v.options', this.conv_selected(component.get('v.allselectlist.SupportNeeds__c'))); | 
|---|
|  |  |  | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 end | 
|---|
|  |  |  | // ToDo需要测试手机上能运行不 | 
|---|
|  |  |  | component.set('v.data.Opportunity__c', ''); | 
|---|
|  |  |  | component.find('select_Product1').set('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','活动区分','结果'] | 
|---|
|  |  |  | 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; | 
|---|
|  |  |  | 
|---|
|  |  |  | }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 if(skey == 'SupportNeeds__c'){//SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start | 
|---|
|  |  |  | csvStringResult += '"'+ objectRecords[i].SupportNeeds__c+'"'; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | else{ | 
|---|
|  |  |  | csvStringResult += '"'+ objectRecords[i][skey]+'"'; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | showExportDate : function(component,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 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++){ | 
|---|
|  |  |  | 
|---|
|  |  |  | }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 if(skey == 'SupportNeeds__c'){//SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start | 
|---|
|  |  |  | content += '<td>'+ objectRecords[i].SupportNeeds__c+'</td>'; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | else{ | 
|---|
|  |  |  | content += '<td>'+ objectRecords[i][skey]+'</td>'; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | this.allselectlist.put('StageName__c', WeeklyReportCmp.getPicklistValues('Agency_Opportunity__c','StageName__c')); | 
|---|
|  |  |  | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start | 
|---|
|  |  |  | // 支援需求 SupportNeeds__c | 
|---|
|  |  |  | // this.allselectlist.put('SupportNeeds__c', WeeklyReportCmp.getPicklistValues('Agency_Report__c','SupportNeeds__c')); | 
|---|
|  |  |  | this.allselectlist.put('SupportNeeds__c', WeeklyReportCmp.getPicklistValues('Agency_Report__c','SupportNeeds__c')); | 
|---|
|  |  |  | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 end | 
|---|
|  |  |  | // 职位 | 
|---|
|  |  |  | //        this.allselectlist.put('visitor_title__c', WeeklyReportCmp.getPicklistValues('Agency_Report__c','visitor_title__c')); | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @RemoteAction | 
|---|
|  |  |  | @AuraEnabled//SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start SupportNeedsc ,String SupportNeedsc | 
|---|
|  |  |  | public static String saveAgencyReport(String Department_Cateogy, String Purpose_Type, String Agency_Report_Header, | 
|---|
|  |  |  | public static String saveAgencyReport(String Department_Cateogy, String Purpose_Type,String SupportNeedsc, String Agency_Report_Header, | 
|---|
|  |  |  | String Agency_Hospital, String Person_In_Charge2, String doctor, String Submit_date, | 
|---|
|  |  |  | String Product_Category1, String Product_Category2, String Product_Category3, | 
|---|
|  |  |  | String Result, String Opportunity, String StageName, String oppAmount, String oppOCMPrice, String Close_Forecasted_Date, String Report_Date) | 
|---|
|  |  |  | 
|---|
|  |  |  | Agency_Report__c agency_report = makeAgencyReport(Department_Cateogy, Purpose_Type, Agency_Report_Header, | 
|---|
|  |  |  | Agency_Hospital, Person_In_Charge2, doctor, Submit_date, | 
|---|
|  |  |  | Product_Category1, Product_Category2, Product_Category3,//SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start SupportNeedsc   ,SupportNeedsc | 
|---|
|  |  |  | Result, Opportunity, StageName, oppAmount, oppOCMPrice, Close_Forecasted_Date, Report_Date); | 
|---|
|  |  |  | Result, Opportunity, StageName, oppAmount, oppOCMPrice, Close_Forecasted_Date, Report_Date,SupportNeedsc); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | agency_report = LightningUtil.insertAgencyReport(agency_report); | 
|---|
|  |  |  | return agency_report.Id; | 
|---|
|  |  |  | 
|---|
|  |  |  | public static Agency_Report__c makeAgencyReport(String Department_Cateogy, String Purpose_Type, String Agency_Report_Header, | 
|---|
|  |  |  | String Agency_Hospital, String Person_In_Charge2, String doctor, String Submit_date, | 
|---|
|  |  |  | String Product_Category1, String Product_Category2, String Product_Category3,//SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start SupportNeeds__c   ,String SupportNeedsc | 
|---|
|  |  |  | String Result, String Opportunity, String StageName, String oppAmount, String oppOCMPrice, String Close_Forecasted_Date, String Report_Date) | 
|---|
|  |  |  | String Result, String Opportunity, String StageName, String oppAmount, String oppOCMPrice, String Close_Forecasted_Date, String Report_Date,String SupportNeedsc) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | Agency_Report__c agency_report = new Agency_Report__c(); | 
|---|
|  |  |  | Date week = Date.valueOf(Submit_date); | 
|---|
|  |  |  | 
|---|
|  |  |  | if (Department_Cateogy != '') { agency_report.Department_Cateogy__c = Department_Cateogy; } | 
|---|
|  |  |  | if (Purpose_Type != '') { agency_report.Purpose_Type__c = Purpose_Type; } | 
|---|
|  |  |  | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start | 
|---|
|  |  |  | // if (SupportNeedsc != '') { agency_report.SupportNeeds__c = SupportNeedsc; } | 
|---|
|  |  |  | if (SupportNeedsc != '') { agency_report.SupportNeeds__c = SupportNeedsc; } | 
|---|
|  |  |  | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 end | 
|---|
|  |  |  | if (Agency_Report_Header != '') { agency_report.Agency_Report_Header__c = Agency_Report_Header; } | 
|---|
|  |  |  | if (Agency_Hospital != '') { agency_report.Agency_Hospital__c = Agency_Hospital; } | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @RemoteAction | 
|---|
|  |  |  | @AuraEnabled | 
|---|
|  |  |  | public static String editAgencyReport(String Agency_Report_Id, String Department_Cateogy, String Purpose_Type, String Agency_Report_Header, | 
|---|
|  |  |  | public static String editAgencyReport(String Agency_Report_Id, String Department_Cateogy, String Purpose_Type,String SupportNeedsc, String Agency_Report_Header, | 
|---|
|  |  |  | String Agency_Hospital, String Person_In_Charge2, String doctor, String Submit_date, | 
|---|
|  |  |  | String Product_Category1, String Product_Category2, String Product_Category3, //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start SupportNeeds__c  ,String SupportNeedsc | 
|---|
|  |  |  | String Result, String Opportunity, String StageName, String oppAmount, String oppOCMPrice, String Close_Forecasted_Date, String Report_Date) | 
|---|
|  |  |  | 
|---|
|  |  |  | if (String.isBlank(Agency_Report_Id)) { | 
|---|
|  |  |  | return null; | 
|---|
|  |  |  | }//SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start SupportNeeds__c   ,SupportNeeds__c | 
|---|
|  |  |  | Agency_Report__c agency_report = [select Id, Name, Department_Cateogy__c, Purpose_Type__c, Agency_Hospital__c, | 
|---|
|  |  |  | Agency_Report__c agency_report = [select Id, Name, Department_Cateogy__c, Purpose_Type__c,SupportNeeds__c, Agency_Hospital__c, | 
|---|
|  |  |  | Person_In_Charge2__c, doctor2__c, Submit_date__c, Product_Category__c, Result__c, visitor_title__c, Opportunity__c | 
|---|
|  |  |  | from Agency_Report__c where id=:Agency_Report_Id]; | 
|---|
|  |  |  | Date week = Date.valueOf(Submit_date); | 
|---|
|  |  |  | 
|---|
|  |  |  | if (Department_Cateogy != '') { agency_report.Department_Cateogy__c = Department_Cateogy; } else { agency_report.Department_Cateogy__c = null; } | 
|---|
|  |  |  | if (Purpose_Type != '') { agency_report.Purpose_Type__c = Purpose_Type; } else { agency_report.Purpose_Type__c = null; } | 
|---|
|  |  |  | //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start SupportNeeds__c | 
|---|
|  |  |  | //  if (SupportNeedsc != '') { agency_report.SupportNeeds__c = SupportNeedsc; } else { agency_report.SupportNeeds__c = null; } | 
|---|
|  |  |  | if (SupportNeedsc != '') { agency_report.SupportNeeds__c = SupportNeedsc; } else { agency_report.SupportNeeds__c = null; } | 
|---|
|  |  |  | if (Agency_Hospital != '') { agency_report.Agency_Hospital__c = Agency_Hospital; } else { agency_report.Agency_Hospital__c = null; } | 
|---|
|  |  |  | if (Product_Category1 != '') { agency_report.Product_Category1__c = Product_Category1; } else { agency_report.Product_Category1__c = null; } | 
|---|
|  |  |  | if (Product_Category2 != '') { agency_report.Product_Category2__c = Product_Category2; } else { agency_report.Product_Category2__c = null; } | 
|---|