From ddb0231ef7c5cf2bad9d3f1afc2f733674ad38a5 Mon Sep 17 00:00:00 2001
From: unknown <sunxia@prec-tech.com>
Date: 星期四, 24 八月 2023 14:50:51 +0800
Subject: [PATCH] 再修理按钮

---
 force-app/main/default/lwc/lexRentalFixtureSetAssignAgency/lexRentalFixtureSetAssignAgency.js |   84 +++++++++++++++++++++--------------------
 1 files changed, 43 insertions(+), 41 deletions(-)

diff --git a/force-app/main/default/lwc/lexRentalFixtureSetAssignAgency/lexRentalFixtureSetAssignAgency.js b/force-app/main/default/lwc/lexRentalFixtureSetAssignAgency/lexRentalFixtureSetAssignAgency.js
index 67d459e..9ec851a 100644
--- a/force-app/main/default/lwc/lexRentalFixtureSetAssignAgency/lexRentalFixtureSetAssignAgency.js
+++ b/force-app/main/default/lwc/lexRentalFixtureSetAssignAgency/lexRentalFixtureSetAssignAgency.js
@@ -13,51 +13,53 @@
 			recordId: this.recordId
 		}).then(result=>{
 			this.IsLoading = false;
-			let res = result.ra;
-			console.log(res);
-			if(res.Campaign__c != '' || res.Campaign__c != undefined){
-				if(res.CampaignStatus == '鍙栨秷'){
-					this.isShow = true;
-					this.msg = '瀛︿細鍙栨秷锛屼笉鍙垎閰�';
-					return;
+			if(result){
+				let res = result.ra;
+				console.log(res);
+				if(res.Campaign__c != '' || res.Campaign__c != undefined){
+					if(res.CampaignStatus == '鍙栨秷'){
+						this.isShow = true;
+						this.msg = '瀛︿細鍙栨秷锛屼笉鍙垎閰�';
+						return;
+					}
 				}
-			}
 
-			if(res.Repair__c != '' || res.Repair__c != undefined){
-				if(res.Repair_Final_Inspection_Date_F__c != null && res.Repair_Final_Inspection_Date_F__c !='' 
-						|| (res.RC_return_to_office__c!=null && res.RC_return_to_office__c != '')){
-					this.isShow = true;
-					this.msg = '淇悊鏈夋渶缁堟娴嬫棩鎴栦慨鐞嗗搧杩旈�佹棩锛屼笉鍙垎閰�';
-					return;
+				if(res.Repair__c != '' || res.Repair__c != undefined){
+					if(res.Repair_Final_Inspection_Date_F__c != null && res.Repair_Final_Inspection_Date_F__c !='' 
+							|| (res.RC_return_to_office__c!=null && res.RC_return_to_office__c != '')){
+						this.isShow = true;
+						this.msg = '淇悊鏈夋渶缁堟娴嬫棩鎴栦慨鐞嗗搧杩旈�佹棩锛屼笉鍙垎閰�';
+						return;
+					}
 				}
-			}
 
-			assignBtn({
-				Rid: this.recordId
-			}).then(resultMsg => {
-				if(res.Status__c == '鍙栨秷' && res.Rental_Apply_Equipment_Set_Cnt__c != 0){
-					window.open("/apex/RentalFixtureSetAssignAgency?pt_recid=" + this.recordId); 
-					this.closeAction();
-				}else if((res.demo_purpose2__c == '瀛︿細灞曚細' || res.demo_purpose2__c == '璇鹃鐮旂┒' || res.demo_purpose2__c == '鍩硅涓績')&& res.Status__c == '鑽夋涓�'){
-					this.isShow = true;
-					this.msg = "涓嶈兘鍒嗛厤锛岃纭鐢宠鐨勭姸鎬�";
-					return
-				}else if((res.demo_purpose2__c =='璇曠敤锛堟棤璇环锛�' || res.demo_purpose2__c == '璇曠敤锛堟湁璇环锛�' || res.demo_purpose2__c =='鍔ㄧ墿瀹為獙' || 
-					res.demo_purpose2__c == '涓�鑸淮淇唬鐢�' || res.demo_purpose2__c== '淇濅慨鍚堝悓鐢ㄦ埛缁翠慨浠g敤' || res.demo_purpose2__c == '宸茶喘寰呰揣') 
-				&& res.Status__c != '宸叉壒鍑�' && res.Status__c != '宸插嚭搴撴寚绀�'){
-					this.isShow = true;
-					this.msg = "涓嶈兘鍒嗛厤锛岃纭鐢宠鐨勭姸鎬�";
-					return;
-				}else if(resultMsg == 'Fin'){
-					window.open("/apex/RentalFixtureSetAssignAgency?pt_recid=" + this.recordId); 
-					this.closeAction();
-					return;
-				}else{
-					this.isShow = true;
-					this.msg = resultMsg;
-					return;
-				}
-			})
+				assignBtn({
+					Rid: this.recordId
+				}).then(resultMsg => {
+					if(res.Status__c == '鍙栨秷' && res.Rental_Apply_Equipment_Set_Cnt__c != 0){
+						window.open("/apex/RentalFixtureSetAssignAgency?pt_recid=" + this.recordId); 
+						this.closeAction();
+					}else if((res.demo_purpose2__c == '瀛︿細灞曚細' || res.demo_purpose2__c == '璇鹃鐮旂┒' || res.demo_purpose2__c == '鍩硅涓績')&& res.Status__c == '鑽夋涓�'){
+						this.isShow = true;
+						this.msg = "涓嶈兘鍒嗛厤锛岃纭鐢宠鐨勭姸鎬�";
+						return
+					}else if((res.demo_purpose2__c =='璇曠敤锛堟棤璇环锛�' || res.demo_purpose2__c == '璇曠敤锛堟湁璇环锛�' || res.demo_purpose2__c =='鍔ㄧ墿瀹為獙' || 
+						res.demo_purpose2__c == '涓�鑸淮淇唬鐢�' || res.demo_purpose2__c== '淇濅慨鍚堝悓鐢ㄦ埛缁翠慨浠g敤' || res.demo_purpose2__c == '宸茶喘寰呰揣') 
+					&& res.Status__c != '宸叉壒鍑�' && res.Status__c != '宸插嚭搴撴寚绀�'){
+						this.isShow = true;
+						this.msg = "涓嶈兘鍒嗛厤锛岃纭鐢宠鐨勭姸鎬�";
+						return;
+					}else if(resultMsg == 'Fin'){
+						window.open("/apex/RentalFixtureSetAssignAgency?pt_recid=" + this.recordId); 
+						this.closeAction();
+						return;
+					}else{
+						this.isShow = true;
+						this.msg = resultMsg;
+						return;
+					}
+				})
+			}
 		})
 		.catch(err=>{
 			console.log('initErr==='+err);

--
Gitblit v1.9.1