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/lexOCSMNoToReportLighting/lexOCSMNoToReportLighting.js |   66 ++++++++++++++++----------------
 1 files changed, 33 insertions(+), 33 deletions(-)

diff --git a/force-app/main/default/lwc/lexOCSMNoToReportLighting/lexOCSMNoToReportLighting.js b/force-app/main/default/lwc/lexOCSMNoToReportLighting/lexOCSMNoToReportLighting.js
index 2c3c93c..31f4054 100644
--- a/force-app/main/default/lwc/lexOCSMNoToReportLighting/lexOCSMNoToReportLighting.js
+++ b/force-app/main/default/lwc/lexOCSMNoToReportLighting/lexOCSMNoToReportLighting.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.initForlexOCSMNoToReportLightingButton';
 import updateQis  from '@salesforce/apex/QISReportController.updateQisForlexOCSMNoToReportLighting';
-import UserInfo_Owner from '@salesforce/apex/TaskFeedbackController.UserInfo_Owner';
-import { updateRecord } from 'lightning/uiRecordApi';
 
 export default class lexOCSMNoToReportLighting extends LightningElement {
 	@api recordId;
@@ -42,43 +40,46 @@
             this.OCSMAdministrativeReportDate = result.oCSMAdministrativeReportDate;
             this.qisReportId = result.Id;
             this.Awaredate = result.awaredate;
-            if (!confirm("涓嶈鎶ュ憡鍚庢棤娉曟挙鍥烇紝鏄惁缁х画锛�")) {
-            		this.dispatchEvent(new CloseActionScreenEvent());
-                    return;
-        	}
-            if (this.OCSMAdministrativeReportDate != null || this.OCSMAdministrativeReportNumber != null) {
-            		const evt = new ShowToastEvent({
-                            title : '宸茬粡鎶ュ憡鐨凲IS锛屼笉鍙互鐐瑰嚮OCSM涓嶈鎶ュ憡',
-                            message: '',
-                            variant: 'error'
-                        });
-                        this.dispatchEvent(evt);
+            LightningConfirm.open({
+                message: '涓嶈鎶ュ憡鍚庢棤娉曟挙鍥烇紝鏄惁缁х画锛�',
+                variant: 'headerless',
+                label: 'this is the aria-label value',
+                }).then(res=>{
+                    if(res) {
+                        if (this.OCSMAdministrativeReportDate != null || this.OCSMAdministrativeReportNumber != null) {
+                            const evt = new ShowToastEvent({
+                                    title : '宸茬粡鎶ュ憡鐨凲IS锛屼笉鍙互鐐瑰嚮OCSM涓嶈鎶ュ憡',
+                                    message: '',
+                                    variant: 'error'
+                                });
+                                this.dispatchEvent(evt);
+                                this.dispatchEvent(new CloseActionScreenEvent());
+                                return;
+                        }
+                        if (this.Awaredate!=null) {
+                            this.updateQisSubmit();
+                        }else{
+                            const evt = new ShowToastEvent({
+                                    title : '娌℃湁AwareDate鎴栧凡缁廜CSM琛屾斂鎶ュ憡锛岃纭',
+                                    message: '',
+                                    variant: 'error'
+                                });
+                                this.dispatchEvent(evt);
+                                this.dispatchEvent(new CloseActionScreenEvent());
+                                return;
+                        }
+                    }else{
                         this.dispatchEvent(new CloseActionScreenEvent());
                         return;
-            }
-         	if (this.Awaredate!=null) {
-         		this.updateQisSubmit();
-         	}else{
-         		const evt = new ShowToastEvent({
-                        title : '娌℃湁AwareDate鎴栧凡缁廜CSM琛屾斂鎶ュ憡锛岃纭',
-                        message: '',
-                        variant: 'error'
-                    });
-                    this.dispatchEvent(evt);
-                    this.dispatchEvent(new CloseActionScreenEvent());
-                    return;
-         	}
+                    }
+                    
+            });
         }).catch(error => {
             console.log('error='+error);
         }).finally(() => {
             
         }); 
     }
-
-    updateRecordView(recordId) {
-        updateRecord({fields: { Id: recordId }});
-    }
-
     updateQisSubmit(){
         	updateQis({
         		 recordId: this.recordId
@@ -94,7 +95,6 @@
                         this.dispatchEvent(evt);
                     }
                 this.dispatchEvent(new CloseActionScreenEvent());
-                this.updateRecordView(this.recordId);
         		}).catch(error => {
             console.log('error='+error);
         }).finally(() => {

--
Gitblit v1.9.1