Commit 9adabe83 authored by ari_darmawan's avatar ari_darmawan

fix tabs loogbook

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