Commit 5d3e7748 authored by ari_darmawan's avatar ari_darmawan

save local after creat ticket

parent 8469350f
......@@ -68,7 +68,7 @@
nzPlaceHolder="Select Team"
nzAllowClear
nzShowSearch
(ngModelChange)="AssigneeTeamChange()"
(ngModelChange)="AssigneeTeamChange(); AssigneeTeamAgent_ID = '';"
>
<nz-option *ngFor="let o of AssigneeTeamData" [nzValue]="o.ID" [nzLabel]="o.Name" nzCustomContent>
<span nz-tooltip [nzTitle]="o.Name">{{o.Name}}</span>
......
......@@ -247,7 +247,7 @@ export class AdminTicketCreateComponent implements OnInit {
ID: "",
Name: "No Select"
}]
this.AssigneeTeamAgent_ID = ""
// this.AssigneeTeamAgent_ID = ""
}
}
......@@ -259,13 +259,13 @@ export class AdminTicketCreateComponent implements OnInit {
ID: "",
Name: "No Select"
}]
this.SubTopic_ID = ""
// this.SubTopic_ID = ""
this.CategoryData = [{
ID: "",
Name: "No Select"
}]
this.Category_ID = ""
// this.Category_ID = ""
}
}
......@@ -277,7 +277,7 @@ export class AdminTicketCreateComponent implements OnInit {
ID: "",
Name: "No Select"
}]
this.Category_ID = ""
// this.Category_ID = ""
}
}
......@@ -301,7 +301,55 @@ export class AdminTicketCreateComponent implements OnInit {
}
FromChildCustomerMD(_data) {
const getItemLocal = localStorage.getItem('create-ticket');
console.log(getItemLocal)
console.log(_data)
if (getItemLocal) {
const ItemParse = JSON.parse(getItemLocal);
if (_data.ID) {
if (ItemParse.caller_id === _data.ID) {
this.AssigneeTeam_ID = ItemParse.team_id;
this.AssigneeTeamAgent_ID = ItemParse.agent_id;
this.Topic_ID = ItemParse.topic_id;
this.SubTopic_ID = ItemParse.service_id.toString();
this.Category_ID = ItemParse.servicesubcategory_id.toString();
this.AssigneeTeam_ID = ItemParse.team_id;
this.Complaintment_ID = ItemParse.penyebab_pengaduan_id;
this.CSCabang = ItemParse.cscabang;
this.SupervisorBOH = ItemParse.supervisor;
setTimeout(() => {
this.AssigneeTeamChange();
this.TopicChange();
this.SubTopicChange();
if (ItemParse.tanggal_transaksi) {
AratakaConfig.BootstrapDateCustomPicker({
ID : '#DateTransaction',
DateValue : ItemParse.tanggal_transaksi,
Format : 'DD MMMM YYYY',
isGet : false
})
this.isDateTransaction = true;
}
}, 500);
} else {
this.AssigneeTeamAgent_ID = "";
this.Topic_ID = "";
this.SubTopic_ID = "";
this.Category_ID = "";
this.AssigneeTeam_ID = "";
this.Complaintment_ID = "";
this.CSCabang = "";
this.SupervisorBOH = "";
AratakaConfig.BootstrapDateCustomPicker({
ID : '#DateTransaction',
DateValue : new Date(),
Format : 'DD MMMM YYYY',
isGet : false
})
this.isDateTransaction = false;
}
}
}
this.CustomerMdData = _data;
AratakaConfig.BootstrapModal({ ID: '#SelectCustomer-MD', Open: false, Static: null });
......@@ -344,6 +392,7 @@ export class AdminTicketCreateComponent implements OnInit {
var Request = {
caller_id : this.CustomerMdData.ID,
topic_id: this.Topic_ID,
service_id : Number(this.SubTopic_ID),
servicesubcategory_id : Number(this.Category_ID),
title : this.Subject,
......@@ -503,7 +552,7 @@ export class AdminTicketCreateComponent implements OnInit {
ID : "",
Name : "Retrieving.."
}]
this.AssigneeTeamAgent_ID = ""
// this.AssigneeTeamAgent_ID = ""
var AllowedAgent = [];
......@@ -542,7 +591,7 @@ export class AdminTicketCreateComponent implements OnInit {
// Name: "No Select"
// })
this.AssigneeTeamAgent_ID = ""
// this.AssigneeTeamAgent_ID = ""
for(var i=0; i < result.values.length; i++){
......@@ -635,13 +684,13 @@ export class AdminTicketCreateComponent implements OnInit {
ID: "",
Name: "No Select"
}]
this.SubTopic_ID = ""
// this.SubTopic_ID = ""
this.CategoryData = [{
ID: "",
Name: "No Select"
}]
this.Category_ID = ""
// this.Category_ID = ""
for(var i=0; i < result.values.length; i++){
......@@ -683,7 +732,7 @@ export class AdminTicketCreateComponent implements OnInit {
// ID : "",
// Name : "Retrieving.."
// }]
this.SubTopic_ID = ""
// this.SubTopic_ID = ""
this._TicketService.GetSubTopic(_Request)
.subscribe((result: any) => {
......@@ -745,7 +794,7 @@ export class AdminTicketCreateComponent implements OnInit {
ID : "",
Name : "Retrieving.."
}]
this.Category_ID = ""
// this.Category_ID = ""
this._TicketService.GetCategory(_Request)
.subscribe((result: any) => {
......@@ -760,7 +809,7 @@ export class AdminTicketCreateComponent implements OnInit {
// ID: "",
// Name: "No Select"
// })
this.Category_ID = ""
// this.Category_ID = ""
for(var i=0; i < result.values.length; i++){
this.CategoryData.push({
......@@ -867,6 +916,9 @@ export class AdminTicketCreateComponent implements OnInit {
"ticket_id": Number(created.key),
"ticket_type": created.class
}
_Request.team_id = this.AssigneeTeam_ID;
_Request.agent_id = this.AssigneeTeamAgent_ID;
localStorage.setItem('create-ticket', JSON.stringify(_Request))
this.InsertNewTicketAssignAPI({
ticket_assign : created.key,
......
......@@ -95,6 +95,7 @@
class="form-control form-control-sm"
[disabled]="IsFormDisabled"
[(ngModel)]="Email"
#inputRequired
(blur)="EmailOnBlur()"
maxlength="100">
<input
......
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