|  |  | 
 |  |  |                 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)); | 
 |  |  | 
 |  |  |         component.find('save_button').set('v.disabled', true); | 
 |  |  |  | 
 |  |  |         var Report_Date__c = component.get('v.data.Report_Date__c'); | 
 |  |  |             alert('Report_Date__c'+Report_Date__c); | 
 |  |  |             // alert('Report_Date__c'+Report_Date__c); | 
 |  |  |         var Person_In_Charge2__c = ""; | 
 |  |  |         var Submit_date__c = ""; | 
 |  |  |         if (component.get('v.mode') == 'edit') { | 
 |  |  |             // 周 Submit_date__c | 
 |  |  |             Submit_date__c = component.get('v.select_report_data').Submit_date__c; | 
 |  |  |             alert('Submit_date__c'+Submit_date__c); | 
 |  |  |             // alert('Submit_date__c'+Submit_date__c); | 
 |  |  |  | 
 |  |  |  | 
 |  |  |             // 担当 Person_In_Charge2__c | 
 |  |  | 
 |  |  |         } else { | 
 |  |  |             // 周 Submit_date__c | 
 |  |  |             Submit_date__c = this.get_date_string(component.find('select_date').get('v.value')); | 
 |  |  |             alert('Submit_date__c'+Submit_date__c); | 
 |  |  |             // alert('Submit_date__c'+Submit_date__c); | 
 |  |  |  | 
 |  |  |             // 担当 Person_In_Charge2__c | 
 |  |  |             Person_In_Charge2__c = component.find('select_agency_person').get('v.value'); | 
 |  |  | 
 |  |  |         if (!Department_Cateogy__c) { error.push("科室 不存在"); } | 
 |  |  |         if (!doctor2__c) { error.push("拜访人 不存在"); } | 
 |  |  |         if (!Purpose_Type__c) { error.push("活动区分 不存在"); } | 
 |  |  |         if (!SupportNeeds__c) { error.push("支援需求 不存在"); } | 
 |  |  |         // if (!SupportNeeds__c) { error.push("支援需求 不存在"); } | 
 |  |  |         if (!Opportunity__c) { Opportunity__c = ""; } | 
 |  |  |         if (!Product_Category1__c) { error.push("产品区分1 不存在"); } | 
 |  |  |         if (Purpose_Type__c && (Purpose_Type__c.substr(-3) == 'SIS' || Purpose_Type__c.substr(-3) == 'OPD')) { | 
 |  |  | 
 |  |  |         if (component.get('v.mode') == 'edit') { | 
 |  |  |             var Agency_Report__c = component.get('v.select_report_data').Id; | 
 |  |  |             var action = component.get('c.editAgencyReport'); | 
 |  |  |             alert("Purpose_Type:"+Purpose_Type__c+","+"SupportNeedsc:"+SupportNeeds__c); | 
 |  |  |             debugger | 
 |  |  |             // alert("Purpose_Type:"+Purpose_Type__c+","+"SupportNeedsc:"+SupportNeeds__c); | 
 |  |  |             action.setParams({ | 
 |  |  |                 "Agency_Report_Id" : Agency_Report__c, | 
 |  |  |                 "Department_Cateogy" : Department_Cateogy__c, | 
 |  |  | 
 |  |  |             /* Save (New & Copy) */ | 
 |  |  |              | 
 |  |  |             var action = component.get('c.saveAgencyReport'); | 
 |  |  |             debugger; | 
 |  |  |             // alert(SupportNeeds__c); | 
 |  |  |             action.setParams({ | 
 |  |  |                 "Department_Cateogy" : Department_Cateogy__c, | 
 |  |  |                 "Purpose_Type" : Purpose_Type__c, | 
 |  |  | 
 |  |  |     searchHos : function(component, event, helper) { | 
 |  |  |         var hospital_name = event.getParam("value"); | 
 |  |  |         var action = component.get("c.getHospitalList"); | 
 |  |  |         debugger; | 
 |  |  |         action.setParams({"hospital_name": hospital_name}); | 
 |  |  |  | 
 |  |  |         action.setCallback(this, function(response) { | 
 |  |  | 
 |  |  |     }, | 
 |  |  |  | 
 |  |  |     selectHos : function(component, event, helper) { | 
 |  |  |         debugger | 
 |  |  |         var hospital_list = component.find('hospital_list'); | 
 |  |  |         $A.util.removeClass(hospital_list, 'slds-is-open'); | 
 |  |  |         var accname = event.currentTarget.dataset.accname; |