From 890eafcf31f5f8d519bb9e6f9c15303be5328e2d Mon Sep 17 00:00:00 2001
From: KKbes <1620284052@qq.com>
Date: 星期一, 07 八月 2023 10:48:54 +0800
Subject: [PATCH] review

---
 force-app/main/default/lwc/lexNewIntention/lexNewIntention.js |   49 +++++++++++++++++++++++++------------------------
 1 files changed, 25 insertions(+), 24 deletions(-)

diff --git a/force-app/main/default/lwc/lexNewIntention/lexNewIntention.js b/force-app/main/default/lwc/lexNewIntention/lexNewIntention.js
index 85f04dc..a62af77 100644
--- a/force-app/main/default/lwc/lexNewIntention/lexNewIntention.js
+++ b/force-app/main/default/lwc/lexNewIntention/lexNewIntention.js
@@ -4,10 +4,18 @@
 import { ShowToastEvent } from 'lightning/platformShowToastEvent';
 
 import init  from '@salesforce/apex/LexNewIntentionController.init';
+import getRecordIdByName  from '@salesforce/apex/LexSubmitCampaignController.getRecordIdByName';
 import getAccountByLongName  from '@salesforce/apex/LexNewIntentionController.getAccountByLongName';
 import getAccountByShortName  from '@salesforce/apex/LexNewIntentionController.getAccountByShortName';
-
-
+import Agency_Opportunity from '@salesforce/label/c.Agency_Opportunity';
+import Opportunity_stage from '@salesforce/label/c.Opportunity_stage';
+import Opp_Name from '@salesforce/label/c.Opp_Name';
+import Purchase_Reason from '@salesforce/label/c.Purchase_Reason';
+import Fund_Basis from '@salesforce/label/c.Fund_Basis';
+import Purchase_Type from '@salesforce/label/c.Purchase_Type';
+import Sales_Method from '@salesforce/label/c.Sales_Method';
+import Request from '@salesforce/label/c.Request';
+import Request_Detail from '@salesforce/label/c.Request_Detail';
 
 
   const event1 = new ShowToastEvent({
@@ -30,7 +38,6 @@
           const urlValue = currentPageReference.state.recordId;
           if (urlValue) {
             let str = `${urlValue}`;
-            console.log(str);
             this.recordId = str;
           }
         }
@@ -43,17 +50,14 @@
         init({
             recordId: this.recordId
         }).then(result => {
-            console.log(result);
             if (result != null) {
                 this.AgencyOpportunity = result;
                 this.newIntention().then(result=>{
                 	IsLoading=false;
                 	this.dispatchEvent(new CloseActionScreenEvent());
                 });
+                this.judageWhertherNull();
             }
-        }).catch(error => {
-            console.log("error");
-            console.log(error);
         });
 
     }
@@ -71,35 +75,32 @@
 	var accountID = '';
 		if(accountrecords.length > 0){
 			accountID = accountrecords[0].Id;
-			console.log('闀縩ame杩斿洖闀垮害澶т簬0')
 		}
 		if (accountID == '') {
 			accountName = this.AgencyOpportunity.Department_Class_Opp_Name__c;
 			accountrecords =  await getAccountByShortName({Name : accountName});
 				if(accountrecords.length > 0){
 					accountID = accountrecords[0].Id;
-					console.log('shortName return size 銆� 0')
 				}
 		}
-	var url = '/apex/NewAndEditLead?' + '00N10000009HKSP=' + this.AgencyOpportunity.Id
-	+ '&LeadSource=缁忛攢鍟�' + '&00N10000006qOFb=' + this.AgencyOpportunity.StageName__c 
-	+ '&00N10000006qOF0=' + this.AgencyOpportunity.Close_Forecasted_Date__c 
-	+ '&00N10000002EjE1=' + this.AgencyOpportunity.Name 
-	+ '&00N10000008rqHf=' + this.AgencyOpportunity.Purchase_Reason__c 
-	+ '&00N10000008rqHd=' + this.AgencyOpportunity.Fund_Basis__c 
-	+ '&00N10000008rqHg=' + this.AgencyOpportunity.Purchase_Type__c 
-	+'&00N10000008rqHj=' + this.AgencyOpportunity.Sales_Method__c
-	+ '&00N10000008rqHi=' + this.AgencyOpportunity.Request__c
-	+ '&00N10000008rqHh=' + this.AgencyOpportunity.Request_Detail__c
+	//鍚庣浠g爜鍙栧弬鏁版暟鎹�,涓�涓�瀵瑰簲
+	var recordTypeId= await getRecordIdByName({Name : '鎷滆鑾峰彇鐨勬剰鍚�'})
+	var url = '/apex/NewAndEditLead?' + Agency_Opportunity+'=' + this.AgencyOpportunity.Id
+	+ '&LeadSource=缁忛攢鍟�' + '&'+Opportunity_stage+'=' + this.AgencyOpportunity.StageName__c 
+	+ '&00N10000006qOF0=' + 	this.AgencyOpportunity.Close_Forecasted_Date__c 
+	+ '&'+Opp_Name+'=' + 		this.AgencyOpportunity.Name 
+	+ '&'+Purchase_Reason+'=' + this.AgencyOpportunity.Purchase_Reason__c 
+	+ '&'+Fund_Basis+'=' + 		this.AgencyOpportunity.Fund_Basis__c 
+	+ '&'+Purchase_Type+'=' + 	this.AgencyOpportunity.Purchase_Type__c 
+	+'&'+Sales_Method+'=' + 	this.AgencyOpportunity.Sales_Method__c
+	+ '&'+Request+'=' + 		this.AgencyOpportunity.Request__c
+	+ '&'+Request_Detail+'=' +  this.AgencyOpportunity.Request_Detail__c
 	+ '&CF00N10000002CvC5=' + accountName
 	+ '&CF00N10000002CvC5_lkid=' + accountID
-	+ '&RecordTypeId=01210000000QiRf' + '&retURL=%2F' + this.AgencyOpportunity.Id;
-
+	+ '&RecordTypeId='+recordTypeId + '&retURL=%2F' + this.AgencyOpportunity.Id;
 	window.open(url);
+
 	
-
-
     }
-
 
 }
\ No newline at end of file

--
Gitblit v1.9.1