perbaikan export cost management
This commit is contained in:
		
							parent
							
								
									3172ba70b2
								
							
						
					
					
						commit
						8403bafcd1
					
				@ -13,7 +13,7 @@
 | 
				
			|||||||
        href="https://allbestsistem.com/"
 | 
					        href="https://allbestsistem.com/"
 | 
				
			||||||
        target="_blank"
 | 
					        target="_blank"
 | 
				
			||||||
        style="background-color: #000000 !important;"
 | 
					        style="background-color: #000000 !important;"
 | 
				
			||||||
        >Smart Building Management Systems (V@2024-07-4.01)
 | 
					        >Smart Building Management Systems (V@2024-07-4.02)
 | 
				
			||||||
      </a></span
 | 
					      </a></span
 | 
				
			||||||
    >
 | 
					    >
 | 
				
			||||||
  </p>
 | 
					  </p>
 | 
				
			||||||
 | 
				
			|||||||
@ -95,14 +95,26 @@ export class CostManagementComponent implements OnInit {
 | 
				
			|||||||
          categoryName: item.category_name,
 | 
					          categoryName: item.category_name,
 | 
				
			||||||
          estimationCost: item.estimation_cost,
 | 
					          estimationCost: item.estimation_cost,
 | 
				
			||||||
          totalUse: item.total_use,
 | 
					          totalUse: item.total_use,
 | 
				
			||||||
          endDate: item.end_date,
 | 
					          endDate: this.convertToUTC7(item.end_date),
 | 
				
			||||||
 | 
					          // endDate: item.end_date,
 | 
				
			||||||
          statusId: item.status_id,
 | 
					          statusId: item.status_id,
 | 
				
			||||||
          categoryId: item.category_id,
 | 
					          categoryId: item.category_id,
 | 
				
			||||||
          roomId: item.room_id,
 | 
					          roomId: item.room_id,
 | 
				
			||||||
        }));
 | 
					        }));
 | 
				
			||||||
 | 
					        console.log(this.data_cost);
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
      });
 | 
					      });
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  convertToUTC7(dateString: string): string {
 | 
				
			||||||
 | 
					    const date = new Date(dateString);
 | 
				
			||||||
 | 
					    const utc7Offset = 7 * 60; // UTC+7 in minutes
 | 
				
			||||||
 | 
					    const localOffset = date.getTimezoneOffset();
 | 
				
			||||||
 | 
					    const totalOffset = utc7Offset - localOffset;
 | 
				
			||||||
 | 
					    const utc7Date = new Date(date.getTime() + totalOffset * 60 * 1000);
 | 
				
			||||||
 | 
					    return utc7Date.toISOString();
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  dataListMaster() {
 | 
					  dataListMaster() {
 | 
				
			||||||
    this.monitoringApiService.getMasterListData().subscribe((data) => {
 | 
					    this.monitoringApiService.getMasterListData().subscribe((data) => {
 | 
				
			||||||
      const dataCategory = data.data.find(
 | 
					      const dataCategory = data.data.find(
 | 
				
			||||||
@ -431,15 +443,15 @@ export class CostManagementComponent implements OnInit {
 | 
				
			|||||||
    this.spinnerExportActive = true;
 | 
					    this.spinnerExportActive = true;
 | 
				
			||||||
    setTimeout(() => {
 | 
					    setTimeout(() => {
 | 
				
			||||||
      const columnsToExport = [
 | 
					      const columnsToExport = [
 | 
				
			||||||
        "name",
 | 
					        "building",
 | 
				
			||||||
        "room_name",
 | 
					        "roomName",
 | 
				
			||||||
        "category_name",
 | 
					        "categoryName",
 | 
				
			||||||
        "total_use",
 | 
					        "totalUse",
 | 
				
			||||||
        "estimation_cost",
 | 
					        "estimationCost",
 | 
				
			||||||
        "end_date",
 | 
					        "endDate",
 | 
				
			||||||
      ];
 | 
					      ];
 | 
				
			||||||
      this.tableexcelService.exportAsExcelFileCostManage(
 | 
					      this.tableexcelService.exportAsExcelFileCostManage(
 | 
				
			||||||
        this.filteredRows,
 | 
					        this.data_cost,
 | 
				
			||||||
        "Smart_building_cost_management",
 | 
					        "Smart_building_cost_management",
 | 
				
			||||||
        columnsToExport
 | 
					        columnsToExport
 | 
				
			||||||
      );
 | 
					      );
 | 
				
			||||||
 | 
				
			|||||||
@ -138,7 +138,7 @@
 | 
				
			|||||||
                <p
 | 
					                <p
 | 
				
			||||||
                  class="card-subtitle line-on-side text-muted text-center font-small-3 mx-2 my-1"
 | 
					                  class="card-subtitle line-on-side text-muted text-center font-small-3 mx-2 my-1"
 | 
				
			||||||
                >
 | 
					                >
 | 
				
			||||||
                  <span>(v@2024.07.4.01)</span>
 | 
					                  <span>(v@2024.07.4.02)</span>
 | 
				
			||||||
                </p>
 | 
					                </p>
 | 
				
			||||||
                <!-- <div class="card-body">
 | 
					                <!-- <div class="card-body">
 | 
				
			||||||
                  <a
 | 
					                  <a
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user