mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
draft added to diploma
This commit is contained in:
@@ -66,10 +66,10 @@
|
||||
<div class="bottom-content width-100">
|
||||
<ion-list *ngIf="fulltask.Documents">
|
||||
<h5>Documentos Anexados</h5>
|
||||
<ion-item *ngFor="let attachment of fulltask.Documents"
|
||||
<ion-item *ngFor="let attachment of mergedArray"
|
||||
class="ion-no-margin ion-no-padding cursor-pointer">
|
||||
<ion-label
|
||||
(click)="viewDocument(attachment.DocId, attachment)">
|
||||
(click)="viewDocument(attachment.DocId, attachment, attachment.content)">
|
||||
<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>
|
||||
|
||||
@@ -21,6 +21,7 @@ import { RouteService } from 'src/app/services/route.service';
|
||||
import { PermissionService } from 'src/app/services/permission.service';
|
||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||
import { TaskService } from 'src/app/services/task.service'
|
||||
import { TinyMCEPage } from 'src/app/tiny-mce/tiny-mce.page';
|
||||
|
||||
@Component({
|
||||
selector: 'app-despacho-pr',
|
||||
@@ -41,6 +42,7 @@ export class DespachoPrPage implements OnInit {
|
||||
profile: string;
|
||||
intervenientes: any =[]
|
||||
cc: any = [];
|
||||
mergedArray: any = [];
|
||||
|
||||
constructor(
|
||||
private activateRoute: ActivatedRoute,
|
||||
@@ -121,6 +123,15 @@ export class DespachoPrPage implements OnInit {
|
||||
"TaskStartDate": res.taskStartDate
|
||||
}
|
||||
this.fulltask = res;
|
||||
let stringDraft = res.workflowInstanceDataFields.DraftIds;
|
||||
let split_stringDraft = stringDraft?.split(",");
|
||||
|
||||
try {
|
||||
this.getDraft(split_stringDraft);
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
this.getDocumentPdf(this.fulltask.Documents)
|
||||
|
||||
// this.updateProcessOnDB(res);
|
||||
// console.log('this.fulltask', this.fulltask)
|
||||
@@ -177,26 +188,40 @@ export class DespachoPrPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
async viewDocument(DocId: string, Document) {
|
||||
async viewDocument(docId: string, Document, content) {
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: ViewDocumentPage,
|
||||
componentProps: {
|
||||
trustedUrl: '',
|
||||
file: {
|
||||
title: Document.Assunto,
|
||||
url: '',
|
||||
title_link: '',
|
||||
if (Document.content == "") {
|
||||
const modal = await this.modalController.create({
|
||||
component: ViewDocumentPage,
|
||||
componentProps: {
|
||||
trustedUrl: '',
|
||||
file: {
|
||||
title: Document.Assunto,
|
||||
url: '',
|
||||
title_link: '',
|
||||
},
|
||||
Document,
|
||||
applicationId: Document.ApplicationId,
|
||||
docId: Document.DocId || Document.SourceId,
|
||||
folderId: this.task.FolderId,
|
||||
task: this.fulltask
|
||||
},
|
||||
Document,
|
||||
applicationId: Document.ApplicationId,
|
||||
docId: Document.DocId || Document.SourceId,
|
||||
folderId: this.task.FolderId,
|
||||
task: this.fulltask
|
||||
},
|
||||
cssClass: 'modal modal-desktop'
|
||||
});
|
||||
await modal.present();
|
||||
cssClass: 'modal modal-desktop'
|
||||
});
|
||||
await modal.present();
|
||||
} else {
|
||||
const modal = await this.modalController.create({
|
||||
component: TinyMCEPage,
|
||||
componentProps: {
|
||||
Document,
|
||||
content
|
||||
},
|
||||
cssClass: 'modal modal-desktop'
|
||||
});
|
||||
await modal.present();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -557,5 +582,49 @@ export class DespachoPrPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
getDocumentPdf(Documents: any) {
|
||||
Documents.forEach(element => {
|
||||
let docObject = {
|
||||
"ApplicationId": element.ApplicationId,
|
||||
"Assunto": element.Assunto,
|
||||
"DocDate": element.DocDate,
|
||||
"DocId": element.DocId,
|
||||
"DocNumber": element.DocNumber,
|
||||
"FolderId": element.FolderId,
|
||||
"Sender": element.Sender,
|
||||
"SourceDocId": element.SourceDocId,
|
||||
"content": "",
|
||||
"path": "",
|
||||
"ownerId": "",
|
||||
"status": "",
|
||||
}
|
||||
this.mergedArray.push(docObject);
|
||||
});
|
||||
}
|
||||
getDraft(split_stringDraft: string[]) {
|
||||
split_stringDraft.forEach(element => {
|
||||
console.log('List of ids', element)
|
||||
this.processes.GetDraftByID(element).subscribe((resd) => {
|
||||
let object = {
|
||||
"ApplicationId": "",
|
||||
"Assunto": resd.data.description,
|
||||
"DocDate": "",
|
||||
"DocId": resd.data.id,
|
||||
"DocNumber": "",
|
||||
"FolderId": "",
|
||||
"Sender": "",
|
||||
"SourceDocId": "",
|
||||
"content": resd.data.content,
|
||||
"path": resd.data.path,
|
||||
"ownerId": resd.data.ownerId,
|
||||
"status": resd.data.status,
|
||||
}
|
||||
this.mergedArray.push(object)
|
||||
console.log('List of draff', resd)
|
||||
})
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -111,36 +111,13 @@ export class DespachoPage implements OnInit {
|
||||
this.TaskService.loadDiplomas();
|
||||
let stringDraft = res.workflowInstanceDataFields.DraftIds;
|
||||
console.log('sring to array', stringDraft)
|
||||
let split_stringDraft = stringDraft.split(",");
|
||||
let listDrafts = []
|
||||
|
||||
split_stringDraft.forEach(element => {
|
||||
console.log('List of ids', element)
|
||||
this.processes.GetDraftByID(element).subscribe((resd) => {
|
||||
let object = {
|
||||
"ApplicationId": "",
|
||||
"Assunto": resd.data.description,
|
||||
"DocDate": "",
|
||||
"DocId": resd.data.id,
|
||||
"DocNumber": "",
|
||||
"FolderId": "",
|
||||
"Sender": "",
|
||||
"SourceDocId": "",
|
||||
"content": resd.data.content,
|
||||
"path": resd.data.path,
|
||||
"ownerId": resd.data.ownerId,
|
||||
"status": resd.data.status,
|
||||
}
|
||||
this.mergedArray.push(object)
|
||||
console.log('List of draff', resd)
|
||||
})
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
let split_stringDraft = stringDraft?.split(",");
|
||||
|
||||
try {
|
||||
this.getDraft(split_stringDraft);
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
|
||||
this.task = {
|
||||
"SerialNumber": res.serialNumber,
|
||||
@@ -164,31 +141,8 @@ export class DespachoPage implements OnInit {
|
||||
// this.updateProcessOnDB(res);
|
||||
this.fulltask = res;
|
||||
|
||||
console.log('Anexos', this.fulltask.Documents)
|
||||
|
||||
const mergedArray1 = [];
|
||||
const mergedArray2 = [];
|
||||
|
||||
|
||||
// Merge array1 with tag
|
||||
this.fulltask.Documents.forEach(element => {
|
||||
let docObject = {
|
||||
"ApplicationId": element.ApplicationId,
|
||||
"Assunto": element.Assunto,
|
||||
"DocDate": element.DocDate,
|
||||
"DocId": element.DocId,
|
||||
"DocNumber": element.DocNumber,
|
||||
"FolderId": element.FolderId,
|
||||
"Sender": element.Sender,
|
||||
"SourceDocId": element.SourceDocId,
|
||||
"content": "",
|
||||
"path": "",
|
||||
"ownerId": "",
|
||||
"status": "",
|
||||
}
|
||||
this.mergedArray.push(docObject);
|
||||
});
|
||||
|
||||
this.getDocumentPdf(this.fulltask.Documents)
|
||||
|
||||
console.log('All', this.mergedArray)
|
||||
|
||||
let thedate = new Date(this.task.CreateDate);
|
||||
@@ -220,6 +174,49 @@ export class DespachoPage implements OnInit {
|
||||
}
|
||||
});
|
||||
}
|
||||
getDocumentPdf(Documents: any) {
|
||||
Documents.forEach(element => {
|
||||
let docObject = {
|
||||
"ApplicationId": element.ApplicationId,
|
||||
"Assunto": element.Assunto,
|
||||
"DocDate": element.DocDate,
|
||||
"DocId": element.DocId,
|
||||
"DocNumber": element.DocNumber,
|
||||
"FolderId": element.FolderId,
|
||||
"Sender": element.Sender,
|
||||
"SourceDocId": element.SourceDocId,
|
||||
"content": "",
|
||||
"path": "",
|
||||
"ownerId": "",
|
||||
"status": "",
|
||||
}
|
||||
this.mergedArray.push(docObject);
|
||||
});
|
||||
}
|
||||
getDraft(split_stringDraft: string[]) {
|
||||
split_stringDraft.forEach(element => {
|
||||
console.log('List of ids', element)
|
||||
this.processes.GetDraftByID(element).subscribe((resd) => {
|
||||
let object = {
|
||||
"ApplicationId": "",
|
||||
"Assunto": resd.data.description,
|
||||
"DocDate": "",
|
||||
"DocId": resd.data.id,
|
||||
"DocNumber": "",
|
||||
"FolderId": "",
|
||||
"Sender": "",
|
||||
"SourceDocId": "",
|
||||
"content": resd.data.content,
|
||||
"path": resd.data.path,
|
||||
"ownerId": resd.data.ownerId,
|
||||
"status": resd.data.status,
|
||||
}
|
||||
this.mergedArray.push(object)
|
||||
console.log('List of draff', resd)
|
||||
})
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
// updateProcessOnDB(res) {
|
||||
// if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
|
||||
+2
-2
@@ -66,11 +66,11 @@
|
||||
<div class="bottom-content width-100">
|
||||
<ion-list>
|
||||
<h5>Documentos Anexados</h5>
|
||||
<ion-item *ngFor="let attachment of attachments"
|
||||
<ion-item *ngFor="let attachment of mergedArray"
|
||||
class="ion-no-margin ion-no-padding cursor-pointer"
|
||||
>
|
||||
<ion-label
|
||||
(click)="viewDocument(attachment.DocId, attachment)"
|
||||
(click)="viewDocument(attachment.DocId, attachment,attachment.content)"
|
||||
>
|
||||
<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>
|
||||
|
||||
+87
-18
@@ -16,6 +16,7 @@ import { AttachmentList } from 'src/app/models/Excludetask';
|
||||
import { CreateProcessPage } from 'src/app/modals/create-process/create-process.page';
|
||||
import { DiscartExpedientModalPage } from '../../discart-expedient-modal/discart-expedient-modal.page';
|
||||
import { TaskService } from 'src/app/services/task.service'
|
||||
import { TinyMCEPage } from 'src/app/tiny-mce/tiny-mce.page';
|
||||
|
||||
@Component({
|
||||
selector: 'app-diploma-assinar',
|
||||
@@ -35,6 +36,7 @@ export class DiplomaAssinarPage implements OnInit {
|
||||
attachments:any;
|
||||
customDate: any;
|
||||
caller:string;
|
||||
mergedArray: any = [];
|
||||
|
||||
constructor(
|
||||
private processes: ProcessesService,
|
||||
@@ -110,6 +112,15 @@ export class DiplomaAssinarPage implements OnInit {
|
||||
}
|
||||
|
||||
this.fulltask = res;
|
||||
let stringDraft = res.workflowInstanceDataFields.DraftIds;
|
||||
let split_stringDraft = stringDraft?.split(",");
|
||||
|
||||
try {
|
||||
this.getDraft(split_stringDraft);
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
this.getDocumentPdf(this.fulltask.Documents)
|
||||
|
||||
let thedate = new Date(this.task.CreateDate);
|
||||
this.customDate = this.days[thedate.getDay()]+ ", " + thedate.getDate() +" de " + ( this.months[thedate.getMonth()]);
|
||||
@@ -139,26 +150,40 @@ export class DiplomaAssinarPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
async viewDocument(DocId:string, Document) {
|
||||
async viewDocument(docId: string, Document, content) {
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: ViewDocumentPage,
|
||||
componentProps: {
|
||||
trustedUrl: '',
|
||||
file: {
|
||||
title: Document.Assunto,
|
||||
url: '',
|
||||
title_link: '',
|
||||
if (Document.content == "") {
|
||||
const modal = await this.modalController.create({
|
||||
component: ViewDocumentPage,
|
||||
componentProps: {
|
||||
trustedUrl: '',
|
||||
file: {
|
||||
title: Document.Assunto,
|
||||
url: '',
|
||||
title_link: '',
|
||||
},
|
||||
Document,
|
||||
applicationId: Document.ApplicationId,
|
||||
docId: Document.DocId || Document.SourceId,
|
||||
folderId: this.task.FolderId,
|
||||
task: this.fulltask
|
||||
},
|
||||
Document,
|
||||
applicationId: Document.ApplicationId,
|
||||
docId: Document.DocId || Document.SourceId,
|
||||
folderId: this.task.FolderId,
|
||||
task: this.fulltask
|
||||
},
|
||||
cssClass: 'modal modal-desktop'
|
||||
});
|
||||
await modal.present();
|
||||
cssClass: 'modal modal-desktop'
|
||||
});
|
||||
await modal.present();
|
||||
} else {
|
||||
const modal = await this.modalController.create({
|
||||
component: TinyMCEPage,
|
||||
componentProps: {
|
||||
Document,
|
||||
content
|
||||
},
|
||||
cssClass: 'modal modal-desktop'
|
||||
});
|
||||
await modal.present();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -334,4 +359,48 @@ export class DiplomaAssinarPage implements OnInit {
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
|
||||
getDocumentPdf(Documents: any) {
|
||||
Documents.forEach(element => {
|
||||
let docObject = {
|
||||
"ApplicationId": element.ApplicationId,
|
||||
"Assunto": element.Assunto,
|
||||
"DocDate": element.DocDate,
|
||||
"DocId": element.DocId,
|
||||
"DocNumber": element.DocNumber,
|
||||
"FolderId": element.FolderId,
|
||||
"Sender": element.Sender,
|
||||
"SourceDocId": element.SourceDocId,
|
||||
"content": "",
|
||||
"path": "",
|
||||
"ownerId": "",
|
||||
"status": "",
|
||||
}
|
||||
this.mergedArray.push(docObject);
|
||||
});
|
||||
}
|
||||
getDraft(split_stringDraft: string[]) {
|
||||
split_stringDraft.forEach(element => {
|
||||
console.log('List of ids', element)
|
||||
this.processes.GetDraftByID(element).subscribe((resd) => {
|
||||
let object = {
|
||||
"ApplicationId": "",
|
||||
"Assunto": resd.data.description,
|
||||
"DocDate": "",
|
||||
"DocId": resd.data.id,
|
||||
"DocNumber": "",
|
||||
"FolderId": "",
|
||||
"Sender": "",
|
||||
"SourceDocId": "",
|
||||
"content": resd.data.content,
|
||||
"path": resd.data.path,
|
||||
"ownerId": resd.data.ownerId,
|
||||
"status": resd.data.status,
|
||||
}
|
||||
this.mergedArray.push(object)
|
||||
console.log('List of draff', resd)
|
||||
})
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'doneIt' " src="assets/images/theme/doneIt/icons-calendar-arrow-left.svg"></ion-icon>
|
||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " slot="end" src='assets/images/theme/gov/icons-calendar-arrow-left.svg'></ion-icon>
|
||||
</div>
|
||||
<div class="middle d-flex align-center flex-grow-1 ">
|
||||
<div class=" d-flex align-center flex-grow-1 ">
|
||||
<ion-label class="title">{{ task.Folio}}</ion-label>
|
||||
</div>
|
||||
<div class="div-icon" (click)="openOptions()">
|
||||
@@ -64,11 +64,11 @@
|
||||
<div class="bottom-content width-100">
|
||||
<ion-list>
|
||||
<h5>Documentos Anexados</h5>
|
||||
<ion-item *ngFor="let attachment of attachments"
|
||||
<ion-item *ngFor="let attachment of mergedArray"
|
||||
class="ion-no-margin ion-no-padding cursor-pointer"
|
||||
>
|
||||
<ion-label
|
||||
(click)="viewDocument(attachment.DocId, attachment)">
|
||||
(click)="viewDocument(attachment.DocId, attachment, attachment.content)">
|
||||
<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>
|
||||
|
||||
@@ -20,6 +20,7 @@ import { DespachoService } from 'src/app/Rules/despacho.service'
|
||||
import { CreateProcessPage } from 'src/app/modals/create-process/create-process.page';
|
||||
import { DiscartExpedientModalPage } from '../../discart-expedient-modal/discart-expedient-modal.page';
|
||||
import { TaskService } from 'src/app/services/task.service'
|
||||
import { TinyMCEPage } from 'src/app/tiny-mce/tiny-mce.page';
|
||||
|
||||
|
||||
@Component({
|
||||
@@ -40,7 +41,8 @@ export class DiplomaPage implements OnInit {
|
||||
intervenientes: any = []
|
||||
cc: any = [];
|
||||
attachments: any;
|
||||
customDate: any
|
||||
customDate: any;
|
||||
mergedArray: any = [];
|
||||
|
||||
constructor(
|
||||
private processes: ProcessesService,
|
||||
@@ -120,7 +122,17 @@ export class DiplomaPage implements OnInit {
|
||||
"activityInstanceName": res.activityInstanceName,
|
||||
}
|
||||
this.fulltask = res;
|
||||
console.log('Diploma anexo',this.fulltask.Documents )
|
||||
// this.updateProcessOnDB(res)
|
||||
let stringDraft = res.workflowInstanceDataFields.DraftIds;
|
||||
let split_stringDraft = stringDraft?.split(",");
|
||||
|
||||
try {
|
||||
this.getDraft(split_stringDraft);
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
this.getDocumentPdf(this.fulltask.Documents)
|
||||
|
||||
let thedate = new Date(this.task.CreateDate);
|
||||
this.customDate = this.days[thedate.getDay()] + ", " + thedate.getDate() + " de " + (this.months[thedate.getMonth()]);
|
||||
@@ -170,8 +182,9 @@ export class DiplomaPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
async viewDocument(DocId: string, Document) {
|
||||
async viewDocument(DocId: string, Document, content) {
|
||||
|
||||
if (Document.content == "") {
|
||||
const modal = await this.modalController.create({
|
||||
component: ViewDocumentPage,
|
||||
componentProps: {
|
||||
@@ -190,6 +203,17 @@ export class DiplomaPage implements OnInit {
|
||||
cssClass: 'modal modal-desktop'
|
||||
});
|
||||
await modal.present();
|
||||
} else {
|
||||
const modal = await this.modalController.create({
|
||||
component: TinyMCEPage,
|
||||
componentProps: {
|
||||
Document,
|
||||
content
|
||||
},
|
||||
cssClass: 'modal modal-desktop'
|
||||
});
|
||||
await modal.present();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -446,5 +470,49 @@ export class DiplomaPage implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
getDocumentPdf(Documents: any) {
|
||||
Documents.forEach(element => {
|
||||
let docObject = {
|
||||
"ApplicationId": element.ApplicationId,
|
||||
"Assunto": element.Assunto,
|
||||
"DocDate": element.DocDate,
|
||||
"DocId": element.DocId,
|
||||
"DocNumber": element.DocNumber,
|
||||
"FolderId": element.FolderId,
|
||||
"Sender": element.Sender,
|
||||
"SourceDocId": element.SourceDocId,
|
||||
"content": "",
|
||||
"path": "",
|
||||
"ownerId": "",
|
||||
"status": "",
|
||||
}
|
||||
this.mergedArray.push(docObject);
|
||||
});
|
||||
}
|
||||
getDraft(split_stringDraft: string[]) {
|
||||
split_stringDraft.forEach(element => {
|
||||
console.log('List of ids', element)
|
||||
this.processes.GetDraftByID(element).subscribe((resd) => {
|
||||
let object = {
|
||||
"ApplicationId": "",
|
||||
"Assunto": resd.data.description,
|
||||
"DocDate": "",
|
||||
"DocId": resd.data.id,
|
||||
"DocNumber": "",
|
||||
"FolderId": "",
|
||||
"Sender": "",
|
||||
"SourceDocId": "",
|
||||
"content": resd.data.content,
|
||||
"path": resd.data.path,
|
||||
"ownerId": resd.data.ownerId,
|
||||
"status": resd.data.status,
|
||||
}
|
||||
this.mergedArray.push(object)
|
||||
console.log('List of draff', resd)
|
||||
})
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user