فهرست منبع

Avances preventivo

Jose Brito 1 سال پیش
والد
کامیت
a819af1152

+ 8 - 1
sistema-mantenimiento-front/src/app/components/preventive-maintenance/work-orders/new-work-order/new-work-order.component.ts

@@ -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);
+
+          this.orderFormGroup.controls['equipmentControl'].setValue(`${equipmentCodeDec} - ${order.response.TIPO_EQUIPAMIENTO}`);
+          console.log(equipmentCodeDec, equipmentIDDEc);
+        }
+
         this.orderFormGroup.controls['descriptionControl'].setValue(order.response.DESCRIPCION);
 
         let instructionsArr: Instruction[] = JSON.parse(order.response.INSTRUCCIONES);