import { Component, OnInit } from '@angular/core';
import { FormBuilder } from '@angular/forms';
import { DomSanitizer } from '@angular/platform-browser';
import { BsModalRef } from 'ngx-bootstrap/modal';
import { AjaxService } from '../../../../../core/service/ajax.service';
import { MsgService } from '../../../../../core/service/msg.service';
import { FrameDetailComponent } from '../../../../frame/core/detail/frame.detail';

@Component({
  selector: 'app-exam-video-cancel',
  templateUrl: './exam-video-cancel.component.html',
  styleUrls: ['./exam-video-cancel.component.scss']
})
export class ExamVideoCancelComponent extends FrameDetailComponent  implements OnInit {

  exam_date:any;
  constructor(bsModalRef: BsModalRef, fb: FormBuilder, sanitizer: DomSanitizer) {
    super(bsModalRef, sanitizer);
   }

  ngOnInit() {
  }

  cancelTask() {
    if (this.exam_date === undefined) {
      MsgService.errorToastr('请输入视频评分日期！');
      return;
    }
    MsgService.confirmAlert('取消会删除已经建立的考场，确定要取消任务分发吗？', () => {
      AjaxService.request('exam/video/dist/cancel.htm', 
      {agent_id: this.ResponseEntity, exam_date: this.exam_date}, () => {
        MsgService.successToastr('取消任务成功！');
        this.closeWindow();
      });
    });
  }

}
