LiJinHuan
2023-08-08 9f5874fcd8657ade15b4fc73c924813684f3a9a8
force-app/main/default/lwc/lexFeedbackReport/lexFeedbackReport.js
@@ -3,12 +3,10 @@
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import { CurrentPageReference } from 'lightning/navigation';
import init from '@salesforce/apex/RentalApplyFaultController.init';
import updateRentalApplyFaultStatus from '@salesforce/apex/RentalApplyFaultController.updateRentalApplyFaultStatus';
import init from '@salesforce/apex/LexRentalApplyFaultController.init';
import updateRentalApplyFaultStatus from '@salesforce/apex/LexRentalApplyFaultController.updateRentalApplyFaultStatus';
export default class lexFeedbackReport extends LightningElement {
   @api recordId;
   IsLoading = true;
   @wire(CurrentPageReference)
   getStateParameters(currentPageReference){
      if(currentPageReference) {
@@ -24,21 +22,25 @@
      init({
         recordId: this.recordId
      }).then(res=>{
         if(res.status__c!='已发送'){
         if(res){
            if(res.status__c!='已发送'){
            this.showToast('只有已发送的检测分析报告才能发送','warning');
            return;
         }
         updateRentalApplyFaultStatus({
            recordId: this.recordId,
            updateStatus: '已反馈'
         }).then(result=>{
            if(result=='SUCCESS'){
               this.showToast('报告已反馈','success');
            }else{
               this.showToast(res,'error');
               return;
            }
         })
            updateRentalApplyFaultStatus({
               recordId: this.recordId,
               updateStatus: '已反馈'
            }).then(result=>{
               if(result=='SUCCESS'){
                  this.showToast('报告已反馈','success');
               }else{
                  this.showToast(res,'error');
               }
            })
         }else{
            this.showToast('未查询到数据','warning');
         }
      })
   }