unknown
2023-07-06 2b6d9d2fe87c2e31cd29da024717ab5b10104787
排队NO.置顶

排队NO.置顶 备品借出申请 更新
2个文件已修改
39 ■■■■■ 已修改文件
force-app/main/default/lwc/lexTopInQueue/lexTopInQueue.html 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexTopInQueue/lexTopInQueue.js 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexTopInQueue/lexTopInQueue.html
@@ -1,5 +1,2 @@
<template>
    <div class="sisToOPDHolder" if:true={IsLoading}>
        <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
    </div>
</template>
force-app/main/default/lwc/lexTopInQueue/lexTopInQueue.js
@@ -3,6 +3,7 @@
import { CloseActionScreenEvent } from 'lightning/actions';
import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import { updateRecord } from 'lightning/uiRecordApi';
import queueTop from '@salesforce/apex/ApplyJsCtl.queueTop';
export default class lexTopInQueue extends LightningElement {
@@ -25,25 +26,32 @@
        queueTop({
            applyId: this.recordId
        }).then(res=>{
            this.IsLoading = false;
            if(res == 'Success'){
                const evt = new ShowToastEvent({
                        title : '置顶成功',
                        message: '',
                        variant: 'success'
                    });
                this.dispatchEvent(evt);
                this.dispatchEvent(new CloseActionScreenEvent());
                this.showToast('置顶成功','success');
                return;
            }else{
                const evterr = new ShowToastEvent({
                        title : res,
                        message: '',
                        variant: 'error'
                    });
                this.dispatchEvent(evterr);
                this.dispatchEvent(new CloseActionScreenEvent());
                this.showToast(res,'error');
                return;
            }
        }).catch(err=>{
            this.dispatchEvent(new CloseActionScreenEvent());
        })
    }
    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 }});
    }
}