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