From be071b75b1afb8ab880d79f651f6c76e10a33a24 Mon Sep 17 00:00:00 2001 From: Fuzi_fauzia Date: Fri, 28 Jun 2024 10:44:45 +0700 Subject: [PATCH] perbaikan export cost management --- .../modal-export/modal-export.component.html | 2 +- .../modal-export/modal-export.component.ts | 16 ++- .../monitoring/detail/detail.component.html | 122 +----------------- .../monitoring/detail/detail.component.ts | 3 +- 4 files changed, 12 insertions(+), 131 deletions(-) diff --git a/src/app/content/hemat-app/cost-management/modal-export/modal-export.component.html b/src/app/content/hemat-app/cost-management/modal-export/modal-export.component.html index dfdbbc0..99ed18c 100644 --- a/src/app/content/hemat-app/cost-management/modal-export/modal-export.component.html +++ b/src/app/content/hemat-app/cost-management/modal-export/modal-export.component.html @@ -110,7 +110,7 @@

- {{ value | date : "MM/yyyy" }} + {{ value | date : "dd/MM/yyyy" }}

diff --git a/src/app/content/hemat-app/cost-management/modal-export/modal-export.component.ts b/src/app/content/hemat-app/cost-management/modal-export/modal-export.component.ts index 26c973c..fcedcf8 100644 --- a/src/app/content/hemat-app/cost-management/modal-export/modal-export.component.ts +++ b/src/app/content/hemat-app/cost-management/modal-export/modal-export.component.ts @@ -18,6 +18,7 @@ export class ModalExportComponent { kwhTerm: string = ""; costTerm: string = ""; data_cost: any; + dataExport: any; formattedEndDate: any; spinnerExportActive = false; constructor( @@ -39,6 +40,7 @@ export class ModalExportComponent { this.costService .getCostDetail(category, room, period) .subscribe((response) => { + this.dataExport = response.data; this.data_cost = response.data.map((item) => ({ deviceName: item.device_name, roomName: item.room_name, @@ -57,18 +59,18 @@ export class ModalExportComponent { this.spinnerExportActive = true; setTimeout(() => { const columnsToExport = [ - "deviceName", - "roomName", - "categoryName", - "estimationCost", - "totalKwh", + "device_name", + "room_name", + "category_name", + "estimation_cost", + "total_kwh", "watt", "duration", - "priceKwh", + "price_kwh", "periode", ]; this.tableexcelService.exportAsExcelFileManageDetail( - this.data_cost, + this.dataExport, "export_detail_cost_management", columnsToExport ); diff --git a/src/app/content/hemat-app/monitoring/detail/detail.component.html b/src/app/content/hemat-app/monitoring/detail/detail.component.html index 594f308..bd4b76d 100644 --- a/src/app/content/hemat-app/monitoring/detail/detail.component.html +++ b/src/app/content/hemat-app/monitoring/detail/detail.component.html @@ -13,7 +13,7 @@
Kwh Consumption

- {{ topCard?.kwh_consumption }} Kwh + {{ topCard?.kwh_consumption.toFixed(1) }} Kwh

@@ -168,126 +168,6 @@
-