zhangqian
2023-07-31 ca743be68ec263a6d9d6c70410f894ed2bb1d293
force-app/main/default/lwc/lexConsumApply_FromOPDPlan/lexConsumApply_FromOPDPlan.js
@@ -7,7 +7,8 @@
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils';
export default class LexConsumApply_FromOPDPlan extends LightningElement {
// 新建耗材申请(OPD计划)
export default class LexConsumApply_FromOPDPlan extends NavigationMixin(LightningElement) {
    @api recordId;
    IsLoading = true;
@@ -33,8 +34,9 @@
            recordId: this.recordId
        }).then(result=>{
            UserInfo_Owner({}).then(res=>{
                if(res.isFormalStuff == 'true'){
                    this.showToast('试用期内,不能申请','warning');
                console.log("-----UserInfo_Owner--",res)
                if(res.isFormalStuff){
                    this.showToast('试用期内,不能申请','error');
                    return;
                }else{
    
@@ -57,10 +59,10 @@
                        Account__c:result.accountLab,
                        Name:'*',
                        demo_purpose2__c:'OPD试用',
                        Person_In_Charge__c:res.lastName + res.firstName,
                        applyUser__c:res.lastName + res.firstName
                        Person_In_Charge__c:res.id,
                        applyUser__c:res.id
                    });
                    console.log("defaultValues====> ",defaultValues);
                    this[NavigationMixin.Navigate]({
                        type: 'standard__objectPage',
                        attributes: {
@@ -68,19 +70,18 @@
                            actionName: 'new'
                        },
                        state:{
                            defaultFieldValues: this.defaultValues
                            defaultFieldValues: defaultValues
                        }
                    })
                    });
                }
            })
            .catch(error => {
                console.log("error");
                console.log(error);
                console.log("error ---> ",error);
            })
        })
        .catch(error => {
            console.log("error");
            console.log("error----");
            console.log(error);
        }).finally(() => {
            this.dispatchEvent(new CloseActionScreenEvent());
@@ -94,6 +95,7 @@
            variant: type
        });
        this.dispatchEvent(evt);
        this.dispatchEvent(new CloseActionScreenEvent());
    }
}