<mat-progress-bar mode="indeterminate" *ngIf="isLoadingForm"></mat-progress-bar>
<h2 mat-dialog-title>Registrar Orden de Compra</h2>
<mat-dialog-content>
  <form [formGroup]="formGroup" class="override_content_flex mt-10">
    <div class="col-flex-12">
      <mat-form-field appearance="outline" class="w-100">
        <mat-label>Propósito</mat-label>
        <mat-select formControlName="PROPOSITO">
            <mat-option value="" disabled style="display: none;"> <i>Seleccione una opción...</i> </mat-option>
            <mat-option value="NA">--- No Aplica ---</mat-option>
            <mat-optgroup *ngFor="let project of arrProject" [label]="project.typeMaintenance">
                <mat-option *ngFor="let maintenance of project.dataMaintenance" [value]="maintenance.IDORDEN">
                    Orden #{{ maintenance.IDORDEN }}
                </mat-option>
            </mat-optgroup>
        </mat-select>
      </mat-form-field>
    </div>
    <div class="col-flex-12">
      <mat-form-field appearance="outline" class="w-100">
        <mat-label>Despacho</mat-label>
        <mat-select formControlName="DESPACHO">
          <mat-option *ngFor="let dispatch of arrDispatch" [value]="dispatch.DESP_IDDE">{{dispatch.DESP_NODE}} ({{dispatch.DESP_IDDE}})</mat-option>
        </mat-select>
      </mat-form-field>
    </div>
  </form>
</mat-dialog-content>
<mat-dialog-actions align="end">
  <button mat-button cdkFocusInitial mat-dialog-close>Cancelar</button>
  <button mat-button (click)="alert()" [disabled]="formGroup.invalid">Registrar Orden</button>
</mat-dialog-actions>
