From 9632f91c30db677b51b5c0ce6684c30e64fcab8c Mon Sep 17 00:00:00 2001
From: unknown <sunxia@prec-tech.com>
Date: 星期四, 06 七月 2023 11:41:56 +0800
Subject: [PATCH] 上传试用表和回寄单

---
 force-app/main/default/lwc/lexReturnDeliverySlipConsumApply/lexReturnDeliverySlipConsumApply.js-meta.xml |   11 +++++
 force-app/main/default/lwc/lexReturnDeliverySlipConsumApply/lexReturnDeliverySlipConsumApply.html        |    3 +
 force-app/main/default/lwc/lexReturnDeliverySlipConsumApply/lexReturnDeliverySlipConsumApply.js          |   50 +++++++++++++++++++++++++
 3 files changed, 64 insertions(+), 0 deletions(-)

diff --git a/force-app/main/default/lwc/lexReturnDeliverySlipConsumApply/lexReturnDeliverySlipConsumApply.html b/force-app/main/default/lwc/lexReturnDeliverySlipConsumApply/lexReturnDeliverySlipConsumApply.html
new file mode 100644
index 0000000..af9fa97
--- /dev/null
+++ b/force-app/main/default/lwc/lexReturnDeliverySlipConsumApply/lexReturnDeliverySlipConsumApply.html
@@ -0,0 +1,3 @@
+<template>
+
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexReturnDeliverySlipConsumApply/lexReturnDeliverySlipConsumApply.js b/force-app/main/default/lwc/lexReturnDeliverySlipConsumApply/lexReturnDeliverySlipConsumApply.js
new file mode 100644
index 0000000..e2bf008
--- /dev/null
+++ b/force-app/main/default/lwc/lexReturnDeliverySlipConsumApply/lexReturnDeliverySlipConsumApply.js
@@ -0,0 +1,50 @@
+import { LightningElement, track, wire, api } from 'lwc';
+import { CurrentPageReference,NavigationMixin } from 'lightning/navigation';
+import { ShowToastEvent } from 'lightning/platformShowToastEvent';
+import { CloseActionScreenEvent } from 'lightning/actions';
+import init from '@salesforce/apex/lexReturnDeliveryController.init';
+
+export default class lexReturnDeliverySlipConsumApply extends LightningElement {
+	@api recordId;
+
+	@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(res=>{
+			if(!res.flag){
+				this.showToast('鏈畬鎴愬埌璐х‘璁ゆ垨澶囧搧涓績鏈‘璁や笉鑳戒笂浼犺瘯鐢ㄨ〃','warning');
+				return;
+			}
+			if(res.size > 0){
+				window.open("/apex/consumTrialConfirm?id=" + this.recordId); 
+			}
+		})
+	}
+
+	showToast(msg,type) {
+        const event = new ShowToastEvent({
+            message: msg,
+            variant: type
+        });
+        if(type == 'success'){
+            this.updateRecordView(this.recordId);
+        }
+        this.dispatchEvent(event);
+        this.dispatchEvent(new CloseActionScreenEvent());
+    }
+
+    updateRecordView(recordId) {
+        updateRecord({fields: { Id: recordId }});
+    }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexReturnDeliverySlipConsumApply/lexReturnDeliverySlipConsumApply.js-meta.xml b/force-app/main/default/lwc/lexReturnDeliverySlipConsumApply/lexReturnDeliverySlipConsumApply.js-meta.xml
new file mode 100644
index 0000000..e76c6b2
--- /dev/null
+++ b/force-app/main/default/lwc/lexReturnDeliverySlipConsumApply/lexReturnDeliverySlipConsumApply.js-meta.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexReturnDeliverySlipConsumApply">
+    <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