From cc7487a59bd4b0fa5bed1dd59f6d0565ace81b8b Mon Sep 17 00:00:00 2001
From: 李金换 <lijinhuan@prec-tech.com>
Date: 星期五, 21 四月 2023 09:48:22 +0800
Subject: [PATCH] opd计划Cl3
---
force-app/main/default/aura/WeeklyReport/WeeklyReportController.js | 83 ++++++++++++++++++++++++++++++++++++++++-
1 files changed, 80 insertions(+), 3 deletions(-)
diff --git a/force-app/main/default/aura/WeeklyReport/WeeklyReportController.js b/force-app/main/default/aura/WeeklyReport/WeeklyReportController.js
index 7117d9a..1b97f08 100644
--- a/force-app/main/default/aura/WeeklyReport/WeeklyReportController.js
+++ b/force-app/main/default/aura/WeeklyReport/WeeklyReportController.js
@@ -1,5 +1,6 @@
({
doInit : function(component, event, helper) {
+ console.log('zhj 鏂版柟妗�');
if (window.location.href.endsWith("weekly-report")) {
helper.doinit(component, event, helper);
} else {
@@ -63,7 +64,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 +82,91 @@
}
}
+ // 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');
+ //zhj MEBG鏂版柟妗堟敼閫� 2022-11-29 start
+ debugger
+ let hospitalName = '';
+ //璋冪敤鍚庣searchAgencyDataId鏂规硶鏌ヨ鍑哄尰闄笅闈㈡墍鏈夊鎴蜂汉鍛榙ataid
+ helper.CallBackAction(component,'searchAgencyDataId',{
+ hospitalId : agencyHospitalid
+ },function(data){
+ if(data.getState() == "SUCCESS"){
+ var data = data.getReturnValue();
+ if(data.IsSuccess == true){
+ let agencyContactIds = ''
+ 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;
+ }
+ agencyContactIds = agencyContactIds.substring(1);
+ agencyReport['agencyContactIds'] = agencyContactIds;
+ }else{
+ agencyReport['agencyContactIds'] = agencyContactIds;
+ }
+ var arr = new Array();
+ arr.push(agencyReport);
+ var requestData = JSON.stringify(arr);
+ // helper.set_aws_url(component,data,agencyHospitalid);
+
+ 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{
+ helper.ShowToast({
+ "message" : data.message,
+ "type" : "error"
+ });
+ }
+ }else{
+ helper.ShowToast({
+ "message" : 'searchAgency澶辫触',
+ "type" : "error"
+ });
+ }
+ })
+ //zhj MEBG鏂版柟妗堟敼閫� 2022-11-29 end
+ // 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) {
@@ -182,7 +259,7 @@
},
processFileContent : function(component,event,helper){
- helper.saveRecords(component,event);
+ helper.saveRecords(component,event,helper);
},
cancel : function(component,event,helper){
--
Gitblit v1.9.1