penambahan validasi filter cost management

This commit is contained in:
Fuzi_fauzia 2024-07-04 10:41:30 +07:00
parent 8403bafcd1
commit 5913980330
1 changed files with 19 additions and 20 deletions

View File

@ -6,6 +6,7 @@ import { ModalAddActualComponent } from "./modal-add-actual/modal-add-actual.com
import "chartist-plugin-tooltips";
import { ModalExportComponent } from "./modal-export/modal-export.component";
import { TableexcelService } from "src/app/_services/tableexcel.service";
import { ToastrService } from "ngx-toastr";
@Component({
selector: "app-cost-management",
@ -46,7 +47,8 @@ export class CostManagementComponent implements OnInit {
private monitoringApiService: BuildingService,
private costService: CostManagementService,
private modalService: NgbModal,
private tableexcelService: TableexcelService
private tableexcelService: TableexcelService,
private toastr: ToastrService,
) {}
ngOnInit() {
@ -102,7 +104,6 @@ export class CostManagementComponent implements OnInit {
roomId: item.room_id,
}));
console.log(this.data_cost);
});
}
@ -354,24 +355,22 @@ export class CostManagementComponent implements OnInit {
}
doFilter() {
// const requestData = {
// building: this.buildingSelected,
// category: this.categorySelected,
// date: this.dateSelected,
// searchTerm: this.searchTerm,
// };
this.spinnerFilterActive = true;
setTimeout(() => {
this.spinnerFilterActive = false;
this.fetchData(
this.buildingSelected,
this.dateSelected,
this.categorySelected
);
// this.dataCompWaterElectCost(this.buildingSelected);
// this.dataCompPrevMonthCost(this.buildingSelected);
// this.dataCompActEstCost(this.buildingSelected);
}, 3000);
if (this.dateSelected) {
this.spinnerFilterActive = true;
setTimeout(() => {
this.spinnerFilterActive = false;
this.fetchData(
this.buildingSelected,
this.dateSelected,
this.categorySelected
);
}, 3000);
} else {
this.toastr.error("Warning", "Format date tidak valid.", {
timeOut: 5000,
closeButton: true,
});
}
}
addFieldValue() {