<div class="container">
  <div class="row">
    <div class="content-block">
      <h2 class="title">修改廠商資料</h2>
      <form #editcompanyInformationData="ngForm">
        <div class="form-group">
          <label for="companyCode">廠商代碼</label>
          <span *ngIf="companyCode.invalid && (companyCode.dirty || companyCode.touched)">
            <span class="invalidMessage" *ngIf="companyCode?.errors.required">*此欄必填</span>
          </span>
          <input type="text" class="form-control" id="companyCode" name="companyCode" #companyCode="ngModel" [(ngModel)]="selectedItem.companyCode"
            required placeholder="廠商代碼">
        </div>
    <div class="form-group">
      <label for="companyName">廠商名稱</label>
      <span *ngIf="companyName.invalid && (companyName.dirty || companyName.touched)">
        <span class="invalidMessage" *ngIf="companyName?.errors.required">*此欄必填</span>
      </span>
      <input type="text" class="form-control" id="companyName" name="companyName" #companyName="ngModel" [(ngModel)]="selectedItem.companyName"
        required placeholder="廠商名稱">
    </div>
    <div class="form-group">
      <label for="companyEmail">廠商Email</label>
      <span *ngIf="companyEmail.invalid && (companyEmail.dirty || companyEmail.touched)">
        <span class="invalidMessage" *ngIf="companyEmail?.errors.required">*此欄必填</span>
        <span class="invalidMessage" *ngIf="companyEmail?.errors.pattern">*請輸入正確信箱格式</span>
      </span>
      <input type="text" class="form-control" id="companyEmail" name="companyEmail" #companyEmail="ngModel" [(ngModel)]="selectedItem.email"
        required placeholder="廠商Email" pattern="[^ @]*@[^ @]*">
    </div>
        <div class="btn-footer">
          <button type="submit" class="btn btn-danger" (click)="backPreviousPage()">
            <i class="fa fa-chevron-left" aria-hidden="true"></i> 回上一頁
          </button>
          <button type="button" class="btn btn-success" [disabled]="!editcompanyInformationData.form.valid" (click)="doEditcompanyInformation()">
            送出
            <i class="fa fa-chevron-right" aria-hidden="true"></i>
          </button>
        </div>
      </form>
    </div>
  </div>
</div>
