From bac2a731433a38cb262e7f38a98c9522481752ec Mon Sep 17 00:00:00 2001
From: unknown <sunxia@prec-tech.com>
Date: 星期四, 20 七月 2023 10:08:02 +0800
Subject: [PATCH] button-all_received_fse

---
 force-app/main/default/lwc/lexAllReceivedFse/lexAllReceivedFse.js |   56 +++++++++++++++++++++++++++++---------------------------
 1 files changed, 29 insertions(+), 27 deletions(-)

diff --git a/force-app/main/default/lwc/lexAllReceivedFse/lexAllReceivedFse.js b/force-app/main/default/lwc/lexAllReceivedFse/lexAllReceivedFse.js
index 1e29534..e088359 100644
--- a/force-app/main/default/lwc/lexAllReceivedFse/lexAllReceivedFse.js
+++ b/force-app/main/default/lwc/lexAllReceivedFse/lexAllReceivedFse.js
@@ -4,8 +4,8 @@
 import { ShowToastEvent } from 'lightning/platformShowToastEvent';
 import { updateRecord } from 'lightning/uiRecordApi';
 
-import init from '@salesforce/apex/AllReceivedFseController.init';
-import getRaeSet from '@salesforce/apex/AllReceivedFseController.getRaeSet';
+import init from '@salesforce/apex/LexAllReceivedFseController.init';
+import getRaeSet from '@salesforce/apex/LexAllReceivedFseController.getRaeSet';
 export default class lexAllReceivedFse extends LightningElement {
 
 	@api recordId;
@@ -26,31 +26,33 @@
 		init({
 			recordId: this.recordId
 		}).then(res=>{
-			console.log('loanerReceivedNgNum==='+ res.loanerReceivedNgNum);
-			if(res.loanerReceivedNgNum == 0){
-				const evt = new ShowToastEvent({
-                        title : '鐜板満宸茬粡鍏ㄩ儴鏀跺埌瀹炵墿浜�',
-                        message: '',
-                        variant: 'error'
-                    });
-                this.dispatchEvent(evt);
-                this.dispatchEvent(new CloseActionScreenEvent());
-			}else{
-				getRaeSet({
-					recordId: this.recordId
-				}).then(res=>{
-					if(res == 'SUCCESS'){
-                		this.showToast('鐜板満宸插叏閮ㄦ敹璐�','success');
-                		return;
-					}else{
-                		this.showToast(res,'warning');
-                		return;
-					}
-					
-				})
-				.catch(err=>{
-					console.log('getRaeSet==='+err);
-				})
+			console.log('loanerReceivedNgNum==='+ JSON.stringify(res));
+			if(res){
+				if(res.loanerReceivedNgNum == 0){
+					const evt = new ShowToastEvent({
+	                        title : '鐜板満宸茬粡鍏ㄩ儴鏀跺埌瀹炵墿浜�',
+	                        message: '',
+	                        variant: 'error'
+	                    });
+	                this.dispatchEvent(evt);
+	                this.dispatchEvent(new CloseActionScreenEvent());
+				}else{
+					getRaeSet({
+						recordId: this.recordId
+					}).then(res=>{
+						if(res == 'SUCCESS'){
+	                		this.showToast('鐜板満宸插叏閮ㄦ敹璐�','success');
+	                		return;
+						}else{
+	                		this.showToast(res,'warning');
+	                		return;
+						}
+						
+					})
+					.catch(err=>{
+						console.log('getRaeSet==='+err);
+					})
+				}
 			}
 		}).catch(err=>{
 			console.log('init==='+err);

--
Gitblit v1.9.1