From f5a94e721ae5a26f817f0df75065b64f1f192eb3 Mon Sep 17 00:00:00 2001
From: Li Jun <buli@deloitte.com.cn>
Date: 星期一, 28 三月 2022 21:43:51 +0800
Subject: [PATCH] PIPLFunctionDeploy0328

---
 force-app/main/default/aura/WeeklyReport/WeeklyReportController.js |   34 ++++++++++++++++++++++++++++++++--
 1 files changed, 32 insertions(+), 2 deletions(-)

diff --git a/force-app/main/default/aura/WeeklyReport/WeeklyReportController.js b/force-app/main/default/aura/WeeklyReport/WeeklyReportController.js
index 7117d9a..29c6056 100644
--- a/force-app/main/default/aura/WeeklyReport/WeeklyReportController.js
+++ b/force-app/main/default/aura/WeeklyReport/WeeklyReportController.js
@@ -63,7 +63,11 @@
         var vaildationFailReason = '';
         // var vaildationFailReason2 = '';
         // var currentDate = new Date().toJSON().slice(0,10);
- 
+        
+        // PIPL update Yin Mingjie 21/02/2022 start
+        let agencyReport = Object.create(null);
+        // PIPL update Yin Mingjie 21/02/2022 end
+
         fields.forEach(function (field) {
             if(field.get("v.fieldName") === 'Type__c' && $A.util.isEmpty(field.get("v.value"))){
                 showValidationError = true;
@@ -77,19 +81,45 @@
                 }
                 
             }
+            // PIPL update Yin Mingjie 21/02/2022 start
+            if(field.get("v.fieldName") === 'Name'){
+                agencyReport['name'] = field.get("v.value");
+            }else if(field.get("v.fieldName") === 'Type__c'){
+                agencyReport['type'] = field.get("v.value");
+            }else if(field.get("v.fieldName") === 'Doctor_Division1__c'){
+                agencyReport['doctorDivision1'] = field.get("v.value");
+            }
+            // PIPL update Yin Mingjie 21/02/2022 end
         });
          
         if (!showValidationError) {
+            // PIPL update Yin Mingjie 21/02/2022 start
+            /*
             var eventFields = event.getParam("fields");
             eventFields["Agency_Hospital__c"] = component.get('v.hospitalLinkId');
             component.find('recordEditForm').submit(eventFields);
+            */
+
+            var agencyHospitalid = component.get('v.hospitalLinkId');
+            var arr = new Array();
+            arr.push(agencyReport);
+            var data = JSON.stringify(arr);
+            // helper.set_aws_url(component,data,agencyHospitalid);
+
+            var token = component.get('v.AWStoken');
+            var newUrl = component.get('v.AWSinsert');
+            
+            component.set('v.login',true);
+            helper.insert_agencycontact(component,token,newUrl,data,agencyHospitalid,helper);
+
+            // PIPL update Yin Mingjie 21/02/2022 end
         }else{
             component.find('OppMessage').setError(vaildationFailReason);
         }
         // var eventFields = event.getParam("fields");
         // eventFields["Agency_Hospital__c"] = component.get('v.hospitalLinkId');
         // component.find('recordEditForm').submit(eventFields);
-         // vivek 娣诲姞楠岃瘉 end
+        // vivek 娣诲姞楠岃瘉 end
     },
     
     createCancel : function(component, event, helper) {

--
Gitblit v1.9.1