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

@Component({
  selector: 'app-audit-transfer-table',
  templateUrl: './audit-transfer-table.component.html',
  styleUrls: ['./audit-transfer-table.component.scss']
})
export class AuditTransferTableComponent extends FlexTableComponent implements OnInit {


  query = {
    query: "",
    org_id: "",
    exam_time_id: "",
    major_level: "",
    school_id: "",
    std_source:""
  }

  QUERY_URL = "by/byApply/pageAuditTransferTable.htm";
  CITY_URL = "by/byApply/listUnit.htm?exam_time_id="+this.query.exam_time_id;
  EXPORT_URL = "by/byApply/exportAuditTransferTable.htm";
  SCHOOL_URL = "cf/cfOrganization/list.htm?org_type=1&status=1";

  constructor() { 
    super();
  }

  ngOnInit() {
    this.query.std_source = "1";
  }

  resetdata(){
    //this.query.exam_time_id = "";
    this.query.major_level = "";
    this.query.org_id = "";
    this.query.query = "";
    this.query.std_source = "1";
    this.query.school_id = "";
    
  }

   //导出毕业生材料交接表
   export() {
    AppComponent.GobalComponent.setLoading(true);
    let params = {
      exam_time_id: this.query.exam_time_id,
      major_level: this.query.major_level,
      org_id: this.query.org_id,
      query: this.query.query,
      std_source: this.query.std_source,
      school_id: this.query.school_id
    }
    FrameRequest.download(this.EXPORT_URL, params, () => {
      AppComponent.GobalComponent.setLoading(false);
      AppComponent.GobalComponent.successMsg("毕业审核统计表导出成功");
    });
  }
}
