From a1a28f05f9560cd6a265caef72e0ca07977510ac Mon Sep 17 00:00:00 2001
From: 付煜 <fuyu3103346691@163.com>
Date: 星期一, 28 三月 2022 15:56:23 +0800
Subject: [PATCH] 系统周报

---
 force-app/main/default/aura/WeeklyReport/WeeklyReportHelper.js |   23 +++++++++++++++++------
 1 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/force-app/main/default/aura/WeeklyReport/WeeklyReportHelper.js b/force-app/main/default/aura/WeeklyReport/WeeklyReportHelper.js
index 93c578b..f49b1b0 100644
--- a/force-app/main/default/aura/WeeklyReport/WeeklyReportHelper.js
+++ b/force-app/main/default/aura/WeeklyReport/WeeklyReportHelper.js
@@ -1381,6 +1381,11 @@
             if (key == 'sre') {continue;}
             dataArr.push(key);
         }
+        if(dataArr.length == 0){
+            component.set('v.login',false);
+            this.warning('娌℃湁鎵惧埌绗﹀悎鏉′欢鐨勫鎴蜂汉鍛�');
+            return;
+        }
         let obj= Object.create(null);
         obj['dataIds'] = dataArr;
         var data = JSON.stringify(obj);
@@ -1861,8 +1866,10 @@
     saveRecords : function(component,event){
         component.set('v.login',true);
         var action = component.get("c.processData");
+        debugger;
         var selectDate = component.find('select_date').get('v.value');
         var fieldsList=['Name','Phone','AccountNumber']; //Please write your code dynamic fields
+        var sss=component.get("v.fileContentData");
         action.setParams({ 
             fileData : component.get("v.fileContentData"),
             //selectDateselectDate :component.find('select_date').get('v.value'),
@@ -1924,8 +1931,9 @@
          }
         columnDivider = ',';
         lineDivider =  '\n';
-        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','娲诲姩鍖哄垎','缁撴灉']
+        //SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start
+        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;
@@ -1953,6 +1961,8 @@
                     csvStringResult += '"'+ objectRecords[i].Product_Category2__r.Name+'"';
                 }else if(skey == 'Product_Category3__c'){
                     csvStringResult += '"'+ objectRecords[i].Product_Category3__r.Name+'"';
+                }else if(skey == 'SupportNeeds__c'){//SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start
+                    csvStringResult += '"'+ objectRecords[i].SupportNeeds__c+'"';
                 }else{
                     csvStringResult += '"'+ objectRecords[i][skey]+'"';
                 }
@@ -1967,9 +1977,9 @@
         return csvStringResult;        
     },
     showExportDate : function(component,objectRecords){
-        console.log('杩涘叆showexceportdate'+objectRecords);
-        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','娲诲姩鍖哄垎','缁撴灉']
+        console.log('杩涘叆showexceportdate'+objectRecords);//SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start
+        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++){
@@ -2000,6 +2010,8 @@
                     content += '<td>'+ objectRecords[i].Product_Category2__r.Name+'</td>';
                 }else if(skey == 'Product_Category3__c'){
                     content += '<td>'+ objectRecords[i].Product_Category3__r.Name+'</td>';
+                }else if(skey == 'SupportNeeds__c'){//SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start
+                    content += '<td>'+ objectRecords[i].SupportNeeds__c+'</td>';
                 }else{
                     content += '<td>'+ objectRecords[i][skey]+'</td>';
                 }
@@ -2107,5 +2119,4 @@
     //     var data = this.search(searchUrl,data,token);
     //     return data;searchUrl,requestSearchPayload,token
     // },
-    
 })
\ No newline at end of file

--
Gitblit v1.9.1