From 49a9ae5ad6999c280e4a010a7b2d6161fa860a20 Mon Sep 17 00:00:00 2001
From: unknown <sunxia@prec-tech.com>
Date: 星期四, 04 五月 2023 11:06:05 +0800
Subject: [PATCH] 同行报告书-按钮

---
 force-app/main/default/lwc/lexVisitReportCancel/lexVisitReportCancel.html        |    5 ++
 force-app/main/default/lwc/lexVisitReportCancel/lexVisitReportCancel.js          |   51 +++++++++++++++++++++++++
 force-app/main/default/lwc/lexVisitReportCancel/lexVisitReportCancel.js-meta.xml |   11 +++++
 force-app/main/default/lwc/lexVisitReportCancel/lexVisitReportCancel.css         |   22 +++++++++++
 4 files changed, 89 insertions(+), 0 deletions(-)

diff --git a/force-app/main/default/lwc/lexVisitReportCancel/lexVisitReportCancel.css b/force-app/main/default/lwc/lexVisitReportCancel/lexVisitReportCancel.css
new file mode 100644
index 0000000..635bc6c
--- /dev/null
+++ b/force-app/main/default/lwc/lexVisitReportCancel/lexVisitReportCancel.css
@@ -0,0 +1,22 @@
+.outerBorderCss{
+    border: 1px solid #D4D4D4;
+    border-radius : 5px;
+    border-top : 3px solid #565959;
+}
+.borderCss{
+    border: 1px solid #D4D4D4;
+    border-radius : 5px;
+    margin-bottom : 7px;
+    border-top : 3px solid #565959;
+}
+.headerDorderCss{
+    border-top: 1px solid #565959;
+    border-bottom: 1px solid #D4D4D4;
+    padding:3px;
+}
+.centerCss{
+    text-align: center;
+}
+.centerCss .left{
+    margin-left: 100px;
+}/* sample css file */
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexVisitReportCancel/lexVisitReportCancel.html b/force-app/main/default/lwc/lexVisitReportCancel/lexVisitReportCancel.html
new file mode 100644
index 0000000..49a10f7
--- /dev/null
+++ b/force-app/main/default/lwc/lexVisitReportCancel/lexVisitReportCancel.html
@@ -0,0 +1,5 @@
+<template>
+    <div class="sisToOPDHolder" if:true={IsLoading}>
+        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
+    </div>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexVisitReportCancel/lexVisitReportCancel.js b/force-app/main/default/lwc/lexVisitReportCancel/lexVisitReportCancel.js
new file mode 100644
index 0000000..a063b72
--- /dev/null
+++ b/force-app/main/default/lwc/lexVisitReportCancel/lexVisitReportCancel.js
@@ -0,0 +1,51 @@
+import { LightningElement, track, wire, api } from 'lwc';
+import { CurrentPageReference,NavigationMixin } from 'lightning/navigation';
+import { CloseActionScreenEvent } from 'lightning/actions';
+import { updateRecord } from 'lightning/uiRecordApi';
+
+import init from '@salesforce/apex/lexVisitReportCancelController.init';
+export default class lexVisitReportCancel extends LightningElement {
+	@api recordId;
+    IsLoading = true;
+
+    @wire(CurrentPageReference)
+     getStateParameters(currentPageReference) {
+        console.log(currentPageReference,'666666666666');
+         if (currentPageReference) {
+           const urlValue = currentPageReference.state.recordId;
+           if (urlValue) {
+             let str = `${urlValue}`;
+             console.log("str:"+str);
+             this.recordId = str;
+           }
+         }
+     }
+
+	connectedCallback(){
+		init({
+			recordId:this.recordId
+		}).then(res=>{
+			if(res == '鍙栨秷鎴愬姛'){
+				this.showToast('鍙栨秷鎴愬姛','success');
+			}else{
+				this.showToast(res,'warning');
+			}
+		})
+	}
+
+	updateRecordView() {
+        updateRecord({fields: { Id: this.recordId }});
+    }
+
+	showToast(msg,type) {
+        const event = new ShowToastEvent({
+            message: msg,
+            variant: type
+        });
+        if(type == 'success'){
+            this.updateRecordView();
+        }
+        this.dispatchEvent(event);
+        this.dispatchEvent(new CloseActionScreenEvent());
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexVisitReportCancel/lexVisitReportCancel.js-meta.xml b/force-app/main/default/lwc/lexVisitReportCancel/lexVisitReportCancel.js-meta.xml
new file mode 100644
index 0000000..74849f3
--- /dev/null
+++ b/force-app/main/default/lwc/lexVisitReportCancel/lexVisitReportCancel.js-meta.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexOCMSubmit">
+    <apiVersion>54.0</apiVersion>
+    <isExposed>true</isExposed>
+    <targets>
+        <target>lightning__RecordPage</target>
+        <target>lightning__AppPage</target>
+        <target>lightning__HomePage</target>
+        <target>lightning__RecordAction</target>
+    </targets>
+</LightningComponentBundle>
\ No newline at end of file

--
Gitblit v1.9.1