From da3b3ada2bcbb0ef7e595e12d1f2609a37364467 Mon Sep 17 00:00:00 2001
From: unknown <sunxia@prec-tech.com>
Date: 星期四, 20 七月 2023 15:55:17 +0800
Subject: [PATCH] button-lexSendReport

---
 force-app/main/default/lwc/lexSendReport/lexSendReport.js |   41 +++++++++++++++++++++++------------------
 1 files changed, 23 insertions(+), 18 deletions(-)

diff --git a/force-app/main/default/lwc/lexSendReport/lexSendReport.js b/force-app/main/default/lwc/lexSendReport/lexSendReport.js
index bb442ab..5015f01 100644
--- a/force-app/main/default/lwc/lexSendReport/lexSendReport.js
+++ b/force-app/main/default/lwc/lexSendReport/lexSendReport.js
@@ -3,8 +3,8 @@
 import { ShowToastEvent } from 'lightning/platformShowToastEvent';
 import { CurrentPageReference } from 'lightning/navigation';
 
-import init from '@salesforce/apex/RentalApplyFaultController.init';
-import updateRentalApplyFaultStatus from '@salesforce/apex/RentalApplyFaultController.updateRentalApplyFaultStatus';
+import init from '@salesforce/apex/LexRentalApplyFaultController.init';
+import updateRentalApplyFaultStatus from '@salesforce/apex/LexRentalApplyFaultController.updateRentalApplyFaultStatus';
 export default class lexSendReport extends LightningElement {
 
 	@api recordId;
@@ -25,23 +25,28 @@
 		init({
 			recordId: this.recordId
 		}).then(res=>{
-			console.log('res==='+JSON.stringify(res));
-			if(res.status__c!='鑽夋涓�' && res.status__c!=''){
-				this.showToast('鍙湁鑽夋涓殑妫�娴嬪垎鏋愭姤鍛婃墠鑳藉彂閫佹姤鍛�','warning');
-				return;
-			}
-
-			updateRentalApplyFaultStatus({
-				recordId: this.recordId,
-				updateStatus: '宸插彂閫�'
-			}).then(result=>{
-				console.log('result==='+result);
-				if(result=='SUCCESS'){
-					this.showToast('鎶ュ憡宸插彂閫�','success');
-				}else{
-					this.showToast(res.getMessage(),'error');
+			if(res){
+				console.log('res==='+JSON.stringify(res));
+				if(res.status__c!='鑽夋涓�' && res.status__c!=''){
+					this.showToast('鍙湁鑽夋涓殑妫�娴嬪垎鏋愭姤鍛婃墠鑳藉彂閫佹姤鍛�','warning');
+					return;
 				}
-			})
+
+				updateRentalApplyFaultStatus({
+					recordId: this.recordId,
+					updateStatus: '宸插彂閫�'
+				}).then(result=>{
+					console.log('result==='+result);
+					if(result=='SUCCESS'){
+						this.showToast('鎶ュ憡宸插彂閫�','success');
+					}else{
+						this.showToast(res.getMessage(),'error');
+					}
+				})
+			}else{
+				this.showToast('鏈煡璇㈠埌鏁版嵁','warning');
+			}
+			
 		}).catch(err=>{
 			console.log('init=='+err);
 		})

--
Gitblit v1.9.1