| | |
| | | * @Author: chen jing wu |
| | | * @Date: 2023-09-11 09:20:29 |
| | | * @LastEditors: chen jing wu |
| | | * @LastEditTime: 2023-09-11 10:00:40 |
| | | * @LastEditTime: 2023-10-10 17:47:00 |
| | | */ |
| | | import { api, wire,LightningElement, track } from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | |
| | | import { refreshApex } from '@salesforce/apex'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | import LightningConfirm from 'lightning/confirm'; |
| | | |
| | | import lwcCSS from '@salesforce/resourceUrl/lwcCSS'; |
| | | import {loadStyle} from 'lightning/platformResourceLoader'; |
| | | export default class LexSubmitReport extends LightningElement { |
| | | @wire(getRecord, { recordId: '$recordId', fields: [STATUS_FIELD] }) |
| | | record; |
| | | @api recordId; |
| | | cntLostCancelReport; |
| | | cntLostCancelDraft; |
| | | IsLoading = true; |
| | | IsLoading; |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | console.log(111); |
| | |
| | | } |
| | | } |
| | | 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()); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | connectedCallback(){ |
| | | Promise.all([ |
| | | loadStyle(this, lwcCSS) |
| | | ]); |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result=>{ |
| | |
| | | label: 'this is the aria-label value' |
| | | }); |
| | | console.log(result); |
| | | this.IsLoading = true; |
| | | if(result){ |
| | | updateSubmitReportButton({ |
| | | recordId: this.recordId |
| | |
| | | }else{ |
| | | setTimeout(() => { |
| | | this.IsLoading = false; |
| | | refreshApex(this.record); |
| | | window.location = '/' + this.recordId; |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }, 2000); |
| | | }, 1000); |
| | | } |
| | | }); |
| | | }else{ |