This commit is contained in:
Eudes Inácio
2021-06-02 13:59:00 +01:00
284 changed files with 13634 additions and 2806 deletions
+1
View File
@@ -23,6 +23,7 @@
<platform name="android">
<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application" xmlns:android="http://schemas.android.com/apk/res/android">
<application android:networkSecurityConfig="@xml/network_security_config" />
<application android:requestLegacyExternalStorage="true" />
</edit-config>
<resource-file src="resources/android/xml/network_security_config.xml" target="app/src/main/res/xml/network_security_config.xml" />
<allow-intent href="market:*" />
+47 -18
View File
@@ -2111,6 +2111,11 @@
"@types/cordova": "^0.0.34"
}
},
"@ionic-native/fingerprint-aio": {
"version": "4.20.0",
"resolved": "https://registry.npmjs.org/@ionic-native/fingerprint-aio/-/fingerprint-aio-4.20.0.tgz",
"integrity": "sha512-DhdXVG7gdBtCwYHDAsNazIcMlyt6X968ilA/5Rt8uFd+xN4Un5gZteOJCVn9xWDC/ZqhO/QAq2M0BIGyEhzW0g=="
},
"@ionic-native/http": {
"version": "5.31.1",
"resolved": "https://registry.npmjs.org/@ionic-native/http/-/http-5.31.1.tgz",
@@ -4570,16 +4575,30 @@
}
},
"browserslist": {
"version": "4.16.3",
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.3.tgz",
"integrity": "sha512-vIyhWmIkULaq04Gt93txdh+j02yX/JzlyhLYbV3YQCn/zvES3JnY7TifHHvvr1w5hTDluNKMkV05cs4vy8Q7sw==",
"version": "4.16.6",
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.6.tgz",
"integrity": "sha512-Wspk/PqO+4W9qp5iUTJsa1B/QrYn1keNCcEP5OvP7WBwT4KaDly0uONYmC6Xa3Z5IqnUgS0KcgLYu1l74x0ZXQ==",
"dev": true,
"requires": {
"caniuse-lite": "^1.0.30001181",
"colorette": "^1.2.1",
"electron-to-chromium": "^1.3.649",
"caniuse-lite": "^1.0.30001219",
"colorette": "^1.2.2",
"electron-to-chromium": "^1.3.723",
"escalade": "^3.1.1",
"node-releases": "^1.1.70"
"node-releases": "^1.1.71"
},
"dependencies": {
"caniuse-lite": {
"version": "1.0.30001230",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001230.tgz",
"integrity": "sha512-5yBd5nWCBS+jWKTcHOzXwo5xzcj4ePE/yjtkZyUV1BTUmrBaA9MRGC+e7mxnqXSA90CmCA8L3eKLaSUkt099IQ==",
"dev": true
},
"colorette": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/colorette/-/colorette-1.2.2.tgz",
"integrity": "sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==",
"dev": true
}
}
},
"browserstack": {
@@ -5833,6 +5852,12 @@
"resolved": "https://registry.npmjs.org/cordova-plugin-filepath/-/cordova-plugin-filepath-1.5.8.tgz",
"integrity": "sha512-DhMVM9lkndPWQ+lI8Um0Yq648MBKWpNe/3PW057g4wuFrnAz/9nR8Qs4bjYt/yxwxMX/VMZC59qXOcksd2JYuw=="
},
"cordova-plugin-fingerprint-aio": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/cordova-plugin-fingerprint-aio/-/cordova-plugin-fingerprint-aio-4.0.2.tgz",
"integrity": "sha512-Mmm/Ee85s4JH7qL3yikQ2J2I2vY2XbNi1fttoEK2kI++YHr/WeqPHWGREFL7bmFYjZTph/JovhfWHPGV924WjQ==",
"dev": true
},
"cordova-plugin-globalization": {
"version": "1.11.0",
"resolved": "https://registry.npmjs.org/cordova-plugin-globalization/-/cordova-plugin-globalization-1.11.0.tgz",
@@ -7635,6 +7660,11 @@
"randomfill": "^1.0.3"
}
},
"crypto-js": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.0.0.tgz",
"integrity": "sha512-bzHZN8Pn+gS7DQA6n+iUmBfl0hO5DJq++QP3U6uTucDtk/0iGpXd/Gg7CGR0p8tJhofJyaKoWBuJI4eAO00BBg=="
},
"css": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/css/-/css-3.0.0.tgz",
@@ -8396,9 +8426,9 @@
"dev": true
},
"dns-packet": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-1.3.1.tgz",
"integrity": "sha512-0UxfQkMhYAUaZI+xrNZOz/as5KgDU0M/fQ9b6SpkyLbk3GEswDi6PADJVaYJradtRVsRIlF1zLyOodbcTCDzUg==",
"version": "1.3.4",
"resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-1.3.4.tgz",
"integrity": "sha512-BQ6F4vycLXBvdrJZ6S3gZewt6rcrks9KBgM9vrhW+knGRqc8uEdT7fuCwloc7nny5xNoMJ17HGH0R/6fpo8ECA==",
"dev": true,
"requires": {
"ip": "^1.1.0",
@@ -8513,9 +8543,9 @@
"dev": true
},
"electron-to-chromium": {
"version": "1.3.672",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.672.tgz",
"integrity": "sha512-gFQe7HBb0lbOMqK2GAS5/1F+B0IMdYiAgB9OT/w1F4M7lgJK2aNOMNOM622aEax+nS1cTMytkiT0uMOkbtFmHw==",
"version": "1.3.741",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.741.tgz",
"integrity": "sha512-4i3T0cwnHo1O4Mnp9JniEco8bZiXoqbm3PhW5hv7uu8YLg35iajYrRnNyKFaN8/8SSTskU2hYqVTeYVPceSpUA==",
"dev": true
},
"elementtree": {
@@ -12541,9 +12571,9 @@
}
},
"node-releases": {
"version": "1.1.70",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.70.tgz",
"integrity": "sha512-Slf2s69+2/uAD79pVVQo8uSiC34+g8GWY8UH2Qtqv34ZfhYrxpYpfzs9Js9d6O0mbDmALuxaTlplnBTnSELcrw==",
"version": "1.1.72",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.72.tgz",
"integrity": "sha512-LLUo+PpH3dU6XizX3iVoubUNheF/owjXCZZ5yACDxNnPtgFuludV1ZL3ayK1kVep42Rmm0+R9/Y60NQbZ2bifw==",
"dev": true
},
"noop-logger": {
@@ -18849,8 +18879,7 @@
},
"ssri": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.1.tgz",
"integrity": "sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA==",
"resolved": "",
"dev": true,
"requires": {
"figgy-pudding": "^3.5.1"
+5 -1
View File
@@ -30,6 +30,7 @@
"@ionic-native/core": "^5.0.7",
"@ionic-native/file": "^5.30.0",
"@ionic-native/file-path": "^5.30.0",
"@ionic-native/fingerprint-aio": "^4.20.0",
"@ionic-native/http": "^5.31.1",
"@ionic-native/in-app-browser": "^5.28.0",
"@ionic-native/ionic-webview": "^5.30.0",
@@ -49,6 +50,7 @@
"cordova-plugin-okhttp": "^2.0.0",
"cordova-res": "^0.15.3",
"cordova-sqlite-storage": "^5.1.0",
"crypto-js": "^4.0.0",
"date-fns": "^2.17.0",
"ionic-angular": "^3.9.10",
"ionic-selectable": "^4.7.1",
@@ -88,6 +90,7 @@
"cordova-plugin-dialogs": "^2.0.2",
"cordova-plugin-fcm-with-dependecy-updated": "^7.2.0",
"cordova-plugin-file": "^6.0.2",
"cordova-plugin-fingerprint-aio": "^4.0.2",
"cordova-plugin-globalization": "^1.11.0",
"cordova-plugin-inappbrowser": "^4.0.0",
"cordova-plugin-ionic-keyboard": "^2.2.0",
@@ -132,7 +135,8 @@
"ANDROID_GRADLE_TOOLS_VERSION": "3.5.3",
"ANDROID_GOOGLE_SERVICES_VERSION": "4.3.3",
"ANDROID_DEFAULT_NOTIFICATION_ICON": "@mipmap/ic_launcher"
}
},
"cordova-plugin-fingerprint-aio": {}
},
"platforms": [
"browser",
+60 -27
View File
@@ -1,17 +1,18 @@
import { NgModule } from '@angular/core';
import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
import { ChatPage } from './pages/chat/chat.page';
import { MessagesPage } from './pages/chat/messages/messages.page';
const routes: Routes = [
{
path: '',
loadChildren: () => import('./index/index.module').then(m => m.IndexPageModule)
},
{
path: '',
loadChildren: () => import('./home/home.module').then( m => m.HomePageModule)
},
import { NgModule } from '@angular/core';
import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
import { ChatPage } from './pages/chat/chat.page';
import { MessagesPage } from './pages/chat/messages/messages.page';
const routes: Routes = [
{
path: '',
loadChildren: () => import('./index/index.module').then(m => m.IndexPageModule)
},
{
path: '',
loadChildren: () => import('./home/home.module').then( m => m.HomePageModule)
},
{
path: 'empty-chat',
loadChildren: () => import('./shared/chat/empty-chat/empty-chat.module').then( m => m.EmptyChatPageModule)
},
@@ -47,6 +48,10 @@ const routes: Routes = [
path: 'pedidos',
loadChildren: () => import('./shared/gabinete-digital/pedidos/pedidos.module').then( m => m.PedidosPageModule)
},
{
path: 'event-list',
loadChildren: () => import('./pages/gabinete-digital/event-list/event-list.module').then(m =>m.EventListPageModule)
},
{
path: 'despachos',
loadChildren: () => import('./shared/gabinete-digital/despachos/despachos.module').then( m => m.DespachosPageModule)
@@ -87,17 +92,45 @@ const routes: Routes = [
path: 'expedientes-pr',
loadChildren: () => import('./shared/gabinete-digital/expedientes-pr/expedientes-pr.module').then( m => m.ExpedientesPrPageModule)
},
{
path: 'diplomas-assinar',
loadChildren: () => import('./shared/gabinete-digital/diplomas-assinar/diplomas-assinar.module').then( m => m.DiplomasAssinarPageModule)
},
{
path: 'opts-expediente-pr',
loadChildren: () => import('./shared/popover/opts-expediente-pr/opts-expediente-pr.module').then( m => m.OptsExpedientePrPageModule)
},
{
path: 'despachos-options',
loadChildren: () => import('./shared/popover/despachos-options/despachos-options.module').then( m => m.DespachosOptionsPageModule)
},
{
path: 'despachos-pr-options',
loadChildren: () => import('./shared/popover/despachos-pr-options/despachos-pr-options.module').then( m => m.DespachosPrOptionsPageModule)
},
{
path: 'deploma-options',
loadChildren: () => import('./shared/popover/deploma-options/deploma-options.module').then( m => m.DeplomaOptionsPageModule)
},
{
path: 'pin',
loadChildren: () => import('./shared/pin/pin.module').then( m => m.PinPageModule)
},
{
path: 'fingerprint',
loadChildren: () => import('./shared/fingerprint/fingerprint.module').then( m => m.FingerprintPageModule)
},
/* {
path: 'chat',
component: ChatPage
} */
];
@NgModule({
imports: [
RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })
],
exports: [RouterModule]
})
/* {
path: 'chat',
component: ChatPage
} */
];
@NgModule({
imports: [
RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })
],
exports: [RouterModule]
})
export class AppRoutingModule {}
+28
View File
@@ -0,0 +1,28 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { HeaderPage } from '../shared/header/header.page';
import { BtnSeguintePage } from '../shared/btn-seguinte/btn-seguinte.page';
import { BtnModalDismissPage } from '../shared/btn-modal-dismiss/btn-modal-dismiss.page';
import { EmptyChatPage } from '../shared/chat/empty-chat/empty-chat.page';
import { BtnCriarPage } from '../shared/buttons/btn-criar/btn-criar.page';
import { BtnAdicionarPage } from '../shared/buttons/btn-adicionar/btn-adicionar.page';
import { HeaderNoSearchPage } from '../shared/headers/header-no-search/header-no-search.page';
@NgModule({
declarations: [],
exports: [
HeaderPage,
HeaderNoSearchPage,
BtnSeguintePage,
BtnModalDismissPage,
EmptyChatPage,
BtnCriarPage,
BtnAdicionarPage,
],
imports: [
CommonModule
]
})
export class ComponentsModule { }
+5 -1
View File
@@ -120,7 +120,7 @@ const routes: Routes = [
{
path:'expediente-task-modal',
loadChildren: ()=> import('../pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.module').then(m => m.ExpedientTaskModalPageModule),
}
},
]
},
{
@@ -186,6 +186,10 @@ const routes: Routes = [
path:'new-publication',
loadChildren: ()=> import('../shared/publication/new-publication/new-publication.module').then(m => m.NewPublicationPageModule)
},
{
path: 'request-options',
loadChildren: () => import('../shared/popover/request-options/request-options.module').then( m => m.RequestOptionsPageModule)
},
]
},
{
+2 -1
View File
@@ -9,6 +9,7 @@ import { HomePageRoutingModule } from './home-routing.module';
import { HomePage } from './home.page';
/* import { IonicSelectableModule } from 'ionic-selectable'; */
import { SharedModule } from 'src/app/shared/shared.module';
import { ComponentsModule } from '../components/components.module';
@NgModule({
imports: [
@@ -16,7 +17,7 @@ import { SharedModule } from 'src/app/shared/shared.module';
FormsModule,
IonicModule,
HomePageRoutingModule,
SharedModule
ComponentsModule
],
declarations: [HomePage]
})
+38 -1
View File
@@ -2,6 +2,8 @@ import { Component, OnInit } from '@angular/core';
import { ModalController } from '@ionic/angular';
import { SearchDocument } from 'src/app/models/search-document';
import { SearchPage } from 'src/app/pages/search/search.page';
import { BadRequestComponent } from 'src/app/shared/popover/bad-request/bad-request.component';
import { SuccessMessageComponent } from 'src/app/shared/popover/success-message/success-message.component';
@Component({
selector: 'app-add-note',
@@ -32,7 +34,8 @@ export class AddNotePage implements OnInit {
this.modalController.dismiss(body);
}
async getDoc(){
async getDoc() {
const modal = await this.modalController.create({
component: SearchPage,
cssClass: 'modal-width-100-width-background modal',
@@ -49,12 +52,46 @@ export class AddNotePage implements OnInit {
this.documents.push(data.selected);
}
});
}
removeAttachment(index: number){
this.documents = this.documents.filter( (e, i) => index != i);
}
async successMessage(message?: string) {
const modal = await this.modalController.create({
component: SuccessMessageComponent,
componentProps: {
message: message || 'Processo efetuado' ,
},
cssClass: 'modal modal-desktop'
});
modal.present()
setTimeout(()=>{
modal.dismiss()
},3000)
}
async badRequest(message?: string) {
const modal = await this.modalController.create({
component: BadRequestComponent,
componentProps: {
message: message || 'Processo não efetuado' ,
},
cssClass: 'modal modal-desktop'
});
modal.present()
setTimeout(()=>{
modal.dismiss()
},3000)
}
}
@@ -133,6 +133,7 @@
</app-empty-container>
<app-attendee-modal
*ngIf="showAttendees"
[footer]="false"
class="d-flex flex-column height-100"
[adding]="adding"
[taskParticipants]="taskParticipants"
@@ -16,6 +16,9 @@ import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discar
import { ExpedienteDetailPage } from 'src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page';
import { SearchDocument } from 'src/app/models/search-document';
import { SearchPage } from 'src/app/pages/search/search.page';
import { BadRequestComponent } from 'src/app/shared/popover/bad-request/bad-request.component';
import { SuccessMessageComponent } from 'src/app/shared/popover/success-message/success-message.component';
import { User } from 'src/app/models/user.model';
@Component({
selector: 'app-create-process',
@@ -56,6 +59,8 @@ export class CreateProcessPage implements OnInit {
showEmptyContainer = true;
documents:SearchDocument[] = [];
loggeduser: User;
constructor(
private modalController: ModalController,
@@ -64,7 +69,10 @@ export class CreateProcessPage implements OnInit {
private attachmentsService: AttachmentsService,
private navParams: NavParams,
private alertController: AlertService,
private authService: AuthService) {
private authService: AuthService,
private userAuth: AuthService,
) {
this.loggeduser = userAuth.ValidatedUser;
this.user = environment.defaultuser +'@'+ environment.domain;
this.task = this.navParams.get('task');
@@ -78,11 +86,12 @@ export class CreateProcessPage implements OnInit {
Nad: 30,
Subject: '',
Message: '',
SourceSecFsId: this.task.workflowInstanceDataFields.FsId, //361
SourceSecFsId: this.task.workflowInstanceDataFields.SourceSecFsID, //361
SourceType: 'DOC', //FOLDER
SourceId: this.task.workflowInstanceDataFields.DocId, //FolderId
SourceId: this.task.workflowInstanceDataFields.SourceID, //FolderId
DeadlineType: '',
SubjectTypes: ['99999844'],
NumberPDPP: this.task.workflowInstanceDataFields.DispatchNumber,
};
@@ -100,23 +109,12 @@ export class CreateProcessPage implements OnInit {
}
ngOnInit() {
this.taskDate = new Date(this.task.taskStartDate);
if(!this.task.hasOwnProperty('isEvent')) {
// if not
this.getAttachments();
}
this.getSubjectType();
console.log('CHEGOU');
}
close(){
this.router.navigate(['/home/gabinete-digital/expediente']);
//this.router.navigate(['/home/gabinete-digital/expediente']);
this.modalController.dismiss(null);
}
@@ -130,7 +128,7 @@ export class CreateProcessPage implements OnInit {
this.modalController.dismiss(null);
}
saveTask(){
async saveTask(){
if(this.postData.Priority=='99999861'){
this.dispatchFolder.DeadlineType = 'Normal';
@@ -161,79 +159,171 @@ export class CreateProcessPage implements OnInit {
});
this.dispatchFolder.SubjectTypes = this.selectedTypes;
switch (this.loggeduser.Profile) {
case 'MDGPR':
if(this.taskParticipants.length > 0) {
switch (this.taskType) {
case '0':
this.postData = {
DistributionType: "Paralelo",
CountryCode: 'AO',
Priority: this.postData.Priority,
UserEmail: this.user,
UsersSelected: attendees,
DispatchFolder: this.dispatchFolder,
}
console.log('this.postData', this.postData, this.taskType);
try {
await this.processes.postDespatcho(this.postData).toPromise()
this.successMessage()
} catch (error) {
this.badRequest()
}
break;
case '1':
this.postData = {
DistributionType: "Paralelo",
CountryCode: 'AO',
Priority: this.postData.Priority,
UserEmail: this.user,
UsersSelected: attendees,
DispatchFolder: this.dispatchFolder,
}
console.log(this.postData);
await this.processes.postParecer(this.postData).toPromise()
try {
await this.processes.postParecer(this.postData).toPromise()
this.successMessage()
} catch (error) {
this.badRequest()
}
break;
case '2':
this.postData = {
DistributionType: "Paralelo",
CountryCode: 'AO',
Priority: this.postData.Priority,
UserEmail: this.user,
UsersSelected: attendees,
DispatchFolder: this.dispatchFolder,
}
console.log(this.postData);
try {
await this.processes.postDeferimento(this.postData).toPromise()
this.successMessage()
} catch (error) {
this.badRequest()
}
break;
}
this.executado();
this.modalController.dismiss();
}
else {
this.alertController.presentAlert("Lista de intervenientes vazia. Por favor, adicione 1 ou mais intervenientes.");
}
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,
}
console.log('this.postData', this.postData, this.taskType);
try {
await this.processes.postDespatcho(this.postData).toPromise()
this.successMessage()
} catch (error) {
this.badRequest()
}
break;
case '1':
this.postData = {
DistributionType: "Paralelo",
CountryCode: 'AO',
Priority: this.postData.Priority,
UserEmail: this.user,
UsersSelected: attendees,
DispatchFolder: this.dispatchFolder,
}
console.log(this.postData);
await this.processes.postParecer(this.postData).toPromise()
try {
await this.processes.postParecer(this.postData).toPromise()
this.successMessage()
} catch (error) {
this.badRequest()
}
break;
case '2':
this.postData = {
DistributionType: "Paralelo",
CountryCode: 'AO',
Priority: this.postData.Priority,
UserEmail: this.user,
UsersSelected: attendees,
DispatchFolder: this.dispatchFolder,
}
console.log(this.postData);
try {
await this.processes.postDeferimento(this.postData).toPromise()
this.successMessage()
} catch (error) {
this.badRequest()
}
break;
}
this.executado();
this.modalController.dismiss();
break;
}
if(this.taskParticipants.length > 0) {
switch (this.taskType) {
case '0':
this.postData = {
DistributionType: "Paralelo",
CountryCode: 'AO',
Priority: this.postData.Priority,
UserEmail: this.user,
UsersSelected: attendees,
DispatchFolder: this.dispatchFolder,
}
console.log('this.postData', this.postData, this.taskType);
this.processes.postDespatcho(this.postData);
break;
case '1':
this.postData = {
DistributionType: "Paralelo",
CountryCode: 'AO',
Priority: this.postData.Priority,
UserEmail: this.user,
UsersSelected: attendees,
DispatchFolder: this.dispatchFolder,
}
console.log(this.postData);
this.processes.postParecer(this.postData);
break;
case '2':
this.postData = {
DistributionType: "Paralelo",
CountryCode: 'AO',
Priority: this.postData.Priority,
UserEmail: this.user,
UsersSelected: attendees,
DispatchFolder: this.dispatchFolder,
}
console.log(this.postData);
this.processes.postDeferimento(this.postData);
break;
}
this.executado();
this.modalController.dismiss();
}
else {
this.alertController.presentAlert("Lista de intervenientes vazia. Por favor, adicione 1 ou mais intervenientes.");
}
}
executado(){
async executado(){
let body = {
"serialNumber": this.task.serialNumber,
"action": "Conhecimento",
"ActionTypeId": 104,
"dataFields": {
"ReviewUserComent": '',
"ReviewUserComment": '',
},
"AttachmentList" :null,
}
this.processes.CompleteTask(body);
}
try {
await this.processes.CompleteTask(body).toPromise()
this.successMessage()
} catch (error) {
this.badRequest()
}
getAttachments() {
this.attachmentsService.getAttachmentsBySerial(this.task.serialNumber).subscribe(res=>{
this.loadedAttachments = res;
console.log(res);
});
}
async addParticipants() {
/* console.log('HERES'); */
this.adding = "intervenient";
this.contacts = this.taskParticipants;
@@ -412,4 +502,39 @@ export class CreateProcessPage implements OnInit {
}
async successMessage(message?: string) {
const modal = await this.modalController.create({
component: SuccessMessageComponent,
componentProps: {
message: message || 'Processo efetuado' ,
},
cssClass: 'modal modal-desktop'
});
modal.present()
setTimeout(()=>{
modal.dismiss()
},3000)
}
async badRequest(message?: string) {
const modal = await this.modalController.create({
component: BadRequestComponent,
componentProps: {
message: message || 'Processo não efetuado' ,
},
cssClass: 'modal modal-desktop'
});
modal.present()
setTimeout(()=>{
modal.dismiss()
},3000)
}
}
+52 -6
View File
@@ -3,6 +3,8 @@ import { ModalController, NavParams } from '@ionic/angular';
import { SearchDocument } from 'src/app/models/search-document';
import { SearchPage } from 'src/app/pages/search/search.page';
import { ProcessesService } from 'src/app/services/processes.service';
import { BadRequestComponent } from 'src/app/shared/popover/bad-request/bad-request.component';
import { SuccessMessageComponent } from 'src/app/shared/popover/success-message/success-message.component';
@Component({
selector: 'app-dar-parecer',
@@ -34,7 +36,8 @@ export class DarParecerPage implements OnInit {
this.modalController.dismiss();
}
save(){
async save() {
const DocumentToSave = this.documents.map((e) => {
return {
ApplicationId: e.ApplicationType,
@@ -43,23 +46,30 @@ export class DarParecerPage implements OnInit {
});
let docs = {
ProcessInstanceID: this.instanceId,
ProcessInstanceID: "",
Attachments: DocumentToSave,
}
let body = {
"serialNumber": this.serialNumber,
"action": "Registar",
"ActionTypeId": 104,
"dataFields": {
"ReviewUserComent": this.note,
"ReviewUserComment": this.note,
},
"AttachmentList": docs,
}
console.log(body);
this.processes.CompleteTask(body);
this.modalController.dismiss();
try {
await this.processes.CompleteTask(body).toPromise()
this.modalController.dismiss();
this.successMessage()
} catch (error) {
this.badRequest()
}
}
removeAttachment(index: number){
@@ -84,4 +94,40 @@ export class DarParecerPage implements OnInit {
}
});
}
async successMessage(message?: string) {
const modal = await this.modalController.create({
component: SuccessMessageComponent,
componentProps: {
message: message || 'Processo efetuado' ,
},
cssClass: 'modal modal-desktop'
});
modal.present()
setTimeout(()=>{
modal.dismiss()
},3000)
}
async badRequest() {
const modal = await this.modalController.create({
component: BadRequestComponent,
componentProps: {
message: 'hello',
},
cssClass: 'modal modal-desktop'
});
modal.present()
setTimeout(()=>{
modal.dismiss()
},1000)
}
}
+1
View File
@@ -71,6 +71,7 @@
<div class="aside-righ flex-grow-1">
<app-attendee-modal class=" d-flex flex-column height-100"
[footer]="false"
*ngIf="showAttendees"
[taskParticipants]="taskParticipants"
[taskParticipantsCc]="taskParticipantsCc"
+40
View File
@@ -11,6 +11,8 @@ import { AddParticipantsModalPage } from 'src/app/pages/gabinete-digital/expedie
import { AddParticipantsCcModalPage } from 'src/app/pages/gabinete-digital/expediente/add-participants-cc-modal/add-participants-cc-modal.page';
import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discart-expedient-modal/discart-expedient-modal.page';
import { AlertService } from 'src/app/services/alert.service';
import { BadRequestComponent } from 'src/app/shared/popover/bad-request/bad-request.component';
import { SuccessMessageComponent } from 'src/app/shared/popover/success-message/success-message.component';
@Component({
selector: 'app-delegar',
@@ -93,6 +95,10 @@ export class DelegarPage implements OnInit {
console.log(body);
this.processes.DelegateTask(body).subscribe(res=>{
console.log(res);
this.successMessage('Processo delegado')
},
(error)=>{
this.badRequest()
});
this.close();
}
@@ -164,4 +170,38 @@ export class DelegarPage implements OnInit {
this.taskParticipants = taskParticipants;
}
async successMessage(message?: string) {
const modal = await this.modalController.create({
component: SuccessMessageComponent,
componentProps: {
message: message || 'Processo efetuado' ,
},
cssClass: 'modal modal-desktop'
});
modal.present()
setTimeout(()=>{
modal.dismiss()
},3000)
}
async badRequest(message?: string) {
const modal = await this.modalController.create({
component: BadRequestComponent,
componentProps: {
message: message || 'Processo não efetuado' ,
},
cssClass: 'modal modal-desktop'
});
modal.present()
setTimeout(()=>{
modal.dismiss()
},3000)
}
}
@@ -8,13 +8,14 @@ import { DocumentDetailPageRoutingModule } from './document-detail-routing.modul
import { DocumentDetailPage } from './document-detail.page';
import { SharedModule } from 'src/app/shared/shared.module';
import { ComponentsModule } from 'src/app/components/components.module';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
SharedModule,
ComponentsModule,
DocumentDetailPageRoutingModule
],
declarations: [
+3 -1
View File
@@ -7,10 +7,12 @@ export class DailyWorkTask{
Remetente:string;
DocumentsQty:any;
WorkflowName:string;
activityInstanceName: string;
}
export class tasksList{
actions: null;
activityInstanceName: string;
formURL: string;
originator: {
displayName: string,
@@ -38,7 +40,7 @@ export class tasksList{
InstanceID: string,
InstanceIDNew: string,
NewSerialNumber: string,
ReviewUserComent: string,
ReviewUserComment: string,
ReviewUserEmail: string,
ReviewUserName: string,
SourceID: number,
+1
View File
@@ -7,4 +7,5 @@ export class Folder{
SourceId:string;
DeadlineType: string;
SubjectTypes: string[];
NumberPDPP:string;
}
+2 -1
View File
@@ -27,6 +27,7 @@ registerLocaleData(localeDe);
import { CalendarModule, DateAdapter } from 'angular-calendar';
import { adapterFactory } from 'angular-calendar/date-adapters/date-fns';
import { EventsToApprovePage } from 'src/app/shared/gabinete-digital/events-to-approve/events-to-approve.page';
import { ComponentsModule } from 'src/app/components/components.module';
@NgModule({
imports: [
CommonModule,
@@ -37,7 +38,7 @@ import { EventsToApprovePage } from 'src/app/shared/gabinete-digital/events-to-a
provide: DateAdapter,
useFactory: adapterFactory
}),
SharedModule,
ComponentsModule,
AgendaPageRoutingModule,
NgCalendarModule,
CalModalPageModule,
+1
View File
@@ -290,6 +290,7 @@
</app-approve-event>
<app-attendee-modal
[footer]="true"
class="d-flex flex-column height-100"
*ngIf="mobileComponent.showAttendees"
(closeComponent)="GoBackEditOrAdd()"
+6 -6
View File
@@ -170,7 +170,7 @@ export class AgendaPage implements OnInit {
if(this.loggeduser.Profile == 'MDGPR') {
this.mobileComponent.showEventList = true;
}
}
ngOnInit() {
@@ -538,8 +538,8 @@ export class AgendaPage implements OnInit {
//this.eventSource=[];
if(this.loggeduser.Profile == 'MDGPR' ) {
this.eventService.getAllMdEvents( momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59') ).subscribe(
if(this.profile == "mdgpr" && this.loggeduser.Profile == 'MDGPR' ) {
this.eventService.getAllMdEvents( momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59') ).subscribe(
response => {
// calendar
@@ -576,7 +576,7 @@ export class AgendaPage implements OnInit {
this.timelineBoxCorrectHeight(500);
this.centralizeTimeline(500);
});
});
}
else {
@@ -627,7 +627,7 @@ export class AgendaPage implements OnInit {
case "Pessoal":
//Inicializa o array eventSource
if(this.loggeduser.Profile == 'MDGPR') {
if(this.profile == "mdgpr" && this.loggeduser.Profile == 'MDGPR') {
this.eventService.getAllMdEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).subscribe(response => {
this.eventSource=[];
@@ -703,7 +703,7 @@ export class AgendaPage implements OnInit {
//Inicializa o array eventSource
this.eventsListOficial = [];
if(this.loggeduser.Profile == 'MDGPR') {
if(this.profile == "mdgpr" && this.loggeduser.Profile == 'MDGPR') {
this.eventService.getAllMdEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).subscribe(res => {
this.eventSource=[];
this.eventsListOficial = res.filter(data => data.CalendarName == "Oficial");
@@ -5,6 +5,8 @@ import { Event } from 'src/app/models/event.model';
import { AlertService } from 'src/app/services/alert.service';
import { AttachmentsService } from 'src/app/services/attachments.service';
import { ProcessesService } from 'src/app/services/processes.service';
import { BadRequestComponent } from 'src/app/shared/popover/bad-request/bad-request.component';
import { SuccessMessageComponent } from 'src/app/shared/popover/success-message/success-message.component';
import { EmendMessageModalPage } from '../emend-message-modal/emend-message-modal.page';
import { EventActionsPopoverPage } from '../event-actions-popover/event-actions-popover.page';
@@ -69,29 +71,51 @@ export class ApproveEventModalPage implements OnInit {
})
}
approveTask(serialNumber:string){
async approveTask(serialNumber:string){
let body = {
"serialNumber": serialNumber,
"action": "Aprovar"
}
this.processes.PostTaskAction(body);
this.router.navigate(['/home/gabinete-digital/event-list']);
this.modalController.dismiss(null);
try {
await this.processes.PostTaskAction(body).toPromise()
this.router.navigate(['/home/gabinete-digital/event-list']);
this.modalController.dismiss(null);
this.successMessage()
} catch (error) {
this.badRequest()
}
}
emendTask(serialNumber:string){
this.menu.close();
this.openEmendMessageModal(serialNumber);
this.modalController.dismiss(null);
async emendTask(serialNumber:string){
try {
await this.openEmendMessageModal(serialNumber);
this.modalController.dismiss(null);
this.menu.close();
} catch (error) {
}
}
rejectTask(serialNumber:string){
async rejectTask(serialNumber:string){
let body = { "serialNumber": serialNumber, "action": "Rejeitar" }
this.processes.PostTaskAction(body);
this.router.navigate(['/home/gabinete-digital/event-list']);
this.modalController.dismiss(null);
try {
await this.processes.PostTaskAction(body).toPromise()
this.router.navigate(['/home/gabinete-digital/event-list']);
this.modalController.dismiss(null);
this.successMessage()
} catch (error) {
this.badRequest()
}
}
getAttachments(){
this.attachmentsService.getAttachmentsBySerial(this.serialNumber).subscribe(res=>{
this.loadedAttachments = res;
@@ -108,36 +132,79 @@ export class ApproveEventModalPage implements OnInit {
});
return await popover.present();
}
openMenu() {
this.menu.open();
}
async openEmendMessageModal(serialNumber:string) {
const modal = await this.modalController.create({
component: EmendMessageModalPage,
componentProps:{
},
cssClass: 'emend-message-modal',
backdropDismiss: false
});
}
await modal.present();
async openEmendMessageModal(serialNumber:string) {
const modal = await this.modalController.create({
component: EmendMessageModalPage,
componentProps:{
},
cssClass: 'emend-message-modal',
backdropDismiss: false
});
modal.onDidDismiss().then(res => {
if(res.data !== ''){
let body = { "serialNumber": serialNumber,
"action": "Emendar",
"dataFields": {
"ReviewerUseComment": res.data,
}
}
this.processes.PostTaskAction(body);
this.router.navigate(['/home/gabinete-digital/event-list']);
}
else{
//this.alertService.presentAlert('Operação cancelada!');
}
});
}
await modal.present();
modal.onDidDismiss().then(res => {
if(res.data !== '') {
let body = { "serialNumber": serialNumber,
"action": "Emendar",
"dataFields": {
"ReviewerUseComment": res.data,
}
}
try {
this.processes.PostTaskAction(body).toPromise()
this.router.navigate(['/home/gabinete-digital/event-list']);
this.successMessage()
} catch (error) {
this.badRequest()
}
}
else{
//this.alertService.presentAlert('Operação cancelada!');
}
});
}
async successMessage(message?: string) {
const modal = await this.modalController.create({
component: SuccessMessageComponent,
componentProps: {
message: message || 'Processo efetuado' ,
},
cssClass: 'modal modal-desktop'
});
modal.present()
setTimeout(()=>{
modal.dismiss()
},3000)
}
async badRequest(message?: string) {
const modal = await this.modalController.create({
component: BadRequestComponent,
componentProps: {
message: message || 'Processo não efetuado' ,
},
cssClass: 'modal modal-desktop'
});
modal.present()
setTimeout(()=>{
modal.dismiss()
},3000)
}
}
@@ -219,9 +219,11 @@
<app-attendee-modal class="aside-right flex-column height-100 d-none d-md-flex pt-10"
*ngIf="showAttendees"
[footer]="false"
[taskParticipants]="taskParticipants"
[taskParticipantsCc]="taskParticipantsCc"
[adding]="adding"
[footer]="false"
(dynamicSetIntervenient)="dynamicSetIntervenient($event)"
></app-attendee-modal>
@@ -6,6 +6,8 @@ import { EventPerson } from 'src/app/models/eventperson.model';
import { AlertService } from 'src/app/services/alert.service';
import { AttachmentsService } from 'src/app/services/attachments.service';
import { EventsService } from 'src/app/services/events.service';
import { BadRequestComponent } from 'src/app/shared/popover/bad-request/bad-request.component';
import { SuccessMessageComponent } from 'src/app/shared/popover/success-message/success-message.component';
import { Event } from '../../../models/event.model';
import { AttendeesPage } from '../../events/attendees/attendees.page';
import { SearchPage } from '../../search/search.page';
@@ -101,16 +103,27 @@ export class EditEventPage implements OnInit {
this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc)
this.eventsService.editEvent(this.postEvent, 2, 3).subscribe(async () => {
/* const alert = await this.alertController.create({
cssClass: 'my-custom-class',
header: 'Evento actualizado',
buttons: ['OK']
try{
this.eventsService.editEvent(this.postEvent, 2, 3).subscribe(async () => {
/* const alert = await this.alertController.create({
cssClass: 'my-custom-class',
header: 'Evento actualizado',
buttons: ['OK']
});
await alert.present(); */
this.successMessage()
}, error => {
this.badRequest()
});
await alert.present(); */
});
this.isEventEdited = true;
this.modalController.dismiss(this.isEventEdited);
this.isEventEdited = true;
this.modalController.dismiss(this.isEventEdited);
} catch (error) {
this.badRequest()
}
}
async openAttendees() {
@@ -220,4 +233,38 @@ export class EditEventPage implements OnInit {
});
}
async successMessage(message?: string) {
const modal = await this.modalController.create({
component: SuccessMessageComponent,
componentProps: {
message: message || 'Processo efetuado' ,
},
cssClass: 'modal modal-desktop'
});
modal.present()
setTimeout(()=>{
modal.dismiss()
},3000)
}
async badRequest() {
const modal = await this.modalController.create({
component: BadRequestComponent,
componentProps: {
message: 'Processo não realizado com sucesso',
},
cssClass: 'modal modal-desktop'
});
modal.present()
setTimeout(()=>{
modal.dismiss()
},3000)
}
}
@@ -1,15 +1,14 @@
<ion-list>
<ion-item>
<p>
<ion-button class="button-edit-event cursor-pointer" shape="round" (click)="emendarTask()">Adicionar Nota</ion-button>
</p>
<p>
<ion-button class="button-approve cursor-pointer" shape="round" (click)="approveTask()">Aprovar</ion-button>
</p>
</ion-item>
<ion-item lines="none">
<p>
<ion-button class="button-discart-event cursor-pointer" shape="round" (click)="deleteTask()">Rejeitar</ion-button>
</p>
</ion-item>
</ion-list>
<ion-content class="container">
<div class="arrow-right" (click)="closePopover()">
<button class="btn-no-color">
<ion-icon slot="end" class="arrow-right-icon" src='assets/images/icons-arrow-arrow-right.svg'></ion-icon>
</button>
</div>
<div class="buttons">
<button class="btn-cancel" shape="round" (click)="emendarTask()">Adicionar Nota</button>
<button class="btn-ok" shape="round" (click)="approveTask()">Aprovar</button>
<div class="solid"></div>
<button class="btn-cancel" shape="round" (click)="editTask()">Editar</button>
<button class="btn-delete" shape="round" (click)="deleteTask()">Rejeitar</button>
</div>
</ion-content>
@@ -1,24 +1,58 @@
.button-edit-event {
/* width: 140px; */
height: 44px;
border-radius: 22.5px;
--background: #e0e9ee;
--color:#061b52;
.container{
--padding-top:20px !important;
--padding-bottom:20px !important;
--padding-start:20px !important;
--padding-end:20px !important;
}
.button-options {
height: 44px;
--color: #42b9fe;
.arrow-right{
display: none;
margin-bottom: 20px;
.arrow-right-icon{
width: 37px;
float: right;
font-size: 35px;
overflow: hidden;
}
}
.button-approve {
/* width: 140px; */
height: 44px;
border-radius: 22.5px;
--background: #42b9fe;
.buttons{
display: flex;
flex-wrap: wrap;
justify-content: space-around;
align-items: center;
}
.button-discart-event {
/* width: 140px; */
height: 44px;
border-radius: 22.5px;
--background: #d30a0a;
--color:#fff;
.solid {
display: none;
width: 90%;
border-top: 5px solid #bbb;
margin: 0 auto !important;
}
.btn-ok, .btn-cancel{
//width: 50% !important;
justify-content: center;
margin-bottom: 10px !important;
margin-top: 10px !important;
}
@media only screen and (max-width: 800px) {
.btn-ok, .btn-cancel, .btn-delete{
width: 47% !important;
}
}
@media only screen and (min-width: 1024px) {
.arrow-right{
display: flex;
justify-content: flex-end;
}
.btn-cancel{
display: none;
width: 100% !important;
margin-bottom: 10px !important;
}
.btn-delete, .btn-ok{
width: 100% !important;
margin-bottom: 10px !important;
margin-top: 10px !important;
}
/* .solid{
display: block;
} */
}
@@ -2,6 +2,9 @@ import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { ModalController, NavParams, PopoverController } from '@ionic/angular';
import { ProcessesService } from 'src/app/services/processes.service';
import { EditEventToApproveComponent } from 'src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page';
import { BadRequestComponent } from 'src/app/shared/popover/bad-request/bad-request.component';
import { SuccessMessageComponent } from 'src/app/shared/popover/success-message/success-message.component';
@Component({
selector: 'app-event-actions-popover',
@@ -9,16 +12,25 @@ import { ProcessesService } from 'src/app/services/processes.service';
styleUrls: ['./event-actions-popover.page.scss'],
})
export class EventActionsPopoverPage implements OnInit {
serialNumber:string;
instanceId: string;
constructor(private navParams: NavParams,
constructor(
private navParams: NavParams,
private processes:ProcessesService,
private router:Router,
private modalController: ModalController,
private popoverController: PopoverController,) {
/* this.serialNumber = this.navParams.get('serialNumber'); */
this.serialNumber = this.navParams.get('serialNumber');
this.instanceId = this.navParams.get('InstanceId');
}
ngOnInit() {
window.onresize = (event) => {
if( window.innerWidth >= 800){
this.popoverController.dismiss();
}
};
}
closePopover(){
this.popoverController.dismiss();
@@ -26,20 +38,92 @@ export class EventActionsPopoverPage implements OnInit {
approveTask(serialNumber:string){
let body = { "serialNumber": serialNumber, "action": "Aprovar" }
console.log(body);
this.processes.PostTaskAction(body);
this.router.navigate(['/home/gabinete-digital/event-list']);
this.modalController.dismiss(null);
try {
this.processes.PostTaskAction(body).toPromise()
this.router.navigate(['/home/gabinete-digital/event-list']);
this.modalController.dismiss(null);
this.successMessage()
} catch (error) {
this.badRequest()
}
}
emendarTask(serialNumber:string){
let body = { "serialNumber": serialNumber, "action": "Rejeitar" }
console.log(body);
this.processes.PostTaskAction(body);
this.router.navigate(['/home/gabinete-digital/event-list']);
this.modalController.dismiss(null);
try {
this.processes.PostTaskAction(body).toPromise()
this.router.navigate(['/home/gabinete-digital/event-list']);
this.modalController.dismiss(null);
this.successMessage()
} catch (error) {
this.badRequest()
}
}
deleteTask(){
}
async editTask() {
console.log(this.serialNumber);
console.log(this.instanceId);
const modal = await this.modalController.create({
component: EditEventToApproveComponent,
componentProps: {
serialNumber: this.serialNumber,
InstanceId: this.instanceId
},
cssClass: 'modal modal-desktop',
// backdropDismiss: false
});
await modal.present();
modal.onDidDismiss().then(res => {
});
}
async successMessage(message?: string) {
const modal = await this.modalController.create({
component: SuccessMessageComponent,
componentProps: {
message: message || 'Processo efetuado' ,
},
cssClass: 'modal modal-desktop'
});
modal.present()
setTimeout(()=>{
modal.dismiss()
},3000)
}
async badRequest(message?: string) {
const modal = await this.modalController.create({
component: BadRequestComponent,
componentProps: {
message: message || 'Processo não efetuado' ,
},
cssClass: 'modal modal-desktop'
});
modal.present()
setTimeout(()=>{
modal.dismiss()
},3000)
}
}
@@ -6,6 +6,8 @@ import { EventPerson } from 'src/app/models/eventperson.model';
import { SearchDocument } from 'src/app/models/search-document';
import { AttachmentsService } from 'src/app/services/attachments.service';
import { EventsService } from 'src/app/services/events.service';
import { BadRequestComponent } from 'src/app/shared/popover/bad-request/bad-request.component';
import { SuccessMessageComponent } from 'src/app/shared/popover/success-message/success-message.component';
import { Event } from '../../../models/event.model';
import { AttendeesPage } from '../../events/attendees/attendees.page';
import { SearchPage } from '../../search/search.page';
@@ -50,7 +52,7 @@ export class NewEventPage implements OnInit {
ngOnInit() {
/* console.log(this.profile); */
/* console.log(this.profile); */
let selectedStartdDate = this.selectedDate;
let selectedEndDate = new Date(this.selectedDate);
@@ -112,6 +114,7 @@ export class NewEventPage implements OnInit {
close(){
this.modalController.dismiss();
}
async save() {
/* console.log(this.postEvent);
console.log(this.profile); */
@@ -121,37 +124,83 @@ export class NewEventPage implements OnInit {
}
let eventId: string;
if(this.profile=='mdgpr'){
eventId = await this.eventService.postEventMd(this.postEvent, this.postEvent.CalendarName).toPromise();
}
else if(this.profile=='pr'){
eventId = await this.eventService.postEventPr(this.postEvent, this.postEvent.CalendarName).toPromise();
try {
if(this.profile=='mdgpr') {
eventId = await this.eventService.postEventMd(this.postEvent, this.postEvent.CalendarName).toPromise();
}
else if(this.profile=='pr'){
eventId = await this.eventService.postEventPr(this.postEvent, this.postEvent.CalendarName).toPromise();
}
const DocumentToSave: EventAttachment[] = this.documents.map((e) => {
return {
SourceTitle: e.Assunto,
ParentId: eventId,
Source: '1',
SourceId: e.Id,
ApplicationId: e.ApplicationType.toString(),
Id: '',
Link: '',
SerialNumber: ''
};
});
await DocumentToSave.forEach( async (attachments, i) => {
try {
await this.attachmentsService.setEventAttachmentById(attachments).toPromise();
} catch(error) {
alert('document error')
}
});
this.successMessage()
this.modalController.dismiss(this.postEvent);
} catch (error) {
this.badRequest()
}
const DocumentToSave: EventAttachment[] = this.documents.map((e) => {
return {
SourceTitle: e.Assunto,
ParentId: eventId,
Source: '1',
SourceId: e.Id,
ApplicationId: e.ApplicationType.toString(),
Id: '',
Link: '',
SerialNumber: ''
};
});
await DocumentToSave.forEach( async (attachments, i) => {
this.attachmentsService.setEventAttachmentById(attachments).toPromise();
});
this.modalController.dismiss(this.postEvent);
}
async successMessage(message?: string) {
const modal = await this.modalController.create({
component: SuccessMessageComponent,
componentProps: {
message: message || 'Processo efetuado' ,
},
cssClass: 'modal modal-desktop'
});
modal.present()
setTimeout(()=>{
modal.dismiss()
},3000)
}
async badRequest() {
const modal = await this.modalController.create({
component: BadRequestComponent,
componentProps: {
message: 'Processo não realizado com sucesso',
},
cssClass: 'modal modal-desktop'
});
modal.present()
setTimeout(()=>{
modal.dismiss()
},3000)
}
async openAttendees() {
@@ -202,7 +251,6 @@ export class NewEventPage implements OnInit {
}
async getDoc(){
const modal = await this.modalController.create({
component: SearchPage,
@@ -227,6 +275,4 @@ export class NewEventPage implements OnInit {
this.documents = this.documents.filter( (e, i) => index != i);
}
}
@@ -8,13 +8,14 @@ import { ViewEventPageRoutingModule } from './view-event-routing.module';
import { ViewEventPage } from './view-event.page';
import { SharedModule } from 'src/app/shared/shared.module';
import { ComponentsModule } from 'src/app/components/components.module';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
SharedModule,
ComponentsModule,
ViewEventPageRoutingModule
],
declarations: [ViewEventPage]
+2 -1
View File
@@ -17,13 +17,14 @@ import { NewGroupPage } from 'src/app/shared/chat/new-group/new-group.page';
import { GroupContactsPage } from 'src/app/shared/chat/group-messages/group-contacts/group-contacts.page';
import { PipesModule } from 'src/app/pipes/pipes.module';
import { EditGroupPage } from 'src/app/shared/chat/edit-group/edit-group.page';
import { ComponentsModule } from 'src/app/components/components.module';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
SharedModule,
ComponentsModule,
PipesModule,
ChatPageRoutingModule,
RouterModule,
+5 -5
View File
@@ -38,16 +38,16 @@
</ion-segment-button>
</ion-segment>
</ion-toolbar>
<div class="overflow-y-auto d-flex flex-wrap">
<div class="overflow-y-auto d-flex flex-wrap flex-grow-1">
<div class="width-100" [ngSwitch]="segment">
<ion-list *ngSwitchCase="'Contactos'">
<ion-item-group>
<ion-item-sliding>
<div class="item width-100" *ngFor="let dm of userDirectMessages">
<div class="item width-100 d-flex" *ngFor="let dm of userDirectMessages">
<div class="item-icon">
<ion-icon class="icon" slot="start" src="assets/images/icons-chat-chat-40.svg"></ion-icon>
</div>
<div (click)="openMessagesPage(dm._id)" class="item-content"><!-- (click)="openMessages(dm)" -->
<div (click)="openMessagesPage(dm._id)" class="item-content flex-grow-1"><!-- (click)="openMessages(dm)" -->
<div class="item-title-time">
<div class="item-title">
<ion-label *ngFor="let user of dm.usernames">
@@ -69,11 +69,11 @@
<ion-list *ngSwitchCase="'Grupos'" >
<ion-item-group>
<ion-item-sliding>
<div *ngFor="let group of allGroups" class="item">
<div *ngFor="let group of allGroups" class="item d-flex">
<div class="item-icon">
<ion-icon class="icon" slot="start" src="assets/images/icons-chat-group-chat-40.svg"></ion-icon>
</div>
<div (click)="openGroupMessagesPage(group._id)" class="item-content">
<div (click)="openGroupMessagesPage(group._id)" class="item-content flex-grow-1">
<div class="item-title-time">
<div class="item-title">
<ion-label>{{group.name.split('-').join(' ')}}</ion-label>
-1
View File
@@ -79,7 +79,6 @@ ion-content{
}
.item-content{
width: 317px;
margin: 0 auto;
float:right
}
.item-title-time{
+6 -17
View File
@@ -294,7 +294,7 @@ sendMsg() {
async selectContact(){
const modal = await this.modalController.create({
component: ContactsPage,
cssClass: 'contacts',
cssClass: 'modal modal-desktop',
});
await modal.present();
modal.onDidDismiss();
@@ -303,7 +303,7 @@ sendMsg() {
async newGroup(){
const modal = await this.modalController.create({
component: NewGroupPage,
cssClass: 'new-group',
cssClass: 'modal modal-desktop',
});
await modal.present();
modal.onDidDismiss();
@@ -312,7 +312,7 @@ sendMsg() {
async editGroup(roomId){
const modal = await this.modalController.create({
component: EditGroupPage,
cssClass: 'edit-group',
cssClass: 'modal modal-desktop',
componentProps: {
roomId: roomId,
},
@@ -327,17 +327,11 @@ sendMsg() {
async openMessagesModal(roomId:any){
this.closeAllDesktopComponents();
let classs;
if( window.innerWidth <= 1024){
classs = 'modal'
} else {
classs = 'chat-mobile-modal-to-Desktop'
}
console.log(roomId);
const modal = await this.modalController.create({
component: MessagesPage,
cssClass: classs,
cssClass: 'modal modal-desktop',
componentProps: {
roomId: roomId,
},
@@ -347,17 +341,12 @@ sendMsg() {
}
async openGroupMessagesModal(roomId:any){
let classs;
if( window.innerWidth <= 1024){
classs = 'modal'
} else {
classs = 'chat-mobile-modal-to-Desktop'
}
console.log(roomId);
const modal = await this.modalController.create({
component: GroupMessagesPage,
cssClass: classs,
cssClass: 'modal modal-desktop',
componentProps: {
roomId: roomId,
},
@@ -8,13 +8,14 @@ import { EditGroupPageRoutingModule } from './edit-group-routing.module';
import { EditGroupPage } from './edit-group.page';
import { SharedModule } from 'src/app/shared/shared.module';
import { ComponentsModule } from 'src/app/components/components.module';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
SharedModule,
ComponentsModule,
EditGroupPageRoutingModule
],
declarations: [EditGroupPage]
@@ -9,13 +9,14 @@ import { GroupContactsPageRoutingModule } from './group-contacts-routing.module'
import { GroupContactsPage } from './group-contacts.page';
import { SharedModule } from 'src/app/shared/shared.module';
import { PipesModule } from 'src/app/pipes/pipes.module';
import { ComponentsModule } from 'src/app/components/components.module';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
SharedModule,
ComponentsModule,
PipesModule,
GroupContactsPageRoutingModule
],
@@ -26,7 +26,6 @@
padding-left: 20px;
}
.title-content{
width: 360px;
margin: 0px auto;
overflow: auto;
padding: 0 !important;
@@ -8,8 +8,8 @@ import { IonicModule } from '@ionic/angular';
import { GroupMessagesPageRoutingModule } from './group-messages-routing.module';
import { GroupMessagesPage } from './group-messages.page';
import { SharedModule } from 'src/app/shared/shared.module';
import { PopoverModule } from 'src/app/shared/popover/chat-popover/popover.modules';
import { ComponentsModule } from 'src/app/components/components.module';
@NgModule({
imports: [
@@ -17,7 +17,7 @@ import { PopoverModule } from 'src/app/shared/popover/chat-popover/popover.modul
BrowserModule,
FormsModule,
IonicModule,
SharedModule,
ComponentsModule,
PopoverModule,
GroupMessagesPageRoutingModule
],
@@ -16,8 +16,6 @@
transform: translate3d(0, 1px, 0);
.header-top{
width: 360px;
margin: 0px auto;
overflow: auto;
padding: 0 !important;
background: #fff;
@@ -36,7 +34,7 @@
}
}
.header-bottom{
width: 310px;
padding-left: 10px;
overflow: auto;
margin: 0 auto;
@@ -129,6 +129,9 @@ export class GroupMessagesPage implements OnInit {
this.chatService.sendMessage(body).subscribe(res=> {
this.getRoomInfo();
},(error) => {
});
this.message = "";
}
@@ -9,13 +9,14 @@ import { ContactsPageRoutingModule } from './contacts-routing.module';
import { ContactsPage } from './contacts.page';
import { SharedModule } from 'src/app/shared/shared.module';
import { PipesModule } from 'src/app/pipes/pipes.module';
import { ComponentsModule } from 'src/app/components/components.module';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
SharedModule,
ComponentsModule,
PipesModule,
ContactsPageRoutingModule
],
@@ -27,7 +27,6 @@
padding-left: 20px;
}
.title-content{
width: 360px;
margin: 0px auto;
overflow: auto;
padding: 0 !important;
@@ -9,15 +9,16 @@ import { MessagesPageRoutingModule } from './messages-routing.module';
import { MessagesPage } from './messages.page';
import { SharedModule } from 'src/app/shared/shared.module';
import { BtnModalDismissPage } from 'src/app/shared/btn-modal-dismiss/btn-modal-dismiss.page';
import { ComponentsModule } from 'src/app/components/components.module';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
SharedModule,
ComponentsModule,
MessagesPageRoutingModule
],
declarations: [MessagesPage, SharedModule]
declarations: [MessagesPage]
})
export class MessagesPageModule {}
@@ -16,7 +16,6 @@
transform: translate3d(0, 1px, 0);
.header-top{
width: 360px;
margin: 0px auto;
overflow: auto;
padding: 0 !important;
@@ -8,13 +8,14 @@ import { ContactsPageRoutingModule } from './contacts-routing.module';
import { ContactsPage } from './contacts.page';
import { SharedModule } from 'src/app/shared/shared.module';
import { ComponentsModule } from 'src/app/components/components.module';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
SharedModule,
ComponentsModule,
ContactsPageRoutingModule
],
declarations: [ContactsPage]
@@ -27,7 +27,6 @@
padding-left: 20px;
}
.title-content{
width: 360px;
margin: 0px auto;
overflow: auto;
padding: 0 !important;
@@ -8,13 +8,14 @@ import { GroupChatPageRoutingModule } from './group-chat-routing.module';
import { GroupChatPage } from './group-chat.page';
import { SharedModule } from 'src/app/shared/shared.module';
import { ComponentsModule } from 'src/app/components/components.module';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
SharedModule,
ComponentsModule,
GroupChatPageRoutingModule
],
declarations: [GroupChatPage]
@@ -8,13 +8,14 @@ import { NewGroupPageRoutingModule } from './new-group-routing.module';
import { NewGroupPage } from './new-group.page';
import { SharedModule } from 'src/app/shared/shared.module';
import { ComponentsModule } from 'src/app/components/components.module';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
SharedModule,
ComponentsModule,
NewGroupPageRoutingModule
],
declarations: [NewGroupPage]
@@ -47,7 +47,6 @@ ion-content{
transform: translate3d(0, 1px, 0);
.title-content{
width: 360px;
margin: 0px auto;
overflow: auto;
padding: 0 !important;
@@ -101,7 +100,6 @@ ion-content{
padding: 15px 20px 0 20px;
.item-container{
width: 360px;
margin: 15px auto;
border: 1px solid #ebebeb;
border-radius: 5px;
@@ -29,7 +29,6 @@ ion-content{
padding-left: 20px;
}
.title-content{
width: 360px;
margin: 0px auto;
overflow: auto;
padding: 0 !important;
@@ -94,7 +94,6 @@ ion-card{
}
.header-content{
width: 360px;
overflow: auto;
margin: 0 auto;
padding-top: 25px;
+2 -1
View File
@@ -8,13 +8,14 @@ import { EventsPageRoutingModule } from './events-routing.module';
import { EventsPage } from './events.page';
import { SharedModule } from 'src/app/shared/shared.module';
import { ComponentsModule } from 'src/app/components/components.module';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
SharedModule,
ComponentsModule,
EventsPageRoutingModule
],
declarations: [EventsPage],
+1 -1
View File
@@ -97,7 +97,7 @@
<div class="content">
<ion-list>
<ion-item class="cursor-pointer" lines="none" *ngFor = "let task of expedientList"
(click)="viewExpedientDetail(task.serialNumber)">
(click)="goToExpediente(task.serialNumber)">
<div class="item-exp d-flex">
<div class="schedule-date">
<div class="time-end">{{task.taskStartDate | date: 'dd-MM-yy'}}</div>
+37 -21
View File
@@ -18,6 +18,7 @@ import { ExpedienteDetailPage } from '../gabinete-digital/expediente/expediente-
import { EventEditPage } from './edit-event/edit-event.component';
import { GabineteDigitalPage } from '../gabinete-digital/gabinete-digital.page';
import { EditEventPage } from '../agenda/edit-event/edit-event.page';
import { User } from 'src/app/models/user.model';
@Component({
selector: 'app-events',
@@ -63,6 +64,8 @@ export class EventsPage implements OnInit {
@Output() openExpedientListPage:EventEmitter<any> = new EventEmitter<any>();
loggeduser: User;
constructor(private eventService: EventsService,
private router: Router,
private storageService:StorageService,
@@ -72,6 +75,9 @@ export class EventsPage implements OnInit {
private processes:ProcessesService,
/* private gabineteService: GabineteDigitalPage, */
private modalController:ModalController) {
this.loggeduser = authService.ValidatedUser;
this.prEventList = null;
// list
@@ -86,10 +92,6 @@ export class EventsPage implements OnInit {
this.profile = "mdgpr";
/* console.log(this.profile); */
/* this.storageService.get(AuthConnstants.USER).then(res=>{
console.log(res);
}); */
this.showGreeting();
this.router.events.forEach((event) => {
@@ -98,10 +100,6 @@ export class EventsPage implements OnInit {
this.LoadList();
}
});
/* this.storageService.get(AuthConnstants.PROFILE).then(res=>{
this.profile = res;
}); */
}
@@ -127,7 +125,7 @@ export class EventsPage implements OnInit {
switch (this.segment)
{
case "Combinada":
if(this.profile == "mdgpr"){
if(this.loggeduser.Profile == 'MDGPR'){
this.eventService.getAllMdEvents(start, end).subscribe(res => {
this.eventsList = res;
@@ -158,7 +156,7 @@ export class EventsPage implements OnInit {
break;
case "Pessoal":
if(this.profile == "mdgpr"){
if(this.loggeduser.Profile == 'MDGPR'){
this.eventService.getAllMdEvents(start, end).subscribe(res => {
this.personaleventsList = res.filter(data => data.CalendarName == "Pessoal");
this.showLoader = false;
@@ -172,7 +170,7 @@ export class EventsPage implements OnInit {
break;
case "Oficial":
if(this.profile == "mdgpr"){
if(this.loggeduser.Profile == 'MDGPR'){
this.eventService.getAllMdEvents(start, end).subscribe(res => {
this.officialeventsList = res.filter(data => data.CalendarName == "Oficial");;
this.showLoader = false;
@@ -249,10 +247,24 @@ export class EventsPage implements OnInit {
}
LoadList(){
this.processes.GetTasksList("Expediente", false).subscribe(result => {
this.expedientList = result.reverse();
console.log(this.expedientList);
});
switch (this.loggeduser.Profile) {
case 'MDGPR':
this.processes.GetTasksList("Expediente", false).subscribe(result => {
this.expedientList = result.reverse();
console.log(this.expedientList);
});
break;
case 'PR':
this.processes.GetTasksList("Expediente do Presidente", false).subscribe(result => {
this.expedientList = result.reverse();
console.log(this.expedientList);
});
break;
default:
break;
}
}
sortArrayISODate(myArray: any){
@@ -314,6 +326,15 @@ export class EventsPage implements OnInit {
});
}
goToExpediente(serialNumber:any){
let navigationExtras: NavigationExtras = {
queryParams: {
"serialNumber": serialNumber,
}
};
this.router.navigate(['/home/gabinete-digital/expediente/expediente-detail'], navigationExtras);
}
async viewExpedientDetail(serialNumber:any) {
let classs;
if( window.innerWidth <= 800){
@@ -344,12 +365,7 @@ export class EventsPage implements OnInit {
this.openExpedientList();
}
else{
console.log('ttt');
let navigationExtras: NavigationExtras = {
queryParams: {
"show": true,
}
};
let navigationExtras: NavigationExtras = { queryParams: {"expedientes": true,} };
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
}
}
@@ -195,7 +195,7 @@
</div>
<div hidden class="ion-item-container-no-border">
<ion-label>
<ion-label class="cursor-pointer">
<div class="attach-icon">
<ion-icon src="assets/images/icons-attach-doc.svg"></ion-icon>
</div>
@@ -210,7 +210,7 @@
<ion-label>Documentos Anexados</ion-label>
</ion-item>
<ion-list>
<ion-item>
<ion-item class="cursor-pointer">
<ion-label>
<h4 class="attach-title-item">Text</h4>
<p><span class="span-left">Text</span><span class="span-right"> Text </span></p>
@@ -7,12 +7,15 @@ import { IonicModule } from '@ionic/angular';
import { DespachoPrPageRoutingModule } from './despacho-pr-routing.module';
import { DespachoPrPage } from './despacho-pr.page';
import { SharedModule } from 'src/app/shared/shared.module';
import { ComponentsModule } from 'src/app/components/components.module';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
ComponentsModule,
DespachoPrPageRoutingModule
],
declarations: [DespachoPrPage]
@@ -1,9 +1,175 @@
<ion-header>
<ion-toolbar>
<ion-title>despacho-pr</ion-title>
</ion-toolbar>
<ion-header class="ion-no-border">
<app-header></app-header>
</ion-header>
<ion-menu autoHide="false" side="end" content-id="main-content">
<ion-header>
<ion-toolbar translucent>
<ion-title>Menu</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
<ion-list>
<ion-item (click)="openExpedientActionsModal('0',fulltask)">
<ion-icon name="documents" slot="start"></ion-icon>
<ion-label>Efectuar Despacho</ion-label>
</ion-item>
<ion-item (click)="openExpedientActionsModal('1',fulltask)">
<ion-icon name="arrow-undo" slot="start"></ion-icon>
<ion-label>Pedido de Parecer</ion-label>
</ion-item>
<ion-item (click)="openExpedientActionsModal('2',fulltask)">
<ion-icon name="arrow-redo" slot="start"></ion-icon>
<ion-label>Pedido de Deferimento</ion-label>
</ion-item>
<ion-item (click)="openBookMeetingModal(task)">
<ion-icon name="calendar" slot="start"></ion-icon>
<ion-label>Marcar reunião</ion-label>
</ion-item>
<ion-item hidden disabled>
<ion-icon name="paper-plane" slot="start"></ion-icon>
<ion-label>Enviar para pendentes</ion-label>
</ion-item>
</ion-list>
</ion-content>
</ion-menu>
<div class="ion-page d-none" id="main-content">
<ion-menu-button></ion-menu-button>
</div>
<ion-content>
<div class="main-content d-flex height-100">
<div class="content d-flex flex-column" *ngIf="task">
<div class="main-header">
<div class="title-content d-flex justify-space-between">
<div class="font-30 cursor-pointer" (click)="goBack()" defaultHref="#">
<ion-icon slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
</div>
<div class="middle d-flex align-center flex-grow-1">
<ion-label class="title">{{ task.Folio}}</ion-label>
</div>
<div class="div-icon" (click)="openOptions()">
<!-- <ion-menu-button autoHide="false">
<ion-icon name="ellipsis-vertical-outline"></ion-icon>
</ion-menu-button> -->
<ion-icon class="font-25 cursor-pointer" src="assets/images/icons-menu.svg"></ion-icon>
</div>
</div>
</div>
<div class="upper-content">
<div class="content-details">
<ion-label>
<p><span class="date">{{customDate}}</span><span class="label">{{ task.activityInstanceName }}</span></p>
<p><span class="color-red">{{ task.DeadlineType }}</span></p>
</ion-label>
</div>
</div>
<div class="line"></div>
<div class="middle-content">
<div *ngIf="intervenientes.length > 0">
<h5 >Intervenientes</h5>
<ion-item class="ion-no-margin ion-no-padding">
<ion-label *ngIf="intervenientes">
<div *ngFor="let interveniente of intervenientes">
<p>{{interveniente.Name}}</p>
</div>
</ion-label>
</ion-item>
</div>
<div *ngIf="cc.length > 0">
<h5>Com conhecimento</h5>
<ion-item class="ion-no-margin ion-no-padding">
<ion-label>
<div *ngFor="let c of cc">
<p>{{c.Name}}</p>
</div>
</ion-label>
</ion-item>
</div>
<div *ngIf="fulltask.workflowInstanceDataFields.TaskMessage">
<h5>Detalhes</h5>
<ion-item class="ion-no-margin ion-no-padding">
<p [innerHTML]="fulltask.workflowInstanceDataFields.TaskMessage"></p>
</ion-item>
</div>
</div>
<div class="bottom-content width-100">
<ion-list *ngIf="attachments">
<h5>Documentos Anexados</h5>
<ion-item *ngFor="let attachment of attachments"
class="ion-no-margin ion-no-padding cursor-pointer">
<ion-label
(click)="viewDocument(attachment.DocId)">
<p *ngIf="attachment.Assunto" class="attach-title-item">{{ attachment.Assunto }}<span class="span-right color-red btn-size"><ion-icon hidden name="close"></ion-icon></span></p>
<p *ngIf="!attachment.Assunto" class="attach-title-item">{{ attachment.DocNumber }}<span class="span-right color-red btn-size"><ion-icon hidden name="close"></ion-icon></span></p>
<p><span class="span-left">{{attachment.Sender}}</span><span class="span-right">{{ attachment.DocDate | date: 'dd/MM/yy' }}</span></p>
</ion-label>
</ion-item>
</ion-list>
</div>
</div>
<div *ngIf="task" class="aside-right flex-column height-100">
<div class="buttons" *ngIf="task.activityInstanceName == 'Tarefa de Despacho'">
<button (click)="openAddNoteModal('Executado')" class="btn-cancel" shape="round" >Executado</button>
<button (click)="openDelegarModal(task)" class="btn-cancel" shape="round" >Delegar</button>
<button (click)="openAddNoteModal('Gerar Diploma')" class="btn-cancel" shape="round" >Gerar Diploma </button>
<div class="solid"></div>
<button (click)="openExpedientActionsModal('0',fulltask)" class="btn-ok" shape="round" >Efectuar Despacho</button>
<button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
<div class="solid"></div>
<button (click)="sendExpedienteToPending()" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
</div>
<div class="buttons" *ngIf="task.activityInstanceName == 'Concluir Despacho'">
<button (click)="openAddNoteModal('Concluido')" class="btn-cancel" shape="round" >Marcar como Concluído</button>
<button (click)="openAddNoteModal('Reexecução')" class="btn-cancel" shape="round" >Enviar para Reexecução</button>
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
<button (click)="sendExpedienteToPending()" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
</div>
</div>
<div *ngIf="!task">
<ion-list>
<ion-list-header>
<ion-label>
<ion-skeleton-text animated style="width: 50%"></ion-skeleton-text>
</ion-label>
</ion-list-header>
<ion-item>
<ion-label>
<h3>
<ion-skeleton-text animated style="width: 50%"></ion-skeleton-text>
</h3>
<p>
<ion-skeleton-text animated style="width: 80%"></ion-skeleton-text>
</p>
</ion-label>
</ion-item>
<ion-item>
<ion-label>
<h3>
<ion-skeleton-text animated style="width: 50%"></ion-skeleton-text>
</h3>
<p><ion-skeleton-text animated style="width: 80%"></ion-skeleton-text></p>
</ion-label>
</ion-item>
<ion-item>
<ion-label>
<h3>
<ion-skeleton-text animated style="width: 50%"></ion-skeleton-text>
</h3>
<p>
<ion-skeleton-text animated style="width: 80%"></ion-skeleton-text>
</p>
</ion-label>
</ion-item>
<ion-button color="medium" shape="round" expand="block">
<!-- <ion-icon color="medium" name="attach" slot="start"></ion-icon> -->
<ion-skeleton-text animated style="width: 50%"></ion-skeleton-text>
</ion-button>
</ion-list>
</div>
</div>
</ion-content>
@@ -0,0 +1,241 @@
@import '~src/function.scss';
.main-content{
background-color: #fff !important;
border-top-left-radius: 25px;
border-top-right-radius: 25px;
}
.content{
padding: 30px 20px 0 20px !important;
margin: 0;
float: left;
}
.color-red{
font-weight: 500;
color:#d30a0a !important;
}
.btn-size{
font-size: 18px !important;
}
.main-header{
font-family: Roboto;
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{
padding: 0!important;
float: left;
width: 280px;
margin: 2.5px 0 0 5px;
display: flex;
align-items: center;
}
.right{
padding: 0!important;
float: right;
font-size: 25px;
color: #0782c9;
margin: 5px 0 0 0;
}
}
.header-bottom{
width: 310px;
overflow: auto;
margin: 0 auto;
.header-bottom-icon{
width: 30px;
font-size: 25px;
float: left;
padding: 2px;
}
.header-bottom-contacts{
width: 275px;
font-size: 15px;
color: #797979;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
float: left;
padding: 5px;
margin: 1px;
}
}
.title{
font-size: 25px;
overflow: auto;
float: left;
padding-top: 4px;
padding-left: 5px;
}
.div-icon{
width: 40px;
float: right;
font-size: 35px;
overflow: auto;
padding: 1px;
}
}
ion-item-group{
margin: 15px;
}
ion-button{
display: block;
width: 80%;
margin: 20px auto;
}
.upper-content{
font-family: Roboto;
margin-left: 41px;
overflow: auto;
font-size: 18px;
.label{
border-radius: 20px;
background: #ffb703;
float: right;
padding: 5px 13.5px 5px 13.5px;
color: #fff;
}
.button-calendar-type ion-button{
height: 25px;
}
.content-details{
font-size: 17px;
.date{
color: #797979;
}
}
}
.middle-conten{
.middle-content p{
font-size: 16px;
}
}
.bottom-content{
//width: 360px;
margin: 0 auto;
.bottom-content h3{
font-size: 16px;
margin: 0 0 0 10px;
}
.attach-document{
font-size: 15px;
color: #0d89d1;
margin: 5px 5px 5px 10px;
padding: 5px;
float: left;
}
.attach-icon{
width: 37px;
font-size: 35px;
float: left;
}
.attach-title-item{
font-size: 18px;
width: 100%;
color:#0d89d1;
padding-bottom: 5px;
}
/* SPAN */
.span-left{
float: left;
font-size: 15x;
}
.span-right{
text-align: right;
float: right;
font-size: 13px;
}
}
.aside-right{
padding: 30px 20px 0 20px !important;
.arrow-right{
display: flex;
justify-content: flex-end;
margin-bottom: 20px;
.arrow-right-icon{
width: 37px;
float: right;
font-size: 35px;
overflow: hidden;
}
}
.buttons{
display: flex;
flex-wrap: wrap;
justify-content: space-between;
.btn-ok, .btn-cancel, .btn-delete{
height: auto !important;
font-size: 16px !important;
font-weight: 600 !important;
width: 100% !important;
margin-bottom: 10px !important;
padding: 15px !important;
}
}
.solid {
display: block;
width: 90%;
border-top: 1px solid #ebebeb;
margin: 0 auto !important;
margin-bottom: 10px !important;
}
}
@media only screen and (max-width: 800px) {
.content{
width: 100% !important;
}
.aside-right{
display: none;
}
}
@media only screen and (min-width: 801px) {
.div-icon{
display: none;
}
.content{
width: 65%;
border-right: 1px solid #d8d8d8;
}
.aside-right{
width: 35%;
}
}
@media only screen and (min-width: 1024px){
.content{
width: 70%;
}
.aside-right{
width: 30%;
}
}
@media only screen and (min-width: 1140px){
.content{
width: 75%;
}
.aside-right{
width: 25%;
}
}
@@ -1,4 +1,26 @@
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 { DailyWorkTask } from '../../../../models/dailyworktask.model';
import { ActivatedRoute, NavigationExtras, Router } from '@angular/router';
import { formatDate } from '@angular/common';
import { Event } from '../../../../models/event.model';
import { 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 { momentG } from 'src/plugin/momentG'
import { DiscartExpedientModalPage } from '../../discart-expedient-modal/discart-expedient-modal.page';
import { ExpedientTaskModalPage } from '../../expediente/expedient-task-modal/expedient-task-modal.page';
import { BookMeetingModalPage } from '../../expediente/book-meeting-modal/book-meeting-modal.page';
import { CreateProcessPage } from 'src/app/modals/create-process/create-process.page';
import { DelegarPage } from 'src/app/modals/delegar/delegar.page';
import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
import { OptsExpedientePage } from 'src/app/shared/popover/opts-expediente/opts-expediente.page';
import { BadRequestComponent } from 'src/app/shared/popover/bad-request/bad-request.component';
import { SuccessMessageComponent } from 'src/app/shared/popover/success-message/success-message.component';
import { DespachosPrOptionsPage } from 'src/app/shared/popover/despachos-pr-options/despachos-pr-options.page';
@Component({
selector: 'app-despacho-pr',
@@ -6,10 +28,470 @@ import { Component, OnInit } from '@angular/core';
styleUrls: ['./despacho-pr.page.scss'],
})
export class DespachoPrPage implements OnInit {
months = ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"];
days = ["Domingo", "Segunda-feira", "Terça-feira", "Quarta-feira", "Quinta-feira", "Sexta-feira", "Sábado"];
constructor() { }
customDate:any;
task: any;
attachments:any;
fulltask: any;
eventsList: Event[];
serialnumber: string;
profile: string;
intervenientes: any;
cc: any;
constructor(private activateRoute: ActivatedRoute,
private processes: ProcessesService,
private iab: InAppBrowser,
private attachmentsService: AttachmentsService,
private events: EventsService,
private menu: MenuController,
private router: Router,
private modalController: ModalController,
private alertService: AlertService,
public popoverController: PopoverController,
private activatedRoute: ActivatedRoute,) {
this.activatedRoute.queryParams.subscribe(params => {
if(params["serialNumber"]) {
this.serialnumber = params["serialNumber"];
console.log(params["serialNumber"]);
}
});
}
ngOnInit() {
this.profile = "mdgpr";
console.log(this.serialnumber);
this.activateRoute.paramMap.subscribe(paramMap => {
if (!paramMap.has('SerialNumber')) {
return;
}
/* this.serialnumber = paramMap.get('SerialNumber'); */
this.LoadTaskDetail(this.serialnumber);
this.LoadRelatedEvents(this.serialnumber);
});
this.LoadTaskDetail(this.serialnumber);
this.LoadRelatedEvents(this.serialnumber);
}
close(){
this.modalController.dismiss();
}
goBack(){
// let navigationExtras: NavigationExtras = {
// queryParams: {
// "despachospr": true,
// }
// };
// this.router.navigate(['/home/gabinete-digital'], navigationExtras);
window.history.back()
}
async LoadTaskDetail(serial: string) {
this.processes.GetTask(serial).subscribe(res => {
this.task = {
"SerialNumber": res.serialNumber,
"Folio": res.workflowInstanceDataFields.Subject,
"Senders": res.originator.email,
"CreateDate": momentG(new Date(res.taskStartDate),'yyyy-MM-dd HH:mm:ss'),
"DocumentURL": res.workflowInstanceDataFields.ViewerRequest,
"Remetente": res.workflowInstanceDataFields.Sender,
"Note": res.workflowInstanceDataFields.Note,
"FolderId": res.workflowInstanceDataFields.FolderID,
"FsId": '361',
"DocId": res.workflowInstanceDataFields.DispatchDocId,
"WorkflowName": res.workflowDisplayName,
"DeadlineType": res.workflowInstanceDataFields.DeadlineType,
"activityInstanceName": res.activityInstanceName,
}
this.fulltask = res;
console.log(this.task);
console.log('GetTask', res);
let thedate = new Date(this.task.CreateDate);
this.customDate = this.days[thedate.getDay()]+ ", " + thedate.getDate() +" de " + ( this.months[thedate.getMonth()]);
this.processes.GetTaskParticipants(this.task.FolderId).subscribe(users=>{
this.intervenientes = users.filter(user=>{
return user.Type == 'I';
});
this.cc = users.filter(user=>{
return user.Type == 'CC';
});
console.log(users);
});
this.getDocumentDetails(this.task.FolderId, '361');
});
}
getDocumentDetails(forlderId:string, applicationId:string) {
this.processes.GetDocumentDetails(forlderId,applicationId).subscribe(res=>{
this.attachments = res.Documents;
console.log(res['Documents']);
console.log(this.attachments);
})
}
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);
const url: string = res.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1");
const browser = this.iab.create(url,"_blank");
browser.show();
});
}
openMenu() {
this.menu.open();
this.modalController.dismiss();
}
async executado(note:string, documents:any){
let body = {
"serialNumber": this.serialnumber,
"action": "Conhecimento",
"ActionTypeId": 104,
"dataFields": {
"ReviewUserComment": note,
},
"AttachmentList" :documents,
}
try {
await this.processes.CompleteTask(body).toPromise()
this.close();
this.successMessage()
} catch(error) {
this.badRequest()
}
}
async arquivar(note:string, documents:any){
let body = {
"serialNumber": this.serialnumber,
"action": "Arquivo",
"ActionTypeId": 95,
"dataFields": {
"ReviewUserComment": note,
},
"AttachmentList" :documents,
}
try {
await this.processes.CompleteTask(body).toPromise()
this.successMessage()
this.close();
} catch (error) {
this.badRequest()
}
}
async generateDiploma(note:string, documents:any){
let body = {
"serialNumber": this.serialnumber,
"action": "Reencaminhar",
"ActionTypeId": 99999839,
"dataFields": {
"ReviewUserComment": note,
},
"AttachmentList" :documents,
}
try {
await this.processes.CompleteTask(body).toPromise()
this.successMessage()
this.close();
} catch (error) {
this.badRequest()
}
}
async concluir(note:string, documents:any){
let body = {
"serialNumber": this.serialnumber,
"action": "Executado",
"ActionTypeId": 104,
"dataFields": {
"ReviewUserComment": note,
},
"AttachmentList" :documents,
}
try {
await this.processes.CompleteTask(body).toPromise()
this.successMessage()
this.close();
} catch (error) {
this.badRequest()
}
}
async reexecutar(note:string, documents:any){
let body = {
"serialNumber": this.serialnumber,
"action": "Reexecutar",
"ActionTypeId": 100000010,
"dataFields": {
"ReviewUserComment": note,
},
"AttachmentList" :documents,
}
try {
await this.processes.CompleteTask(body).toPromise()
this.successMessage()
this.close();
} catch (error) {
this.badRequest()
}
}
sendExpedienteToPending(){
this.processes.SetTaskToPending(this.serialnumber).subscribe(res=>{
console.log(res);
this.close();
});
}
async openAddNoteModal(actionName:string) {
let classs;
if( window.innerWidth <= 800){
classs = 'modal modal-desktop'
} else {
classs = 'modal modal-desktop'
}
const modal = await this.modalController.create({
component: AddNotePage,
componentProps:{
},
cssClass: classs,
backdropDismiss: true
});
await modal.present();
modal.onDidDismiss().then(res => {
console.log(res);
if(res.data){
const DocumentToSave = res.data.documents.map((e) => {
return {
ApplicationId: e.ApplicationType,
SourceId: e.Id,
}
});
let docs = {
ProcessInstanceID: "",
Attachments: DocumentToSave,
}
if(actionName == 'Executado'){
this.executado(res.data.note, docs);
}
else if(actionName == 'Arquivar'){
this.arquivar(res.data.note, docs);
}
else if(actionName == 'Gerar Diploma'){
this.generateDiploma(res.data.note, docs);
}
else if(actionName == 'Concluido'){
this.concluir(res.data.note, docs);
}
else if(actionName == 'Reexecução'){
this.reexecutar(res.data.note, docs);
}
this.goBack();
}
});
}
async openExpedientActionsModal(taskAction: any, task: any) {
//this.modalController.dismiss();
let classs;
if( window.innerWidth <= 800){
classs = 'modal modal-desktop'
} else {
classs = 'modal modal-desktop showAsideOptions'
}
const modal = await this.modalController.create({
component: CreateProcessPage,
componentProps: {
taskAction: taskAction,
task: task,
profile: this.profile,
},
cssClass: classs,
});
await modal.present();
modal.onDidDismiss().then(res=>{
console.log(res['data']);
if(res['data']=='openDiscart'){
console.log('open discart');
this.distartExpedientModal();
}
});
}
async distartExpedientModal2(task: any){
const modal = await this.modalController.create({
component: DiscartExpedientModalPage,
componentProps: {
serialNumber: task.serialNumber,
folderId: task.workflowInstanceDataFields.FolderID,
action: 'discart',
},
cssClass: 'discart-expedient-modal',
backdropDismiss: false
});
await modal.present();
modal.onDidDismiss();
}
async openBookMeetingModal(task: any) {
let classs;
if( window.innerWidth <= 800){
classs = 'book-meeting-modal modal modal-desktop'
} else {
classs = 'modal modal-desktop showAsideOptions'
}
const modal = await this.modalController.create({
component: BookMeetingModalPage,
componentProps: {
task: this.task,
},
cssClass: classs,
backdropDismiss: false
});
await modal.present();
modal.onDidDismiss();
}
async openDelegarModal(task: any) {
let classs;
if( window.innerWidth <= 800){
classs = 'book-meeting-modal modal modal-desktop'
} else {
classs = 'modal modal-desktop showAsideOptions'
}
const modal = await this.modalController.create({
component: DelegarPage,
componentProps: {
task: this.task,
},
cssClass: classs,
backdropDismiss: false
});
await modal.present();
modal.onDidDismiss();
}
async distartExpedientModal(){
console.log(this.fulltask);
const modal = await this.modalController.create({
component: DiscartExpedientModalPage,
componentProps: {
serialNumber: this.fulltask.serialNumber,
folderId: this.fulltask.workflowInstanceDataFields.FolderID,
action: 'complete',
},
cssClass: 'discart-expedient-modal',
backdropDismiss: false
});
await modal.present();
modal.onDidDismiss().then(res=>{
if(res['data']=='close'){
this.close();
/* console.log('2Expedient Discard closed2');
this.close();
this.openMenu(); */
}
});
}
async openOptions(taskAction?: any) {
const popover = await this.popoverController.create({
component: DespachosPrOptionsPage,
cssClass: 'exp-options',
componentProps: {
task: this.task,
fulltask: this.fulltask,
taskAction:taskAction,
showEnviarPendentes: false
},
translucent: true
});
return await popover.present();
}
async successMessage(message?: string) {
const modal = await this.modalController.create({
component: SuccessMessageComponent,
componentProps: {
message: message || 'Processo efetuado' ,
},
cssClass: 'modal modal-desktop'
});
modal.present()
setTimeout(()=>{
modal.dismiss()
},3000)
}
async badRequest(message?: string) {
const modal = await this.modalController.create({
component: BadRequestComponent,
componentProps: {
message: message || 'Processo não efetuado' ,
},
cssClass: 'modal modal-desktop'
});
modal.present()
setTimeout(()=>{
modal.dismiss()
},3000)
}
}
@@ -7,12 +7,15 @@ import { IonicModule } from '@ionic/angular';
import { DespachosPrPageRoutingModule } from './despachos-pr-routing.module';
import { DespachosPrPage } from './despachos-pr.page';
import { SharedModule } from 'src/app/shared/shared.module';
import { ComponentsModule } from 'src/app/components/components.module';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
ComponentsModule,
DespachosPrPageRoutingModule
],
declarations: [DespachosPrPage]
@@ -1,13 +1,21 @@
<ion-header class="ion-no-border1">
<ion-header class="ion-no-border">
<app-header > </app-header>
</ion-header>
<ion-header class="ion-no-border header-2">
<div class="main-header">
<div class="thetitle"><ion-label >Despachos Presidenciais</ion-label></div>
<app-btn-modal-dismiss (click)="goBack()" ></app-btn-modal-dismiss>
<div class="thetitle">
<ion-label *ngIf="loggeduser.Profile =='MDGPR'" >Despachos Presidenciais</ion-label>
<ion-label *ngIf="loggeduser.Profile =='PR'" >Despachos</ion-label>
</div>
<div class="theicon">
<button class="btn-no-color" (click)="doRefresh($event)">
<ion-icon slot="end" class="title-icon" name="reload-circle"></ion-icon>
</button>
</div>
</div>
<div class="bottom-title d-flex"><h3 class="bottom-text">Presidente da República</h3></div>
<div *ngIf="loggeduser.Profile =='MDGPR'" class="bottom-title d-flex"><h3 class="bottom-text">Presidente da República</h3></div>
</ion-header>
<ion-content>
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
@@ -19,42 +27,44 @@
</ion-refresher-content>
</ion-refresher>
<div class="main-content width-100">
<div *ngIf="despachoList">
<ion-list>
<ion-item
class="expediente ion-no-padding cursor-pointer"
*ngFor = "let task of despachoList; let i = index"
(click)="viewExpedientDetail(task.SerialNumber)"
>
<!-- [routerLink]="['/home/gabinete-digital/expediente',task.SerialNumber]" -->
<div class="item width-100" *ngIf="task.Status == 'Active'">
<div class="exp-top-detail">
<div class="exp-date">
<ion-label>{{ task.CreateDate | date: 'dd-MM-yy' }}</ion-label>
</div>
<div class="exp-remetente">
<ion-label>{{task.Senders}}</ion-label>
</div>
<div class="exp-icon d-flex align-center">
<ion-icon src="assets/images/icons-expediente-attachment.svg"></ion-icon>
<label>{{task.DocumentsQty}}</label>
<!-- <ion-menu-button (click)="docIndex(i)" style="width: 35px; height: 41px;" autoHide="false">
<div class="main-content width-100">
<div *ngIf="despachoList">
<ion-list>
<ion-item
class="expediente ion-no-padding cursor-pointer"
*ngFor = "let task of despachoList; let i = index"
(click)="goToDespachoPr(task.SerialNumber)"
>
<!-- [routerLink]="['/home/gabinete-digital/expediente',task.SerialNumber]" -->
<div class="item width-100" *ngIf="task.Status == 'Active'">
<div class="exp-top-detail">
<div class="exp-date">
<ion-label>{{ task.CreateDate | date: 'dd-MM-yy' }}</ion-label>
</div>
<div class="exp-remetente">
<ion-label>{{task.Senders}}</ion-label>
</div>
<div class="exp-workflow">
<span class="label">{{task.activityInstanceName}}</span>
</div>
<div class="exp-icon d-flex align-center">
<ion-icon src="assets/images/icons-expediente-attachment.svg"></ion-icon>
</ion-menu-button> -->
<label>{{task.DocumentsQty}}</label>
<!-- <ion-menu-button (click)="docIndex(i)" style="width: 35px; height: 41px;" autoHide="false">
<ion-icon src="assets/images/icons-expediente-attachment.svg"></ion-icon>
</ion-menu-button> -->
</div>
</div>
<div class="exp-bottom-detail">
<ion-label>{{ task.Folio }}</ion-label>
</div>
</div>
<div class="exp-bottom-detail">
<ion-label>{{ task.Folio }}</ion-label>
</div>
</div>
</ion-item>
</ion-list>
</ion-item>
</ion-list>
</div>
</div>
</div>
<div *ngIf="loading">
<ion-list>
@@ -1,5 +1,21 @@
@import '~src/function.scss';
/* CONTENT */
:host{
margin: 0;
}
.header-2 {
border-top-right-radius: 24px;
border-top-left-radius: 24px;
}
ion-content, .header-2, .main-content{
padding: 30px 20px 0 20px !important;
background-color: white;
}
.main-content {
padding-top: 0px !important;
}
.main-content{
padding: 30px 20px 0 20px !important;
margin: 0;
@@ -9,7 +25,7 @@
font-size: 25px;
color:#000;
overflow: auto;
padding: 30px 20px 0 20px !important;
// padding: 30px 20px 0 20px !important;
margin: 0;
.thetitle{
@@ -14,6 +14,8 @@ import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discar
import { AuthService } from 'src/app/services/auth.service';
import { DespachoPage } from 'src/app/pages/gabinete-digital/despachos/despacho/despacho.page';
import { User } from 'src/app/models/user.model';
import { NavigationEnd, NavigationExtras, Router } from '@angular/router';
@Component({
selector: 'app-despachos-pr',
@@ -25,7 +27,7 @@ export class DespachosPrPage implements OnInit {
@ViewChild(CalendarComponent) myCal: CalendarComponent;
taskslist:DailyWorkTask[];
despachoList:DailyWorkTask[] = [];
despachoList:any[] = [];
deferimentoList:DailyWorkTask[] = [];
taskList:tasksList[] = [];
@@ -44,28 +46,45 @@ export class DespachosPrPage implements OnInit {
dicIndex = 0;
inicial = false
loggeduser: User;
constructor (
private processes:ProcessesService,
private modalController: ModalController,
private alertService: AlertService,
private authService: AuthService,
private navParams: NavParams
private router: Router,
) {
this.profile = this.navParams.get('profile') || 'mdgpr';
this.loggeduser = authService.ValidatedUser;
this.profile = 'mdgpr';
}
ngOnInit() {
//Inicializar segment
this.segment = "despachos";
this.LoadList();
this.authService.userData$.subscribe((res:any)=>{
console.log(res);
});
this.router.events.forEach((event) => {
if(event instanceof NavigationEnd && event.url == this.router.url) {
this.LoadList();
}
});
}
segmentChanged(ev: any) {
// this.LoadList();
this.LoadList();
}
goToDespachoPr(serialNumber:any){
let navigationExtras: NavigationExtras = {
queryParams: {
"serialNumber": serialNumber,
}
};
this.router.navigate(['/home/gabinete-digital/despachos-pr/despacho-pr'], navigationExtras);
}
notImplemented(){
@@ -76,58 +95,61 @@ export class DespachosPrPage implements OnInit {
console.log(data);
// this.openExpedientDetail.emit(data);
}
async LoadList(){
this.despachoList = new Array();
this.loading = true;
let result = await this.processes.GetTasksList("Despacho do Presidente da República", false).toPromise();
console.log(result);
async LoadList() {
this.despachoList = new Array();
this.loading = true;
let result = await this.processes.GetTasksList("Despacho do Presidente da República", false).toPromise();
console.log(result);
await result.forEach( (element, index) => {
let task = {
"SerialNumber": element.serialNumber,
"Folio": element.workflowInstanceDataFields.Subject,
"Senders": element.workflowInstanceDataFields.Sender,
"CreateDate": formatDate(new Date(element.taskStartDate), 'yyyy-MM-dd HH:mm', 'pt'),
"DocumentURL": element.workflowInstanceDataFields.ViewerRequest,
"Remetente": element.workflowInstanceDataFields.Remetente,
"DocumentsQty": '',
"DocId": element.workflowInstanceDataFields.DocId,
"WorkflowName": element.workflowDisplayName,
"FolderID": element.workflowInstanceDataFields.FolderID,
"Status": element.workflowInstanceDataFields.Status
}
await result.forEach( (element, index) => {
let date = new Date(element.taskStartDate);
date.setMonth(date.getMonth() + 1);
let taskDate = date.getFullYear()+"-"+ date.getMonth()+"-"+date.getDate()+" "+date.getHours()+":"+date.getMinutes()+ ":"+date.getSeconds();
let task = {
"SerialNumber": element.serialNumber,
"Folio": element.workflowInstanceDataFields.Subject,
"Senders": element.workflowInstanceDataFields.Sender,
"CreateDate": taskDate,
"DocumentURL": element.workflowInstanceDataFields.ViewerRequest,
"Remetente": element.workflowInstanceDataFields.Remetente,
"DocumentsQty": 0,
"DocId": element.workflowInstanceDataFields.DocIdDiferimento,
"WorkflowName": element.workflowDisplayName,
"activityInstanceName": element.activityInstanceName,
}
this.despachoList.push(task)
});
});
this.despachoList = this.sortArrayISODate(this.despachoList).reverse()
this.despachoList = this.sortArrayISODate(this.despachoList).reverse()
this.despachoList.forEach( (element, index) => {
this.despachoList.forEach( (element, index) => {
// let aplicationId = element.workflowInstanceDataFields.SourceSecFsID;
let FolderID = element['FolderID'];
this.processes.GetDocumentDetails(FolderID, '361').subscribe(res=>{
this.processes.GetDocumentDetails(FolderID, '361').subscribe(res=>{
element.DocumentsQty = res.DocumentsTotal
})
})
});
});
this.loading = false;
}
sortArrayISODate(myArray: any){
return myArray.sort(function(a, b) {
return (a.CreateDate < b.CreateDate) ? -1 : ((a.CreateDate > b.CreateDate) ? 1 : 0);
});
}
this.loading = false;
}
sortArrayISODate(myArray: any) {
return myArray.sort(function(a, b) {
return (a.CreateDate < b.CreateDate) ? -1 : ((a.CreateDate > b.CreateDate) ? 1 : 0);
});
}
doRefresh(event) {
this.LoadList();
@@ -162,118 +184,122 @@ export class DespachosPrPage implements OnInit {
});
}
// old
async openExpedientActionsModal(taskAction: any, task: any) {
//this.modalController.dismiss();
let classs;
if( window.innerWidth <= 800){
classs = 'modal modal-desktop'
} else {
classs = 'modal modal-desktop showAsideOptions'
}
// old
async openExpedientActionsModal(taskAction: any, task: any) {
//this.modalController.dismiss();
let classs;
if( window.innerWidth <= 800){
classs = 'modal modal-desktop'
} else {
classs = 'modal modal-desktop showAsideOptions'
}
const doc = this.loadedAttachments[ this.dicIndex];
const doc = this.loadedAttachments[ this.dicIndex];
task = {
serialNumber: doc.SourceId,
taskStartDate: doc.CreateDate,
isEvent: true,
workflowInstanceDataFields: {
FsId: doc.ApplicationId,
FolderID: null,
DocId: doc.SourceId,
Subject: doc.SourceName
},
}
task = {
serialNumber: doc.SourceId,
taskStartDate: doc.CreateDate,
isEvent: true,
workflowInstanceDataFields: {
FsId: doc.ApplicationId,
FolderID: null,
DocId: doc.SourceId,
Subject: doc.SourceName
},
}
const modal = await this.modalController.create({
component: ExpedientTaskModalPage,
componentProps: {
taskAction: taskAction,
task: task,
profile: this.profile,
},
cssClass: classs,
});
await modal.present();
modal.onDidDismiss().then(res=>{
console.log(res['data']);
if(res['data']=='openDiscart'){
console.log('open discart');
// this.distartExpedientModal();
const modal = await this.modalController.create({
component: ExpedientTaskModalPage,
componentProps: {
taskAction: taskAction,
task: task,
profile: this.profile,
},
cssClass: classs,
});
await modal.present();
modal.onDidDismiss().then(res=>{
console.log(res['data']);
if(res['data']=='openDiscart'){
console.log('open discart');
// this.distartExpedientModal();
}
}
});
}
});
}
async openBookMeetingModal(task: any) {
const doc = this.loadedAttachments[ this.dicIndex];
task = {
serialNumber: doc.SourceId,
taskStartDate: doc.CreateDate,
isEvent: true,
workflowInstanceDataFields: {
FsId: doc.ApplicationId,
FolderID: null,
DocId: doc.SourceId,
Subject: doc.SourceName
},
}
let classs;
if( window.innerWidth <= 800){
classs = 'book-meeting-modal modal modal-desktop'
} else {
classs = 'modal modal-desktop showAsideOptions'
}
const modal = await this.modalController.create({
component: BookMeetingModalPage,
componentProps: {
task: task,
},
cssClass: classs,
backdropDismiss: false
});
await modal.present();
modal.onDidDismiss();
}
async distartExpedientModal() {
const doc = this.taskList[ this.dicIndex];
console.log(doc, this.dicIndex, this.taskList)
const modal = await this.modalController.create({
component: DiscartExpedientModalPage,
componentProps: {
serialNumber: doc.serialNumber,
folderId: doc.workflowInstanceDataFields.FolderID,
action: 'complete',
},
cssClass: 'discart-expedient-modal',
backdropDismiss: false
});
await modal.present();
modal.onDidDismiss().then(res=>{
if(res['data']=='close'){
// this.close();
/* console.log('2Expedient Discard closed2');
this.close();
this.openMenu(); */
}
});
}
async openBookMeetingModal(task: any) {
const doc = this.loadedAttachments[ this.dicIndex];
task = {
serialNumber: doc.SourceId,
taskStartDate: doc.CreateDate,
isEvent: true,
workflowInstanceDataFields: {
FsId: doc.ApplicationId,
FolderID: null,
DocId: doc.SourceId,
Subject: doc.SourceName
},
}
let classs;
if( window.innerWidth <= 800){
classs = 'book-meeting-modal modal modal-desktop'
} else {
classs = 'modal modal-desktop showAsideOptions'
}
const modal = await this.modalController.create({
component: BookMeetingModalPage,
componentProps: {
task: task,
},
cssClass: classs,
backdropDismiss: false
});
await modal.present();
modal.onDidDismiss();
}
async distartExpedientModal() {
const doc = this.taskList[ this.dicIndex];
console.log(doc, this.dicIndex, this.taskList)
const modal = await this.modalController.create({
component: DiscartExpedientModalPage,
componentProps: {
serialNumber: doc.serialNumber,
folderId: doc.workflowInstanceDataFields.FolderID,
action: 'complete',
},
cssClass: 'discart-expedient-modal',
backdropDismiss: false
});
await modal.present();
modal.onDidDismiss().then(res=>{
if(res['data']=='close'){
// this.close();
/* console.log('2Expedient Discard closed2');
this.close();
this.openMenu(); */
}
});
}
docIndex(index: number) {
this.dicIndex = index;
}
docIndex(index: number) {
this.dicIndex = index;
}
goBack() {
this.router.navigate(['/home/gabinete-digital']);
}
}
@@ -8,15 +8,18 @@ import { DespachoPageRoutingModule } from './despacho-routing.module';
import { DespachoPage } from './despacho.page';
import { SharedModule } from 'src/app/shared/shared.module';
import { ComponentsModule } from 'src/app/components/components.module';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
SharedModule,
ComponentsModule,
DespachoPageRoutingModule
],
declarations: [DespachoPage]
declarations: [
DespachoPage,
]
})
export class DespachoPageModule {}
@@ -1,3 +1,7 @@
<ion-header class="ion-no-border">
<app-header></app-header>
</ion-header>
<ion-menu autoHide="false" side="end" content-id="main-content">
<ion-header>
<ion-toolbar translucent>
@@ -22,10 +26,6 @@
<ion-icon name="calendar" slot="start"></ion-icon>
<ion-label>Marcar reunião</ion-label>
</ion-item>
<ion-item (click)="discartExpedient()">
<ion-icon name="trash" slot="start"></ion-icon>
<ion-label>Descartar</ion-label>
</ion-item>
<ion-item hidden disabled>
<ion-icon name="paper-plane" slot="start"></ion-icon>
<ion-label>Enviar para pendentes</ion-label>
@@ -41,9 +41,11 @@
<div class="main-content d-flex height-100">
<div class="content d-flex flex-column" *ngIf="task">
<div class="main-header">
<div class="title-content">
<app-btn-modal-dismiss></app-btn-modal-dismiss>
<div class="middle">
<div class="title-content d-flex justify-space-between align-center">
<div class="font-30 cursor-pointer" (click)="goBack()" defaultHref="#">
<ion-icon slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
</div>
<div class="middle d-flex align-center flex-grow-1">
<ion-label class="title">{{ task.Folio}}</ion-label>
</div>
<div class="div-icon" (click)="openOptions()">
@@ -82,17 +84,18 @@
</ion-label>
</ion-item>
</div>
<div *ngIf="task.Note">
<div *ngIf="fulltask.workflowInstanceDataFields.TaskMessage">
<h5>Detalhes</h5>
<ion-item class="ion-no-margin ion-no-padding">
<p [innerHTML]="task.Note"></p>
<p [innerHTML]="fulltask.workflowInstanceDataFields.TaskMessage"></p>
</ion-item>
</div>
</div>
<div class="bottom-content width-100">
<ion-list>
<h5>Documentos Anexados</h5>
<ion-item *ngFor="let attachment of attachments" class="ion-no-margin ion-no-padding">
<ion-item *ngFor="let attachment of attachments"
class="ion-no-margin ion-no-padding cursor-pointer">
<ion-label
(click)="viewDocument(attachment.DocId)">
<p *ngIf="attachment.Assunto" class="attach-title-item">{{ attachment.Assunto }}<span class="span-right color-red btn-size"><ion-icon hidden name="close"></ion-icon></span></p>
@@ -133,51 +136,9 @@
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
<div class="solid"></div>
<button (click)="sendExpedienteToPending()" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
<button class="btn-cancel" shape="round" >Enviar para Reexecução</button>
<button (click)="openAddNoteModal('Reexecução')" class="btn-cancel" shape="round" >Enviar para Reexecução</button>
</div>
</div>
<div *ngIf="!task">
<ion-list>
<ion-list-header>
<ion-label>
<ion-skeleton-text animated style="width: 50%"></ion-skeleton-text>
</ion-label>
</ion-list-header>
<ion-item>
<ion-label>
<h3>
<ion-skeleton-text animated style="width: 50%"></ion-skeleton-text>
</h3>
<p>
<ion-skeleton-text animated style="width: 80%"></ion-skeleton-text>
</p>
</ion-label>
</ion-item>
<ion-item>
<ion-label>
<h3>
<ion-skeleton-text animated style="width: 50%"></ion-skeleton-text>
</h3>
<p><ion-skeleton-text animated style="width: 80%"></ion-skeleton-text></p>
</ion-label>
</ion-item>
<ion-item>
<ion-label>
<h3>
<ion-skeleton-text animated style="width: 50%"></ion-skeleton-text>
</h3>
<p>
<ion-skeleton-text animated style="width: 80%"></ion-skeleton-text>
</p>
</ion-label>
</ion-item>
<ion-button color="medium" shape="round" expand="block">
<!-- <ion-icon color="medium" name="attach" slot="start"></ion-icon> -->
<ion-skeleton-text animated style="width: 50%"></ion-skeleton-text>
</ion-button>
</ion-list>
</div>
</div>
</ion-content>
@@ -1,4 +1,9 @@
@import '~src/function.scss';
.main-content{
background-color: #fff !important;
border-top-left-radius: 25px;
border-top-right-radius: 25px;
}
.content{
padding: 30px 20px 0 20px !important;
margin: 0;
@@ -20,7 +25,6 @@
color:#000;
transform: translate3d(0, 1px, 0);
.header-top{
width: 360px;
margin: 0px auto;
overflow: auto;
padding: 0 !important;
@@ -4,10 +4,10 @@ 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 { DailyWorkTask } from '../../../../models/dailyworktask.model';
import { ActivatedRoute, Router } from '@angular/router';
import { ActivatedRoute, NavigationExtras, Router } from '@angular/router';
import { formatDate } from '@angular/common';
import { Event } from '../../../../models/event.model';
import { MenuController, ModalController, NavParams, PopoverController } from '@ionic/angular';
import { 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 { momentG } from 'src/plugin/momentG'
@@ -18,6 +18,8 @@ import { CreateProcessPage } from 'src/app/modals/create-process/create-process.
import { DelegarPage } from 'src/app/modals/delegar/delegar.page';
import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
import { OptsExpedientePage } from 'src/app/shared/popover/opts-expediente/opts-expediente.page';
import { BadRequestComponent } from 'src/app/shared/popover/bad-request/bad-request.component';
import { SuccessMessageComponent } from 'src/app/shared/popover/success-message/success-message.component';
@Component({
selector: 'app-despacho',
@@ -45,13 +47,20 @@ export class DespachoPage implements OnInit {
private attachmentsService: AttachmentsService,
private events: EventsService,
private menu: MenuController,
private router: Router,
private modalController: ModalController,
private navParams: NavParams,
private alertService: AlertService,
public popoverController: PopoverController) {
this.serialnumber = this.navParams.get('serialNumber');
this.profile = this.navParams.get('profile');
public popoverController: PopoverController,
private activatedRoute: ActivatedRoute,
private router: Router,
) {
this.activatedRoute.queryParams.subscribe(params => {
if(params["serialNumber"]) {
this.serialnumber = params["serialNumber"];
console.log(params["serialNumber"]);
}
});
}
ngOnInit() {
@@ -74,6 +83,25 @@ export class DespachoPage implements OnInit {
this.modalController.dismiss();
}
goBack() {
// this.activatedRoute.queryParams.subscribe(params => {
// if(params["from"] == 'pendentes') {
// this.router.navigate(['/home/gabinete-digital/pendentes']);
// } else {
// let navigationExtras: NavigationExtras = {
// queryParams: {
// "despachos": true,
// }
// };
// this.router.navigate(['/home/gabinete-digital/despachos'], navigationExtras);
// }
// });
window.history.back()
}
async LoadTaskDetail(serial: string) {
this.processes.GetTask(serial).subscribe(res => {
@@ -154,37 +182,77 @@ export class DespachoPage implements OnInit {
this.menu.open();
this.modalController.dismiss();
}
executado(note:string, documents:any){
async executado(note:string, documents:any){
let body = {
"serialNumber": this.serialnumber,
"action": "Conhecimento",
"ActionTypeId": 104,
"dataFields": {
"ReviewUserComent": note,
"ReviewUserComment": note,
},
"AttachmentList" :null,
"AttachmentList" :documents,
}
try {
await this.processes.CompleteTask(body).toPromise()
this.close();
this.successMessage()
} catch(error) {
this.badRequest()
}
this.processes.CompleteTask(body);
this.close();
}
arquivar(note:string, documents:any){
async arquivar(note:string, documents:any){
let body = {
"serialNumber": this.serialnumber,
"action": "Arquivo",
"ActionTypeId": 95,
"dataFields": {
"ReviewUserComent": note,
"ReviewUserComment": note,
},
"AttachmentList" :null,
"AttachmentList" :documents,
}
this.processes.CompleteTask(body);
this.close();
try {
await this.processes.CompleteTask(body).toPromise()
this.successMessage()
this.close();
} catch (error) {
this.badRequest()
}
}
async reexecute(note:string, documents:any){
let body = {
"serialNumber": this.serialnumber,
"action": "Reencaminhar",
"ActionTypeId": 98,
"dataFields": {
"ReviewUserComment": note,
},
"AttachmentList" :documents,
}
try {
await this.processes.CompleteTask(body).toPromise()
this.successMessage()
this.close();
} catch (error) {
this.badRequest()
}
}
sendExpedienteToPending(){
this.processes.SetTaskToPending(this.serialnumber).subscribe(res=>{
console.log(res);
this.close();
this.successMessage()
},
error => {
this.badRequest()
});
}
@@ -208,18 +276,35 @@ export class DespachoPage implements OnInit {
modal.onDidDismiss().then(res => {
console.log(res);
if(res.data){
const DocumentToSave = res.data.documents.map((e) => {
return {
ApplicationId: e.ApplicationType,
SourceId: e.Id,
}
});
let docs = {
ProcessInstanceID: "",
Attachments: DocumentToSave,
}
if(actionName == 'Executado'){
this.executado(res.data.note,res.data.documents);
this.executado(res.data.note, docs);
}
else if(actionName == 'Arquivar'){
this.arquivar(res.data.note,res.data.documents);
this.arquivar(res.data.note, docs);
}
else if(actionName == 'Reexecução'){
this.reexecute(res.data.note, docs);
}
}
});
}
async openExpedientActionsModal(taskAction: any, task: any) {
//this.modalController.dismiss();
let classs;
if( window.innerWidth <= 800){
classs = 'modal modal-desktop'
@@ -342,4 +427,38 @@ export class DespachoPage implements OnInit {
return await popover.present();
}
async successMessage(message?: string) {
const modal = await this.modalController.create({
component: SuccessMessageComponent,
componentProps: {
message: message || 'Processo efetuado' ,
},
cssClass: 'modal modal-desktop'
});
modal.present()
setTimeout(()=>{
modal.dismiss()
},3000)
}
async badRequest(message?: string) {
const modal = await this.modalController.create({
component: BadRequestComponent,
componentProps: {
message: message || 'Processo não efetuado' ,
},
cssClass: 'modal modal-desktop'
});
modal.present()
setTimeout(()=>{
modal.dismiss()
},3000)
}
}
@@ -8,15 +8,18 @@ import { DespachosPageRoutingModule } from './despachos-routing.module';
import { DespachosPage } from './despachos.page';
import { SharedModule } from 'src/app/shared/shared.module';
import { ComponentsModule } from 'src/app/components/components.module';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
SharedModule,
DespachosPageRoutingModule
ComponentsModule,
DespachosPageRoutingModule,
],
declarations: [DespachosPage]
declarations: [
DespachosPage,
]
})
export class DespachosPageModule {}
@@ -1,6 +1,12 @@
<ion-header class="ion-no-border">
<app-btn-modal-dismiss></app-btn-modal-dismiss>
<div class="title">
<app-header > </app-header>
</ion-header>
<ion-header class="ion-no-border header-2">
<div class="title d-flex align-center">
<app-btn-modal-dismiss (click)="goBack()" ></app-btn-modal-dismiss>
<div class="thetitle"><ion-label >Despachos</ion-label></div>
<div class="theicon">
<button class="btn-no-color" (click)="doRefresh($event)">
@@ -10,74 +16,81 @@
</div>
</ion-header>
<ion-content>
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
<div class="main-content">
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
<ion-refresher-content
pullingIcon="chevron-down-circle-outline"
pullingText="deslize para actualizar"
refreshingSpinner="circles"
refreshingText="A actualizar...">
</ion-refresher-content>
pullingIcon="chevron-down-circle-outline"
pullingText="deslize para actualizar"
refreshingSpinner="circles"
refreshingText="A actualizar...">
</ion-refresher-content>
</ion-refresher>
<div class="width-100">
<div *ngIf="despachoList">
<ion-list>
<ion-item
class="expediente ion-no-padding"
*ngFor = "let task of despachoList; let i = index"
(click)="viewExpedientDetail(task.SerialNumber)"
>
<!-- [routerLink]="['/home/gabinete-digital/expediente',task.SerialNumber]" -->
<div class="item width-100">
<div class="exp-top-detail ">
<div class="exp-date">
<ion-label>{{ task.CreateDate | date: 'dd-MM-yy' }}</ion-label>
</div>
<div class="exp-remetente">
<ion-label>{{task.Senders}}</ion-label>
</div>
<div class="exp-icon d-flex align-center">
<ion-icon src="assets/images/icons-expediente-attachment.svg"></ion-icon>
<label>{{task.DocumentsQty}}</label>
<!-- <ion-menu-button (click)="docIndex(i)" style="width: 35px; height: 41px;" autoHide="false">
<div class="width-100">
<div *ngIf="despachoList">
<ion-list>
<ion-item
class="expediente ion-no-padding cursor-pointer"
*ngFor = "let task of despachoList; let i = index"
(click)="viewExpedientDetail(task.SerialNumber)"
>
<!-- [routerLink]="['/home/gabinete-digital/expediente',task.SerialNumber]" -->
<div class="item width-100">
<div class="exp-top-detail">
<div class="exp-date">
<ion-label>{{ task.CreateDate | date: 'dd-MM-yy' }}</ion-label>
</div>
<div class="exp-remetente">
<ion-label>{{task.Senders}}</ion-label>
</div>
<div class="exp-workflow">
<span class="label">{{task.activityInstanceName}}</span>
</div>
<div class="exp-icon d-flex align-center">
<ion-icon src="assets/images/icons-expediente-attachment.svg"></ion-icon>
</ion-menu-button> -->
<label>{{task.DocumentsQty}}</label>
<!-- <ion-menu-button (click)="docIndex(i)" style="width: 35px; height: 41px;" autoHide="false">
<ion-icon src="assets/images/icons-expediente-attachment.svg"></ion-icon>
</ion-menu-button> -->
</div>
</div>
<div class="exp-bottom-detail">
<ion-label>{{ task.Folio }}</ion-label>
</div>
</div>
<div class="exp-bottom-detail">
<ion-label>{{ task.Folio }}</ion-label>
</div>
</div>
</ion-item>
</ion-list>
</ion-item>
</ion-list>
</div>
</div>
<div *ngIf="despachoList.length < 1">
<ion-list>
<ion-item>
<ion-thumbnail slot="end">
<ion-skeleton-text animated></ion-skeleton-text>
</ion-thumbnail>
<ion-label>
<h3><ion-skeleton-text animated style="width: 50%"></ion-skeleton-text></h3>
<p><ion-skeleton-text animated style="width: 80%"></ion-skeleton-text></p>
<p><ion-skeleton-text animated style="width: 60%"></ion-skeleton-text></p>
</ion-label>
</ion-item>
<ion-item>
<ion-thumbnail slot="end">
<ion-skeleton-text animated></ion-skeleton-text>
</ion-thumbnail>
<ion-label>
<h3><ion-skeleton-text animated style="width: 50%"></ion-skeleton-text></h3>
<p><ion-skeleton-text animated style="width: 80%"></ion-skeleton-text></p>
<p><ion-skeleton-text animated style="width: 60%"></ion-skeleton-text></p>
</ion-label>
</ion-item>
</ion-list>
</div>
</div>
<div *ngIf="!despachoList">
<ion-list>
<ion-item>
<ion-thumbnail slot="end">
<ion-skeleton-text animated></ion-skeleton-text>
</ion-thumbnail>
<ion-label>
<h3><ion-skeleton-text animated style="width: 50%"></ion-skeleton-text></h3>
<p><ion-skeleton-text animated style="width: 80%"></ion-skeleton-text></p>
<p><ion-skeleton-text animated style="width: 60%"></ion-skeleton-text></p>
</ion-label>
</ion-item>
<ion-item>
<ion-thumbnail slot="end">
<ion-skeleton-text animated></ion-skeleton-text>
</ion-thumbnail>
<ion-label>
<h3><ion-skeleton-text animated style="width: 50%"></ion-skeleton-text></h3>
<p><ion-skeleton-text animated style="width: 80%"></ion-skeleton-text></p>
<p><ion-skeleton-text animated style="width: 60%"></ion-skeleton-text></p>
</ion-label>
</ion-item>
</ion-list>
</div>
</ion-content>
@@ -1,20 +1,34 @@
@import '~src/function.scss';
/* CONTENT */
:host{
padding: 30px 20px 0 20px !important;
margin: 0;
margin: 0;
}
.header-2 {
border-top-right-radius: 24px;
border-top-left-radius: 24px;
}
ion-content, .header-2, .main-content{
padding: 30px 20px 0 20px !important;
background-color: white;
}
.main-content {
padding-top: 0px !important;
}
.title{
font-family: Roboto;
font-size: 25px;
color:#000;
overflow: auto;
.thetitle{
.thetitle {
width: fit-content;
float: left;
}
.theicon{
.theicon {
width: fit-content;
float: right;
}
@@ -167,11 +181,24 @@ ion-item{
margin: 2.5px 0 2.5px 71px;
float: left;
}
.div-logo img{
.div-logo img {
width: 100%;
}
.div-profile{
font-size: 45px;
float: right;
margin-right: 10px;
}
.exp-workflow{
float: left;
margin-left: 15px;
.label{
border-radius: 20px;
background: #ffb703;
font-size: 12px;
float: right;
padding: 2.5px 13.5px 2.5px 13.5px;
color: #fff;
}
}
@@ -14,252 +14,152 @@ import { DiscartExpedientModalPage } from 'src/app/pages/gabinete-digital/discar
import { AuthService } from 'src/app/services/auth.service';
import { DespachoPage } from 'src/app/pages/gabinete-digital/despachos/despacho/despacho.page';
import { NavigationExtras, Router } from '@angular/router';
@Component({
selector: 'app-despachos',
templateUrl: './despachos.page.html',
styleUrls: ['./despachos.page.scss'],
})
export class DespachosPage implements OnInit {
//profile:string;
//profile:string;
@ViewChild(CalendarComponent) myCal: CalendarComponent;
@ViewChild(CalendarComponent) myCal: CalendarComponent;
taskslist:DailyWorkTask[];
despachoList:DailyWorkTask[] = [];
deferimentoList:DailyWorkTask[] = [];
taskslist:DailyWorkTask[];
despachoList:any[] = [];
deferimentoList:DailyWorkTask[] = [];
taskList:tasksList[] = [];
taskList:tasksList[] = [];
taskType: string;
serialNumber:string;
totalDocs:any;
taskType: string;
serialNumber:string;
totalDocs:any;
@Input() profile:string;
segment:string;
@Output() openExpedientDetail:EventEmitter<any> = new EventEmitter<any>();
@Input() profile:string;
segment:string;
@Output() openExpedientDetail:EventEmitter<any> = new EventEmitter<any>();
loadedAttachments:any;
dicIndex = 0;
inicial = false
loadedAttachments:any;
dicIndex = 0;
inicial = false
constructor (
private processes:ProcessesService,
private modalController: ModalController,
private alertService: AlertService,
private authService: AuthService,
) {
this.profile = 'mdgpr';
constructor (
private processes:ProcessesService,
private modalController: ModalController,
private alertService: AlertService,
private authService: AuthService,
private router: Router,
) {
this.profile = 'mdgpr';
// alert('nice!')
}
ngOnInit() {
//Inicializar segment
this.segment = "despachos";
this.LoadList();
this.authService.userData$.subscribe((res:any)=>{
console.log(res);
});
}
ngOnInit() {
//Inicializar segment
this.segment = "despachos";
this.LoadList();
this.authService.userData$.subscribe((res:any)=>{
console.log(res);
});
}
segmentChanged(ev: any) {
this.LoadList();
}
notImplemented(){
this.alertService.presentAlert('Funcionalidade em desenvolvimento');
}
openExpedientDetailPage(data){
console.log(data);
this.openExpedientDetail.emit(data);
}
async LoadList(){
let result = await this.processes.GetTasksList("Despacho", false).toPromise();
//let despachos = result.reverse().filter(data => data.activityInstanceName == "Despacho (Paralelo)");
console.log(result);
await result.forEach( (element, index) => {
let task = {
"SerialNumber": element.serialNumber,
"Folio": element.workflowInstanceDataFields.Subject,
"Senders": element.workflowInstanceDataFields.Sender,
"CreateDate": formatDate(new Date(element.taskStartDate), 'yyyy-MM-dd HH:mm', 'pt'),
"DocumentURL": element.workflowInstanceDataFields.ViewerRequest,
"Remetente": element.workflowInstanceDataFields.Remetente,
"DocumentsQty": '',
"DocId": element.workflowInstanceDataFields.DocId,
"WorkflowName": element.workflowDisplayName,
"FolderID": element.workflowInstanceDataFields.FolderID,
"activityInstanceName": element.activityInstanceName,
}
this.despachoList.push(task)
});
this.despachoList = this.sortArrayISODate(this.despachoList).reverse()
this.despachoList.forEach( (element, index) => {
// let aplicationId = element.workflowInstanceDataFields.SourceSecFsID;
let FolderID = element['FolderID'];
this.processes.GetDocumentDetails(FolderID, '361').subscribe(res=>{
element.DocumentsQty = res.DocumentsTotal
})
});
}
sortArrayISODate(myArray: any){
return myArray.sort(function(a, b) {
return (a.CreateDate < b.CreateDate) ? -1 : ((a.CreateDate > b.CreateDate) ? 1 : 0);
});
}
doRefresh(event) {
this.LoadList();
setTimeout(() => {
event.target.complete();
}, 2000);
}
async viewExpedientDetail(serialNumber:any) {
console.log(this.profile);
const modal = await this.modalController.create({
component: DespachoPage,
componentProps:{
enterAnimation: "",
serialNumber: serialNumber,
profile: this.profile,
},
cssClass: 'modal modal-desktop',
});
await modal.present();
modal.onDidDismiss().then((res)=>{
console.log('refresh list');
segmentChanged(ev: any) {
this.LoadList();
});
}
// old
async openExpedientActionsModal(taskAction: any, task: any) {
//this.modalController.dismiss();
let classs;
if( window.innerWidth <= 800){
classs = 'modal modal-desktop'
} else {
classs = 'modal modal-desktop showAsideOptions'
}
const doc = this.loadedAttachments[ this.dicIndex];
task = {
serialNumber: doc.SourceId,
taskStartDate: doc.CreateDate,
isEvent: true,
workflowInstanceDataFields: {
FsId: doc.ApplicationId,
FolderID: null,
DocId: doc.SourceId,
Subject: doc.SourceName
},
}
const modal = await this.modalController.create({
component: ExpedientTaskModalPage,
componentProps: {
taskAction: taskAction,
task: task,
profile: this.profile,
},
cssClass: classs,
});
await modal.present();
modal.onDidDismiss().then(res=>{
console.log(res['data']);
if(res['data']=='openDiscart'){
console.log('open discart');
// this.distartExpedientModal();
}
});
}
async openBookMeetingModal(task: any) {
const doc = this.loadedAttachments[ this.dicIndex];
task = {
serialNumber: doc.SourceId,
taskStartDate: doc.CreateDate,
isEvent: true,
workflowInstanceDataFields: {
FsId: doc.ApplicationId,
FolderID: null,
DocId: doc.SourceId,
Subject: doc.SourceName
},
}
let classs;
if( window.innerWidth <= 800){
classs = 'book-meeting-modal modal modal-desktop'
} else {
classs = 'modal modal-desktop showAsideOptions'
}
const modal = await this.modalController.create({
component: BookMeetingModalPage,
componentProps: {
task: task,
},
cssClass: classs,
backdropDismiss: false
});
await modal.present();
modal.onDidDismiss();
}
}
async distartExpedientModal() {
const doc = this.taskList[ this.dicIndex];
notImplemented() {
this.alertService.presentAlert('Funcionalidade em desenvolvimento');
}
console.log(doc, this.dicIndex, this.taskList)
const modal = await this.modalController.create({
component: DiscartExpedientModalPage,
componentProps: {
serialNumber: doc.serialNumber,
folderId: doc.workflowInstanceDataFields.FolderID,
action: 'complete',
},
cssClass: 'discart-expedient-modal',
backdropDismiss: false
});
await modal.present();
modal.onDidDismiss().then(res=>{
if(res['data']=='close'){
// this.close();
/* console.log('2Expedient Discard closed2');
this.close();
this.openMenu(); */
}
});
}
openExpedientDetailPage(data) {
this.openExpedientDetail.emit(data);
}
async LoadList() {
let result = await this.processes.GetTasksList("Despacho", false).toPromise();
//let despachos = result.reverse().filter(data => data.activityInstanceName == "Despacho (Paralelo)");
this.despachoList = new Array();
console.log(result);
await result.forEach( (element, index) => {
let date = new Date(element.taskStartDate);
date.setMonth(date.getMonth() + 1);
let taskDate = date.getFullYear()+"-"+ date.getMonth()+"-"+date.getDate()+" "+date.getHours()+":"+date.getMinutes()+ ":"+date.getSeconds();
let task = {
"SerialNumber": element.serialNumber,
"Folio": element.workflowInstanceDataFields.Subject,
"Senders": element.workflowInstanceDataFields.Sender,
"CreateDate": taskDate,
"DocumentURL": element.workflowInstanceDataFields.ViewerRequest,
"Remetente": element.workflowInstanceDataFields.Remetente,
"DocumentsQty": 0,
"DocId": element.workflowInstanceDataFields.DocIdDiferimento,
"WorkflowName": element.workflowDisplayName,
"activityInstanceName": element.activityInstanceName,
}
this.despachoList.push(task)
});
this.despachoList = this.sortArrayISODate(this.despachoList).reverse()
this.despachoList.forEach( (element, index) => {
// let aplicationId = element.workflowInstanceDataFields.SourceSecFsID;
let FolderID = element['FolderID'];
this.processes.GetDocumentDetails(FolderID, '361').subscribe(res=>{
element.DocumentsQty = res.DocumentsTotal
})
});
}
sortArrayISODate(myArray: any) {
return myArray.sort(function(a, b) {
return (a.CreateDate < b.CreateDate) ? -1 : ((a.CreateDate > b.CreateDate) ? 1 : 0);
});
}
doRefresh(event) {
this.LoadList();
setTimeout(() => {
event.target.complete();
}, 2000);
}
async viewExpedientDetail(serialNumber:any) {
let navigationExtras: NavigationExtras = {
queryParams: {
"serialNumber": serialNumber,
}
};
this.router.navigate(['/home/gabinete-digital/despachos/despacho'], navigationExtras);
}
docIndex(index: number) {
this.dicIndex = index;
}
goBack() {
this.router.navigate(['/home/gabinete-digital']);
}
goToList() {
this.router.navigate(['/home/gabinete-digital/despachos']);
}
}
@@ -0,0 +1,17 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { DiplomaAssinarPage } from './diploma-assinar.page';
const routes: Routes = [
{
path: '',
component: DiplomaAssinarPage
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class DiplomaAssinarPageRoutingModule {}
@@ -0,0 +1,24 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { IonicModule } from '@ionic/angular';
import { DiplomaAssinarPageRoutingModule } from './diploma-assinar-routing.module';
import { DiplomaAssinarPage } from './diploma-assinar.page';
import { SharedModule } from 'src/app/shared/shared.module';
import { ComponentsModule } from 'src/app/components/components.module';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
ComponentsModule,
DiplomaAssinarPageRoutingModule
],
declarations: [DiplomaAssinarPage]
})
export class DiplomaAssinarPageModule {}
@@ -0,0 +1,125 @@
<ion-header class="ion-no-border">
<app-header > </app-header>
</ion-header>
<ion-content>
<div class="main-content d-flex height-100">
<div class="content d-flex flex-column" *ngIf="task">
<div class="main-header">
<div class="title-content d-flex justify-space-between">
<div class="font-30 cursor-pointer" (click)="goBack()" defaultHref="#">
<ion-icon slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
</div>
<div class="middle d-flex align-center flex-grow-1 ">
<ion-label class="title">{{ task.Folio}}</ion-label>
</div>
<div class="div-icon" (click)="openOptions()">
<!-- <ion-menu-button autoHide="false">
<ion-icon name="ellipsis-vertical-outline"></ion-icon>
</ion-menu-button> -->
<ion-icon class="font-25 cursor-pointer" name="ellipsis-vertical-outline"></ion-icon>
</div>
</div>
</div>
<div class="upper-content">
<div class="content-details">
<ion-label>
<p><span class="date">{{customDate}}</span><span class="label">{{ task.activityInstanceName }}</span></p>
<p><span class="color-red">{{ task.DeadlineType }}</span></p>
</ion-label>
</div>
</div>
<div class="line"></div>
<div class="middle-content">
<h5 *ngIf="intervenientes">Intervenientes</h5>
<ion-item class="ion-no-margin ion-no-padding">
<ion-label>
<div *ngFor="let interveniente of intervenientes">
<p>{{interveniente.Name}}</p>
</div>
</ion-label>
</ion-item>
<div *ngIf="cc.length > 0">
<h5>Com conhecimento</h5>
<ion-item class="ion-no-margin ion-no-padding">
<ion-label>
<div *ngFor="let c of cc">
<p>{{c.Name}}</p>
</div>
</ion-label>
</ion-item>
</div>
<div *ngIf="fulltask.workflowInstanceDataFields.TaskMessage">
<h5>Detalhes</h5>
<ion-item class="ion-no-margin ion-no-padding">
<p [innerHTML]="fulltask.workflowInstanceDataFields.TaskMessage"></p>
</ion-item>
</div>
</div>
<div class="bottom-content width-100">
<ion-list>
<h5>Documentos Anexados</h5>
<ion-item *ngFor="let attachment of attachments"
class="ion-no-margin ion-no-padding cursor-pointer">
<ion-label
(click)="viewDocument(attachment.DocId)">
<p *ngIf="attachment.Assunto" class="attach-title-item">{{ attachment.Assunto }}<span class="span-right color-red btn-size"><ion-icon hidden name="close"></ion-icon></span></p>
<p *ngIf="!attachment.Assunto" class="attach-title-item">{{ attachment.DocNumber }}<span class="span-right color-red btn-size"><ion-icon hidden name="close"></ion-icon></span></p>
<p><span class="span-left">{{attachment.Sender}}</span><span class="span-right">{{ attachment.DocDate | date: 'dd/MM/yy' }}</span></p>
</ion-label>
</ion-item>
</ion-list>
</div>
</div>
<div *ngIf="task" class="aside-right flex-column height-100">
<div class="buttons">
<button (click)="Assinar()" class="btn-cancel" shape="round" >Assinado</button>
<div class="solid"></div>
</div>
</div>
<div *ngIf="!task">
<ion-list>
<ion-list-header>
<ion-label>
<ion-skeleton-text animated style="width: 50%"></ion-skeleton-text>
</ion-label>
</ion-list-header>
<ion-item>
<ion-label>
<h3>
<ion-skeleton-text animated style="width: 50%"></ion-skeleton-text>
</h3>
<p>
<ion-skeleton-text animated style="width: 80%"></ion-skeleton-text>
</p>
</ion-label>
</ion-item>
<ion-item>
<ion-label>
<h3>
<ion-skeleton-text animated style="width: 50%"></ion-skeleton-text>
</h3>
<p><ion-skeleton-text animated style="width: 80%"></ion-skeleton-text></p>
</ion-label>
</ion-item>
<ion-item>
<ion-label>
<h3>
<ion-skeleton-text animated style="width: 50%"></ion-skeleton-text>
</h3>
<p>
<ion-skeleton-text animated style="width: 80%"></ion-skeleton-text>
</p>
</ion-label>
</ion-item>
<ion-button color="medium" shape="round" expand="block">
<!-- <ion-icon color="medium" name="attach" slot="start"></ion-icon> -->
<ion-skeleton-text animated style="width: 50%"></ion-skeleton-text>
</ion-button>
</ion-list>
</div>
</div>
</ion-content>
@@ -0,0 +1,259 @@
@import '~src/function.scss';
:host{
margin: 0;
}
.header-2 {
border-top-right-radius: 24px;
border-top-left-radius: 24px;
}
ion-content, .header-2, .main-content{
padding: 30px 20px 0 20px !important;
background-color: white;
}
.main-content {
padding-top: 0px !important;
}
.main-content{
background-color: #fff !important;
border-top-left-radius: 25px;
border-top-right-radius: 25px;
}
.content{
padding: 30px 20px 0 20px !important;
margin: 0;
float: left;
}
.color-red{
font-weight: 500;
color:#d30a0a !important;
}
.btn-size{
font-size: 18px !important;
}
.main-header{
font-family: Roboto;
border-top-left-radius: 25px;
border-top-right-radius: 25px;
background-color: #fff;
overflow:auto;
color:#000;
transform: translate3d(0, 1px, 0);
.header-top{
margin: 0px auto;
overflow: auto;
padding: 0 !important;
background: #fff;
.middle{
padding: 0!important;
float: left;
width: 280px;
margin: 2.5px 0 0 5px;
display: flex;
align-items: center;
}
.right{
padding: 0!important;
float: right;
font-size: 25px;
color: #0782c9;
margin: 5px 0 0 0;
}
}
.header-bottom{
width: 310px;
overflow: auto;
margin: 0 auto;
.header-bottom-icon{
width: 30px;
font-size: 25px;
float: left;
padding: 2px;
}
.header-bottom-contacts{
width: 275px;
font-size: 15px;
color: #797979;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
float: left;
padding: 5px;
margin: 1px;
}
}
.title{
font-size: 25px;
overflow: auto;
float: left;
padding-top: 4px;
padding-left: 5px;
}
.div-icon{
width: 40px;
float: right;
font-size: 35px;
overflow: auto;
padding: 1px;
}
}
ion-item-group{
margin: 15px;
}
ion-button{
display: block;
width: 80%;
margin: 20px auto;
}
.upper-content{
font-family: Roboto;
margin-left: 41px;
overflow: auto;
font-size: 18px;
.label{
border-radius: 20px;
background: #ffb703;
float: right;
padding: 5px 13.5px 5px 13.5px;
color: #fff;
}
.button-calendar-type ion-button{
height: 25px;
}
.content-details{
font-size: 17px;
.date{
color: #797979;
}
}
}
.middle-conten{
.middle-content p{
font-size: 16px;
}
}
.bottom-content{
//width: 360px;
margin: 0 auto;
.bottom-content h3{
font-size: 16px;
margin: 0 0 0 10px;
}
.attach-document{
font-size: 15px;
color: #0d89d1;
margin: 5px 5px 5px 10px;
padding: 5px;
float: left;
}
.attach-icon{
width: 37px;
font-size: 35px;
float: left;
}
.attach-title-item{
font-size: 18px;
width: 100%;
color:#0d89d1;
padding-bottom: 5px;
}
/* SPAN */
.span-left{
float: left;
font-size: 15x;
}
.span-right{
text-align: right;
float: right;
font-size: 13px;
}
}
.aside-right{
padding: 30px 20px 0 20px !important;
.arrow-right{
display: flex;
justify-content: flex-end;
margin-bottom: 20px;
.arrow-right-icon{
width: 37px;
float: right;
font-size: 35px;
overflow: hidden;
}
}
.buttons{
display: flex;
flex-wrap: wrap;
justify-content: space-between;
.btn-ok, .btn-cancel, .btn-delete{
height: auto !important;
font-size: 16px !important;
font-weight: 600 !important;
width: 100% !important;
margin-bottom: 10px !important;
padding: 15px !important;
}
}
.solid {
display: block;
width: 90%;
border-top: 1px solid #ebebeb;
margin: 0 auto !important;
margin-bottom: 10px !important;
}
}
@media only screen and (max-width: 800px) {
.content{
width: 100% !important;
}
.aside-right{
display: none;
}
}
@media only screen and (min-width: 801px) {
.div-icon{
display: none;
}
.content{
width: 65%;
border-right: 1px solid #d8d8d8;
}
.aside-right{
width: 35%;
}
}
@media only screen and (min-width: 1024px){
.content{
width: 70%;
}
.aside-right{
width: 30%;
}
}
@media only screen and (min-width: 1140px){
.content{
width: 75%;
}
.aside-right{
width: 25%;
}
}
@@ -0,0 +1,24 @@
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { IonicModule } from '@ionic/angular';
import { DiplomaAssinarPage } from './diploma-assinar.page';
describe('DiplomaAssinarPage', () => {
let component: DiplomaAssinarPage;
let fixture: ComponentFixture<DiplomaAssinarPage>;
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [ DiplomaAssinarPage ],
imports: [IonicModule.forRoot()]
}).compileComponents();
fixture = TestBed.createComponent(DiplomaAssinarPage);
component = fixture.componentInstance;
fixture.detectChanges();
}));
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -0,0 +1,191 @@
import { Component, OnInit } from '@angular/core';
import { ModalController, PopoverController } from '@ionic/angular';
import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
import { ProcessesService } from 'src/app/services/processes.service';
import { OptsExpedientePage } from 'src/app/shared/popover/opts-expediente/opts-expediente.page';
import { momentG } from 'src/plugin/momentG';
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
import { ActivatedRoute, NavigationExtras, Router } from '@angular/router';
import { BookMeetingModalPage } from '../../expediente/book-meeting-modal/book-meeting-modal.page';
import { BadRequestComponent } from 'src/app/shared/popover/bad-request/bad-request.component';
import { SuccessMessageComponent } from 'src/app/shared/popover/success-message/success-message.component';
import { DeplomaOptionsPage } from 'src/app/shared/popover/deploma-options/deploma-options.page';
@Component({
selector: 'app-diploma-assinar',
templateUrl: './diploma-assinar.page.html',
styleUrls: ['./diploma-assinar.page.scss'],
})
export class DiplomaAssinarPage implements OnInit {
months = ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"];
days = ["Domingo", "Segunda-feira", "Terça-feira", "Quarta-feira", "Quinta-feira", "Sexta-feira", "Sábado"];
serialnumber: string;
profile: string;
task: any
fulltask: any
intervenientes: any;
cc: any;
attachments:any;
customDate: any
constructor(
private processes: ProcessesService,
public popoverController: PopoverController,
private modalController: ModalController,
private iab: InAppBrowser,
private activatedRoute: ActivatedRoute,
private router: Router,
) {
this.activatedRoute.queryParams.subscribe(params => {
if(params["serialNumber"]) {
this.serialnumber = params["serialNumber"];
console.log(params["serialNumber"]);
}
});
}
ngOnInit() {
this.profile = "mdgpr";
this.LoadTaskDetail(this.serialnumber);
}
goBack(){
window.history.back()
}
async openOptions(taskAction?: any) {
const popover = await this.popoverController.create({
component: DeplomaOptionsPage,
cssClass: 'exp-options',
componentProps: {
task: this.task,
fulltask: this.fulltask,
taskAction:taskAction,
showEnviarPendentes: false
},
translucent: true
});
return await popover.present();
}
async LoadTaskDetail(serial: string) {
this.processes.GetTask(serial).subscribe(res => {
this.task = {
"SerialNumber": res.serialNumber,
"Folio": res.workflowInstanceDataFields.Subject,
"Senders": res.originator.email,
"CreateDate": momentG(new Date(res.taskStartDate),'yyyy-MM-dd HH:mm:ss'),
"DocumentURL": res.workflowInstanceDataFields.ViewerRequest,
"Remetente": res.workflowInstanceDataFields.Sender,
"Note": res.workflowInstanceDataFields.Note,
"FolderId": res.workflowInstanceDataFields.FolderID,
"FsId": '361',
"DocId": res.workflowInstanceDataFields.DispatchDocId,
"WorkflowName": res.workflowDisplayName,
"DeadlineType": res.workflowInstanceDataFields.DeadlineType,
"activityInstanceName": res.activityInstanceName,
}
this.fulltask = res;
console.log(this.task);
console.log('GetTask', res);
let thedate = new Date(this.task.CreateDate);
this.customDate = this.days[thedate.getDay()]+ ", " + thedate.getDate() +" de " + ( this.months[thedate.getMonth()]);
this.processes.GetTaskParticipants(this.task.FolderId).subscribe(users=>{
this.intervenientes = users.filter(user=>{
return user.Type == 'I';
});
this.cc = users.filter(user=>{
return user.Type == 'CC';
});
console.log(users);
});
this.getDocumentDetails(this.task.FolderId, '361');
});
}
viewDocument(docId:string){
this.processes.GetDocumentUrl(docId, '361').subscribe(res=>{
console.log(res);
const url: string = res.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1");
const browser = this.iab.create(url,"_blank");
browser.show();
});
}
getDocumentDetails(forlderId:string, applicationId:string) {
this.processes.GetDocumentDetails(forlderId,applicationId).subscribe(res=>{
this.attachments = res.Documents;
console.log(res['Documents']);
console.log(this.attachments);
})
}
async Assinar(){
let body = {
"serialNumber": this.serialnumber,
"action": "Assinado",
"ActionTypeId": 99999842,
"dataFields": {
"ReviewUserComment": '',
},
"AttachmentList": [],
}
try {
await this.processes.CompleteTask(body).toPromise()
this.goBack();
this.successMessage()
} catch (error) {
this.badRequest()
}
}
close(){
this.modalController.dismiss();
}
async successMessage(message?: string) {
const modal = await this.modalController.create({
component: SuccessMessageComponent,
componentProps: {
message: message || 'Processo efetuado' ,
},
cssClass: 'modal modal-desktop'
});
modal.present()
setTimeout(()=>{
modal.dismiss()
},3000)
}
async badRequest(message?: string) {
const modal = await this.modalController.create({
component: BadRequestComponent,
componentProps: {
message: message || 'Processo não efetuado' ,
},
cssClass: 'modal modal-desktop'
});
modal.present()
setTimeout(()=>{
modal.dismiss()
},3000)
}
}
@@ -0,0 +1,21 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { DiplomasAssinarPage } from './diplomas-assinar.page';
const routes: Routes = [
{
path: '',
component: DiplomasAssinarPage
},
{
path: 'diploma-assinar',
loadChildren: () => import('./diploma-assinar/diploma-assinar.module').then( m => m.DiplomaAssinarPageModule)
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class DiplomasAssinarPageRoutingModule {}
@@ -0,0 +1,23 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { IonicModule } from '@ionic/angular';
import { DiplomasAssinarPageRoutingModule } from './diplomas-assinar-routing.module';
import { DiplomasAssinarPage } from './diplomas-assinar.page';
import { SharedModule } from 'src/app/shared/shared.module';
import { ComponentsModule } from 'src/app/components/components.module';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
DiplomasAssinarPageRoutingModule,
ComponentsModule
],
declarations: [DiplomasAssinarPage]
})
export class DiplomasAssinarPageModule {}
@@ -0,0 +1,94 @@
<ion-header class="ion-no-border">
<app-header > </app-header>
</ion-header>
<ion-header class="ion-no-border header-2">
<div class="title">
<div class="thetitle"><ion-label >Diplomas</ion-label></div>
<div class="theicon">
<button class="btn-no-color" (click)="doRefresh($event)">
<ion-icon slot="end" class="title-icon" name="reload-circle"></ion-icon>
</button>
</div>
<div class="bottom-title d-flex"><h3 class="bottom-text">Diplomas por Assinar</h3></div>
</div>
</ion-header>
<ion-content>
<div class="main-content">
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
<ion-refresher-content
pullingIcon="chevron-down-circle-outline"
pullingText="deslize para actualizar"
refreshingSpinner="circles"
refreshingText="A actualizar...">
</ion-refresher-content>
</ion-refresher>
<div class="width-100">
<div *ngIf="diplomasList">
<ion-list >
<!-- *ngFor = "let task of parecerList; let i = index"
(click)="viewExpedientDetail(task.SerialNumber)" -->
<ion-item
class="expediente ion-no-padding cursor-pointer"
*ngFor = "let task of diplomasList"
(click)="goToDiploma(task.SerialNumber)"
>
<!-- (click)="viewExpedientDetail(task.SerialNumber)" -->
<!-- [routerLink]="['/home/gabinete-digital/expediente',task.SerialNumber]" -->
<div class="item width-100">
<div class="exp-top-detail">
<div class="exp-date">
<ion-label>{{ task.CreateDate | date: 'dd-MM-yy' }}</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">
<ion-label>{{ task.Folio }}</ion-label>
</div>
</div>
</ion-item>
</ion-list>
</div>
</div>
<div *ngIf="!diplomasList">
<ion-list>
<ion-item>
<ion-thumbnail slot="end">
<ion-skeleton-text animated></ion-skeleton-text>
</ion-thumbnail>
<ion-label>
<h3><ion-skeleton-text animated style="width: 50%"></ion-skeleton-text></h3>
<p><ion-skeleton-text animated style="width: 80%"></ion-skeleton-text></p>
<p><ion-skeleton-text animated style="width: 60%"></ion-skeleton-text></p>
</ion-label>
</ion-item>
<ion-item>
<ion-thumbnail slot="end">
<ion-skeleton-text animated></ion-skeleton-text>
</ion-thumbnail>
<ion-label>
<h3><ion-skeleton-text animated style="width: 50%"></ion-skeleton-text></h3>
<p><ion-skeleton-text animated style="width: 80%"></ion-skeleton-text></p>
<p><ion-skeleton-text animated style="width: 60%"></ion-skeleton-text></p>
</ion-label>
</ion-item>
</ion-list>
</div>
</div>
</ion-content>
@@ -0,0 +1,197 @@
@import '~src/function.scss';
/* CONTENT */
:host{
margin: 0;
}
.header-2 {
border-top-right-radius: 24px;
border-top-left-radius: 24px;
}
ion-content, .header-2, .main-content{
padding: 30px 20px 0 20px !important;
background-color: white;
}
.main-content {
padding-top: 0px !important;
}
.title{
font-family: Roboto;
font-size: 25px;
color:#000;
overflow: auto;
.thetitle{
width: fit-content;
float: left;
}
.theicon{
width: fit-content;
float: right;
}
}
.bottom-title{
width: calc(100% - 40px);
margin-left: 20px !important;
margin-right: 20px !important;
margin: 0 auto;
align-items: center;
justify-content: center;
border-bottom: 5px solid #42b9fe;
.bottom-text{
font-size: 15px !important;
font-family: Roboto !important;
color: #0d89d1 !important;
}
}
.item-list-small{
font-size: 11px;
overflow: hidden;
}
.ion-item-class{
padding: 0;
}
.label-text{
width: 100%;
padding: 0;
margin: 0;
}
//DIV
ion-item{
--background: none;
}
.item {
background-color: var(--white);
margin: 0 auto;
margin-bottom: 10px;
overflow: hidden;
}
.div-content-expediente{
width: 100%;
float: left;
border-left: 3px solid #dae3f3;
padding:5px 5px 15px 5px;
margin: 10px 0 10px 0;
background: #dae3f3;
border-radius: 20px;
}
.div-content-pendentes{
width: 100%;
float: left;
border-left: 3px solid #d9d9d9;
padding: 5px;
}
.div-content-expediente h3, .div-content-pendentes h3{
margin: 0;
padding: 0;
font-size: 14pt;
width: 100%;
}
.div-icon{
width: 10%;
font-size: 20px;
float: left;
color: #808080;
}
.div-icon ion-icon{
display: block;
margin: 0 auto;
}
.div-content-expediente p, .div-content-pendentes p{
font-size: 14pt;
color: rgb(94, 92, 92);
padding: 0;
margin: 0;
}
.span-left{
float: left;
font-size: 12px;
padding-left: 18px;
}
.span-right{
text-align: right;
float: right;
font-size: 12px;
padding-right: 18px;
}
/* New CSS */
.expediente{
padding-top: 10px;
}
.exp-list-item{
overflow: auto;
margin: 10px auto;
}
.exp-top-detail{
width: 100%;
overflow: auto;
}
.exp-date{
width: auto;
font-family: Roboto;
font-size: 13px;
font-weight: normal;
font-stretch: normal;
font-style: normal;
line-height: normal;
letter-spacing: normal;
color: #797979;
float: left;
}
.exp-remetente{
font-family: Roboto;
font-size: 13px;
font-weight: normal;
color: #000000;
float: left;
margin-left: 16px;
}
.exp-icon{
width: 45px;
float: right;
font-size: 13px;
}
.exp-icon ion-icon{
font-size: 25px;
color: #42b9fe;
}
.exp-bottom-detail{
float: left;
font-family: Roboto;
font-size: 16px;
font-weight: 700;
color: #0d89d1;
}
.div-top-header{
width: 400px;
margin: 6px auto;
background-color: #0782c9;
overflow: auto;
}
.div-search{
font-size: 45px;
float: left;
margin: 0 0 0 10px
}
.div-logo{
background: transparent;
width: 150px;
margin: 2.5px 0 2.5px 71px;
float: left;
}
.div-logo img{
width: 100%;
}
.div-profile{
font-size: 45px;
float: right;
margin-right: 10px;
}
@@ -0,0 +1,24 @@
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { IonicModule } from '@ionic/angular';
import { DiplomasAssinarPage } from './diplomas-assinar.page';
describe('DiplomasAssinarPage', () => {
let component: DiplomasAssinarPage;
let fixture: ComponentFixture<DiplomasAssinarPage>;
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [ DiplomasAssinarPage ],
imports: [IonicModule.forRoot()]
}).compileComponents();
fixture = TestBed.createComponent(DiplomasAssinarPage);
component = fixture.componentInstance;
fixture.detectChanges();
}));
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -0,0 +1,105 @@
import { Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';
import { NavigationExtras, Router } from '@angular/router';
import { DailyWorkTask, tasksList } from '../../../models/dailyworktask.model';
import { ProcessesService } from 'src/app/services/processes.service';
import { formatDate } from '@angular/common';
import { ModalController, NavParams } from '@ionic/angular';
import { AlertService } from 'src/app/services/alert.service';
import { DiplomaPage } from 'src/app/pages/gabinete-digital/diplomas/diploma/diploma.page';
@Component({
selector: 'app-diplomas-assinar',
templateUrl: './diplomas-assinar.page.html',
styleUrls: ['./diplomas-assinar.page.scss'],
})
export class DiplomasAssinarPage implements OnInit {
//profile:string;
diplomasList:DailyWorkTask[] = [];
showLoader: boolean;
totalDocs:any;
serialNumber:string;
@Input() profile:string;
@Input() segment:string;
constructor(
private processes:ProcessesService,
private modalController: ModalController,
private alertService: AlertService,
private router: Router,
) {
}
ngOnInit() {
this.LoadList();
}
goToDiploma(serialNumber:any){
let navigationExtras: NavigationExtras = {
queryParams: {
"serialNumber": serialNumber,
}
};
this.router.navigate(['/home/gabinete-digital/diplomas-assinar/diploma-assinar'], navigationExtras);
}
doRefresh() {
this.LoadList();
setTimeout(() => {
//event.target.complete();
}, 2000);
}
async LoadList(){
let diplomas = await this.processes.GetTasksList("Despacho do Presidente da República", false).toPromise();
this.diplomasList = new Array();
console.log(diplomas);
let diplomasAssinar = diplomas.reverse().filter(data => data.activityInstanceName == "Assinar Diploma");
console.log(diplomasAssinar);
diplomasAssinar.forEach(element => {
let DocId = element.workflowInstanceDataFields.FolderID;
let ApplicationId = element.workflowInstanceDataFields.ApplicationId;
this.processes.GetDocumentDetails(DocId, '361').subscribe(res=>{
this.totalDocs = res.DocumentsTotal;
console.log(res.DocumentsTotal);
let task = {
"SerialNumber": element.serialNumber,
"Folio": element.workflowInstanceDataFields.Subject,
"Senders": element.workflowInstanceDataFields.Sender,
"CreateDate": formatDate(new Date(element.taskStartDate), 'yyyy-MM-dd HH:mm', 'pt'),
"DocumentURL": element.workflowInstanceDataFields.ViewerRequest,
"Remetente": element.workflowInstanceDataFields.Remetente,
"DocumentsQty": this.totalDocs,
"DocId": element.workflowInstanceDataFields.DocId,
"WorkflowName": element.workflowDisplayName,
"activityInstanceName": element.activityInstanceName,
}
this.diplomasList.push(task);
},
(error)=>{
let task = {
"SerialNumber": element.serialNumber,
"Folio": element.workflowInstanceDataFields.Subject,
"Senders": element.workflowInstanceDataFields.Sender,
"CreateDate": formatDate(new Date(element.taskStartDate), 'yyyy-MM-dd HH:mm', 'pt'),
"DocumentURL": element.workflowInstanceDataFields.ViewerRequest,
"Remetente": element.workflowInstanceDataFields.Remetente,
"DocumentsQty": 0,
"DocId": element.workflowInstanceDataFields.DocId,
"WorkflowName": element.workflowDisplayName,
"activityInstanceName": element.activityInstanceName,
}
this.diplomasList.push(task);
});
});
this.showLoader = false;
}
goBack() {
this.router.navigate(['/home/gabinete-digital']);
// window.history.back()
}
}
@@ -7,12 +7,15 @@ import { IonicModule } from '@ionic/angular';
import { DiplomaPageRoutingModule } from './diploma-routing.module';
import { DiplomaPage } from './diploma.page';
import { SharedModule } from 'src/app/shared/shared.module';
import { ComponentsModule } from 'src/app/components/components.module';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
ComponentsModule,
DiplomaPageRoutingModule
],
declarations: [DiplomaPage]
@@ -1,24 +1,30 @@
<ion-header class="ion-no-border">
<app-header></app-header>
</ion-header>
<ion-content>
<div class="main-content d-flex height-100">
<div class="content d-flex flex-column" *ngIf="task">
<div class="main-header">
<div class="title-content">
<app-btn-modal-dismiss></app-btn-modal-dismiss>
<div class="middle">
<div class="title-content d-flex justify-space-between">
<div class="font-30 cursor-pointer" (click)="goBack()" defaultHref="#">
<ion-icon slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
</div>
<div class="middle d-flex align-center flex-grow-1 ">
<ion-label class="title">{{ task.Folio}}</ion-label>
</div>
<div class="div-icon" (click)="openOptions()">
<!-- <ion-menu-button autoHide="false">
<ion-icon name="ellipsis-vertical-outline"></ion-icon>
</ion-menu-button> -->
<ion-icon class="font-25 cursor-pointer" name="ellipsis-vertical-outline"></ion-icon>
<ion-icon class="font-25 cursor-pointer" src="assets/images/icons-menu.svg"></ion-icon>
</div>
</div>
</div>
<div class="upper-content">
<div class="content-details">
<ion-label>
<p><span class="date">{{customDate}}</span><span class="label">{{ task.WorkflowName }}</span></p>
<p><span class="date">{{customDate}}</span><span class="label">{{ task.activityInstanceName }}</span></p>
<p><span class="color-red">{{ task.DeadlineType }}</span></p>
</ion-label>
</div>
@@ -43,17 +49,18 @@
</ion-label>
</ion-item>
</div>
<div *ngIf="task.Note">
<div *ngIf="fulltask.workflowInstanceDataFields.TaskMessage">
<h5>Detalhes</h5>
<ion-item class="ion-no-margin ion-no-padding">
<p [innerHTML]="task.Note"></p>
<p [innerHTML]="fulltask.workflowInstanceDataFields.TaskMessage"></p>
</ion-item>
</div>
</div>
<div class="bottom-content width-100">
<ion-list>
<h5>Documentos Anexados</h5>
<ion-item *ngFor="let attachment of attachments" class="ion-no-margin ion-no-padding">
<ion-item *ngFor="let attachment of attachments"
class="ion-no-margin ion-no-padding cursor-pointer">
<ion-label
(click)="viewDocument(attachment.DocId)">
<p *ngIf="attachment.Assunto" class="attach-title-item">{{ attachment.Assunto }}<span class="span-right color-red btn-size"><ion-icon hidden name="close"></ion-icon></span></p>
@@ -66,15 +73,14 @@
</div>
<div *ngIf="task" class="aside-right flex-column height-100">
<div class="buttons">
<button (click)="openAddNoteModal('Executado')" class="btn-cancel" shape="round" >Executado</button>
<button (click)="openDelegarModal(task)" class="btn-cancel" shape="round" >Delegar</button>
<div class="solid"></div>
<button (click)="openExpedientActionsModal('0',fulltask)" class="btn-ok" shape="round" >Efectuar Despacho</button>
<button (click)="openExpedientActionsModal('1',fulltask)" class="btn-cancel" shape="round" >Solicitar Parecer</button>
<div class="buttons" *ngIf="task.activityInstanceName == 'Revisar Diploma'">
<button (click)="openAddNoteModal('Solicitar assinatura')" class="btn-cancel" shape="round" >Solicitar assinatura do Presidente</button>
<button (click)="openAddNoteModal('Solicitar alteração')" class="btn-cancel" shape="round" >Solicitar alteração</button>
<button (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
<div class="solid"></div>
<button (click)="sendExpedienteToPending()" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
</div>
<div class="buttons" *ngIf="task.activityInstanceName == 'Diploma Assinado'">
<button (click)="openAddNoteModal('Concluir diploma')" class="btn-cancel" shape="round" >Concluir</button>
</div>
</div>
@@ -1,4 +1,9 @@
@import '~src/function.scss';
.main-content{
background-color: #fff !important;
border-top-left-radius: 25px;
border-top-right-radius: 25px;
}
.content{
padding: 30px 20px 0 20px !important;
margin: 0;
@@ -20,7 +25,6 @@
color:#000;
transform: translate3d(0, 1px, 0);
.header-top{
width: 360px;
margin: 0px auto;
overflow: auto;
padding: 0 !important;
@@ -1,12 +1,16 @@
import { Component, OnInit } from '@angular/core';
import { ModalController, NavParams, PopoverController } from '@ionic/angular';
import { ModalController, PopoverController } from '@ionic/angular';
import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
import { CreateProcessPage } from 'src/app/modals/create-process/create-process.page';
import { DelegarPage } from 'src/app/modals/delegar/delegar.page';
import { ProcessesService } from 'src/app/services/processes.service';
import { OptsExpedientePage } from 'src/app/shared/popover/opts-expediente/opts-expediente.page';
import { momentG } from 'src/plugin/momentG';
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
import { ActivatedRoute, NavigationExtras, Router } from '@angular/router';
import { BookMeetingModalPage } from '../../expediente/book-meeting-modal/book-meeting-modal.page';
import { BadRequestComponent } from 'src/app/shared/popover/bad-request/bad-request.component';
import { SuccessMessageComponent } from 'src/app/shared/popover/success-message/success-message.component';
import { DeplomaOptionsPage } from 'src/app/shared/popover/deploma-options/deploma-options.page';
@Component({
selector: 'app-diploma',
@@ -28,23 +32,41 @@ export class DiplomaPage implements OnInit {
customDate: any
constructor(
private navParams: NavParams,
private processes: ProcessesService,
public popoverController: PopoverController,
private modalController: ModalController,
private iab: InAppBrowser,
private activatedRoute: ActivatedRoute,
private router: Router,
) {
this.serialnumber = this.navParams.get('serialNumber');
this.profile = this.navParams.get('profile');
this.activatedRoute.queryParams.subscribe(params => {
if(params["serialNumber"]) {
this.serialnumber = params["serialNumber"];
console.log(params["serialNumber"]);
}
});
this.LoadTaskDetail(this.serialnumber);
}
ngOnInit() {
this.profile = "mdgpr";
this.LoadTaskDetail(this.serialnumber);
}
goBack() {
// let navigationExtras: NavigationExtras = {
// queryParams: {
// "diplomas": true,
// }
// };
// this.router.navigate(['/home/gabinete-digital'], navigationExtras);
window.history.back()
}
async openOptions(taskAction?: any) {
const popover = await this.popoverController.create({
component: OptsExpedientePage,
component: DeplomaOptionsPage,
cssClass: 'exp-options',
componentProps: {
task: this.task,
@@ -73,6 +95,7 @@ export class DiplomaPage implements OnInit {
"DocId": res.workflowInstanceDataFields.DispatchDocId,
"WorkflowName": res.workflowDisplayName,
"DeadlineType": res.workflowInstanceDataFields.DeadlineType,
"activityInstanceName": res.activityInstanceName,
}
this.fulltask = res;
@@ -98,6 +121,15 @@ export class DiplomaPage implements OnInit {
});
}
viewDocument(docId:string){
this.processes.GetDocumentUrl(docId, '361').subscribe(res=>{
console.log(res);
const url: string = res.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1");
const browser = this.iab.create(url,"_blank");
browser.show();
});
}
getDocumentDetails(forlderId:string, applicationId:string) {
this.processes.GetDocumentDetails(forlderId,applicationId).subscribe(res=>{
@@ -107,6 +139,63 @@ export class DiplomaPage implements OnInit {
})
}
async askSignature(note:string, documents:any){
let body = {
"serialNumber": this.serialnumber,
"action": "Aprovar",
"ActionTypeId": 99999840,
"dataFields": {
"ReviewUserComment": note,
},
"AttachmentList" :documents,
}
try {
await this.processes.CompleteTask(body).toPromise()
this.close();
this.successMessage()
} catch (error) {
this.badRequest()
}
}
async askToChange(note:string, documents:any){
let body = {
"serialNumber": this.serialnumber,
"action": "Retificar",
"ActionTypeId": 99999841,
"dataFields": {
"ReviewUserComment": note,
},
"AttachmentList" :documents,
}
try {
await this.processes.CompleteTask(body).toPromise()
this.successMessage()
} catch (error) {
this.badRequest()
}
}
async finish(note:string, documents:any){
let body = {
"serialNumber": this.serialnumber,
"action": "Concluir",
"ActionTypeId": 95,
"dataFields": {
"ReviewUserComment": note,
},
"AttachmentList" :documents,
}
try {
await this.processes.CompleteTask(body).toPromise();
this.successMessage()
} catch (error) {
this.badRequest()
}
}
async openAddNoteModal(actionName:string) {
let classs;
@@ -127,67 +216,37 @@ export class DiplomaPage implements OnInit {
modal.onDidDismiss().then(res => {
if(res.data){
if(actionName == 'Executado'){
//this.executado(res.data.note,res.data.documents);
const DocumentToSave = res.data.documents.map((e) => {
return {
ApplicationId: e.ApplicationType,
SourceId: e.Id,
}
});
let docs = {
ProcessInstanceID: "",
Attachments: DocumentToSave,
}
else if(actionName == 'Arquivar'){
//this.arquivar(res.data.note,res.data.documents);
if(actionName == 'Solicitar assinatura'){
this.askSignature(res.data.note, docs);
this.goBack();
}
else if(actionName == 'Solicitar alteração'){
this.askToChange(res.data.note, docs);
this.goBack();
}
else if(actionName == 'Concluir diploma'){
this.finish(res.data.note, docs);
this.goBack();
}
}
});
}
async openDelegarModal(task: any) {
let classs;
if( window.innerWidth <= 800){
classs = 'book-meeting-modal modal modal-desktop'
} else {
classs = 'modal modal-desktop showAsideOptions'
}
const modal = await this.modalController.create({
component: DelegarPage,
componentProps: {
task: this.task,
},
cssClass: classs,
backdropDismiss: false
});
await modal.present();
modal.onDidDismiss();
}
async openExpedientActionsModal(taskAction: any, task: any) {
//this.modalController.dismiss();
let classs;
if( window.innerWidth <= 800){
classs = 'modal modal-desktop'
} else {
classs = 'modal modal-desktop showAsideOptions'
}
const modal = await this.modalController.create({
component: CreateProcessPage,
componentProps: {
taskAction: taskAction,
task: task,
profile: this.profile,
},
cssClass: classs,
});
await modal.present();
modal.onDidDismiss().then(res=>{
console.log(res['data']);
if(res['data']=='openDiscart'){
console.log('open discart');
// this.distartExpedientModal();
}
});
}
async openBookMeetingModal(task: any) {
let classs;
if( window.innerWidth <= 800){
@@ -207,15 +266,42 @@ export class DiplomaPage implements OnInit {
modal.onDidDismiss();
}
sendExpedienteToPending(){
this.processes.SetTaskToPending(this.serialnumber).subscribe(res=>{
console.log(res);
this.close();
});
}
close(){
this.modalController.dismiss();
}
async successMessage(message?: string) {
const modal = await this.modalController.create({
component: SuccessMessageComponent,
componentProps: {
message: message || 'Processo efetuado' ,
},
cssClass: 'modal modal-desktop'
});
modal.present()
setTimeout(()=>{
modal.dismiss()
},3000)
}
async badRequest(message?: string) {
const modal = await this.modalController.create({
component: BadRequestComponent,
componentProps: {
message: message || 'Processo não efetuado' ,
},
cssClass: 'modal modal-desktop'
});
modal.present()
setTimeout(()=>{
modal.dismiss()
},3000)
}
}
@@ -7,13 +7,16 @@ import { IonicModule } from '@ionic/angular';
import { DiplomasPageRoutingModule } from './diplomas-routing.module';
import { DiplomasPage } from './diplomas.page';
import { SharedModule } from 'src/app/shared/shared.module';
import { ComponentsModule } from 'src/app/components/components.module';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
DiplomasPageRoutingModule
DiplomasPageRoutingModule,
ComponentsModule
],
declarations: [DiplomasPage]
})
@@ -1,9 +1,129 @@
<ion-header>
<ion-toolbar>
<ion-title>diplomas</ion-title>
</ion-toolbar>
<ion-header class="ion-no-border">
<app-header></app-header>
</ion-header>
<ion-header class="ion-no-border header-2">
<div class="title">
<app-btn-modal-dismiss (click)="goBack()"></app-btn-modal-dismiss>
<div class="thetitle"><ion-label >Diplomas</ion-label></div>
<div class="theicon">
<button class="btn-no-color" (click)="doRefresh($event)">
<ion-icon slot="end" class="title-icon" name="reload-circle"></ion-icon>
</button>
</div>
</div>
<ion-toolbar>
<ion-segment [(ngModel)]="segment" (ionChange)="segmentChanged($event)">
<ion-segment-button value="validar">
Diplomas por validar
</ion-segment-button>
<ion-segment-button value="assinados">
Diplomas assinados PR
</ion-segment-button>
</ion-segment>
</ion-toolbar>
</ion-header>
<ion-content>
<div class="main-content">
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
<ion-refresher-content
pullingIcon="chevron-down-circle-outline"
pullingText="deslize para actualizar"
refreshingSpinner="circles"
refreshingText="A actualizar...">
</ion-refresher-content>
</ion-refresher>
<div class="width-100" [ngSwitch]="segment">
<div *ngIf="diplomasList">
<ion-list *ngSwitchCase="'validar'">
<ion-item
class="expediente ion-no-padding cursor-pointer"
*ngFor = "let task of diplomasList"
(click)="goToDiploma(task.SerialNumber)"
>
<div class="item width-100">
<div class="exp-top-detail">
<div class="exp-date">
<ion-label>{{ task.CreateDate | date: 'dd-MM-yy' }}</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">
<ion-label>{{ task.Folio }}</ion-label>
</div>
</div>
</ion-item>
</ion-list>
</div>
<div *ngIf="diplomasAssinadoList">
<ion-list *ngSwitchCase="'assinados'">
<ion-item
class="expediente ion-no-padding cursor-pointer"
*ngFor = "let task of diplomasList"
(click)="goToDiploma(task.SerialNumber)"
>
<div class="item width-100">
<div class="exp-top-detail">
<div class="exp-date">
<ion-label>{{ task.CreateDate | date: 'dd-MM-yy' }}</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">
<ion-label>{{ task.Folio }}</ion-label>
</div>
</div>
</ion-item>
</ion-list>
</div>
</div>
<div *ngIf="!diplomasList">
<ion-list>
<ion-item>
<ion-thumbnail slot="end">
<ion-skeleton-text animated></ion-skeleton-text>
</ion-thumbnail>
<ion-label>
<h3><ion-skeleton-text animated style="width: 50%"></ion-skeleton-text></h3>
<p><ion-skeleton-text animated style="width: 80%"></ion-skeleton-text></p>
<p><ion-skeleton-text animated style="width: 60%"></ion-skeleton-text></p>
</ion-label>
</ion-item>
<ion-item>
<ion-thumbnail slot="end">
<ion-skeleton-text animated></ion-skeleton-text>
</ion-thumbnail>
<ion-label>
<h3><ion-skeleton-text animated style="width: 50%"></ion-skeleton-text></h3>
<p><ion-skeleton-text animated style="width: 80%"></ion-skeleton-text></p>
<p><ion-skeleton-text animated style="width: 60%"></ion-skeleton-text></p>
</ion-label>
</ion-item>
</ion-list>
</div>
</div>
</ion-content>
@@ -0,0 +1,190 @@
@import '~src/function.scss';
/* CONTENT */
:host{
margin: 0;
}
.header-2 {
border-top-right-radius: 24px;
border-top-left-radius: 24px;
}
ion-content, .header-2, .main-content{
padding: 30px 20px 0 20px !important;
background-color: white;
}
.main-content {
padding-top: 0px !important;
}
.title{
font-family: Roboto;
font-size: 25px;
color:#000;
overflow: auto;
.thetitle{
width: fit-content;
float: left;
}
.theicon{
width: fit-content;
float: right;
}
}
.item-list-small{
font-size: 11px;
overflow: hidden;
}
.ion-item-class{
padding: 0;
}
.label-text{
width: 100%;
padding: 0;
margin: 0;
}
//DIV
ion-item{
--background: none;
}
.item {
//border-radius: 15px;
//box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.07);
//Sborder: solid 1px #e9e9e9;
background-color: var(--white);
margin: 0 auto;
//padding: 10px;
margin-bottom: 10px;
overflow: hidden;
}
.div-content-expediente{
width: 100%;
float: left;
border-left: 3px solid #dae3f3;
padding:5px 5px 15px 5px;
margin: 10px 0 10px 0;
background: #dae3f3;
border-radius: 20px;
}
.div-content-pendentes{
width: 100%;
float: left;
border-left: 3px solid #d9d9d9;
padding: 5px;
}
.div-content-expediente h3, .div-content-pendentes h3{
margin: 0;
padding: 0;
font-size: 14pt;
width: 100%;
}
.div-icon{
width: 10%;
font-size: 20px;
float: left;
color: #808080;
}
.div-icon ion-icon{
display: block;
margin: 0 auto;
}
.div-content-expediente p, .div-content-pendentes p{
font-size: 14pt;
color: rgb(94, 92, 92);
padding: 0;
margin: 0;
}
.span-left{
/* border: 1px solid red; */
float: left;
font-size: 12px;
padding-left: 18px;
}
.span-right{
/* border: 1px solid blue; */
text-align: right;
float: right;
font-size: 12px;
padding-right: 18px;
}
/* New CSS */
.expediente{
padding-top: 10px;
}
.exp-list-item{
//width: 368px;
overflow: auto;
/* border-bottom: 1px solid gray; */
margin: 10px auto;
}
.exp-top-detail{
width: 100%;
overflow: auto;
}
.exp-date{
width: auto;
font-family: Roboto;
font-size: 13px;
font-weight: normal;
font-stretch: normal;
font-style: normal;
line-height: normal;
letter-spacing: normal;
color: #797979;
float: left;
}
.exp-remetente{
//width: 200px;
font-family: Roboto;
font-size: 13px;
font-weight: normal;
color: #000000;
float: left;
margin-left: 16px;
}
.exp-icon{
width: 45px;
float: right;
font-size: 13px;
}
.exp-icon ion-icon{
font-size: 25px;
color: #42b9fe;
}
.exp-bottom-detail{
float: left;
font-family: Roboto;
font-size: 16px;
font-weight: 700;
color: #0d89d1;
}
.div-top-header{
width: 400px;
margin: 6px auto;
background-color: #0782c9;
overflow: auto;
}
.div-search{
font-size: 45px;
float: left;
margin: 0 0 0 10px
}
.div-logo{
background: transparent;
width: 150px;
margin: 2.5px 0 2.5px 71px;
float: left;
}
.div-logo img{
width: 100%;
}
.div-profile{
font-size: 45px;
float: right;
margin-right: 10px;
}
@@ -1,4 +1,11 @@
import { Component, OnInit } from '@angular/core';
import { Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';
import { ActivatedRoute, NavigationExtras, Router } from '@angular/router';
import { DailyWorkTask, tasksList } from '../../../models/dailyworktask.model';
import { ProcessesService } from 'src/app/services/processes.service';
import { formatDate } from '@angular/common';
import { ModalController, NavParams } from '@ionic/angular';
import { AlertService } from 'src/app/services/alert.service';
import { DiplomaPage } from 'src/app/pages/gabinete-digital/diplomas/diploma/diploma.page';
@Component({
selector: 'app-diplomas',
@@ -6,10 +13,215 @@ import { Component, OnInit } from '@angular/core';
styleUrls: ['./diplomas.page.scss'],
})
export class DiplomasPage implements OnInit {
diplomasList:DailyWorkTask[] = [];
diplomasAssinadoList:DailyWorkTask[] = [];
showLoader: boolean;
totalDocs:any;
serialNumber:string;
constructor() { }
@Input() profile:string;
@Input() segment:string;
ngOnInit() {
constructor(
private processes:ProcessesService,
private modalController: ModalController,
private alertService: AlertService,
private router: Router,
private activatedRoute: ActivatedRoute,
) {
}
}
ngOnInit() {
this.activatedRoute.queryParams.subscribe(params => {
if(params['segment'] == 'validar') {
this.segment = 'validar';
} else if (params['segment'] == 'assinados') {
this.segment = 'assinados';
}
this.LoadList();
});
this.LoadList();
}
segmentChanged(ev: any) {
let navigationExtras: NavigationExtras;
if (this.segment == 'assinados') {
navigationExtras= { queryParams: {"assinados": true,}};
} else if (this.segment == 'validar') {
navigationExtras = { queryParams: {"validar": true,}};
}
this.router.navigate(['/home/gabinete-digital/diplomas'], navigationExtras);
// this.LoadList();
}
goToDiploma(serialNumber:any) {
let navigationExtras: NavigationExtras = {
queryParams: {
"serialNumber": serialNumber,
}
}
this.router.navigate(['/home/gabinete-digital/diplomas/diploma'], navigationExtras);
}
notImplemented(){
this.alertService.presentAlert('Funcionalidade em desenvolvimento');
}
async LoadList(){
let diplomas = await this.processes.GetTasksList("Despacho do Presidente da República", false).toPromise();
console.log('diplomas', diplomas);
switch (this.segment) {
case 'validar':
console.log(this.segment);
this.diplomasList = new Array();
let diplomasValidar = diplomas.reverse().filter(data => data.activityInstanceName == "Revisar Diploma");
console.log(diplomasValidar);
diplomasValidar.forEach(element => {
let DocId = element.workflowInstanceDataFields.FolderID;
let ApplicationId = element.workflowInstanceDataFields.ApplicationId;
this.processes.GetDocumentDetails(DocId, '361').subscribe(res=>{
this.totalDocs = res.DocumentsTotal;
console.log(res.DocumentsTotal);
let date = new Date(element.taskStartDate);
date.setMonth(date.getMonth() + 1);
let taskDate = date.getFullYear()+"-"+ date.getMonth()+"-"+date.getDate()+" "+date.getHours()+":"+date.getMinutes()+ ":"+date.getSeconds();
let task = {
"SerialNumber": element.serialNumber,
"Folio": element.workflowInstanceDataFields.Subject,
"Senders": element.workflowInstanceDataFields.Sender,
"CreateDate": taskDate,
"DocumentURL": element.workflowInstanceDataFields.ViewerRequest,
"Remetente": element.workflowInstanceDataFields.Remetente,
"DocumentsQty": 0,
"DocId": element.workflowInstanceDataFields.DocIdDiferimento,
"WorkflowName": element.workflowDisplayName,
"activityInstanceName": element.activityInstanceName,
}
this.diplomasList.push(task);
},
(error)=> {
let date = new Date(element.taskStartDate);
date.setMonth(date.getMonth() + 1);
let taskDate = date.getFullYear()+"-"+ date.getMonth()+"-"+date.getDate()+" "+date.getHours()+":"+date.getMinutes()+ ":"+date.getSeconds();
let task = {
"SerialNumber": element.serialNumber,
"Folio": element.workflowInstanceDataFields.Subject,
"Senders": element.workflowInstanceDataFields.Sender,
"CreateDate": taskDate,
"DocumentURL": element.workflowInstanceDataFields.ViewerRequest,
"Remetente": element.workflowInstanceDataFields.Remetente,
"DocumentsQty": 0,
"DocId": element.workflowInstanceDataFields.DocIdDiferimento,
"WorkflowName": element.workflowDisplayName,
"activityInstanceName": element.activityInstanceName,
}
this.diplomasList.push(task);
});
});
this.showLoader = false;
break;
case 'assinados':
console.log(this.segment);
this.diplomasList = new Array();
let diplomasAssinados = diplomas.reverse().filter(data => data.activityInstanceName == "Diploma Assinado");
console.log(diplomasAssinados);
diplomasAssinados.forEach(element => {
let DocId = element.workflowInstanceDataFields.FolderID;
let ApplicationId = element.workflowInstanceDataFields.ApplicationId;
this.processes.GetDocumentDetails(DocId, '361').subscribe(res=>{
this.totalDocs = res.DocumentsTotal;
console.log(res.DocumentsTotal);
let date = new Date(element.taskStartDate);
date.setMonth(date.getMonth() + 1);
let taskDate = date.getFullYear()+"-"+ date.getMonth()+"-"+date.getDate()+" "+date.getHours()+":"+date.getMinutes()+ ":"+date.getSeconds();
let task = {
"SerialNumber": element.serialNumber,
"Folio": element.workflowInstanceDataFields.Subject,
"Senders": element.workflowInstanceDataFields.Sender,
"CreateDate": taskDate,
"DocumentURL": element.workflowInstanceDataFields.ViewerRequest,
"Remetente": element.workflowInstanceDataFields.Remetente,
"DocumentsQty": 0,
"DocId": element.workflowInstanceDataFields.DocIdDiferimento,
"WorkflowName": element.workflowDisplayName,
"activityInstanceName": element.activityInstanceName,
}
this.diplomasList.push(task);
},
(error)=> {
let date = new Date(element.taskStartDate);
date.setMonth(date.getMonth() + 1);
let taskDate = date.getFullYear()+"-"+ date.getMonth()+"-"+date.getDate()+" "+date.getHours()+":"+date.getMinutes()+ ":"+date.getSeconds();
let task = {
"SerialNumber": element.serialNumber,
"Folio": element.workflowInstanceDataFields.Subject,
"Senders": element.workflowInstanceDataFields.Sender,
"CreateDate": taskDate,
"DocumentURL": element.workflowInstanceDataFields.ViewerRequest,
"Remetente": element.workflowInstanceDataFields.Remetente,
"DocumentsQty": 0,
"DocId": element.workflowInstanceDataFields.DocIdDiferimento,
"WorkflowName": element.workflowDisplayName,
"activityInstanceName": element.activityInstanceName,
}
this.diplomasList.push(task);
});
});
this.showLoader = false;
break;
}
}
doRefresh(event) {
this.LoadList();
setTimeout(() => {
//event.target.complete();
}, 2000);
}
async viewPedidoDetail(serialNumber:any) {
console.log(this.profile);
const modal = await this.modalController.create({
component: DiplomaPage,
componentProps:{
enterAnimation: "",
serialNumber: serialNumber,
profile: this.profile,
},
cssClass: 'modal modal-desktop',
});
await modal.present();
modal.onDidDismiss().then((res)=>{
console.log('refresh list');
this.LoadList();
});
}
goBack() {
this.router.navigate(['/home/gabinete-digital']);
// window.history.back()
}
}
@@ -4,7 +4,7 @@
<ion-content>
<div class="header-content width-100">
<div class="header-title d-flex width-100">
<p>Deseja retirar este expediente da sua caixa de correspondência?</p>
<h3>Deseja retirar este expediente da sua caixa de correspondência?</h3>
</div>
</div>
<div class="header-body width-100">
@@ -16,16 +16,10 @@ export class DiscartExpedientModalPage implements OnInit {
private modalController: ModalController,
private processes:ProcessesService,
private router:Router,
private navParams: NavParams,
) {
this.serialNumber = this.navParams.get('serialNumber');
this.folderId = this.navParams.get('folderId');
this.action = this.navParams.get('action');
}
ngOnInit() {
console.log(this.serialNumber);
}
close(){
this.modalController.dismiss('No');
@@ -41,7 +41,11 @@
<div class="upper-content d-flex width-100">
<div class="content-location d-flex justify-between width-100">
<div class="location-detail flex-grow-1">
<ion-label >{{loadedEvent.workflowInstanceDataFields.Location}}</ion-label>
<div *ngIf="loadedEvent.workflowInstanceDataFields.Location">
<ion-label>
{{loadedEvent.workflowInstanceDataFields.Location}}
</ion-label>
</div>
<div class="content-details">
<ion-label>
<p>1 {{customDate}}</p>
@@ -57,14 +61,15 @@
</div>
</div>
<div class="middle-content">
<div *ngIf="loadedEvent.workflowInstanceDataFields.Participants" class="middle-content">
<div *ngIf="loadedEvent.workflowInstanceDataFields.Participants">
<h5>Intervenientes</h5>
<div *ngFor="let att of loadedEvent.workflowInstanceDataFields.ParticipantsList">
<ion-label>{{att.Name}}</ion-label>
</div>
</div>
</div>
<div *ngIf="loadedEvent.workflowInstanceDataFields.Body">
<h5>Detalhes</h5>
<ion-item lines="none" class="ion-no-padding ion-no-margin">
<div [innerHTML]="loadedEvent.workflowInstanceDataFields.Body"></div>
@@ -74,17 +79,16 @@
<div class="d-flex container-div width-100" >
<ion-list class="width-100 " >
<h5>Documentos Anexados</h5>
<ion-item class="width-100" *ngFor="let document of loadedAttachments">
<ion-label class="width-100 d-block list">
<ion-label
(click)="viewDocument(document.SourceId, document.ApplicationId)"
class="width-100 d-block list">
<p class="d-flex ion-justify-content-between">
<span class="attach-title-item">{{document.SourceName}}</span>
<span class="app-name" *ngIf="document.ApplicationId == 8"> Correspondencia </span>
<span class="app-name" *ngIf="document.ApplicationId == 386"> AccoesPresidenciais </span>
<span class="app-name" *ngIf="document.ApplicationId == 361 "> ArquivoDespachoElect </span>
<span class="close-button text-black" >
<ion-icon class="font-20" src="assets/images/icons-delete-25.svg"></ion-icon>
</span>
</p>
<p><span class="span-left">{{document.Stakeholders}}</span><span class="span-right"> {{document.CreateDate | date: 'dd-MM-yy'}} </span></p>
</ion-label>
@@ -6,9 +6,11 @@ import { AlertService } from 'src/app/services/alert.service';
import { AttachmentsService } from 'src/app/services/attachments.service';
import { ProcessesService } from 'src/app/services/processes.service';
import { EditEventToApproveComponent } from 'src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page';
import { BadRequestComponent } from 'src/app/shared/popover/bad-request/bad-request.component';
import { SuccessMessageComponent } from 'src/app/shared/popover/success-message/success-message.component';
import { EmendMessageModalPage } from '../../../agenda/emend-message-modal/emend-message-modal.page';
import { EventActionsPopoverPage } from '../../../agenda/event-actions-popover/event-actions-popover.page';
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
@Component({
selector: 'app-approve-event-modal',
@@ -37,6 +39,7 @@ export class ApproveEventModalPage implements OnInit {
private menu: MenuController,
private alertService: AlertService,
private activatedRoute: ActivatedRoute,
private iab: InAppBrowser,
) {
@@ -55,7 +58,6 @@ export class ApproveEventModalPage implements OnInit {
this.getTask();
this.getAttachments();
}
@@ -82,14 +84,29 @@ export class ApproveEventModalPage implements OnInit {
})
}
viewDocument(docId:string, applicationId:string){
this.processes.GetDocumentUrl(docId, applicationId).subscribe(res=>{
console.log(res);
const url: string = res.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1");
const browser = this.iab.create(url,"_blank");
browser.show();
});
}
approveTask(serialNumber:string){
async approveTask(serialNumber:string){
console.log('approveTask SERIALNUMBER: ', serialNumber)
let body = { "serialNumber": serialNumber, "action": "Aprovar" }
console.log(body);
this.processes.PostTaskAction(body);
this.router.navigate(['/home/gabinete-digital/event-list']);
this.modalController.dismiss(null);
try {
await this.processes.PostTaskAction(body).toPromise()
this.router.navigate(['/home/gabinete-digital/event-list']);
this.modalController.dismiss(null);
this.successMessage()
} catch (error) {
this.badRequest()
}
}
emendTask(serialNumber:string){
@@ -100,18 +117,27 @@ export class ApproveEventModalPage implements OnInit {
this.modalController.dismiss(null);
}
rejectTask(serialNumber:string){
console.log('rejectTask: ',serialNumber)
async rejectTask(serialNumber:string) {
// console.log('rejectTask: ',serialNumber)
let body = { "serialNumber": serialNumber, "action": "Rejeitar" }
console.log(body);
this.processes.PostTaskAction(body);
this.router.navigate(['/home/gabinete-digital/event-list']);
// console.log(body);
try {
await this.processes.PostTaskAction(body).toPromise()
this.router.navigate(['/home/gabinete-digital/event-list']);
this.successMessage()
} catch (error) {
this.badRequest()
}
this.modalController.dismiss(null);
}
async getAttachments(){
async getAttachments() {
this.loadedAttachments = await this.attachmentsService.getAttachmentsById(this.InstanceId).toPromise();
console.log(this.loadedAttachments);
}
async openOptions(ev:any) {
@@ -123,40 +149,49 @@ export class ApproveEventModalPage implements OnInit {
});
return await popover.present();
}
openMenu() {
this.menu.open();
}
async openEmendMessageModal(serialNumber:string) {
const modal = await this.modalController.create({
component: EmendMessageModalPage,
componentProps:{
},
cssClass: 'emend-message-modal',
backdropDismiss: false
});
}
await modal.present();
async openEmendMessageModal(serialNumber:string) {
const modal = await this.modalController.create({
component: EmendMessageModalPage,
componentProps:{
},
cssClass: 'emend-message-modal',
backdropDismiss: false
});
await modal.present();
modal.onDidDismiss().then( async (res) => {
if(res.data !== '') {
let body = {
"serialNumber": serialNumber,
"action": "Emendar",
"dataFields": {
"ReviewerUseComment": res.data,
}
}
//console.log(body);
try {
await this.processes.PostTaskAction(body).toPromise()
this.router.navigate(['/home/gabinete-digital/event-list']);
this.successMessage()
} catch (error) {
this.badRequest()
this.router.navigate(['/home/gabinete-digital/event-list']);
}
modal.onDidDismiss().then(res => {
if(res.data !== ''){
let body = { "serialNumber": serialNumber,
"action": "Emendar",
"dataFields": {
"ReviewerUseComment": res.data,
}
}
console.log(body);
this.processes.PostTaskAction(body);
this.router.navigate(['/home/gabinete-digital/event-list']);
}
else{
//this.alertService.presentAlert('Operação cancelada!');
}
});
}
else {
//this.alertService.presentAlert('Operação cancelada!');
}
});
}
async editar(serialNumber: string) {
@@ -177,5 +212,39 @@ export class ApproveEventModalPage implements OnInit {
});
}
async successMessage(message?: string) {
const modal = await this.modalController.create({
component: SuccessMessageComponent,
componentProps: {
message: message || 'Processo efetuado' ,
},
cssClass: 'modal modal-desktop'
});
modal.present()
setTimeout(()=>{
modal.dismiss()
},3000)
}
async badRequest(message?: string) {
const modal = await this.modalController.create({
component: BadRequestComponent,
componentProps: {
message: message || 'Processo não efetuado' ,
},
cssClass: 'modal modal-desktop'
});
modal.present()
setTimeout(()=>{
modal.dismiss()
},3000)
}
}
@@ -7,12 +7,15 @@ import { IonicModule } from '@ionic/angular';
import { ApproveEventPageRoutingModule } from './approve-event-routing.module';
import { ApproveEventPage } from './approve-event.page';
import { SharedModule } from 'src/app/shared/shared.module';
import { ComponentsModule } from 'src/app/components/components.module';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
ComponentsModule,
ApproveEventPageRoutingModule
],
declarations: [ApproveEventPage]
@@ -1,24 +1,14 @@
<ion-header class="ion-no-border">
<div *ngIf="loadedEvent" class="header-content d-flex justify-between">
<div class="header-icon-left cursor-pointer">
<ion-icon (click)="close()" src="assets/images/icons-arrow-arrow-left.svg"></ion-icon>
</div>
<div class="header-title flex-grow-1">
<label>{{loadedEvent.workflowInstanceDataFields.Subject}}</label>
</div>
<div class="header-icon-right cursor-pointer">
<ion-icon (click)="notImplemented()" src="assets/images/icons-edit.svg"></ion-icon>
</div>
</div>
<app-header></app-header>
</ion-header>
<ion-menu autoHide="false" side="end" content-id="main-content">
<ion-header>
<ion-toolbar translucent>
<ion-title>Acções</ion-title>
<ion-title>Ações</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
<ion-list class="cursor-pointer">
<ion-list>
<ion-item (click)="approveTask(loadedEvent.serialNumber)">
<ion-icon name="checkmark-sharp"></ion-icon>
<ion-label>Aprovar</ion-label>
@@ -31,76 +21,108 @@
<ion-icon name="close-sharp"></ion-icon>
<ion-label>Rejeitar</ion-label>
</ion-item>
<ion-item (click)="editar(loadedEvent.serialNumber)">
<ion-icon name="close-sharp"></ion-icon>
<ion-label>Editar</ion-label>
</ion-item>
</ion-list>
</ion-content>
</ion-menu>
<ion-content id="main-content">
<div class="upper-content">
<div class="content-location" *ngIf="loadedEvent">
<div class="location-detail">
<ion-label >{{loadedEvent.workflowInstanceDataFields.Location}}</ion-label>
<div class="main-content d-flex height-100">
<div *ngIf="loadedEvent" class="content d-flex flex-column width-100">
<div class="header-content width-100 d-flex justify-space-between">
<div (click)="goBack()" class="header-icon-left cursor-pointer">
<ion-icon src="assets/images/icons-arrow-arrow-left.svg"></ion-icon>
</div>
<div class="header-title flex-grow-1 cursor-pointer">
<label>{{loadedEvent.workflowInstanceDataFields.Subject}}</label>
</div>
<div (click)="editar(loadedEvent.serialNumber)" class="header-icon-right display-none-true">
<ion-icon src="assets/images/icons-edit.svg"></ion-icon>
</div>
<div class="menu-ptions">
<button class="btn-no-color" (click)="openOptions(loadedEvent)">
<ion-icon src="assets/images/icons-menu.svg"></ion-icon>
</button>
</div>
</div>
<div class="button-calendar-type">
<ion-button class="button-calendar-type" slot="end">{{loadedEvent.workflowInstanceDataFields.Agenda}}</ion-button>
<div class="upper-content d-flex flex-column">
<div class="content-location">
<p>
<span class="location">{{loadedEvent.workflowInstanceDataFields.Location}}</span>
<span class="event-type-{{loadedEvent.workflowInstanceDataFields.Agenda}}">{{loadedEvent.workflowInstanceDataFields.Agenda}}</span>
</p>
</div>
<div class="content-details">
<ion-label>
<p>{{customDate}}</p>
<p>das {{loadedEvent.workflowInstanceDataFields.StartDate | date: 'hh:mm'}} às {{loadedEvent.workflowInstanceDataFields.EndDate | date: 'hh:mm'}}</p>
<p *ngIf="!loadedEvent.workflowInstanceDataFields.IsRecurring">(Não se repete)</p>
<p *ngIf="loadedEvent.workflowInstanceDataFields.IsRecurring">Repete</p>
</ion-label>
</div>
</div>
<div class="line"></div>
<div class="overflow-y-auto">
<div class="middle-content">
<div *ngIf="loadedEvent.workflowInstanceDataFields.ParticipantsList">
<h5>Intervenientes</h5>
<div *ngFor="let att of loadedEvent.workflowInstanceDataFields.ParticipantsList">
<ion-label>{{att.Name}}</ion-label>
</div>
<div class="line"></div>
</div>
<div *ngIf="loadedEvent.workflowInstanceDataFields.Body">
<h5>Detalhes</h5>
<ion-item lines="none" class="ion-no-margin ion-no-padding">
<p [innerHTML]="loadedEvent.workflowInstanceDataFields.Body"></p>
</ion-item>
<div class="line"></div>
</div>
</div>
<div *ngIf="loadedAttachments" class="bottom-content width-100">
<ion-list>
<h5>Documentos Anexados</h5>
<ion-item class="ion-no-margin ion-no-padding cursor-pointer"
*ngFor="let attach of loadedAttachments"
(click)="viewDocument(attach.SourceId)">
<ion-label>
<p class="attach-title-item d-block">{{attach.SourceName}}</p>
<p><span class="span-left">{{attach.Stakeholders}}</span><span class="span-right">{{ attach.CreateDate | date: 'dd-MM-yy' }}</span></p>
</ion-label>
</ion-item>
</ion-list>
</div>
</div>
</div>
<div *ngIf="loadedEvent" class="aside-right flex-column height-100">
<div class="aside-buttons">
<button hidden full class="btn-ok" shape="round" >Editar evento</button>
<button (click)="approveTask(loadedEvent.serialNumber)" full class="btn-ok" shape="round" >Aprovar</button>
<button (click)="emendTask(loadedEvent.serialNumber)" class="btn-cancel" shape="round" >Adicionar Nota</button>
<div class="solid"></div>
<button full class="btn-cancel" shape="round" (click)="editar(loadedEvent.serialNumber)" >Editar</button>
<button (click)="rejectTask(loadedEvent.serialNumber)" full class="btn-delete" shape="round" >Rejeitar</button>
</div>
</div>
<div class="content-details" *ngIf="loadedEvent">
<ion-label>
<p>{{customDate}}</p>
<p>das {{loadedEvent.workflowInstanceDataFields.StartDate | date: 'hh:mm'}} às {{loadedEvent.workflowInstanceDataFields.EndDate | date: 'hh:mm'}}</p>
<p *ngIf="!loadedEvent.workflowInstanceDataFields.IsRecurring">(Não se repete)</p>
<p *ngIf="loadedEvent.workflowInstanceDataFields.IsRecurring">Repete</p>
</ion-label>
</div>
</div>
<div class="line"></div>
<div class="middle-content overflow-y-auto" *ngIf="loadedEvent">
<h5>Intervenientes</h5>
<ion-item>
<ion-label>
<p>{{loadedEvent.workflowInstanceDataFields.Participants}}</p>
</ion-label>
</ion-item>
<h5>Detalhes</h5>
<ion-item>
<p>{{loadedEvent.workflowInstanceDataFields.Body}}</p>
</ion-item>
</div>
<!-- <div *ngIf="loadedAttachments" class="bottom-content">
<ion-list>
<h3>Documentos Anexados</h3>
<ion-item>
<ion-label>
<p class="attach-title-item">Receita por Natureza</p>
<p><span class="span-left">{{loadedAttachments.Remetente}}</span><span class="span-right">{{loadedAttachments.CreateDate}}</span></p>
</ion-label>
</ion-item>
</ion-list>
</div> -->
</ion-content>
<ion-footer>
<ion-toolbar class="cursor-pointer">
<div class="buttons">
<ion-item lines="none">
<p>
<ion-button class="button-edit-event" shape="round" (click)="emendTask(loadedEvent.serialNumber)">Emendar</ion-button>
</p>
<p>
<ion-menu-button autoHide="false">
<ion-icon (click)="openMenu()" name="ellipsis-vertical-outline"></ion-icon>
</ion-menu-button>
</p>
<p>
<ion-button class="button-approve" shape="round" (click)="approveTask(loadedEvent.serialNumber)">Aprovar1</ion-button>
</p>
</ion-item>
<ion-item hidden>
<p>
<ion-button class="button-reject" shape="round" (click)="rejectTask(loadedEvent.serialNumber)">Rejeitar</ion-button>
</p>
</ion-item>
</div>
</ion-toolbar>
</ion-content>
<ion-footer class="display-none-true">
<div class="buttons">
<button class="btn-cancel" shape="round" (click)="emendTask(loadedEvent.serialNumber)">Adicionar Nota</button>
<ion-menu-button (click)="openMenu()" autoHide="false">
<ion-icon name="ellipsis-vertical-outline"></ion-icon>
</ion-menu-button>
<button class="btn-ok" shape="round" (click)="approveTask(loadedEvent.serialNumber)">Aprovar</button>
<button hidden class="btn-delete" shape="round" (click)="rejectTask(loadedEvent.serialNumber)">Rejeitar</button>
</div>
</ion-footer>
@@ -1,16 +1,18 @@
ion-content{
--padding-top:0px;
--padding-start: 20px;
--padding-end: 20px;
font-size: 18px;
@import '~src/function.scss';
.main-content{
background-color: #fff !important;
border-top-left-radius: 25px;
border-top-right-radius: 25px;
}
ion-menu{
--height: 225px;
}
.display-none-true{
display: none;
border: 1px solid red;
}
.header-content{
width: 360px;
overflow: auto;
margin: 25px auto;
//margin: 25px auto;
}
.header-icon-left{
width: 36px;
@@ -19,7 +21,6 @@ ion-menu{
float: left;
}
.header-title{
width: 264px;
font-family: Roboto;
font-size: 25px;
margin: 0 5px 0 5px;
@@ -32,98 +33,148 @@ ion-menu{
font-size: 45px;
float: left;
}
.upper-content{
margin-left: 50px;
overflow: auto;
font-size: 18px;
.content-location{
width: 360px;
margin: 0 auto;
padding: 0;
overflow: auto;
}
.content{
padding: 30px 20px 0 20px !important;
margin: 0;
float: left;
/* overflow: auto;
width: 100%; */
border-right: 1px solid #d8d8d8;
.location-detail{
width: 210px;
font-weight: 700;
.upper-content{
margin-left: 40px;
font-size: 18px;
float: left;
margin: 5px 5px 5px 0px;
}
.button-calendar-type{
width: 91px;
--border-radius: 12.5px;
--background: #ffb703;
margin-left: 5px;
.content-location{
margin-top: 0px !important;
width: 100%;
padding: 0;
}
.location{
float: left;
}
.event-type-Oficial{
font-family: Roboto;
border-radius: 20px;
background: #ffb703;
float: right !important;
padding: 5px 13.5px 5px 13.5px;
color: #fff;
}
.event-type-Pessoal{
font-family: Roboto;
border-radius: 20px;
background: #f05d5e;
float: right !important;
padding: 5px 13.5px 5px 13.5px;
color: #fff;
}
.button-edit-event {
width: 140px;
height: 44px;
border-radius: 22.5px;
--background: #e0e9ee;
--color:#061b52;
}
.content-details p{
font-size: 16px;
}
}
.button-calendar-type ion-button{
height: 25px;
}
.button-edit-event {
width: 140px;
height: 44px;
border-radius: 22.5px;
--background: #e0e9ee;
--color:#061b52;
}
.content-details p{
.middle-conten{
.middle-content h3, .middle-content p{
font-size: 16px;
}
}
.bottom-content{
margin: 0 auto;
.bottom-content h3{
font-size: 16px;
margin: 0 0 0 10px;
}
.attach-document{
font-size: 15px;
color: #0d89d1;
margin: 5px 5px 5px 10px;
padding: 5px;
float: left;
}
.attach-icon{
width: 37px;
font-size: 35px;
float: left;
}
.attach-title-item{
width: 100%;
font-size: 15px;
color:#0d89d1;
}
/* SPAN */
.span-left{
float: left;
font-size: 15x;
}
.span-right{
text-align: right;
float: right;
font-size: 13px;
}
}
}
.middle-conten{
.middle-content h3, .middle-content p{
font-size: 16px;
.aside-right{
overflow: auto;
padding: 30px 20px 0 20px !important;
.arrow-right{
display: flex;
justify-content: flex-end;
margin-bottom: 20px;
/* .arrow-right-icon{
width: 37px;
float: right;
font-size: 35px;
overflow: hidden;
} */
}
.aside-buttons{
width: 100% !important;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
.btn-ok, .btn-cancel, .btn-delete{
height: auto !important;
font-size: 16px !important;
font-weight: 600 !important;
width: 100% !important;
margin-bottom: 10px !important;
padding: 15px !important;
}
}
.solid {
display: block;
width: 90%;
border-top: 1px solid #ebebeb;
margin: 0 auto !important;
margin-bottom: 10px !important;
}
}
.bottom-content{
width: 360px;
margin: 0 auto;
.bottom-content h3{
font-size: 16px;
margin: 0 0 0 10px;
}
.attach-document{
font-size: 15px;
color: #0d89d1;
margin: 5px 5px 5px 10px;
padding: 5px;
float: left;
}
.attach-icon{
width: 37px;
font-size: 35px;
float: left;
}
.attach-title-item{
width: 100%;
font-size: 15px;
color:#0d89d1;
}
/* SPAN */
.span-left{
float: left;
font-size: 15x;
}
.span-right{
text-align: right;
float: right;
font-size: 13px;
}
}
.buttons{
width: 360px;
margin: 0 auto;
}
display: flex;
justify-content: space-between;
overflow: auto;
.button-options {
height: 44px;
--color: #42b9fe;
/* opacity: 0; */
--color: #42b9fe;
/* opacity: 0; */
}
.button-approve {
width: 140px;
@@ -138,3 +189,50 @@ ion-menu{
border-radius: 22.5px;
--background: #ffe0e0;
}
}
@media only screen and (max-width: 800px) {
.content{
width: 100% !important;
}
.aside-right{
display: none;
}
}
@media only screen and (min-width: 801px) {
.div-icon{
display: none;
}
.menu-ptions{
display: none;
}
.content{
width: 65%;
border-right: 1px solid #d8d8d8;
}
.aside-right{
width: 35%;
}
}
@media only screen and (min-width: 1024px){
.content{
width: 70%;
}
.aside-right{
width: 30%;
}
}
@media only screen and (min-width: 1140px){
.content{
width: 75%;
}
.aside-right{
width: 25%;
}
}
@@ -1,11 +1,16 @@
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { MenuController, ModalController, PopoverController } from '@ionic/angular';
import { EmendMessageModalPage } from 'src/app/pages/agenda/emend-message-modal/emend-message-modal.page';
import { EventActionsPopoverPage } from 'src/app/pages/agenda/event-actions-popover/event-actions-popover.page';
import { Component, OnInit, Input, EventEmitter, Output } from '@angular/core';
import { ActivatedRoute, NavigationExtras, Router } from '@angular/router';
import { MenuController, ModalController, NavParams, PopoverController } from '@ionic/angular';
import { Event } from 'src/app/models/event.model';
import { AlertService } from 'src/app/services/alert.service';
import { AttachmentsService } from 'src/app/services/attachments.service';
import { ProcessesService } from 'src/app/services/processes.service';
import { EmendMessageModalPage } from 'src/app/pages/agenda/emend-message-modal/emend-message-modal.page';
import { EventActionsPopoverPage } from 'src/app/pages/agenda/event-actions-popover/event-actions-popover.page';
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
import { EditEventToApproveComponent } from 'src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page';
import { BadRequestComponent } from 'src/app/shared/popover/bad-request/bad-request.component';
import { SuccessMessageComponent } from 'src/app/shared/popover/success-message/success-message.component';
@Component({
selector: 'app-approve-event',
@@ -14,45 +19,44 @@ import { ProcessesService } from 'src/app/services/processes.service';
})
export class ApproveEventPage implements OnInit {
event: Event;
loadedEvent: any;
loadedAttachments: any;
serialNumber: string;
customDate: any;
today: any;
loadedEvent:any;
loadedEvent1:any;
loadedAttachments:any;
customDate:any;
today:any;
show: boolean = false;
months = ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"];
days = ["Domingo", "Segunda-feira", "Terça-feira", "Quarta-feira", "Quinta-feira", "Sexta-feira", "Sábado"];
serialNumber:string;
@Input() InstanceId:string;
@Output() approveEventDismiss = new EventEmitter<any>();
@Output() closeEventToApprove = new EventEmitter<any>();
@Output() AproveEventEditEvent = new EventEmitter<any>();
constructor(
private router: Router,
private router:Router,
private activatedRoute: ActivatedRoute,
private modalController: ModalController,
private processes: ProcessesService,
private processes:ProcessesService,
private attachmentsService: AttachmentsService,
private popoverController: PopoverController,
private menu: MenuController,
private alertService: AlertService,
private activatedRoute: ActivatedRoute,
) {
this.activatedRoute.paramMap.subscribe(paramMap =>
{
if (!paramMap.has("serialNumber")){
return;
}
else{
this.serialNumber = paramMap.get('serialNumber');
console.log(this.serialNumber);
}
});
this.loadedEvent = null;
private iab: InAppBrowser
) {
this.activatedRoute.queryParams.subscribe(params => {
if(params["serialNumber"]) {
this.serialNumber = params["serialNumber"];
console.log(params["serialNumber"]);
}
});
}
ngOnInit() {
console.log(this.serialNumber);
this.getTask();
this.getAttachments();
}
notImplemented() {
@@ -60,65 +64,115 @@ export class ApproveEventPage implements OnInit {
}
close() {
this.router.navigate(['/home/gabinete-digital/event-list']);
/* this.router.navigate(['/home/gabinete-digital/event-list']); */
this.closeEventToApprove.emit();
this.modalController.dismiss();
}
getTask() {
this.processes.GetTask(this.serialNumber).subscribe(res => {
console.log(res);
this.loadedEvent = res;
this.today = new Date(res.workflowInstanceDataFields.StartDate);
console.log(new Date(this.today));
this.customDate = this.days[this.today.getDay()] + ", " + this.today.getDate() + " de " + (this.months[this.today.getMonth()]);
})
goBack() {
let navigationExtras: NavigationExtras = {
queryParams: {
"eventos": true,
}
};
if( window.innerWidth < 801) {
this.router.navigate(['/home/gabinete-digital/event-list']);
} else {
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
}
}
approveTask(serialNumber: string) {
async getTask(){
this.loadedEvent = await this.processes.GetTask(this.serialNumber).toPromise();
console.log(this.loadedEvent);
this.today = new Date(this.loadedEvent.workflowInstanceDataFields.StartDate);
console.log(new Date(this.today));
this.customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]);
let instanceId = this.loadedEvent.workflowInstanceDataFields.InstanceId;
this.getAttachments(instanceId);
}
async approveTask(serialNumber:string){
let body = { "serialNumber": serialNumber, "action": "Aprovar" }
console.log(body);
this.processes.PostTaskAction(body);
this.router.navigate(['/home/gabinete-digital/event-list']);
try {
await this.processes.PostTaskAction(body).toPromise()
this.successMessage()
this.goBack();
} catch (error) {
this.badRequest()
}
/* this.approveEventDismiss.emit({
"serialNumber": serialNumber,
"action": "Aprovar",
"saveData": {
loadedEvent: this.loadedEvent,
today: this.today,
customDate: this.customDate
}
}); */
}
emendTask(serialNumber: string) {
emendTask(serialNumber:string){
/* console.log('Emendar'); */
this.menu.close();
this.openEmendMessageModal(serialNumber);
this.close();
this.goBack();
}
rejectTask(serialNumber: string) {
async rejectTask(serialNumber:string){
let body = { "serialNumber": serialNumber, "action": "Rejeitar" }
console.log(body);
this.processes.PostTaskAction(body);
this.router.navigate(['/home/gabinete-digital/event-list'])
this.close();
try {
this.processes.PostTaskAction(body).toPromise()
this.goBack();
await this.successMessage()
} catch (error) {
this.badRequest()
}
}
getAttachments() {
this.attachmentsService.getAttachmentsBySerial(this.serialNumber).subscribe(res => {
this.loadedAttachments = res;
console.log(res);
async getAttachments(instanceId:string){
this.loadedAttachments = await this.attachmentsService.getAttachmentsById(instanceId).toPromise();
}
viewDocument(sourceId){
this.processes.GetDocumentUrl(sourceId, '8').subscribe(res=>{
/* console.log(res); */
const url: string = res.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1");
const browser = this.iab.create(url,"_blank");
browser.show();
});
}
async openOptions(ev: any) {
async openOptions(ev:any) {
const popover = await this.popoverController.create({
component: EventActionsPopoverPage,
cssClass: 'event-actions-popover',
cssClass: 'events-options',
event: ev,
translucent: true
translucent: true,
componentProps:{
serialNumber: ev.serialNumber,
InstanceId: ev.workflowInstanceDataFields.InstanceId,
},
});
return await popover.present();
}
openMenu() {
this.menu.open();
}
async openEmendMessageModal(serialNumber: string) {
async openEmendMessageModal(serialNumber:string) {
const modal = await this.modalController.create({
component: EmendMessageModalPage,
componentProps: {
componentProps:{
},
cssClass: 'emend-message-modal',
backdropDismiss: false
@@ -126,23 +180,100 @@ export class ApproveEventPage implements OnInit {
await modal.present();
modal.onDidDismiss().then(res => {
if (res.data !== '') {
let body = {
"serialNumber": serialNumber,
"action": "Emendar",
"dataFields": {
modal.onDidDismiss().then( async (res) => {
console.log(res.data);
if(res.data !== ''){
let body = { "serialNumber": serialNumber,
"action": "Emendar",
"dataFields": {
"ReviewerUseComment": res.data,
}
}
console.log(body);
this.processes.PostTaskAction(body);
this.router.navigate(['/home/gabinete-digital/event-list'])
console.log(body);
try {
await this.processes.PostTaskAction(body).toPromise()
//this.router.navigate(['/home/gabinete-digital/event-list']);
this.goToEventsToApprove();
this.successMessage()
} catch (error) {
this.badRequest()
}
else {
}
else{
//this.alertService.presentAlert('Operação cancelada!');
}
});
}
goToEventsToApprove(){
let navigationExtras: NavigationExtras = {
queryParams: {
"events": true,
}
};
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
}
async editar(serialNumber: string) {
const modal = await this.modalController.create({
component: EditEventToApproveComponent,
componentProps: {
serialNumber: serialNumber,
InstanceId:this.InstanceId
},
cssClass: 'modal modal-desktop',
// backdropDismiss: false
});
await modal.present();
modal.onDidDismiss().then(res => {
this.getTask();
});
}
async successMessage(message?: string) {
const modal = await this.modalController.create({
component: SuccessMessageComponent,
componentProps: {
message: message || 'Processo efetuado' ,
},
cssClass: 'modal modal-desktop'
});
modal.present()
setTimeout(()=>{
modal.dismiss()
},3000)
}
async badRequest(message?: string) {
const modal = await this.modalController.create({
component: BadRequestComponent,
componentProps: {
message: message || 'Processo não efetuado' ,
},
cssClass: 'modal modal-desktop'
});
modal.present()
setTimeout(()=>{
modal.dismiss()
},3000)
}
}
@@ -7,12 +7,15 @@ import { IonicModule } from '@ionic/angular';
import { EventListPageRoutingModule } from './event-list-routing.module';
import { EventListPage } from './event-list.page';
import { SharedModule } from 'src/app/shared/shared.module';
import { ComponentsModule } from 'src/app/components/components.module';
@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
ComponentsModule,
EventListPageRoutingModule
],
declarations: [EventListPage]
@@ -1,39 +1,41 @@
<ion-header class="ion-no-border">
<div class="header-content">
<div class="header-icon-left">
<button class="btn-no-color cursor-pointer" (click)="close()">
<ion-icon src="assets/images/icons-arrow-arrow-left.svg"></ion-icon>
</button>
</div>
<div class="header-title">
<label>Eventos para Aprovação</label>
</div>
<ion-toolbar>
<ion-segment [(ngModel)]="profile">
<ion-segment-button value="MDGPR">
Seu calendário
</ion-segment-button>
<ion-segment-button value="PR">
Presidente da República
</ion-segment-button>
</ion-segment>
</ion-toolbar>
</div>
<app-header></app-header>
</ion-header>
<ion-content>
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
<ion-refresher-content>
</ion-refresher-content>
</ion-refresher>
<div [ngSwitch]="profile">
<div class="main-content d-flex height-100" [ngSwitch]="segment">
<div class="content d-flex flex-column">
<div class="header-content">
<div class="header-icon-left">
<button class="btn-no-color cursor-pointer" (click)="goBack()">
<ion-icon src="assets/images/icons-arrow-arrow-left.svg"></ion-icon>
</button>
</div>
<div class="header-title">
<label>Eventos para Aprovação</label>
</div>
<ion-toolbar>
<ion-segment [(ngModel)]="segment">
<ion-segment-button value="MDGPR">
Seu calendário
</ion-segment-button>
<ion-segment-button value="PR">
Presidente da República
</ion-segment-button>
</ion-segment>
</ion-toolbar>
</div>
<ion-list *ngSwitchCase="'MDGPR'">
<div *ngIf="eventsMDGPRList">
<ion-list>
<ion-item-sliding>
<ion-item class="Rectangle cursor-pointer" lines="none"
*ngFor="let event of eventsMDGPRList" (click)="openApproveModal(event.serialNumber, event)">
*ngFor="let event of eventsMDGPRList" (click)="goToEventDetail(event)">
<div class="content-mdgpr-{{event.workflowInstanceDataFields.Agenda}} width-100">
<div class="approve-event-time">
@@ -72,4 +74,5 @@
</div>
</ion-list>
</div>
</div>
</ion-content>
@@ -1,7 +1,13 @@
:host{
@import '~src/function.scss';
.main-content{
background-color: #fff !important;
border-top-left-radius: 25px;
border-top-right-radius: 25px;
}
.content{
padding: 30px 20px 0 20px !important;
margin: 0;
float: left;
}
.header-content{
margin: 0 !important;
@@ -3,9 +3,9 @@ import { EventBody } from 'src/app/models/eventbody.model';
import { EventPerson } from 'src/app/models/eventperson.model';
import { Event } from 'src/app/models/event.model';
import { ProcessesService } from 'src/app/services/processes.service';
import { ModalController, NavParams } from '@ionic/angular';
import { ModalController } from '@ionic/angular';
import { ApproveEventModalPage } from './approve-event-modal/approve-event-modal.page';
import { NavigationEnd, Router } from '@angular/router';
import { NavigationEnd, NavigationExtras, Router } from '@angular/router';
@Component({
selector: 'app-event-list',
@@ -14,6 +14,7 @@ import { NavigationEnd, Router } from '@angular/router';
})
export class EventListPage implements OnInit {
profile:string;
segment:string;
showLoader: boolean;
eventsPRList: any;
eventsMDGPRList: any;
@@ -27,18 +28,10 @@ export class EventListPage implements OnInit {
private processes:ProcessesService,
private modalController: ModalController,
private router: Router,
private navParams: NavParams,
) { }
ngOnInit() {
this.profile = this.navParams.get('profile');
/* console.log(this.navParams.get('md')); */
if(this.profile == "mdgpr"){
this.profile = 'MDGPR'
} else {
this.profile = 'PR'
}
this.segment = 'MDGPR';
this.LoadToApproveEvents();
@@ -71,8 +64,6 @@ export class EventListPage implements OnInit {
}
async openApproveModal(eventSerialNumber, event){
const modal = await this.modalController.create({
component: ApproveEventModalPage,
componentProps:{
@@ -81,12 +72,30 @@ export class EventListPage implements OnInit {
cssClass: 'event-list cal-modal modal modal-desktop',
backdropDismiss: false
});
await modal.present();
}
goToEventDetail(eventToAprove){
let InstanceId;
if(!eventToAprove.workflowInstanceDataFields.hasOwnProperty('InstanceId')){
InstanceId = ''
} else {
InstanceId =eventToAprove.workflowInstanceDataFields.InstanceId
}
let navigationExtras: NavigationExtras = {
queryParams: {
"serialNumber": eventToAprove.serialNumber,
}
};
this.router.navigate(['/home/gabinete-digital/event-list/approve-event'], navigationExtras)
}
doRefresh(event) {
this.LoadToApproveEvents();
console.log('refresh');
@@ -97,6 +106,9 @@ export class EventListPage implements OnInit {
close(){
this.modalController.dismiss(null);
}
goBack(){
this.router.navigate(['/home/gabinete-digital']);
}
}

Some files were not shown because too many files have changed in this diff Show More