import { Component, OnInit, TemplateRef } from '@angular/core';
import { FlexTableComponent } from '../../../../../shared/common/FlexTable.component';
import { AppComponent } from '../../../../..';
import { FrameRequest } from '../../../../../shared/frame/frame-request';

@Component({
  selector: 'app-by-turn-in-search',
  templateUrl: './by-turn-in-search.component.html',
  styleUrls: ['./by-turn-in-search.component.scss']
})
export class ByTurnInSearchComponent extends FlexTableComponent implements OnInit {

  public query = {
    query: "",
    time: "",
    prov_code: "",
    status:""
  };
  QUERY_URL = "by/byTurnInApply/search.htm";
  TIME_URL = "by/byTurnTimeConfig/list.htm?turn_type=3";
  TO_AUDIT_URL = "by/byTurnInApply/toAudit.htm";
  scoreList = []; //转考的课程信息
  apply: any; //转考信息

  constructor() {
    super();
   }

  ngOnInit() {
  }

  //转考审批界面
  showDetail(template: TemplateRef<any>, editShowType,item) {
    if (!this.loadData(item)) return;
    this.editShowType = editShowType;
  }
  
    loadData(item) {
     
      FrameRequest.requestMap(this.TO_AUDIT_URL, { id: item.id }, (map) => {
        this.scoreList = map['scoreList'];
        this.apply= map['apply'];
      });
      return true;
    }
}
