import { Component, OnInit } from '@angular/core';
import {FormBuilder, Validators} from '@angular/forms';
import {BsModalRef} from "ngx-bootstrap/modal";
import { FrameDetailComponent } from '../../../../frame/core/detail/frame.detail';

@Component({
  selector: 'app-std-material-refuse',
  templateUrl: './std-material-refuse.component.html',
  styleUrls: ['./std-material-refuse.component.scss']
})
export class StdMaterialRefuseComponent  extends FrameDetailComponent implements OnInit {

  constructor(bsModalRef: BsModalRef, fb: FormBuilder) {
    super(bsModalRef);
    this.detailForm = fb.group({
      'material_id': [null],
      'msg_flag': [null],
      'v_refuse_msg': [null],
      'refuse_msg': [null, Validators.compose([Validators.required, Validators.minLength(2), Validators.maxLength(64)])],
    });
  }

  ngOnInit() {
  }

  initDefautEntity() {
    super.initDefautEntity();
    this.currentEntity['msg_flag'] = 'Active';
  }
  changeRefuseMsg() {
    this.currentEntity.refuse_msg = this.currentEntity.v_refuse_msg;
  }



}


