<div class="flex flex-col w-full">
  <label>ประเภทรายงาน</label>
  <select [(ngModel)]="obj.is_testing_information_report">
    <option [ngValue]="false">รายงานจำแนกตามใบเสร็จ</option>
    <option [ngValue]="true">รายงานจำแนกตามรอบสอบ</option>
  </select>
</div>

<div class="flex flex-col w-full" *ngIf="obj.is_testing_information_report">
  <label>รอบสอบ</label>
  <input #res type="text" [matAutocomplete]="auto3" [(ngModel)]="obj.testing_information_uid" >
  <mat-autocomplete #auto3="matAutocomplete" [displayWith]="display.bind(this)">
    <mat-option>
      กรุณาเลือก
    </mat-option>
    <mat-option *ngFor="let x of testingInformationList | searchAuto : res.value : 'testing_information_name'" [value]="x.testing_information_uid">
      {{x.testing_information_name}}
    </mat-option>
  </mat-autocomplete>
</div>

<div class="flex flex-col w-full" *ngIf="!etest103">
  <label>หมายเลขเครื่อง</label>
  <select [(ngModel)]="obj.counter_no">
    <option *ngFor="let x of counterList" [ngValue]="x.counter_no">
      {{x.counter_no}}
    </option>
  </select>
</div>
<div class="flex flex-col w-full" *ngIf="!etest103">
  <label>คาบ</label>
  <select [(ngModel)]="obj.period">
    <option *ngFor="let x of periodList" [ngValue]="x.period">
      {{x.period}}
    </option>
  </select>
</div>

<div class="flex flex-col w-full" *ngIf="etest103">
  <label>วันที่เริ่มต้น</label>
  <mat-form-field>
    <input matInput [matDatepicker]="picker" [(ngModel)]="obj.start_date" [max]="obj.end_date">
    <mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
    <mat-datepicker #picker></mat-datepicker>
  </mat-form-field>
</div>

<div class="flex flex-col w-full" *ngIf="etest103">
  <label>วันที่สิ้นสุด</label>
  <mat-form-field>
    <input matInput [matDatepicker]="picker1" [(ngModel)]="obj.end_date" [min]="obj.start_date"
      [disabled]="!obj.start_date">
    <mat-datepicker-toggle matSuffix [for]="picker1"></mat-datepicker-toggle>
    <mat-datepicker #picker1></mat-datepicker>
  </mat-form-field>
</div>

<br>
<div class="flex justify-center items-center">
  <button class="search-button" [disabled]="obj.counter_no == null || obj.period == null" (click)="confirm()"
    *ngIf="etest101">ตกลง</button>
    <button class="search-button" (click)="confirm102()"
    *ngIf="etest102">ตกลง</button>
  <button class="search-button" [disabled]="obj.end_date == null || obj.start_date == null" (click)="confirm103()"
    *ngIf="etest103">ตกลง</button>
</div>

<!-- <pre>{{obj | json}}</pre> -->
