unknown
2023-07-19 7687b7bd101f0fb43342e95344d143a12d3e6d3d
force-app/main/default/lwc/lexEquipmentRentalPicturePDF/lexEquipmentRentalPicturePDF.js
@@ -4,7 +4,7 @@
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import { updateRecord } from 'lightning/uiRecordApi';
import init from '@salesforce/apex/EquipmentRentalPicturePDFController.init';
import init from '@salesforce/apex/LexEquipmentRentalPicturePDFController.init';
export default class lexEquipmentRentalPicturePDF extends LightningElement {
   @api recordId;
      IsLoading = true;
@@ -25,15 +25,20 @@
      init({
         recordId: this.recordId
      }).then(result=>{
         //console.log('result.shipmentRequestedCnt===' + result.shipmentRequestedCnt)
         if( result.shipmentRequestedCnt > 0){
            console.log(result.pagelength);
            for(var i =0; i<result.pagelength; i++){
               this.dispatchEvent(new CloseActionScreenEvent());
               window.open('/apex/FixtureRentalPicturePDF?raid='+ this.recordId +'&page=' + i);
         console.log('result==='+JSON.stringify(result));
         if(result){
            //console.log('result.shipmentRequestedCnt===' + result.shipmentRequestedCnt)
            if( result.shipmentRequestedCnt > 0){
               console.log(result.pagelength);
               for(var i =0; i<result.pagelength; i++){
                  this.dispatchEvent(new CloseActionScreenEvent());
                  window.open('/apex/FixtureRentalPicturePDF?raid='+ this.recordId +'&page=' + i);
               }
            }else{
               this.showToast('当前的申请单中没有已出库指示的配套。','error');
            }
         }else{
            this.showToast('当前的申请单中没有已出库指示的配套。','error');
            this.showToast("未查到数据", 'error');
         }
      }).catch(err=>{
         this.dispatchEvent(new CloseActionScreenEvent());