Commit 495c4835 authored by ari_darmawan's avatar ari_darmawan

Released: create multi service

parent b69829bb
......@@ -599,7 +599,7 @@
<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>
<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="col-12 col-sm-6 col-md-2 col-lg-2">
<p class="text-muted">
......
......@@ -769,7 +769,7 @@ export class AdminTicketOnpicDetailComponent implements OnInit {
}
EmailLogDetailClick(_ID){
this.GettingEmailLogsDetailAPI({ID : _ID})
// this.GettingEmailLogsDetailAPI({ID : _ID})
}
DownloadAttchemtnFileLog(_i){
......
......@@ -789,7 +789,7 @@ export class AdminTicketDetailComponent implements OnInit {
}
EmailLogDetailClick(_ID){
this.GettingEmailLogsDetailAPI({ID : _ID})
// this.GettingEmailLogsDetailAPI({ID : _ID})
}
DownloadAttchemtnFileLog(_i){
......
<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">
<p style="font-size: 15px;">DASHBOARD</p>
</div>
<div class="col-12 col-sm-6 col-md-4 col-lg-2">
<label class="text-muted"><small><b>Start Date</b> </small></label>
<nz-date-picker
[nzDisabledDate]="disabledStartDate"
nzFormat="yyyy-MM-dd"
[(ngModel)]="startValue"
nzPlaceHolder="Start Date"
(ngModelChange)="GettingDashboardCardColorsDataAPI()"
nzAllowClear="false"
>
</nz-date-picker>
</div>
<div class="col-12 col-sm-6 col-md-4 col-lg-2">
<label class="text-muted"><small><b>End Date </b></small></label>
<nz-date-picker
[nzDisabledDate]="disabledEndDate"
nzFormat="yyyy-MM-dd"
[(ngModel)]="endValue"
nzPlaceHolder="End Date"
(ngModelChange)="GettingDashboardCardColorsDataAPI()"
nzAllowClear="false"
>
</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">
......@@ -28,7 +52,7 @@
</div>
</div>
</div>
</div>
</div> -->
</div>
<p *ngIf="isDashboardCardEmpty" style="font-size:18px;" class="text-muted text-center">
......
......@@ -6,6 +6,7 @@ import { ServiceProxyWeb } from '../../../shared/serviceproxy/service-proxy.serv
import { Data, Router } from '@angular/router';
import { ChangeDetectorRef } from '@angular/core';
import { environment } from '../../../environments/environment.prod';
import { DisabledDateFn } from 'ng-zorro-antd/date-picker/standard-types';
declare const AratakaConfig : any;
@Component({
......@@ -41,6 +42,8 @@ export class LogbookComponent implements OnInit {
listChildTabs: any[] = [];
isLoadingChild: boolean = false;
isEmptyChild: boolean = false;
startValue: Date = new Date();
endValue: Date = new Date();
public TicketReportRequest = {
page : 1,
......@@ -65,9 +68,9 @@ export class LogbookComponent implements OnInit {
ngOnInit() {
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());
this.startValue.setMonth(this.startValue.getMonth() - 3)
AratakaConfig.BootstrapDateRangeCustomPicker({
StartDate : {
ID : '#StartDate',
......@@ -92,6 +95,23 @@ export class LogbookComponent implements OnInit {
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) {
this.listChildTabs.forEach(element => {
element.selected = false;
......@@ -112,8 +132,10 @@ export class LogbookComponent implements OnInit {
}
GettingDashboardCardColorsDataAPI() {
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.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.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;
else if(this._SP.getUserInformation.values.team_id == this.Env.Team.ServiceDesk) this.DashboardCountRequest.user_id = this._SP.SERVICE_DESK_ID;
this.dashboardListCard = [];
......@@ -282,8 +304,10 @@ export class LogbookComponent implements OnInit {
this.TicketReportRequest.servicefamily_name = this.listChildTabs[0].name;
this.TicketReportRequest.user_id = this.DashboardCountRequest.user_id;
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.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.start_date = this.startValue;
this.TicketReportRequest.end_date = this.endValue;
this.paramsRequest = JSON.stringify(this.TicketReportRequest);
this.isEmptyChild = false;
this.isLoadingChild = false;
......
......@@ -347,6 +347,10 @@ export class TabsLogbookComponent implements OnInit, OnChanges {
}
GettingTicketReportDataAPI(){
if (!this.listRequest.servicefamily_id) {
AratakaConfig.Alert.showAlert('Please Wait Loading Card Dashboard','alert-danger',2000)
return false;
}
this.isDisabledButtonSearch = true;
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;
......@@ -397,6 +401,7 @@ export class TabsLogbookComponent implements OnInit, OnChanges {
document.body.removeChild(a);
URL.revokeObjectURL(objectUrl);
this.listRequest.is_export = null;
this.fieldExport.forEach(element => {
element.value = false;
});
......
......@@ -78,7 +78,7 @@ export class LoginLogsComponent implements OnInit {
}
ngOnInit() {
this.requestLogLogin();
// this.requestLogLogin();
var StartD= new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate());
StartD.setMonth(StartD.getMonth() -3)
......@@ -107,7 +107,7 @@ export class LoginLogsComponent implements OnInit {
if (this.listRequest.filter_page < Math.ceil(this.loginLogs.count / this.listRequest.filter_limit)) {
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.requestLogLogin();
// this.requestLogLogin();
}
}
......@@ -130,14 +130,14 @@ export class LoginLogsComponent implements OnInit {
if(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.requestLogLogin();
// this.requestLogLogin();
}
}
onSearch() {
this.listRequest.filter_limit = 10;
this.listRequest.filter_page = 1;
this.requestLogLogin();
// this.requestLogLogin();
}
exportFile() {
......
......@@ -4,7 +4,8 @@
export const environment = {
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/",
"SITE_NAME" : "Visionet Helpdesk System",
"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';
import { environment } from '../../environments/environment';
//const API_URL = environment.apiUrl;
var API_REPORT = environment.APIREPORTBASEURL;
var API_URL = environment.APIBASEURL;
var API_MICROSERVICE = environment.MICROSERVICEURL;
var ckConfig = environment.ckeConfig;
......@@ -996,7 +997,7 @@ export class DashboardService {
'Authorization' : 'Bearer '+ service.getUserInformation.values.access_token
});
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 {
'Authorization' : 'Bearer '+ service.getUserInformation.values.access_token
});
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 {
'Authorization' : 'Bearer '+ service.getUserInformation.values.access_token
});
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 {
'Authorization' : 'Bearer '+ service.getUserInformation.values.access_token
});
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 {
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> {
......@@ -1123,7 +1124,7 @@ export class DashboardService {
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