From 87861ae5f1ed5456685f97f8a8e7625e47b9576d Mon Sep 17 00:00:00 2001
From: KKbes <1620284052@qq.com>
Date: 星期四, 13 四月 2023 11:12:26 +0800
Subject: [PATCH] Merge branch 'LEX_dev' of http://47.92.229.245:8089/r/lightningupdate into LEX_dev

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

diff --git a/force-app/main/default/lwc/lexCopyPIInspectionReport/lexCopyPIInspectionReport.js b/force-app/main/default/lwc/lexCopyPIInspectionReport/lexCopyPIInspectionReport.js
new file mode 100644
index 0000000..44d87fb
--- /dev/null
+++ b/force-app/main/default/lwc/lexCopyPIInspectionReport/lexCopyPIInspectionReport.js
@@ -0,0 +1,57 @@
+import {
+    LightningElement,
+    wire,
+    api
+} from 'lwc';
+import {
+    CurrentPageReference
+} from "lightning/navigation";
+import {
+    CloseActionScreenEvent
+} from 'lightning/actions';
+
+import init from '@salesforce/apex/otherButtonSpotInspectionReportCtl.init';
+
+export default class LexCopyPIInspectionReport extends LightningElement {
+    @api recordId;
+    str;
+    IsLoading = true;
+    Id;
+    RecordTypeId;
+
+    @wire(CurrentPageReference)
+    getStateParameters(currentPageReference) {
+        if (currentPageReference) {
+            const urlValue = currentPageReference.state.recordId;
+            if (urlValue) {
+                let str = `${urlValue}`;
+                this.recordId = str;
+            }
+        }
+    }
+
+    connectedCallback() {
+        init({
+            recordId: this.recordId
+        }).then(result => {
+            console.log(result);
+            if (result != null) {
+                this.IsLoading = false;
+                this.Id = result.Id;
+                this.RecordTypeId = result.RecordTypeId;
+
+                this.CopyPI();
+                this.dispatchEvent(new CloseActionScreenEvent());
+            }
+        }).catch(error => {
+            console.log(error);
+        }).finally(() => {
+
+        });
+    }
+
+    // 澶嶅埗
+    CopyPI() {
+        window.location.href = '/' + this.Id + '/e?newclone=1';
+    }
+}
\ No newline at end of file

--
Gitblit v1.9.1