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-material-transfer-table',
  templateUrl: './material-transfer-table.component.html',
  styleUrls: ['./material-transfer-table.component.scss']
})
export class MaterialTransferTableComponent extends FlexTableComponent implements OnInit {


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

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

  constructor() { 
    super();
  }

  ngOnInit() {
  }

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