浏览代码

Merge branch 'master' of http://209.50.56.224/git/ITTEC/SistemaMantenimiento

JeanBenitez 1 年之前
父节点
当前提交
52927509e0

+ 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);
+          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);