buli
2023-05-23 07390e2fcb4adf27c928335bf27ae7939c5a80ad
force-app/main/default/lwc/lexEquipmentSetRental_Order/lexEquipmentSetRental_Order.js
@@ -3,6 +3,19 @@
import AssignBtn  from '@salesforce/apex/RentalApplyWebService.AssignBtn';
import {CurrentPageReference} from 'lightning/navigation';
import { CloseActionScreenEvent } from 'lightning/actions';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
const event1 = new ShowToastEvent({
            title: '请检查申请状态',
            message:
                '不能引当,请确认申请的状态',
              });
const event2 = new ShowToastEvent({
            title: 'Get Help',
            message:
                '方法错误,请联系管理员',
              });
export default class lexEquipmentSetRental_Order extends LightningElement {
    @api recordId;
@@ -10,19 +23,19 @@
    Rental_Apply__c;
   @wire(CurrentPageReference)
    getStateParameters(currentPageReference){
       if(currentPageReference){
          console.log(currentPageReference);
          console.log("进入获取page参数")
          const IdValue=currentPageReference.state.recordId;
          if(IdValue){
             let str=`${IdValue}`;
             this.recordId=str;
             console.log("recordId="+str);
          }
       }
    }
   // @wire(CurrentPageReference)
 //    getStateParameters(currentPageReference){
 //       if(currentPageReference){
 //          console.log(currentPageReference);
 //          console.log("进入获取page参数")
 //          const IdValue=currentPageReference.state.recordId;
 //          if(IdValue){
 //             let str=`${IdValue}`;
 //             this.recordId=str;
 //             console.log("recordId="+str);
 //          }
 //       }
 //    }
    connectedCallback(){
@@ -60,7 +73,7 @@
         this.Rental_Apply__c.demo_purpose2__c == '培训中心'
         )
         && this.Rental_Apply__c.Status__c == '草案中') {
         alert("不能引当,请确认申请的状态");
         this.dispatchEvent(event1);
      } else if(
         (this.Rental_Apply__c.demo_purpose2__c == '试用(无询价)' ||
         this.Rental_Apply__c.demo_purpose2__c == '试用(有询价)' || 
@@ -72,11 +85,11 @@
         && this.Rental_Apply__c.Status__c != '批准完了'
         && this.Rental_Apply__c.Status__c != '引当完了'
         && this.Rental_Apply__c.Status__c != '出库指示完了') {
            alert("不能引当,请确认申请的状态");
            this.dispatchEvent(event1);
      } else if(rtn == 'Fin') {
         window.open("/apex/EquipmentRentalApply?raid="+URLENCODE(this.Rental_Apply__c.Id));
      } else{
         alert(rtn);
         this.dispatchEvent(event2);
      }     
    }