This commit is contained in:
Eudes Inácio
2021-08-20 18:23:13 +01:00
30 changed files with 241 additions and 139 deletions
+17 -3
View File
@@ -1,4 +1,5 @@
import { Injectable } from '@angular/core';
import { AttachmentList } from '../models/Excludetask';
import { PermissionService } from '../OtherService/permission.service';
import { ProcessesService } from '../services/processes.service';
@@ -24,7 +25,7 @@ export class DespachoService {
public p: PermissionService
) { }
arquivar(note:string, documents:any, serialnumber) {
arquivar(note:string, documents:AttachmentList, serialnumber) {
let body = {
"serialNumber": serialnumber,
@@ -96,7 +97,7 @@ export class DespachoService {
return this.processes.CompleteTask(body)
}
rexecucao({note, documents, serialnumber}) {
reexecute({note, documents, serialnumber}) {
let body = {
"serialNumber": serialnumber,
"action": "Reexecução",
@@ -158,7 +159,6 @@ export class DespachoService {
}
}
createParecer(body: any) {
if(this.p.userRole(['PR'])) {
return this.processes.postParecerPr(body)
@@ -167,4 +167,18 @@ export class DespachoService {
}
}
generateDiploma({note = '', documents = [], serialnumber}) {
let body = {
"serialNumber": serialnumber,
"action": "Reencaminhar",
"ActionTypeId": 99999839,
"dataFields": {
"ReviewUserComment": note,
},
"AttachmentList" :documents,
}
return this.processes.CompleteTask(body)
}
}
@@ -88,6 +88,7 @@ export class DocumentSetUpMeetingPage implements OnInit {
document: SearchFolderDetails | SearchDocumentDetails | any;
subject: string
eventPipe = new EventPipe()
constructor(
private modalController: ModalController,
@@ -97,8 +98,7 @@ export class DocumentSetUpMeetingPage implements OnInit {
private toastService: ToastService,
private documentService: DocumentService,
private calendarService: EventsService,
private eventService: EventService,
private eventPipe: EventPipe
private eventService: EventService
) {
this.loggeduser = authService.ValidatedUser;
+6 -1
View File
@@ -8,4 +8,9 @@ interface ExpedientTaskModalPageComponentProps {
task: any
profile: any
}
interface ExpedientTaskModalPageReturn {}
interface ExpedientTaskModalPageReturn {}
interface CreateProcessPageComponentProps {
taskAction: any
fulltask: any
}
-7
View File
@@ -1,7 +0,0 @@
import { SearchCategory } from './search-category';
describe('SearchCategory', () => {
it('should create an instance', () => {
expect(new SearchCategory()).toBeTruthy();
});
});
-5
View File
@@ -1,5 +0,0 @@
export class SearchCategory {
Id: number;
Name: string;
Qtd: 6;
}
@@ -94,7 +94,6 @@ ion-menu{
.upper-content{
width: calc(100%-50px);
margin-left: 50px;
overflow: auto;
font-size: 18px;
.content-location{
+1 -1
View File
@@ -63,7 +63,7 @@
</span>
</ion-label>
</div>
<div class="item-date" [class.item-date-active]="dm._id == idSelected">{{dm._updatedAt | date: 'HH:mm'}}</div>
<div class="item-date" [class.item-date-active]="dm._id == idSelected">{{showDateDuration(dm._updatedAt)}}</div>
</div>
<div class="item-description" [class.item-description-active]="dm._id == idSelected">
<ion-label *ngIf="dm.lastMessage">{{dm.lastMessage.msg}}</ion-label>
+41
View File
@@ -138,6 +138,10 @@ export class ChatPage implements OnInit {
/* Fim websocket functions */
this.hideRefreshButton();
this.getChatMembers();
//Teste
let t = this.showDateDuration(new Date());
console.log(t);
}
hideRefreshButton(){
@@ -368,6 +372,43 @@ hideRefreshButton(){
});
}
showDateDuration(start:any){
let end;
end = new Date();
start = new Date(start);
let customizedDate;
const totalSeconds = Math.floor((end - (start))/1000);;
const totalMinutes = Math.floor(totalSeconds/60);
const totalHours = Math.floor(totalMinutes/60);
const totalDays = Math.floor(totalHours/24);
const hours = totalHours - ( totalDays * 24 );
const minutes = totalMinutes - ( totalDays * 24 * 60 ) - ( hours * 60 );
const seconds = totalSeconds - ( totalDays * 24 * 60 * 60 ) - ( hours * 60 * 60 ) - ( minutes * 60 );
if(totalDays == 0){
if(start.getDate() == new Date().getDate()){
let time = start.getHours() + ":" + this.addZero(start.getUTCMinutes());
return time;
}
else{
return 'Ontem';
}
}
else{
let date = start.getDate() + "/" + (start.getMonth()+1) + "/" + start.getFullYear();
return date;
}
}
addZero(i) {
if (i < 10) {
i = "0" + i;
}
return i;
}
async getChatMembers(){
//return await this.chatService.getMembers(roomId).toPromise();
this.chatService.getAllUsers().subscribe(res=> {
@@ -43,7 +43,7 @@
<div *ngIf="msg.t != 'r'" class='incoming-{{msg.u.username!=loggedUser.me.username}}'>
<div class="title">
<ion-label>{{msg.u.name}}</ion-label>
<span class="time">{{msg._updatedAt | date: 'HH:mm' }}</span>
<span class="time">{{showDateDuration(msg._updatedAt)}}</span>
</div>
<div>
<ion-label>{{msg.msg}}</ion-label>
@@ -133,6 +133,47 @@ export class GroupMessagesPage implements OnInit, AfterViewChecked {
});
} */
}
showDateDuration(start:any){
let end;
end = new Date();
start = new Date(start);
let customizedDate;
const totalSeconds = Math.floor((end - (start))/1000);;
const totalMinutes = Math.floor(totalSeconds/60);
const totalHours = Math.floor(totalMinutes/60);
const totalDays = Math.floor(totalHours/24);
const hours = totalHours - ( totalDays * 24 );
const minutes = totalMinutes - ( totalDays * 24 * 60 ) - ( hours * 60 );
const seconds = totalSeconds - ( totalDays * 24 * 60 * 60 ) - ( hours * 60 * 60 ) - ( minutes * 60 );
if(totalDays == 0){
if(start.getDate() == new Date().getDate()){
let time = start.getHours() + ":" + this.addZero(start.getUTCMinutes());
return time;
}
else{
return 'Ontem';
}
}
else{
let date = start.getDate() + "/" + (start.getMonth()+1) + "/" + start.getFullYear();
return date;
}
}
addZero(i) {
if (i < 10) {
i = "0" + i;
}
return i;
}
sendMessage(){
let body = {
"message": { "rid": this.roomId, "msg": this.message }
@@ -39,7 +39,7 @@
<div *ngFor="let msg of messages" class='incoming-{{msg.u.username!=loggedUser.me.username}}'>
<div class="title">
<ion-label>{{msg.u.name}}</ion-label>
<span class="time">{{msg._updatedAt | date: 'HH:mm' }}</span>
<span class="time">{{showDateDuration(msg._updatedAt)}}</span>
</div>
<div>
<ion-label>{{msg.msg}}</ion-label>
@@ -126,6 +126,43 @@ export class MessagesPage implements OnInit, AfterViewChecked {
});
}
showDateDuration(start:any){
let end;
end = new Date();
start = new Date(start);
let customizedDate;
const totalSeconds = Math.floor((end - (start))/1000);;
const totalMinutes = Math.floor(totalSeconds/60);
const totalHours = Math.floor(totalMinutes/60);
const totalDays = Math.floor(totalHours/24);
const hours = totalHours - ( totalDays * 24 );
const minutes = totalMinutes - ( totalDays * 24 * 60 ) - ( hours * 60 );
const seconds = totalSeconds - ( totalDays * 24 * 60 * 60 ) - ( hours * 60 * 60 ) - ( minutes * 60 );
if(totalDays == 0){
if(start.getDate() == new Date().getDate()){
let time = start.getHours() + ":" + this.addZero(start.getUTCMinutes());
return time;
}
else{
return 'Ontem';
}
}
else{
let date = start.getDate() + "/" + (start.getMonth()+1) + "/" + start.getFullYear();
return date;
}
}
addZero(i) {
if (i < 10) {
i = "0" + i;
}
return i;
}
async openMessagesOptions(ev?: any) {
const popover = await this.popoverController.create({
component: MessagesOptionsPage,
@@ -59,7 +59,7 @@
</div>
</div>
<div class="bottom-content width-100">
<ion-list *ngIf="attachments">
<ion-list *ngIf="fulltask.Documents">
<h5>Documentos Anexados</h5>
<ion-item *ngFor="let attachment of fulltask.Documents"
class="ion-no-margin ion-no-padding cursor-pointer">
@@ -21,13 +21,11 @@
border-top-left-radius: 25px;
border-top-right-radius: 25px;
background-color: #fff;
overflow:auto;
color:#000;
transform: translate3d(0, 1px, 0);
.header-top{
width: 360px;
margin: 0px auto;
overflow: auto;
padding: 0 !important;
background: #fff;
.middle{
@@ -99,7 +97,6 @@ ion-button{
.upper-content{
font-family: Roboto;
margin-left: 41px;
overflow: auto;
font-size: 18px;
.label{
@@ -7,9 +7,7 @@ import { DailyWorkTask, fullTask } from '../../../../models/dailyworktask.model'
import { ActivatedRoute, NavigationExtras, Router } from '@angular/router';
import { Event } from '../../../../models/event.model';
import { AnimationController, MenuController, ModalController, PopoverController } from '@ionic/angular';
import { AlertService } from 'src/app/services/alert.service';
import { ViewEventPage } from 'src/app/pages/agenda/view-event/view-event.page';
import { MenuController, ModalController, PopoverController } from '@ionic/angular';
import { momentG } from 'src/plugin/momentG'
import { DiscartExpedientModalPage } from '../../discart-expedient-modal/discart-expedient-modal.page';
import { BookMeetingModalPage } from '../../expediente/book-meeting-modal/book-meeting-modal.page';
@@ -19,6 +17,7 @@ import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
import { DespachosPrOptionsPage } from 'src/app/shared/popover/despachos-pr-options/despachos-pr-options.page';
import { ToastService } from 'src/app/services/toast.service';
import { Location } from '@angular/common'
import { DespachoService } from 'src/app/Rules/despacho.service';
@Component({
selector: 'app-despacho-pr',
@@ -32,7 +31,6 @@ export class DespachoPrPage implements OnInit {
customDate:any;
task: any;
attachments:any;
fulltask: any;
eventsList: Event[];
serialNumber: string;
@@ -53,6 +51,7 @@ export class DespachoPrPage implements OnInit {
private activatedRoute: ActivatedRoute,
private toastService: ToastService,
private location: Location,
private despachoService: DespachoService
) {
this.activatedRoute.paramMap.subscribe(params => {
if(params["params"].SerialNumber) {
@@ -146,24 +145,6 @@ export class DespachoPrPage implements OnInit {
});
}
// async LoadRelatedEvents(serial: string) {
// if (this.eventsList == null) {
// this.attachmentsService.getAttachmentsBySerial(serial).subscribe(res => {
// console.log(res);
// res.forEach(att => {
// if (this.eventsList == null) {
// this.eventsList = new Array();
// }
// this.events.getEvent(att.ParentId).subscribe(event => {
// this.eventsList.push(event);
// console.log(this.eventsList);
// });
// });
// });
// }
// }
viewDocument(docId:string){
this.processes.GetDocumentUrl(docId, '361').subscribe(res=>{
console.log(res);
@@ -232,20 +213,16 @@ export class DespachoPrPage implements OnInit {
}
async generateDiploma(note:string, documents:any){
let body = {
"serialNumber": this.serialNumber,
"action": "Reencaminhar",
"ActionTypeId": 99999839,
"dataFields": {
"ReviewUserComment": note,
},
"AttachmentList" :documents,
}
const loader = this.toastService.loading()
try {
await this.processes.CompleteTask(body).toPromise()
await this.despachoService.generateDiploma({
serialnumber: this.serialNumber,
note,
documents
}).toPromise()
this.toastService.successMessage('Processo criado')
this.close();
} catch (error) {
@@ -284,7 +261,7 @@ export class DespachoPrPage implements OnInit {
}
async reexecutar(note:string, documents:any){
async reexecutar(note:string, documents:any) {
let body = {
"serialNumber": this.serialNumber,
"action": "Reexecutar",
@@ -344,9 +321,7 @@ export class DespachoPrPage implements OnInit {
modal.onDidDismiss().then( async (res) => {
console.log(res);
if(res.data){
if(res.data) {
const DocumentToSave = res.data.documents.map((e) => {
return {
@@ -1,7 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { ProcessesService } from 'src/app/services/processes.service';
import { AttachmentsService } from 'src/app/services/attachments.service';
import { EventsService } from 'src/app/services/events.service';
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
import { ActivatedRoute } from '@angular/router';
import { Event } from '../../../../models/event.model';
@@ -45,8 +43,6 @@ export class DespachoPage implements OnInit {
constructor(private activateRoute: ActivatedRoute,
private processes: ProcessesService,
private iab: InAppBrowser,
private attachmentsService: AttachmentsService,
private events: EventsService,
private menu: MenuController,
private modalController: ModalController,
public popoverController: PopoverController,
@@ -192,19 +188,11 @@ export class DespachoPage implements OnInit {
}
async arquivar(note:string, documents: AttachmentList) {
let body = {
"serialNumber": this.serialnumber,
"action": "Arquivo",
"ActionTypeId": 95,
"dataFields": {
"ReviewUserComment": note,
},
"AttachmentList" :documents,
}
const loader = this.toastService.loading()
try {
await this.processes.CompleteTask(body).toPromise()
await this.despachoService.arquivar(note, documents,this.serialnumber).toPromise()
this.toastService.successMessage('Processo descartado')
this.close();
} catch (error) {
@@ -214,7 +202,6 @@ export class DespachoPage implements OnInit {
loader.remove()
}
}
async reexecute(note:string, documents:any) {
@@ -116,7 +116,6 @@ ion-button{
.upper-content{
font-family: Roboto;
margin-left: 41px;
overflow: auto;
font-size: 18px;
.label{
@@ -98,7 +98,6 @@ ion-button{
.upper-content{
font-family: Roboto;
margin-left: 41px;
overflow: auto;
font-size: 18px;
.label{
@@ -42,26 +42,30 @@
(click)="goToDiploma(task.SerialNumber)"
lines="none"
>
<div class="item width-100">
<div class="exp-top-detail">
<div class="exp-date">
<ion-label>{{ task.CreateDate | date: 'dd-MM-yyyy HH:mm' }}</ion-label>
</div>
<div class="exp-remetente">
<ion-label>{{task.Remetente}}</ion-label>
</div>
<div class="exp-workflow">
<span class="label">{{task.activityInstanceName}}</span>
</div>
<div class="exp-icon">
<ion-icon src="assets/images/icons-expediente-attachment.svg"></ion-icon>
<label>{{task.DocumentsQty}}</label>
</div>
</div>
<div class="exp-bottom-detail">
<div class="item width-100">
<div class="exp-top-detail">
<div class="subject">
<ion-label>{{ task.Folio }}</ion-label>
</div>
<div class="exp-icon">
<ion-icon src="assets/images/icons-expediente-attachment.svg"></ion-icon>
<label *ngIf="task.DocumentsQty != 0">{{task.DocumentsQty}}</label>
</div>
</div>
<div class="exp-bottom-detail">
<div class="exp-remetente">
<ion-label>{{task.Senders}}</ion-label>
</div>
</div>
<div class="exp-middle-detail">
<div class="exp-workflow">
<span class="label">{{task.activityInstanceName}}</span>
</div>
<div class="exp-date">
<ion-label>{{ task.CreateDate | date: 'dd-MM-yyyy HH:mm' }}</ion-label>
</div>
</div>
</div>
</ion-item>
</ion-list>
@@ -74,26 +78,30 @@
(click)="goToDiploma(task.SerialNumber)"
lines="none"
>
<div class="item width-100">
<div class="exp-top-detail">
<div class="exp-date">
<ion-label>{{ task.CreateDate | date: 'dd-MM-yyyy HH:mm' }}</ion-label>
</div>
<div class="exp-remetente">
<ion-label>{{task.Remetente}}</ion-label>
</div>
<div class="exp-workflow">
<span class="label">{{task.activityInstanceName}}</span>
</div>
<div class="exp-icon">
<ion-icon src="assets/images/icons-expediente-attachment.svg"></ion-icon>
<label></label>
</div>
</div>
<div class="exp-bottom-detail">
<div class="item width-100">
<div class="exp-top-detail">
<div class="subject">
<ion-label>{{ task.Folio }}</ion-label>
</div>
<div class="exp-icon">
<ion-icon src="assets/images/icons-expediente-attachment.svg"></ion-icon>
<label *ngIf="task.DocumentsQty != 0">{{task.DocumentsQty}}</label>
</div>
</div>
<div class="exp-bottom-detail">
<div class="exp-remetente">
<ion-label>{{task.Senders}}</ion-label>
</div>
</div>
<div class="exp-middle-detail">
<div class="exp-workflow">
<span class="label">{{task.activityInstanceName}}</span>
</div>
<div class="exp-date">
<ion-label>{{ task.CreateDate | date: 'dd-MM-yyyy HH:mm' }}</ion-label>
</div>
</div>
</div>
</ion-item>
</ion-list>
</div>
@@ -2,7 +2,6 @@ import { Component, Input, OnDestroy, OnInit } from '@angular/core';
import { ActivatedRoute, NavigationEnd, NavigationError, NavigationExtras, NavigationStart, Router } from '@angular/router';
import { DailyWorkTask } from '../../../models/dailyworktask.model';
import { ProcessesService } from 'src/app/services/processes.service';
import { removeDuplicate } from 'src/plugin/removeDuplicate.js'
@Component({
selector: 'app-diplomas',
@@ -12,19 +11,19 @@ import { removeDuplicate } from 'src/plugin/removeDuplicate.js'
export class DiplomasPage implements OnInit, OnDestroy {
list:DailyWorkTask[] = [];
diplomasList:DailyWorkTask[] = [];
diplomasAssinadoList:DailyWorkTask[] = [];
showLoader: boolean;
totalDocs:any;
serialNumber:string;
diplomasAssinadoList:DailyWorkTask[] = [];
showLoader: boolean;
totalDocs:any;
serialNumber:string;
segment:string;
segment:string;
skeletonLoader = true
skeletonLoader = true
constructor(
private processes:ProcessesService,
private router: Router,
private activatedRoute: ActivatedRoute,
constructor(
private processes:ProcessesService,
private router: Router,
private activatedRoute: ActivatedRoute,
) {
this.diplomasList = [];
}
@@ -32,7 +32,6 @@ ion-menu{
}
.upper-content{
padding-left: 50px;
overflow: auto;
font-size: 18px;
.content-location{
@@ -96,7 +96,6 @@ ion-button{
.upper-content{
font-family: Roboto;
margin-left: 41px;
overflow: auto;
font-size: 18px;
.label{
@@ -96,7 +96,6 @@ ion-button{
.upper-content{
font-family: Roboto;
margin-left: 41px;
overflow: auto;
font-size: 18px;
.label{
@@ -154,7 +154,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
}
const pathname = window.location.pathname
this.router.events.forEach((event) => {
if(event instanceof NavigationEnd && event.url == pathname) {
@@ -266,7 +266,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
}
getCustomDate(thedate: Date){
return (thedate.getDay()+1) + "/" +
return thedate.getDate() + "/" +
(thedate.getMonth()+1) + "/" +
thedate.getFullYear();
}
+2 -2
View File
@@ -33,7 +33,7 @@
</div>
</div>
<div class="main-content height-100" *ngIf="setPin || hasSession && loginPreference == 'pin' ">
<!-- <div class="main-content height-100" *ngIf="setPin || hasSession && loginPreference == 'pin' ">
<div class=" align-center justify-center">
<div class="div-top-header">
@@ -80,7 +80,7 @@
</div>
</div>
</div>
</div> -->
</div>
+8 -4
View File
@@ -117,7 +117,7 @@ export class LoginPage implements OnInit {
async Login() {
if (this.validateUsername()) {
if(this.validatePassword()){
if(this.validatePassword()) {
this.userattempt = {
username: this.username,
@@ -134,10 +134,14 @@ export class LoginPage implements OnInit {
this.hasPin = false
this.setPin = true
if(!this.hasPin || this.hasPin) {
} else {
// if(!this.hasPin || this.hasPin) {
// } else {
// this.router.navigate(['/home/events']);
// }
this.code = ['1','1','1','1']
this.storePin()
this.router.navigate(['/home/events']);
}
}
}
else {
+1 -2
View File
@@ -1,7 +1,6 @@
import { Component, OnInit } from '@angular/core';
import { ModalController, NavParams } from '@ionic/angular';
import { SearchService } from "../../services/search.service";
import { SearchCategory } from "src/app/models/search-category";
import { formatDate } from '@angular/common';
import { SenderPage } from 'src/app/pages/search/sender/sender.page';
import { OrganicEntityPage } from 'src/app/pages/search/organic-entity/organic-entity.page';
@@ -9,7 +8,7 @@ import WordCloud from 'src/plugin/wordcloud2.js';
import { ViewEventPage } from 'src/app/pages/agenda/view-event/view-event.page';
import { PublicationDetailPage } from '../publications/view-publications/publication-detail/publication-detail.page';
import { DocumentDetailPage } from 'src/app/modals/document-detail/document-detail.page';
import { SearchList } from 'src/app/models/search-document';
import { SearchCategory, SearchList } from 'src/app/models/search-document';
@Component({
selector: 'app-search',
+15
View File
@@ -2,6 +2,8 @@ import { Injectable } from '@angular/core';
import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page';
import { AnimationController, ModalController, NavParams, PopoverController } from '@ionic/angular';
import { ExpedientTaskModalPage } from 'src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page';
import { CreateProcessPage } from '../modals/create-process/create-process.page';
@Injectable({
providedIn: 'root'
@@ -36,5 +38,18 @@ export class ModalService {
});
}
CreateProcessPage(e:CreateProcessPageComponentProps, { cssClass ="", backdropDismiss = false }) {
return this.modalController.create({
component: CreateProcessPage,
componentProps: {
taskAction: e.taskAction,
task: e.fulltask,
fulltask: e.fulltask
},
cssClass,
});
}
}
-1
View File
@@ -1,6 +1,5 @@
import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
import { DailyWorkTask } from '../models/dailyworktask.model';
import { AuthService } from '../services/auth.service';
import { User } from '../models/user.model';
import { environment } from 'src/environments/environment';
@@ -97,7 +97,6 @@ ion-content{
width: calc(100%-50px);
margin-left: 50px;
font-size: 18px;
overflow: auto;
.content-location{
width: 100%;