修改 导出

dev_ec
hjm 6 years ago
parent 8e6882e8bc
commit 1f13fef45d

@ -290,7 +290,7 @@ let tableData = []
// } // }
}) })
// if (real_value_total >= target_value_total && real_value_total != 0) { // if (real_value_total >= target_value_total && real_value_total != 0) {
nameRowData.status = innerItem.status != "not_achieved" && parseFloat(course.actually_reach) != 0 nameRowData.status = innerItem.status != "not_achieved" && parseFloat(innerItem.actually_reach) != 0
// } // }
maxCouseCount = Math.max(maxCouseCount, innerItem.course_supports.length) maxCouseCount = Math.max(maxCouseCount, innerItem.course_supports.length)
tableData.push(nameRowData) tableData.push(nameRowData)
@ -513,7 +513,9 @@ class GraduatesRequirement extends Component {
let major_school_id =this.props.match.params.major_school_id; let major_school_id =this.props.match.params.major_school_id;
let ec_year_id =this.props.match.params.ec_year_id; let ec_year_id =this.props.match.params.ec_year_id;
var Url = `/ec_major_schools/${major_school_id}/academic_years/${ec_year_id}/set_calculation_value`; var url = `/ec_major_schools/${major_school_id}/academic_years/${ec_year_id}/set_calculation_value`;
url = `/ec_years/${this.state.ec_year_id}/reach_criteria.json`
if (this.state.daChengYuZhi == undefined) { if (this.state.daChengYuZhi == undefined) {
this.props.showSingleButtonModal('提示', '达成阈值不能为空!') this.props.showSingleButtonModal('提示', '达成阈值不能为空!')
return; return;
@ -521,8 +523,8 @@ class GraduatesRequirement extends Component {
this.props.showSingleButtonModal('提示', '达成阈值必须大于0且小于等于1') this.props.showSingleButtonModal('提示', '达成阈值必须大于0且小于等于1')
return; return;
} }
axios.post(Url, { axios.post(url, {
calculation_value : this.state.daChengYuZhi reach_criteria : this.state.daChengYuZhi
}).then((response) => { }).then((response) => {
if( response.data.status === 1 ) { if( response.data.status === 1 ) {
@ -545,23 +547,23 @@ class GraduatesRequirement extends Component {
}) })
this.fetchData(ec_year_id) this.fetchData(ec_year_id)
const Url =`/ec_major_schools/get_navigation_data?ec_year_id=`+ec_year_id; // const Url =`/ec_major_schools/get_navigation_data?ec_year_id=`+ec_year_id;
axios.get(Url, { // axios.get(Url, {
// withCredentials: true, // // withCredentials: true,
}) // })
.then((response) => { // .then((response) => {
if(response.status===200){ // if(response.status===200){
// if(response.data.allow_visit===false){ // // if(response.data.allow_visit===false){
// window.location.href="/403" // // window.location.href="/403"
// } // // }
this.setState({ // this.setState({
schooldata:response.data // schooldata:response.data
}) // })
} // }
}) // })
.catch(function (error) { // .catch(function (error) {
console.log(error); // console.log(error);
}); // });
} }
fetchData(ec_year_id) { fetchData(ec_year_id) {
// const url = `ec_courses/7/get_calculation_data` // const url = `ec_courses/7/get_calculation_data`
@ -581,8 +583,8 @@ class GraduatesRequirement extends Component {
// 先计算再触发render // 先计算再触发render
this.setState({ this.setState({
calculationData: response.data.calculation_data, calculationData: response.data.calculation_data,
daChengYuZhi: response.data.calculation_value, daChengYuZhi: response.data.reach_threshold,
daChengYuZhiSaved: response.data.calculation_value, daChengYuZhiSaved: response.data.reach_threshold,
course_ids: response.data.course_ids, course_ids: response.data.course_ids,
is_manager: response.data.is_manager, is_manager: response.data.is_manager,
calculating: false, calculating: false,
@ -632,7 +634,7 @@ class GraduatesRequirement extends Component {
const { match, history, current_user } = this.props const { match, history, current_user } = this.props
const { daChengYuZhiEditableMode, daChengYuZhi, daChengYuZhiSaved, is_manager } = this.state const { daChengYuZhiEditableMode, daChengYuZhi, daChengYuZhiSaved, is_manager } = this.state
let { schooldata } =this.state; let { schooldata } =this.state;
let { example_major, template_major } = schooldata; // let { example_major, template_major } = schooldata;
let showCalculateButton = is_manager; let showCalculateButton = is_manager;
// let showCalculateButton = false; // let showCalculateButton = false;
// if (example_major && current_user.admin || !example_major && template_major) { // if (example_major && current_user.admin || !example_major && template_major) {
@ -640,7 +642,7 @@ class GraduatesRequirement extends Component {
// } // }
return ( return (
<div className="contentWrap graduatesRequirement"> <div className="educontent graduatesRequirement">
<ul className="clearfix padding20-30 bor-bottom-greyE backgroundFFF" <ul className="clearfix padding20-30 bor-bottom-greyE backgroundFFF"
style={{ 'marginBottom': '0px' }} > style={{ 'marginBottom': '0px' }} >
@ -685,7 +687,7 @@ class GraduatesRequirement extends Component {
<a href="javascript:void(0)" <a href="javascript:void(0)"
class="white-btn edu-orangeback-btn fr mr10" class="white-btn edu-orangeback-btn fr mr10"
href={`/ec_major_schools/${this.props.match.params.major_school_id}/academic_years/${this.props.match.params.ec_year_id}/export_reach_requirements_data.xls`} href={`/api/ec_years/${this.state.ec_year_id}/reach_evaluation.xlsx`}
>导出</a> >导出</a>
{/* /ec_major_schools/3/academic_years/5/export_reach_requirements_data.xls {/* /ec_major_schools/3/academic_years/5/export_reach_requirements_data.xls
let major_school_id =this.props.match.params.major_school_id; let major_school_id =this.props.match.params.major_school_id;

Loading…
Cancel
Save