perbaikan export cost management
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user