liangxiaozhen
2023-08-11 af908216bb0012fe849e3b49b3039c7ba238f8f0
force-app/main/default/lwc/lexStartTrading/lexStartTrading.js
@@ -7,7 +7,7 @@
import start  from '@salesforce/apex/StartTradingController2.start';
export default class LexStartTrading extends LightningElement {
export default class LexStartTrading extends NavigationMixin(LightningElement) {
    @api recordId;
    IsLoading=true;
   Hospital_Name__c;
@@ -65,17 +65,15 @@
            console.log('start result==========',result);
            if(result!=null){
               this.showToast('已成功转化询价','success');
               window.open('/lightning/r/Opportunity/'+result+'/view','_parent');
               // this[NavigationMixin.GenerateUrl]({
               //    type: "standard_recordPage",
               //    attributes: {
               //       recordId: result,
               //       objectApiName:"Opportunity",
               //       actionName:"edit"
               //    }
               // }).then(url => {
               //    window.open(url,"_blank");
               // });
               // window.open('/lightning/r/Opportunity/'+result+'/view','_parent');
               this[NavigationMixin.GenerateUrl]({
                  type: "standard__recordPage",
                  attributes: {
                     recordId: result,
                     objectApiName:"Opportunity",
                     actionName:"edit"
                  }
               })
            }
         });
         // .catch(err=>{
@@ -83,6 +81,7 @@
         //    console.log(err);
         // }).finally(()=>{});
      }
   }
   comparDate(dateValue) {
      return new Date().getTime() >= new Date(dateValue).getTime() + 3600 * 1000 * 24;
@@ -90,11 +89,11 @@
   showToast(msg,type) {
        const event = new ShowToastEvent({
            title: '',
            message: msg,
            variant: type
        });
      this.IsLoading = false;
      this.dispatchEvent(event);
      this.dispatchEvent(new CloseActionScreenEvent());
    }
}