| | |
| | | import { NavigationMixin } from 'lightning/navigation'; |
| | | import initPage from '@salesforce/apex/LexConsumableOrderManageController.init1'; |
| | | import searchConsumableorderdetails from '@salesforce/apex/LexConsumableOrderManageController.searchConsumableorderdetails'; |
| | | //table css |
| | | import { loadStyle } from "lightning/platformResourceLoader"; |
| | | import WrappedHeaderTable from "@salesforce/resourceUrl/lexdatatable"; |
| | | |
| | | |
| | | export default class LexConsumableOrderManage extends NavigationMixin(LightningElement) { |
| | | @track category1; |
| | |
| | | @track cols = []; |
| | | @track showSpinner = false; |
| | | @track showPage = false; |
| | | stylesLoaded = false; |
| | | //是否一直显示提示 |
| | | @track isNoteStay = true; |
| | | |
| | | connectedCallback(){ |
| | | this.showSpinner = true; |
| | | initPage() |
| | | .then(result=>{ |
| | | this.isNoteStay = result.isNoteStay; |
| | | if(result.result == 'Success'){ |
| | | this.provinceOpts = result.provinceOpts; |
| | | this.title = result.title; |
| | |
| | | this.showSpinner = false; |
| | | console.log("Error:"+error); |
| | | }) |
| | | } |
| | | |
| | | renderedCallback(){ |
| | | if (!this.stylesLoaded) { |
| | | Promise.all([loadStyle(this, WrappedHeaderTable)]) |
| | | .then(() => { |
| | | console.log("Custom styles loaded"); |
| | | this.stylesLoaded = true; |
| | | }) |
| | | .catch((error) => { |
| | | console.error("Error loading custom styles"); |
| | | }); |
| | | } |
| | | } |
| | | |
| | | category1Change(event){ |
| | |
| | | }) |
| | | } |
| | | |
| | | showMyToast(title,message,variant){ |
| | | const evt = new ShowToastEvent({ |
| | | title : title, |
| | | message: message, |
| | | variant: variant |
| | | }); |
| | | this.dispatchEvent(evt); |
| | | showMyToast(title, message, variant) { |
| | | console.log('show custom message'); |
| | | var iconName = ''; |
| | | var content = ''; |
| | | if(variant == 'success'){ |
| | | iconName = 'utility:check'; |
| | | }else{ |
| | | iconName = 'utility:error'; |
| | | } |
| | | if(message != ''){ |
| | | content = '<h2><strong>'+title+'<strong/></h2><h5>'+message+'</h5>'; |
| | | }else{ |
| | | content = '<h2><strong>'+title+'<strong/></h2>'; |
| | | } |
| | | this.template.querySelector('c-common-toast'). |
| | | showToast(variant,content,iconName,10000); |
| | | // var mode; |
| | | // if(this.isNoteStay){ |
| | | // mode ='sticky'; |
| | | // }else{ |
| | | // mode = 'dismissable'; |
| | | // } |
| | | // const evt = new ShowToastEvent({ |
| | | // title: title, |
| | | // message: message, |
| | | // variant: variant, |
| | | // mode: mode |
| | | // }); |
| | | // this.dispatchEvent(evt); |
| | | } |
| | | } |