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';
import { AjaxService } from '../../../../core/service/ajax.service';
import { FuncService } from '../../../../core/service/func.service';
import { MsgService } from '../../../../core/service/msg.service';


@Component({
  selector: 'app-cf-initial-review-reject',
  templateUrl: './initial-review-reject.component.html',
  styleUrls: ['./initial-review-reject.component.scss']
})
export class InitialReviewRejectComponent extends FrameDetailComponent implements OnInit {
  initial_remark = "";
  currReviewMsg = "";//常用审核
  reviewMsgArray = [];

  constructor(bsModalRef: BsModalRef, fb: FormBuilder) {
    super(bsModalRef);
  }

  ngOnInit() {
    debugger;
    /*AjaxService.requestArray("cf/material/def/msg/list.htm", {material_def_id: this.ResponseEntity.material_def_id}, (array)=>{
      debugger;
      this.reviewMsgArray = array;
    });*/
    this.initial_remark = "资格审核暂未通过。请考生至材料上传页面查看具体原因，并将修改后的材料于2024年1月2日15点至1月5日12点期间重交至平台。截止2024年1月5日12点，未修改重交材料或材料经重审仍未通过的考生，无法进入学术审核。";
  }

  fileLoadCompeleted() {
    debugger;
  }

  onError() {
    debugger;
  }


  //明细退回
  doRejectMain() {
    let _this = this;
    debugger;
    if (!this.initial_remark || this.initial_remark.trim().length == 0) {
      MsgService.errorAlert("请输入退回原因");
      return;
    }
    let param = {apply_id: [this.ResponseEntity.main_id], initial_remark: this.initial_remark};
    MsgService.showLoading();
    AjaxService.request('review/initial/main/reject.htm', param, (entity) => {
      MsgService.hideLoading();
      debugger;
      MsgService.successToastr("已退回!");
      _this.closeWindow();
    });
  }
}
