From b37242ad5f2a81065eba0b176b38de4dd93ac8d6 Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@prec-tech.com>
Date: 星期一, 10 七月 2023 15:48:46 +0800
Subject: [PATCH] Merge branch 'LEX_dev' of http://47.92.229.245:8089/r/lightningupdate into LEX_dev

---
 force-app/main/default/lwc/lexRentalApplyJump/lexRentalApplyJump.js |  101 +++++++++++++++++++++++++++-----------------------
 1 files changed, 54 insertions(+), 47 deletions(-)

diff --git a/force-app/main/default/lwc/lexRentalApplyJump/lexRentalApplyJump.js b/force-app/main/default/lwc/lexRentalApplyJump/lexRentalApplyJump.js
index 70a5d7d..38786e0 100644
--- a/force-app/main/default/lwc/lexRentalApplyJump/lexRentalApplyJump.js
+++ b/force-app/main/default/lwc/lexRentalApplyJump/lexRentalApplyJump.js
@@ -11,12 +11,14 @@
 
 	@api recordId;
     id;
+    @api rentalApplyIds;
     RentalApplyId;
-    Status;
+    //鎻愮ず淇℃伅
+    msg;
     IsLoading=true;
+
     @wire(CurrentPageReference)
 	getStateParameters(currentPageReference){
-		alert("杩涘叆椤甸潰")
 		console.log("杩涘叆椤甸潰");
 		console.log(currentPageReference);
 		if(currentPageReference){
@@ -35,11 +37,9 @@
 	connectedCallback(){
 		console.log(this.recordId);
 		init({recordId:this.recordId}).then(result=>{
-			console.log(result);
 			if(result!=null){
 				this.id=result.id;
 			    this.RentalApplyId=result.RentalApplyId;
-			    this.Status=result.Status;
 				this.cancelSubmit().then(res=>{
 					this.IsLoading=false;
 					this.dispatchEvent(new CloseActionScreenEvent());
@@ -57,56 +57,63 @@
  
     async cancelSubmit(){
 		// 鍙垎閰嶄唬鏇垮搧鍓嶆彁1 -- 澶囧搧鍊熷嚭鐢宠鐨勭姸鎬侊細鈥滃凡鎵瑰噯鈥濆埌鈥滃凡鍑哄簱鎸囩ず鈥�
-		var userIdArr = ['00510000001O6HoAAK','00510000001O6I2AAK','00510000000gW9pAAE','00510000000gW9BAAU','00510000008pVbWAAU','00510000001OOMjAAO','00510000005sEEMAA2','00510000004pNOtAAM','00510000005QJ2eAAG','00510000007iCmcAAE','00510000006kIg8AAE','00510000004rbkzAAA','00510000003LMHuAAO','00510000000gW92AAE'];
+		var userIdArr = ['00510000001O6HoAAK','00510000001O6I2AAK','00510000000gW9pAAE','00510000000gW9BAAU','00510000008pVbWAAU','00510000001OOMjAAO',
+			'00510000005sEEMAA2','00510000004pNOtAAM','00510000005QJ2eAAG','00510000007iCmcAAE','00510000006kIg8AAE','00510000004rbkzAAA','00510000003LMHuAAO',
+			'00510000000gW92AAE'];
 		//褰撳墠鐢ㄦ埛鐧诲綍id
 		var userId;
 		await getUserId().then(res=>{
 			userId=res;
-		});
-		console.log(userId);
+		})
+		.catch(err=>{
+			console.log("getUserIderr==="+err);
+		})
+		//TODO====
+		userId = '00510000001O6HoAAK';
+		console.log("userId==="+userId);
 		if(userIdArr.indexOf(userId)== -1){
-			// alert('瀵逛笉璧蜂綘娌℃湁姝ゆ搷浣滅殑鏉冮檺锛�');
-			const event = new ShowToastEvent({
-	            title: '鎻愮ず淇℃伅',
-	            message:'瀵逛笉璧蜂綘娌℃湁姝ゆ搷浣滅殑鏉冮檺锛�'
-            });
-	        this.dispatchEvent(event);
+			this.msg = '瀵逛笉璧蜂綘娌℃湁姝ゆ搷浣滅殑鏉冮檺锛�';
+			this.IsLoading = false;
+			return;
 		} else {
-			console.log(userId);
-			let raid = this.RentalApplyId;
-			console.log("hh1");
-			await selectRentalApplyEquipmentSetByRACID({recordId:this.RentalApplyId}).then(res=>{
-				console.log(res);
-				if (res==null||res.length==0) {
-					// alert("鏌ヨ缁撴灉涓虹┖");
-					const event = new ShowToastEvent({
-			            title: '鎻愮ず淇℃伅',
-			            message:"鏌ヨ缁撴灉涓虹┖"
-		            });
-			        this.dispatchEvent(event);
-					return;
-				}
-				var allRecords = res;
-				var validSize= allRecords.length;
-				var canJump = false;
-				for(i=0;i<validSize;i++){
-					if(allRecords[i].Allow_Adjust_Queue_Flag__c == true){
-						canJump = true;
-						break;
+			console.log('this.rentalApplyIds=='+this.rentalApplyIds);
+			if(this.rentalApplyIds == undefined || this.rentalApplyIds.length<1){
+				this.msg = '璇烽�夋嫨鍊熷嚭澶囧搧涓�瑙堣褰�';
+				this.IsLoading = false;
+				return;
+			}else{
+				let raid = this.RentalApplyId;
+				await selectRentalApplyEquipmentSetByRACID({recordId:this.recordId}).then(res=>{
+					console.log('selectRentalApplyEquipmentSetByRACID=='+JSON.stringify(res));
+					
+					var allRecords = res;
+					var validSize= allRecords.length;
+					var canJump = false;
+					for(var i=0;i<validSize;i++){
+						if(allRecords[i].Allow_Adjust_Queue_Flag__c == true){
+							canJump = true;
+							break;
+						}
 					}
-				}
-				if(canJump == true){
-					// alert("閫夋嫨鍊熷嚭澶囧搧涓�瑙堣褰曟湁宸茬粡鍏佽鎻掗槦鐨勶紝璇烽�夋嫨鏈厑璁哥殑涓�瑙�");
-					const event = new ShowToastEvent({
-			            title: '鎻愮ず淇℃伅',
-			            message:"閫夋嫨鍊熷嚭澶囧搧涓�瑙堣褰曟湁宸茬粡鍏佽鎻掗槦鐨勶紝璇烽�夋嫨鏈厑璁哥殑涓�瑙�"
-		            });
-			        this.dispatchEvent(event);
-				}else{
-					let records=[this.recordId];
-					window.open("/apex/RentalApplyJump?objId="+this.RentalApplyId+"&raesIds="+records, 'RentalApplyJump', 'width=700,height=300');
-				}
-			});
+					if(canJump == true){
+						this.msg = '閫夋嫨鍊熷嚭澶囧搧涓�瑙堣褰曟湁宸茬粡鍏佽鎻掗槦鐨勶紝璇烽�夋嫨鏈厑璁哥殑涓�瑙�';
+						this.IsLoading = false;
+						return;
+					}else{
+						let records=[this.recordId];
+						window.open("/apex/RentalApplyJump?objId="+this.recordId+"&raesIds="+ this.rentalApplyIds, 'RentalApplyJump', 'width=700,height=300');
+						this.closeAction();
+					}
+				})
+				.catch(error=>{
+					console.log('selectRentalApplyEquipmentSetByRACIDerr==='+error);
+				})
+			}
 		}
 	}
+
+	closeAction() {
+        //杩斿洖褰撳墠鐨勫鍝佺敵璇�
+		window.open("/"+this.recordId,'_self');
+    }
 }
\ No newline at end of file

--
Gitblit v1.9.1