| | |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | import { NavigationMixin } from 'lightning/navigation'; |
| | | import { encodeDefaultFieldValues } from 'lightning/pageReferenceUtils'; |
| | | import ConSent from '@salesforce/apex/BidAnnouncementController.ConSent'; |
| | | import lwcCSS from '@salesforce/resourceUrl/lwcCSS'; |
| | | import {loadStyle} from 'lightning/platformResourceLoader'; |
| | | import queryCancelReport from '@salesforce/apex/OpportunityLightingButtonController.queryCancelReport'; |
| | | export default class LexCancelReport extends NavigationMixin(LightningElement) { |
| | | @api recordId; |
| | | stageName; |
| | |
| | | salesOwnerBuchang; |
| | | salesOwnerBuchangID; |
| | | recordTypeId; |
| | | haveLostReport; |
| | | IsLoading = true; |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | |
| | | } |
| | | } |
| | | connectedCallback(){ |
| | | Promise.all([ |
| | | loadStyle(this, lwcCSS) |
| | | ]); |
| | | |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result=>{ |
| | |
| | | this.salesOwnerBuchang = result.salesOwnerBuchang == undefined ? '' : result.salesOwnerBuchang; |
| | | this.salesOwnerBuchangID = result.salesOwnerBuchangID == undefined ? '' : result.salesOwnerBuchangID; |
| | | this.recordTypeId = result.recordTypeId; |
| | | this.cancelReport(); |
| | | queryCancelReport({ |
| | | recordId: this.recordId |
| | | }).then(result=>{ |
| | | this.haveLostReport = result; |
| | | this.cancelReport(); |
| | | }); |
| | | |
| | | }).catch(error=>{ |
| | | console.log("error"); |
| | | console.log(error); |
| | | }); |
| | | } |
| | | showToast(msg,type) { |
| | | const event = new ShowToastEvent({ |
| | | title: ' ', |
| | | message: msg, |
| | | variant: type, |
| | | mode: 'sticky' |
| | | }); |
| | | this.dispatchEvent(event); |
| | | if(type == 'success'){ |
| | | const event = new ShowToastEvent({ |
| | | message: msg, |
| | | variant: type, |
| | | }); |
| | | this.dispatchEvent(event); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }else{ |
| | | const event = new ShowToastEvent({ |
| | | message: msg, |
| | | variant: type, |
| | | mode: 'sticky' |
| | | }); |
| | | this.dispatchEvent(event); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | } |
| | | updateRecordView(recordId) { |
| | | updateRecord({fields: { Id: recordId }}); |
| | |
| | | else if (this.sapSendOK == '1') { |
| | | this.showToast("已经上传SAP、不能做 取消 了!","error"); |
| | | } |
| | | else if (this.cntLostCancelReport - this.cntLostCancelDraft > 0) { |
| | | else if (this.haveLostReport) { |
| | | this.showToast("询价已经有 取消/失单报告 了!","error"); |
| | | } |
| | | else if (this.jobCategory == '支援') { |