diff --git a/src/app/modules/rup/components/core/rup.component.ts b/src/app/modules/rup/components/core/rup.component.ts index 471d24bc4b..7b67eec4f4 100644 --- a/src/app/modules/rup/components/core/rup.component.ts +++ b/src/app/modules/rup/components/core/rup.component.ts @@ -51,6 +51,7 @@ export class RUPComponent implements OnInit, AfterViewInit, OnDestroy { @Input() vistaHUDS = false; @Input() params: any; @Input() style: any; + @Input() habilitado: any; public mensaje: any = {}; @@ -100,6 +101,7 @@ export class RUPComponent implements OnInit, AfterViewInit, OnDestroy { componentReference.instance['paciente'] = this.paciente; componentReference.instance['params'] = this.params; componentReference.instance['style'] = this.style; + componentReference.instance['habilitado'] = this.habilitado; // Event bubbling componentReference.instance['change'].subscribe(value => { @@ -283,7 +285,7 @@ export class RUPComponent implements OnInit, AfterViewInit, OnDestroy { get isValid() { if (this.rupInstance) { - return (!this.rupInstance.formulario || !this.rupInstance.formulario.touched || (!this.rupInstance.formulario.invalid) ) && this.rupInstance.onValidate(); + return (!this.rupInstance.formulario || !this.rupInstance.formulario.touched || (!this.rupInstance.formulario.invalid)) && this.rupInstance.onValidate(); } return true; } @@ -316,7 +318,7 @@ export class RUPComponent implements OnInit, AfterViewInit, OnDestroy { for (let i = 0; i < this.registro.registros.length; i++) { const concepto = this.registro.registros[i].concepto; const requerido = requeridos[i]; - const elementoRUP = this.registro.registros[i].elementoRUP ? this.elementosRUPService.getById(this.registro.registros[i].elementoRUP): null; + const elementoRUP = this.registro.registros[i].elementoRUP ? this.elementosRUPService.getById(this.registro.registros[i].elementoRUP) : null; if (requerido && requerido.concepto.conceptId === concepto.conceptId) { requerido.elementoRUP = elementoRUP || requerido.elementoRUP; response.push(requerido); diff --git a/src/app/modules/rup/components/elementos/FormulaBase.component.ts b/src/app/modules/rup/components/elementos/FormulaBase.component.ts index 9573afbfef..e3833a8e6c 100644 --- a/src/app/modules/rup/components/elementos/FormulaBase.component.ts +++ b/src/app/modules/rup/components/elementos/FormulaBase.component.ts @@ -13,6 +13,7 @@ export class FormulaBaseComponent extends RUPComponent implements OnInit { public formulaProvider: FormulaBaseService; public resultado; public hasRules = false; + public habilitado = false; public valorManual: Boolean = false; ngOnInit() { @@ -62,7 +63,8 @@ export class FormulaBaseComponent extends RUPComponent implements OnInit { this.addFact('value', this.registro.valor); } - changeValorManual() { + changeValorManual(valor) { + this.valorManual = valor; if (this.valorManual) { this.registro.valorManual = true; this.registro.registros.map(reg => reg.valor = null); diff --git a/src/app/modules/rup/components/elementos/FormulaBase.html b/src/app/modules/rup/components/elementos/FormulaBase.html index 72a8870904..80323ee106 100644 --- a/src/app/modules/rup/components/elementos/FormulaBase.html +++ b/src/app/modules/rup/components/elementos/FormulaBase.html @@ -1,45 +1,69 @@ -
-
- - -
- - -
- - -
+ + + + +
+ + +
+
+
+ + +
+ + +
+
-
-
- - - - - - - - -

- - {{ registro.valor }} - - - {{ mensaje.texto }} - - +

+
+
+ + + +

+ + {{registro.valor}} + + + {{ mensaje.texto }} + + + + +

+
+ + + + + +
+
+ - -

- -
-
+ + +
+
+
+ +
\ No newline at end of file diff --git a/src/app/modules/rup/components/elementos/valorFecha.component.ts b/src/app/modules/rup/components/elementos/valorFecha.component.ts index 90c58d8224..2e4cb31fb1 100644 --- a/src/app/modules/rup/components/elementos/valorFecha.component.ts +++ b/src/app/modules/rup/components/elementos/valorFecha.component.ts @@ -11,11 +11,11 @@ export class ValorFechaComponent extends RUPComponent implements OnInit { get DateFormat() { switch (this.params.type) { case 'date': - return moment(this.registro.valor).format('DD/MM/YYYY'); + return (this.registro.valor) ? moment(this.registro.valor).format('DD/MM/YYYY') : 'Sin fecha'; case 'datetime': - return moment(this.registro.valor).format('DD/MM/YYYY hh:mm'); + return (this.registro.valor) ? moment(this.registro.valor).format('DD/MM/YYYY hh:mm') : 'Sin fecha'; case 'time': - return moment(this.registro.valor).format('hh:mm'); + return (this.registro.valor) ? moment(this.registro.valor).format('hh:mm') : 'Sin hora'; default: break; } diff --git a/src/app/modules/rup/components/elementos/valorFecha.html b/src/app/modules/rup/components/elementos/valorFecha.html index aa1404e594..49e6c8f9c8 100644 --- a/src/app/modules/rup/components/elementos/valorFecha.html +++ b/src/app/modules/rup/components/elementos/valorFecha.html @@ -2,7 +2,10 @@
- +