Commit 9adabe83 authored by ari_darmawan's avatar ari_darmawan

fix tabs loogbook

parent 6d4fe6a0
......@@ -3,9 +3,7 @@
<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"
[ngClass]="{'d-none': (RoleID != _SP.PARAM_SERVICEDESK && RoleID != _SP.PARAM_SPV &&
(TeamID != Env.Team.SociomileStaff && TeamID != Env.Team.CsCabangBranchAgent) && TeamID != Env.Team.ServiceReport )}">
<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">
......@@ -18,9 +16,7 @@
</div>
</div>
</div>
<div class="col-12 col-sm-6 col-md-4 col-lg-2"
[ngClass]="{'d-none': (RoleID != _SP.PARAM_SERVICEDESK && RoleID != _SP.PARAM_SPV
&& (TeamID != Env.Team.SociomileStaff && TeamID != Env.Team.CsCabangBranchAgent) && TeamID != Env.Team.ServiceReport )}">
<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">
......
......@@ -442,7 +442,7 @@
<div class="table-responsive mt-4" *ngIf="(TeamID == Env.Team.AgentCallCenter)">
<table class="table table-bordered table-striped table-sm">
<thead>
<ng-container *ngIf="serviceFamilyName == 'Pengaduan Dashboard SD'">
<ng-container>
<tr>
<th rowspan="2" style="max-width: 15px;">#</th>
<th *ngFor="let data of fieldExport; let i = index">
......@@ -453,7 +453,7 @@
</th>
</tr>
</ng-container>
<ng-container *ngIf="serviceFamilyName == 'Permintaan Dashboard SD'">
<!-- <ng-container *ngIf="serviceFamilyName == 'Permintaan Dashboard SD'">
<tr>
<th rowspan="2" style="max-width: 15px;">#</th>
<th *ngFor="let data of fieldExport; let i = index">
......@@ -463,11 +463,11 @@
</div>
</th>
</tr>
</ng-container>
</ng-container> -->
</thead>
<!-- [ngStyle]="{'background-color': (i%2 == 0)? '#ccc' : '#fff'}" -->
<tbody>
<ng-container *ngIf="serviceFamilyName == 'Pengaduan Dashboard SD'">
<ng-container>
<ng-container *ngFor="let data of listLogbooks.data; let i = index">
<tr>
<td class="col-1">{{((i+1) + ((listRequest.perpage * listRequest.page) - listRequest.perpage))}}.</td>
......@@ -499,7 +499,7 @@
</tr>
</ng-container>
</ng-container>
<ng-container *ngIf="serviceFamilyName == 'Permintaan Dashboard SD'">
<!-- <ng-container *ngIf="serviceFamilyName == 'Permintaan Dashboard SD'">
<ng-container *ngFor="let data of listLogbooks.data; let i = index">
<tr>
<td class="col-1">{{((i+1) + ((listRequest.perpage * listRequest.page) - listRequest.perpage))}}.</td>
......@@ -530,7 +530,7 @@
<td>{{data.sla_hari_kerja}}</td>
</tr>
</ng-container>
</ng-container>
</ng-container> -->
</tbody>
</table>
</div>
......@@ -542,7 +542,7 @@
<div class="col-12">
<p class="text-center text-muted">
<small>
{{PagingDisplay}}
{{listLogbooks.PagingDisplay}}
</small>
</p>
</div>
......
......@@ -219,6 +219,24 @@ export class LogbooksReportComponent implements OnInit, OnChanges {
if (this.isDisabledButtonSearch) this.GettingTicketReportDataAPI()
}
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;
}
}
onChangeFieldReport(i: number, evt: any) {
this.fieldExport[i]['value'] = evt.target.checked;
}
......
......@@ -158,9 +158,7 @@ export class LogbooksComponent implements OnInit, OnChanges {
ReportExportToExcel(){
let UserID = this._SP.getUserInformation.values.team_id == this.Env.Team.ServiceReport ? null : this._SP.getUserInformation.values.user_id;
// let UserID = this._SP.getUserInformation.values.user_id;
if(this.RoleID == this._SP.PARAM_SPV){
UserID = null;
}
if (this.RoleID == this._SP.PARAM_SPV) UserID = null;
this.GettingExcelForReportDataAPI({
user_id : UserID,
......@@ -197,7 +195,7 @@ export class LogbooksComponent implements OnInit, OnChanges {
});
let promiseLogbooks = new Promise((resolve, reject) => {
this._DashboardService.ReportTicketCategoryLogBook(this.TeamID)
this._DashboardService.ReportTicketCategoryLogBook(null)
.subscribe((result: any) => {
if (result.values != undefined) {
let responseLogbooks = {
......@@ -215,33 +213,16 @@ export class LogbooksComponent implements OnInit, OnChanges {
this.listChildTabs = [];
Promise.all([
promiseReport,
// promiseReport,
promiseLogbooks
])
.then((result: any) => {
]).then((result: any) => {
let reportData = [];
let logbooksData = [];
for (let i=0; i<result.length; i++) {
if ('report' in result[i]) reportData = result[i].report;
else if ('logbooks' in result[i]) logbooksData = result[i].logbooks
if ('logbooks' in result[i]) logbooksData = result[i].logbooks
}
var AllCount = 0;
reportData.map(function(x,index){
AllCount = AllCount + x.count;
})
this.listChildTabs.push({
id: null,
name: "All",
servicefamily_id : null,
servicefamily_name : "All",
count : `(${AllCount})`,
selected : false,
tabs: 'report'
})
for(var i = 0 ; i < reportData.length; i++){
this.listChildTabs.push({
id : reportData[i].servicefamily_id,
......@@ -254,8 +235,9 @@ export class LogbooksComponent implements OnInit, OnChanges {
})
}
// pengkondisian tabs team
for(var i = 0 ; i < logbooksData.length; i++){
if (this.TeamID == this.Env.Team.AgentCallCenter) {
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,
......@@ -263,8 +245,26 @@ export class LogbooksComponent implements OnInit, OnChanges {
selected : false,
tabs: 'logbooks'
})
}
} else {
}
} 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,
......@@ -275,19 +275,15 @@ export class LogbooksComponent implements OnInit, OnChanges {
}
this.listChildTabs[0].selected = true;
// if (this.listChildTabs[0].servicefamily_id) {
this.TicketReportRequest.servicefamily_id = this.listChildTabs[0].servicefamily_id;
this.TicketReportRequest.servicefamily_name = this.listChildTabs[0].servicefamily_name;
// }
this.TicketReportRequest.servicefamily_id = this.listChildTabs[0].servicefamily_id;
this.TicketReportRequest.servicefamily_name = this.listChildTabs[0].servicefamily_name;
this.isEmptyChild = false;
this.isLoadingChild = false;
})
.catch((err) => {
}).catch((err) => {
this.isEmptyChild = true;
this.isLoadingChild = false;
})
}
GettingTicketReportDataAPI() {
......
......@@ -4,7 +4,7 @@
export const environment = {
production: false,
"APIBASEURL" : "http://innodev.vnetcloud.com/nobucall-api-v2/",
"APIBASEURL" : "http://localhost:9825/",
"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",
......
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