From 744f42c5496e656a1f9927740a3b37c0b97a6cba Mon Sep 17 00:00:00 2001 From: buli <137736985@qq.com> Date: 星期五, 14 七月 2023 14:34:12 +0800 Subject: [PATCH] lexcommunityupload0714 --- force-app/main/default/lwc/lexConsumableAccount/lexConsumableAccount.js | 44 +++++++++++++++++++++++--------------------- 1 files changed, 23 insertions(+), 21 deletions(-) diff --git a/force-app/main/default/lwc/lexConsumableAccount/lexConsumableAccount.js b/force-app/main/default/lwc/lexConsumableAccount/lexConsumableAccount.js index 0585f10..270892f 100644 --- a/force-app/main/default/lwc/lexConsumableAccount/lexConsumableAccount.js +++ b/force-app/main/default/lwc/lexConsumableAccount/lexConsumableAccount.js @@ -228,7 +228,7 @@ //鍒嗛〉start @track sortBy = ''; - @track pageSize = 10; + @track pageSize = 200; error; records; currentPageToken = 0; @@ -238,7 +238,7 @@ @track pageNumber = 1; @track paginationVisibility = false; @track totalPages = 1; - pageSizeOptions = [10, 25, 50, 100]; + pageSizeOptions = [100, 200, 300]; @track recordStart = 0; @track recordEnd = 0; //end @@ -361,7 +361,7 @@ : r.entity.obj.Parent.Name; console.log( 'this.accountDataInfo = ' + - JSON.stringify(this.accountDataInfo) + JSON.stringify(this.accountDataInfo) ); this.printUrl = '/lexconsumableaccountinfoprint?AccId=' + @@ -397,7 +397,7 @@ this.recordEnd = r.entity.paginatedAccounts.recordEnd; this.totalPages = Math.ceil( r.entity.paginatedAccounts.totalRecords / - this.pageSize + this.pageSize ); console.log('this.totalPages = ' + this.totalPages); this.paginationVisibility = @@ -432,12 +432,12 @@ } console.log( 'this.listViewOptions = ' + - JSON.stringify(this.listViewOptions) + JSON.stringify(this.listViewOptions) ); console.log( 'r.entity.topInfo = ' + - JSON.stringify(r.entity.topInfo) + JSON.stringify(r.entity.topInfo) ); //top10瀹㈡埛 this.topInfo = r.entity.topInfo; @@ -447,18 +447,17 @@ this.topAccountData = this.topInfo.acList; console.log( 'this.topAccountData = ' + - JSON.stringify(this.topAccountData) + JSON.stringify(this.topAccountData) ); console.log( '9/3 = ' + - this.keepTwoDecimalStr( - this.amend(9, 3, '/').toFixed(2) - ) + this.keepTwoDecimalStr( + this.amend(9, 3, '/').toFixed(2) + ) ); let total = 100; try { for (var i in this.topAccountData) { - console.log('i = ' + i); this.topAccountData[i]['accountName'] = this.topAccountData[i].Name; this.topAccountData[i]['accountUrl'] = @@ -486,6 +485,7 @@ ) * 100 ).toFixed(2) ); + console.log('this.amend = ' + this.amend(this.topInfo.deList[i],this.topInfo.saleAmount,'/') * 100); total -= number; this.topAccountData[i]['proportion'] = number + '%'; @@ -493,16 +493,17 @@ console.log( 'this.topAccountData = ' + - JSON.stringify(this.topAccountData) + JSON.stringify(this.topAccountData) ); //鍏朵粬 + console.log('(total.toFixed(2) > 0.00 ? total.toFixed(2) : 0.00) = ' + (total.toFixed(2) > 0.00 ? total.toFixed(2) : '0.00')) if (total != 100) { this.topAccountData.push({ accountName: '...', accountUrl: '/s/lexconsumableaccount', isDisable: true, - proportion: total.toFixed(2) + '%', + proportion: (total.toFixed(2) > 0.00 ? total.toFixed(2) : '0.00') + '%', CityMasterName: '...', CityMasterNameUrl: '/lexconsumableaccount', Town__c: '...', @@ -628,7 +629,7 @@ this.topAccountData = this.topInfo.acList; console.log( 'this.topAccountData = ' + - JSON.stringify(this.topAccountData) + JSON.stringify(this.topAccountData) ); let total = 100; for (var i in this.topAccountData) { @@ -669,7 +670,7 @@ accountName: '...', accountUrl: '/s/lexconsumableaccount', isDisable: true, - proportion: total.toFixed(2) + '%', + proportion: (total.toFixed(2) > 0.00 ? total.toFixed(2) : '0.00') + '%', CityMasterName: '...', CityMasterNameUrl: '/lexconsumableaccount', Town__c: '...', @@ -787,11 +788,11 @@ sortByMethod(field, reverse, primer) { const key = primer ? function (x) { - return primer(x[field]); - } + return primer(x[field]); + } : function (x) { - return x[field]; - }; + return x[field]; + }; return function (a, b) { a = key(a); @@ -801,18 +802,19 @@ } onHandleSort(event) { + console.log('event.detail.fieldName = ' + event.detail.fieldName) this.sortBy = event.detail.fieldName; switch (this.sortBy) { case 'NameUrl': this.sortBy = 'Name'; break; - case 'StateMasterUrl': + case 'StateMasterName': this.sortBy = 'State_Master__r.Name'; break; case 'RecordTypeName': this.sortBy = 'RecordType.Name'; break; - case 'CityMasterNameUrl': + case 'CityMasterName': this.sortBy = 'City_Master__r.Name'; break; } -- Gitblit v1.9.1