liwentao
2023-05-17 f7cd56053c85587fb734f1b63280071e767b16e1
借出备品配套一览_列表按钮:取消
2个文件已修改
76 ■■■■ 已修改文件
force-app/main/default/lwc/lexCancelSelect/lexCancelSelect.js 40 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCancelSelect/lexCancelSelect.js-meta.xml 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexCancelSelect/lexCancelSelect.js
@@ -9,45 +9,17 @@
    id;
    RentalApplyId;
    Status;
    @wire(CurrentPageReference)
    getStateParameters(currentPageReference){
        console.log("进入页面");
        console.log(currentPageReference);
        if(currentPageReference){
            const urvalue=currentPageReference.state.recordId;
            if(urvalue){
                let str=`${urvalue}`;
                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.id=result.id;
                this.RentalApplyId=result.RentalApplyId;
                this.Status=result.Status;
                this.cancelSubmit().then(res=>{
                    this.IsLoading=false;
                    this.dispatchEvent(new CloseActionScreenEvent());
                });
            }
        }).catch(err=>{
            console.log("error:");
            console.log(err);
        }).finally(()=>{
        });
        window.open("/apex/EquipmentRentalCancel?raid="+this.recordId,'cancelSelect','width=500,height=250');
        this.closeAction();
    }
    async cancelSubmit(){
        window.open("/apex/EquipmentRentalCancel?raid="+this.RentalApplyId,'cancelSelect','width=500,height=250');
    closeAction() {
        //返回当前的备品申请
        window.open("/"+this.recordId,'_self');
    }
}
force-app/main/default/lwc/lexCancelSelect/lexCancelSelect.js-meta.xml
@@ -2,10 +2,34 @@
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexCancelSelect">
    <apiVersion>51.0</apiVersion>
    <isExposed>true</isExposed>    
    <targets>
        <target>lightning__AppPage</target>
        <target>lightning__RecordPage</target>
        <target>lightning__HomePage</target>
        <target>lightning__RecordAction</target>
    </targets>
    <targets>
        <target>lightning__AppPage</target>
        <target>lightning__RecordPage</target>
        <target>lightning__HomePage</target>
        <target>lightning__RecordAction</target>
        <!-- 屏幕流配置 -->
        <target>lightning__FlowScreen</target>
    </targets>
    <!-- 定义变量 -->
    <targetConfigs>
        <targetConfig targets="lightning__FlowScreen">
            <!-- name js中使用的变量,从屏幕流中获取参数  label 在屏幕流的该LWC的设置中显示 -->
            <property name="recordId" type="String" label="recordId"/>
        </targetConfig>
    </targetConfigs>
</LightningComponentBundle>