integrasi cost management

This commit is contained in:
2024-06-11 20:44:05 +07:00
parent 38c936b389
commit ad91c844d6
16 changed files with 1758 additions and 930 deletions

View File

@@ -9,7 +9,9 @@
<div class="col-lg-4 col-12">
<div class="card">
<div class="card-header">
<h4 class="card-title text-center">Temperature and Humidity</h4>
<h4 class="card-title text-center">
Comparison of Water and Electricity Costs
</h4>
</div>
<div class="card-body">
<div class="card-block">
@@ -30,35 +32,25 @@
<div class="col-lg-4 col-12">
<div class="card">
<div class="card-header">
<h4 class="card-title text-center">Air Quality</h4>
<h4 class="card-title text-center">
Comparison of Previous Month Costs
</h4>
</div>
<div class="card-body">
<div class="card-block">
<div class="donut-chart1" style="height: 150px !important">
<x-chartist
*ngIf="donutChart1"
[data]="donutChart1.data"
[type]="donutChart1.type"
[options]="donutChart1.options"
[responsiveOptions]="donutChart1.responsiveOptions"
[events]="donutChart1.events"
></x-chartist>
</div>
<div
class="text-center"
style="
position: absolute;
top: 80%;
left: 50%;
transform: translate(-50%, -50%);
"
class="donut-chart3 text-center"
style="height: 150px !important"
>
<h3
class="display-4 blue-grey darken-1"
style="font-size: 2em"
<x-chartist
*ngIf="barChart"
[data]="barChart.data"
[type]="barChart.type"
[options]="barChart.options"
[responsiveOptions]="barChart.responsiveOptions"
[events]="barChart.events"
>
76 %
</h3>
</x-chartist>
</div>
</div>
</div>
@@ -67,7 +59,9 @@
<div class="col-lg-4 col-12">
<div class="card">
<div class="card-header">
<h4 class="card-title text-center">Comparison of Actual Costs and Estimated Costs</h4>
<h4 class="card-title text-center">
Comparison of Actual Costs and Estimated Costs
</h4>
</div>
<div class="card-body">
<div class="card-block">
@@ -75,30 +69,36 @@
<div class="flex-grow-1">
<ngb-progressbar
height="45px"
type="danger"
[value]="89"
type="success"
[value]="dataCompAct?.est_cost"
[max]="dataCompAct?.real_cost"
></ngb-progressbar>
</div>
<div
class="ml-2 d-flex align-items-center"
style="height: 20px"
>
<span class="text-bold-600">1.234.242</span>
<span class="text-bold-600">{{
dataCompAct?.est_cost
}}</span>
</div>
</div>
<div class="d-flex align-items-center">
<div class="flex-grow-1">
<ngb-progressbar
height="45px"
type="success"
[value]="50"
type="danger"
[value]="dataCompAct?.real_cost"
[max]="dataCompAct?.real_cost"
></ngb-progressbar>
</div>
<div
class="ml-2 d-flex align-items-center"
style="height: 20px"
>
<span class="text-bold-600">1.545.232</span>
<span class="text-bold-600">{{
dataCompAct?.real_cost
}}</span>
</div>
</div>
</div>
@@ -107,6 +107,276 @@
</div>
</div>
</section>
<section id="configuration">
<div class="row">
<div
class="col-12"
*blockUI="'zeroConfiguration'; message: 'Loading'"
>
<m-card>
<!-- <ng-container mCardHeaderTitle> Device Table </ng-container> -->
<ng-container mCardBody>
<div class="row mb-2">
<div class="col-3">
<div class="form-group">
<ng-select
[items]="dataBuildingList"
[searchable]="true"
bindLabel="name"
bindValue="id"
placeholder="Select Building"
[(ngModel)]="buildingSelected"
>
</ng-select>
</div>
</div>
<div class="col-3">
<div class="form-group">
<input
type="month"
class="form-control"
[(ngModel)]="dateSelected"
id="month12"
(focus)="focusElement('month12')"
/>
</div>
</div>
<div class="col-3">
<div class="form-group">
<ng-select
[items]="dataMasterCategori"
[searchable]="true"
bindLabel="name"
bindValue="id"
placeholder="Select Category"
[(ngModel)]="categorySelected"
>
</ng-select>
</div>
</div>
<div class="col-3">
<div class="d-flex">
<input
type="text"
class="form-control"
placeholder="Search..."
[(ngModel)]="searchTerm"
/>
<button
type="button"
class="btn btn-outline-success ml-2"
(click)="doFilter()"
>
<i class="la la-search"></i>
</button>
</div>
</div>
</div>
<div class="row mb-2">
<div class="col-4">
<div class="form-group">
<input
type="text"
class="form-control"
placeholder="Kwh"
[(ngModel)]="kwhTerm"
disabled
/>
</div>
</div>
<div class="col-4">
<div class="form-group">
<input
type="text"
class="form-control"
placeholder="Cost"
[(ngModel)]="costTerm"
disabled
/>
</div>
</div>
<div class="col-4">
<div class="d-flex justify-content-end">
<button
class="btn btn-secondary mr-2"
style="width: 100%"
(click)="syncData()"
>
<i
class="la la-spinner spinner"
*ngIf="spinnerActive"
></i>
<i class="la la-spinner" *ngIf="!spinnerActive"></i
>&nbsp;
<span>Syncing Data</span>
</button>
<button
class="btn btn-secondary"
style="width: 100%"
(click)="addFieldValue()"
>
<i class="feather ft-plus"></i
>&nbsp;
<span>Add Actual Cost</span>
</button>
</div>
</div>
</div>
<div class="card-dashboard">
<ngx-datatable
class="bootstrap table-bordered"
[limit]="5"
[rows]="data_cost"
[columnMode]="'force'"
[headerHeight]="50"
[footerHeight]="50"
[rowHeight]="50"
fxFlex="auto"
[scrollbarH]="true"
>
<ngx-datatable-column
name="#"
[flexGrow]="1"
[minWidth]="10"
>
<ng-template
ngx-datatable-cell-template
let-rowIndex="rowIndex"
>
{{ rowIndex + 1 }}
</ng-template>
</ngx-datatable-column>
<ngx-datatable-column
name="building"
[flexGrow]="1"
[minWidth]="90"
>
<ng-template ngx-datatable-header-template>
<span>Building</span>
</ng-template>
<ng-template
let-value="value"
ngx-datatable-cell-template
>
{{ value }}
</ng-template>
</ngx-datatable-column>
<ngx-datatable-column
name="categoryName"
[flexGrow]="1"
[minWidth]="90"
>
<ng-template ngx-datatable-header-template>
<span>Category</span>
</ng-template>
<ng-template
let-value="value"
ngx-datatable-cell-template
>
{{ value }}
</ng-template>
</ngx-datatable-column>
<ngx-datatable-column
name="estimationCost"
[flexGrow]="1"
[minWidth]="90"
>
<ng-template ngx-datatable-header-template>
<span>Estimation Cost</span>
</ng-template>
<ng-template
let-value="value"
ngx-datatable-cell-template
>
{{
value.toLocaleString("id-ID", {
style: "currency",
currency: "IDR"
})
}}
</ng-template>
</ngx-datatable-column>
<ngx-datatable-column
name="totalUse"
[flexGrow]="1"
[minWidth]="90"
>
<ng-template ngx-datatable-header-template>
<span>Total Use</span>
</ng-template>
<ng-template
let-value="value"
ngx-datatable-cell-template
>
{{ value }} kWh
</ng-template>
</ngx-datatable-column>
<ngx-datatable-column
name="endDate"
[flexGrow]="1"
[minWidth]="90"
>
<ng-template ngx-datatable-header-template>
<span>Tanggal</span>
</ng-template>
<ng-template
let-value="value"
ngx-datatable-cell-template
>
{{ value | date : "MM/yyyy" }}
</ng-template>
</ngx-datatable-column>
<ngx-datatable-column
name="status_id"
[flexGrow]="1"
[minWidth]="90"
>
<ng-template ngx-datatable-header-template>
<span>Status</span>
</ng-template>
<ng-template
ngx-datatable-cell-template
let-value="value"
>
{{ value === 2 ? "Aktif" : "Tidak Aktif" }}
</ng-template>
</ngx-datatable-column>
<ngx-datatable-column
name="Actions"
[flexGrow]="1"
[minWidth]="150"
>
<ng-template
ngx-datatable-cell-template
let-rowIndex="rowIndex"
let-row="row"
>
<button
class="btn btn-sm btn-warning mr-1"
(click)="editRow(row)"
>
<i class="ficon feather ft-edit"></i>
</button>
<button
class="btn btn-sm btn-danger"
(click)="deleteRow(row)"
>
<i class="ficon feather ft-trash-2"></i>
</button>
</ng-template>
</ngx-datatable-column>
</ngx-datatable>
</div>
</ng-container>
</m-card>
</div>
</div>
</section>
</div>
</div>
</div>