|
|
@@ -51,7 +51,9 @@ export class FormsManagementFormComponent implements OnInit {
|
|
|
|
|
|
public arrInformationValidate: InformationValidate[];
|
|
|
|
|
|
- public idForm: string;
|
|
|
+ public title: string;
|
|
|
+ public idForm!: string;
|
|
|
+ public typeForm!: 'R'|'M';
|
|
|
|
|
|
@ViewChild('stepper') stepper!: MatStepper;
|
|
|
|
|
|
@@ -78,7 +80,7 @@ export class FormsManagementFormComponent implements OnInit {
|
|
|
this.arrIdentifiers = [];
|
|
|
this.arrTableColumns = [];
|
|
|
this.arrInformationValidate = [];
|
|
|
- this.idForm = '';
|
|
|
+ this.title = '...';
|
|
|
}
|
|
|
async ngOnInit() {
|
|
|
this.isLoading = true;
|
|
|
@@ -120,7 +122,19 @@ export class FormsManagementFormComponent implements OnInit {
|
|
|
const STR_FORM: string = await this._encService.decrypt(FORM);
|
|
|
const DATA_FORM = JSON.parse(STR_FORM);
|
|
|
|
|
|
- DATA_FORM.ID_FORM
|
|
|
+ this.typeForm = DATA_FORM.TYPE_FORM;
|
|
|
+
|
|
|
+ if (this.typeForm === 'R') {
|
|
|
+ this.title = `Creación de formulario dinámico`;
|
|
|
+ } else if (this.typeForm === 'M') {
|
|
|
+ this.title = `Modificación del formulario dinámico`;
|
|
|
+ this.idForm = DATA_FORM.ID_FORM;
|
|
|
+
|
|
|
+ await this._getFormById(this.idForm);
|
|
|
+ } else {
|
|
|
+ this.resourcesService.openSnackBar(`Opción del tipo de formulario no disponible.`);
|
|
|
+ this.resourcesService.goBack();
|
|
|
+ }
|
|
|
|
|
|
} else {
|
|
|
this.resourcesService.openSnackBar(`Ocurrió un error al obtener los datos del formulario.`);
|
|
|
@@ -128,6 +142,13 @@ export class FormsManagementFormComponent implements OnInit {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private async _getFormById(idForm: string) {
|
|
|
+
|
|
|
+ const ID_FORM: string = await this._encService.encrypt(idForm);
|
|
|
+ const USUARIO: string = this.resourcesService.getUser();
|
|
|
+ const NUMERO_LINEA: number = this.resourcesService.getLineNumber();
|
|
|
+ }
|
|
|
+
|
|
|
private async _getModulesAviable() {
|
|
|
this.isLoadingFieldModule = true;
|
|
|
const USER: string = this.resourcesService.getUser();
|