| | |
| | | import { |
| | | CloseActionScreenEvent |
| | | } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/otherButtonMaintenanceContractCtl.init'; |
| | | import init from '@salesforce/apex/buttonMaintenanceTaskCtl.init'; |
| | | import selectMaintenanceContract from '@salesforce/apex/buttonMaintenanceTaskCtl.selectMaintenanceContract'; |
| | | |
| | | export default class LexCreateReportMaintenanceTask extends LightningElement { |
| | | @api recordId; |
| | | str; |
| | | IsLoading = true; |
| | | Id; |
| | | RecordTypeDeveloperNameC; |
| | | EstimateTargetC; |
| | | MaintenanceContractC; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | |
| | | } |
| | | |
| | | connectedCallback() { |
| | | console.log(this.recordId); |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.Id = result.Id; |
| | | this.RecordTypeDeveloperNameC = result.RecordTypeDeveloperNameC; |
| | | this.EstimateTargetC = result.EstimateTargetC; |
| | | this.MaintenanceContractC = result.MaintenanceContractC; |
| | | |
| | | this.CreateReport(); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | |
| | | |
| | | // 制作报告书 |
| | | CreateReport() { |
| | | var MaintenanceContractId = this.Id; |
| | | var RecordTypeName = this.RecordTypeDeveloperNameC; |
| | | var EstimateTarget = this.EstimateTargetC; |
| | | selectMaintenanceContract({ |
| | | Id: this.MaintenanceContractC |
| | | }).then(result => { |
| | | console.log(result); |
| | | var MaintenanceContractId = this.MaintenanceContractC; |
| | | var RecordTypeName = result[0].RecordType_DeveloperName__c; |
| | | var EstimateTarget = result[0].Estimate_Target__c; |
| | | |
| | | console.log(RecordTypeName); |
| | | console.log(EstimateTarget); |
| | | var url = ''; |
| | | if (EstimateTarget == "经销商" && (RecordTypeName == "NewMaintenance_Contract" || RecordTypeName == "VM_Contract")) { |
| | | url = "/apex/MoreMaintenanceContractPop?Id=" + MaintenanceContractId + "&RecordTypeName=" + RecordTypeName; |
| | |
| | | url = "http://powerbi.olympus.com.cn/Home/Login"; |
| | | } |
| | | window.open(url, '_bank'); |
| | | }) |
| | | } |
| | | } |