Commit 565f5925 authored by ari_darmawan's avatar ari_darmawan

change behavior logbook pda team and behavior config env

parent cad53651
......@@ -11,7 +11,157 @@
(click)="GettingExcelForReportDataAPI()">
Download Excel <i class="fas fa-download"></i>
</span>
<!-- <div class="table-responsive mt-4">
<table class="table table-bordered table-striped table-sm">
<thead>
<tr>
<th rowspan="2" style="max-width: 15px;">#</th>
<th *ngFor="let data of fieldExport; let i = index">
<div class="form-check">
<input type="checkbox" class="form-check-input" [checked]="data['value']" id="exampleCheck1" (change)="onChangeFieldReport(i, $event)">
<label class="form-check-label" for="exampleCheck1">{{data['field']}}</label>
</div>
</th>
</tr>
</thead>
<tbody>
<div *ngIf="TeamID == Env.Team.SociomileStaff">
<tr *ngFor="let data of listLogbooks.data; let i = index">
<td class="col-1">{{((i+1) + ((listRequest.perpage * listRequest.page) - listRequest.perpage))}}.</td>
<td>{{data.ref}}</td>
<td>{{data.createdby_name}}</td>
<td>{{data.start_date}}</td>
<td>{{data.caller_name}}</td>
<td>{{data.caller_mobile_phone}}</td>
<td>{{data.ticket_servicefamiliy_name}}</td>
<td>{{data.ticket_service_name}}</td>
<td>{{data.ticket_servicesubcategory_name}}</td>
<td>{{data.title}}</td>
<td>{{data.team_name}}</td>
<td>{{data.sla_internal}}</td>
<td>{{data.ticket_status}}</td>
<td>{{data.resolve_date}}</td>
<td>{{data.cscabang}}</td>
</tr>
</div>
<div *ngIf="TeamID == Env.Team.CsCabangBranchAgent">
<tr *ngFor="let data of listLogbooks.data; let i = index">
<td class="col-1">{{((i+1) + ((listRequest.perpage * listRequest.page) - listRequest.perpage))}}.</td>
<td>{{data.ref}}</td>
<td>{{data.createdby_name}}</td>
<td>{{data.start_date}}</td>
<td>{{data.caller_name}}</td>
<td>{{data.caller_mobile_phone}}</td>
<td>{{data.ticket_servicefamiliy_name}}</td>
<td>{{data.ticket_servicesubcategory_name}}</td>
<td>{{data.title}}</td>
<td>{{data.team_name}}</td>
<td>{{data.sla_internal}}</td>
<td>{{data.ticket_status}}</td>
<td>{{data.resolve_date}}</td>
<td>{{data.cscabang}}</td>
<td>{{data.supervisor}}</td>
</tr>
</div>
<div *ngIf="TeamID == Env.Team.AgentCallCenter">
<tr *ngFor="let data of listLogbooks.data; let i = index">
<td class="col-1">{{((i+1) + ((listRequest.perpage * listRequest.page) - listRequest.perpage))}}.</td>
<td>{{data.ref}}</td>
<td>{{data.createdby_name}}</td>
<td>{{data.agent_name}}</td>
<td>{{data.unit_pengaduan}}</td>
<td>{{data.start_date}}</td>
<td>{{data.caller_name}}</td>
<td>{{data.caller_mobile_phone}}</td>
<td>{{data.no_rekening}}</td>
<td>{{data.no_kartu_atm}}</td>
<td>{{data.penyebab_pengaduan}}</td>
<td>{{data.ticket_servicefamiliy_name}}</td>
<td>{{data.ticket_service_name}}</td>
<td>{{data.ticket_servicesubcategory_name}}</td>
<td>{{data.deskripsi}}</td>
<td>{{data.tanggal_transaksi}}</td>
<td>{{data.e_channel}}</td>
<td>{{data.kategori}}</td>
<td>{{data.tidak_lanjut}}</td>
<td>{{data.team_name}}</td>
<td>{{data.pic}}</td>
<td>{{(data.ticket_solution != null)? (data.ticket_solution | pipeSubstring) : ''}}</td>
<td>{{data.ticket_status}}</td>
<td>{{data.resolve_date}}</td>
<td>{{data.sla_internal}}</td>
<td>{{data.sla_hari_kerja}}</td>
</tr>
</div>
<div *ngIf="TeamID == Env.Team.ServiceReport">
<div *ngIf="servicefamily_id == 2 || servicefamily_id == 4">
<tr *ngFor="let data of listLogbooks.data; let i = index">
<td class="col-1">{{((i+1) + ((listRequest.perpage * listRequest.page) - listRequest.perpage))}}.</td>
<td>{{data.ref}}</td>
<td>{{data.createdby_name}}</td>
<td>{{data.agent_name}}</td>
<td>{{data.unit_pengaduan}}</td>
<td>{{data.start_date}}</td>
<td>{{data.caller_name}}</td>
<td>{{data.caller_mobile_phone}}</td>
<td>{{data.no_rekening}}</td>
<td>{{data.no_kartu_atm}}</td>
<td>{{data.penyebab_pengaduan}}</td>
<td>{{data.ticket_servicefamiliy_name}}</td>
<td>{{data.ticket_service_name}}</td>
<td>{{data.ticket_servicesubcategory_name}}</td>
<td>{{data.deskripsi}}</td>
<td>{{data.tanggal_transaksi}}</td>
<td>{{data.e_channel}}</td>
<td>{{data.kategori}}</td>
<td>{{data.tidak_lanjut}}</td>
<td>{{data.team_name}}</td>
<td>{{data.pic}}</td>
<td>{{(data.ticket_solution != null)? (data.ticket_solution | pipeSubstring) : ''}}</td>
<td>{{data.ticket_status}}</td>
<td>{{data.resolve_date}}</td>
<td>{{data.sla_internal}}</td>
<td>{{data.sla_hari_kerja}}</td>
<td>{{data.target_penyelesaian}}</td>
<td>{{data.remark}}</td>
<td>{{data.nasabah}}</td>
<td>{{data.bank}}</td>
</tr>
</div>
<div *ngIf="servicefamily_id == 1 || servicefamily_id == 5">
<tr *ngFor="let data of listLogbooks.data; let i = index">
<td class="col-1">{{((i+1) + ((listRequest.perpage * listRequest.page) - listRequest.perpage))}}.</td>
<td>{{data.ref}}</td>
<td>{{data.createdby_name}}</td>
<td>{{data.start_date}}</td>
<td>{{data.caller_name}}</td>
<td>{{data.caller_mobile_phone}}</td>
<td>{{data.no_rekening}}</td>
<td>{{data.no_kartu_atm}}</td>
<td>{{data.ticket_servicefamiliy_name}}</td>
<td>{{data.ticket_service_name}}</td>
<td>{{data.ticket_servicesubcategory_name}}</td>
<td>{{data.deskripsi}}</td>
<td>{{data.e_channel}}</td>
<td>{{data.kategori}}</td>
<td>{{data.ticket_solution}}</td>
<td>{{data.team_name}}</td>
<td>{{data.ticket_status}}</td>
<td>{{data.close_date}}</td>
<td>{{data.sla_internal}}</td>
<td>{{data.sla_hari_kerja}}</td>
</tr>
</div>
</div>
</tbody>
</table>
</div> -->
<!-- Role SPV and SD Only -->
<div class="table-responsive mt-4" *ngIf="RoleID == _SP.PARAM_SPV || RoleID == _SP.PARAM_SERVICEDESK || TeamID == Env.Team.ServiceReport">
<table class="table table-bordered table-striped table-sm">
......
......@@ -37,6 +37,7 @@ export class LogbooksReportComponent implements OnInit, OnChanges {
listRequest: any = {};
serviceFamilyName: string = "";
servicefamily_id: number = 0;
constructor(
private _cRef: ChangeDetectorRef,
private router: Router,
......@@ -57,6 +58,7 @@ export class LogbooksReportComponent implements OnInit, OnChanges {
let start_date_ticket = '';
let deskripsi = '';
let status= '';
this.servicefamily_id = this.listRequest.servicefamily_id[0];
switch (this.listRequest.servicefamily_id[0]) {
case 2:
start_date_ticket += " Pengaduan";
......
......@@ -12,16 +12,21 @@ import { AdminLivedashboardComponent } from './admin-livedashboard/admin-livedas
import { LoginLogsComponent } from './login-logs/login-logs.component';
import { AdminDashboardLogbooksComponent } from './admin-dashboard-logbooks/admin-dashboard-logbooks.component';
import { AdminUserAgentComponent } from './admin-user-agent/admin-user-agent.component';
import { LogbookComponent } from './logbook/logbook.component';
const routes: Routes = [
{
path: '',
component: LogbookComponent
},
// {
// path: '',
// component: AdminDashboardComponent
// },
{
path: '',
component: AdminDashboardLogbooksComponent
},
// {
// path: '',
// component: AdminDashboardLogbooksComponent
// },
{
path: 'live-dashboard',
component: AdminLivedashboardComponent
......
......@@ -17,7 +17,7 @@
{{CustomerMdData.Name}}
</button>
</div>
<hr>
<!-- <hr>
<p>
<b>Agent</b>
</p>
......@@ -48,8 +48,8 @@
<div class="form-group">
<label class="text-muted">Channel <span class="text-danger">*</span></label>
<input type="text" placeholder="Input Channel ..." #inputRequired class="form-control form-control-sm" [(ngModel)]="channel" maxlength="30">
</div>
<hr>
</div> -->
<!-- <hr> -->
<p>
<b>Assignee</b>
</p>
......
......@@ -175,7 +175,7 @@ export class AdminTicketCreateComponent implements OnInit {
this.GettingTeamsListAPI()
this.GettingTopicListAPI()
this.GettingComplaintmentListAPI()
this.requestAgent();
// this.requestAgent();
}
//Take By User ------------------------------------------------------------------------
......@@ -370,7 +370,8 @@ export class AdminTicketCreateComponent implements OnInit {
this.Env.Team.SociomileStaff,
this.Env.Team.ITRM,
this.Env.Team.BarcodeQRIS,
this.Env.Team.MerchantBusiness
this.Env.Team.MerchantBusiness,
this.Env.Team.DigitalLoan
]
}
......@@ -786,16 +787,11 @@ export class AdminTicketCreateComponent implements OnInit {
this._TicketService.CreateTicketWithContact(_Request)
.subscribe((result: any) => {
if(result != null){
//console.log(JSON.stringify(result))
if(result.values.code == 0){
// AratakaConfig.LoadingPage.hideLoading()
var ObjKey = Object.keys(result.values.objects)
var created = result.values.objects[ObjKey[0]]
console.log(ObjKey)
console.log(created)
const params = {
"agent_custom": this.extAgent,
"agent_extension_id": Number(this.idAgent),
......@@ -804,26 +800,33 @@ export class AdminTicketCreateComponent implements OnInit {
"ticket_id": Number(created.key),
"ticket_type": created.class
}
console.log(params)
this.InsertNewTicketAssignAPI({
ticket_assign : created.key,
ticket_class : created.class,
team_id : this.AssigneeTeam_ID,
agent_id : this.AssigneeTeamAgent_ID,
source_agent_id : this._SP.getUserInformation.values.user_id
})
this.API.post('ticket_extension', params)
.subscribe((response: any) => {
this.InsertNewTicketAssignAPI({
ticket_assign : created.key,
ticket_class : created.class,
team_id : this.AssigneeTeam_ID,
agent_id : this.AssigneeTeamAgent_ID,
source_agent_id : this._SP.getUserInformation.values.user_id
})
}, (err: HttpErrorResponse) => {
this.InsertNewTicketAssignAPI({
ticket_assign : created.key,
ticket_class : created.class,
team_id : this.AssigneeTeam_ID,
agent_id : this.AssigneeTeamAgent_ID,
source_agent_id : this._SP.getUserInformation.values.user_id
})
})
// this.API.post('ticket_extension', params)
// .subscribe((response: any) => {
// this.InsertNewTicketAssignAPI({
// ticket_assign : created.key,
// ticket_class : created.class,
// team_id : this.AssigneeTeam_ID,
// agent_id : this.AssigneeTeamAgent_ID,
// source_agent_id : this._SP.getUserInformation.values.user_id
// })
// }, (err: HttpErrorResponse) => {
// this.InsertNewTicketAssignAPI({
// ticket_assign : created.key,
// ticket_class : created.class,
// team_id : this.AssigneeTeam_ID,
// agent_id : this.AssigneeTeamAgent_ID,
// source_agent_id : this._SP.getUserInformation.values.user_id
// })
// })
// this.InsertNewTicketContactAPI({
// ticket_id : created.key,
......@@ -928,7 +931,8 @@ export class AdminTicketCreateComponent implements OnInit {
if(result != null){
//console.log(JSON.stringify(result))
if(result.values.code == 0){
AratakaConfig.LoadingPage.hideLoading();
AratakaConfig.Alert.showAlert('Create Ticket Success','alert-success',2000)
}else{
AratakaConfig.Alert.showAlert('Failed to Create Ticket Dispatch','alert-danger',2000)
......
......@@ -27,7 +27,7 @@
<br>
<div class="row">
<div class="col-12 col-sm-4 col-md-4 col-lg-3 mb-3">
<p>
<!-- <p>
<b>Agent</b>
</p>
<div class="form-group">
......@@ -58,7 +58,7 @@
<div class="form-group">
<label class="text-muted">Channel <span class="text-danger">*</span></label>
<input type="text" placeholder="Input Channel ..." #inputRequired class="form-control form-control-sm" [(ngModel)]="channel" disabled>
</div>
</div> -->
<hr>
<p>
<b>Assignee</b>
......
......@@ -250,8 +250,8 @@ export class AdminTicketDetailComponent implements OnInit {
this.GettingTicketDetailAPI({
ID : this.paramTicketID
})
this.getDetailExtensionTiket()
this.requestAgent()
// this.getDetailExtensionTiket()
// this.requestAgent()
this.ConversationViewByRole()
AratakaConfig.BootstrapDateCustomPicker({
......
......@@ -31,6 +31,8 @@ import { LogbooksComponent } from './admin-dashboard-logbooks/logbooks/logbooks.
import { LogbooksReportComponent } from './admin-dashboard-logbooks/logbooks-report/logbooks-report.component';
import { AdminUserAgentComponent } from './admin-user-agent/admin-user-agent.component';
import { CreateAgentComponent } from './admin-user-agent/create-agent/create-agent.component';
import { LogbookComponent } from './logbook/logbook.component';
import { TabsLogbookComponent } from './logbook/tabs-logbook/tabs-logbook.component';
/*import { PipeSha256 } from '../pipe/pipe-global.pipe';
import { PipeEncryptoJs } from '../pipe/pipe-global.pipe';
import { PipeDencryptoJs } from '../pipe/pipe-global.pipe';
......@@ -65,6 +67,8 @@ import { PipeDencryptoJs } from '../pipe/pipe-global.pipe';
LogbooksReportComponent,
AdminUserAgentComponent,
CreateAgentComponent,
LogbookComponent,
TabsLogbookComponent,
],
imports: [
PipeglobalModule,
......
.jumbotron{
background: url('../../../assets/StoredImage/DahsboardJumbotron.png') no-repeat center center;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: 100%;
margin-top:0px;
/*border: 1px solid #ccc;*/
}
.container-01{
border: 2px solid #ccc;
border-radius:3px;
}
.dashboardBox{
padding: 8px;
border: 1px solid transparent;
text-align: center;
border-radius: 5px;
margin: 5px 0;
}
.ticketTect{
font-size: 11px;
font-weight: bold;
}
.downloadExportDashboard{
top: 0;
right: 0;
position: absolute;
cursor: pointer;
color: #636e72;
margin-right: 10px;
background: #fff;
/* border: 1px solid #ccc; */
border-radius: 50%;
padding: 5px 8px;
font-size: 12px;
}
.downloadExportDashboard:hover{
color: #222;
}
.TabsCustomTitle{
background: transparent;
margin: 2px;
color: #222;
padding: 3px 30px;
border-bottom: 3px solid #ebe9e9;
cursor: pointer;
word-wrap: break-word;
display: inline-block;
font-size: 13px;
font-weight: 900;
text-transform: uppercase;
}
.TabsCustomTitle:hover{
color: #222;
border-bottom: 3px solid #d18b5d;
}
.TabsCustomTitle.active{
color: #222;
border-bottom: 3px solid #e67e22;
}
.TabsCustom{
background: transparent;
margin: 2px;
color: #222;
padding: 3px 20px;
border-bottom: 3px solid #ebe9e9;
cursor: pointer;
word-wrap: break-word;
display: inline-block;
font-size: 12px;
}
.TabsCustom:hover{
color: #222;
border-bottom: 3px solid #7e8389;
}
.TabsCustom.active{
color: #222;
border-bottom: 3px solid #2c3e50;
}
<div class="container" style="margin-top: -20px;">
<div class="row">
<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">
<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>
<p *ngIf="isDashboardCardEmpty" style="font-size:18px;" class="text-muted text-center">
<i class="far fa-chart-bar fa-3x"></i>
<br> Upss... no Dashboard!
</p>
<p *ngIf="isDashboardCardLoading" style="font-size:18px;" class="text-muted text-center">
<i class="fas fa-spinner fa-spin"></i>
Retrieving data
</p>
<ng-container *ngIf="!isDashboardCardEmpty && !isDashboardCardLoading">
<div class="row">
<ng-container *ngFor="let data of dashboardListCard; let i = index">
<div class="col-12 col-sm-6 col-md-4 col-lg-2">
<div class="dashboardBox" [ngStyle]="{'background-color': data.colour,'color': '#fff'}">
<p class="downloadExportDashboard"
*ngIf="(data.Count != 0) && (RoleID == _SP.PARAM_SPV || RoleID == _SP.PARAM_SERVICEDESK)"
(click)="GettingExcelForDashboardDataAPI(i)">
<i class="fas fa-download"></i>
</p>
<p class="m-0 p-0">
{{data.Count}}
</p>
<p class="m-0 p-0 ticketTect">{{data.Name}}</p>
</div>
</div>
</ng-container>
</div>
</ng-container>
<br>
<p class="mb-3">
<span class="mb-1 TabsCustomTitle active">
Logbook
</span>
</p>
<p *ngIf="isEmptyChild" style="font-size:18px;" class="text-muted text-center">
<i class="fas fa-columns fa-3x"></i> <br>
There is no Dashboard
</p>
<p *ngIf="isLoadingChild" style="font-size:18px;" class="text-muted text-center">
<i class="fas fa-spinner fa-spin"></i>
Retrieving data
</p>
<p *ngIf="!isLoadingChild && !isEmptyChild">
<ng-container *ngFor="let data of listChildTabs; let i = index">
<span
class="TabsCustom"
[ngClass]="{'active': data.selected, '': !data.selected}" (click)="changeTab(i)">
{{data.name}} {{data.count ? data.count : ''}}
</span>
</ng-container>
</p>
<app-tabs-logbook
[paramsRequest]="paramsRequest">
</app-tabs-logbook>
</div>
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { LogbookComponent } from './logbook.component';
describe('LogbookComponent', () => {
let component: LogbookComponent;
let fixture: ComponentFixture<LogbookComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ LogbookComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(LogbookComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit,Injector, ViewChildren, ViewChild } from '@angular/core';
import { HttpErrorResponse } from '@angular/common/http';
import { FormBuilder, FormGroup } from '@angular/forms';
import { DashboardService } from '../../../shared/serviceproxy/service-proxy.service';
import { ServiceProxyWeb } from '../../../shared/serviceproxy/service-proxy.service';
import { Data, Router } from '@angular/router';
import { ChangeDetectorRef } from '@angular/core';
import { environment } from '../../../environments/environment.prod';
declare const AratakaConfig : any;
@Component({
selector: 'app-logbook',
templateUrl: './logbook.component.html',
styleUrls: ['./logbook.component.css']
})
export class LogbookComponent implements OnInit {
public TeamID = this._SP.getUserInformation.values.team_id
public RoleID = this._SP.getUserInformation.values.roles[0].id
public Env = environment;
public appMaintenance = "assets/StoredImage/matains-logo.png"
public SiteName = this._SP.SITE_NAME
public Username : string = (this._SP.getUserInformation != null)? this._SP.getUserInformation.values.contact_name : '';
public DashboardCountRequest = {
user_id : null,
start_date : null,
end_date : null,
type_id: 1
}
isDashboardCardEmpty: boolean = false;
isDashboardCardLoading: boolean = true;
dashboardListCard: any[] = [];
startDate: string = "";
endDate: string = "";
listChildTabs: any[] = [];
isLoadingChild: boolean = false;
isEmptyChild: boolean = false;
public TicketReportRequest = {
page : 1,
perpage : 10,
user_id : null,
start_date : null,
end_date : null,
servicefamily_id : null,
field_export: null,
servicefamily_name: ''
}
paramsRequest: string = "";
constructor(
private _cRef: ChangeDetectorRef,
private router: Router,
private FormBuilder : FormBuilder,
private _DashboardService : DashboardService,
public _SP : ServiceProxyWeb
) { }
ngOnInit() {
var StartD= new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate());
StartD.setMonth(StartD.getMonth() -6)
var EndD = new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate());
AratakaConfig.BootstrapDateRangeCustomPicker({
StartDate : {
ID : '#StartDate',
DateValue : StartD,
Format : 'DD MMMM YYYY',
},
EndDate : {
ID :'#EndDate',
DateValue : EndD,
Format : 'DD MMMM YYYY',
},
})
if (this.RoleID == this._SP.PARAM_SPV) {
this.DashboardCountRequest.user_id = null
} else {
this.DashboardCountRequest.user_id = this._SP.getUserInformation.values.user_id
}
this.DashboardCountRequest.start_date = AratakaConfig.GetDateBDTP({ ID: '#StartDate', isGet: true, isGetFormat: 'YYYY-MM-DD'});
this.DashboardCountRequest.end_date = AratakaConfig.GetDateBDTP({ ID: '#EndDate', isGet: true, isGetFormat: 'YYYY-MM-DD' });
this.GettingDashboardCardColorsDataAPI()
}
changeTab(i: number) {
this.listChildTabs.forEach(element => {
element.selected = false;
});
this.listChildTabs[i].selected = true;
this.TicketReportRequest.servicefamily_id = this.listChildTabs[i].id;
this.TicketReportRequest.servicefamily_name = this.listChildTabs[i].name;
this.paramsRequest = JSON.stringify(this.TicketReportRequest);
}
RandomColorPicker() {
const color = [
"#EF3D59", "#E17A47", "#EFC958", "#4AB19D", "#344E5C", "#F26627", "#F9A26C", "#9BD7D1",
"#DDA5B6", "#F2CC8C", "#3F6A8A", "#4D5E72", "#CC2A49", "#F99E4C", "#F36F38", "#EF4648",
"#8FB9A8", "#F1828D", "#765D69", "#FCBB6D", "#AB6C82", "#685D79", "#66a6ff", "#48c6ef ",
];
return color[Math.floor(Math.random() * color.length)];
}
GettingDashboardCardColorsDataAPI() {
this.startDate = AratakaConfig.BootstrapDateCustomPicker({ ID: '#StartDate', isGet: true, isGetFormat: 'YYYY-MM-DD'});
this.endDate = AratakaConfig.BootstrapDateCustomPicker({ ID: '#EndDate', isGet: true, isGetFormat: 'YYYY-MM-DD' });
if(this._SP.getUserInformation.values.team_id == this.Env.Team.ServiceReport) this.DashboardCountRequest.user_id = null;
this.dashboardListCard = [];
this.isDashboardCardLoading = true;
this.isDashboardCardEmpty = false;
this._DashboardService.Counting(this.DashboardCountRequest)
.subscribe((result: any) => {
if(result.values != undefined){
this.dashboardListCard = result.values;
var that = this;
this.dashboardListCard.map(function(x, index){
x.colour = that.RandomColorPicker();
x.selected = false;
})
this.dashboardListCard[0].selected = true;
this.isDashboardCardEmpty = false;
this.requestData();
} else {
this.isDashboardCardEmpty = true;
}
this.isDashboardCardLoading = false;
},
(err: HttpErrorResponse) => {
this.isDashboardCardLoading = false;
this.isDashboardCardEmpty = true;
});
}
GettingExcelForDashboardDataAPI(_i: number){
let userID = null
if (this.RoleID == this._SP.PARAM_SPV) userID = null;
else userID = this._SP.getUserInformation.values.user_id;
let request = {
user_id : userID,
user_name : this._SP.getUserInformation.values.contact_name,
start_date : this.DashboardCountRequest.start_date,
end_date : this.DashboardCountRequest.end_date,
type_id : this.dashboardListCard[_i].TypeId,
type_name : this.dashboardListCard[_i].Name,
}
AratakaConfig.LoadingPage.showLoading('Please wait.., perparing excel.')
this._DashboardService.downloadFileExcelDashboard(request)
.subscribe((result: any) => {
const blob = new Blob([result], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
const fileName: string = request.type_name + '-' + new Date().toISOString().replace(/T/, ' ').replace(/\..+/, '') +'.xlsx';
const objectUrl: string = URL.createObjectURL(blob);
const a: HTMLAnchorElement = document.createElement('a') as HTMLAnchorElement;
a.href = objectUrl;
a.download = fileName;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
URL.revokeObjectURL(objectUrl);
AratakaConfig.LoadingPage.hideLoading()
},
(err: HttpErrorResponse) => {
AratakaConfig.LoadingPage.hideLoading()
});
}
requestData() {
this.isLoadingChild = true;
let promiseReport = new Promise((resolve, reject) => {
this._DashboardService.ReportTicketCategory(this.DashboardCountRequest)
.subscribe((result: any) => {
if (result.values != undefined) {
let responseReport = {
report: result.values
}
resolve(responseReport)
}
}, (err: HttpErrorResponse) => {
let responseReport = {
report: []
}
reject(responseReport)
});
});
let promiseLogbooks = new Promise((resolve, reject) => {
this._DashboardService.ReportTicketCategoryLogBook(null)
.subscribe((result: any) => {
if (result.values != undefined) {
let responseLogbooks = {
logbooks: result.values
}
resolve(responseLogbooks)
}
}, (err: HttpErrorResponse) => {
let responseLogbooks = {
logbooks: []
}
reject(responseLogbooks)
});
})
this.listChildTabs = [];
Promise.all([
// promiseReport,
promiseLogbooks
]).then((result: any) => {
let reportData = [];
let logbooksData = [];
for (let i=0; i<result.length; i++) {
if ('logbooks' in result[i]) logbooksData = result[i].logbooks
}
for (var i = 0 ; i < reportData.length; i++) {
this.listChildTabs.push({
id : reportData[i].servicefamily_id,
name : reportData[i].servicefamily_name,
servicefamily_id : reportData[i].servicefamily_id,
servicefamily_name : reportData[i].servicefamily_name,
count : `(${reportData[i].count})`,
selected : false,
tabs: 'report'
})
}
// pengkondisian tabs team
for (var i = 0 ; i < logbooksData.length; i++) {
if (this.RoleID == Number(this.Env.PARAM_SUPPORT)) {
if (logbooksData[i].name == "Pengaduan Dashboard SD" || logbooksData[i].name == "Permintaan Dashboard SD") {
this.listChildTabs.push({
id : logbooksData[i].id,
name : logbooksData[i].name,
selected : false,
tabs: 'logbooks'
})
}
} else if (this.RoleID == Number(this.Env.PARAM_AGENT)) {
if (this.TeamID == this.Env.Team.SociomileStaff) {
if (logbooksData[i].name == 'Inquiry Call Center') logbooksData[i].name = 'Inquiry Call Center & NWB';
if (logbooksData[i].name == 'Telepon terputus Call Center') logbooksData[i].name = 'Telepon terputus Call Center & NWB';
this.listChildTabs.push({
id : logbooksData[i].id,
name : logbooksData[i].name,
selected : false,
tabs: 'logbooks'
})
} else {
this.listChildTabs.push({
id : logbooksData[i].id,
name : logbooksData[i].name,
selected : false,
tabs: 'logbooks'
})
}
} else {
this.listChildTabs.push({
id : logbooksData[i].id,
name : logbooksData[i].name,
selected : false,
tabs: 'logbooks'
})
}
}
this.listChildTabs[0].selected = true;
this.TicketReportRequest.servicefamily_id = this.listChildTabs[0].id;
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.paramsRequest = JSON.stringify(this.TicketReportRequest);
this.isEmptyChild = false;
this.isLoadingChild = false;
}).catch((err) => {
this.isEmptyChild = true;
this.isLoadingChild = false;
})
}
}
.downloadExportReport{
border: 1px solid #607D8B;
padding: 5px 10px;
border-radius: 3px;
float: right;
font-size: 12px;
background: #607D8B;
color: #fff;
cursor: pointer;
margin: 0 10px 30px 0;
}
.downloadExportReport:hover{
color: #ffffff;
background-color:#263238 ;
}
.Table-Background{
/* border: 2px solid #ebe9e9; */
padding: 20px 5px;
margin: 10px;
/* border-radius: 10px; */
}
.table th {
vertical-align: middle;
}
.table td, .table th {
min-width: 150px;
}
.table td:first-child, .table th:first-child {
min-width: 20px;
}
\ No newline at end of file
<button class="btn btn-sm btn-success arataka-btn-success" style="width: 100px;" (click)="GettingTicketReportDataAPI()" [disabled]="isDisabledButtonSearch">
<i class="bi bi-search"></i>
Search
</button>
<br>
<div class="row">
<div class="col-12 col-sm-12 text-center mt-5" *ngIf="isEmptyLogbooks">
<p style="font-size:18px;" class="text-muted"><i class="fas fa-table fa-3x"></i> <br> No List of Report</p>
</div>
<div class="col-12 col-sm-12 text-center mt-5" *ngIf="isLoadingLogbooks">
<p style="font-size:18px;" class="text-muted"><i class="fas fa-spinner fa-spin"></i> Retrieving data</p>
</div>
<div class="col-12 col-sm-12 Table-Background" *ngIf="!isLoadingLogbooks && !isEmptyLogbooks">
<span
class="downloadExportReport"
(click)="GettingExcelForReportDataAPI()">
Download Excel <i class="fas fa-download"></i>
</span>
<div class="table-responsive mt-4">
<table class="table table-bordered table-striped table-sm">
<thead>
<tr>
<th rowspan="2" style="max-width: 15px;">#</th>
<th *ngFor="let data of fieldExport; let i = index">
<div class="form-check">
<input type="checkbox" class="form-check-input" [checked]="data['value']" id="exampleCheck1" (change)="onChangeFieldReport(i, $event)">
<label class="form-check-label" for="exampleCheck1">{{data['field']}}</label>
</div>
</th>
</tr>
</thead>
<tbody>
<ng-container *ngIf="TeamID == Env.Team.SociomileStaff">
<tr *ngFor="let data of listLogbooks.data; let i = index">
<td class="col-1">{{((i+1) + ((listRequest.perpage * listRequest.page) - listRequest.perpage))}}.</td>
<td>{{data.ref}}</td>
<td>{{data.createdby_name}}</td>
<td>{{data.start_date}}</td>
<td>{{data.caller_name}}</td>
<td>{{data.caller_mobile_phone}}</td>
<td>{{data.ticket_servicefamiliy_name}}</td>
<td>{{data.ticket_service_name}}</td>
<td>{{data.ticket_servicesubcategory_name}}</td>
<td>{{data.title}}</td>
<td>{{data.team_name}}</td>
<td>{{data.sla_internal}}</td>
<td>{{data.ticket_status}}</td>
<td>{{data.resolve_date}}</td>
<td>{{data.cscabang}}</td>
</tr>
</ng-container>
<ng-container *ngIf="TeamID == Env.Team.CsCabangBranchAgent">
<tr *ngFor="let data of listLogbooks.data; let i = index">
<td class="col-1">{{((i+1) + ((listRequest.perpage * listRequest.page) - listRequest.perpage))}}.</td>
<td>{{data.ref}}</td>
<td>{{data.createdby_name}}</td>
<td>{{data.start_date}}</td>
<td>{{data.caller_name}}</td>
<td>{{data.caller_mobile_phone}}</td>
<td>{{data.ticket_servicefamiliy_name}}</td>
<td>{{data.ticket_servicesubcategory_name}}</td>
<td>{{data.title}}</td>
<td>{{data.team_name}}</td>
<td>{{data.sla_internal}}</td>
<td>{{data.ticket_status}}</td>
<td>{{data.resolve_date}}</td>
<td>{{data.cscabang}}</td>
<td>{{data.supervisor}}</td>
</tr>
</ng-container>
<ng-container *ngIf="TeamID == Env.Team.AgentCallCenter">
<tr *ngFor="let data of listLogbooks.data; let i = index">
<td class="col-1">{{((i+1) + ((listRequest.perpage * listRequest.page) - listRequest.perpage))}}.</td>
<td>{{data.ref}}</td>
<td>{{data.createdby_name}}</td>
<td>{{data.agent_name}}</td>
<td>{{data.unit_pengaduan}}</td>
<td>{{data.start_date}}</td>
<td>{{data.caller_name}}</td>
<td>{{data.caller_mobile_phone}}</td>
<td>{{data.no_rekening}}</td>
<td>{{data.no_kartu_atm}}</td>
<td>{{data.penyebab_pengaduan}}</td>
<td>{{data.ticket_servicefamiliy_name}}</td>
<td>{{data.ticket_service_name}}</td>
<td>{{data.ticket_servicesubcategory_name}}</td>
<td>{{data.deskripsi}}</td>
<td>{{data.tanggal_transaksi}}</td>
<td>{{data.e_channel}}</td>
<td>{{data.kategori}}</td>
<td>{{data.tidak_lanjut}}</td>
<td>{{data.team_name}}</td>
<td>{{data.pic}}</td>
<td>{{(data.ticket_solution != null)? (data.ticket_solution | pipeSubstring) : ''}}</td>
<td>{{data.ticket_status}}</td>
<td>{{data.resolve_date}}</td>
<td>{{data.sla_internal}}</td>
<td>{{data.sla_hari_kerja}}</td>
</tr>
</ng-container>
<ng-container *ngIf="RoleID == _SP.PARAM_SPV || RoleID == _SP.PARAM_SERVICEDESK || TeamID == Env.Team.ServiceReport">
<ng-container *ngIf="servicefamily_id == 2 || servicefamily_id == 4">
<tr *ngFor="let data of listLogbooks.data; let i = index">
<td class="col-1">{{((i+1) + ((listRequest.perpage * listRequest.page) - listRequest.perpage))}}.</td>
<td>{{data.ref}}</td>
<td>{{data.createdby_name}}</td>
<td>{{data.agent_name}}</td>
<td>{{data.unit_pengaduan}}</td>
<td>{{data.start_date}}</td>
<td>{{data.caller_name}}</td>
<td>{{data.caller_mobile_phone}}</td>
<td>{{data.no_rekening}}</td>
<td>{{data.no_kartu_atm}}</td>
<td>{{data.penyebab_pengaduan}}</td>
<td>{{data.ticket_servicefamiliy_name}}</td>
<td>{{data.ticket_service_name}}</td>
<td>{{data.ticket_servicesubcategory_name}}</td>
<td>{{data.deskripsi}}</td>
<td>{{data.tanggal_transaksi}}</td>
<td>{{data.e_channel}}</td>
<td>{{data.kategori}}</td>
<td>{{data.tidak_lanjut}}</td>
<td>{{data.team_name}}</td>
<td>{{data.pic}}</td>
<td>{{(data.ticket_solution != null)? (data.ticket_solution | pipeSubstring) : ''}}</td>
<td>{{data.ticket_status}}</td>
<td>{{data.resolve_date}}</td>
<td>{{data.sla_internal}}</td>
<td>{{data.sla_hari_kerja}}</td>
<td>{{data.target_penyelesaian}}</td>
<td>{{data.remark}}</td>
<td>{{data.nasabah}}</td>
<td>{{data.bank}}</td>
</tr>
</ng-container>
<ng-container *ngIf="servicefamily_id == 1 || servicefamily_id == 5">
<tr *ngFor="let data of listLogbooks.data; let i = index">
<td class="col-1">{{((i+1) + ((listRequest.perpage * listRequest.page) - listRequest.perpage))}}.</td>
<td>{{data.ref}}</td>
<td>{{data.createdby_name}}</td>
<td>{{data.start_date}}</td>
<td>{{data.caller_name}}</td>
<td>{{data.caller_mobile_phone}}</td>
<td>{{data.no_rekening}}</td>
<td>{{data.no_kartu_atm}}</td>
<td>{{data.ticket_servicefamiliy_name}}</td>
<td>{{data.ticket_service_name}}</td>
<td>{{data.ticket_servicesubcategory_name}}</td>
<td>{{data.deskripsi}}</td>
<td>{{data.e_channel}}</td>
<td>{{data.kategori}}</td>
<td>{{data.ticket_solution}}</td>
<td>{{data.team_name}}</td>
<td>{{data.ticket_status}}</td>
<td>{{data.close_date}}</td>
<td>{{data.sla_internal}}</td>
<td>{{data.sla_hari_kerja}}</td>
</tr>
</ng-container>
</ng-container>
<ng-container *ngIf="RoleID == Env.PARAM_SUPPORT">
<tr *ngFor="let data of listLogbooks.data; let i = index">
<td class="col-1">{{((i+1) + ((listRequest.perpage * listRequest.page) - listRequest.perpage))}}.</td>
<td>{{data.ref}}</td>
<td>{{data.createdby_name}}</td>
<td>{{data.start_date}}</td>
<td>{{data.caller_name}}</td>
<td>{{data.caller_mobile_phone}}</td>
<td>{{data.ticket_servicefamiliy_name}}</td>
<td>{{data.deskripsi}}</td>
<td>{{data.ticket_status}}</td>
<td>{{data.resolve_date}}</td>
<td>{{data.target_penyelesaian}}</td>
<td>{{data.sla_hari_kerja}}</td>
</tr>
</ng-container>
</tbody>
</table>
</div>
</div>
</div>
<br>
<div class="row" *ngIf="!isLoadingLogbooks && !isEmptyLogbooks">
<div class="col-12">
<p class="text-center text-muted">
<small>
{{listLogbooks.PagingDisplay}}
</small>
</p>
</div>
<div class="col-6">
<h5 class="text-center arataka-paging-arrow mb-5" (click)="PagingArrowLeft()">
<i class="fas fa-chevron-left"></i> Previous
</h5>
</div>
<div class="col-6">
<h5 class="text-center arataka-paging-arrow mb-5" (click)="PagingArrowRight()">
Next <i class="fas fa-chevron-right"></i>
</h5>
</div>
</div>
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { TabsLogbookComponent } from './tabs-logbook.component';
describe('TabsLogbookComponent', () => {
let component: TabsLogbookComponent;
let fixture: ComponentFixture<TabsLogbookComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ TabsLogbookComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(TabsLogbookComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit,Injector, ViewChildren, ViewChild, Input, OnChanges, SimpleChanges,EventEmitter, Output } from '@angular/core';
import { HttpErrorResponse } from '@angular/common/http';
import { FormBuilder, FormGroup } from '@angular/forms';
import { DashboardService } from '../../../../shared/serviceproxy/service-proxy.service';
import { ServiceProxyWeb } from '../../../../shared/serviceproxy/service-proxy.service';
import { Data, Router } from '@angular/router';
import { ChangeDetectorRef } from '@angular/core';
import { environment } from '../../../../environments/environment.prod';
declare const AratakaConfig : any;
@Component({
selector: 'app-tabs-logbook',
templateUrl: './tabs-logbook.component.html',
styleUrls: ['./tabs-logbook.component.css']
})
export class TabsLogbookComponent implements OnInit, OnChanges {
@Input() TicketReportRequest: any;
@Input() paramsRequest;
isDisabledButtonSearch: boolean = false;
public TeamID = this._SP.getUserInformation.values.team_id
public RoleID = this._SP.getUserInformation.values.roles[0].id
public Env = environment;
fieldExport: any[] = [];
isEmptyLogbooks: boolean = true;
isLoadingLogbooks: boolean = false;
listLogbooks: any = {};
serviceFamilyName: string = "";
servicefamily_id: number = 0;
listRequest = {
page : 1,
perpage : 10,
user_id : null,
start_date : null,
end_date : null,
servicefamily_id: null,
field_export: null,
servicefamily_name: '',
team_id: null,
is_export: null,
roleID: null
}
constructor(
private _cRef: ChangeDetectorRef,
private router: Router,
private FormBuilder : FormBuilder,
private _DashboardService : DashboardService,
public _SP : ServiceProxyWeb
) { }
ngOnInit() {
}
isJsonString(str) {
try {
JSON.parse(str);
} catch (e) {
return false;
}
return true;
}
ngOnChanges(changes: SimpleChanges) {
if (this.isJsonString(this.paramsRequest)) {
this.listRequest =JSON.parse(this.paramsRequest);
this.serviceFamilyName = this.listRequest.servicefamily_name;
if (this._SP.getUserInformation.values.team_id == this.Env.Team.ServiceReport) this.listRequest.user_id = null;
let start_date_ticket = '';
let deskripsi = '';
let status= '';
this.servicefamily_id = this.listRequest.servicefamily_id[0];
switch (this.listRequest.servicefamily_id[0]) {
case 2:
start_date_ticket += " Pengaduan";
deskripsi += " Pengaduan";
status += " Pengaduan";
break;
case 4:
start_date_ticket += " Permintaan";
deskripsi += " Permintaan";
status += " Permintaan";
break;
case 1:
start_date_ticket += " Inquery";
deskripsi += " Inquery";
status += " Inquery";
break;
case 6:
start_date_ticket += " Telpon Terputus";
deskripsi += " Telpon Terputus";
status += " Telpon Terputus";
break;
}
if (this.TeamID == this.Env.Team.SociomileStaff){
this.fieldExport = [
{"name": 'ref', "value": false, "field": "No Ticket CRM"},
{"name": 'createdby_name', "value": false, "field": "Nama User"},
{"name": 'start_date', "value": false, "field": start_date_ticket == '' ? "Tanggal Permintaan" : start_date_ticket},
{"name": 'caller_name', "value": false, "field": "Nama Nasabah"},
{"name": 'caller_mobile_phone', "value": false, "field": "No Telepon 1"},
{"name": 'ticket_servicefamiliy_name', "value": false, "field": "Jenis Topik"},
{"name": 'ticket_service_name', "value": false, "field": "Sub Topik"},
{"name": 'ticket_servicesubcategory_name', "value": false, "field": "Kategori"},
{"name": 'title', "value": false, "field": deskripsi == '' ? 'Desctiption' : deskripsi},
{"name": 'team_name', "value": false, "field": 'Unit Terkait'},
{"name": 'sla_internal', "value": false, "field": "SLA Internal"},
{"name": 'ticket_status', "value": false, "field": status == '' ? 'Status' : status},
{"name": 'resolve_date', "value": false, "field": "Tanggal & Waktu Resolved"},
{"name": 'cscabang', "value": false, "field": "Nama Staff"},
]
} else if (this.TeamID == this.Env.Team.CsCabangBranchAgent) {
this.fieldExport = [
{"name": 'ref', "value": false, "field": "No Ticket CRM"},
{"name": 'createdby_name', "value": false, "field": "Nama User"},
{"name": 'start_date', "value": false, "field": start_date_ticket == '' ? "Tanggal Permintaan" : start_date_ticket},
{"name": 'caller_name', "value": false, "field": "Nama Nasabah"},
{"name": 'caller_mobile_phone', "value": false, "field": "No Telepon 1"},
{"name": 'ticket_servicefamiliy_name', "value": false, "field": "Jenis Topik"},
{"name": 'ticket_service_name', "value": false, "field": "Sub Topik"},
{"name": 'ticket_servicesubcategory_name', "value": false, "field": "Kategori"},
{"name": 'title', "value": false, "field": deskripsi == '' ? 'Desctiption' : deskripsi},
{"name": 'team_name', "value": false, "field": 'Unit Terkait'},
{"name": 'sla_internal', "value": false, "field": "SLA Internal"},
{"name": 'ticket_status', "value": false, "field": status == '' ? 'Status' : status},
{"name": 'resolve_date', "value": false, "field": "Tanggal & Waktu Resolved"},
{"name": 'cscabang', "value": false, "field": "Nama Staff"},
]
} else if (this.TeamID == this.Env.Team.AgentCallCenter) {
this.fieldExport = [
{"name": 'ref', "value": false, "field": "No Ticket CRM"},
{"name": 'createdby_name', "value": false, "field": "Nama User"},
{"name": 'agent_name', "value": false, "field": "Assigned Agent"},
{"name": 'unit_pengaduan', "value": false, "field": "Unit Pengaduan (Cabang/ Call Center/ Sociomile Staff)"},
{"name": 'start_date', "value": false, "field": 'Tanggal ' + ((this.listRequest.servicefamily_id[0] == 2) ? 'Pengaduan' : 'Permintaan')},
{"name": 'caller_name', "value": false, "field": "Nama Nasabah"},
{"name": 'caller_mobile_phone', "value": false, "field": "No Telepon"},
{"name": 'no_rekening', "value": false, "field": "No Rekening"},
{"name": 'no_kartu_atm', "value": false, "field": "No Kartu ATM"},
{"name": 'penyebab_pengaduan', "value": false, "field": "Penyebab Pengaduan"},
{"name": 'ticket_servicefamiliy_name', "value": false, "field": "Topik"},
{"name": 'ticket_service_name', "value": false, "field": "Sub Topik"},
{"name": 'ticket_servicesubcategory_name', "value": false, "field": "Kategori"},
{"name": 'deskripsi', "value": false, "field": 'Deskripsi ' + ((this.listRequest.servicefamily_id[0] == 2) ? 'Pengaduan' : 'Permintaan')},
{"name": 'tanggal_transaksi', "value": false, "field": "Tanggal Transaksi"},
{"name": 'e_channel', "value": false, "field": "E-channel/Non-E-channel"},
{"name": 'kategori', "value": false, "field": 'Kategori ' + ((this.listRequest.servicefamily_id[0] == 2) ? 'Pengaduan' : 'Permintaan')},
{"name": 'tidak_lanjut', "value": false, "field": 'Tindak Lanjut ' + ((this.listRequest.servicefamily_id[0] == 2) ? 'Pengaduan' : 'Permintaan')},
{"name": 'team_name', "value": false, "field": "Unit Terkait (Divisi)"},
{"name": 'pic', "value": false, "field": "PIC"},
{"name": 'ticket_solution', "value": false, "field": "Tindak lanjut oleh Unit Terkait"},
{"name": 'ticket_status', "value": false, "field": 'Status ' + ((this.listRequest.servicefamily_id[0] == 2) ? 'Pengaduan' : 'Permintaan')},
{"name": 'resolve_date', "value": false, "field": "Tanggal Resolved"},
{"name": 'sla_internal', "value": false, "field": "SLA Internal"},
{"name": 'sla_hari_kerja', "value": false, "field": "Hari SLA"}
]
} else if (this.TeamID == this.Env.Team.ServiceReport || this.RoleID == this._SP.PARAM_SPV || this.RoleID == this._SP.PARAM_SERVICEDESK) {
if (this.servicefamily_id == 2 || this.servicefamily_id == 4) {
this.fieldExport = [
{"name": 'ref', "value": false, "field": "No Ticket CRM"},
{"name": 'createdby_name', "value": false, "field": "Nama User"},
{"name": 'agent_name', "value": false, "field": "Assigned Agent"},
{"name": 'unit_pengaduan', "value": false, "field": "Unit Pengaduan (Cabang/ Call Center/ Sociomile Staff)"},
{"name": 'start_date', "value": false, "field": 'Tanggal ' + ((this.listRequest.servicefamily_id[0] == 2) ? 'Pengaduan' : 'Permintaan')},
{"name": 'caller_name', "value": false, "field": "Nama Nasabah"},
{"name": 'caller_mobile_phone', "value": false, "field": "No Telepon"},
{"name": 'no_rekening', "value": false, "field": "No Rekening"},
{"name": 'no_kartu_atm', "value": false, "field": "No Kartu ATM"},
{"name": 'penyebab_pengaduan', "value": false, "field": "Penyebab Pengaduan"},
{"name": 'ticket_servicefamiliy_name', "value": false, "field": "Topik"},
{"name": 'ticket_service_name', "value": false, "field": "Sub Topik"},
{"name": 'ticket_servicesubcategory_name', "value": false, "field": "Kategori"},
{"name": 'deskripsi', "value": false, "field": 'Deskripsi ' + ((this.listRequest.servicefamily_id[0] == 2) ? 'Pengaduan' : 'Permintaan')},
{"name": 'tanggal_transaksi', "value": false, "field": "Tanggal Transaksi"},
{"name": 'e_channel', "value": false, "field": "E-channel/Non-E-channel"},
{"name": 'kategori', "value": false, "field": 'Kategori ' + ((this.listRequest.servicefamily_id[0] == 2) ? 'Pengaduan' : 'Permintaan')},
{"name": 'tidak_lanjut', "value": false, "field": 'Tindak Lanjut ' + ((this.listRequest.servicefamily_id[0] == 2) ? 'Pengaduan' : 'Permintaan')},
{"name": 'team_name', "value": false, "field": "Unit Terkait (Divisi)"},
{"name": 'pic', "value": false, "field": "PIC"},
{"name": 'ticket_solution', "value": false, "field": "Tindak lanjut oleh Unit Terkait"},
{"name": 'ticket_status', "value": false, "field": 'Status ' + ((this.listRequest.servicefamily_id[0] == 2) ? 'Pengaduan' : 'Permintaan')},
{"name": 'resolve_date', "value": false, "field": "Tanggal Resolved"},
{"name": 'sla_internal', "value": false, "field": "SLA Internal"},
{"name": 'sla_hari_kerja', "value": false, "field": "Hari SLA"},
{"name": 'target_penyelesaian', "value": false, "field": "Target Penyelesaian"},
{"name": 'remark', "value": false, "field": "Remark"},
{"name": 'nasabah', "value": false, "field": "Nasabah"},
{"name": 'bank', "value": false, "field": "Bank"}
]
} else {
this.fieldExport = [
{"name": 'ref', "value": false, "field": "No Ticket CRM"},
{"name": 'createdby_name', "value": false, "field": "Nama User"},
{"name": 'start_date', "value": false, "field": 'Tanggal ' + ((this.listRequest.servicefamily_id[0] == 1) ? 'Inquery' : 'Permintaan')},
{"name": 'caller_name', "value": false, "field": "Nama Nasabah"},
{"name": 'caller_mobile_phone', "value": false, "field": "No Telepon"},
{"name": 'no_rekening', "value": false, "field": "No Rekening"},
{"name": 'no_kartu_atm', "value": false, "field": "No Kartu ATM"},
{"name": 'ticket_servicefamiliy_name', "value": false, "field": "Topik"},
{"name": 'ticket_service_name', "value": false, "field": "Sub Topik"},
{"name": 'ticket_servicesubcategory_name', "value": false, "field": "Kategori"},
{"name": 'deskripsi', "value": false, "field": 'Deskripsi ' + ((this.listRequest.servicefamily_id[0] == 1) ? 'Inquery' : 'Permintaan')},
{"name": 'e_channel', "value": false, "field": "E-channel/Non-E-channel"},
{"name": 'kategori', "value": false, "field": 'Kategori ' + ((this.listRequest.servicefamily_id[0] == 1) ? 'Inquery' : 'Permintaan')},
{"name": 'tidak_lanjut', "value": false, "field": 'Tindak Lanjut'},
{"name": 'team_name', "value": false, "field": "Unit Terkait (Divisi)"},
{"name": 'ticket_status', "value": false, "field": 'Status ' + ((this.listRequest.servicefamily_id[0] == 1) ? 'Inquery' : 'Permintaan')},
{"name": 'resolve_date', "value": false, "field": "Tanggal Resolved"},
{"name": 'sla_internal', "value": false, "field": "SLA Internal"},
{"name": 'sla_hari_kerja', "value": false, "field": "Hari SLA"},
]
}
} else {
this.fieldExport = [
{"name": 'ref', "value": false, "field": "No Ticket CRM"},
{"name": 'createdby_name', "value": false, "field": "Nama User"},
{"name": 'start_date', "value": false, "field": 'Tanggal Telepon'},
{"name": 'caller_name', "value": false, "field": "Nama Nasabah"},
{"name": 'caller_mobile_phone', "value": false, "field": "No Telepon"},
{"name": 'ticket_servicefamiliy_name', "value": false, "field": "Topik"},
{"name": 'deskripsi', "value": false, "field": 'Deskripsi'},
{"name": 'ticket_status', "value": false, "field": 'Status'},
{"name": 'resolve_date', "value": false, "field": "Tanggal Resolved"},
{"name": 'target_penyelesaian', "value": false, "field": "Target Penyelesaian"},
{"name": 'sla_hari_kerja', "value": false, "field": "Hari SLA"},
]
}
// else {
// this.fieldExport = [
// {"name": 'ref', "value": false, "field": "No Ticket CRM"},
// {"name": 'createdby_name', "value": false, "field": "Nama User"},
// {"name": 'start_date', "value": false, "field": 'Tanggal Telepon'},
// {"name": 'caller_name', "value": false, "field": "Nama Nasabah"},
// {"name": 'caller_mobile_phone', "value": false, "field": "No Telepon"},
// {"name": 'ticket_servicefamiliy_name', "value": false, "field": "Topik"},
// {"name": 'deskripsi', "value": false, "field": 'Deskripsi'},
// {"name": 'ticket_status', "value": false, "field": 'Status'},
// {"name": 'resolve_date', "value": false, "field": "Tanggal Resolved"},
// {"name": 'target_penyelesaian', "value": false, "field": "Target Penyelesaian"},
// {"name": 'sla_hari_kerja', "value": false, "field": "Hari SLA"},
// ]
// }
this.isEmptyLogbooks = true;
this.isLoadingLogbooks = false;
this.listRequest.page = 1;
this.listRequest.perpage = 10;
}
}
onChangeFieldReport(i: number, evt: any) {
this.fieldExport[i]['value'] = evt.target.checked;
}
PagingArrowLeft(){
if(this.listRequest.page != 1){
this.listRequest.page = this.listRequest.page -= 1
this.listLogbooks.PagingDisplay = "Page "+this.listRequest.page+" from " + Math.ceil(this.listLogbooks.count / this.listRequest.perpage) + ', Total ' + this.listLogbooks.count + ' Data'
this.GettingTicketReportDataAPI()
this.isDisabledButtonSearch = true;
}
}
PagingArrowRight(){
if(this.listRequest.page < Math.ceil(this.listLogbooks.count / this.listRequest.perpage)){
this.listRequest.page = this.listRequest.page += 1
this.listLogbooks.PagingDisplay = "Page "+this.listRequest.page+" from " + Math.ceil(this.listLogbooks.count / this.listRequest.perpage) + ', Total ' + this.listLogbooks.count + ' Data'
this.GettingTicketReportDataAPI()
this.isDisabledButtonSearch = true;
}
}
GettingTicketReportDataAPI(){
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;
this.listRequest.roleID = this.RoleID;
this.isLoadingLogbooks = true;
this.isEmptyLogbooks = false;
this._DashboardService.ReportTicketLogBook(this.listRequest)
.subscribe((result: any) => {
if (result.values.data.length != 0) {
this.listLogbooks = {...result.values};
this.listLogbooks.PagingDisplay = "Page "+this.listRequest.page+" from " + Math.ceil(this.listLogbooks.count / this.listRequest.perpage) + ', Total ' + this.listLogbooks.count + ' Data'
this.isEmptyLogbooks = false;
} else {
this.isEmptyLogbooks = true
this.listLogbooks.PagingDisplay = "Page "+this.listRequest.page+" from 1, Total 0 Data";
}
this.isDisabledButtonSearch = false;
this.isLoadingLogbooks = false;
}, (err: HttpErrorResponse) => {
this.isLoadingLogbooks = false;
this.isEmptyLogbooks = true;
this.isDisabledButtonSearch = false;
});
}
GettingExcelForReportDataAPI() {
this.listRequest.field_export = this.fieldExport;
this.listRequest.is_export = 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;
this.listRequest.roleID = this.RoleID;
AratakaConfig.LoadingPage.showLoading('Please wait.., perparing excel.')
this._DashboardService.downloadFileExcelReportLogBook(this.listRequest)
.subscribe((result: any) => {
const blob = new Blob([result], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
const fileName: string = this.listRequest.servicefamily_name + '-' + new Date().toISOString().replace(/T/, ' ').replace(/\..+/, '') +'.xlsx';
const objectUrl: string = URL.createObjectURL(blob);
const a: HTMLAnchorElement = document.createElement('a') as HTMLAnchorElement;
a.href = objectUrl;
a.download = fileName;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
URL.revokeObjectURL(objectUrl);
this.fieldExport.forEach(element => {
element.value = false;
});
AratakaConfig.LoadingPage.hideLoading()
}, (err: HttpErrorResponse) => {
AratakaConfig.LoadingPage.hideLoading()
});
}
}
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { NgModule, APP_INITIALIZER } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterModule } from '@angular/router';
......@@ -7,7 +7,7 @@ import { FormsModule,ReactiveFormsModule } from '@angular/forms';
import { HttpClientModule } from '@angular/common/http';
import { HomeService } from './home.service';
import { ServiceProxyWeb } from '../shared/serviceproxy/service-proxy.service';
import { ConfigService, ServiceProxyWeb } from '../shared/serviceproxy/service-proxy.service';
import { AuthService } from '../shared/serviceproxy/service-proxy.service';
import { AppRoutingModule } from './app-routing.module';
......@@ -22,6 +22,10 @@ import { PageNotFoundComponent } from './page-not-found/page-not-found.component
import { PipeglobalModule } from './pipe/pipeglobal/pipeglobal.module';
export const configFactory = (configService: ConfigService) => {
return () => configService.loadEnvConfig();
};
@NgModule({
declarations: [
AppComponent,
......@@ -45,7 +49,13 @@ import { PipeglobalModule } from './pipe/pipeglobal/pipeglobal.module';
providers: [
HomeService,
ServiceProxyWeb,
AuthService
AuthService,
{
provide: APP_INITIALIZER,
useFactory: configFactory,
deps: [ConfigService],
multi: true
}
],
bootstrap: [AppComponent]
})
......
{
"APIBASEURL" : "http://localhost:9825/",
"MICROSERVICEURL" : "hhttp://innodev.vnetcloud.com/nobu-history-login/api/v1/",
"APIBASEURL" : "http://innodev.vnetcloud.com/nobucall-api-v2/",
"MICROSERVICEURL" : "http://innodev.vnetcloud.com/nobu-history-login/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",
"COMPANY_NAME" : "PT. Visionet Data Internasional",
......
......@@ -4,15 +4,15 @@
export const environment = {
production: false,
"APIBASEURL" : "http://crm.nobubank.com/nobucall-api-v2/",
"MICROSERVICEURL" : "http://crm.nobubank.com/nobucall-api-log/api/v1/",
"APIBASEURL" : "http://innodev.vnetcloud.com/nobucall-api-v2/",
"MICROSERVICEURL" : "http://innodev.vnetcloud.com/nobucall-history-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",
"COMPANY_NAME" : "PT. Visionet Data Internasional",
"PARAM_AGENTROLEID" : 2,
"PARAM_AGENTSPVROLEID" : 1,
"PARAM_SPV" : "1",
"PARAM_AGENT" : "2",
"PARAM_AGENT" : "2",
"PARAM_SERVICEDESK" : "4",
"PARAM_SUPPORT" : "5",
"ZENDESK_API_URL" : "https://ovo1552295957.zendesk.com/",
......
......@@ -9,42 +9,22 @@ import { Http, ResponseContentType, RequestOptions } from '@angular/http';
import { environment } from '../../environments/environment';
//const API_URL = environment.apiUrl;
var API_URL = environment.APIBASEURL;
var API_MICROSERVICE = environment.MICROSERVICEURL;
var ckConfig = environment.ckeConfig;
var SITE_NAME = environment.SITE_NAME;
var SITE_LOGO = environment.SITE_LOGO;
var COMPANY_NAME = environment.COMPANY_NAME
var PARAM_AGENTROLEID = environment.PARAM_AGENTROLEID
var PARAM_AGENTSPVROLEID = environment.PARAM_AGENTSPVROLEID
var PARAM_SPV = environment.PARAM_SPV
var PARAM_AGENT = environment.PARAM_AGENT
var PARAM_SERVICEDESK = environment.PARAM_SERVICEDESK
var PARAM_SUPPORT = environment.PARAM_SUPPORT
var ZENDESK_API_URL = environment.ZENDESK_API_URL
var ZENDESK_API_USER = environment.ZENDESK_API_USER
var ZENDESK_API_PASS = environment.ZENDESK_API_PASS
var CATEGORY = environment.category.servicesubcategory_id
console.log(environment)
// fetch('./assets/configAPI.json').then(res => res.json())
// .then(res => {
// API_URL = res.APIBASEURL;
// API_MICROSERVICE = res.MICROSERVICEURL;
// ckConfig = res.ckeConfig;
// SITE_NAME = res.SITE_NAME;
// SITE_LOGO = res.SITE_LOGO;
// COMPANY_NAME = res.COMPANY_NAME
// PARAM_AGENTROLEID = res.PARAM_AGENTROLEID
// PARAM_AGENTSPVROLEID = res.PARAM_AGENTSPVROLEID
// PARAM_SPV = res.PARAM_SPV
// PARAM_AGENT = res.PARAM_AGENT
// PARAM_SERVICEDESK = res.PARAM_SERVICEDESK
// PARAM_SUPPORT = res.PARAM_SUPPORT
// ZENDESK_API_URL = res.ZENDESK_API_URL
// ZENDESK_API_USER = res.ZENDESK_API_USER
// ZENDESK_API_PASS = res.ZENDESK_API_PASS
// CATEGORY = res.category.servicesubcategory_id
// })
var API_URL;
var API_MICROSERVICE;
var ckConfig;
var SITE_NAME;
var SITE_LOGO;
var COMPANY_NAME;
var PARAM_AGENTROLEID;
var PARAM_AGENTSPVROLEID ;
var PARAM_SPV;
var PARAM_AGENT;
var PARAM_SERVICEDESK;
var PARAM_SUPPORT;
var ZENDESK_API_URL;
var ZENDESK_API_USER;
var ZENDESK_API_PASS;
var CATEGORY;
@Injectable({
providedIn: 'root'
......@@ -1128,6 +1108,38 @@ export class DashboardService {
}
@Injectable({
providedIn: 'root'
})
export class ConfigService {
config;
constructor(private http: HttpClient) {}
loadEnvConfig() {
this.config = this.http
.get('./assets/configAPI.json')
.subscribe((config: any) => {
API_URL = config.APIBASEURL;
API_MICROSERVICE = config.MICROSERVICEURL;
ckConfig = config.ckeConfig;
SITE_NAME = config.SITE_NAME;
SITE_LOGO = config.SITE_LOGO;
COMPANY_NAME = config.COMPANY_NAME;
PARAM_AGENTROLEID = config.PARAM_AGENTROLEID;
PARAM_AGENTSPVROLEID = config.PARAM_AGENTSPVROLEID;
PARAM_SPV = config.PARAM_SPV;
PARAM_AGENT = config.PARAM_AGENT;
PARAM_SERVICEDESK = config.PARAM_SERVICEDESK;
PARAM_SUPPORT = config.PARAM_SUPPORT;
ZENDESK_API_URL = config.ZENDESK_API_URL;
ZENDESK_API_USER = config.ZENDESK_API_USER;
ZENDESK_API_PASS = config.ZENDESK_API_PASS;
CATEGORY = config.category.servicesubcategory_id;
})
}
}
@Injectable({
providedIn: 'root'
......
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