<ion-header *ngIf="isShowHeader">
  <ion-toolbar>
    <ion-buttons slot="start">
      <ion-back-button text="{{ 'generic_goback' | translate }}"></ion-back-button>
    </ion-buttons>
    <ion-title>{{ 'generic_spc_title' | translate }}</ion-title>
  </ion-toolbar>
</ion-header>

<ion-content>
  <ion-list>
    <!-- 开始时间 -->
    <ion-item>
      <ion-icon slot="start" src="/assets/svg/calendar-primary.svg"></ion-icon>
      <ion-label>{{'generic_startTime' | translate}}</ion-label>
      <ion-datetime [(ngModel)]="input.startDate" display-format="YYYY-MM-DD" picker-format="YYYY-MM-DD" doneText="{{'generic_confirm' | translate}}" cancelText="{{'generic_cancel' | translate}}"></ion-datetime>
    </ion-item>
    <!-- 结束时间 -->
    <ion-item>
      <ion-icon slot="start" src="/assets/svg/calendar-primary.svg"></ion-icon>
      <ion-label>{{'generic_endTime' | translate}}</ion-label>
      <ion-datetime [(ngModel)]="input.endDate" display-format="YYYY-MM-DD" picker-format="YYYY-MM-DD" doneText="{{'generic_confirm' | translate}}" cancelText="{{'generic_cancel' | translate}}"></ion-datetime>
    </ion-item>
    <!-- 物料名称 -->
    <ion-item>
      <ion-icon slot="start" src="/assets/svg/material-primary.svg"></ion-icon>
      <ion-label>{{'generic_materName' | translate}}</ion-label>
      <ion-input [(ngModel)]="input.materName" placeholder="{{'generic_placeholder_materName' | translate}}" readonly [routerLink]="['/tabs/func/spc/rubberquamater']" routerLinkActive="router-link-active"></ion-input>
      <ion-icon slot="end" color="primary" name="arrow-redo-outline" [routerLink]="['/tabs/func/spc/rubberquamater']" [queryParams]="{ from: 'spc' }" routerLinkActive="router-link-active" ></ion-icon>
    </ion-item>
    <!-- 检验项目 -->
    <ion-item>
      <ion-icon slot="start" src="/assets/svg/checkItem-primary.svg"></ion-icon>
      <ion-label>{{'generic_inspectionItems' | translate}}</ion-label>
      <ion-select [(ngModel)]="input.itemCode" (ionChange)="handleCheckItemChange($event)" multiple="false" okText="{{'generic_confirm' | translate}}" cancelText="{{'generic_cancel' | translate}}" required>
        <ion-select-option *ngFor="let item of checkItemList" value="{{item.itemCd}}">{{item.itemName}}</ion-select-option>
      </ion-select>
    </ion-item>
    <!-- 生产机台 -->
    <ion-item>
      <ion-icon slot="start" src="/assets/svg/monitor-primary.svg"></ion-icon>
      <ion-label>{{'generic_equip' | translate}}</ion-label>
      <ion-select [(ngModel)]="input.equipCode" (ionChange)="handleEquipChange($event)" multiple="false" okText="{{'generic_confirm' | translate}}" cancelText="{{'generic_cancel' | translate}}" placeholder="{{'generic_placeholder_equip' | translate}}">
        <ion-select-option *ngFor="let equip of equipList" value="{{equip.equipCode}}">{{equip.equipName}}</ion-select-option>
      </ion-select>
    </ion-item>
    <!-- 生产班组 -->
    <ion-item>
      <ion-icon slot="start" src="/assets/svg/classgroup-primary.svg"></ion-icon>
      <ion-label>{{'generic_shiftClass' | translate}}</ion-label>
      <ion-select [(ngModel)]="input.shiftClassId" (ionChange)="handleShiftClassChange($event)" okText="{{'generic_confirm' | translate}}" cancelText="{{'generic_cancel' | translate}}">
        <ion-select-option *ngFor="let shiftClass of shiftClassList" value="{{shiftClass.shiftClassId}}">{{shiftClass.shiftClassName}}</ion-select-option>
      </ion-select>
    </ion-item>
  </ion-list>
  <ion-button expand="full" (click)="doSearch()">{{ 'generic_query' | translate }}</ion-button>
</ion-content>
