This commit is contained in:
Peter Maquiran
2022-06-03 16:53:50 +01:00
parent 7430bf7fe1
commit ee370f7e2e
29 changed files with 175 additions and 404 deletions
@@ -8,7 +8,7 @@
<div class="ion-item-container width-100" [class.input-error]="Form?.get('Subject')?.invalid && validateFrom ">
<ion-input autocomplete="on" autocorrect="on" spellcheck="true" placeholder="Assunto*" [(ngModel)]="postData.DispatchFolder.Subject"></ion-input>
</div>
<div *ngIf="Form && validateFrom" >
<div *ngIf="Form.get('Subject').invalid " class="input-errror-message">
<div *ngIf="Form.get('Subject').errors?.required">
@@ -209,15 +209,6 @@ export class ExpedientTaskModalPage implements OnInit {
Priority: new FormControl(this.postData.Priority, [
Validators.required,
]),
// CalendarName: new FormControl(this.postEvent.CalendarName, [
// Validators.required
// ]),
// Categories: new FormControl(this.postEvent.Categories, [
// Validators.required
// ]),
// IsRecurring: new FormControl(this.postEvent.IsRecurring, [
// Validators.required
// ]),
participantes: new FormControl(this.taskParticipants, [
Validators.required
]),
@@ -298,195 +289,6 @@ export class ExpedientTaskModalPage implements OnInit {
this.dispatchFolder.SubjectTypes = this.selectedTypes;
const loader = this.toastService.loading()
// switch (this.loggeduser.Profile) {
// case 'MDGPR':
// if(this.taskParticipants.length > 0) {
// switch (this.taskType) {
// case '0': // Despacho
// this.postData = {
// DistributionType: "Paralelo",
// CountryCode: 'AO',
// Priority: this.postData.Priority,
// UserEmail: this.loggeduser.Email,
// UsersSelected: attendees,
// DispatchFolder: this.dispatchFolder,
// AttachmentList: docs,
// }
// let action_despacho = {
// "serialNumber": this.task.serialNumber,
// "action": "Tratado",
// "ActionTypeId": 94,
// "dataFields": {
// "Note": "",
// }
// }
// try {
// this.taskResult = await this.processes.postDespatcho(this.postData).toPromise();
// await this.toastService._successMessage('Processo efetuado');
// this.modalController.dismiss(action_despacho);
// } catch (error) {
// await this.toastService._badRequest('Processo não efetuado')
// } finally {
// loader.remove()
// }
// break;
// case '1': // Parecer
// this.postData = {
// DistributionType: "Paralelo",
// CountryCode: 'AO',
// Priority: this.postData.Priority,
// UserEmail: this.loggeduser.Email,
// UsersSelected: attendees,
// DispatchFolder: this.dispatchFolder,
// AttachmentList: docs
// }
// let action_parecer = {
// "serialNumber": this.task.serialNumber,
// "action": "Tratado",
// "ActionTypeId": 92,
// "dataFields": {
// "Note": "",
// }
// }
// try {
// this.taskResult = await this.processes.postParecer(this.postData).toPromise();
// await this.toastService._successMessage('Pedido enviado');
// this.modalController.dismiss(action_parecer);
// } catch (error) {
// await this.toastService._badRequest('Processo não efetuado')
// } finally {
// loader.remove()
// }
// break;
// case '2': // Deferimento
// this.postData = {
// DistributionType: "Paralelo",
// CountryCode: 'AO',
// Priority: this.postData.Priority,
// UserEmail: this.loggeduser.Email,
// UsersSelected: attendees,
// DispatchFolder: this.dispatchFolder,
// AttachmentList: docs
// }
// //
// let action_deferimento = {
// "serialNumber": this.task.serialNumber,
// "action": "Tratado",
// "ActionTypeId": 93,
// "dataFields": {
// "Note": "",
// }
// }
// try {
// this.taskResult = await this.processes.postDeferimento(this.postData).toPromise();
// this.toastService._successMessage('Processo efetuado');
// this.modalController.dismiss(action_deferimento);
// } catch (error) {
// await this.toastService._badRequest('Processo não efetuado')
// } finally {
// loader.remove()
// }
// break;
// }
// }
// else {
// this.alertController.presentAlert("Lista de i-ntervenientes vazia. Por favor, adicione 1 ou mais intervenientes.");
// }
// break;
// case 'PR':
// switch (this.taskType) {
// case '0': // despacho
// this.postData = {
// DistributionType: "Paralelo",
// CountryCode: 'AO',
// Priority: this.postData.Priority,
// UserEmail: this.loggeduser.Email,
// UsersSelected: attendees,
// DispatchFolder: this.dispatchFolder,
// AttachmentList: docs,
// }
// let action_despacho_pr = {
// "serialNumber": this.task.serialNumber,
// "action": "Tratado",
// "ActionTypeId": 99999881 ,
// "dataFields": {
// "Note": "",
// }
// }
// if(this.postData.DispatchFolder.Message){
// try {
// this.taskResult = await this.despachoService.createDespacho(this.postData).toPromise();
// await this.toastService._successMessage('Processo efetuado');
// this.modalController.dismiss(action_despacho_pr);
// } catch (error) {
// await this.toastService._badRequest('Processo não efetuado')
// } finally {
// //loader.remove()
// }
// }
// else{
// this.validateField = true;
// this.toastService._badRequest('Por favor adicione uma descrição');
// }
// loader.remove();
// break;
// case '1': // parecer
// this.postData = {
// DistributionType: "Paralelo",
// CountryCode: 'AO',
// Priority: this.postData.Priority,
// UserEmail: this.loggeduser.Email,
// UsersSelected: attendees,
// DispatchFolder: this.dispatchFolder,
// AttachmentList: docs
// }
// let action_parecer_pr = {
// "serialNumber": this.task.serialNumber,
// "action": "Tratado",
// "ActionTypeId": 99999881,
// "dataFields": {
// "Note": "",
// }
// }
// try {
// this.taskResult = await this.processes.postParecerPr(this.postData).toPromise();
// await this.toastService._successMessage('Pedido enviado');
// this.modalController.dismiss(action_parecer_pr);
// } catch (error) {
// await this.toastService._badRequest('Processo não efetuado')
// } finally {
// loader.remove()
// }
// break;
// }
// break;
// }
if(this.loggeduser.Profile != 'PR') {
if(this.taskParticipants.length > 0) {
switch (this.taskType) {
@@ -506,12 +308,10 @@ export class ExpedientTaskModalPage implements OnInit {
"action": "Tratado",
"ActionTypeId": 94,
"dataFields": {
"Note": "",
"Note": this.postData.DispatchFolder.Subject,
}
}
try {
this.taskResult = await this.processes.postDespatcho(this.postData).toPromise();
@@ -543,7 +343,7 @@ export class ExpedientTaskModalPage implements OnInit {
"action": "Tratado",
"ActionTypeId": 92,
"dataFields": {
"Note": "",
"Note": this.postData.DispatchFolder.Subject,
}
}
@@ -570,11 +370,11 @@ export class ExpedientTaskModalPage implements OnInit {
}
//
let action_deferimento = {
"serialNumber": this.task.serialNumber,
"action": "Tratado",
"ActionTypeId": 93,
"dataFields": {
"Note": "",
"serialNumber": this.task.serialNumber,
"action": "Tratado",
"ActionTypeId": 93,
"dataFields": {
"Note": this.postData.DispatchFolder.Subject,
}
}
@@ -612,7 +412,7 @@ export class ExpedientTaskModalPage implements OnInit {
"action": "Tratado",
"ActionTypeId": 99999881 ,
"dataFields": {
"Note": "",
"Note": this.postData.DispatchFolder.Subject,
}
}
@@ -651,7 +451,7 @@ export class ExpedientTaskModalPage implements OnInit {
"action": "Tratado",
"ActionTypeId": 99999881,
"dataFields": {
"Note": "",
"Note": this.postData.DispatchFolder.Subject,
}
}