import { LightningElement,wire,api,track } from 'lwc'; import { ShowToastEvent } from 'lightning/platformShowToastEvent'; import { NavigationMixin } from 'lightning/navigation'; import initPage from '@salesforce/apex/TopPageLwcController.initPage'; export default class TopPageLwc extends NavigationMixin(LightningElement) { @track title = []; @track raesList = []; @track column = []; @track overlimitdateorderdetails = []; @track accountInfo; @track accountId; @track pageRecords = []; @track csvData = []; @track product_Limit; @track over_view = false; @track overlimit = false; @track hasHos = false; @track activeSections = ['A', 'B','C']; @track isRender = false; @track consumableorderdetailsRecordsview; connectedCallback(){ initPage() .then(result=>{ if(result.result == 'Success'){ this.title = result.title; this.raesList = result.raesList; this.column = result.column; this.accountInfo = result.accountInfo; this.accountId = result.accountInfo.Id; this.pageRecords = result.pageRecords; this.overlimitdateorderdetails = result.overlimitdateorderdetails; this.over_view = result.over_view; this.overlimit = result.overlimit; this.hasHos = result.hasHos; this.product_Limit = result.product_Limit; this.consumableorderdetailsRecordsview = result.consumableorderdetailsRecordsview; console.log('this.accountId:'+this.accountId); console.log('this.accountInfo:'+JSON.stringify(this.accountInfo)); }else{ console.log("Error:"+result.errorMsg); const evt = new ShowToastEvent({ title : '初始化页面失败', message: result.errorMsg, variant: 'error' }); this.dispatchEvent(evt); } }); } renderedCallback(){ if(!this.isRender){ this.isRender = true; var tableStr = productLimitTableJs(this.product_Limit); const container = this.template.querySelector('div.resultDiv'); container.innerHTML = tableStr; } function productLimitTableJs(str){ var csv_data = new Array(); if(str != null && str != ''){ csv_data = productlist(str); } var table = '
产品型号 | 库存下限 | 库存上限 |
---|---|---|
'; var colu = row[j]; table = table + colu + ' | '; } table = table + '