From d77b6353ca9b59a6398df3eae9912f9fd766946d Mon Sep 17 00:00:00 2001
From: zhangzhengmei <zhangzhengmei@prec-tech.com>
Date: 星期六, 05 八月 2023 17:04:22 +0800
Subject: [PATCH] fix: lightning 页面确认

---
 force-app/main/default/lwc/lexCreateQISFromAsset/lexCreateQISFromAsset.js |   60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 60 insertions(+), 0 deletions(-)

diff --git a/force-app/main/default/lwc/lexCreateQISFromAsset/lexCreateQISFromAsset.js b/force-app/main/default/lwc/lexCreateQISFromAsset/lexCreateQISFromAsset.js
new file mode 100644
index 0000000..e27813d
--- /dev/null
+++ b/force-app/main/default/lwc/lexCreateQISFromAsset/lexCreateQISFromAsset.js
@@ -0,0 +1,60 @@
+import { LightningElement,wire,track,api} from 'lwc';
+import { CurrentPageReference } from "lightning/navigation";
+import { CloseActionScreenEvent } from 'lightning/actions';
+import { NavigationMixin } from 'lightning/navigation';
+import { ShowToastEvent } from 'lightning/platformShowToastEvent';
+import init  from '@salesforce/apex/QISReportController.initForlexCreateQISFromAssetButton';
+import UserInfo_Owner from '@salesforce/apex/TaskFeedbackController.UserInfo_Owner';
+import { updateRecord } from 'lightning/uiRecordApi';
+
+export default class lexCreateQISFromAsset extends LightningElement {
+	@api recordId;
+	IsLoading = true;
+	Old_Repair_Name;
+
+	@wire(CurrentPageReference)
+     getStateParameters(currentPageReference) {
+             console.log(111);
+             console.log(currentPageReference);
+
+         if (currentPageReference) {
+           const urlValue = currentPageReference.state.recordId;
+           if (urlValue) {
+             let str = `${urlValue}`;
+             console.log("str");
+             console.log(str);
+             this.recordId = str;
+           }
+         }
+    }
+
+
+    connectedCallback(){
+		console.log(this.recordId);
+		init({recordId:this.recordId}).then(result=>{
+			console.log(result);
+			if(result!=null){
+				if (result.id!=null) {
+					var boolday=confirm('璇风‘璁ゆ浠舵槸鍚﹀睘浜�10澶╁唴閲嶅鎶ュ憡锛屽鏋滄槸锛岃浣跨敤鍘烸IS閲岀殑澶嶅埗鍔熻兘閲嶆柊鎻愪氦銆�');
+					if(!boolday){
+						return;
+					} 
+				}
+				if (result.repId!=null) {
+					var boolday=confirm('璇风‘璁ゆ浠舵槸鍚﹀睘浜�10澶╁唴閲嶅鎶ュ憡锛屽鏋滄槸锛岄渶鎸夌収鍘熷厛鐨勭淮淇俊鎭~鍐欍��');
+					if(!boolday){
+						return;
+					}
+				}
+				
+			}
+		}).catch(err=>{
+			console.log("error:");
+			console.log(err);
+		}).finally(()=>{
+
+		});
+	}
+
+
+}
\ No newline at end of file

--
Gitblit v1.9.1