This commit is contained in:
tiago.kayaya
2021-09-06 12:14:21 +01:00
parent ab0bbf2efd
commit 64fb8f42a1
2 changed files with 74 additions and 42 deletions
+60 -29
View File
@@ -32,7 +32,7 @@ export class DespachoService {
public p: PermissionService,
public LoaderService: LoaderService
) { }
arquivar(note:string, documents:AttachmentList, serialnumber) {
let body = {
@@ -44,10 +44,10 @@ export class DespachoService {
},
"AttachmentList" :documents,
}
return this.processes.CompleteTask(body)
}
// reencaminhar(note:string, documents:any, serialnumber) {
// let body = {
@@ -61,9 +61,9 @@ export class DespachoService {
// }
// return this.processes.CompleteTask(body)
// }
executado(note:string, documents:any , serialnumber) {
let body = {
"serialNumber": serialnumber,
"action": "Conhecimento",
@@ -77,30 +77,61 @@ export class DespachoService {
return this.processes.CompleteTask(body)
}
solicitarParecer({note ='', documents = [], serialnumber}) {
let body = {
"serialNumber": serialnumber,
"action": "Conhecimento",
"ActionTypeId": 92,
"dataFields": {
"ReviewUserComment": note,
},
"AttachmentList" :documents,
solicitarParecer({note ='', documents = [], serialnumber, activityInstanceName}) {
let body;
if(activityInstanceName == 'Concluir Despacho' || activityInstanceName == 'Concluir Parecer' || activityInstanceName == 'Concluir Deferimento'){
body = {
"serialNumber": serialnumber,
"action": "Parecer",
"ActionTypeId": 92,
"dataFields": {
"ReviewUserComment": note,
},
"AttachmentList" :documents,
}
}
else{
body = {
"serialNumber": serialnumber,
"action": "Conhecimento",
"ActionTypeId": 92,
"dataFields": {
"ReviewUserComment": note,
},
"AttachmentList" :documents,
}
}
return this.processes.CompleteTask(body)
}
EfectuarDespacho({note = '', documents = [], serialnumber}) {
let body = {
"serialNumber": serialnumber,
"action": "Conhecimento",
"ActionTypeId": 94,
"dataFields": {
"ReviewUserComment": note,
},
"AttachmentList" :documents,
EfectuarDespacho({note = '', documents = [], serialnumber, activityInstanceName}) {
let body;
if(activityInstanceName == 'Concluir Despacho' || activityInstanceName == 'Concluir Parecer' || activityInstanceName == 'Concluir Deferimento'){
body = {
"serialNumber": serialnumber,
"action": "Despacho",
"ActionTypeId": 94,
"dataFields": {
"ReviewUserComment": note,
},
"AttachmentList" :documents,
}
}
else{
body = {
"serialNumber": serialnumber,
"action": "Conhecimento",
"ActionTypeId": 94,
"dataFields": {
"ReviewUserComment": note,
},
"AttachmentList" :documents,
}
}
console.log(body);
return this.processes.CompleteTask(body)
}
@@ -191,13 +222,13 @@ export class DespachoService {
async getList({updateStore = false}): Promise<customTask[]> | null {
if (this.LoaderService.loading) {
return this.despachoStore.list
}
this.LoaderService.push({})
let result: fullTaskList[] = []
let despachoList: customTask[] = [];
@@ -205,18 +236,18 @@ export class DespachoService {
result = await this.processes.GetTasksList("Despacho", false).toPromise();
result = result.filter((data:fullTaskList) => data.workflowInstanceDataFields.Status == "Active")
result.forEach((element, index) => {
let task: customTask = this.customTaskPipe.transform(element);
despachoList.push(task);
});
despachoList = this.sortArrayISODate(despachoList).reverse();
if(updateStore) {
this.despachoStore.reset(despachoList);
}
} catch (error) {
} finally {