mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
create dispatch from attachment
This commit is contained in:
@@ -172,7 +172,10 @@ export class ViewDocumentPage implements OnInit {
|
|||||||
taskAction: taskAction, // check
|
taskAction: taskAction, // check
|
||||||
task: this.task, // check
|
task: this.task, // check
|
||||||
document: this.Document, // nope
|
document: this.Document, // nope
|
||||||
aplicationId: this.Document.ApplicationId || this.Document.ApplicationID // check
|
aplicationId: this.Document.ApplicationId || this.Document.ApplicationID, // check
|
||||||
|
applicationId: this.applicationId,
|
||||||
|
docId: this.docId,
|
||||||
|
createProcessFromFile: true,
|
||||||
},
|
},
|
||||||
cssClass: classs,
|
cssClass: classs,
|
||||||
});
|
});
|
||||||
|
|||||||
+31
-5
@@ -1,4 +1,4 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, Input, OnInit } from '@angular/core';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { ModalController, NavParams } from '@ionic/angular';
|
import { ModalController, NavParams } from '@ionic/angular';
|
||||||
import { Despacho } from 'src/app/models/despacho.model';
|
import { Despacho } from 'src/app/models/despacho.model';
|
||||||
@@ -27,6 +27,7 @@ import { PermissionService } from 'src/app/services/permission.service';
|
|||||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||||
import { RouteService } from 'src/app/services/route.service';
|
import { RouteService } from 'src/app/services/route.service';
|
||||||
import { TaskService } from 'src/app/services/task.service'
|
import { TaskService } from 'src/app/services/task.service'
|
||||||
|
import { z } from 'zod';
|
||||||
|
|
||||||
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
||||||
parse: {
|
parse: {
|
||||||
@@ -41,6 +42,12 @@ const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const createProcessFromFileSchema = z.object({
|
||||||
|
applicationId: z.any(),
|
||||||
|
docId: z.any(),
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-expedient-task-modal',
|
selector: 'app-expedient-task-modal',
|
||||||
templateUrl: './expedient-task-modal.page.html',
|
templateUrl: './expedient-task-modal.page.html',
|
||||||
@@ -59,6 +66,8 @@ export class ExpedientTaskModalPage implements OnInit {
|
|||||||
taskType:string;
|
taskType:string;
|
||||||
task: task;
|
task: task;
|
||||||
aplicationId = null
|
aplicationId = null
|
||||||
|
docId!: string
|
||||||
|
createProcessFromFile: false
|
||||||
|
|
||||||
taskParticipants: any = [];
|
taskParticipants: any = [];
|
||||||
taskParticipantsCc: any = [];
|
taskParticipantsCc: any = [];
|
||||||
@@ -121,14 +130,31 @@ export class ExpedientTaskModalPage implements OnInit {
|
|||||||
this.loggeduser = SessionStore.user;
|
this.loggeduser = SessionStore.user;
|
||||||
this.task = this.navParams.get('task');
|
this.task = this.navParams.get('task');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
this.SearchFolder = this.navParams.get('SearchFolder');
|
this.SearchFolder = this.navParams.get('SearchFolder');
|
||||||
this.aplicationId = this.navParams.get('aplicationId')
|
this.aplicationId = this.navParams.get('aplicationId') | this.navParams.get('applicationId')
|
||||||
this.document = this.navParams.get('document')
|
this.docId = this.navParams.get('docId')
|
||||||
|
this.createProcessFromFile = this.navParams.get('createProcessFromFile') || false;
|
||||||
|
|
||||||
|
this.document = this.navParams.get('document');
|
||||||
this.taskType = this.navParams.get('taskAction');
|
this.taskType = this.navParams.get('taskAction');
|
||||||
|
|
||||||
|
|
||||||
|
if(this.createProcessFromFile) {
|
||||||
|
try {
|
||||||
|
createProcessFromFileSchema.parse({
|
||||||
|
applicationId: this.aplicationId,
|
||||||
|
docId: this.docId
|
||||||
|
});
|
||||||
|
|
||||||
|
this.task.workflowInstanceDataFields.SourceSecFsID = this.aplicationId; //361
|
||||||
|
this.task.workflowInstanceDataFields.SourceType = 'DOC'; //FOLDER
|
||||||
|
this.task.workflowInstanceDataFields.SourceID = this.docId; //FolderId
|
||||||
|
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Validation failed params, expediente-task-modal:', error.errors);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// try {
|
// try {
|
||||||
// if(this.document) {
|
// if(this.document) {
|
||||||
// const doc: any = this.document
|
// const doc: any = this.document
|
||||||
|
|||||||
Reference in New Issue
Block a user