unknown
2023-08-23 8749760be3e1ba64edd4ada506bdf628e5bee852
force-app/main/default/lwc/lexSCSubmit/lexSCSubmit.js
@@ -14,6 +14,7 @@
import {
    ShowToastEvent
} from 'lightning/platformShowToastEvent';
import LightningConfirm from 'lightning/confirm';
export default class LexSCSubmit extends LightningElement {
    @api recordId;
@@ -39,12 +40,10 @@
        }).then(result => {
            console.log(result);
            if (result != null) {
                this.IsLoading = false;
                this.Id = result.Id;
                this.StatusC = result.StatusC;
                this.SCSubmit();
                this.dispatchEvent(new CloseActionScreenEvent());
            }
        }).catch(error => {
            console.log(error);
@@ -54,26 +53,12 @@
    // 提交待审批
    SCSubmit() {
        if (this.StatusC != '草案中') {
            this.ShowToastEvent("已经提交审批", "error")
            this.ShowToastEvent("已经提交审批", "error");
            this.dispatchEvent(new CloseActionScreenEvent());
            return;
        }
        if (!confirm("一旦OCM提交此记录以待批准,根据您的设置您可能不再能够编辑此记录或将他从批准过程中调回。是否继续?")) {
            return;
        }
        updateQISSCReport({
            QId: this.Id
        }).then(result => {
            console.log(result);
            if (result.length > 0) {
                var split = result.split(", ");
                alert(split[1]);
            } else {
                this.ShowToastEvent("已提交", "success")
                window.location.reload();
            }
        })
        this.handleConfirmClick("一旦OCM提交此记录以待批准,根据您的设置您可能不再能够编辑此记录或将他从批准过程中调回。是否继续?");
    }
    ShowToastEvent(msg, type) {
@@ -84,4 +69,30 @@
        });
        this.dispatchEvent(event);
    }
    async handleConfirmClick(msg) {
        const result = await LightningConfirm.open({
            message: msg,
            variant: 'headerless',
            label: 'this is the aria-label value'
        });
        if(result){
            updateQISSCReport({
                QId: this.Id
            }).then(result => {
                console.log(result);
                if (result.length > 0) {
                    var split = result.split(", ");
                    this.ShowToastEvent(split[1], "error");
                    this.dispatchEvent(new CloseActionScreenEvent());
                } else {
                    this.ShowToastEvent("已提交", "success")
                    window.location.reload();
                }
            })
        }else{
            this.dispatchEvent(new CloseActionScreenEvent());
        }
    }
}