Commit 4e3e9a29 authored by ari_darmawan's avatar ari_darmawan

validasi resolve by agent

parent 808c4660
...@@ -318,12 +318,14 @@ export class AdminTicketCreateComponent implements OnInit { ...@@ -318,12 +318,14 @@ export class AdminTicketCreateComponent implements OnInit {
if(this.RoleID == this._SP.PARAM_AGENT){ if(this.RoleID == this._SP.PARAM_AGENT){
if(this.TeamID == this.Env.Team.CsCabangBranchAgent){ if(this.TeamID == this.Env.Team.CsCabangBranchAgent){
AllowedTeam = [ AllowedTeam = [
this.Env.Team.ServiceDesk this.Env.Team.ServiceDesk,
Number(this.Env.category.servicesubcategory_id) == Number(this.Category_ID) ? this.Env.Team.EChanelSupportCardOpr : ''
] ]
}else{ }else{
AllowedTeam = [ AllowedTeam = [
this.Env.Team.ServiceDesk, this.Env.Team.ServiceDesk,
this.TeamID this.TeamID,
Number(this.Env.category.servicesubcategory_id) == Number(this.Category_ID) ? this.Env.Team.EChanelSupportCardOpr : ''
] ]
} }
} }
......
...@@ -247,7 +247,6 @@ export class AdminTicketDetailComponent implements OnInit { ...@@ -247,7 +247,6 @@ export class AdminTicketDetailComponent implements OnInit {
}) })
this.ConversationViewByRole() this.ConversationViewByRole()
this.ConversationReplyNoteViewByRole()
// PublicReplySubmit // PublicReplySubmit
...@@ -260,12 +259,14 @@ export class AdminTicketDetailComponent implements OnInit { ...@@ -260,12 +259,14 @@ export class AdminTicketDetailComponent implements OnInit {
x.Hide = false x.Hide = false
}) })
if(this.RoleID == this._SP.PARAM_SERVICEDESK){ if (Number(this.itemDetailTicket.servicesubcategory_id) == Number(this.Env.category.servicesubcategory_id)) {
this.ConversationReplyNote[0].Selected = true this.ConversationReplyNote[0].Selected = true;
} this.ConversationReplyNote[0].Hide = false;
if(this.RoleID != this._SP.PARAM_SERVICEDESK){ } else if (this.RoleID == this._SP.PARAM_SERVICEDESK) {
this.ConversationReplyNote[1].Selected = true this.ConversationReplyNote[0].Selected = true;
this.ConversationReplyNote[0].Hide = true } else if (this.RoleID != this._SP.PARAM_SERVICEDESK) {
this.ConversationReplyNote[1].Selected = true;
this.ConversationReplyNote[0].Hide = true;
} }
} }
...@@ -284,70 +285,65 @@ export class AdminTicketDetailComponent implements OnInit { ...@@ -284,70 +285,65 @@ export class AdminTicketDetailComponent implements OnInit {
SubmitAsDataByRole(_data){ SubmitAsDataByRole(_data){
console.log(_data) console.log(_data)
if(_data.status == 'new' || _data.status == "escalated_tto"){ if (Number(this.itemDetailTicket.servicesubcategory_id) == Number(this.Env.category.servicesubcategory_id)) {
this.SubmitAsData = [ this.SubmitAsData = [
{
ID : "",
Name : "No Select"
},
{
ID : "resolve",
Name : "Resolved"
}]
} else {
if (_data.status == 'new' || _data.status == "escalated_tto") {
this.SubmitAsData = [
{
ID : "reject",
Name : "Reject"
}
]
} else if (_data.status == 'escalated_ttr') {
this.SubmitAsData = [
{
ID : "assign",
Name : "Assigned"
},
{
ID : "resolve",
Name : "Resolved"
}]
} else if(_data.status == 'assigned') {
this.SubmitAsData = [{
ID : "assign",
Name : "Assigned"
},
{
ID : "resolve",
Name : "Resolved"
},
{ {
ID : "reject", ID : "reject",
Name : "Reject" Name : "Reject"
} }]
] } else if(_data.status == 'resolved') {
} this.SubmitAsData = [{
else if(_data.status == 'escalated_ttr'){ ID : "",
Name : "No Select"
this.SubmitAsData = [ }]
{ } else if(_data.status == 'closed') {
ID : "assign", this.SubmitAsData = [{
Name : "Assigned" ID : "",
}, Name : "No Select"
{ }]
ID : "resolve", } else {
Name : "Resolved" this.SubmitAsData = [{
}] ID : "",
Name : "Nothing to Select"
// }else if(_data.status == 'assigned' || _data.status == 'escalated_ttr'){ }]
}else if(_data.status == 'assigned'){ }
this.SubmitAsData = [{
ID : "assign",
Name : "Assigned"
},
{
ID : "resolve",
Name : "Resolved"
},
{
ID : "reject",
Name : "Reject"
}]
}
else if(_data.status == 'resolved'){
// this.SubmitAsData = [{
// ID : "close",
// Name : "Closed"
// }]
this.SubmitAsData = [{
ID : "",
Name : "No Select"
}]
}
else if(_data.status == 'closed'){
// this.SubmitAsData = [{
// ID : "reopen",
// Name : "Re-open"
// }]
this.SubmitAsData = [{
ID : "",
Name : "No Select"
}]
}else{
this.SubmitAsData = [{
ID : "",
Name : "Nothing to Select"
}]
} }
this.SubmitAs = this.SubmitAsData[0].ID this.SubmitAs = this.SubmitAsData[0].ID
} }
AssigneeTeamChange(){ AssigneeTeamChange(){
...@@ -791,6 +787,7 @@ export class AdminTicketDetailComponent implements OnInit { ...@@ -791,6 +787,7 @@ export class AdminTicketDetailComponent implements OnInit {
} }
//API Function ------------------------------------------------------------------------- //API Function -------------------------------------------------------------------------
private itemDetailTicket: any = {};
GettingTicketDetailAPI(_Request){ GettingTicketDetailAPI(_Request){
console.log(_Request) console.log(_Request)
AratakaConfig.LoadingPage.showLoading('Retrieving data...') AratakaConfig.LoadingPage.showLoading('Retrieving data...')
...@@ -813,7 +810,7 @@ export class AdminTicketDetailComponent implements OnInit { ...@@ -813,7 +810,7 @@ export class AdminTicketDetailComponent implements OnInit {
var ObjKey = Object.keys(result.values.objects) var ObjKey = Object.keys(result.values.objects)
var data = result.values.objects[ObjKey[0]] var data = result.values.objects[ObjKey[0]]
this.itemDetailTicket = {...data.fields};
this.create_By_id = data.fields.createdby_id; this.create_By_id = data.fields.createdby_id;
this.CallerID = data.fields.caller_id this.CallerID = data.fields.caller_id
this.TickectContactID = data.fields.ticket_contact_id this.TickectContactID = data.fields.ticket_contact_id
...@@ -843,7 +840,7 @@ export class AdminTicketDetailComponent implements OnInit { ...@@ -843,7 +840,7 @@ export class AdminTicketDetailComponent implements OnInit {
//ServiceDeskLogsID must be null first at get detail ticket //ServiceDeskLogsID must be null first at get detail ticket
this.ServiceDeskLogsID = null this.ServiceDeskLogsID = null
this.ChangeAgentViewAssginee(data) this.ChangeAgentViewAssginee(data)
this.ConversationReplyNoteViewByRole()
this._TicketService.GetTopicDetail({ServiceID : data.fields.service_id}) this._TicketService.GetTopicDetail({ServiceID : data.fields.service_id})
...@@ -1791,7 +1788,9 @@ export class AdminTicketDetailComponent implements OnInit { ...@@ -1791,7 +1788,9 @@ export class AdminTicketDetailComponent implements OnInit {
subject : result.values[i].subject, subject : result.values[i].subject,
attachments : objAttachment, attachments : objAttachment,
status : result.values[i].status, status : result.values[i].status,
body : result.values[i].body body : result.values[i].body,
trigger_id_friendlyname : result.values[i].trigger_id_friendlyname,
action_id_friendlyname : result.values[i].action_id_friendlyname
}) })
} }
......
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