|
|
@@ -367,7 +367,6 @@ export class NewWorkOrderComponent implements OnInit {
|
|
|
try{
|
|
|
let idUser = localStorage.getItem('idusuario')!;
|
|
|
let order: PreventiveWorkOrderResponse = await lastValueFrom(this._prevMaintService.getWorkOrder(idOrder, idUser, 1));
|
|
|
- console.log(order);
|
|
|
|
|
|
this.hasError = order.error;
|
|
|
this.errorStr = order.msg;
|
|
|
@@ -375,6 +374,14 @@ export class NewWorkOrderComponent implements OnInit {
|
|
|
if(this.hasError){
|
|
|
this.isLoading = false;
|
|
|
}else{
|
|
|
+ if(order.response.ID_EQUIPAMIENTO != null){
|
|
|
+ let equipmentCodeDec = await this._encService.decrypt(order.response.EQUIPAMIENTO);
|
|
|
+ let equipmentIDDEc = await this._encService.decrypt(order.response.ID_EQUIPAMIENTO);
|
|
|
+ let equipmentStr = `${equipmentCodeDec} - ${order.response.TIPO_EQUIPAMIENTO} - ${order.response.MODELO_EQUIPAMIENTO} (${equipmentIDDEc})`;
|
|
|
+
|
|
|
+ this.orderFormGroup.controls['equipmentControl'].setValue(equipmentStr);
|
|
|
+ }
|
|
|
+
|
|
|
this.orderFormGroup.controls['descriptionControl'].setValue(order.response.DESCRIPCION);
|
|
|
|
|
|
let instructionsArr: Instruction[] = JSON.parse(order.response.INSTRUCCIONES);
|