From 50ce6a5e5ae7ac6ce3e6281acca9a0db568306e6 Mon Sep 17 00:00:00 2001
From: unknown <sunxia@prec-tech.com>
Date: 星期三, 23 八月 2023 14:54:59 +0800
Subject: [PATCH] Merge branch 'LEX_dev' of http://47.92.229.245:8089/r/lightningupdate into LEX_dev

---
 force-app/main/default/lwc/lexEquipmentSetRental_Order/lexEquipmentSetRental_Order.js |   72 +++++++++++++++++++++++------------
 1 files changed, 47 insertions(+), 25 deletions(-)

diff --git a/force-app/main/default/lwc/lexEquipmentSetRental_Order/lexEquipmentSetRental_Order.js b/force-app/main/default/lwc/lexEquipmentSetRental_Order/lexEquipmentSetRental_Order.js
index ff768cb..ec9d65b 100644
--- a/force-app/main/default/lwc/lexEquipmentSetRental_Order/lexEquipmentSetRental_Order.js
+++ b/force-app/main/default/lwc/lexEquipmentSetRental_Order/lexEquipmentSetRental_Order.js
@@ -3,6 +3,19 @@
 import AssignBtn  from '@salesforce/apex/RentalApplyWebService.AssignBtn';
 import {CurrentPageReference} from 'lightning/navigation';
 import { CloseActionScreenEvent } from 'lightning/actions';
+import { ShowToastEvent } from 'lightning/platformShowToastEvent';
+
+const event1 = new ShowToastEvent({
+            title: '璇锋鏌ョ敵璇风姸鎬�',
+            message:   
+                '涓嶈兘寮曞綋锛岃纭鐢宠鐨勭姸鎬�',
+        		});
+const event2 = new ShowToastEvent({
+            title: 'Get Help',
+            message:
+                '鏂规硶閿欒锛岃鑱旂郴绠$悊鍛�',
+        		});
+
 export default class lexEquipmentSetRental_Order extends LightningElement {
 
  	@api recordId;
@@ -10,35 +23,35 @@
  	Rental_Apply__c;
 
 
-	@wire(CurrentPageReference)
-    getStateParameters(currentPageReference){
-    	if(currentPageReference){
-    		console.log(currentPageReference);
-    		console.log("杩涘叆鑾峰彇page鍙傛暟")
-    		const IdValue=currentPageReference.state.recordId;
-    		if(IdValue){
-    			let str=`${IdValue}`;
-    			this.recordId=str;
-    			console.log("recordId="+str);
-    		}
-    	}
-    }
+	// @wire(CurrentPageReference)
+ //    getStateParameters(currentPageReference){
+ //    	if(currentPageReference){
+ //    		console.log(currentPageReference);
+ //    		console.log("杩涘叆鑾峰彇page鍙傛暟")
+ //    		const IdValue=currentPageReference.state.recordId;
+ //    		if(IdValue){
+ //    			let str=`${IdValue}`;
+ //    			this.recordId=str;
+ //    			console.log("recordId="+str);
+ //    		}
+ //    	}
+ //    }
 
 
     connectedCallback(){
     init({recordId:this.recordId}).then(res=>{
     	if(res!=null){
-    	this.IsLoading=false;
-    	console.log("res");
-    	console.log(res);
-    	console.log("杩涘叆鍒濆鍖栧璞″叾浠栧睘鎬�");
-    	this.Rental_Apply__c=res;
-    	console.log(this.Rental_Apply__c);
-        this.distribution();
+			this.IsLoading=false;
+			console.log("res");
+			console.log(res);
+			console.log("杩涘叆鍒濆鍖栧璞″叾浠栧睘鎬�");
+			this.Rental_Apply__c=res;
+			console.log(this.Rental_Apply__c);
+			this.distribution();
     	}
     	else{
-    		 var a="娌¤繘distribution";
- console.log(a);
+    		var a="娌¤繘distribution";
+ 			console.log(a);
     	}
     }).catch(error =>{
     	console.log("error");
@@ -60,7 +73,8 @@
 			this.Rental_Apply__c.demo_purpose2__c == '鍩硅涓績'
 			)
 			&& this.Rental_Apply__c.Status__c == '鑽夋涓�') {
-			alert("涓嶈兘寮曞綋锛岃纭鐢宠鐨勭姸鎬�");
+			this.dispatchEvent(event1);
+			this.dispatchEvent(new CloseActionScreenEvent());
 		} else if(
 			(this.Rental_Apply__c.demo_purpose2__c == '璇曠敤锛堟棤璇环锛�' ||
 			this.Rental_Apply__c.demo_purpose2__c == '璇曠敤锛堟湁璇环锛�' || 
@@ -72,12 +86,20 @@
 			&& this.Rental_Apply__c.Status__c != '鎵瑰噯瀹屼簡'
 			&& this.Rental_Apply__c.Status__c != '寮曞綋瀹屼簡'
 			&& this.Rental_Apply__c.Status__c != '鍑哄簱鎸囩ず瀹屼簡') {
-				alert("涓嶈兘寮曞綋锛岃纭鐢宠鐨勭姸鎬�");
+				this.dispatchEvent(event1);
+				this.dispatchEvent(new CloseActionScreenEvent());
 		} else if(rtn == 'Fin') {
 			window.open("/apex/EquipmentRentalApply?raid="+URLENCODE(this.Rental_Apply__c.Id));
+			this.closeAction();
 		} else{
-			alert(rtn);
+			this.dispatchEvent(event2);
+			this.dispatchEvent(new CloseActionScreenEvent());
 		}  	
 
     }
+
+	closeAction() {
+        //杩斿洖褰撳墠鐨勫鍝佺敵璇�
+		window.open("/"+this.recordId,'_self');
+    }
 }
\ No newline at end of file

--
Gitblit v1.9.1