Commit e26e4e01 authored by ari_darmawan's avatar ari_darmawan

add multi service list & fix range date

parent 495c4835
......@@ -99,18 +99,25 @@ export class LogbookComponent implements OnInit {
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);
};
const oneMonthBeforeStart = new Date(this.startValue);
oneMonthBeforeStart.setMonth(oneMonthBeforeStart.getMonth() - 1);
const ninetyDaysAfterStart = new Date(this.startValue);
ninetyDaysAfterStart.setDate(ninetyDaysAfterStart.getDate() + 90);
const now = new Date();
return (
current.getTime() < oneMonthBeforeStart.getTime() ||
current.getTime() > ninetyDaysAfterStart.getTime() ||
current.getTime() > now.getTime()
);
};
changeTab(i: number) {
this.listChildTabs.forEach(element => {
......
......@@ -4,8 +4,9 @@
export const environment = {
production: false,
"APIBASEURL" : "http://localhost:9825/",
"APIREPORTBASEURL" : "http://localhost:9825/",
"APIBASEURL" : "http://crm.nobubank.com/nobucall-api-v2/",
"APIREPORTBASEURL" : "http://crm.nobubank.com/nobucall-api-report/",
"APILISTBASEURL" : "http://crm.nobubank.com/nobucall-api-list/",
"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",
......
......@@ -11,6 +11,7 @@ import { environment } from '../../environments/environment';
//const API_URL = environment.apiUrl;
var API_REPORT = environment.APIREPORTBASEURL;
var API_LIST = environment.APILISTBASEURL;
var API_URL = environment.APIBASEURL;
var API_MICROSERVICE = environment.MICROSERVICEURL;
var ckConfig = environment.ckeConfig;
......@@ -255,7 +256,7 @@ export class TicketService {
'Authorization' : 'Bearer '+ service.getUserInformation.values.access_token
});
let options = { headers: headers };
return this.http.get(API_URL +'v3/nobutickets/0/0/'+idCaller+'/0/0/1/300' , options);
return this.http.get(API_LIST +'v3/nobutickets/0/0/'+idCaller+'/0/0/1/300' , options);
}
List(_data) {
......@@ -275,33 +276,33 @@ export class TicketService {
if(data.search != ""){
searchQ = '?search=' + data.Search
}
return this.http.get(API_URL +'v3/tickets/bycontact/' + service.getUserInformation.values.user_id + '/'+ data.TeamID + '/'+data.FilterTicket+'/'+data.Page+'/'+data.PerPage+''+searchQ, options);
return this.http.get(API_LIST +'v3/tickets/bycontact/' + service.getUserInformation.values.user_id + '/'+ data.TeamID + '/'+data.FilterTicket+'/'+data.Page+'/'+data.PerPage+''+searchQ, options);
}else if(data.FilterByContact == 'team'){
var searchQ = ""
if(data.search != ""){
searchQ = '?search=' + data.Search
}
return this.http.get(API_URL +'v3/tickets/bycontactteam/' + Team + '/'+data.FilterTicket+'/'+data.Page+'/'+data.PerPage+''+searchQ, options);
return this.http.get(API_LIST +'v3/tickets/bycontactteam/' + Team + '/'+data.FilterTicket+'/'+data.Page+'/'+data.PerPage+''+searchQ, options);
}else{
if(data.Search != ""){
//return this.http.get(API_URL +'v3/nobutickets/0/'+data.FilterTicket+'/0/0/0/'+data.Page+'/'+data.PerPage+'?search=' + data.Search, options);
if(service.getUserInformation.values.team_id == environment.Team.CsCabangBranchAgent){
return this.http.get(API_URL +'v3/nobutickets/0/'+data.FilterTicket+'/0/0/' + service.getUserInformation.values.user_id + '/'+data.Page+'/'+data.PerPage+'?search=' + data.Search, options);
return this.http.get(API_LIST +'v3/nobutickets/0/'+data.FilterTicket+'/0/0/' + service.getUserInformation.values.user_id + '/'+data.Page+'/'+data.PerPage+'?search=' + data.Search, options);
}else if(service.getUserInformation.values.team_id == environment.Team.SupervisorNobu){
return this.http.get(API_URL +'v3/nobutickets/0/'+data.FilterTicket+'/0/0/0/'+data.Page+'/'+data.PerPage+'?search=' + data.Search, options);
return this.http.get(API_LIST +'v3/nobutickets/0/'+data.FilterTicket+'/0/0/0/'+data.Page+'/'+data.PerPage+'?search=' + data.Search, options);
}
else{
return this.http.get(API_URL +'v3/nobutickets/0/'+data.FilterTicket+'/0/0/' + Team + '/'+data.Page+'/'+data.PerPage+'?search=' + data.Search, options);
return this.http.get(API_LIST +'v3/nobutickets/0/'+data.FilterTicket+'/0/0/' + Team + '/'+data.Page+'/'+data.PerPage+'?search=' + data.Search, options);
}
}else{
if(service.getUserInformation.values.team_id == environment.Team.CsCabangBranchAgent){
return this.http.get(API_URL +'v3/nobutickets/0/'+data.FilterTicket+'/0/0/' + service.getUserInformation.values.user_id + '/'+data.Page+'/'+data.PerPage+'', options);
return this.http.get(API_LIST +'v3/nobutickets/0/'+data.FilterTicket+'/0/0/' + service.getUserInformation.values.user_id + '/'+data.Page+'/'+data.PerPage+'', options);
}else if(service.getUserInformation.values.team_id == environment.Team.SupervisorNobu){
return this.http.get(API_URL +'v3/nobutickets/0/'+data.FilterTicket+'/0/0/0/'+data.Page+'/'+data.PerPage+'', options);
return this.http.get(API_LIST +'v3/nobutickets/0/'+data.FilterTicket+'/0/0/0/'+data.Page+'/'+data.PerPage+'', options);
}
else{
return this.http.get(API_URL +'v3/nobutickets/0/'+data.FilterTicket+'/0/0/' + Team+ '/'+data.Page+'/'+data.PerPage+'', options);
return this.http.get(API_LIST +'v3/nobutickets/0/'+data.FilterTicket+'/0/0/' + Team+ '/'+data.Page+'/'+data.PerPage+'', options);
}
}
......@@ -320,9 +321,9 @@ export class TicketService {
let options = { headers: headers };
if(data.Search != ""){
return this.http.get(API_URL +'v3/nobuticketswithoutteamid/0/'+data.FilterTicket+'/'+data.Page+'/'+data.PerPage+'?search=' + data.Search, options);
return this.http.get(API_LIST +'v3/nobuticketswithoutteamid/0/'+data.FilterTicket+'/'+data.Page+'/'+data.PerPage+'?search=' + data.Search, options);
}else{
return this.http.get(API_URL +'v3/nobuticketswithoutteamid/0/'+data.FilterTicket+'/'+data.Page+'/'+data.PerPage+'', options);
return this.http.get(API_LIST +'v3/nobuticketswithoutteamid/0/'+data.FilterTicket+'/'+data.Page+'/'+data.PerPage+'', options);
}
}
......@@ -347,7 +348,7 @@ export class TicketService {
});
let options = { headers: headers };
return this.http.get(API_URL +'v3/teams', options);
return this.http.get(API_LIST +'v3/teams', options);
}
GetTeamAgent(_data) {
......@@ -359,7 +360,7 @@ export class TicketService {
});
let options = { headers: headers };
return this.http.get(API_URL +'v3/teamagents/' + data.ID, options);
return this.http.get(API_LIST +'v3/teamagents/' + data.ID, options);
}
GetTopic() {
......@@ -370,7 +371,7 @@ export class TicketService {
});
let options = { headers: headers };
return this.http.get(API_URL +'v3/tickets/servicefamilies', options);
return this.http.get(API_LIST +'v3/tickets/servicefamilies', options);
}
GetTopicDetail(_data) {
......@@ -382,7 +383,7 @@ export class TicketService {
});
let options = { headers: headers };
return this.http.get(API_URL +'v3/tickets/servicefamily/byservice/'+ data.ServiceID, options);
return this.http.get(API_LIST +'v3/tickets/servicefamily/byservice/'+ data.ServiceID, options);
}
GetSubTopic(_data) {
......@@ -394,7 +395,7 @@ export class TicketService {
});
let options = { headers: headers };
return this.http.get(API_URL +'v3/tickets/services/' + data.ID, options);
return this.http.get(API_LIST +'v3/tickets/services/' + data.ID, options);
}
GetCategory(_data) {
......@@ -406,7 +407,7 @@ export class TicketService {
});
let options = { headers: headers };
return this.http.get(API_URL +'v3/tickets/subservices/' + data.ID, options);
return this.http.get(API_LIST +'v3/tickets/subservices/' + data.ID, options);
}
......@@ -513,7 +514,7 @@ export class TicketService {
});
let options = { headers: headers };
return this.http.get(API_URL +'v3/tickets/0/0/' + data.CallerID + '/0/1/20', options);
return this.http.get(API_LIST +'v3/tickets/0/0/' + data.CallerID + '/0/1/20', options);
}
TicketEventHistory(_data) {
......@@ -525,7 +526,7 @@ export class TicketService {
});
let options = { headers: headers };
return this.http.get(API_URL +'v3/ticket/history/' + data.TicketID + '/' + data.FinalClass, options);
return this.http.get(API_LIST +'v3/ticket/history/' + data.TicketID + '/' + data.FinalClass, options);
}
EmailLogs(_data) {
......@@ -560,7 +561,7 @@ export class TicketService {
});
let options = { headers: headers };
return this.http.get(API_URL +'v3/penyebabpengaduan', options);
return this.http.get(API_LIST +'v3/penyebabpengaduan', options);
}
......@@ -688,7 +689,7 @@ export class CustomerService {
});
let options = { headers: headers };
return this.http.get(API_URL +'v3/person/mobileno/' + data.MobileNumber, options);
return this.http.get(API_LIST +'v3/person/mobileno/' + data.MobileNumber, options);
}
GetPersonByIdentityIDNumber(_data) {
......@@ -700,7 +701,7 @@ export class CustomerService {
});
let options = { headers: headers };
return this.http.get(API_URL +'v3/person/idno/' + data.IdentityIDNumber, options);
return this.http.get(API_LIST +'v3/person/idno/' + data.IdentityIDNumber, options);
}
GetPersonByCallerID(_data) {
......@@ -712,7 +713,7 @@ export class CustomerService {
});
let options = { headers: headers };
return this.http.get(API_URL +'v3/person/' + data.CallerID, options);
return this.http.get(API_LIST +'v3/person/' + data.CallerID, options);
}
GetTicketContact(_data) {
......@@ -724,7 +725,7 @@ export class CustomerService {
});
let options = { headers: headers };
return this.http.get(API_URL +'v3/ticketcontact/' + data.TicketContactID, options);
return this.http.get(API_LIST +'v3/ticketcontact/' + data.TicketContactID, options);
}
AddNewCustomer(_data) {
......@@ -842,7 +843,7 @@ export class MacroService {
});
let options = { headers: headers };
return this.http.get(API_URL +'v3/precanned', options);
return this.http.get(API_LIST +'v3/precanned', options);
}
ListSearch(_id){
......@@ -854,7 +855,7 @@ export class MacroService {
});
let options = { headers: headers };
return this.http.get(API_URL +'v3/precanned/search/'+_id, options);
return this.http.get(API_LIST +'v3/precanned/search/'+_id, options);
}
Insert(_data){
......
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