Add new item in despacho forms.

This commit is contained in:
tiago.kayaya
2021-02-17 09:47:00 +01:00
parent 3c138e81c7
commit d1590de14e
4 changed files with 30 additions and 2 deletions
+1
View File
@@ -5,6 +5,7 @@ export class Despacho{
DistributionType: string; DistributionType: string;
CountryCode: string; CountryCode: string;
Priority: string; Priority: string;
SubjectTypeId:string;
UserEmail: string; UserEmail: string;
UsersSelected: Participant[]; UsersSelected: Participant[];
DispatchFolder: Folder; DispatchFolder: Folder;
@@ -32,6 +32,18 @@
</div> </div>
</div> </div>
</div> </div>
<div class="container-div">
<div class="ion-item-class-2">
<div class="ion-icon-class">
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
</div>
<div class="ion-input-class">
<ion-select placeholder="Tipo" [(ngModel)]="postData.SubjectTypeId" interface="action-sheet" Cancel-text="Cancelar" required>
<ion-select-option *ngFor="let type of subjectTypes" value="{{type.Code}}">{{type.Description}}</ion-select-option>
</ion-select>
</div>
</div>
</div>
<div class="container-div"> <div class="container-div">
<div class="ion-item-class-2"> <div class="ion-item-class-2">
@@ -34,6 +34,7 @@ export class ExpedientTaskModalPage implements OnInit {
taskDescription: string; taskDescription: string;
user: string; user: string;
loadedAttachments:any; loadedAttachments:any;
subjectTypes:any;
postData: Despacho; postData: Despacho;
dispatchFolder: Folder; dispatchFolder: Folder;
@@ -65,6 +66,8 @@ export class ExpedientTaskModalPage implements OnInit {
this.postData.UsersSelected = this.participants; this.postData.UsersSelected = this.participants;
/* By Default TypeDeadline should be 'Normal' */ /* By Default TypeDeadline should be 'Normal' */
this.postData.Priority = '99999861'; this.postData.Priority = '99999861';
/* By Default TypeDeadline should be 'Economia' */
this.postData.SubjectTypeId = '99999844';
/* Initialize 'Subject' with the title of the expedient */ /* Initialize 'Subject' with the title of the expedient */
this.postData.DispatchFolder.Subject = this.task.workflowInstanceFolio; this.postData.DispatchFolder.Subject = this.task.workflowInstanceFolio;
} }
@@ -80,6 +83,8 @@ export class ExpedientTaskModalPage implements OnInit {
console.log(this.task.serialNumber); console.log(this.task.serialNumber);
this.getAttachments(); this.getAttachments();
console.log(this.getSubjectType());
} }
close(){ close(){
@@ -89,6 +94,12 @@ export class ExpedientTaskModalPage implements OnInit {
cancelTask(){ cancelTask(){
this.modalController.dismiss(null); this.modalController.dismiss(null);
} }
getSubjectType(){
this.processes.GetSubjectType().subscribe(res=>{
console.log(res);
this.subjectTypes = res;
});
}
saveTask(){ saveTask(){
console.log(this.taskType); console.log(this.taskType);
@@ -100,6 +111,7 @@ export class ExpedientTaskModalPage implements OnInit {
CountryCode: 'AO', CountryCode: 'AO',
Priority: this.postData.Priority, Priority: this.postData.Priority,
UserEmail: this.user, UserEmail: this.user,
SubjectTypeId: this.postData.SubjectTypeId,
UsersSelected: this.participants, UsersSelected: this.participants,
DispatchFolder: this.dispatchFolder, DispatchFolder: this.dispatchFolder,
} }
@@ -113,6 +125,7 @@ export class ExpedientTaskModalPage implements OnInit {
CountryCode: 'AO', CountryCode: 'AO',
Priority: this.postData.Priority, Priority: this.postData.Priority,
UserEmail: this.user, UserEmail: this.user,
SubjectTypeId: this.postData.SubjectTypeId,
UsersSelected: this.participants, UsersSelected: this.participants,
DispatchFolder: this.dispatchFolder, DispatchFolder: this.dispatchFolder,
} }
@@ -124,6 +137,7 @@ export class ExpedientTaskModalPage implements OnInit {
CountryCode: 'AO', CountryCode: 'AO',
Priority: this.postData.Priority, Priority: this.postData.Priority,
UserEmail: this.user, UserEmail: this.user,
SubjectTypeId: this.postData.SubjectTypeId,
UsersSelected: this.participants, UsersSelected: this.participants,
DispatchFolder: this.dispatchFolder, DispatchFolder: this.dispatchFolder,
} }
@@ -201,6 +215,7 @@ export class ExpedientTaskModalPage implements OnInit {
} }
async distartExpedientModal(){ async distartExpedientModal(){
console.log(this.task.serialNumber);
const modal = await this.modalController.create({ const modal = await this.modalController.create({
component: DiscartExpedientModalPage, component: DiscartExpedientModalPage,
componentProps: { componentProps: {
+1 -1
View File
@@ -92,7 +92,7 @@ export class ProcessesService {
let options = { let options = {
headers: this.headers, headers: this.headers,
params: params params: params,
}; };
return this.http.get<any>(`${geturl}`, options); return this.http.get<any>(`${geturl}`, options);
} }