From 962519811b7c4be07f30d09e791798b0ea79d3ae Mon Sep 17 00:00:00 2001 From: 黄千龙 <huangqianlong@prec-tech.com> Date: 星期三, 08 三月 2023 09:54:02 +0800 Subject: [PATCH] 同步代码 --- force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReportController.js | 127 ++++++++++++++++++++++++++++++++++++++---- 1 files changed, 115 insertions(+), 12 deletions(-) diff --git a/force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReportController.js b/force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReportController.js index 9fc5afb..1764619 100644 --- a/force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReportController.js +++ b/force-app/main/default/aura/RetrospectiveWeeklyReport/RetrospectiveWeeklyReportController.js @@ -21,7 +21,9 @@ component.find('save_button').set('v.label', '淇濆瓨骞舵柊寤�'); helper.copy_button(component, event, helper); }, - + delete_button : function(component, event, helper) { + helper.delete_button(component, event, helper); + }, change_report_radio : function(component, event, helper) { helper.change_report_radio(component, event, helper); }, @@ -49,6 +51,7 @@ 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"))){ showValidationError = true; @@ -62,9 +65,74 @@ } } + //SWAG-CF58C3 fy 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"); + } + //SWAG-CF58C3 fy end }); if (!showValidationError) { - helper.newlyBuild(component, event, helper); + //SWAG-CF58C3 fy start + 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); + // 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); + //SWAG-CF58C3 fy end + // helper.newlyBuild(component, event, helper); }else{ component.find('OppMessage').setError(vaildationFailReason); } @@ -97,15 +165,23 @@ }, 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"); + var hospital_nameld = component.get("v.UseProduct1s"); if (hospital_name.match(/(\S+\s)+/)) { - helper.searchHos(component, event, helper); + if(hospital_nameld!=hospital_name){ + helper.searchHos(component, event, helper); + } } else { - helper.hideSearch(component, event, helper); + if(hospital_name==''){ + helper.hideSearchs(component, event, helper); + }else{ + helper.hideSearch(component, event, helper); + } } }, selectHos : function(component, event, helper) { @@ -115,10 +191,18 @@ //浣跨敤浜у搧1 UseProduct1Change : function(component, event, helper) { var UseProduct1Name = event.getParam("value"); + var UseProduct1Nameold = component.get("v.UseProduct1s"); + debugger if (UseProduct1Name.match(/(\S+\s)+/)) { - helper.searchUseProduct1(component, event, helper); + if(UseProduct1Name!=UseProduct1Nameold){ + helper.searchUseProduct1(component, event, helper); + } } else { - helper.hideSearchUseProduct1(component, event, helper); + if(UseProduct1Name==''){ + helper.hideSearchUseProduct1s(component, event, helper); + }else{ + helper.hideSearchUseProduct1(component, event, helper); + } } }, seletUseProduct1Change : function(component, event, helper) { @@ -127,10 +211,17 @@ //浣跨敤浜у搧2 UseProduct2Change : function(component, event, helper) { var UseProduct2Name = event.getParam("value"); + var UseProduct2Nameold = component.get("v.UseProduct2s"); if (UseProduct2Name.match(/(\S+\s)+/)) { - helper.searchUseProduct2(component, event, helper); + if(UseProduct2Name!=UseProduct2Nameold){ + helper.searchUseProduct2(component, event, helper); + } } else { - helper.hideSearchUseProduct2(component, event, helper); + if(UseProduct2Name==''){ + helper.hideSearchUseProduct2s(component, event, helper); + }else{ + helper.hideSearchUseProduct2(component, event, helper); + } } }, seletUseProduct2Change : function(component, event, helper) { @@ -142,10 +233,17 @@ //浣跨敤浜у搧3 UseProduct3Change : function(component, event, helper) { var UseProduct3Name = event.getParam("value"); + var UseProduct3Nameold = component.get("v.UseProduct3s"); if (UseProduct3Name.match(/(\S+\s)+/)) { - helper.searchUseProduct3(component, event, helper); + if(UseProduct3Name!=UseProduct3Nameold){ + helper.searchUseProduct3(component, event, helper); + } } else { - helper.hideSearchUseProduct3(component, event, helper); + if(UseProduct3Name==''){ + helper.hideSearchUseProduct3s(component, event, helper); + }else{ + helper.hideSearchUseProduct3(component, event, helper); + } } }, seletUseProduct3Change : function(component, event, helper) { @@ -204,7 +302,6 @@ hiddenElement.click(); // using click() js function to download csv file }, - export_condition : function(component,event,helper){ helper.showExport(component); }, @@ -233,8 +330,14 @@ }, select_warlocksNumber : function(component,event,helper){ helper.select_warlocksNumber(component,event,helper); - }, + }, selectProductClassification : function(component,event,helper){ helper.selectProductClassification(component,event,helper); + }, + selectpurposetype : function(component,event,helper){ + helper.selectpurposetype(component,event,helper); + }, + return_main_page: function(component,event,helper){ + window.open('/customer/','_self'); } }) \ No newline at end of file -- Gitblit v1.9.1