Commit 495c4835 authored by ari_darmawan's avatar ari_darmawan

Released: create multi service

parent b69829bb
...@@ -599,7 +599,7 @@ ...@@ -599,7 +599,7 @@
<div class="card-body" style="max-height: 610px;overflow-y: scroll;"> <div class="card-body" style="max-height: 610px;overflow-y: scroll;">
<p *ngIf="EmailLogsData.length == 0" class="text-center"><b>No E-mail Log</b></p> <p *ngIf="EmailLogsData.length == 0" class="text-center"><b>No E-mail Log</b></p>
<ng-container *ngFor="let data of EmailLogsData; let i = index"> <ng-container *ngFor="let data of EmailLogsData; let i = index">
<div class="divider-custom" (click)="EmailLogDetailClick(data.id)"> <div class="divider-custom">
<div class="row"> <div class="row">
<div class="col-12 col-sm-6 col-md-2 col-lg-2"> <div class="col-12 col-sm-6 col-md-2 col-lg-2">
<p class="text-muted"> <p class="text-muted">
......
...@@ -769,7 +769,7 @@ export class AdminTicketOnpicDetailComponent implements OnInit { ...@@ -769,7 +769,7 @@ export class AdminTicketOnpicDetailComponent implements OnInit {
} }
EmailLogDetailClick(_ID){ EmailLogDetailClick(_ID){
this.GettingEmailLogsDetailAPI({ID : _ID}) // this.GettingEmailLogsDetailAPI({ID : _ID})
} }
DownloadAttchemtnFileLog(_i){ DownloadAttchemtnFileLog(_i){
......
...@@ -789,7 +789,7 @@ export class AdminTicketDetailComponent implements OnInit { ...@@ -789,7 +789,7 @@ export class AdminTicketDetailComponent implements OnInit {
} }
EmailLogDetailClick(_ID){ EmailLogDetailClick(_ID){
this.GettingEmailLogsDetailAPI({ID : _ID}) // this.GettingEmailLogsDetailAPI({ID : _ID})
} }
DownloadAttchemtnFileLog(_i){ DownloadAttchemtnFileLog(_i){
......
<div class="container" style="margin-top: -20px;"> <div class="container" style="margin-top: -20px;">
<div class="row"> <div class="row mb-4">
<div class="col-12 col-sm-6 col-md-4 col-lg-8"> <div class="col-12 col-sm-6 col-md-4 col-lg-8">
<p style="font-size: 15px;">DASHBOARD</p> <p style="font-size: 15px;">DASHBOARD</p>
</div> </div>
<div class="col-12 col-sm-6 col-md-4 col-lg-2"> <div class="col-12 col-sm-6 col-md-4 col-lg-2">
<div class="form-group" > <label class="text-muted"><small><b>Start Date</b> </small></label>
<label class="text-muted"><small>Start Date </small></label> <nz-date-picker
<div class="input-group date" id="StartDate" data-target-input="nearest"> [nzDisabledDate]="disabledStartDate"
<input type="text" nzFormat="yyyy-MM-dd"
class="form-control form-control-sm datetimepicker-input" data-toggle="datetimepicker" [(ngModel)]="startValue"
data-target="#StartDate" (blur)="GettingDashboardCardColorsDataAPI()"/> nzPlaceHolder="Start Date"
<div class="input-group-append" data-target="#StartDate" data-toggle="datetimepicker"> (ngModelChange)="GettingDashboardCardColorsDataAPI()"
<div class="input-group-text"><i class="far fa-calendar-alt"></i></div> nzAllowClear="false"
</div> >
</div> </nz-date-picker>
</div>
</div> </div>
<div class="col-12 col-sm-6 col-md-4 col-lg-2"> <div class="col-12 col-sm-6 col-md-4 col-lg-2">
<div class="form-group"> <label class="text-muted"><small><b>End Date </b></small></label>
<label class="text-muted"><small>End Date </small></label> <nz-date-picker
<div class="input-group date" id="EndDate" data-target-input="nearest"> [nzDisabledDate]="disabledEndDate"
<input type="text" nzFormat="yyyy-MM-dd"
class="form-control form-control-sm datetimepicker-input" data-toggle="datetimepicker" [(ngModel)]="endValue"
data-target="#EndDate" (blur)="GettingDashboardCardColorsDataAPI()"/> nzPlaceHolder="End Date"
<div class="input-group-append" data-target="#EndDate" data-toggle="datetimepicker"> (ngModelChange)="GettingDashboardCardColorsDataAPI()"
<div class="input-group-text"><i class="far fa-calendar-alt"></i></div> nzAllowClear="false"
</div> >
</nz-date-picker>
</div>
<!-- <div class="col-12 col-sm-6 col-md-4 col-lg-2">
<div class="form-group" >
<label class="text-muted"><small>Start Date </small></label>
<div class="input-group date" id="StartDate" data-target-input="nearest">
<input type="text"
class="form-control form-control-sm datetimepicker-input" data-toggle="datetimepicker"
data-target="#StartDate" (blur)="GettingDashboardCardColorsDataAPI()"/>
<div class="input-group-append" data-target="#StartDate" data-toggle="datetimepicker">
<div class="input-group-text"><i class="far fa-calendar-alt"></i></div>
</div>
</div>
</div>
</div>
<div class="col-12 col-sm-6 col-md-4 col-lg-2">
<div class="form-group">
<label class="text-muted"><small>End Date </small></label>
<div class="input-group date" id="EndDate" data-target-input="nearest">
<input type="text"
class="form-control form-control-sm datetimepicker-input" data-toggle="datetimepicker"
data-target="#EndDate" (blur)="GettingDashboardCardColorsDataAPI()"/>
<div class="input-group-append" data-target="#EndDate" data-toggle="datetimepicker">
<div class="input-group-text"><i class="far fa-calendar-alt"></i></div>
</div> </div>
</div> </div>
</div> </div>
</div> -->
</div> </div>
<p *ngIf="isDashboardCardEmpty" style="font-size:18px;" class="text-muted text-center"> <p *ngIf="isDashboardCardEmpty" style="font-size:18px;" class="text-muted text-center">
......
...@@ -6,6 +6,7 @@ import { ServiceProxyWeb } from '../../../shared/serviceproxy/service-proxy.serv ...@@ -6,6 +6,7 @@ import { ServiceProxyWeb } from '../../../shared/serviceproxy/service-proxy.serv
import { Data, Router } from '@angular/router'; import { Data, Router } from '@angular/router';
import { ChangeDetectorRef } from '@angular/core'; import { ChangeDetectorRef } from '@angular/core';
import { environment } from '../../../environments/environment.prod'; import { environment } from '../../../environments/environment.prod';
import { DisabledDateFn } from 'ng-zorro-antd/date-picker/standard-types';
declare const AratakaConfig : any; declare const AratakaConfig : any;
@Component({ @Component({
...@@ -41,6 +42,8 @@ export class LogbookComponent implements OnInit { ...@@ -41,6 +42,8 @@ export class LogbookComponent implements OnInit {
listChildTabs: any[] = []; listChildTabs: any[] = [];
isLoadingChild: boolean = false; isLoadingChild: boolean = false;
isEmptyChild: boolean = false; isEmptyChild: boolean = false;
startValue: Date = new Date();
endValue: Date = new Date();
public TicketReportRequest = { public TicketReportRequest = {
page : 1, page : 1,
...@@ -65,9 +68,9 @@ export class LogbookComponent implements OnInit { ...@@ -65,9 +68,9 @@ export class LogbookComponent implements OnInit {
ngOnInit() { ngOnInit() {
var StartD= new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate()); var StartD= new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate());
StartD.setMonth(StartD.getMonth() -6) StartD.setMonth(StartD.getMonth() - 1)
var EndD = new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate()); var EndD = new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate());
this.startValue.setMonth(this.startValue.getMonth() - 3)
AratakaConfig.BootstrapDateRangeCustomPicker({ AratakaConfig.BootstrapDateRangeCustomPicker({
StartDate : { StartDate : {
ID : '#StartDate', ID : '#StartDate',
...@@ -92,6 +95,23 @@ export class LogbookComponent implements OnInit { ...@@ -92,6 +95,23 @@ export class LogbookComponent implements OnInit {
this.GettingDashboardCardColorsDataAPI() this.GettingDashboardCardColorsDataAPI()
} }
disabledStartDate: DisabledDateFn = (current: Date): boolean => {
if (!this.startValue || !this.endValue) {
return false;
}
// Mengembalikan true jika tanggal saat ini lebih besar dari satu bulan dari EndDate
return current.getTime() > this.endValue.getTime() || current.getTime() < this.endValue.getTime() - (90 * 24 * 60 * 60 * 1000);
};
// Fungsi untuk menentukan tanggal yang akan dinonaktifkan pada EndDate
disabledEndDate: DisabledDateFn = (current: Date): boolean => {
if (!this.startValue || !this.endValue) {
return false;
}
// Mengembalikan true jika tanggal saat ini lebih kecil dari satu bulan dari StartDate atau lebih besar dari StartDate
return current.getTime() < this.startValue.getTime() || current.getTime() > this.startValue.getTime() + (90 * 24 * 60 * 60 * 1000);
};
changeTab(i: number) { changeTab(i: number) {
this.listChildTabs.forEach(element => { this.listChildTabs.forEach(element => {
element.selected = false; element.selected = false;
...@@ -112,8 +132,10 @@ export class LogbookComponent implements OnInit { ...@@ -112,8 +132,10 @@ export class LogbookComponent implements OnInit {
} }
GettingDashboardCardColorsDataAPI() { GettingDashboardCardColorsDataAPI() {
this.DashboardCountRequest.start_date = AratakaConfig.BootstrapDateCustomPicker({ ID: '#StartDate', isGet: true, isGetFormat: 'YYYY-MM-DD'}); // this.DashboardCountRequest.start_date = AratakaConfig.BootstrapDateCustomPicker({ ID: '#StartDate', isGet: true, isGetFormat: 'YYYY-MM-DD'});
this.DashboardCountRequest.end_date = AratakaConfig.BootstrapDateCustomPicker({ ID: '#EndDate', isGet: true, isGetFormat: 'YYYY-MM-DD' }); // this.DashboardCountRequest.end_date = AratakaConfig.BootstrapDateCustomPicker({ ID: '#EndDate', isGet: true, isGetFormat: 'YYYY-MM-DD' });
this.DashboardCountRequest.start_date = this.startValue;
this.DashboardCountRequest.end_date = this.endValue;
if(this._SP.getUserInformation.values.team_id == this.Env.Team.ServiceReport) this.DashboardCountRequest.user_id = null; if(this._SP.getUserInformation.values.team_id == this.Env.Team.ServiceReport) this.DashboardCountRequest.user_id = null;
else if(this._SP.getUserInformation.values.team_id == this.Env.Team.ServiceDesk) this.DashboardCountRequest.user_id = this._SP.SERVICE_DESK_ID; else if(this._SP.getUserInformation.values.team_id == this.Env.Team.ServiceDesk) this.DashboardCountRequest.user_id = this._SP.SERVICE_DESK_ID;
this.dashboardListCard = []; this.dashboardListCard = [];
...@@ -282,8 +304,10 @@ export class LogbookComponent implements OnInit { ...@@ -282,8 +304,10 @@ export class LogbookComponent implements OnInit {
this.TicketReportRequest.servicefamily_name = this.listChildTabs[0].name; this.TicketReportRequest.servicefamily_name = this.listChildTabs[0].name;
this.TicketReportRequest.user_id = this.DashboardCountRequest.user_id; this.TicketReportRequest.user_id = this.DashboardCountRequest.user_id;
this.TicketReportRequest.start_date = AratakaConfig.GetDateBDTP({ ID: '#StartDate', isGet: true, isGetFormat: 'YYYY-MM-DD'}); // this.TicketReportRequest.start_date = AratakaConfig.GetDateBDTP({ ID: '#StartDate', isGet: true, isGetFormat: 'YYYY-MM-DD'});
this.TicketReportRequest.end_date = AratakaConfig.GetDateBDTP({ ID: '#EndDate', isGet: true, isGetFormat: 'YYYY-MM-DD' }); // this.TicketReportRequest.end_date = AratakaConfig.GetDateBDTP({ ID: '#EndDate', isGet: true, isGetFormat: 'YYYY-MM-DD' });
this.TicketReportRequest.start_date = this.startValue;
this.TicketReportRequest.end_date = this.endValue;
this.paramsRequest = JSON.stringify(this.TicketReportRequest); this.paramsRequest = JSON.stringify(this.TicketReportRequest);
this.isEmptyChild = false; this.isEmptyChild = false;
this.isLoadingChild = false; this.isLoadingChild = false;
......
...@@ -347,6 +347,10 @@ export class TabsLogbookComponent implements OnInit, OnChanges { ...@@ -347,6 +347,10 @@ export class TabsLogbookComponent implements OnInit, OnChanges {
} }
GettingTicketReportDataAPI(){ GettingTicketReportDataAPI(){
if (!this.listRequest.servicefamily_id) {
AratakaConfig.Alert.showAlert('Please Wait Loading Card Dashboard','alert-danger',2000)
return false;
}
this.isDisabledButtonSearch = true; this.isDisabledButtonSearch = true;
this.listRequest.team_id = this._SP.getUserInformation.values.team_id == this.Env.Team.ServiceReport ? null : this.TeamID; this.listRequest.team_id = this._SP.getUserInformation.values.team_id == this.Env.Team.ServiceReport ? null : this.TeamID;
// this.listRequest.user_id = this._SP.getUserInformation.values.team_id == this.Env.Team.ServiceReport ? null : this.listRequest.user_id; // this.listRequest.user_id = this._SP.getUserInformation.values.team_id == this.Env.Team.ServiceReport ? null : this.listRequest.user_id;
...@@ -397,6 +401,7 @@ export class TabsLogbookComponent implements OnInit, OnChanges { ...@@ -397,6 +401,7 @@ export class TabsLogbookComponent implements OnInit, OnChanges {
document.body.removeChild(a); document.body.removeChild(a);
URL.revokeObjectURL(objectUrl); URL.revokeObjectURL(objectUrl);
this.listRequest.is_export = null;
this.fieldExport.forEach(element => { this.fieldExport.forEach(element => {
element.value = false; element.value = false;
}); });
......
...@@ -78,7 +78,7 @@ export class LoginLogsComponent implements OnInit { ...@@ -78,7 +78,7 @@ export class LoginLogsComponent implements OnInit {
} }
ngOnInit() { ngOnInit() {
this.requestLogLogin(); // this.requestLogLogin();
var StartD= new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate()); var StartD= new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate());
StartD.setMonth(StartD.getMonth() -3) StartD.setMonth(StartD.getMonth() -3)
...@@ -107,7 +107,7 @@ export class LoginLogsComponent implements OnInit { ...@@ -107,7 +107,7 @@ export class LoginLogsComponent implements OnInit {
if (this.listRequest.filter_page < Math.ceil(this.loginLogs.count / this.listRequest.filter_limit)) { if (this.listRequest.filter_page < Math.ceil(this.loginLogs.count / this.listRequest.filter_limit)) {
this.listRequest.filter_page += count this.listRequest.filter_page += count
this.loginLogs.pageTitle = "Page "+ this.listRequest.filter_page +" from " + Math.ceil(this.loginLogs.count / this.listRequest.filter_limit) + ', Total ' + this.loginLogs.count + ' Data'; this.loginLogs.pageTitle = "Page "+ this.listRequest.filter_page +" from " + Math.ceil(this.loginLogs.count / this.listRequest.filter_limit) + ', Total ' + this.loginLogs.count + ' Data';
this.requestLogLogin(); // this.requestLogLogin();
} }
} }
...@@ -130,14 +130,14 @@ export class LoginLogsComponent implements OnInit { ...@@ -130,14 +130,14 @@ export class LoginLogsComponent implements OnInit {
if(this.listRequest.filter_page != 1){ if(this.listRequest.filter_page != 1){
this.listRequest.filter_page -= 1 this.listRequest.filter_page -= 1
this.loginLogs.pageTitle = "Page "+this.listRequest.filter_page+" from " + Math.ceil(this.loginLogs.count / this.listRequest.filter_limit) + ', Total ' + this.loginLogs.count + ' Data'; this.loginLogs.pageTitle = "Page "+this.listRequest.filter_page+" from " + Math.ceil(this.loginLogs.count / this.listRequest.filter_limit) + ', Total ' + this.loginLogs.count + ' Data';
this.requestLogLogin(); // this.requestLogLogin();
} }
} }
onSearch() { onSearch() {
this.listRequest.filter_limit = 10; this.listRequest.filter_limit = 10;
this.listRequest.filter_page = 1; this.listRequest.filter_page = 1;
this.requestLogLogin(); // this.requestLogLogin();
} }
exportFile() { exportFile() {
......
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
export const environment = { export const environment = {
production: false, production: false,
"APIBASEURL" : "http://crm.nobubank.com/nobucall-api-v2/", "APIBASEURL" : "http://localhost:9825/",
"APIREPORTBASEURL" : "http://localhost:9825/",
"MICROSERVICEURL" : "http://crm.nobubank.com/nobucall-api-log/api/v1/", "MICROSERVICEURL" : "http://crm.nobubank.com/nobucall-api-log/api/v1/",
"SITE_NAME" : "Visionet Helpdesk System", "SITE_NAME" : "Visionet Helpdesk System",
"SITE_LOGO" : "https://i0.wp.com/jogorogo.info/wp-content/uploads/2017/07/logo_visionet.png?fit=879%2C227", "SITE_LOGO" : "https://i0.wp.com/jogorogo.info/wp-content/uploads/2017/07/logo_visionet.png?fit=879%2C227",
......
...@@ -10,6 +10,7 @@ import { Subscription } from 'rxjs'; ...@@ -10,6 +10,7 @@ import { Subscription } from 'rxjs';
import { environment } from '../../environments/environment'; import { environment } from '../../environments/environment';
//const API_URL = environment.apiUrl; //const API_URL = environment.apiUrl;
var API_REPORT = environment.APIREPORTBASEURL;
var API_URL = environment.APIBASEURL; var API_URL = environment.APIBASEURL;
var API_MICROSERVICE = environment.MICROSERVICEURL; var API_MICROSERVICE = environment.MICROSERVICEURL;
var ckConfig = environment.ckeConfig; var ckConfig = environment.ckeConfig;
...@@ -996,7 +997,7 @@ export class DashboardService { ...@@ -996,7 +997,7 @@ export class DashboardService {
'Authorization' : 'Bearer '+ service.getUserInformation.values.access_token 'Authorization' : 'Bearer '+ service.getUserInformation.values.access_token
}); });
let options = { headers: headers }; let options = { headers: headers };
return this.http.post(API_URL +'v3/dashboard', _data, options); return this.http.post(API_REPORT +'v3/dashboard', _data, options);
} }
...@@ -1033,7 +1034,7 @@ export class DashboardService { ...@@ -1033,7 +1034,7 @@ export class DashboardService {
'Authorization' : 'Bearer '+ service.getUserInformation.values.access_token 'Authorization' : 'Bearer '+ service.getUserInformation.values.access_token
}); });
let options = { headers: headers }; let options = { headers: headers };
return this.http.post(API_URL +'v3/report/logbook', _data, options); return this.http.post(API_REPORT +'v3/report/logbook', _data, options);
} }
...@@ -1048,7 +1049,7 @@ export class DashboardService { ...@@ -1048,7 +1049,7 @@ export class DashboardService {
'Authorization' : 'Bearer '+ service.getUserInformation.values.access_token 'Authorization' : 'Bearer '+ service.getUserInformation.values.access_token
}); });
let options = { headers: headers }; let options = { headers: headers };
return this.http.get(API_URL +'v3/report/logbook/category/'+_TeamID, options); return this.http.get(API_REPORT +'v3/report/logbook/category/'+_TeamID, options);
} }
...@@ -1061,7 +1062,7 @@ export class DashboardService { ...@@ -1061,7 +1062,7 @@ export class DashboardService {
'Authorization' : 'Bearer '+ service.getUserInformation.values.access_token 'Authorization' : 'Bearer '+ service.getUserInformation.values.access_token
}); });
let options = { headers: headers }; let options = { headers: headers };
return this.http.post(API_URL +'v3/report/ticketcount', _data, options); return this.http.post(API_REPORT +'v3/report/ticketcount', _data, options);
} }
...@@ -1091,7 +1092,7 @@ export class DashboardService { ...@@ -1091,7 +1092,7 @@ export class DashboardService {
responseType: 'arraybuffer' responseType: 'arraybuffer'
} }
return this.http.post<any>(API_URL +'v3/dashboard/export',_data, requestOptions); return this.http.post<any>(API_REPORT +'v3/dashboard/export',_data, requestOptions);
} }
downloadFileExcelReport(_data: any) :Observable<any> { downloadFileExcelReport(_data: any) :Observable<any> {
...@@ -1123,7 +1124,7 @@ export class DashboardService { ...@@ -1123,7 +1124,7 @@ export class DashboardService {
responseType: 'arraybuffer' responseType: 'arraybuffer'
} }
return this.http.post<any>(API_URL +'v3/report/logbook',_data, requestOptions); return this.http.post<any>(API_REPORT +'v3/report/logbook',_data, requestOptions);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment