Commit 60b3d3af authored by ari_darmawan's avatar ari_darmawan

micro service

parent b69829bb
...@@ -13,7 +13,8 @@ import { LoginLogsComponent } from './login-logs/login-logs.component'; ...@@ -13,7 +13,8 @@ import { LoginLogsComponent } from './login-logs/login-logs.component';
import { AdminDashboardLogbooksComponent } from './admin-dashboard-logbooks/admin-dashboard-logbooks.component'; import { AdminDashboardLogbooksComponent } from './admin-dashboard-logbooks/admin-dashboard-logbooks.component';
import { AdminUserAgentComponent } from './admin-user-agent/admin-user-agent.component'; import { AdminUserAgentComponent } from './admin-user-agent/admin-user-agent.component';
import { LogbookComponent } from './logbook/logbook.component'; import { LogbookComponent } from './logbook/logbook.component';
import { AdminTestPingComponent } from '../admin/admin-test-ping/admin-test-ping.component' import { AdminTestPingComponent } from '../admin/admin-test-ping/admin-test-ping.component';
import { CreateTicketTestComponent } from '../admin/admin-ticket/create-ticket-test/create-ticket-test.component';
const routes: Routes = [ const routes: Routes = [
{ {
...@@ -68,6 +69,10 @@ const routes: Routes = [ ...@@ -68,6 +69,10 @@ const routes: Routes = [
path: 'testing-server', path: 'testing-server',
component: AdminTestPingComponent component: AdminTestPingComponent
}, },
{
path: 'create-ticket-test',
component: CreateTicketTestComponent
}
]; ];
......
.custom-add-date{
background: transparent;
color: #222;
border-radius: 2px;
border: 1px solid #ccc;
}
.custom-add-date:hover{
background: #FAFAFA;
}
.arataka-custom-autocomplete{
border: 1px solid #cccccc;
padding: 0px;
border-radius: 5px;
margin-top: -5px;
position: absolute;
background: #ffffff !important;
z-index: 999;
width: 90%;
max-height: 260px;
overflow-y: auto;
}
.arataka-chevron-autocomplete{
position: absolute;
z-index: 999;
right: 0;
top: 0;
margin-top: 33px !important;
margin-right: 25px !important;
color: #9E9E9E;
}
.arataka-custom-autocomplete-itemlist{
font-size: 11px;
color: #222;
margin: 7px 0;
cursor: pointer;
padding: 3px 3px;
}
.arataka-custom-autocomplete-itemlist:hover{
background: #1976D2;
border-radius: 3px;
color: #ffffff;
}
.custom-minus-date{
position: absolute;
z-index: 99;
top:0;
right: 0;
height: 18px;
width: 18px;
border: 1px solid #ffffff;
border-radius: 50%;
background: #fff;
font-size: 12px;
color: #D50000;
cursor: pointer;
margin-top: 20px;
margin-right: 7px;
}
.input-information {
width: 100%;
height: 30px;
}
.custom-minus-date:hover{
background: #D50000;
border: 1px solid #D50000;
color: #fff;
}
<div class="container">
<div class="row">
<div class="col-6 col-sm-6 col-md-9 col-lg-10 mb-3">
<h6 class="text-muted"><i class="fas fa-ticket-alt"></i> Create New Ticket</h6>
</div>
<div class="col-6 col-sm-6 col-md-3 col-lg-2 mb-3">
<button class="btn btn-sm btn-block arataka-btn-primary" (click)="SubmitClick()"><i class="fas fa-save"></i>
Create Ticket</button>
</div>
</div>
<div class="row">
<div class="col-12 col-sm-4 col-md-4 col-lg-3">
<div class="form-group">
<label class="text-muted">Add Customer <span class="text-danger">*</span></label>
<button type="button" class="btn arataka-btn-select btn-sm btn-block mb-3"
(click)="SelectCustomerMDClick(null)">
<i class="fas fa-chevron-down"></i>&nbsp;
{{CustomerMdData.Name}}
</button>
</div>
<!-- <hr>
<p>
<b>Agent</b>
</p>
<div class="form-group">
<label class="text-muted">Nama Agent <span class="text-danger">*</span></label>
<select type="text"
class="form-control form-control-sm select-style" [(ngModel)]="idAgent" #inputRequired>
<ng-container *ngFor="let agent of listAgent; let i = index">
<option value="{{agent.id}}">{{agent.code}} - {{agent.name}}</option>
</ng-container>
</select>
</div>
<div class="form-group">
<label class="text-muted">Ext Agent <span class="text-danger">*</span></label>
<input type="text" placeholder="Input Ext Agent ..." #inputRequired class="form-control form-control-sm" [(ngModel)]="extAgent" maxlength="30">
</div>
<div class="form-group">
<label class="text-muted">Date Time Call <span class="text-danger">*</span></label>
<div class="input-group date" id="DateTimeCall" data-target-input="nearest">
<input type="text"
class="form-control form-control-sm datetimepicker-input" data-toggle="datetimepicker"
data-target="#DateTimeCall" (blur)="onChangeCallTImeAgent()"/>
<div class="input-group-append" data-target="#DateTimeCall" data-toggle="datetimepicker">
<div class="input-group-text"><i class="far fa-calendar-alt"></i></div>
</div>
</div>
</div>
<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> -->
<p>
<b>Assignee</b>
</p>
<div class="form-group">
<label class="text-muted">Assignee Team <span class="text-danger">*</span></label>
<!-- <select type="text" #inputRequired class="form-control form-control-sm select-style"
[(ngModel)]="AssigneeTeam_ID" (change)="AssigneeTeamChange()">
<ng-container *ngFor="let AssigneeTeam of AssigneeTeamData; let i = index">
<option value="{{AssigneeTeam.ID}}">{{AssigneeTeam.Name}}</option>
</ng-container>
</select> -->
<nz-select
style="width: 100%;"
[(ngModel)]="AssigneeTeam_ID"
nzPlaceHolder="Select Team"
nzAllowClear
nzShowSearch
(ngModelChange)="AssigneeTeamChange()"
>
<nz-option *ngFor="let o of AssigneeTeamData" [nzValue]="o.ID" [nzLabel]="o.Name" nzCustomContent>
<span nz-tooltip [nzTitle]="o.Name">{{o.Name}}</span>
</nz-option>
</nz-select>
</div>
<div class="form-group">
<label class="text-muted">Assignee Agent <span class="text-danger">*</span></label>
<nz-select
style="width: 100%;"
[(ngModel)]="AssigneeTeamAgent_ID"
nzPlaceHolder="Select Agent"
nzAllowClear
nzShowSearch
>
<nz-option *ngFor="let o of AssigneeTeamAgentData" [nzValue]="o.ID" [nzLabel]="o.Name" nzCustomContent>
<span nz-tooltip [nzTitle]="o.Name">{{o.Name}}</span>
</nz-option>
</nz-select>
<!-- <div [ngClass]="{'arataka-custom-autocomplete': search.isAgent}" *ngIf="search.isAgent">
<input type="text" class="form-control form-control-sm" [(ngModel)]="AssigneeTeamAgent_Name"
placeholder="All Agent : Type to search" (blur)="onBlur()"
(keyup)="onSeacrhSelectAgent($event)"/>
<span class="arataka-chevron-autocomplete"></span>
<ng-container *ngFor="let data of AssigneeTeamAgentData; let i = index">
<p (click)="AssigneeTeamAgent_ID = data.ID; search.isAgent=false; AssigneeTeamAgent_Name = data.Name;"
class="arataka-custom-autocomplete-itemlist"
>{{data.Name}}</p>
</ng-container>
</div>
<select type="text" #inputRequired class="form-control form-control-sm select-style"
[(ngModel)]="AssigneeTeamAgent_ID" *ngIf="!search.isAgent"
(click)="search.isAgent = true">
<ng-container *ngFor="let AssigneeTeamAgent of AssigneeTeamAgentData; let i = index">
<option value="{{AssigneeTeamAgent.ID}}">{{AssigneeTeamAgent.Name}}</option>
</ng-container>
</select> -->
</div>
<hr>
<p>
<b>Topic & Category</b>
</p>
<div class="form-group">
<label class="text-muted">Topic <span class="text-danger">*</span></label>
<select type="text" #inputRequired class="form-control form-control-sm select-style" [(ngModel)]="Topic_ID"
(change)="TopicChange(); Category_Name = ''; Category_ID = ''; SubTopic_Name= ''; SubTopic_ID = '';">
<ng-container *ngFor="let Topic of TopicData; let i = index">
<option value="{{Topic.ID}}">{{Topic.Name}}</option>
</ng-container>
</select>
</div>
<div class="form-group">
<label class="text-muted">Sub Topic <span class="text-danger">*</span></label>
<nz-select
style="width: 100%;"
[(ngModel)]="SubTopic_ID"
nzPlaceHolder="Select Sub Topic"
nzAllowClear
nzShowSearch
(ngModelChange)="SubTopicChange()"
>
<nz-option *ngFor="let o of SubTopicData" [nzValue]="o.ID" [nzLabel]="o.Name" nzCustomContent>
<span nz-tooltip [nzTitle]="o.Name">{{o.Name}}</span>
</nz-option>
</nz-select>
<!-- <div [ngClass]="{'arataka-custom-autocomplete': search.isSubTopic}" *ngIf="search.isSubTopic">
<input type="text" class="form-control form-control-sm" [(ngModel)]="SubTopic_Name"
placeholder="All Sub Topic : Type to search" (blur)="onBlur()"
(keyup)="onSeacrhSelectSubTopic($event)"/>
<span class="arataka-chevron-autocomplete"></span>
<ng-container *ngFor="let data of SubTopicData; let i = index">
<p (click)="SubTopic_ID = data.ID; search.isSubTopic=false; SubTopic_Name = data.Name; SubTopicChange(); Category_Name = ''; Category_ID = '';"
class="arataka-custom-autocomplete-itemlist"
>{{data.Name}}</p>
</ng-container>
</div>
<select type="text" #inputRequired class="form-control form-control-sm select-style" [(ngModel)]="SubTopic_ID"
(change)="SubTopicChange()" *ngIf="!search.isSubTopic"
(click)="search.isSubTopic = true">
<ng-container *ngFor="let SubTopic of SubTopicData; let i = index">
<option value="{{SubTopic.ID}}">{{SubTopic.Name}}</option>
</ng-container>
</select> -->
</div>
<div class="form-group">
<label class="text-muted">Category <span class="text-danger">*</span></label>
<nz-select
style="width: 100%;"
[(ngModel)]="Category_ID"
nzPlaceHolder="Select Category"
nzAllowClear
nzShowSearch
>
<nz-option *ngFor="let o of CategoryData" [nzValue]="o.ID" [nzLabel]="o.Name" nzCustomContent>
<span nz-tooltip [nzTitle]="o.Name">{{o.Name}}</span>
</nz-option>
</nz-select>
<!-- <div [ngClass]="{'arataka-custom-autocomplete': search.isCategory}" *ngIf="search.isCategory">
<input type="text" class="form-control form-control-sm" [(ngModel)]="Category_Name"
placeholder="All Category : Type to search" (blur)="onBlur()"
(keyup)="onSeacrhSelectCategory($event)"/>
<span class="arataka-chevron-autocomplete"></span>
<ng-container *ngFor="let data of CategoryData; let i = index">
<p (click)="Category_ID = data.ID; search.isCategory=false; Category_Name = data.Name"
class="arataka-custom-autocomplete-itemlist"
>{{data.Name}}</p>
</ng-container>
</div>
<select type="text" #inputRequired class="form-control form-control-sm select-style" [(ngModel)]="Category_ID"
*ngIf="!search.isCategory" (click)="search.isCategory = true">
<ng-container *ngFor="let Category of CategoryData; let i = index">
<option value="{{Category.ID}}">{{Category.Name}}</option>
</ng-container>
</select> -->
</div>
<ng-container
*ngIf="Topic_ID == Env.Topic.Keluhan.toString() || Topic_ID == Env.Topic.PermintaanKeServiceDesk.toString()">
<hr>
<p>Complaint</p>
<div class="form-group">
<label class="text-muted">Reason <span class="text-danger">*</span></label>
<select type="text" #inputRequired class="form-control form-control-sm select-style"
[(ngModel)]="Complaintment_ID">
<ng-container *ngFor="let Complaintment of ComplaintmentData; let i = index">
<option value="{{Complaintment.ID}}">{{Complaintment.Name}}</option>
</ng-container>
</select>
</div>
</ng-container>
</div>
<div class="col-12 col-sm-8 col-md-8 col-lg-9">
<div class="row">
<div class="col-12 col-sm-12 col-md-8 col-lg-9">
<div class="form-group">
<label class="text-muted">Subject <span class="text-danger">*</span></label>
<input type="text" #inputRequired class="form-control form-control-sm" [(ngModel)]="Subject"
maxlength="100">
</div>
</div>
<div class="col-12 col-sm-12 col-md-4 col-lg-3">
<div class="form-group" [ngClass]="{'d-block': !isDateTransaction, 'd-none':isDateTransaction }">
<label class="text-muted"><small>Date Transaction (Optional)</small></label>
<a href="javascript:;" class="btn btn-sm btn-block custom-add-date" (click)="isDateTransaction=true"><i
class="far fa-calendar-alt"></i> Add Date</a>
</div>
<div class="form-group" [ngClass]="{'d-block': isDateTransaction, 'd-none':!isDateTransaction }">
<label class="text-muted"><small>Date Transaction (Optional)</small></label>
<div class="input-group date" id="DateTransaction" data-target-input="nearest">
<input type="text" class="form-control form-control-sm datetimepicker-input" data-toggle="datetimepicker"
data-target="#DateTransaction" />
<div class="input-group-append" data-target="#DateTransaction" data-toggle="datetimepicker">
<div class="input-group-text"><i class="far fa-calendar-alt"></i></div>
</div>
</div>
<span class="custom-minus-date text-center" (click)="isDateTransaction=false"><i
class="fas fa-times"></i></span>
</div>
</div>
</div>
<div class="form-group">
<p class="btn btn-sm arataka-btn-default m-0" (click)="SelectAndUploadFile()">
<i class="fas fa-upload"></i> Select & Upload File
</p>
</div>
<div class="form-group">
<label class="text-muted">Description <span class="text-danger">*</span></label>
<!--<textarea class="form-control form-control-sm" [(ngModel)]="description" style="resize: none;"></textarea>-->
<ck-editor name="editor1" [(ngModel)]="Description" skin="moono-lisa" language="en" [fullPage]="false" [config]="{ toolbar: [
[ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo' ],
[ 'list', 'indent', 'blocks', 'align', 'bidi' ],
[ 'Bold', 'Italic', 'Underline'],
[ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', '-', 'Language' ],
[ 'Link', 'Unlink'] ],
height : 292 }">
</ck-editor>
</div>
<div class="form-group" *ngIf="TeamID == Env.Team.CsCabangBranchAgent || TeamID == Env.Team.SociomileStaff">
<label class="text-muted" *ngIf="TeamID == Env.Team.CsCabangBranchAgent">CS Cabang <span
class="text-danger">*</span></label>
<label class="text-muted" *ngIf="TeamID == Env.Team.SociomileStaff">Staff NWB <span
class="text-danger">*</span></label>
<input type="text" #inputRequired class="form-control form-control-sm" [(ngModel)]="CSCabang" maxlength="100">
</div>
<div class="form-group" *ngIf="TeamID == Env.Team.CsCabangBranchAgent">
<label class="text-muted">Supervisor/BOH <span class="text-danger">*</span></label>
<input type="text" #inputRequired class="form-control form-control-sm" [(ngModel)]="SupervisorBOH"
maxlength="100">
</div>
</div>
</div>
</div>
<div class="modal fade" id="SelectCustomer-MD" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<p class="modal-title">
<b>Add Customer</b>
</p>
<!-- <button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button> -->
</div>
<div class="modal-body">
<app-admin-ticket-customer-md #CallViewChildCustomerMd (ChildEvent)="FromChildCustomerMD($event)">
</app-admin-ticket-customer-md>
</div>
</div>
</div>
</div>
<div class="modal fade" id="SelectFile-MD" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-body">
<app-admin-selectfiletemplate #CallViewChildSelectFileMd
(ChildEvent)="FromSelectAndUploadFileMD($event)"></app-admin-selectfiletemplate>
</div>
</div>
</div>
</div>
\ No newline at end of file
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { CreateTicketTestComponent } from './create-ticket-test.component';
describe('CreateTicketTestComponent', () => {
let component: CreateTicketTestComponent;
let fixture: ComponentFixture<CreateTicketTestComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ CreateTicketTestComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(CreateTicketTestComponent);
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 { TicketService } from '../../../../shared/serviceproxy/service-proxy.service';
import { ServiceProxyWeb,MicroService } from '../../../../shared/serviceproxy/service-proxy.service';
import { Router, ActivatedRoute } from '@angular/router';
import * as moment from 'moment';
import * as $ from 'jquery';
declare const AratakaConfig : any;
import { AdminTicketCustomerMdComponent } from '../admin-ticket-customer-md/admin-ticket-customer-md.component';
import { AdminSelectfiletemplateComponent } from '../../admin-selectfiletemplate/admin-selectfiletemplate.component';
import { environment } from '../../../../environments/environment.prod';
import { NzNotificationService } from 'ng-zorro-antd';
import { NzModalService } from 'ng-zorro-antd';
@Component({
selector: 'app-create-ticket-test',
templateUrl: './create-ticket-test.component.html',
styleUrls: ['./create-ticket-test.component.css']
})
export class CreateTicketTestComponent implements OnInit {
public Env = environment;
public TeamID = this._SP.getUserInformation.values.team_id
public RoleID = this._SP.getUserInformation.values.roles[0].id
public isDateTransaction : boolean = false
public UrlPhoneNumberParam =
{
value : null,
type : "PhoneNumber"
}
///Call Child
@ViewChild('CallViewChildCustomerMd') CallViewChildCustomerMd: AdminTicketCustomerMdComponent;
@ViewChild('CallViewChildSelectFileMd') CallViewChildSelectFileMd: AdminSelectfiletemplateComponent;
@ViewChildren('inputRequired') inputRequired;
public CustomerMdData = {
ID: null,
Name: "No Customer Added",
MobileNumber : null,
IdentityIDNumber : null
}
public AssigneeTeamData = [{
ID : "",
Name : "Retrieving.."
}]
public AssigneeTeamAgentData = [{
ID : "",
Name : "Retrieving.."
}]
public TopicData = [{
ID : "",
Name : "Retrieving.."
}]
public SubTopicData = [{
ID : "",
Name : "Retrieving.."
}]
public CategoryData = [{
ID : "",
Name : "Retrieving.."
}]
public ComplaintmentData = [{
ID : "",
Name : "Retrieving.."
}
]
//Model
public Subject : string = ""
public Description : string = ""
public CSCabang : string = ""
public SupervisorBOH : string = ""
public AssigneeTeam_ID : string = ""
public AssigneeTeamAgent_ID : string = ""
public AssigneeTeamAgent_Name: string = ""
public Topic_ID : string = ""
public SubTopic_ID : string = ""
public SubTopic_Name : string = ""
public Category_ID : string = ""
public Category_Name : string = ""
public Complaintment_ID : string = ""
public idAgent: string = "";
public extAgent: string = "";
public channel: string = "";
listAgent: any[] = [];
private create_date;
search = {
isAgent: false,
isSubTopic: false,
isCategory: false
}
constructor(injector: Injector,
private router: Router,
private FormBuilder : FormBuilder,
private _TicketService : TicketService,
public _SP : ServiceProxyWeb,
private API: MicroService,
private notification: NzNotificationService,
private modalService: NzModalService,
private activatedRoute: ActivatedRoute) {
this.activatedRoute.queryParams.subscribe(params => {
let PhoneNumber = params['phonenumber'];
//console.log("Phone URL : ",PhoneNumber);
if(PhoneNumber != undefined && PhoneNumber != "")
{
let ConvertNumber = Number(PhoneNumber);
if(!isNaN(ConvertNumber)){
if(ConvertNumber.toString()[0] + ConvertNumber.toString()[1] == "62"){
PhoneNumber = ConvertNumber.toString()
let length = PhoneNumber.length
let trimed = PhoneNumber.substring(2, length);
trimed = "0" + trimed
PhoneNumber = trimed
}
//
let that = this
AratakaConfig.LoadingPage.showLoading('Calling Customer Form..')
setTimeout(() => {
this.UrlPhoneNumberParam.value = PhoneNumber
this.UrlPhoneNumberParam.type = "PhoneNumber"
this.CallViewChildCustomerMd.ngOnInitAfter(this.CustomerMdData,this.UrlPhoneNumberParam);
AratakaConfig.BootstrapModal({ ID: '#SelectCustomer-MD', Open: true, Static: true });
AratakaConfig.LoadingPage.hideLoading()
}, 1500);
}else{
this.router.navigate(['admin/ticket/create']);
}
}
});
}
ngOnInit() {
if(this.RoleID != this._SP.PARAM_AGENT){
this.router.navigate(['admin']);
}
var NowDate = new Date();
AratakaConfig.BootstrapDateCustomPicker({
ID : '#DateTransaction',
DateValue : NowDate,
Format : 'DD MMMM YYYY',
isGet : false
})
AratakaConfig.BootstrapDateCustomPicker({
ID : '#DateTimeCall',
DateValue : NowDate,
Format : 'DD MMMM YYYY HH:mm:ss',
isGet : false
})
this.GettingTeamsListAPI()
this.GettingTopicListAPI()
this.GettingComplaintmentListAPI()
// this.requestAgent();
}
private tempAgent = [];
onSeacrhSelectAgent(evt: any) {
const searchTerm = evt.srcElement.value.toLowerCase();
if (searchTerm == "") {
this.AssigneeTeamAgentData = this.tempAgent;
} else {
const cloneObj = this.tempAgent;
this.AssigneeTeamAgentData = cloneObj.filter((item) => {
return item['Name'].toLowerCase().includes(searchTerm);
})
}
}
private tempSubTopic = [];
onSeacrhSelectSubTopic(evt: any) {
const searchTerm = evt.srcElement.value.toLowerCase();
if (searchTerm == "") {
this.SubTopicData = this.tempSubTopic;
} else {
const cloneObj = this.tempSubTopic;
this.SubTopicData = cloneObj.filter((item) => {
return item['Name'].toLowerCase().includes(searchTerm);
})
}
}
private tempCategory = [];
onSeacrhSelectCategory(evt: any) {
const searchTerm = evt.srcElement.value.toLowerCase();
if (searchTerm == "") {
this.CategoryData = this.tempCategory;
} else {
const cloneObj = this.tempCategory;
this.CategoryData = cloneObj.filter((item) => {
return item['Name'].toLowerCase().includes(searchTerm);
})
}
}
onBlur() {
setTimeout(() => {
this.search.isAgent = false;
this.search.isSubTopic = false;
this.search.isCategory = false;
}, 200);
}
//Take By User ------------------------------------------------------------------------
replaceAtPosition(number,index,replacement){
number += '';//to string
number = number.substring(0,index) + replacement + number.substring(index+1);
return +number; // to int
}
AssigneeTeamChange(){
if(this.AssigneeTeam_ID != "" && this.AssigneeTeam_ID){
this.GettingTeamAgentListAPI({ID : parseInt(this.AssigneeTeam_ID)})
}else{
this.AssigneeTeamAgentData = [{
ID: "",
Name: "No Select"
}]
this.AssigneeTeamAgent_ID = ""
}
}
TopicChange(){
if(this.Topic_ID != ""){
this.GettingSubTopicListAPI({ID : parseInt(this.Topic_ID)})
}else{
this.SubTopicData = [{
ID: "",
Name: "No Select"
}]
this.SubTopic_ID = ""
this.CategoryData = [{
ID: "",
Name: "No Select"
}]
this.Category_ID = ""
}
}
SubTopicChange(){
if(this.SubTopic_ID != "" && this.SubTopic_ID){
this.GettingCategoryListAPI({ID : parseInt(this.SubTopic_ID)})
}else{
this.CategoryData = [{
ID: "",
Name: "No Select"
}]
this.Category_ID = ""
}
}
onChangeCallTImeAgent() {
if (AratakaConfig.GetDateBDTP({ ID: '#DateTimeCall', isGet: true, isGetFormat: 'YYYYMMDD' }) != moment(new Date()).format('YYYYMMDD')) {
AratakaConfig.Alert.showAlert('Please Select Date Now','alert-danger',2000)
AratakaConfig.BootstrapDateCustomPicker({
ID : '#DateTimeCall',
DateValue : new Date(),
Format : 'DD MMMM YYYY HH:mm:ss',
isGet : false
})
return false;
}
}
SelectCustomerMDClick(_Data) {
this.CallViewChildCustomerMd.ngOnInitAfter(this.CustomerMdData,this.UrlPhoneNumberParam);
AratakaConfig.BootstrapModal({ ID: '#SelectCustomer-MD', Open: true, Static: true });
}
FromChildCustomerMD(_data) {
this.CustomerMdData = _data;
AratakaConfig.BootstrapModal({ ID: '#SelectCustomer-MD', Open: false, Static: null });
}
SelectAndUploadFile(){
this.CallViewChildSelectFileMd.ngOnInitAfter([]);
AratakaConfig.BootstrapModal({ ID: '#SelectFile-MD', Open: true, Static: true });
}
RemoveLastDirectoryPartOf(the_url)
{
var the_arr = the_url.split('/');
the_arr.pop();
return( the_arr.join('/') );
}
FromSelectAndUploadFileMD(_data) {
if(_data.length != 0){
var fineUrl = this.RemoveLastDirectoryPartOf(this._SP.APIURL)
for(var i = 0; i < _data.length; i++){
this.Description = this.Description + "<a href='"+fineUrl+_data[i].Address+"' target='_blank'>"+ _data[i].FileName +"</a>&nbsp;";
}
}
AratakaConfig.BootstrapModal({ ID: '#SelectFile-MD', Open: false, Static: null });
}
SubmitClick(){
var valid = true;
this.inputRequired.forEach(element => {
//console.log(element.nativeElement.value)
if(element.nativeElement.value == "" || this.SubTopic_ID == '' || this.Category_ID == '' || !this.Category_ID){
valid = false;
return false;
}
});
var Request = {
caller_id : this.CustomerMdData.ID,
service_id : this.SubTopic_ID == '' ? '' : Number(this.SubTopic_ID),
servicesubcategory_id : this.Category_ID == '' ? '' : Number(this.Category_ID),
title : this.Subject,
description : this.Description,
cscabang : this.CSCabang,
supervisor : this.SupervisorBOH,
impact : 1,
urgency : 1,
org_id : this._SP.getUserInformation.values.org_id,
createdby : this._SP.getUserInformation.values.user_id,
origin : 'portal',
tanggal_transaksi :(this.isDateTransaction)? AratakaConfig.GetDateBDTP({ ID: '#DateTransaction', isGet: true, isGetFormat: 'YYYY-MM-DD' }) : null,
penyebab_pengaduan_id : (this.Complaintment_ID != "")? this.Complaintment_ID : null,
contacts : [{
id : this._SP.getUserInformation.values.user_id,
name : this._SP.getUserInformation.values.contact_name,
org_id : this._SP.getUserInformation.values.org_id
}]
}
if(valid == true){
if(this.CustomerMdData.ID != null){
if(this.Description != ""){
this.InsertNewTicketAPI(Request)
}else{
AratakaConfig.Alert.showAlert('Please fill Description Body!','alert-danger',2000)
}
}else{
AratakaConfig.Alert.showAlert('Please select Customer!','alert-danger',2000)
}
}else{
AratakaConfig.Alert.showAlert('Please fill empty field!','alert-danger',2000)
}
}
//API Function -------------------------------------------------------------------------
GettingTeamsListAPI(){
this.AssigneeTeamData = [{
ID : "",
Name : "Retrieving.."
}]
this.AssigneeTeam_ID = ""
var AllowedTeam = [];
if(this.RoleID == this._SP.PARAM_AGENT){
if(this.TeamID == this.Env.Team.CsCabangBranchAgent){
AllowedTeam = [
this.Env.Team.ServiceDesk,
Number(this.Env.category.servicesubcategory_id) == Number(this.Category_ID) ? this.Env.Team.EChanelSupportCardOpr : ''
]
}else{
AllowedTeam = [
this.Env.Team.ServiceDesk,
this.TeamID,
Number(this.Env.category.servicesubcategory_id) == Number(this.Category_ID) ? this.Env.Team.EChanelSupportCardOpr : ''
]
}
}
if(this.RoleID == this._SP.PARAM_SERVICEDESK){
AllowedTeam = [
this.Env.Team.EChanelSupportCardOpr,
this.Env.Team.AtmPaymentSettlement,
this.Env.Team.DigitalBussinessSupport,
this.Env.Team.ITOprPolicyAndQA,
this.Env.Team.ConsumerLoan,
this.Env.Team.SBAndFinancialPlanning,
this.Env.Team.CsCabangBranchAgent,
this.Env.Team.AgentCallCenter,
this.Env.Team.ITSolution,
this.Env.Team.ProductInovationAndBusinessSupport,
this.Env.Team.MerchantProcessing,
this.Env.Team.ProductAndProcessConsumer,
this.Env.Team.SociomileStaff,
this.Env.Team.ITRM,
this.Env.Team.BarcodeQRIS,
this.Env.Team.MerchantBusiness,
this.Env.Team.DigitalLoan,
this.Env.Team.TransferTradeOperation,
this.Env.Team.WealthManagement,
this.Env.Team.DigitalBankingBusiness,
this.Env.Team.MerchantService,
this.Env.Team.TransferTradeOperation,
this.Env.Team.ITB2BApplicationSupport
]
}
if(this.RoleID == this._SP.PARAM_SUPPORT){
AllowedTeam = [
this.Env.Team.ServiceDesk
]
}
this._TicketService.GetTeams()
.subscribe((result: any) => {
if(result != null){
this.AssigneeTeamData = []
//console.log(JSON.stringify(result))
if(result.values != null){
this.AssigneeTeamData.push({
ID: "",
Name: "No Select"
})
this.AssigneeTeam_ID = ""
this.AssigneeTeamAgentData = [{
ID: "",
Name: "No Select"
}]
this.AssigneeTeamAgent_ID = ""
for(var i=0; i < result.values.length; i++){
var isThere = AllowedTeam.includes(result.values[i].id)
if(isThere){
this.AssigneeTeamData.push({
ID: result.values[i].id.toString(),
Name: result.values[i].name
})
}
}
// this.AssigneeTeam_ID = this.AssigneeTeamData[0].ID
// this.GettingTeamAgentListAPI({ID : this.AssigneeTeamData[0].ID})
}else{
this.AssigneeTeamData.push({
ID: "",
Name: "Data is empty!"
})
}
}else{
AratakaConfig.Alert.showAlert('Internal Server Error!','alert-danger',2000)
}
},
(err: HttpErrorResponse) => {
console.log(JSON.stringify(err.error));
AratakaConfig.Alert.showAlert(err.error.detail,'alert-danger',2000)
this.AssigneeTeamData.push({
ID: "",
Name: "Error!"
})
});
}
GettingTeamAgentListAPI(_Request){
console.log(JSON.stringify(_Request))
this.AssigneeTeamAgentData = [{
ID : "",
Name : "Retrieving.."
}]
this.AssigneeTeamAgent_ID = ""
var AllowedAgent = [];
//If Selected Team is Service Desk
if(this.Env.Team.ServiceDesk == _Request.ID){
if(this.RoleID == this._SP.PARAM_AGENT){
if(this.TeamID == this.Env.Team.CsCabangBranchAgent){
AllowedAgent = [
this.Env.Agent.ServiceDesk
]
}
else if(this.TeamID == this.Env.Team.SociomileStaff){
AllowedAgent = [
this.Env.Agent.ServiceDesk
]
}else{
AllowedAgent = [
this.Env.Agent.ServiceDesk,
this.Env.Agent.NobuCall
]
}
}
}
this._TicketService.GetTeamAgent(_Request)
.subscribe((result: any) => {
if(result != null){
this.AssigneeTeamAgentData = []
if(result.values != null){
// this.AssigneeTeamAgentData.push({
// ID: "",
// Name: "No Select"
// })
this.AssigneeTeamAgent_ID = ""
for(var i=0; i < result.values.length; i++){
var isThere = (this.Env.Team.ServiceDesk == _Request.ID)? AllowedAgent.includes(result.values[i].id) : true;
if(isThere){
this.AssigneeTeamAgentData.push({
ID: result.values[i].id.toString(),
Name: result.values[i].name
})
}
}
this.AssigneeTeamAgentData.sort((a: any, b: any) => a.Name.localeCompare(b.Name))
this.AssigneeTeamAgentData.unshift({ID: '', Name: "No Select"})
this.tempAgent = this.AssigneeTeamAgentData;
//this.AssigneeTeamAgent_ID = this.AssigneeTeamAgentData[0].ID
}else{
this.AssigneeTeamAgentData.push({
ID: "",
Name: "Data is empty!"
})
}
}else{
AratakaConfig.Alert.showAlert('Internal Server Error!','alert-danger',2000)
}
},
(err: HttpErrorResponse) => {
console.log(JSON.stringify(err.error));
AratakaConfig.Alert.showAlert(err.error.detail,'alert-danger',2000)
this.AssigneeTeamAgentData.push({
ID: "",
Name: "Error!"
})
});
}
GettingTopicListAPI(){
this.TopicData = [{
ID : "",
Name : "Retrieving.."
}]
this.Topic_ID = ""
var AllowedTopic = [];
if(this.TeamID == this.Env.Team.CsCabangBranchAgent){
AllowedTopic = [
this.Env.Topic.Keluhan,
this.Env.Topic.PermintaanKeServiceDesk,
];
}
else if(this.TeamID == this.Env.Team.SociomileStaff){ //Nobu WA Bussiness
AllowedTopic = [
this.Env.Topic.Keluhan,
this.Env.Topic.PermintaanKeServiceDesk,
this.Env.Topic.Informasi,
this.Env.Topic.TelponTerputus
];
}
else{
AllowedTopic = [
this.Env.Topic.Keluhan,
this.Env.Topic.PermintaanKeServiceDesk,
this.Env.Topic.PermintaanKeNobuCall,
this.Env.Topic.Informasi,
this.Env.Topic.TelponTerputus
];
}
this._TicketService.GetTopic()
.subscribe((result: any) => {
if(result != null){
this.TopicData = []
//console.log("TOPIC", JSON.stringify(result))
if(result.values != null){
this.TopicData.push({
ID: "",
Name: "No Select"
})
this.Topic_ID = ""
this.SubTopicData = [{
ID: "",
Name: "No Select"
}]
this.SubTopic_ID = ""
this.CategoryData = [{
ID: "",
Name: "No Select"
}]
this.Category_ID = ""
for(var i=0; i < result.values.length; i++){
var isThere = AllowedTopic.includes(result.values[i].id)
if(isThere){
this.TopicData.push({
ID: result.values[i].id.toString(),
Name: result.values[i].name
})
}
}
// this.Topic_ID = this.TopicData[0].ID
// this.GettingSubTopicListAPI({ID : this.TopicData[0].ID})
}else{
this.TopicData.push({
ID: "",
Name: "Data is empty!"
})
}
}else{
AratakaConfig.Alert.showAlert('Internal Server Error!','alert-danger',2000)
}
},
(err: HttpErrorResponse) => {
console.log(JSON.stringify(err.error));
AratakaConfig.Alert.showAlert(err.error.detail,'alert-danger',2000)
this.TopicData.push({
ID: "",
Name: "Error!"
})
});
}
GettingSubTopicListAPI(_Request){
// this.SubTopicData = [{
// ID : "",
// Name : "Retrieving.."
// }]
this.SubTopic_ID = ""
this._TicketService.GetSubTopic(_Request)
.subscribe((result: any) => {
if(result != null){
this.SubTopicData = [];
this.tempSubTopic = [];
//console.log(JSON.stringify(result))
if(result.values != null){
// this.SubTopicData.push({
// ID: "",
// Name: "No Select"
// })
// this.SubTopic_ID = ""
// this.CategoryData = [{
// ID: "",
// Name: "No Select"
// }]
// this.Category_ID = ""
for(var i=0; i < result.values.length; i++){
this.SubTopicData.push({
ID: result.values[i].id.toString(),
Name: result.values[i].name
})
}
this.SubTopicData.sort((a: any, b: any) => a.Name.localeCompare(b.Name))
this.SubTopicData.unshift({ID: '', Name: "No Select"})
this.tempSubTopic = this.SubTopicData
// this.SubTopic_ID = this.SubTopicData[0].ID
// this.GettingCategoryListAPI({ID : this.SubTopicData[0].ID})
}else{
this.SubTopicData.push({
ID: "",
Name: "Data is empty!"
})
}
}else{
AratakaConfig.Alert.showAlert('Internal Server Error!','alert-danger',2000)
}
},
(err: HttpErrorResponse) => {
console.log(JSON.stringify(err.error));
AratakaConfig.Alert.showAlert(err.error.detail,'alert-danger',2000)
this.SubTopicData.push({
ID: "",
Name: "Error!"
})
});
}
GettingCategoryListAPI(_Request){
this.CategoryData = [{
ID : "",
Name : "Retrieving.."
}]
this.Category_ID = ""
this._TicketService.GetCategory(_Request)
.subscribe((result: any) => {
if(result != null){
this.CategoryData = [];
this.tempCategory = [];
//console.log(JSON.stringify(result))
if(result.values != null){
// this.CategoryData.push({
// ID: "",
// Name: "No Select"
// })
this.Category_ID = ""
for(var i=0; i < result.values.length; i++){
this.CategoryData.push({
ID: result.values[i].id.toString(),
Name: result.values[i].name
})
}
this.CategoryData.sort((a: any, b: any) => a.Name.localeCompare(b.Name))
this.CategoryData.unshift({ID: '', Name: "No Select"})
this.tempCategory = this.CategoryData;
// this.Category_ID = this.CategoryData[0].ID
}else{
this.CategoryData.push({
ID: "",
Name: "Data is empty!"
})
}
}else{
AratakaConfig.Alert.showAlert('Internal Server Error!','alert-danger',2000)
}
},
(err: HttpErrorResponse) => {
console.log(JSON.stringify(err.error));
AratakaConfig.Alert.showAlert(err.error.detail,'alert-danger',2000)
this.CategoryData.push({
ID: "",
Name: "Error!"
})
});
}
GettingComplaintmentListAPI(){
this.ComplaintmentData = [{
ID : "",
Name : "Retrieving.."
}]
this.Complaintment_ID = ""
this._TicketService.GetComplaintment()
.subscribe((result: any) => {
if(result != null){
this.ComplaintmentData = []
console.log(JSON.stringify(result))
if(result.values != null){
this.ComplaintmentData.push({
ID: "",
Name: "No Select"
})
this.Complaintment_ID = ""
for(var i=0; i < result.values.length; i++){
this.ComplaintmentData.push({
ID: result.values[i].id.toString(),
Name: result.values[i].name
})
}
// this.Complaintment_ID = this.CategoryData[0].ID
}else{
this.ComplaintmentData.push({
ID: "",
Name: "Data is empty!"
})
}
}else{
AratakaConfig.Alert.showAlert('Internal Server Error!','alert-danger',2000)
}
},
(err: HttpErrorResponse) => {
console.log(JSON.stringify(err.error));
AratakaConfig.Alert.showAlert(err.error.detail,'alert-danger',2000)
this.ComplaintmentData.push({
ID: "",
Name: "Error!"
})
});
}
private json_log_response_query
InsertNewTicketAPI(_Request){
//console.log("Request Create",JSON.stringify(_Request))
// this.create_date = moment()
AratakaConfig.LoadingPage.showLoading('Creating Ticket')
this._TicketService.CreateTicketWithContact(_Request)
.subscribe((result: any) => {
if(result != null){
if(result.values.data.code == 0){
// AratakaConfig.LoadingPage.hideLoading()
this.json_log_response_query = result.values.log_query;
var ObjKey = Object.keys(result.values.data.objects)
var created = result.values.data.objects[ObjKey[0]]
const params = {
"agent_custom": this.extAgent,
"agent_extension_id": Number(this.idAgent),
"call_time": AratakaConfig.GetDateBDTP({ ID: '#DateTimeCall', isGet: true, isGetFormat: 'YYYY-MM-DD HH:mm:ss' }),
"channel": this.channel,
"ticket_id": Number(created.key),
"ticket_type": created.class
}
this.InsertNewTicketAssignAPI({
ticket_assign : created.key,
ticket_class : created.class,
team_id : Number(this.AssigneeTeam_ID),
agent_id : Number(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,
// ticket_class : created.class,
// contacts : {
// id : this._SP.getUserInformation.values.user_id,
// name : this._SP.getUserInformation.values.contact_name,
// org_id : this._SP.getUserInformation.values.org_id
// }
// })
// this.InsertNewTicketDispatchAPI({
// ticket_assign : created.key,
// ticket_class : created.class,
// team_id : this.AssigneeTeam_ID
// })
}else{
AratakaConfig.Alert.showAlert('Failed to Create Ticket','alert-danger',2000)
AratakaConfig.LoadingPage.hideLoading()
}
}else{
AratakaConfig.Alert.showAlert('Internal Server Error!','alert-danger',2000)
AratakaConfig.LoadingPage.hideLoading()
}
},
(err: HttpErrorResponse) => {
console.log(JSON.stringify(err.error));
//AratakaConfig.Alert.showAlert(err.error.detail,'alert-danger',2000)
AratakaConfig.LoadingPage.hideLoading()
});
}
InsertNewTicketContactAPI(_Request){
//console.log(JSON.stringify(_Request))
AratakaConfig.LoadingPage.showLoading('Create Ticket Contact.., Please wait..')
this._TicketService.CreateTicketContact(_Request)
.subscribe((result: any) => {
if(result != null){
if(result.values != undefined){
console.log("Contect Created")
this.InsertNewTicketAssignAPI({
ticket_assign : _Request.ticket_id,
ticket_class : _Request.ticket_class,
team_id : this.AssigneeTeam_ID,
agent_id : this.AssigneeTeamAgent_ID
})
}else{
AratakaConfig.Alert.showAlert('Failed to Create Ticket Contact','alert-danger',2000)
}
}else{
AratakaConfig.Alert.showAlert('Internal Server Error!','alert-danger',2000)
}
AratakaConfig.LoadingPage.hideLoading()
},
(err: HttpErrorResponse) => {
AratakaConfig.LoadingPage.hideLoading()
AratakaConfig.Alert.showAlert('Internal Server Error!','alert-danger',2000)
});
}
InsertNewTicketAssignAPI(_Request){
AratakaConfig.LoadingPage.showLoading('Ticket Assigning.., Please wait..')
this._TicketService.CreateTicketAssign(_Request)
.subscribe((result: any) => {
if(result != null){
if(result.values != undefined){
AratakaConfig.LoadingPage.hideLoading()
this.modalService.create({
nzTitle: 'Log Query',
nzClosable: false,
nzContent: `<b>Log Response Query Create Ticket</b>
<p></p>
<p></p>
<p></p>
<p>create person: <b>${this.json_log_response_query.message_create_person}</b></p>
<p>get person: <b>${this.json_log_response_query.message_get_person}</b></p>
<p>get Contact List: <b>${this.json_log_response_query.message_get_contact_list}</b></p>
<p>request Type: <b>${this.json_log_response_query.message_request_type}</b></p>
<p>create Ticket: <b>${this.json_log_response_query.message_create_ticket}</b></p>
<p>get Ticket: <b>${this.json_log_response_query.message_get_ticket}</b></p>
<p></p>
<p></p>
<p></p>
<b>Log Response Query Assigned Ticket</b>
<p>get Ticket: <b>${result.values.log_query.ticket}</b></p>
<p>Query lnkcontacttoticket: <b>${result.values.log_query.lnkcontacttoticket}</b></p>
<p>Assigned Ticket: <b>${result.values.log_query.assigned_ticket}</b></p>`,
nzFooter: null
});
setTimeout(() => {
this.modalService.closeAll()
this.router.navigate(['admin/ticket/detail/' + _Request.ticket_assign]);
}, 2500);
}else{
AratakaConfig.Alert.showAlert('Failed to Create Ticket Assign','alert-danger',2000)
AratakaConfig.LoadingPage.hideLoading()
}
}else{
AratakaConfig.Alert.showAlert('Internal Server Error!','alert-danger',2000)
AratakaConfig.LoadingPage.hideLoading()
}
},
(err: HttpErrorResponse) => {
AratakaConfig.Alert.showAlert(err.error.message,'alert-danger',3000)
AratakaConfig.LoadingPage.hideLoading()
});
}
InsertNewTicketDispatchAPI(_Request){
this._TicketService.CreateTicketDispatch(_Request)
.subscribe((result: any) => {
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)
}
}else{
AratakaConfig.Alert.showAlert('Internal Server Error!','alert-danger',2000)
}
},
(err: HttpErrorResponse) => {
console.log(JSON.stringify(err.error));
});
}
requestAgent() {
this.listAgent = [{
id: "",
code: "Retrieving",
name: "..."
}]
const params = {
"filter_limit": null,
"filter_page": null,
"order_field": "id|desc",
}
this.API.post('agent_extension/list', params)
.subscribe((response: any) => {
console.log(response)
if (response.items) {
this.listAgent = response.items;
this.idAgent = this.listAgent[0].id;
} else {
this.listAgent = [];
}
}, (err: HttpErrorResponse) => {
this.listAgent = [{
id: "",
code: "Error",
name: "API!"
}]
})
}
}
...@@ -40,6 +40,7 @@ import { PipeDencryptoJs } from '../pipe/pipe-global.pipe'; ...@@ -40,6 +40,7 @@ import { PipeDencryptoJs } from '../pipe/pipe-global.pipe';
import { NzSelectModule } from 'ng-zorro-antd'; import { NzSelectModule } from 'ng-zorro-antd';
import { NgZorroAntdModule, NzPopoverModule, NzToolTipModule, NzNotificationModule, NzModalModule } from 'ng-zorro-antd'; import { NgZorroAntdModule, NzPopoverModule, NzToolTipModule, NzNotificationModule, NzModalModule } from 'ng-zorro-antd';
import { AdminTestPingComponent } from './admin-test-ping/admin-test-ping.component'; import { AdminTestPingComponent } from './admin-test-ping/admin-test-ping.component';
import { CreateTicketTestComponent } from './admin-ticket/create-ticket-test/create-ticket-test.component';
@NgModule({ @NgModule({
declarations: [ declarations: [
/*PipeSha256, /*PipeSha256,
...@@ -72,6 +73,7 @@ import { AdminTestPingComponent } from './admin-test-ping/admin-test-ping.compon ...@@ -72,6 +73,7 @@ import { AdminTestPingComponent } from './admin-test-ping/admin-test-ping.compon
LogbookComponent, LogbookComponent,
TabsLogbookComponent, TabsLogbookComponent,
AdminTestPingComponent, AdminTestPingComponent,
CreateTicketTestComponent,
], ],
imports: [ imports: [
PipeglobalModule, PipeglobalModule,
......
...@@ -4,8 +4,9 @@ ...@@ -4,8 +4,9 @@
export const environment = { export const environment = {
production: false, production: false,
"APIBASEURL" : "http://crm.nobubank.com/nobucall-api-v2/", "APIBASEURL" : "http://innodev.vnetcloud.com/nobucall-api-v2/",
"MICROSERVICEURL" : "http://crm.nobubank.com/nobucall-api-log/api/v1/", "APIBASEURLREPORT" : "http://innodev.vnetcloud.com/nobucall-api-report/",
"MICROSERVICEURL" : "http://innodev.vnetcloud.com/nobucall-api-log/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",
"COMPANY_NAME" : "PT. Visionet Data Internasional", "COMPANY_NAME" : "PT. Visionet Data Internasional",
......
...@@ -11,6 +11,7 @@ import { environment } from '../../environments/environment'; ...@@ -11,6 +11,7 @@ import { environment } from '../../environments/environment';
//const API_URL = environment.apiUrl; //const API_URL = environment.apiUrl;
var API_URL = environment.APIBASEURL; var API_URL = environment.APIBASEURL;
var API_REPORT_URL = environment.APIBASEURLREPORT;
var API_MICROSERVICE = environment.MICROSERVICEURL; var API_MICROSERVICE = environment.MICROSERVICEURL;
var ckConfig = environment.ckeConfig; var ckConfig = environment.ckeConfig;
var SITE_NAME = environment.SITE_NAME; var SITE_NAME = environment.SITE_NAME;
...@@ -274,33 +275,33 @@ export class TicketService { ...@@ -274,33 +275,33 @@ export class TicketService {
if(data.search != ""){ if(data.search != ""){
searchQ = '?search=' + 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_REPORT_URL +'v3/tickets/bycontact/' + service.getUserInformation.values.user_id + '/'+ data.TeamID + '/'+data.FilterTicket+'/'+data.Page+'/'+data.PerPage+''+searchQ, options);
}else if(data.FilterByContact == 'team'){ }else if(data.FilterByContact == 'team'){
var searchQ = "" var searchQ = ""
if(data.search != ""){ if(data.search != ""){
searchQ = '?search=' + 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_REPORT_URL +'v3/tickets/bycontactteam/' + Team + '/'+data.FilterTicket+'/'+data.Page+'/'+data.PerPage+''+searchQ, options);
}else{ }else{
if(data.Search != ""){ 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); //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){ 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_REPORT_URL +'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){ }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_REPORT_URL +'v3/nobutickets/0/'+data.FilterTicket+'/0/0/0/'+data.Page+'/'+data.PerPage+'?search=' + data.Search, options);
} }
else{ 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_REPORT_URL +'v3/nobutickets/0/'+data.FilterTicket+'/0/0/' + Team + '/'+data.Page+'/'+data.PerPage+'?search=' + data.Search, options);
} }
}else{ }else{
if(service.getUserInformation.values.team_id == environment.Team.CsCabangBranchAgent){ 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_REPORT_URL +'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){ }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_REPORT_URL +'v3/nobutickets/0/'+data.FilterTicket+'/0/0/0/'+data.Page+'/'+data.PerPage+'', options);
} }
else{ 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_REPORT_URL +'v3/nobutickets/0/'+data.FilterTicket+'/0/0/' + Team+ '/'+data.Page+'/'+data.PerPage+'', options);
} }
} }
...@@ -436,6 +437,19 @@ export class TicketService { ...@@ -436,6 +437,19 @@ export class TicketService {
return this.http.post(API_URL +'v3/ticket/withcontact', data, options); return this.http.post(API_URL +'v3/ticket/withcontact', data, options);
} }
CreateTicketWithContactTest(_data) {
var data = _data
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.post(API_URL +'v3/ticket/withcontact-test', data, options);
}
AutoResolveTicket(_data) { AutoResolveTicket(_data) {
...@@ -477,6 +491,19 @@ export class TicketService { ...@@ -477,6 +491,19 @@ export class TicketService {
return this.http.post(API_URL +'v3/ticket/assign/'+ _data.ticket_assign, data, options); return this.http.post(API_URL +'v3/ticket/assign/'+ _data.ticket_assign, data, options);
} }
CreateTicketAssignTest(_data) {
var data = _data
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.post(API_URL +'v3/ticket/assign-test/'+ _data.ticket_assign, data, options);
}
CreateTicketDispatch(_data) { CreateTicketDispatch(_data) {
var data = _data var data = _data
...@@ -996,7 +1023,7 @@ export class DashboardService { ...@@ -996,7 +1023,7 @@ export class DashboardService {
'Authorization' : 'Bearer '+ service.getUserInformation.values.access_token 'Authorization' : 'Bearer '+ service.getUserInformation.values.access_token
}); });
let options = { headers: headers }; let options = { headers: headers };
return this.http.post(API_URL +'v3/dashboard', _data, options); return this.http.post(API_REPORT_URL +'v3/dashboard', _data, options);
} }
...@@ -1033,7 +1060,7 @@ export class DashboardService { ...@@ -1033,7 +1060,7 @@ export class DashboardService {
'Authorization' : 'Bearer '+ service.getUserInformation.values.access_token 'Authorization' : 'Bearer '+ service.getUserInformation.values.access_token
}); });
let options = { headers: headers }; let options = { headers: headers };
return this.http.post(API_URL +'v3/report/logbook', _data, options); return this.http.post(API_REPORT_URL +'v3/report/logbook', _data, options);
} }
...@@ -1048,7 +1075,7 @@ export class DashboardService { ...@@ -1048,7 +1075,7 @@ export class DashboardService {
'Authorization' : 'Bearer '+ service.getUserInformation.values.access_token 'Authorization' : 'Bearer '+ service.getUserInformation.values.access_token
}); });
let options = { headers: headers }; let options = { headers: headers };
return this.http.get(API_URL +'v3/report/logbook/category/'+_TeamID, options); return this.http.get(API_REPORT_URL +'v3/report/logbook/category/'+_TeamID, options);
} }
...@@ -1061,7 +1088,7 @@ export class DashboardService { ...@@ -1061,7 +1088,7 @@ export class DashboardService {
'Authorization' : 'Bearer '+ service.getUserInformation.values.access_token 'Authorization' : 'Bearer '+ service.getUserInformation.values.access_token
}); });
let options = { headers: headers }; let options = { headers: headers };
return this.http.post(API_URL +'v3/report/ticketcount', _data, options); return this.http.post(API_REPORT_URL +'v3/report/ticketcount', _data, options);
} }
...@@ -1091,7 +1118,7 @@ export class DashboardService { ...@@ -1091,7 +1118,7 @@ export class DashboardService {
responseType: 'arraybuffer' responseType: 'arraybuffer'
} }
return this.http.post<any>(API_URL +'v3/dashboard/export',_data, requestOptions); return this.http.post<any>(API_REPORT_URL +'v3/dashboard/export',_data, requestOptions);
} }
downloadFileExcelReport(_data: any) :Observable<any> { downloadFileExcelReport(_data: any) :Observable<any> {
...@@ -1123,7 +1150,7 @@ export class DashboardService { ...@@ -1123,7 +1150,7 @@ export class DashboardService {
responseType: 'arraybuffer' responseType: 'arraybuffer'
} }
return this.http.post<any>(API_URL +'v3/report/logbook',_data, requestOptions); return this.http.post<any>(API_REPORT_URL +'v3/report/logbook',_data, requestOptions);
} }
......
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