hemat_solution/src/app/content/hemat-app/cost-management/cost-management.component.html
2024-07-17 11:51:29 +07:00

412 lines
16 KiB
HTML

<div class="app-content content" style="background-color: #FBFBFB !important">
<div class="content-wrapper">
<div class="content-header row mb-1">
<app-breadcrumb class="col-12" [breadcrumb]="breadcrumb"></app-breadcrumb>
</div>
<div class="content-body">
<section>
<div class="row">
<div class="col-12 col-sm-6 col-md-6 col-lg-6">
<div class="card" style="background-color: #DDE1E6 !important">
<div
class="card-header"
style="background-color: #DDE1E6 !important"
>
<h4
class="card-title text-center text-custom-label"
>
Comparison of Previous Month Costs
</h4>
<hr
style="
border-top: 4px solid #242222;
border-color: #242222 !important;
"
/>
</div>
<div class="card-body">
<div
echarts
[options]="chartOption"
class="echart-container"
style="height: 150% !important"
></div>
</div>
</div>
</div>
<div class="col-12 col-sm-6 col-md-6 col-lg-6">
<div class="card" style="background-color: #DDE1E6 !important">
<div
class="card-header"
style="background-color: #DDE1E6 !important"
>
<h4
class="card-title text-center text-custom-label"
>
Comparison of Actual Costs and Estimated Costs
</h4>
<hr
style="
border-top: 4px solid #242222;
border-color: #242222 !important;
"
/>
</div>
<div class="card-body">
<div
echarts
[options]="chartOption2"
class="echart-container"
style="height: 150% !important"
></div>
</div>
</div>
</div>
</div>
</section>
<section id="configuration">
<div class="card" style="background-color: #FBFBFB !important">
<div class="card-content">
<div class="card-body">
<div class="row">
<div class="col-6 col-sm-3 col-md-3 col-lg-3 col-xl-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-6 col-sm-3 col-md-3 col-lg-3 col-xl-3">
<div class="form-group">
<input
type="month"
class="form-control"
[(ngModel)]="dateSelected"
id="month12"
(focus)="focusElement('month12')"
/>
</div>
</div>
<div class="col-6 col-sm-3 col-md-3 col-lg-3 col-xl-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-6 col-sm-3 col-md-3 col-lg-3 col-xl-3">
<div class="d-flex">
<button
type="button"
class="btn btn-outline-success"
(click)="doFilter()"
style="
background-color: #37A647 !important;
border-color: #37A647 !important;
color: #ffffff;
"
[disabled]="spinnerFilterActive"
>
<i
class="la la-search"
style="color: #ffffff !important"
*ngIf="!spinnerFilterActive"
></i>
<i
class="la la-spinner spinner"
style="color: #ffffff !important"
*ngIf="spinnerFilterActive"
></i>
</button>
</div>
</div>
</div>
<div class="row mb-2">
<div class="col-6 col-sm-6 col-md-6 col-lg-6 col-xl-3">
<div class="form-group">
<div class="input-group">
<input
type="text"
class="form-control"
placeholder="Kwh"
[(ngModel)]="kwhTerm"
disabled
/>
<div
class="input-group-append"
style="background-color: #FBFBFB !important"
>
<span
class="input-group-text"
style="
background-color: #FBFBFB !important;
color: #242222;
height: 40px !important;
"
>Kwh</span
>
</div>
</div>
</div>
</div>
<div class="col-6 col-sm-6 col-md-6 col-lg-6 col-xl-3">
<div class="form-group">
<div class="input-group">
<input
type="text"
class="form-control"
placeholder="Cost"
mask="separator"
thousandSeparator="."
[(ngModel)]="costTerm"
disabled
/>
<div
class="input-group-append"
style="background-color: #FBFBFB !important"
>
<span
class="input-group-text"
style="
background-color: #FBFBFB !important;
color: #242222;
height: 40px !important;
"
>IDR</span
>
</div>
</div>
</div>
</div>
<div class="col-12 col-sm-12 col-md-12 col-lg-12 col-xl-6">
<div class="d-flex justify-content-end">
<button
class="btn btn-secondary mr-2"
style="
width: 100%;
background-color: #37A647 !important;
border-color: #37A647 !important;
color: #ffffff !important;
"
(click)="export()"
[disabled]="spinnerExportActive"
>
<i
class="la la-spinner spinner"
*ngIf="spinnerExportActive"
></i>
<i class="ri-export-line" *ngIf="!spinnerExportActive"></i
>&nbsp;
<span>Export</span>
</button>
<button
class="btn btn-secondary mr-2"
style="
width: 100%;
background-color: #37A647 !important;
border-color: #37A647 !important;
color: #ffffff !important;
"
(click)="syncData()"
[disabled]="spinnerActive"
>
<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%;
background-color: #37A647 !important;
border-color: #37A647 !important;
color: #ffffff !important;
"
(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]="10"
[rows]="data_cost"
[columnMode]="'force'"
[headerHeight]="50"
[footerHeight]="50"
[rowHeight]="50"
fxFlex="auto"
[scrollbarH]="true"
>
<ngx-datatable-column
name="#"
[flexGrow]="0.5"
[minWidth]="30"
>
<ng-template
ngx-datatable-cell-template
let-rowIndex="rowIndex"
>
<p class="style-custom-label">
{{ rowIndex + 1 }}
</p>
</ng-template>
</ngx-datatable-column>
<ngx-datatable-column
name="building"
[flexGrow]="1"
[minWidth]="90"
>
<ng-template ngx-datatable-header-template>
<span class="style-custom-label">Building</span>
</ng-template>
<ng-template let-value="value" ngx-datatable-cell-template>
<p class="style-custom-label">{{ value }}</p>
</ng-template>
</ngx-datatable-column>
<ngx-datatable-column
name="categoryName"
[flexGrow]="1"
[minWidth]="90"
>
<ng-template ngx-datatable-header-template>
<span class="style-custom-label">Category</span>
</ng-template>
<ng-template let-value="value" ngx-datatable-cell-template>
<p class="style-custom-label">{{ value }}</p>
</ng-template>
</ngx-datatable-column>
<ngx-datatable-column
name="roomName"
[flexGrow]="1"
[minWidth]="90"
>
<ng-template ngx-datatable-header-template>
<span class="style-custom-label">Room</span>
</ng-template>
<ng-template let-value="value" ngx-datatable-cell-template>
<p class="style-custom-label">{{ value }}</p>
</ng-template>
</ngx-datatable-column>
<ngx-datatable-column
name="estimationCost"
[flexGrow]="1"
[minWidth]="90"
>
<ng-template ngx-datatable-header-template>
<span class="style-custom-label"
>Estimation Cost</span
>
</ng-template>
<ng-template let-value="value" ngx-datatable-cell-template>
<p class="style-custom-label">
{{
value.toLocaleString("id-ID", {
style: "currency",
currency: "IDR"
})
}}
</p>
</ng-template>
</ngx-datatable-column>
<ngx-datatable-column
name="totalUse"
[flexGrow]="1"
[minWidth]="90"
>
<ng-template ngx-datatable-header-template>
<span class="style-custom-label">Total Kwh</span>
</ng-template>
<ng-template let-value="value" ngx-datatable-cell-template>
<p class="style-custom-label">{{ value }}</p>
kWh
</ng-template>
</ngx-datatable-column>
<!-- <ngx-datatable-column
name="endDate"
[flexGrow]="1"
[minWidth]="90"
>
<ng-template ngx-datatable-header-template>
<span class="style-custom-label">Tanggal</span>
</ng-template>
<ng-template let-value="value" ngx-datatable-cell-template>
<p class="style-custom-label">
{{ value | date : "MM/yyyy" }}
</p>
</ng-template>
</ngx-datatable-column> -->
<ngx-datatable-column
name="status_id"
[flexGrow]="1"
[minWidth]="90"
>
<ng-template ngx-datatable-header-template>
<span class="style-custom-label">Status</span>
</ng-template>
<ng-template ngx-datatable-cell-template let-value="value">
<p class="style-custom-label">
{{ value === 2 ? "Aktif" : "Tidak Aktif" }}
</p>
</ng-template>
</ngx-datatable-column>
<ngx-datatable-column
name="Actions"
[flexGrow]="1"
[minWidth]="150"
>
<ng-template ngx-datatable-header-template>
<span class="style-custom-label">Actions</span>
</ng-template>
<ng-template
ngx-datatable-cell-template
let-rowIndex="rowIndex"
let-row="row"
>
<button
class="btn btn-sm btn-warning mr-1"
style="
background-color: #DDE1E6 !important;
border-color: #37A647 !important;
"
(click)="viewRow(row)"
>
<i
class="ficon ri-export-line"
style="color: #37A647 !important"
></i>
</button>
</ng-template>
</ngx-datatable-column>
</ngx-datatable>
</div>
</div>
</div>
</div>
</section>
</div>
</div>
</div>