binxie
2023-06-26 614b1b648eceb33e325ed7cf8d8cb6a7a71b9ddc
force-app/main/default/aura/WeeklyReport/WeeklyReportHelper.js
@@ -439,6 +439,7 @@
                    }
                    if (reportDate != null) {
                        console.log('reportDate = ' + reportDate);
                        component.set('v.data.Report_Date__c', reportDate);
                    }
                    
@@ -963,6 +964,7 @@
        component.find('select_Product1').set('v.value','');
        component.find('select_Product2').set('v.value','');
        component.find('select_Product3').set('v.value','');
        console.log('reportDate = 空');
        component.set('v.data.Report_Date__c', '');
        component.set('v.oppdata.Close_Forecasted_Date__c', '');
        component.set('v.oppdata.Amount__c', '');
@@ -2059,6 +2061,7 @@
                        let errorDatas = [];
                        let errorDataRow = [];
                        debugger
                        var fileContentData = component.get("v.fileContentData").split('\n');
                        for (var i=0; i<ress.length; i++) {
                            res1 += ress[i].substr(7)+'\n';
                            if (ress[i] != '') {
@@ -2071,13 +2074,20 @@
                                    errorData.errorRow = ress[i].substr(7).substring(1, 2);
                                    errorDataRow.push(errorData.errorRow);
                                    errorData.errorInfo = ress[i].substr(7).substring(5).replace('=','');
                                    if(errorData.errorInfo == '拜访人不存在'){
                                        console.log('errorData.errorRow = ' + errorData.errorRow)
                                        errorData.errorInfo ='拜访人 ' + fileContentData[errorData.errorRow].split(',')[4] + '不存在';
                                    }
                                    errorDatas.push(errorData);
                                } else {
                                    errorDatas[index].errorInfo += '; ' + ress[i].substr(7).substring(5);
                                    if(ress[i].substr(7).substring(5) == '拜访人不存在'){
                                        errorDatas[index].errorInfo += '; ' + '拜访人 ' + fileContentData[errorDatas[index].errorRow].split(',')[4] + '不存在';
                                    }else{
                                        errorDatas[index].errorInfo += '; ' + ress[i].substr(7).substring(5);
                                    }
                                }
                            }
                        }
                        var fileContentData = component.get("v.fileContentData").split('\n');
                        let errorColumns = [
                            { label: '错误行', fieldName: 'errorRow', type: 'text', hideDefaultActions: true, initialWidth: 100 },
                            { label: '错误信息', fieldName: 'errorInfo', type: 'text', hideDefaultActions: true, initialWidth: 300, wrapText: true }
@@ -2177,6 +2187,7 @@
            let errorDatas = [];
            let errorDataRow = [];
            debugger
            var fileContentData = component.get("v.fileContentData").split('\n');
            console.log('errorArray = ' + JSON.stringify(errorArray))
            for (var i in errorArray) {
                if (errorArray[i] != '') {
@@ -2189,9 +2200,16 @@
                        errorData.errorRow = errorArray[i].trim().substring(1, 2);
                        errorDataRow.push(errorData.errorRow);
                        errorData.errorInfo = errorArray[i].trim().substring(5,errorArray[i].trim().length).replace('=','');
                        if(errorData.errorInfo == '拜访人AWS不存在'){
                            errorData.errorInfo ='拜访人 ' + fileContentData[errorData.errorRow].split(',')[4] + '不存在';
                        }
                        errorDatas.push(errorData);
                    } else {
                        errorDatas[index].errorInfo += '; ' + errorArray[i].trim().substring(5,errorArray[i].trim().length);
                        if(errorArray[i].trim().substring(5) == '拜访人AWS不存在'){
                            errorData[index].errorInfo = '; ' + '拜访人 ' + fileContentData[errorDatas[index].errorRow].split(',')[4] + '不存在';
                        }else{
                            errorDatas[index].errorInfo += '; ' + errorArray[i].trim().substring(5,errorArray[i].trim().length);
                        }
                    }
                }
            }