|
|
@@ -161,8 +161,7 @@ export class AssetsComponent implements OnInit {
|
|
|
else {
|
|
|
this.city = this.listAssets.find(object=>object.id == this.assetID).city;
|
|
|
}
|
|
|
- console.log("asset city");
|
|
|
- console.log(this.city);
|
|
|
+
|
|
|
let tempAsset = this.listAssets.find(object=>object.id == this.assetID);
|
|
|
|
|
|
if (tempAsset["meters_installed"].length > 0){
|
|
|
@@ -195,7 +194,7 @@ export class AssetsComponent implements OnInit {
|
|
|
//this.chartjs = true;
|
|
|
setTimeout(()=>{
|
|
|
Swal.close();
|
|
|
- }, 2500);
|
|
|
+ }, 3000);
|
|
|
}
|
|
|
|
|
|
// Default check asset dropdown if a value is equal to an assetID
|
|
|
@@ -219,7 +218,8 @@ export class AssetsComponent implements OnInit {
|
|
|
this.assetID = event.target.value;
|
|
|
let tempAsset = this.listAssets.find(object=>object.id == this.assetID);
|
|
|
this.city = tempAsset["city"];
|
|
|
-
|
|
|
+ this.total_savings = 0;
|
|
|
+ this.last_day_savings = 0;
|
|
|
if (tempAsset["meters_installed"].length > 0){
|
|
|
this.metersInstalled = true;
|
|
|
this.getSavings(this.assetID);
|
|
|
@@ -227,13 +227,25 @@ export class AssetsComponent implements OnInit {
|
|
|
this.getMeasureRangeChart(this.view, this.initialDate, this.assetID);
|
|
|
this.getEnvironmentalData(this.assetID);
|
|
|
}
|
|
|
- else {
|
|
|
- this.metersInstalled = false;
|
|
|
- if (this.chart1 != undefined){
|
|
|
- this.chart1.destroy();
|
|
|
- }
|
|
|
- this.chart1 = undefined;
|
|
|
- this.chart1 = new Chart('canvas', {});
|
|
|
+ else {
|
|
|
+
|
|
|
+ Swal.fire({
|
|
|
+ allowOutsideClick: false,
|
|
|
+ type: 'info',
|
|
|
+ text: 'Espere por favor...'
|
|
|
+ });
|
|
|
+ Swal.showLoading();
|
|
|
+ setTimeout(()=>{
|
|
|
+ Swal.close();
|
|
|
+ this.metersInstalled = false;
|
|
|
+ if (this.chart1 != undefined ){
|
|
|
+ this.chart1.destroy();
|
|
|
+ }
|
|
|
+ this.chart1 = undefined;
|
|
|
+ this.chart1 = new Chart('canvas', {});
|
|
|
+
|
|
|
+ }, 3000);
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -553,7 +565,7 @@ export class AssetsComponent implements OnInit {
|
|
|
});
|
|
|
setTimeout(()=>{
|
|
|
Swal.close();
|
|
|
- }, 1600)
|
|
|
+ }, 1800)
|
|
|
}
|
|
|
|
|
|
getDateWithFormat(view:string, date:string){
|