高章伟
2022-03-10 1312ba82d4c880bdb5357d28e0d4af5b285f610f
force-app/main/default/aura/WeeklyReport/WeeklyReportHelper.js
@@ -17,6 +17,9 @@
                component.find('select_purpose_type').set('v.options', this.conv_selected(res.allselectlist.Purpose_Type__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));
                //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 end
                component.set('v.selected_agency_person', res.allselectlist.AgencyPerson__c[0].label);
                component.set('v.dialog_type', '新建');
                
@@ -46,6 +49,7 @@
            }
        }
        if (dc != '' || purpose_type != '') {
            var action = component.get('c.getProductList');
            action.setParams({
                "dc" : dc,
@@ -53,8 +57,8 @@
            });
            action.setCallback(this,function(response){
                var state = response.getState();
                alert(state);
                if(state == 'SUCCESS'){
                    var res = response.getReturnValue();
                    component.find('select_Product1').set("v.options", JSON.parse(JSON.stringify(res)));
                    component.find('select_Product2').set("v.options", JSON.parse(JSON.stringify(res)));
@@ -201,7 +205,6 @@
                if (select_data['Department_Cateogy__c'] != '') {
                    this.set_selected(component, 'select_department', select_data['Department_Cateogy__c']);
                }
                // 拜访人
                component.set('v.default_select_doctor_id', select_data['doctor2__c']);
            this.set_doctor_list(component);
@@ -524,6 +527,10 @@
        
        // 活动区分 Purpose_Type__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');
        //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 end
        // 询价 Opportunity__c
        var Opportunity__c = component.get('v.data.Opportunity__c');
@@ -572,6 +579,7 @@
        if (!Department_Cateogy__c) { error.push("科室 不存在"); }
        if (!doctor2__c) { error.push("拜访人 不存在"); }
        if (!Purpose_Type__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')) {
@@ -591,10 +599,14 @@
      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);
            action.setParams({
                "Agency_Report_Id" : Agency_Report__c,
                "Department_Cateogy" : Department_Cateogy__c,
                "Purpose_Type" : Purpose_Type__c,
                //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start
                "SupportNeedsc" : SupportNeeds__c,
                //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 end
                "Agency_Report_Header" : Agency_Report_Header__c,
                "Agency_Hospital" : Agency_Hospital__c,
                "Person_In_Charge2" : Person_In_Charge2__c,
@@ -658,6 +670,9 @@
            action.setParams({
                "Department_Cateogy" : Department_Cateogy__c,
                "Purpose_Type" : Purpose_Type__c,
                //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 start
                "SupportNeedsc" : SupportNeeds__c,
                //SWAG-CBX68C fy 【委托】DAMS系统周报模块内容需求增加 end
                "Agency_Report_Header" : Agency_Report_Header__c,
                "Agency_Hospital" : Agency_Hospital__c,
                "Person_In_Charge2" : Person_In_Charge2__c,
@@ -979,7 +994,6 @@
            var result = component.find('result');
           $A.util.addClass(result, 'disp_none');
        }
        this.select_department(component, null, null);
    },
    
@@ -1538,7 +1552,6 @@
    },
    showExportDate : function(component,objectRecords){
        console.log('进入showexceportdate'+objectRecords);
        alert(777);
        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\">";