From 80a3f59e2d3df07805bc67e329300b8de90a5b3a Mon Sep 17 00:00:00 2001
From: buli <137736985@qq.com>
Date: 星期二, 11 七月 2023 14:13:08 +0800
Subject: [PATCH] Merge branch 'LEXCommunityLiJun' into LEXUpgrade2023-Deloitte

---
 force-app/main/default/lwc/lexConsumableAccount/lexConsumableAccount.js |   33 +++++++++++++++++++++++++++------
 1 files changed, 27 insertions(+), 6 deletions(-)

diff --git a/force-app/main/default/lwc/lexConsumableAccount/lexConsumableAccount.js b/force-app/main/default/lwc/lexConsumableAccount/lexConsumableAccount.js
index 0585f10..a81d360 100644
--- a/force-app/main/default/lwc/lexConsumableAccount/lexConsumableAccount.js
+++ b/force-app/main/default/lwc/lexConsumableAccount/lexConsumableAccount.js
@@ -458,7 +458,6 @@
                         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,15 @@
                                         ) * 100
                                     ).toFixed(2)
                                 );
+                                console.log(
+                                    'this.amend = ' +
+                                        this.amend(
+                                            this.topInfo.deList[i],
+                                            this.topInfo.saleAmount,
+                                            '/'
+                                        ) *
+                                            100
+                                );
                                 total -= number;
                                 this.topAccountData[i]['proportion'] =
                                     number + '%';
@@ -497,12 +505,21 @@
                             );
 
                             //鍏朵粬
+                            console.log(
+                                '(total.toFixed(2) > 0.00 ? total.toFixed(2) : 0.00) = ' +
+                                    (total.toFixed(2) > 0.0
+                                        ? 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.0
+                                            ? total.toFixed(2)
+                                            : '0.00') + '%',
                                     CityMasterName: '...',
                                     CityMasterNameUrl: '/lexconsumableaccount',
                                     Town__c: '...',
@@ -669,7 +686,10 @@
                             accountName: '...',
                             accountUrl: '/s/lexconsumableaccount',
                             isDisable: true,
-                            proportion: total.toFixed(2) + '%',
+                            proportion:
+                                (total.toFixed(2) > 0.0
+                                    ? total.toFixed(2)
+                                    : '0.00') + '%',
                             CityMasterName: '...',
                             CityMasterNameUrl: '/lexconsumableaccount',
                             Town__c: '...',
@@ -801,18 +821,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;
         }
@@ -862,4 +883,4 @@
     get nextButtonDisabled() {
         return this.nextPageToken === undefined;
     }
-}
\ No newline at end of file
+}

--
Gitblit v1.9.1