zhangqian
2023-06-20 a541906d9d6510d493292fae704fe80cc5e8d0ce
force-app/main/default/lwc/lexEquipmentRentalApply_FromQIS2/lexEquipmentRentalApply_FromQIS2.js
@@ -1,8 +1,8 @@
import { LightningElement,wire,track,api} from 'lwc';
import { CurrentPageReference, NavigationMixin} from "lightning/navigation";
import { CloseActionScreenEvent } from 'lightning/actions';
import  init  from '@salesforce/apex/LexEquipmentRentalApply_FromQISCtl.rentalApp';
import  rentalApp  from '@salesforce/apex/LexEquipmentRentalApply_FromQISCtl.init';
import  rentalApp  from '@salesforce/apex/LexEquipmentRentalApply_FromQISCtl.rentalApp';
import  init  from '@salesforce/apex/LexEquipmentRentalApply_FromQISCtl.init';
import UserInfo_Owner from '@salesforce/apex/LexEquipmentRentalApply_FromQISCtl.UserInfo_Owner';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
@@ -33,7 +33,7 @@
        rentalApp({
            recordId: this.recordId
        }).then(result => {
            console.log('rentalApp============' + result);
            console.log('rentalApp============',result);
            if(result.lenth > 0){
                const evt = new ShowToastEvent({
                    title : 'Error',
@@ -47,22 +47,23 @@
                recordId: this.recordId
            }).then(result => {
                this.IsLoading = false;
                console.log('init============',result);
                if (result != null) {
                    if(result.nextAction=='送回'){
                        this.showToast('QIS对应方法为“送回”,不能申请','warning');
                        this.showToast('QIS对应方法为“送回”,不能申请','error');
                        return;
                    }
                    if(result.qISStatus=='草案中'){
                        this.showToast('QIS状态为草案中,不能申请','warning');
                        // this.msg =  'QIS状态为草案中,不能申请';
                        this.showToast('QIS状态为草案中,不能申请','error');
                        return;
                    }
                    if(result.qISStatus=='FSE填写完毕'){
                        this.showToast('QIS状态为FSE填写完毕,不能申请','warning');
                        this.showToast('QIS状态为FSE填写完毕,不能申请','error');
                        return;
                    }
                    if(result.qISStatus=='取消'){
                        this.showToast('QIS状态为取消,不能申请','warning');
                        this.showToast('QIS状态为取消,不能申请','error');
                        return;
                    }
                    // if('{!$User.isFormal_Stuff__c}'=='true'){
@@ -73,7 +74,7 @@
                    //     }
                    UserInfo_Owner({}).then(res=>{
                        if(res.isFormalStuff == 'true'){
                            this.showToast('试用期内,不能申请','warning');
                            this.showToast('试用期内,不能申请','error');
                            return;
                        }else{
                            const defaultValues = encodeDefaultFieldValues({
@@ -122,11 +123,12 @@
    showToast(message, type) {
        const evt = new ShowToastEvent({
            title: '',
            title: 'Error',
            message: message,
            variant: type
        });
        this.dispatchEvent(evt);
        this.dispatchEvent(new CloseActionScreenEvent());
    }
}