From f9d0e4f847dc2dcbdf6e1c427ea9d9fab697c987 Mon Sep 17 00:00:00 2001
From: 19626 <1962676589@qq.com>
Date: 星期五, 07 四月 2023 08:55:37 +0800
Subject: [PATCH] 修改按钮4.7

---
 force-app/main/default/lwc/lexASACEditor/lexASACEditor.js-meta.xml                 |   11 +
 force-app/main/default/lwc/lexASRCEditor/lexASRCEditor.css                         |   10 +
 force-app/main/default/lwc/lexASACEditor/lexASACEditor.js                          |   73 ++++++++++
 force-app/main/default/lwc/lexCancelSubmitReport/lexCancelSubmitReport.css         |   10 +
 force-app/main/default/lwc/lexCancelSubmitReport/lexCancelSubmitReport.js          |   57 ++++++++
 force-app/main/default/lwc/lexVOCConfirm/lexVOCConfirm.css                         |   10 +
 force-app/main/default/lwc/lexVOCConfirm/lexVOCConfirm.html                        |    6 
 force-app/main/default/lwc/lexCancelSubmitReport/lexCancelSubmitReport.js-meta.xml |   11 +
 force-app/main/default/lwc/lexASACEditor/lexASACEditor.html                        |    5 
 force-app/main/default/lwc/lexASACEditor/lexASACEditor.css                         |   10 +
 force-app/main/default/lwc/lexASRCEditor/lexASRCEditor.js                          |   74 ++++++++++
 force-app/main/default/lwc/lexVOCConfirm/lexVOCConfirm.js-meta.xml                 |   11 +
 force-app/main/default/lwc/lexVOCConfirm/lexVOCConfirm.js                          |   96 +++++++++++++
 force-app/main/default/lwc/lexCancelSubmitReport/lexCancelSubmitReport.html        |    6 
 force-app/main/default/lwc/lexASRCEditor/lexASRCEditor.js-meta.xml                 |   11 +
 force-app/main/default/lwc/lexASRCEditor/lexASRCEditor.html                        |    5 
 16 files changed, 406 insertions(+), 0 deletions(-)

