<ngx-loading [show]="loading" [config]="{fullScreenBackdrop: true}"></ngx-loading>
<!-- <div class="app flex-row align-items-center"> -->
<div class="container ">
  <div class="row">
  <div class="content-block">
    <form #createReasonForm="ngForm">
      <h2 class="title">新增原因資料</h2>

    <div class="form-group">
      <label for="eventTypeId">事件類型ID</label>
      <span *ngIf="eventTypeId.invalid && (eventTypeId.dirty || eventTypeId.touched)">
        <span class="invalidMessage" *ngIf="eventTypeId?.errors.required">*請選擇事件類型ID</span>
      </span>
      <select class="form-control" id="eventTypeId" name="eventTypeId" [(ngModel)]="reasonData.EventTypeId" #eventTypeId="ngModel" required>
        <option value="">請選擇事件類型ID</option>
        <option *ngFor="let eventTypeId of selectEventTypeId" [value]="eventTypeId.Id">{{eventTypeId.EventName}}</option>
      </select>
    </div>

    <!-- <div class="form-group">
      <label for="notPunishType">不開單類型</label>
      <span *ngIf="notPunishType.invalid && (notPunishType.dirty || notPunishType.touched)">
        <span class="invalidMessage" *ngIf="notPunishType?.errors.required">*此欄必填</span>
      </span>
      <input type="text" class="form-control" id="notPunishType" name="notPunishType" #notPunishType="ngModel" [(ngModel)]="reasonData.NotPunishType"
        required placeholder="不開單類型">
    </div> -->

    <div class="form-group">
      <label for="notPunishReason">不開單原因</label>
      <span *ngIf="notPunishReason.invalid && (notPunishReason.dirty || notPunishReason.touched)">
        <span class="invalidMessage" *ngIf="notPunishReason?.errors.required">*此欄必填</span>
      </span>
      <input type="text" class="form-control" id="notPunishReason" name="notPunishReason" #notPunishReason="ngModel" [(ngModel)]="reasonData.NotPunishReason"
        required placeholder="不開單原因">
    </div>
    <div class="btn-footer">
      <button type="submit" class="btn btn-footer btn-danger" (click)="backPreviousPage()">
        <i class=" fa fa-chevron-left" aria-hidden="true "></i> 回上一頁
      </button>
      <button type="submit" class="btn btn-footer btn-success" [disabled]="!createReasonForm.form.valid"
        (click)="createReasonData()">
        送出
        <i class=" fa fa-chevron-right" aria-hidden="true "></i>
      </button>
    </div>
  </form>
  </div>
  </div>
</div>
