KKbes
2023-08-07 890eafcf31f5f8d519bb9e6f9c15303be5328e2d
force-app/main/default/lwc/lexExistingInquiry/lexExistingInquiry.js
@@ -1,5 +1,4 @@
//author : kk   
//self  review  更新失败返回的错误信息没有之前class的好。给出的都是意义不明的报错
import { LightningElement, track, wire , api  } from 'lwc';
@@ -74,11 +73,9 @@
     connectedCallback(){
        console.log(this.recordId);
        init({
            recordId: this.recordId
        }).then(result => {
            console.log(result);
            if (result != null) {
                this.Task = result;
                this.ExistingInquiry().then(result=>{
@@ -86,9 +83,6 @@
                    this.dispatchEvent(new CloseActionScreenEvent());
                });
            }
        }).catch(error => {
            console.log("error");
            console.log(error);
        });
    }
@@ -112,13 +106,10 @@
                    await getQuoteIrai({QuoteIraiId : this.Task.QuoteIraiId__c
                    }).then(res=>{
                        this.NewTask=res;
                    }).catch(err=>{
                        console.log("err:",err.message);
                    });
                    if(this.NewTask.Lead__c){
                         // Lead作成并更
                        await makeAndUpdateLead({ Lead_c : this.Opportunity.Lead__c, Id : this.NewTask.Id,
                        await makeAndUpdateLead({ Lead_c : this.Opportunity.Id, Id : this.NewTask.Lead__c,
                               QuoteIraiId__c : this.Task.QuoteIraiId__c
                        }).then(res=>{
                            if(res !='success'){
@@ -135,7 +126,7 @@
                            return;
                        }
                        // 判断报价委托
                            if( this.Task.QuoteIraiId__c != '') {
                            if( this.Task.QuoteIraiId__c != '' && this.Task.QuoteIraiId__c!=undefined) {
                                // 报价委托作成
                                await makeAndUpdateQuoteIrai({ QuoteIraiStatus : "已有询价", Id : this.Task.QuoteIraiId__c 
                                }).then(res=>{