unknown
2023-08-23 50ce6a5e5ae7ac6ce3e6281acca9a0db568306e6
force-app/main/default/lwc/lexRentalFixtureSetAssign/lexRentalFixtureSetAssign.js
@@ -6,6 +6,9 @@
export default class lexRentalFixtureSetAssign extends LightningElement {
   @api recordId
   msg;
   IsLoading = true;
   IsShow = false;
   @wire(CurrentPageReference)
   getStateParameters(currentPageReference){
      console.log("进入页面");
@@ -22,19 +25,20 @@
      init({
         recordId:this.recordId
      }).then(result =>{
         console.log(this.recordId);
         console.log(result);
         this.IsLoading = false;
         let res = result.ra;
         console.log("res==="+JSON.stringify(res));
         if(res.Campaign__c != '' || res.Campaign__c != undefined){
            if(res.CampaignStatus == '取消'){
               this.IsShow = true;
               this.msg = '学会取消,不可分配';
               return;
            }
         }
         if(res.Repair__c != '' || res.Repair__c != undefined){
            if(res.Repair_Final_Inspection_Date_F__c != null && res.Repair_Final_Inspection_Date_F__c !='' || (res.RC_return_to_office__c!=null && res.RC_return_to_office__c != '')){
            if(res.Repair_Final_Inspection_Date_F__c != null && res.Repair_Final_Inspection_Date_F__c !='' ||
               (res.RC_return_to_office__c!=null && res.RC_return_to_office__c != '')){
               this.IsShow = true;
               this.msg = '修理有最终检测日或修理品返送日,不可分配';
               return;
            }
@@ -46,16 +50,22 @@
            if(res.Status__c == '取消' && res.Rental_Apply_Equipment_Set_Cnt__c != 0){
               window.open("/apex/RentalFixtureSetAssign?pt_recid=" + this.recordId); 
               this.closeAction();
            }else if((res.demo_purpose2__c == '学会展会' || res.demo_purpose2__c == '课题研究' || res.demo_purpose2__c == '培训中心')&& res.Status__c == '草案中'){
            }else if((res.demo_purpose2__c == '学会展会' || res.demo_purpose2__c == '课题研究' || res.demo_purpose2__c == '培训中心')
               && res.Status__c == '草案中'){
               this.IsShow = true;
               this.msg = "不能分配,请确认申请的状态";
               return
            }else if((res.demo_purpose2__c =='试用(无询价)' || res.demo_purpose2__c == '试用(有询价)' || res.demo_purpose2__c =='动物实验' || res.demo_purpose2__c == '一般维修代用' || res.demo_purpose2__c== '保修合同用户维修代用' || res.demo_purpose2__c == '已购待货') && res.Status__c != '已批准' && res.Status__c != '已出库指示'){
            }else if((res.demo_purpose2__c =='试用(无询价)' || res.demo_purpose2__c == '试用(有询价)' || res.demo_purpose2__c =='动物实验'
               || res.demo_purpose2__c == '一般维修代用' || res.demo_purpose2__c== '保修合同用户维修代用' || res.demo_purpose2__c == '已购待货')
               && res.Status__c != '已批准' && res.Status__c != '已出库指示'){
               this.IsShow = true;
               this.msg = "不能分配,请确认申请的状态";
               return;
            }else if(resultMsg == 'Fin'){
               window.open("/apex/RentalFixtureSetAssign?pt_recid=" + this.recordId); 
               this.closeAction();
            }else{
               this.IsShow = true;
               this.msg = resultMsg;
               return;
            }