From 7986d6aaf7e235f2f5a7dac7345f97a76ac00b97 Mon Sep 17 00:00:00 2001
From: 黄千龙 <huangqianlong@prec-tech.com>
Date: 星期五, 26 五月 2023 12:23:09 +0800
Subject: [PATCH] 清理多余引用,去除多余update操作(跳转带默认值未完成)

---
 force-app/main/default/lwc/lexOCMSubmit/lexOCMSubmit.js |   46 +++++++++++++++++++++-------------------------
 1 files changed, 21 insertions(+), 25 deletions(-)

diff --git a/force-app/main/default/lwc/lexOCMSubmit/lexOCMSubmit.js b/force-app/main/default/lwc/lexOCMSubmit/lexOCMSubmit.js
index d6c2e68..2f48924 100644
--- a/force-app/main/default/lwc/lexOCMSubmit/lexOCMSubmit.js
+++ b/force-app/main/default/lwc/lexOCMSubmit/lexOCMSubmit.js
@@ -1,12 +1,10 @@
 import { LightningElement,wire,track,api} from 'lwc';
 import { CurrentPageReference } from "lightning/navigation";
 import { CloseActionScreenEvent } from 'lightning/actions';
-import { NavigationMixin } from 'lightning/navigation';
+import LightningConfirm from 'lightning/confirm';
 import { ShowToastEvent } from 'lightning/platformShowToastEvent';
 import init  from '@salesforce/apex/QISReportController.initForOCMSubmitButton';
 import updateQis  from '@salesforce/apex/QISReportController.updateQisWithOCM';
-import UserInfo_Owner from '@salesforce/apex/TaskFeedbackController.UserInfo_Owner';
-import { updateRecord } from 'lightning/uiRecordApi';
 
 export default class lexOCMSubmit extends LightningElement {
 	@api recordId;
@@ -16,6 +14,7 @@
 	qisStatus;
 	contractnumber;
 	isaohuiproduct;
+    err;
 	@wire(CurrentPageReference)
      getStateParameters(currentPageReference) {
              console.log(111);
@@ -38,12 +37,10 @@
         }).then(result => {
             this.IsLoading = false;
             this.qisReportId = result.Id;
-            this.qisStatus = result.QIStatus;
-            this.QISInstallDate = result.QISInstallDate;
+            this.qisStatus = result.qIStatus;
+            this.QISInstallDate = result.qISInstallDate;
             this.contractnumber = result.contractnumber;
             this.isaohuiproduct = result.isaohuiproduct;
-            console.log('this.qisStatus='+this.qisStatus);
-            console.log('this.isaohuiproduct='+this.isaohuiproduct);
          	if (this.qisStatus!='鑽夋涓�' && this.qisStatus!='鍙栨秷') {
          		const evt = new ShowToastEvent({
                         title : '宸茬粡鎻愪氦',
@@ -87,38 +84,37 @@
          		this.dispatchEvent(new CloseActionScreenEvent());
 				return;
          	}
-
-         	if (!confirm("涓�鏃︽彁浜ゆ璁板綍浠ュ緟鎵瑰噯锛屾牴鎹偍鐨勮缃偍鍙兘涓嶅啀鑳藉缂栬緫姝よ褰曟垨灏嗕粬浠庢壒鍑嗚繃绋嬩腑璋冨洖銆傛槸鍚︾户缁紵")) {
-         		this.dispatchEvent(new CloseActionScreenEvent());
-				return;
-			}
-			this.updateQisSubmit();
-			if (this.isaohuiproduct == 'true') {
-				this.dispatchEvent(new CloseActionScreenEvent());
-                this.updateRecordView(this.recordId);
-			}
-			this.dispatchEvent(new CloseActionScreenEvent());
-            this.updateRecordView(this.recordId);
+                LightningConfirm.open({
+                message: '涓�鏃︽彁浜ゆ璁板綍浠ュ緟鎵瑰噯锛屾牴鎹偍鐨勮缃偍鍙兘涓嶅啀鑳藉缂栬緫姝よ褰曟垨灏嗕粬浠庢壒鍑嗚繃绋嬩腑璋冨洖銆傛槸鍚︾户缁紵',
+                variant: 'headerless',
+                label: 'this is the aria-label value',
+                }).then(res=>{
+                    if(res) {
+                        this.updateQisSubmit();
+                        if (this.isaohuiproduct) {
+                            this.dispatchEvent(new CloseActionScreenEvent());
+                        }
+                    }else{
+                        this.dispatchEvent(new CloseActionScreenEvent());
+                        return;
+                    }                 
+                });
         }).catch(error => {
             console.log('error='+error);
         }).finally(() => {
             
         }); 
     }
-
-    updateRecordView(recordId) {
-        updateRecord({fields: { Id: recordId }});
-    }
-
     updateQisSubmit(){
         	updateQis({
         		 recordId: this.recordId
         		}).then(result =>{
         			console.log('result'+result);
         			if (result!='鎴愬姛') {
+                        this.err = result;
         				const evt = new ShowToastEvent({
 	                        title : '鏇存柊澶辫触',
-	                        message: result,
+	                        message: this.err,
 	                        variant: 'error'
                     	});
                     	this.dispatchEvent(evt);

--
Gitblit v1.9.1