mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
save
This commit is contained in:
+143
-131
@@ -174,149 +174,161 @@ export class ExpedientTaskModalPage implements OnInit {
|
|||||||
SourceId: e.Id
|
SourceId: e.Id
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
docs.Attachments = DocumentToSave;
|
docs.Attachments = DocumentToSave;
|
||||||
|
|
||||||
this.dispatchFolder.SubjectTypes = this.selectedTypes;
|
this.dispatchFolder.SubjectTypes = this.selectedTypes;
|
||||||
|
|
||||||
|
|
||||||
if(this.taskParticipants.length > 0) {
|
if(this.taskParticipants.length > 0) {
|
||||||
switch (this.taskType) {
|
switch (this.loggeduser.Profile) {
|
||||||
case '0':
|
case 'MDGPR':
|
||||||
this.postData = {
|
switch (this.taskType) {
|
||||||
DistributionType: "Paralelo",
|
case '0':
|
||||||
CountryCode: 'AO',
|
this.postData = {
|
||||||
Priority: this.postData.Priority,
|
DistributionType: "Paralelo",
|
||||||
UserEmail: this.user,
|
CountryCode: 'AO',
|
||||||
UsersSelected: attendees,
|
Priority: this.postData.Priority,
|
||||||
DispatchFolder: this.dispatchFolder,
|
UserEmail: this.user,
|
||||||
AttachmentList: docs,
|
UsersSelected: attendees,
|
||||||
//SubjectTypes: [],
|
DispatchFolder: this.dispatchFolder,
|
||||||
|
AttachmentList: docs,
|
||||||
}
|
//SubjectTypes: [],
|
||||||
|
}
|
||||||
// console.log('this.postData', this.postData, this.taskType);
|
try {
|
||||||
|
|
||||||
try {
|
|
||||||
switch(this.loggeduser.Profile){
|
|
||||||
case 'MDGPR':
|
|
||||||
this.taskResult = await this.processes.postDespatcho(this.postData).toPromise();
|
this.taskResult = await this.processes.postDespatcho(this.postData).toPromise();
|
||||||
let action_despacho = {
|
await this.successMessage('Processo efetuado')
|
||||||
"serialNumber": this.task.serialNumber,
|
} catch (error) {
|
||||||
"action": "Tratado",
|
await this.badRequest('Processo não efetuado')
|
||||||
"ActionTypeId": 94,
|
}
|
||||||
"dataFields": {
|
console.log('this.taskResult', this.taskResult);
|
||||||
"Note": "",
|
let action_despacho = {
|
||||||
}
|
"serialNumber": this.task.serialNumber,
|
||||||
|
"action": "Tratado",
|
||||||
|
"ActionTypeId": 94,
|
||||||
|
"dataFields": {
|
||||||
|
"Note": "",
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
this.modalController.dismiss(action_despacho);
|
||||||
|
break;
|
||||||
|
|
||||||
this.modalController.dismiss(action_despacho);
|
case '1':
|
||||||
break;
|
this.postData = {
|
||||||
case 'PR':
|
DistributionType: "Paralelo",
|
||||||
let action_despacho_pr = {
|
CountryCode: 'AO',
|
||||||
"serialNumber": this.task.serialNumber,
|
Priority: this.postData.Priority,
|
||||||
"action": "Tratado",
|
UserEmail: this.user,
|
||||||
"ActionTypeId": 99999881 ,
|
UsersSelected: attendees,
|
||||||
"dataFields": {
|
DispatchFolder: this.dispatchFolder,
|
||||||
"Note": "",
|
AttachmentList: docs
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.successMessage('Processo efetuado')
|
||||||
|
} catch (error) {
|
||||||
|
await this.badRequest('Processo não efetuado')
|
||||||
|
}
|
||||||
|
|
||||||
|
let action_parecer = {
|
||||||
|
"serialNumber": this.task.serialNumber,
|
||||||
|
"action": "Tratado",
|
||||||
|
"ActionTypeId": 92,
|
||||||
|
"dataFields": {
|
||||||
|
"Note": "",
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
this.modalController.dismiss(action_parecer);
|
||||||
|
break;
|
||||||
|
case '2':
|
||||||
|
this.postData = {
|
||||||
|
DistributionType: "Paralelo",
|
||||||
|
CountryCode: 'AO',
|
||||||
|
Priority: this.postData.Priority,
|
||||||
|
UserEmail: this.user,
|
||||||
|
UsersSelected: attendees,
|
||||||
|
DispatchFolder: this.dispatchFolder,
|
||||||
|
AttachmentList: docs
|
||||||
|
}
|
||||||
|
//console.log(this.postData);
|
||||||
|
try {
|
||||||
|
this.taskResult = await this.processes.postDeferimento(this.postData).toPromise()
|
||||||
|
await this.successMessage('Processo efetuado')
|
||||||
|
} catch (error) {
|
||||||
|
await this.badRequest('Processo não efetuado')
|
||||||
|
}
|
||||||
|
console.log('this.taskResult', this.taskResult);
|
||||||
|
let action_deferimento = {
|
||||||
|
"serialNumber": this.task.serialNumber,
|
||||||
|
"action": "Tratado",
|
||||||
|
"ActionTypeId": 93,
|
||||||
|
"dataFields": {
|
||||||
|
"Note": "",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.modalController.dismiss(action_deferimento);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
this.modalController.dismiss(action_despacho_pr);
|
break;
|
||||||
|
case 'PR':
|
||||||
|
switch (this.taskType) {
|
||||||
|
case '0':
|
||||||
|
this.postData = {
|
||||||
|
DistributionType: "Paralelo",
|
||||||
|
CountryCode: 'AO',
|
||||||
|
Priority: this.postData.Priority,
|
||||||
|
UserEmail: this.user,
|
||||||
|
UsersSelected: attendees,
|
||||||
|
DispatchFolder: this.dispatchFolder,
|
||||||
|
AttachmentList: docs,
|
||||||
|
//SubjectTypes: [],
|
||||||
|
}
|
||||||
|
try {
|
||||||
this.taskResult = await this.processes.postDespatchoPr(this.postData).toPromise();
|
this.taskResult = await this.processes.postDespatchoPr(this.postData).toPromise();
|
||||||
break;
|
await this.successMessage('Processo efetuado')
|
||||||
|
} catch (error) {
|
||||||
|
await this.badRequest('Processo não efetuado')
|
||||||
|
}
|
||||||
|
console.log('this.taskResult', this.taskResult);
|
||||||
|
let action_despacho_pr = {
|
||||||
|
"serialNumber": this.task.serialNumber,
|
||||||
|
"action": "Tratado",
|
||||||
|
"ActionTypeId": 99999881 ,
|
||||||
|
"dataFields": {
|
||||||
|
"Note": "",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.modalController.dismiss(action_despacho_pr);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case '1':
|
||||||
|
this.postData = {
|
||||||
|
DistributionType: "Paralelo",
|
||||||
|
CountryCode: 'AO',
|
||||||
|
Priority: this.postData.Priority,
|
||||||
|
UserEmail: this.user,
|
||||||
|
UsersSelected: attendees,
|
||||||
|
DispatchFolder: this.dispatchFolder,
|
||||||
|
AttachmentList: docs
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.successMessage('Processo efetuado')
|
||||||
|
} catch (error) {
|
||||||
|
await this.badRequest('Processo não efetuado')
|
||||||
|
}
|
||||||
|
|
||||||
|
let action_parecer_pr = {
|
||||||
|
"serialNumber": this.task.serialNumber,
|
||||||
|
"action": "Tratado",
|
||||||
|
"ActionTypeId": 99999881,
|
||||||
|
"dataFields": {
|
||||||
|
"Note": "",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.modalController.dismiss(action_parecer_pr);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
await this.successMessage('Processo efetuado')
|
|
||||||
} catch (error) {
|
|
||||||
await this.badRequest('Processo não efetuado')
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log('this.taskResult', this.taskResult);
|
|
||||||
|
|
||||||
/* let action_despacho = {
|
|
||||||
"serialNumber": this.task.serialNumber,
|
|
||||||
"action": "Tratado",
|
|
||||||
"ActionTypeId": 94,
|
|
||||||
"dataFields": {
|
|
||||||
"Note": "",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.modalController.dismiss(action_despacho); */
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '1':
|
default:
|
||||||
this.postData = {
|
|
||||||
DistributionType: "Paralelo",
|
|
||||||
CountryCode: 'AO',
|
|
||||||
Priority: this.postData.Priority,
|
|
||||||
UserEmail: this.user,
|
|
||||||
UsersSelected: attendees,
|
|
||||||
DispatchFolder: this.dispatchFolder,
|
|
||||||
AttachmentList: docs
|
|
||||||
}
|
|
||||||
|
|
||||||
//console.log(this.postData);
|
|
||||||
|
|
||||||
try {
|
|
||||||
switch(this.loggeduser.Profile){
|
|
||||||
case 'MDGPR':
|
|
||||||
this.taskResult = await this.processes.postParecer(this.postData).toPromise();
|
|
||||||
break;
|
|
||||||
case 'PR':
|
|
||||||
this.taskResult = await this.processes.postParecerPr(this.postData).toPromise();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
await this.successMessage('Processo efetuado')
|
|
||||||
} catch (error) {
|
|
||||||
await this.badRequest('Processo não efetuado')
|
|
||||||
}
|
|
||||||
|
|
||||||
// console.log('this.taskResult', this.taskResult);
|
|
||||||
|
|
||||||
let action_parecer = {
|
|
||||||
"serialNumber": this.task.serialNumber,
|
|
||||||
"action": "Tratado",
|
|
||||||
"ActionTypeId": 92,
|
|
||||||
"dataFields": {
|
|
||||||
"Note": "",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.modalController.dismiss(action_parecer);
|
|
||||||
break;
|
|
||||||
case '2':
|
|
||||||
this.postData = {
|
|
||||||
DistributionType: "Paralelo",
|
|
||||||
CountryCode: 'AO',
|
|
||||||
Priority: this.postData.Priority,
|
|
||||||
UserEmail: this.user,
|
|
||||||
UsersSelected: attendees,
|
|
||||||
DispatchFolder: this.dispatchFolder,
|
|
||||||
AttachmentList: docs
|
|
||||||
}
|
|
||||||
|
|
||||||
//console.log(this.postData);
|
|
||||||
|
|
||||||
try {
|
|
||||||
this.taskResult = await this.processes.postDeferimento(this.postData).toPromise()
|
|
||||||
await this.successMessage('Processo efetuado')
|
|
||||||
} catch (error) {
|
|
||||||
await this.badRequest('Processo não efetuado')
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
console.log('this.taskResult', this.taskResult);
|
|
||||||
|
|
||||||
let action_deferimento = {
|
|
||||||
"serialNumber": this.task.serialNumber,
|
|
||||||
"action": "Tratado",
|
|
||||||
"ActionTypeId": 93,
|
|
||||||
"dataFields": {
|
|
||||||
"Note": "",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.modalController.dismiss(action_deferimento);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user