| | |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | import { updateRecord } from 'lightning/uiRecordApi'; |
| | | |
| | | import init from '@salesforce/apex/loanerArrangedEmailController.init'; |
| | | import getRentalApplyEquipmentSet from '@salesforce/apex/loanerArrangedEmailController.getRentalApplyEquipmentSet'; |
| | | import init from '@salesforce/apex/LexLoanerArrangedEmailController.init'; |
| | | import getRentalApplyEquipmentSet from '@salesforce/apex/LexLoanerArrangedEmailController.getRentalApplyEquipmentSet'; |
| | | import approvalCheck from '@salesforce/apex/RentalApplyWebService.approvalCheck'; |
| | | import setShipment_request from '@salesforce/apex/RentalApplyWebService.approvalCheck'; |
| | | import setShipment_request from '@salesforce/apex/RentalApplyWebService.setShipment_request'; |
| | | export default class lexLoanerArrangedEmail extends LightningElement { |
| | | @api recordId; |
| | | IsLoading = true; |
| | |
| | | } |
| | | |
| | | connectedCallback() { |
| | | |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | let id = result.id; |
| | | let statusArr = result.statusList; |
| | | console.log('result==='+JSON.stringify(result)); |
| | | if(result != null) { |
| | |
| | | //bp2 alert(rs2); |
| | | //bp2 } else { |
| | | //var rs1 = sforce.apex.execute("RentalApplyWebService", "setShipment_request", {raid : "{!Rental_Apply__c.Id}"}); |
| | | console.log('setShipment_request=='); |
| | | setShipment_request({ |
| | | raid: this.recordId |
| | | }).then(res=>{ |
| | | console.log('res==',res); |
| | | if (res == "状态更新到已出库指示") { |
| | | this.showToast("状态更新到已出库指示",'success'); |
| | | if (res == '状态更新到已出库指示') { |
| | | this.showToast('状态更新到已出库指示','success'); |
| | | print(); |
| | | // setTimeout(function() { |
| | | // location.href = "/{!Rental_Apply__c.Id}"; |
| | | // },100); |
| | | this.updateRecordView(this.recordId); |
| | | return; |
| | | }else { |
| | | this.showToast(res,'error'); |
| | | console.log('else==',res); |
| | | const evt = new ShowToastEvent({ |
| | | title: 'Error', |
| | | message:res, |
| | | variant: 'error' |
| | | }); |
| | | this.dispatchEvent(evt); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(e=>{ |
| | | console.log('approvalCheck==='+e); |
| | |
| | | console.log('setShipment_request==='+e); |
| | | }) |
| | | } |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }) |
| | | } |
| | |
| | | getRentalApplyEquipmentSet({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | window.open("https://ocsm--partial.sandbox.lightning.force.com/apex/FixtureRentalPDF?raid=" + this.recordId + "&page=" + result); |
| | | window.open("/apex/FixtureRentalPDF?raid=" + this.recordId + "&page=" + result); |
| | | }) |
| | | } |
| | | |
| | |
| | | variant: type |
| | | }); |
| | | if(type == 'success'){ |
| | | this.updateRecordView(); |
| | | this.updateRecordView(this.recordId); |
| | | } |
| | | this.dispatchEvent(event); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |