Add types

This commit is contained in:
Peter Maquiran
2021-07-30 22:03:48 +01:00
parent df8ccb1073
commit 3d92560e1b
10 changed files with 114 additions and 60 deletions
@@ -1,13 +1,13 @@
import { TestBed } from '@angular/core/testing';
import { DespachoMdService } from './despacho-md.service';
import { DespachoService } from './despacho.service';
describe('DespachoMdService', () => {
let service: DespachoMdService;
describe('DespachoService', () => {
let service: DespachoService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(DespachoMdService);
service = TestBed.inject(DespachoService);
});
it('should be created', () => {
@@ -1,12 +1,10 @@
import { Injectable } from '@angular/core';
import { ProcessesService } from '../services/processes.service';
@Injectable({
providedIn: 'root'
})
export class DespachoMdService {
export class DespachoService {
/**
* @description para terminar o
* 95 - signfica
@@ -16,10 +14,10 @@ export class DespachoMdService {
action: "Arquivo" | "Reencaminhar"
constructor(
constructor(
private processes: ProcessesService,
) { }
) { }
arquivar(note:string, documents:any, serialnumber) {
let body = {
@@ -34,7 +32,7 @@ export class DespachoMdService {
return this.processes.CompleteTask(body)
}
reencaminhar(note:string, documents:any, serialnumber) {
let body = {
@@ -49,7 +47,7 @@ export class DespachoMdService {
return this.processes.CompleteTask(body)
}
executado(note:string, documents:any , serialnumber) {
let body = {
@@ -64,10 +62,9 @@ export class DespachoMdService {
return this.processes.CompleteTask(body)
}
sendExpedienteToPending(serialnumber) {
return this.processes.SetTaskToPending(serialnumber)
}
}
@@ -3,10 +3,10 @@
<div class="main-content d-flex height-100">
<div *ngIf="LoadedDocument" class="content d-flex flex-column">
<div class="main-header">
<div class="title-content width-100">
<div class="title-content width-100 d-flex">
<app-btn-modal-dismiss></app-btn-modal-dismiss>
<div class="middle">
<ion-label class="title">{{LoadedDocument.Subject}}</ion-label>
<ion-label class="title">{{LoadedDocument.Assunto}}</ion-label>
</div>
<div class="div-icon">
<ion-menu-button >
@@ -18,7 +18,7 @@
<div class="upper-content">
<div class="content-details">
<ion-label>
<p><span class="date">{{customDate}}</span><span class="label">{{LoadedDocument.Type}}</span></p>
<p><span class="date">{{customDate}}</span><span class="label" *ngIf="LoadedDocument.Nature">{{LoadedDocument.Nature}}</span></p>
</ion-label>
</div>
</div>
@@ -43,7 +43,7 @@
<ion-item class="ion-no-margin ion-no-padding">
<ion-label
(click)="viewDocument()">
<p class="attach-title-item">{{LoadedDocument.Subject}}<span class="span-right color-red btn-size"><ion-icon hidden name="close"></ion-icon></span></p>
<p class="attach-title-item">{{LoadedDocument.Assunto}}<span class="span-right color-red btn-size"><ion-icon hidden name="close"></ion-icon></span></p>
<p hidden><span class="span-left">Remetente</span><span class="span-right"></span></p>
</ion-label>
</ion-item>
@@ -6,6 +6,8 @@ import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
import { ExpedientTaskModalPage } from 'src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page';
import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page';
import { DocumentSetUpMeetingPage } from '../document-set-up-meeting/document-set-up-meeting.page';
import { FromSearchDocument, SearchFolder } from 'src/app/models/search-document';
import { ExpedientTaskModalPageNavParamsTask } from 'src/app/models/ExpedientTaskModalPage';
@Component({
selector: 'app-document-detail',
@@ -23,6 +25,9 @@ export class DocumentDetailPage implements OnInit {
applicationId:string;
LoadedDocument:any = null;
folder: SearchFolder
document: FromSearchDocument
constructor(
private navParams: NavParams,
private modalController: ModalController,
@@ -57,7 +62,6 @@ export class DocumentDetailPage implements OnInit {
const url: string = res.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1");
const browser = this.iab.create(url,"_blank");
browser.show();
});
}
@@ -75,30 +79,33 @@ export class DocumentDetailPage implements OnInit {
// efetuar despacho
async openExpedientActionsModal( taskAction: any) {
let task;
let task: ExpedientTaskModalPageNavParamsTask
let document: FromSearchDocument = this.LoadedDocument
let folder: SearchFolder = this.LoadedDocument
if(this.LoadedDocument.ApplicationID == 361) {
task = {
serialNumber: this.LoadedDocument.DispatchNumber,
taskStartDate: this.LoadedDocument.DateDispatch,
serialNumber: folder.DispatchNumber,
taskStartDate: folder.DateDispatch,
isEvent: true,
workflowInstanceDataFields: {
FsId: this.LoadedDocument.ApplicationID,
FsId: folder.ApplicationID || folder.ApplicationId,
FolderID: null,
DocId: this.LoadedDocument.DispatchNumber,
Subject: this.LoadedDocument.Assunto
DocId: folder.DispatchNumber,
Subject: folder.Assunto
},
}
} else if (this.LoadedDocument.ApplicationID == 8 || this.LoadedDocument.ApplicationId == 8) {
} else if (document.ApplicationID == 8 || document.ApplicationId == 8) {
task = {
serialNumber: this.LoadedDocument.DocId,
taskStartDate: this.LoadedDocument.DocDate,
serialNumber: document.DocId,
taskStartDate: document.DocDate,
isEvent: true,
workflowInstanceDataFields: {
FsId: this.LoadedDocument.ApplicationID || this.LoadedDocument.ApplicationId,
FsId: document.ApplicationID || document.ApplicationId,
FolderID: null,
DocId: this.LoadedDocument.DocId,
Subject: this.LoadedDocument.Assunto
DocId: document.DocId || document.DocID,
Subject: document.Assunto
}
}
}
@@ -124,34 +131,35 @@ export class DocumentDetailPage implements OnInit {
async openBookMeetingModal() {
let document: FromSearchDocument = this.LoadedDocument
let folder: SearchFolder = this.LoadedDocument
let task;
if(this.LoadedDocument.ApplicationID == 361) {
if(folder.ApplicationID == 361) {
task = {
serialNumber: this.LoadedDocument.DispatchNumber,
taskStartDate: this.LoadedDocument.DateDispatch,
serialNumber: folder.DispatchNumber,
taskStartDate: folder.DateDispatch,
isEvent: true,
Folio: this.LoadedDocument.Assunto,
FsId: this.LoadedDocument.ApplicationID,
Folio: folder.Assunto,
FsId: folder.ApplicationID,
workflowInstanceDataFields: {
FsId: this.LoadedDocument.ApplicationID,
FsId: folder.ApplicationID,
FolderID: null,
DocId: this.LoadedDocument.DispatchNumber,
Subject: this.LoadedDocument.Assunto
DocId: folder.DispatchNumber,
Subject: folder.Assunto
},
}
} else if (this.LoadedDocument.ApplicationID == 8 || this.LoadedDocument.ApplicationId == 8) {
} else if (document.ApplicationID == 8 || document.ApplicationId == 8) {
task = {
serialNumber: this.LoadedDocument.SourceId,
taskStartDate: this.LoadedDocument.CreateDate,
taskStartDate: document.DocDate,
isEvent: true,
Folio: this.LoadedDocument.Assunto,
FsId: this.LoadedDocument.ApplicationID,
Folio: document.Assunto,
FsId: document.ApplicationID,
workflowInstanceDataFields: {
FsId: this.LoadedDocument.ApplicationID,
FsId: document.ApplicationID || document.ApplicationId,
FolderID: null,
DocId: this.LoadedDocument.SourceId,
Subject: this.LoadedDocument.SourceName
DocId: document.DocID || document.DocId,
Subject: document.Assunto
}
}
}
+17
View File
@@ -0,0 +1,17 @@
export class ExpedientTaskModalPageNavParamsTask {
serialNumber: any
taskStartDate: string
isEvent: boolean
workflowInstanceDataFields: {
FsId: any,
FolderID: string,
DocId: any,
DocID?: any
Subject: string,
DispatchNumber?: any
}
}
export class task extends ExpedientTaskModalPageNavParamsTask {}
+37 -1
View File
@@ -1,5 +1,4 @@
export class SearchDocument {
ApplicationType: number | string;
Assunto: string;
Data: string;
@@ -9,3 +8,40 @@ export class SearchDocument {
Id: string;
appName?: string;
}
export class FromSearchDocument {
ApplicationId: number
ApplicationID: number
Assunto: string
DocDate: string
DocId: number
DocID?: number
Sender: string
SenderId: number
}
export class SearchFolder {
ApplicationID: number
ApplicationId: number
Assunto:string
DateDispatch: string
DispatchNumber: string
Docs: string
Documents: {
Assunto: string
DocDate: string
DocId: number
DocNumber: string
Sender: string
}[]
DocumentsTotal: 2
IntervenerList: string[]
Interveners: string
Nature:string
Sender: null | string
SenderId: null | string
Status: string
folderId: number
}
+1 -1
View File
@@ -129,7 +129,7 @@
<button class="btn-no-color" *ngIf="showCalendar" (click)="calendarHeight='75px';showCalendar=false">
<ion-icon class="collaps btn-no-color" src="assets/images/icons-collaps-up.svg" ></ion-icon>
</button>
<button class="btn-no-color" *ngIf="!showCalendar" (click)="calendarHeight='317px';showCalendar=true">
<button class="btn-no-color" *ngIf="!showCalendar" (click)="calendarHeight='320px';showCalendar=true">
<ion-icon class="collaps btn-no-color" src="assets/images/icons-collaps-down.svg" ></ion-icon>
</button >
+1 -1
View File
@@ -171,7 +171,7 @@ export class AgendaPage implements OnInit {
this.loggeduser = authService.ValidatedUser;
this.calendarHeight = "317px";
this.calendarHeight = "320px";
this.showCalendar = true;
this.timelineDate = momentG(new Date(),'dd MMMM yyyy');
@@ -15,8 +15,7 @@ import { DelegarPage } from 'src/app/modals/delegar/delegar.page';
import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
import { DespachosOptionsPage } from 'src/app/shared/popover/despachos-options/despachos-options.page';
import { ToastService } from 'src/app/services/toast.service';
import { DespachoMdService } from 'src/app/Rules/despacho-md.service'
import { NavigationService } from 'src/app/services/navigation.service';
import { DespachoService } from 'src/app/Rules/despacho.service'
import { Location } from '@angular/common'
@Component({
@@ -47,14 +46,10 @@ export class DespachoPage implements OnInit {
private events: EventsService,
private menu: MenuController,
private modalController: ModalController,
private alertService: AlertService,
public popoverController: PopoverController,
private activatedRoute: ActivatedRoute,
private router: Router,
private animationController: AnimationController,
private toastService: ToastService,
private despachoMdService: DespachoMdService,
private navigationService: NavigationService,
private despachoService: DespachoService,
private location: Location
) {
@@ -204,7 +199,7 @@ export class DespachoPage implements OnInit {
const loader = this.toastService.loading()
try {
await this.despachoMdService.executado(note, documents, this.serialnumber)
await this.despachoService.executado(note, documents, this.serialnumber)
this.toastService.successMessage('Processo criado')
this.close();
} catch(error) {
@@ -300,7 +295,7 @@ export class DespachoPage implements OnInit {
async sendExpedienteToPending() {
this.despachoMdService.sendExpedienteToPending(this.serialnumber).subscribe(res=>{
this.despachoService.sendExpedienteToPending(this.serialnumber).subscribe(res=>{
this.goBack();
this.toastService.successMessage('Processo enviado para despacho')
},
@@ -19,6 +19,7 @@ import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.pag
import { FormControl, FormGroup, Validators } from '@angular/forms';
import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker';
import { NgxMatDateFormats } from '@angular-material-components/datetime-picker';
import { task } from 'src/app/models/ExpedientTaskModalPage';
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
parse: {
@@ -49,7 +50,7 @@ export class ExpedientTaskModalPage implements OnInit {
'Solicitar Deferimento'
];
taskType:string;
task: any;
task: task;
taskParticipants: any = [];
taskParticipantsCc: any = [];