From d533f39b6fa798e238810d17e928dee75d5b1af7 Mon Sep 17 00:00:00 2001
From: yumenghui <953181891@qq.com>
Date: 星期五, 11 八月 2023 16:02:17 +0800
Subject: [PATCH] 备注添加改造

---
 force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReportController.js |  315 +++++++++++++++++++++++++++-------------------------
 1 files changed, 162 insertions(+), 153 deletions(-)

diff --git a/force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReportController.js b/force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReportController.js
index 1764619..baa5976 100644
--- a/force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReportController.js
+++ b/force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReportController.js
@@ -1,9 +1,9 @@
 ({
-    doInit : function(component, event, helper) {
-            helper.doinit(component, event, helper);
+    doInit: function (component, event, helper) {
+        helper.doinit(component, event, helper);
     },
 
-    createAopp : function(component, event, helper) {
+    createAopp: function (component, event, helper) {
         var addRecordEvent = $A.get('e.force:createRecord');
         addRecordEvent.setParams({
             entityApiName: 'Agency_Opportunity__c',
@@ -11,66 +11,66 @@
         });
         addRecordEvent.fire();
     },
-    
-    new_report : function(component, event, helper) {
+
+    new_report: function (component, event, helper) {
         component.find('save_button').set('v.label', '淇濆瓨骞舵柊寤�');
         helper.new_report(component, event, helper);
     },
-    
-    copy_button : function(component, event, helper) {
+
+    copy_button: function (component, event, helper) {
         component.find('save_button').set('v.label', '淇濆瓨骞舵柊寤�');
         helper.copy_button(component, event, helper);
     },
-    delete_button : function(component, event, helper) {
+    delete_button: function (component, event, helper) {
         helper.delete_button(component, event, helper);
     },
-    change_report_radio : function(component, event, helper) {
+    change_report_radio: function (component, event, helper) {
         helper.change_report_radio(component, event, helper);
     },
-    
-    edit_button : function(component, event, helper) {
+
+    edit_button: function (component, event, helper) {
         component.find('save_button').set('v.label', '淇濆瓨');
         helper.edit_button(component, event, helper);
     },
-    
-    createCon : function(component, event, helper) {
-		helper.createCon(component, event, helper);
+
+    createCon: function (component, event, helper) {
+        helper.createCon(component, event, helper);
     },
 
-    showRequiredFields: function(component, event, helper){
+    showRequiredFields: function (component, event, helper) {
         $A.util.removeClass(component.find("newOpportunityField"), "none");
         $A.util.removeClass(component.find("newOpportunityField"), "none");
     },
-    
-    handleSuccess : function(component, event, helper) {
+
+    handleSuccess: function (component, event, helper) {
         helper.handleSuccess(component, event, helper);
     },
-    
-    handleSubmit : function(component, event, helper) {
+
+    handleSubmit: function (component, event, helper) {
         event.preventDefault(); // stop form submission
         var showValidationError = false;
         var fields = component.find("newOpportunityField");
         var vaildationFailReason = '';
         let agencyReport = Object.create(null);
         fields.forEach(function (field) {
-            if(field.get("v.fieldName") === 'Type__c' && $A.util.isEmpty(field.get("v.value"))){
+            if (field.get("v.fieldName") === 'Type__c' && $A.util.isEmpty(field.get("v.value"))) {
                 showValidationError = true;
                 vaildationFailReason = "鍒嗙被涓嶈兘涓虹┖锛�";
-            }else if(field.get("v.fieldName") === 'Doctor_Division1__c' && $A.util.isEmpty(field.get("v.value"))){
+            } else if (field.get("v.fieldName") === 'Doctor_Division1__c' && $A.util.isEmpty(field.get("v.value"))) {
                 showValidationError = true;
-                if(vaildationFailReason != ''){
+                if (vaildationFailReason != '') {
                     vaildationFailReason += "鍖荤敓鍖哄垎(鑱屽姟)涓嶈兘涓虹┖锛�";
-                }else{
+                } else {
                     vaildationFailReason = "鍖荤敓鍖哄垎(鑱屽姟)涓嶈兘涓虹┖锛�";
                 }
-                
+
             }
             //SWAG-CF58C3 fy start 
-            if(field.get("v.fieldName") === 'Name'){
+            if (field.get("v.fieldName") === 'Name') {
                 agencyReport['name'] = field.get("v.value");
-            }else if(field.get("v.fieldName") === 'Type__c'){
+            } else if (field.get("v.fieldName") === 'Type__c') {
                 agencyReport['type'] = field.get("v.value");
-            }else if(field.get("v.fieldName") === 'Doctor_Division1__c'){
+            } else if (field.get("v.fieldName") === 'Doctor_Division1__c') {
                 agencyReport['doctorDivision1'] = field.get("v.value");
             }
             //SWAG-CF58C3 fy end 
@@ -82,22 +82,22 @@
             debugger
             let hospitalName = '';
             //璋冪敤鍚庣searchAgencyDataId鏂规硶鏌ヨ鍑哄尰闄笅闈㈡墍鏈夊鎴蜂汉鍛榙ataid
-            helper.CallBackAction(component,'searchAgencyDataId',{
-                hospitalId : agencyHospitalid
-            },function(data){
-                if(data.getState() == "SUCCESS"){
+            helper.CallBackAction(component, 'searchAgencyDataId', {
+                hospitalId: agencyHospitalid
+            }, function (data) {
+                if (data.getState() == "SUCCESS") {
                     var data = data.getReturnValue();
-                    if(data.IsSuccess == true){
+                    if (data.IsSuccess == true) {
                         let agencyContactIds = ''
-                        if(data.Message == '' && data.Data && data.Data.length > 0){
+                        if (data.Message == '' && data.Data && data.Data.length > 0) {
                             hospitalName = data.Data[0].Agency_Hospital__r.Name;
-                            for(var i=0;i<data.Data.length;i++){
-                                if(data.Data[i].AWS_Data_Id__c)
-                                    agencyContactIds += ','+data.Data[i].AWS_Data_Id__c;
+                            for (var i = 0; i < data.Data.length; i++) {
+                                if (data.Data[i].AWS_Data_Id__c)
+                                    agencyContactIds += ',' + data.Data[i].AWS_Data_Id__c;
                             }
                             agencyContactIds = agencyContactIds.substring(1);
                             agencyReport['agencyContactIds'] = agencyContactIds;
-                        }else{
+                        } else {
                             agencyReport['agencyContactIds'] = agencyContactIds;
                         }
                         var arr = new Array();
@@ -107,19 +107,19 @@
 
                         var token = component.get('v.AWStoken');
                         var newUrl = component.get('v.AWSinsert') + 'V2';
-                        
-                        component.set('v.login',true);
-                        helper.insert_agencycontact(component,token,newUrl,requestData,agencyHospitalid,helper,hospitalName);
-                    }else{
+
+                        component.set('v.login', true);
+                        helper.insert_agencycontact(component, token, newUrl, requestData, agencyHospitalid, helper, hospitalName);
+                    } else {
                         helper.ShowToast({
-                            "message" : data.message,
-                            "type" : "error"
+                            "message": data.message,
+                            "type": "error"
                         });
                     }
-                }else{
+                } else {
                     helper.ShowToast({
-                        "message" : 'searchAgency澶辫触',
-                        "type" : "error"
+                        "message": 'searchAgency澶辫触',
+                        "type": "error"
                     });
                 }
             })
@@ -133,211 +133,220 @@
             // helper.insert_agencycontact(component,token,newUrl,data,agencyHospitalid,helper);
             //SWAG-CF58C3 fy end 
             // helper.newlyBuild(component, event, helper);
-        }else{
+        } else {
             component.find('OppMessage').setError(vaildationFailReason);
         }
     },
-    
-    createCancel : function(component, event, helper) {
+
+    createCancel: function (component, event, helper) {
         helper.createCancel(component, event, helper);
     },
-    
-    yes_button : function(component, event, helper) {
+
+    yes_button: function (component, event, helper) {
         component.set('v.confirm_status', 1);
         helper.close_confirm(component, component.get('v.modal_confirm_title'), component.get('v.modal_confirm_text'));
     },
 
-    no_button : function(component, event, helper) {
+    no_button: function (component, event, helper) {
         component.set('v.confirm_status', 2);
         helper.close_confirm(component, component.get('v.modal_confirm_title'), component.get('v.modal_confirm_text'));
     },
-    
-    toggle_report : function(component, event, helper) {
+
+    toggle_report: function (component, event, helper) {
         helper.toggle_report(component, event, helper);
     },
 
-    save_report : function(component, event, helper) {
+    save_report: function (component, event, helper) {
         helper.save_report(component, event, helper);
     },
-    
-    select_date_change : function(component, event, helper) {
+
+    select_date_change: function (component, event, helper) {
         helper.select_date_change(component, event, helper);
     },
-    
-    select_agency_change : function(component, event, helper) {
+
+    select_agency_change: function (component, event, helper) {
         debugger
         helper.select_agency_change(component, event, helper);
     },
-    
-    hosChange : function(component, event, helper) {
-		var hospital_name = event.getParam("value");
+
+    hosChange: function (component, event, helper) {
+        var hospital_name = event.getParam("value");
         var hospital_nameld = component.get("v.UseProduct1s");
-		if (hospital_name.match(/(\S+\s)+/)) {
-            if(hospital_nameld!=hospital_name){
+        if (hospital_name.match(/(\S+\s)+/)) {
+            if (hospital_nameld != hospital_name) {
                 helper.searchHos(component, event, helper);
             }
-		} else {
-            if(hospital_name==''){
+        } else {
+            if (hospital_name == '') {
                 helper.hideSearchs(component, event, helper);
-            }else{
+            } else {
                 helper.hideSearch(component, event, helper);
             }
-		}
+        }
     },
-    selectHos : function(component, event, helper) {
-		helper.selectHos(component, event, helper);
+    selectHos: function (component, event, helper) {
+        helper.selectHos(component, event, helper);
         helper.setOpportunity_cfilter(component);
     },
     //浣跨敤浜у搧1
-    UseProduct1Change : function(component, event, helper) {
-		var UseProduct1Name = event.getParam("value");
+    UseProduct1Change: function (component, event, helper) {
+        var UseProduct1Name = event.getParam("value");
         var UseProduct1Nameold = component.get("v.UseProduct1s");
         debugger
-		if (UseProduct1Name.match(/(\S+\s)+/)) {
-            if(UseProduct1Name!=UseProduct1Nameold){
+        if (UseProduct1Name.match(/(\S+\s)+/)) {
+            if (UseProduct1Name != UseProduct1Nameold) {
                 helper.searchUseProduct1(component, event, helper);
             }
-		} else {
-            if(UseProduct1Name==''){
+        } else {
+            if (UseProduct1Name == '') {
                 helper.hideSearchUseProduct1s(component, event, helper);
-            }else{
+            } else {
                 helper.hideSearchUseProduct1(component, event, helper);
             }
-		}
+        }
     },
-    seletUseProduct1Change : function(component, event, helper) {
-		helper.seletUseProduct1Change(component, event, helper);
+    seletUseProduct1Change: function (component, event, helper) {
+        helper.seletUseProduct1Change(component, event, helper);
     },
-     //浣跨敤浜у搧2
-    UseProduct2Change : function(component, event, helper) {
-		var UseProduct2Name = event.getParam("value");
+    //浣跨敤浜у搧2
+    UseProduct2Change: function (component, event, helper) {
+        var UseProduct2Name = event.getParam("value");
         var UseProduct2Nameold = component.get("v.UseProduct2s");
-		if (UseProduct2Name.match(/(\S+\s)+/)) {
-            if(UseProduct2Name!=UseProduct2Nameold){
-			    helper.searchUseProduct2(component, event, helper);
+        if (UseProduct2Name.match(/(\S+\s)+/)) {
+            if (UseProduct2Name != UseProduct2Nameold) {
+                helper.searchUseProduct2(component, event, helper);
             }
-		} else {
-            if(UseProduct2Name==''){
+        } else {
+            if (UseProduct2Name == '') {
                 helper.hideSearchUseProduct2s(component, event, helper);
-            }else{
+            } else {
                 helper.hideSearchUseProduct2(component, event, helper);
             }
-		}
+        }
     },
-    seletUseProduct2Change : function(component, event, helper) {
-		helper.seletUseProduct2Change(component, event, helper);
+    seletUseProduct2Change: function (component, event, helper) {
+        helper.seletUseProduct2Change(component, event, helper);
     },
-    productcategoryChange2 : function(component, event, helper) {
-		helper.productcategoryChange2(component, event, helper);
+    productcategoryChange2: function (component, event, helper) {
+        helper.productcategoryChange2(component, event, helper);
     },
     //浣跨敤浜у搧3
-    UseProduct3Change : function(component, event, helper) {
-		var UseProduct3Name = event.getParam("value");
+    UseProduct3Change: function (component, event, helper) {
+        var UseProduct3Name = event.getParam("value");
         var UseProduct3Nameold = component.get("v.UseProduct3s");
-		if (UseProduct3Name.match(/(\S+\s)+/)) {
-            if(UseProduct3Name!=UseProduct3Nameold){
-			    helper.searchUseProduct3(component, event, helper);
+        if (UseProduct3Name.match(/(\S+\s)+/)) {
+            if (UseProduct3Name != UseProduct3Nameold) {
+                helper.searchUseProduct3(component, event, helper);
             }
-		} else {
-            if(UseProduct3Name==''){
+        } else {
+            if (UseProduct3Name == '') {
                 helper.hideSearchUseProduct3s(component, event, helper);
-            }else{
+            } else {
                 helper.hideSearchUseProduct3(component, event, helper);
             }
-		}
+        }
     },
-    seletUseProduct3Change : function(component, event, helper) {
-		helper.seletUseProduct3Change(component, event, helper);
+    seletUseProduct3Change: function (component, event, helper) {
+        helper.seletUseProduct3Change(component, event, helper);
     },
-    
-    
-    select_department : function(component, event, helper) {
+
+
+    select_department: function (component, event, helper) {
         helper.setOpportunity_cfilter(component);
     },
-    doctor_change : function(component, event, helper) {
+    doctor_change: function (component, event, helper) {
         helper.doctor_change(component, event, helper);
     },
-    stageNameChange : function(component, event, helper) {
+    stageNameChange: function (component, event, helper) {
         helper.stageNameChange(component, event, helper);
     },
-    onDragOver : function(component, event, helper) {
+    onDragOver: function (component, event, helper) {
         event.preventDefault();
     },
-    
-    onDrop : function(component, event, helper) {
+
+    onDrop: function (component, event, helper) {
         event.stopPropagation();
         event.preventDefault();
-        event.dataTransfer.dropEffect='copy';
-        var files=event.dataTransfer.files;
-        helper.readFile(component,helper,files[0]);
+        event.dataTransfer.dropEffect = 'copy';
+        var files = event.dataTransfer.files;
+        helper.readFile(component, helper, files[0]);
     },
-    CreateRecord : function(component, event, helper){
+    CreateRecord: function (component, event, helper) {
         var files = event.getSource().get("v.files");
-        helper.readFile(component,helper,files[0]);
+        helper.readFile(component, helper, files[0]);
+        component.set("v.showErrorInfo", false);
     },
 
-    processFileContent : function(component,event,helper){
-        helper.saveRecords(component,event,helper);
-    },
-    
-    cancel : function(component,event,helper){
-        component.set("v.showMain",true);
+    processFileContent: function (component, event, helper) {
+        helper.saveRecords(component, event, helper);
+        component.set("v.showErrorInfo", false);
     },
 
-    import : function(component,event,helper){
+    cancel: function (component, event, helper) {
+        component.set("v.showMain", true);
+    },
+
+    import: function (component, event, helper) {
         helper.showImport(component);
     },
-    exportDate : function(component,event,helper){
+    exportDate: function (component, event, helper) {
         var stockData = component.get("v.reports_date");
-        console.log('瀵煎嚭鏁版嵁'+stockData); 
-        var csv = helper.convertArrayOfObjectsToCSV(component,stockData);
-        if (csv == null){return;} 
+        console.log('瀵煎嚭鏁版嵁' + stockData);
+        var csv = helper.convertArrayOfObjectsToCSV(component, stockData);
+        if (csv == null) { return; }
 
         var universalBOM = "\uFEFF";
         var hiddenElement = document.createElement('a');
-        hiddenElement.href = 'data:text/csv;charset=utf-8,' + encodeURI(universalBOM+csv);
+        hiddenElement.href = 'data:text/csv;charset=utf-8,' + encodeURI(universalBOM + csv);
         hiddenElement.target = '_self'; // 
         hiddenElement.download = 'ExportData.csv';  // CSV file Name* you can change it.[only name not .csv] 
         document.body.appendChild(hiddenElement); // Required for FireFox browser
         hiddenElement.click(); // using click() js function to download csv file
-        
+
     },
-    export_condition : function(component,event,helper){
+    export_condition: function (component, event, helper) {
         helper.showExport(component);
     },
 
-    select_repores_date : function(component,event,helper){
-        helper.select_repores_date(component,event,helper);
+    select_repores_date: function (component, event, helper) {
+        helper.select_repores_date(component, event, helper);
     },
-    export : function(component,event,helper){
+    export: function (component, event, helper) {
         console.log('杩涘叆export');
         var stockData = component.get("v.reports_date");
-        console.log('鏌ュ嚭鐨勬暟鎹�'+stockData);
+        console.log('鏌ュ嚭鐨勬暟鎹�' + stockData);
     },
-    close_import : function(component,event,helper){
-        component.set("v.showMain",true);
+    close_import: function (component, event, helper) {
+        component.set("v.showMain", true);
         helper.close_import(component);
     },
-    close_export : function(component,event,helper){
-        component.set("v.showMain",true);
+    close_export: function (component, event, helper) {
+        component.set("v.showMain", true);
         helper.close_export(component);
     },
-    select_ConsumptionOfConsumables : function(component,event,helper){
-        helper.select_ConsumptionOfConsumables(component,event,helper);
+    select_ConsumptionOfConsumables: function (component, event, helper) {
+        helper.select_ConsumptionOfConsumables(component, event, helper);
     },
-    select_purpose_type : function(component,event,helper){
-        helper.selectPurposeType(component,event,helper);
+    select_purpose_type: function (component, event, helper) {
+        helper.selectPurposeType(component, event, helper);
     },
-    select_warlocksNumber : function(component,event,helper){
-        helper.select_warlocksNumber(component,event,helper);
-    }, 
-    selectProductClassification : function(component,event,helper){
-        helper.selectProductClassification(component,event,helper);
+    select_warlocksNumber: function (component, event, helper) {
+        helper.select_warlocksNumber(component, event, helper);
     },
-    selectpurposetype : function(component,event,helper){
-        helper.selectpurposetype(component,event,helper);
+    selectProductClassification: function (component, event, helper) {
+        helper.selectProductClassification(component, event, helper);
     },
-    return_main_page: function(component,event,helper){
-        window.open('/customer/','_self');
+    selectpurposetype: function (component, event, helper) {
+        helper.selectpurposetype(component, event, helper);
+    },
+    return_main_page: function (component, event, helper) {
+        window.open('/customer/', '_self');
+    },
+    exportErrorInfo: function (component, event, helper) {
+        helper.exportErrorInfoHelper(component);
+    },
+    closeErrorDiv: function (component, event, helper) {
+        var errorDiv01 = component.find('errorDiv01');
+        $A.util.addClass(errorDiv01, 'slds-hide');
     }
 })
\ No newline at end of file

--
Gitblit v1.9.1