zhangqian
2023-07-19 04a2d035b87a9aa8836ef84705aec1b3415b1671
试用表按钮

1
3个文件已添加
66 ■■■■■ 已修改文件
force-app/main/default/lwc/lexConsumTrialPDF/lexConsumTrialPDF.html 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexConsumTrialPDF/lexConsumTrialPDF.js 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexConsumTrialPDF/lexConsumTrialPDF.js-meta.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexConsumTrialPDF/lexConsumTrialPDF.html
New file
@@ -0,0 +1,5 @@
<template>
    <div class="dispatchOCSMQARAHolder" if:true={IsLoading}>
        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
    </div>
</template>
force-app/main/default/lwc/lexConsumTrialPDF/lexConsumTrialPDF.js
New file
@@ -0,0 +1,50 @@
import { LightningElement,wire,track,api} from 'lwc';
import { CurrentPageReference, NavigationMixin} from "lightning/navigation";
import { CloseActionScreenEvent } from 'lightning/actions';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
// 耗材 试用表
export default class LexConsumTrialPDF 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(){
        this.IsLoading = false;
        console.log("pdf---",this.recordId,this.IsLoading);
        if(this.recordId){
            window.open('/apex/ConsumTrialPDF?id='+this.recordId);
        }
        setTimeout(()=>{
            this.dispatchEvent(new CloseActionScreenEvent());
        })
    }
    showToast(message, type) {
        const evt = new ShowToastEvent({
            // title: '',
            message: message,
            variant: type
        });
        this.dispatchEvent(evt);
        this.dispatchEvent(new CloseActionScreenEvent());
    }
}
force-app/main/default/lwc/lexConsumTrialPDF/lexConsumTrialPDF.js-meta.xml
New file
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>56.0</apiVersion>
    <isExposed>true</isExposed>
    <targets>
        <target>lightning__AppPage</target>
        <target>lightning__RecordPage</target>
        <target>lightning__HomePage</target>
        <target>lightning__RecordAction</target>
    </targets>
</LightningComponentBundle>