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

---
 force-app/main/default/lwc/lexFeedbackReport/lexFeedbackReport.js |   36 +++++++++++++++++++-----------------
 1 files changed, 19 insertions(+), 17 deletions(-)

diff --git a/force-app/main/default/lwc/lexFeedbackReport/lexFeedbackReport.js b/force-app/main/default/lwc/lexFeedbackReport/lexFeedbackReport.js
index 327730f..ddb8d31 100644
--- a/force-app/main/default/lwc/lexFeedbackReport/lexFeedbackReport.js
+++ b/force-app/main/default/lwc/lexFeedbackReport/lexFeedbackReport.js
@@ -3,12 +3,10 @@
 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 lexFeedbackReport extends LightningElement {
 	@api recordId;
-	IsLoading = true;
-
 	@wire(CurrentPageReference)
 	getStateParameters(currentPageReference){
 		if(currentPageReference) {
@@ -24,21 +22,25 @@
 		init({
 			recordId: this.recordId
 		}).then(res=>{
-			if(res.status__c!='宸插彂閫�'){
+			if(res){
+				if(res.status__c!='宸插彂閫�'){
 				this.showToast('鍙湁宸插彂閫佺殑妫�娴嬪垎鏋愭姤鍛婃墠鑳藉彂閫�','warning');
-				return;
-			}
-
-			updateRentalApplyFaultStatus({
-				recordId: this.recordId,
-				updateStatus: '宸插弽棣�'
-			}).then(result=>{
-				if(result=='SUCCESS'){
-					this.showToast('鎶ュ憡宸插弽棣�','success');
-				}else{
-					this.showToast(res,'error');
+					return;
 				}
-			})
+
+				updateRentalApplyFaultStatus({
+					recordId: this.recordId,
+					updateStatus: '宸插弽棣�'
+				}).then(result=>{
+					if(result=='SUCCESS'){
+						this.showToast('鎶ュ憡宸插弽棣�','success');
+					}else{
+						this.showToast(res,'error');
+					}
+				})
+			}else{
+				this.showToast('鏈煡璇㈠埌鏁版嵁','warning');
+			}
 		})
 	}
 

--
Gitblit v1.9.1