unknown
2023-07-06 c176575f639ac3bf3e5eb5acec11bcdd9905572c
发送报告

发送报告 备品检测分析报告 按钮
4个文件已添加
101 ■■■■■ 已修改文件
force-app/main/default/lwc/lexSendReport/lexSendReport.css 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexSendReport/lexSendReport.html 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexSendReport/lexSendReport.js 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexSendReport/lexSendReport.js-meta.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexSendReport/lexSendReport.css
New file
@@ -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 */
force-app/main/default/lwc/lexSendReport/lexSendReport.html
New file
@@ -0,0 +1,2 @@
<template>
</template>
force-app/main/default/lwc/lexSendReport/lexSendReport.js
New file
@@ -0,0 +1,66 @@
import { LightningElement, track, wire, api } from 'lwc';
import { CloseActionScreenEvent } from 'lightning/actions';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import { CurrentPageReference } from 'lightning/navigation';
import init from '@salesforce/apex/RentalApplyFaultController.init';
import updateRentalApplyFaultStatus from '@salesforce/apex/RentalApplyFaultController.updateRentalApplyFaultStatus';
export default class lexSendReport extends LightningElement {
    @api recordId;
    IsLoading = true;
    @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=>{
            console.log('res==='+JSON.stringify(res));
            if(res.status__c!='草案中' && res.status__c!=''){
                this.showToast('只有草案中的检测分析报告才能发送报告','warning');
                return;
            }
            updateRentalApplyFaultStatus({
                recordId: this.recordId,
                updateStatus: '已发送'
            }).then(result=>{
                console.log('result==='+result);
                if(result=='SUCCESS'){
                    this.showToast('报告已发送','success');
                }else{
                    this.showToast(res.getMessage(),'error');
                }
            })
        }).catch(err=>{
            console.log('init=='+err);
        })
    }
    showToast(msg,type) {
        const event = new ShowToastEvent({
            message: msg,
            variant: type
        });
        if(type == 'success'){
            this.updateRecordView();
        }
        this.dispatchEvent(event);
        this.dispatchEvent(new CloseActionScreenEvent());
    }
    updateRecordView(recordId) {
        updateRecord({fields: { Id: recordId }});
    }
}
force-app/main/default/lwc/lexSendReport/lexSendReport.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" fqn="lexSendReport">
    <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>