diff --git a/force-app/main/default/lwc/lexASACEditor/lexASACEditor.css b/force-app/main/default/lwc/lexASACEditor/lexASACEditor.css
new file mode 100644
index 0000000..689c97d
--- /dev/null
+++ b/force-app/main/default/lwc/lexASACEditor/lexASACEditor.css
@@ -0,0 +1,10 @@
+.inASACEditorHolder{
+    position: relative;
+    display: inline-block;
+    width: 80px;
+    height: 80px;
+    text-align: center;
+}
+.container .uiContainerManager{
+	display: none !important;
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexASACEditor/lexASACEditor.html b/force-app/main/default/lwc/lexASACEditor/lexASACEditor.html
new file mode 100644
index 0000000..19263b7
--- /dev/null
+++ b/force-app/main/default/lwc/lexASACEditor/lexASACEditor.html
@@ -0,0 +1,5 @@
+<template>
+    <div class="inASACEditorHolder" 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/lexASACEditor/lexASACEditor.js b/force-app/main/default/lwc/lexASACEditor/lexASACEditor.js
new file mode 100644
index 0000000..a40f487
--- /dev/null
+++ b/force-app/main/default/lwc/lexASACEditor/lexASACEditor.js
@@ -0,0 +1,73 @@
+import { LightningElement,wire,track,api} from 'lwc';
+import { CurrentPageReference } from "lightning/navigation";
+import { CloseActionScreenEvent } from 'lightning/actions';
+import init  from '@salesforce/apex/ReportController.initForASACEditorButton';
+export default class LexASACEditor extends LightningElement {
+    @api recordId;
+    LastModifiedDate
+    Id
+    Name
+    LastModifiedById
+    DeveloperName
+    IsLoading = true;
+    url;
+    @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 != undefined) {
+                console.log("if");
+                this.LastModifiedById = result.LastModifiedById;
+                this.LastModifiedDate = result.LastModifiedDate;
+                this.Id = result.Id;
+                this.Name = result.Name;
+                this.DeveloperName = result.DeveloperName;
+                console.log(this.Id);
+                this.editor();
+                this.dispatchEvent(new CloseActionScreenEvent());
+                //window.location.replace("https://ocsm--partial.sandbox.lightning.force.com/lightning/r/Report__c/" + this.recordId + "/view");
+            }else{
+                console.log("else");
+                this.IsLoading = false;
+                this.editor();
+                this.dispatchEvent(new CloseActionScreenEvent());
+            }
+        }).catch(error => {
+            console.log("error");
+            console.log(error);
+        }).finally(() => {
+            
+        });   
+        //this.updateRecordView(this.recordId);
+
+    }
+
+    editor(){
+        if (this.Id != undefined){
+            this.url = "/apex/RepPAEDecisionRecord?Id="+this.Id+"&ReportId="+this.recordId+"&RecordTypeIds="+"ASACDecision";
+            console.log(this.url);
+            } else {
+            this.url = "/apex/RepPAEDecisionRecord?ReportId="+this.recordId+"&RecordTypeIds="+"ASACDecision";
+            console.log(this.url);
+            }
+        window.open(this.url,"_self");
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexASACEditor/lexASACEditor.js-meta.xml b/force-app/main/default/lwc/lexASACEditor/lexASACEditor.js-meta.xml
new file mode 100644
index 0000000..952a036
--- /dev/null
+++ b/force-app/main/default/lwc/lexASACEditor/lexASACEditor.js-meta.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
+   <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
diff --git a/force-app/main/default/lwc/lexASRCEditor/lexASRCEditor.css b/force-app/main/default/lwc/lexASRCEditor/lexASRCEditor.css
new file mode 100644
index 0000000..5cd9c5d
--- /dev/null
+++ b/force-app/main/default/lwc/lexASRCEditor/lexASRCEditor.css
@@ -0,0 +1,10 @@
+.inASRCEditorHolder{
+    position: relative;
+    display: inline-block;
+    width: 80px;
+    height: 80px;
+    text-align: center;
+}
+.container .uiContainerManager{
+	display: none !important;
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexASRCEditor/lexASRCEditor.html b/force-app/main/default/lwc/lexASRCEditor/lexASRCEditor.html
new file mode 100644
index 0000000..79f5b93
--- /dev/null
+++ b/force-app/main/default/lwc/lexASRCEditor/lexASRCEditor.html
@@ -0,0 +1,5 @@
+<template>
+    <div class="inASRCEditorHolder" 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/lexASRCEditor/lexASRCEditor.js b/force-app/main/default/lwc/lexASRCEditor/lexASRCEditor.js
new file mode 100644
index 0000000..982af66
--- /dev/null
+++ b/force-app/main/default/lwc/lexASRCEditor/lexASRCEditor.js
@@ -0,0 +1,74 @@
+import { LightningElement,wire,track,api} from 'lwc';
+import { CurrentPageReference } from "lightning/navigation";
+import { CloseActionScreenEvent } from 'lightning/actions';
+import init  from '@salesforce/apex/ReportController.initForASRCEditorButton';
+
+export default class LexASRCEditor extends LightningElement {
+    @api recordId;
+    LastModifiedDate
+    Id
+    Name
+    LastModifiedById
+    DeveloperName
+    IsLoading = true;
+    url;
+    @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 != undefined) {
+                console.log("if");
+                this.LastModifiedById = result.LastModifiedById;
+                this.LastModifiedDate = result.LastModifiedDate;
+                this.Id = result.Id;
+                this.Name = result.Name;
+                this.DeveloperName = result.DeveloperName;
+                console.log(this.Id);
+                this.editor();
+                this.dispatchEvent(new CloseActionScreenEvent());
+                //window.location.replace("https://ocsm--partial.sandbox.lightning.force.com/lightning/r/Report__c/" + this.recordId + "/view");
+            }else{
+                console.log("else");
+                this.IsLoading = false;
+                this.editor();
+                this.dispatchEvent(new CloseActionScreenEvent());
+            }
+        }).catch(error => {
+            console.log("error");
+            console.log(error);
+        }).finally(() => {
+            
+        });   
+        //this.updateRecordView(this.recordId);
+
+    }
+
+    editor(){
+        if (this.Id != undefined){
+            this.url = "/apex/RepPAEDecisionRecord?Id="+this.Id+"&ReportId="+this.recordId+"&RecordTypeIds="+"ASRCDecision";
+            console.log(this.url);
+            } else {
+            this.url = "/apex/RepPAEDecisionRecord?ReportId="+this.recordId+"&RecordTypeIds="+"ASRCDecision";
+            console.log(this.url);
+            }
+        window.open(this.url,"_self");
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexASRCEditor/lexASRCEditor.js-meta.xml b/force-app/main/default/lwc/lexASRCEditor/lexASRCEditor.js-meta.xml
new file mode 100644
index 0000000..952a036
--- /dev/null
+++ b/force-app/main/default/lwc/lexASRCEditor/lexASRCEditor.js-meta.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
+   <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
diff --git a/force-app/main/default/lwc/lexCancelSubmitReport/lexCancelSubmitReport.css b/force-app/main/default/lwc/lexCancelSubmitReport/lexCancelSubmitReport.css
new file mode 100644
index 0000000..3e04b55
--- /dev/null
+++ b/force-app/main/default/lwc/lexCancelSubmitReport/lexCancelSubmitReport.css
@@ -0,0 +1,10 @@
+.cancelSubmitReportHolder{
+    position: relative;
+    display: inline-block;
+    width: 80px;
+    height: 80px;
+    text-align: center;
+}
+.container .uiContainerManager{
+	display: none !important;
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCancelSubmitReport/lexCancelSubmitReport.html b/force-app/main/default/lwc/lexCancelSubmitReport/lexCancelSubmitReport.html
new file mode 100644
index 0000000..6b80280
--- /dev/null
+++ b/force-app/main/default/lwc/lexCancelSubmitReport/lexCancelSubmitReport.html
@@ -0,0 +1,6 @@
+<template>
+    <div class="cancelSubmitReportHolder" if:true={IsLoading}>
+        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
+        <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button>
+    </div>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCancelSubmitReport/lexCancelSubmitReport.js b/force-app/main/default/lwc/lexCancelSubmitReport/lexCancelSubmitReport.js
new file mode 100644
index 0000000..5f4ce92
--- /dev/null
+++ b/force-app/main/default/lwc/lexCancelSubmitReport/lexCancelSubmitReport.js
@@ -0,0 +1,57 @@
+import { LightningElement,wire,track,api} from 'lwc';
+import { CurrentPageReference } from "lightning/navigation";
+import { CloseActionScreenEvent } from 'lightning/actions';
+import cancel  from '@salesforce/apex/ReportController.updateForCancelSubmitReportButton';
+import { updateRecord } from 'lightning/uiRecordApi';
+import { ShowToastEvent } from 'lightning/platformShowToastEvent';
+export default class LexCancelSubmitReport extends LightningElement {
+    @api recordId;
+    IsLoading = true;
+    @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);
+        this.cancelSubmit();
+    }
+
+
+    cancelSubmit(){
+        cancel({
+            recordId: this.recordId
+        }).then(result =>{
+            this.showToast("鍙栨秷鎻愪氦鎴愬姛锛�","success");
+            this.updateRecordView(this.recordId);
+            this.dispatchEvent(new CloseActionScreenEvent());
+        }).catch(error=>{
+            this.showToast(error,"error");
+        });
+    }
+
+    updateRecordView(recordId) {
+        updateRecord({fields: { Id: recordId }});
+    }
+
+
+    showToast(msg,type) {
+        const event = new ShowToastEvent({
+            title: '',
+            message: msg,
+            variant: type
+        });
+        this.dispatchEvent(event);
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexCancelSubmitReport/lexCancelSubmitReport.js-meta.xml b/force-app/main/default/lwc/lexCancelSubmitReport/lexCancelSubmitReport.js-meta.xml
new file mode 100644
index 0000000..329e839
--- /dev/null
+++ b/force-app/main/default/lwc/lexCancelSubmitReport/lexCancelSubmitReport.js-meta.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
+    <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
diff --git a/force-app/main/default/lwc/lexVOCConfirm/lexVOCConfirm.css b/force-app/main/default/lwc/lexVOCConfirm/lexVOCConfirm.css
new file mode 100644
index 0000000..68704c6
--- /dev/null
+++ b/force-app/main/default/lwc/lexVOCConfirm/lexVOCConfirm.css
@@ -0,0 +1,10 @@
+.confirmHolder{
+    position: relative;
+    display: inline-block;
+    width: 80px;
+    height: 80px;
+    text-align: center;
+}
+.container .uiContainerManager{
+	display: none !important;
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexVOCConfirm/lexVOCConfirm.html b/force-app/main/default/lwc/lexVOCConfirm/lexVOCConfirm.html
new file mode 100644
index 0000000..fd0bc74
--- /dev/null
+++ b/force-app/main/default/lwc/lexVOCConfirm/lexVOCConfirm.html
@@ -0,0 +1,6 @@
+<template>
+    <div class="confirmHolder" if:true={IsLoading}>
+        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
+        <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button>
+    </div>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexVOCConfirm/lexVOCConfirm.js b/force-app/main/default/lwc/lexVOCConfirm/lexVOCConfirm.js
new file mode 100644
index 0000000..e5625e4
--- /dev/null
+++ b/force-app/main/default/lwc/lexVOCConfirm/lexVOCConfirm.js
@@ -0,0 +1,96 @@
+import { LightningElement,wire,track,api} from 'lwc';
+import { CurrentPageReference } from "lightning/navigation";
+import { CloseActionScreenEvent } from 'lightning/actions';
+import { NavigationMixin } from 'lightning/navigation';
+import init  from '@salesforce/apex/ReportController.initForVOCConfirmButton';
+import  updateForVOCConfirmButton from '@salesforce/apex/ReportController.updateForVOCConfirmButton';
+import { updateRecord } from 'lightning/uiRecordApi';
+import { ShowToastEvent } from 'lightning/platformShowToastEvent';
+export default class LexVOCConfirm extends LightningElement {
+    @api recordId;
+    status;
+    VOCSatisfy;
+    VOCSatisfy1;
+    Isloading = true;
+    @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) {
+                this.Isloading = false;
+                this.status = result.status;
+                this.VOCSatisfy = result.Satisfy;
+                this.VOCSatisfy1 = result.Satisfy1;
+                console.log(this.VOCSatisfy);
+                console.log(this.VOCSatisfy1);
+                console.log(this.status);
+                this.update();
+            }
+        }).catch(error => {
+            console.log("error");
+            console.log(error);
+        }).finally(() => {
+            
+        });
+        //window.location.replace("https://ocsm--partial.sandbox.lightning.force.com/lightning/r/Report__c/" + this.recordId + "/view");
+        this.updateRecordView(this.recordId);
+    }
+
+    updateRecordView(recordId) {
+        updateRecord({fields: { Id: recordId }});
+    }
+
+    showToast(msg,type) {
+        const event = new ShowToastEvent({
+            title: '',
+            message: msg,
+            variant: type
+        });
+        this.dispatchEvent(event);
+    }
+
+
+    update(){
+        if (this.status != "宸插洖绛�") {
+            this.showToast("涓嶆槸宸插洖绛斾笉鑳界偣鍑�","error");
+            this.dispatchEvent(new CloseActionScreenEvent());
+            return;
+            }
+            if (this.VOCSatisfy == undefined) {
+            this.showToast("璇烽�夋嫨鏄惁婊℃剰","error");
+            this.dispatchEvent(new CloseActionScreenEvent());
+            return;
+            }
+        updateForVOCConfirmButton({
+            recordId: this.recordId,
+            Satisfy: this.VOCSatisfy,
+            Satisfy1: this.VOCSatisfy1    
+        }).then(result=>{
+            this.updateRecordView(this.recordId);
+            this.showToast("鎴愬姛","success");
+            this.dispatchEvent(new CloseActionScreenEvent());
+        });
+
+        
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexVOCConfirm/lexVOCConfirm.js-meta.xml b/force-app/main/default/lwc/lexVOCConfirm/lexVOCConfirm.js-meta.xml
new file mode 100644
index 0000000..8b2c3d6
--- /dev/null
+++ b/force-app/main/default/lwc/lexVOCConfirm/lexVOCConfirm.js-meta.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
+   <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