perbaikan export cost management

This commit is contained in:
2024-06-28 10:44:45 +07:00
parent ca30a991ae
commit be071b75b1
4 changed files with 12 additions and 131 deletions

View File

@@ -110,7 +110,7 @@
</ng-template>
<ng-template let-value="value" ngx-datatable-cell-template>
<p style="color: #ffffff !important">
{{ value | date : "MM/yyyy" }}
{{ value | date : "dd/MM/yyyy" }}
</p>
</ng-template>
</ngx-datatable-column>

View File

@@ -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
);