mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
Improve
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
|
import { AttachmentList } from '../models/Excludetask';
|
||||||
import { PermissionService } from '../OtherService/permission.service';
|
import { PermissionService } from '../OtherService/permission.service';
|
||||||
import { ProcessesService } from '../services/processes.service';
|
import { ProcessesService } from '../services/processes.service';
|
||||||
|
|
||||||
@@ -24,7 +25,7 @@ export class DespachoService {
|
|||||||
public p: PermissionService
|
public p: PermissionService
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
arquivar(note:string, documents:any, serialnumber) {
|
arquivar(note:string, documents:AttachmentList, serialnumber) {
|
||||||
|
|
||||||
let body = {
|
let body = {
|
||||||
"serialNumber": serialnumber,
|
"serialNumber": serialnumber,
|
||||||
@@ -96,7 +97,7 @@ export class DespachoService {
|
|||||||
return this.processes.CompleteTask(body)
|
return this.processes.CompleteTask(body)
|
||||||
}
|
}
|
||||||
|
|
||||||
rexecucao({note, documents, serialnumber}) {
|
reexecute({note, documents, serialnumber}) {
|
||||||
let body = {
|
let body = {
|
||||||
"serialNumber": serialnumber,
|
"serialNumber": serialnumber,
|
||||||
"action": "Reexecução",
|
"action": "Reexecução",
|
||||||
@@ -158,7 +159,6 @@ export class DespachoService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
createParecer(body: any) {
|
createParecer(body: any) {
|
||||||
if(this.p.userRole(['PR'])) {
|
if(this.p.userRole(['PR'])) {
|
||||||
return this.processes.postParecerPr(body)
|
return this.processes.postParecerPr(body)
|
||||||
@@ -167,4 +167,18 @@ export class DespachoService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
generateDiploma({note = '', documents = [], serialnumber}) {
|
||||||
|
let body = {
|
||||||
|
"serialNumber": serialnumber,
|
||||||
|
"action": "Reencaminhar",
|
||||||
|
"ActionTypeId": 99999839,
|
||||||
|
"dataFields": {
|
||||||
|
"ReviewUserComment": note,
|
||||||
|
},
|
||||||
|
"AttachmentList" :documents,
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.processes.CompleteTask(body)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -94,7 +94,6 @@ ion-menu{
|
|||||||
.upper-content{
|
.upper-content{
|
||||||
width: calc(100%-50px);
|
width: calc(100%-50px);
|
||||||
margin-left: 50px;
|
margin-left: 50px;
|
||||||
overflow: auto;
|
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
|
|
||||||
.content-location{
|
.content-location{
|
||||||
|
|||||||
@@ -59,7 +59,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="bottom-content width-100">
|
<div class="bottom-content width-100">
|
||||||
<ion-list *ngIf="attachments">
|
<ion-list *ngIf="fulltask.Documents">
|
||||||
<h5>Documentos Anexados</h5>
|
<h5>Documentos Anexados</h5>
|
||||||
<ion-item *ngFor="let attachment of fulltask.Documents"
|
<ion-item *ngFor="let attachment of fulltask.Documents"
|
||||||
class="ion-no-margin ion-no-padding cursor-pointer">
|
class="ion-no-margin ion-no-padding cursor-pointer">
|
||||||
|
|||||||
@@ -21,13 +21,11 @@
|
|||||||
border-top-left-radius: 25px;
|
border-top-left-radius: 25px;
|
||||||
border-top-right-radius: 25px;
|
border-top-right-radius: 25px;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
overflow:auto;
|
|
||||||
color:#000;
|
color:#000;
|
||||||
transform: translate3d(0, 1px, 0);
|
transform: translate3d(0, 1px, 0);
|
||||||
.header-top{
|
.header-top{
|
||||||
width: 360px;
|
width: 360px;
|
||||||
margin: 0px auto;
|
margin: 0px auto;
|
||||||
overflow: auto;
|
|
||||||
padding: 0 !important;
|
padding: 0 !important;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
.middle{
|
.middle{
|
||||||
@@ -99,7 +97,6 @@ ion-button{
|
|||||||
.upper-content{
|
.upper-content{
|
||||||
font-family: Roboto;
|
font-family: Roboto;
|
||||||
margin-left: 41px;
|
margin-left: 41px;
|
||||||
overflow: auto;
|
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
|
|
||||||
.label{
|
.label{
|
||||||
|
|||||||
@@ -7,9 +7,7 @@ import { DailyWorkTask, fullTask } from '../../../../models/dailyworktask.model'
|
|||||||
import { ActivatedRoute, NavigationExtras, Router } from '@angular/router';
|
import { ActivatedRoute, NavigationExtras, Router } from '@angular/router';
|
||||||
|
|
||||||
import { Event } from '../../../../models/event.model';
|
import { Event } from '../../../../models/event.model';
|
||||||
import { AnimationController, MenuController, ModalController, 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'
|
import { momentG } from 'src/plugin/momentG'
|
||||||
import { DiscartExpedientModalPage } from '../../discart-expedient-modal/discart-expedient-modal.page';
|
import { DiscartExpedientModalPage } from '../../discart-expedient-modal/discart-expedient-modal.page';
|
||||||
import { BookMeetingModalPage } from '../../expediente/book-meeting-modal/book-meeting-modal.page';
|
import { BookMeetingModalPage } from '../../expediente/book-meeting-modal/book-meeting-modal.page';
|
||||||
@@ -19,6 +17,7 @@ import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
|
|||||||
import { DespachosPrOptionsPage } from 'src/app/shared/popover/despachos-pr-options/despachos-pr-options.page';
|
import { DespachosPrOptionsPage } from 'src/app/shared/popover/despachos-pr-options/despachos-pr-options.page';
|
||||||
import { ToastService } from 'src/app/services/toast.service';
|
import { ToastService } from 'src/app/services/toast.service';
|
||||||
import { Location } from '@angular/common'
|
import { Location } from '@angular/common'
|
||||||
|
import { DespachoService } from 'src/app/Rules/despacho.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-despacho-pr',
|
selector: 'app-despacho-pr',
|
||||||
@@ -32,7 +31,6 @@ export class DespachoPrPage implements OnInit {
|
|||||||
customDate:any;
|
customDate:any;
|
||||||
|
|
||||||
task: any;
|
task: any;
|
||||||
attachments:any;
|
|
||||||
fulltask: any;
|
fulltask: any;
|
||||||
eventsList: Event[];
|
eventsList: Event[];
|
||||||
serialNumber: string;
|
serialNumber: string;
|
||||||
@@ -53,6 +51,7 @@ export class DespachoPrPage implements OnInit {
|
|||||||
private activatedRoute: ActivatedRoute,
|
private activatedRoute: ActivatedRoute,
|
||||||
private toastService: ToastService,
|
private toastService: ToastService,
|
||||||
private location: Location,
|
private location: Location,
|
||||||
|
private despachoService: DespachoService
|
||||||
) {
|
) {
|
||||||
this.activatedRoute.paramMap.subscribe(params => {
|
this.activatedRoute.paramMap.subscribe(params => {
|
||||||
if(params["params"].SerialNumber) {
|
if(params["params"].SerialNumber) {
|
||||||
@@ -146,24 +145,6 @@ export class DespachoPrPage implements OnInit {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// async LoadRelatedEvents(serial: string) {
|
|
||||||
// if (this.eventsList == null) {
|
|
||||||
// this.attachmentsService.getAttachmentsBySerial(serial).subscribe(res => {
|
|
||||||
// console.log(res);
|
|
||||||
// res.forEach(att => {
|
|
||||||
// if (this.eventsList == null) {
|
|
||||||
// this.eventsList = new Array();
|
|
||||||
// }
|
|
||||||
// this.events.getEvent(att.ParentId).subscribe(event => {
|
|
||||||
// this.eventsList.push(event);
|
|
||||||
// console.log(this.eventsList);
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
viewDocument(docId:string){
|
viewDocument(docId:string){
|
||||||
this.processes.GetDocumentUrl(docId, '361').subscribe(res=>{
|
this.processes.GetDocumentUrl(docId, '361').subscribe(res=>{
|
||||||
console.log(res);
|
console.log(res);
|
||||||
@@ -232,20 +213,16 @@ export class DespachoPrPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async generateDiploma(note:string, documents:any){
|
async generateDiploma(note:string, documents:any){
|
||||||
let body = {
|
|
||||||
"serialNumber": this.serialNumber,
|
|
||||||
"action": "Reencaminhar",
|
|
||||||
"ActionTypeId": 99999839,
|
|
||||||
"dataFields": {
|
|
||||||
"ReviewUserComment": note,
|
|
||||||
},
|
|
||||||
"AttachmentList" :documents,
|
|
||||||
}
|
|
||||||
|
|
||||||
const loader = this.toastService.loading()
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await this.processes.CompleteTask(body).toPromise()
|
await this.despachoService.generateDiploma({
|
||||||
|
serialnumber: this.serialNumber,
|
||||||
|
note,
|
||||||
|
documents
|
||||||
|
}).toPromise()
|
||||||
|
|
||||||
this.toastService.successMessage('Processo criado')
|
this.toastService.successMessage('Processo criado')
|
||||||
this.close();
|
this.close();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -346,8 +323,6 @@ export class DespachoPrPage implements OnInit {
|
|||||||
console.log(res);
|
console.log(res);
|
||||||
if(res.data) {
|
if(res.data) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const DocumentToSave = res.data.documents.map((e) => {
|
const DocumentToSave = res.data.documents.map((e) => {
|
||||||
return {
|
return {
|
||||||
ApplicationId: e.ApplicationType,
|
ApplicationId: e.ApplicationType,
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { ProcessesService } from 'src/app/services/processes.service';
|
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 { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
|
||||||
import { ActivatedRoute } from '@angular/router';
|
import { ActivatedRoute } from '@angular/router';
|
||||||
import { Event } from '../../../../models/event.model';
|
import { Event } from '../../../../models/event.model';
|
||||||
@@ -45,8 +43,6 @@ export class DespachoPage implements OnInit {
|
|||||||
constructor(private activateRoute: ActivatedRoute,
|
constructor(private activateRoute: ActivatedRoute,
|
||||||
private processes: ProcessesService,
|
private processes: ProcessesService,
|
||||||
private iab: InAppBrowser,
|
private iab: InAppBrowser,
|
||||||
private attachmentsService: AttachmentsService,
|
|
||||||
private events: EventsService,
|
|
||||||
private menu: MenuController,
|
private menu: MenuController,
|
||||||
private modalController: ModalController,
|
private modalController: ModalController,
|
||||||
public popoverController: PopoverController,
|
public popoverController: PopoverController,
|
||||||
@@ -192,19 +188,11 @@ export class DespachoPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async arquivar(note:string, documents: AttachmentList) {
|
async arquivar(note:string, documents: AttachmentList) {
|
||||||
let body = {
|
|
||||||
"serialNumber": this.serialnumber,
|
|
||||||
"action": "Arquivo",
|
|
||||||
"ActionTypeId": 95,
|
|
||||||
"dataFields": {
|
|
||||||
"ReviewUserComment": note,
|
|
||||||
},
|
|
||||||
"AttachmentList" :documents,
|
|
||||||
}
|
|
||||||
const loader = this.toastService.loading()
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await this.processes.CompleteTask(body).toPromise()
|
await this.despachoService.arquivar(note, documents,this.serialnumber).toPromise()
|
||||||
this.toastService.successMessage('Processo descartado')
|
this.toastService.successMessage('Processo descartado')
|
||||||
this.close();
|
this.close();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -214,7 +202,6 @@ export class DespachoPage implements OnInit {
|
|||||||
loader.remove()
|
loader.remove()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async reexecute(note:string, documents:any) {
|
async reexecute(note:string, documents:any) {
|
||||||
|
|||||||
-1
@@ -116,7 +116,6 @@ ion-button{
|
|||||||
.upper-content{
|
.upper-content{
|
||||||
font-family: Roboto;
|
font-family: Roboto;
|
||||||
margin-left: 41px;
|
margin-left: 41px;
|
||||||
overflow: auto;
|
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
|
|
||||||
.label{
|
.label{
|
||||||
|
|||||||
@@ -98,7 +98,6 @@ ion-button{
|
|||||||
.upper-content{
|
.upper-content{
|
||||||
font-family: Roboto;
|
font-family: Roboto;
|
||||||
margin-left: 41px;
|
margin-left: 41px;
|
||||||
overflow: auto;
|
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
|
|
||||||
.label{
|
.label{
|
||||||
|
|||||||
-1
@@ -32,7 +32,6 @@ ion-menu{
|
|||||||
}
|
}
|
||||||
.upper-content{
|
.upper-content{
|
||||||
padding-left: 50px;
|
padding-left: 50px;
|
||||||
overflow: auto;
|
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
|
|
||||||
.content-location{
|
.content-location{
|
||||||
|
|||||||
-1
@@ -96,7 +96,6 @@ ion-button{
|
|||||||
.upper-content{
|
.upper-content{
|
||||||
font-family: Roboto;
|
font-family: Roboto;
|
||||||
margin-left: 41px;
|
margin-left: 41px;
|
||||||
overflow: auto;
|
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
|
|
||||||
.label{
|
.label{
|
||||||
|
|||||||
@@ -96,7 +96,6 @@ ion-button{
|
|||||||
.upper-content{
|
.upper-content{
|
||||||
font-family: Roboto;
|
font-family: Roboto;
|
||||||
margin-left: 41px;
|
margin-left: 41px;
|
||||||
overflow: auto;
|
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
|
|
||||||
.label{
|
.label{
|
||||||
|
|||||||
@@ -97,7 +97,6 @@ ion-content{
|
|||||||
width: calc(100%-50px);
|
width: calc(100%-50px);
|
||||||
margin-left: 50px;
|
margin-left: 50px;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
overflow: auto;
|
|
||||||
|
|
||||||
.content-location{
|
.content-location{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|||||||
Reference in New Issue
Block a user