Commit 5d33b150 authored by ari_darmawan's avatar ari_darmawan

export excel dinamis

parent e036f1b5
......@@ -26,6 +26,11 @@
margin-right: 7px;
}
.input-information {
width: 100%;
height: 30px;
}
.custom-minus-date:hover{
background: #D50000;
border: 1px solid #D50000;
......
......@@ -172,7 +172,7 @@
</div>
<div class="modal fade" id="SelectCustomer-MD" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-md" role="document">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<p class="modal-title">
......
<div class="row">
<div class="col-12">
<div class="col-6">
<div class="form-group" *ngIf="CustomerType != ''" >
<label><small>Customer Type <span class="text-danger">*</span></small></label>
<select type="text"
......@@ -132,24 +133,88 @@
class="form-control form-control-sm" style="resize: none" [(ngModel)]="Address"></textarea>
</div>
</div>
<ng-container *ngIf="CustomerType != ''">
<div class="col-4">
<button class="btn btn-sm btn-block btn-danger" style="border-radius: 3px" (click)="CancelClick()"><i class="fas fa-times"></i> Cancel</button>
<div class="col-6" *ngIf="isTicketHistoryEmpty">
<p><b>Ticket History</b></p>
<p style="font-size:18px;" class="text-muted text-center">
<i class="fas fa-table fa-3x"></i>
<br> Empty Data
</p>
</div>
<div class="col-6" *ngIf="isLoadingTicketHistory">
<p><b>Ticket History</b></p>
<p style="font-size:18px;" class="text-muted text-center">
<i class="fas fa-spinner fa-spin"></i>
Retrieving data
</p>
</div>
<div class="col-6" *ngIf="!isTicketHistoryEmpty && !isLoadingTicketHistory">
<p><b>{{FirstName}} {{LastName}}'s Ticket History</b></p>
<div class="card">
<div class="card-body" style="max-height: 440px;overflow-y: scroll;">
<ng-container *ngFor="let data of listTicketHistory">
<p class="m-1">
<a href="javascript:;" target="_blank" class="text-info">
{{data.ref}}
</a>
</p>
<span *ngIf="data.status == 'rejected'" class='badge badge-pill badge-dark'>REJECTED</span>
<span *ngIf="data.status == 'new'" class='badge badge-pill badge-warning'>NEW</span>
<span *ngIf="data.status == 'resolved'" class='badge badge-pill badge-secondary'>SOLVED</span>
<span *ngIf="data.status == 'closed'" class='badge badge-pill badge-success'>CLOSED</span>
<span *ngIf="data.status == 'escalated_tto'" class='badge badge-pill badge-danger'>ESCALATED TTO</span>
<span *ngIf="data.status == 'escalated_ttr'"class='badge badge-pill badge-danger'>ESCALATED TTR</span>
<span *ngIf="data.status == 'assigned'" class='badge badge-pill badge-primary'>ASSIGNED</span>
<span *ngIf="data.status == 'dispatched'" class='badge badge-pill badge-danger'>DISPATCH</span>
<span *ngIf="data.agent_id == 0" class='badge badge-pill' style="background-color: orange;">Defect</span>
<p class="m-1"><small>{{data.title}}</small></p>
<p class="m-1">
<small>
<b>{{data.start_date | date: 'dd MMMM yyyy HH:mm'}}</b>
</small>
</p>
<hr>
</ng-container>
</div>
<div class="col-4" *ngIf="IsFormDisabled && !isEditCustomerType">
<button class="btn btn-sm btn-block arataka-btn-default" (click)="EditCsutomerData()"><i class="fas fa-user-edit"></i> Edit Customer</button>
</div>
<div class="col-8" *ngIf="IsFormDisabledCSType && isEditCustomerType">
<button class="btn btn-sm btn-block arataka-btn-default" (click)="EditCsutomerDataSubmit()"><i class="far fa-paper-plane"></i> Save Customer</button>
</div>
<div class="col-4" *ngIf="!IsFormDisabledCSType">
<button class="btn btn-sm btn-block arataka-btn-primary" (click)="SubmitNewCustomer()"><i class="fas fa-plus-circle"></i> Add Customer</button>
</div>
<div class="row">
<ng-container *ngIf="CustomerType != ''">
<div class="col-3">
<button class="btn btn-sm btn-block btn-danger" style="border-radius: 3px" (click)="CancelClick()">
<i class="fas fa-times"></i>
Cancel
</button>
</div>
<div class="col-3" *ngIf="IsFormDisabled && !isEditCustomerType">
<button class="btn btn-sm btn-block arataka-btn-default" (click)="EditCsutomerData()">
<i class="fas fa-user-edit"></i>
Edit Customer
</button>
</div>
<div class="col-4" *ngIf="IsFormDisabledCSType && isEditCustomerType">
<button class="btn btn-sm btn-block arataka-btn-default" (click)="EditCsutomerDataSubmit()">
<i class="far fa-paper-plane"></i>
Save Customer
</button>
</div>
<div class="col-3" *ngIf="!IsFormDisabledCSType">
<button class="btn btn-sm btn-block arataka-btn-primary" (click)="SubmitNewCustomer()">
<i class="fas fa-plus-circle"></i>
Add Customer
</button>
</div>
</ng-container>
<ng-container *ngIf="CustomerType == ''">
<div class="col-12">
<p class="text-warning"><small>Note : this Customer doesn't match any Customer Type</small></p>
<button class="btn btn-sm btn-block btn-danger" style="border-radius: 3px" (click)="CancelDosentMatchCustType()"><i class="fas fa-times"></i> Cancel</button>
<button class="btn btn-sm btn-block btn-danger" style="border-radius: 3px" (click)="CancelDosentMatchCustType()">
<i class="fas fa-times"></i>
Cancel
</button>
</div>
</ng-container>
</div>
\ No newline at end of file
......@@ -100,6 +100,10 @@ export class AdminTicketCustomerMdComponent implements OnInit {
type : null
}
listTicketHistory: any[] = [];
isTicketHistoryEmpty: boolean = true;
isLoadingTicketHistory: boolean = false;
constructor(injector: Injector,
private router: Router,
private FormBuilder : FormBuilder,
......@@ -351,6 +355,9 @@ export class AdminTicketCustomerMdComponent implements OnInit {
this.IsFormDisabledCSType = false;
this.IsFormDisabled = true;
}
this.listTicketHistory = [];
this.isTicketHistoryEmpty = true;
this.isLoadingTicketHistory = false;
}
SubmitNewCustomer(){
......@@ -489,7 +496,6 @@ export class AdminTicketCustomerMdComponent implements OnInit {
//API Function ---------------------------------------------------------------------------------------
GettingPersonByMobileNumberListAPI(_Request){
//AratakaConfig.LoadingPage.showLoading('Checking Person by Mobile Number')
console.log(this.MobileNumber)
this._CustomerService.GetPersonByMobileNumber(_Request)
.subscribe((result: any) => {
if(result != null){
......@@ -539,6 +545,7 @@ export class AdminTicketCustomerMdComponent implements OnInit {
this.MobileNumber2 = result.values[0].mobile_phone2
this.MothersName = result.values[0].nama_ibu_kandung
this.Address = result.values[0].alamat
this.requestHistoryTicket(result.values[0].id)
AratakaConfig.BootstrapDateCustomPicker({
ID: '#DOBDate',
DateValue: result.values[0].tanggal_lahir,
......@@ -639,7 +646,7 @@ export class AdminTicketCustomerMdComponent implements OnInit {
Format: 'DD-MM-YYYY',
isGet: false,
})
// this.requestHistoryTicket()
this.CustomerID = result.values[0].id;
this.IsFormDisabled = true;
......@@ -749,4 +756,26 @@ export class AdminTicketCustomerMdComponent implements OnInit {
});
}
requestHistoryTicket(caller_id: number) {
this.listTicketHistory = [];
this.isLoadingTicketHistory = true;
this.isTicketHistoryEmpty = false;
this._TicketService.listTicketToCallerID(caller_id)
.subscribe((res: any) => {
console.log(res)
if (res.values.tickets.length > 0) {
this.listTicketHistory = res.values.tickets;
this.isTicketHistoryEmpty = false;
} else {
this.listTicketHistory = [];
this.isTicketHistoryEmpty = true;
}
this.isLoadingTicketHistory = false;
}, (err: HttpErrorResponse) => {
this.listTicketHistory = [];
this.isLoadingTicketHistory = false;
this.isTicketHistoryEmpty = true;
})
}
}
......@@ -60,3 +60,8 @@
.fileEmailLogsDetail:hover{
background: #FFB74D;
}
.input-information {
width: 100%;
height: 30px;
}
{
"APIBASEURL" : "http://crm.nobubank.com/nobucall-api-v2/",
"APIBASEURL" : "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",
......
......@@ -207,6 +207,16 @@ export class TicketService {
constructor(private injector: Injector, private http : HttpClient) { }
listTicketToCallerID(idCaller: number) {
const service = this.injector.get(ServiceProxyWeb)
let headers = new HttpHeaders({
'Content-Type': 'application/json',
'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);
}
List(_data) {
const service = this.injector.get(ServiceProxyWeb)
......
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