ordensalida.componente.html 4.65 KB
Newer Older
1
<div class="m-5" [formGroup]="datos_materialSobrante">
2 3 4 5 6 7 8 9 10
  <!----------------------------------------------------------------------DESCRIPCION DE ORDEN DE SALIDA ------------------------------------------------------------------->

  <div class="lg:w-1/5 md:w-full">
    <mat-form-field class="w-full" appearance="outline" floatLabel="always">
      <mat-label>N° de Orden de Salida</mat-label>
      <input soloNumeros="entero" type="text" placeholder="Ingresar N° de Orden Salida" matInput formControlName="numeroOrden" maxlength="6">
    </mat-form-field>
  </div>

11 12 13 14 15 16 17 18 19 20 21 22 23
  <div class="w-full">
    <mat-form-field class="w-full">
      <mat-label>DESCRIPCIÓN DEL MATERIAL SOBRANTE :</mat-label>
      <textarea formControlName="descMaterial" matInput placeholder="Breve descripción de los materiales faltantes y su estado"></textarea>
    </mat-form-field>
  </div>

  <!---------------------------------------------------------------------- SECCIÓN MATERIALES SOBRANTES  ---------------------------------------------------------------------->

  <div class="mt-6">
    <!-- Título y botón de agregar artículo -->
    <div class="grid gap-4 grid-cols-1 sm:grid-cols-2 items-center">
      <mat-label class="text-[1.1em] font-bold mb-4 flex items-center">
24 25
        LISTADO DE MATERIAL SOBRANTE
        <mat-icon>deployed_code_update</mat-icon>
26
      </mat-label>
27
      <button [ngStyle]="{'visibility': activarNuevoArticulo ? 'visible' : 'hidden'}" [disabled]="!activarNuevoArticulo" mat-raised-button (click)="onEventoAgregarArticulo($event)">
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
        <mat-icon>add</mat-icon>
        <b>Agregar material</b>
      </button>
    </div>

    <!-- Tabla de artículos -->
    <div class="overflow-x-auto">
      <table mat-table [dataSource]="dataSource" class="mat-elevation-z8 w-full">
        <!-- Columna Nombre de Artículo -->
        <ng-container matColumnDef="nombre">
          <th mat-header-cell *matHeaderCellDef> NOMBRE DE ARTÍCULO </th>
          <td mat-cell *matCellDef="let element">
              {{ element.nombre }}
          </td>
        </ng-container>

        <!-- Columna Unidad -->
        <ng-container matColumnDef="unidad">
          <th mat-header-cell *matHeaderCellDef> UNIDAD </th>
          <td mat-cell *matCellDef="let element">
              {{ element.unidad }}
          </td>
        </ng-container>

        <!-- Columna Cantidad -->
        <ng-container matColumnDef="cantidad">
          <th mat-header-cell *matHeaderCellDef> CANTIDAD </th>
          <td mat-cell *matCellDef="let element">
              {{ element.cantidad }}
          </td>
        </ng-container>

        <!-- Columna Estado Artículo -->
        <ng-container matColumnDef="estado">
          <th mat-header-cell *matHeaderCellDef> ESTADO ARTÍCULO </th>
          <td mat-cell *matCellDef="let element">
              {{ formatoEstado(element.estado) }}
          </td>
        </ng-container>

        <!-- Columna Acción -->
        <ng-container matColumnDef="accion">
          <th mat-header-cell *matHeaderCellDef> ACCIÓN </th>
          <td mat-cell *matCellDef="let element">
72 73 74 75 76 77
            <button mat-icon-button (click)="onEventoEditarArticulo($event, element)">
              <mat-icon>edit</mat-icon>
            </button>
            <button mat-icon-button (click)="onEventoEliminarArticulo($event, element)">
              <mat-icon>delete</mat-icon>
            </button>
78 79 80 81 82 83 84 85 86
          </td>
        </ng-container>

        <!-- Header y Filas -->
        <tr mat-header-row *matHeaderRowDef="columnasArticulos"></tr>
        <tr mat-row *matRowDef="let row; columns: columnasArticulos;"></tr>
      </table>
    </div>
  </div>
87

88 89
  <div class="mt-6">
    <div><b class="md:text-[1rem] text-[1em] text-black/60">EVIDENCIA DE MATERIAL SOBRANTE: (opcional)</b></div>
90
    <div>
91
      <button mat-fab class="!w-full" style="background-color: #ffcf83" (click)="fotoATC.click()">
92 93 94 95 96 97 98 99 100 101
        <mat-label>FOTO MATERIAL SOBRANTE</mat-label>
        <mat-icon>file_open</mat-icon>
      </button>
      <input  type="file" #fotoATC (change)="onEventoSubirArchivo($event,5)" class="hidden"  multiple accept="image/png, image/jpeg">
    </div>
    <div class="flex w-full mt-2" *ngFor="let archivo of archivosMaterial; let i = index">
        <p class="w-2/4" matTooltip="{{ (archivo.file.name + ' (' + (archivo.file.size / 1000) + ' KB)')}}" matTooltipPosition="above">{{ (archivo.file.name + ' (' + (archivo.file.size / 1000) + ' KB)') | truncate:30:true }}</p>
        <div class="w-2/4 grid grid-cols-3 gap-4">
          <button (click)="gestionArchivos(i,1,archivo.file)"><mat-icon>info</mat-icon></button>
          <button (click)="gestionArchivos(i,3)"><mat-icon>delete</mat-icon></button>
102
        </div>
103 104
    </div>
  </div>
105

106
</div>
107