|
|
|
@ -66,12 +66,12 @@ class Goldsubject extends Component {
|
|
|
|
|
|
|
|
|
|
const { datatime } = this.state;
|
|
|
|
|
var datatimes="";
|
|
|
|
|
if(datatime!==undefined){
|
|
|
|
|
datatimes=datatime;
|
|
|
|
|
datatimes=moment(datatimes, dateFormat).subtract(0, 'days');;
|
|
|
|
|
}else {
|
|
|
|
|
datatimes=datatime;
|
|
|
|
|
}
|
|
|
|
|
// if(datatime!==undefined){
|
|
|
|
|
// datatimes=datatime;
|
|
|
|
|
datatimes=moment(datatime, dateFormat);
|
|
|
|
|
// }else {
|
|
|
|
|
// datatimes=datatime;
|
|
|
|
|
// }
|
|
|
|
|
if (!startValue || !datatimes) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
@ -84,12 +84,12 @@ class Goldsubject extends Component {
|
|
|
|
|
// console.log(moment(new Date(), dateFormat).add(2, 'days'));
|
|
|
|
|
const { datatimetwo } = this.state;
|
|
|
|
|
var startvalue="";
|
|
|
|
|
if(datatimetwo!==undefined){
|
|
|
|
|
startvalue=datatimetwo;
|
|
|
|
|
startvalue=moment(startvalue, dateFormat).add(1, 'days');
|
|
|
|
|
}else {
|
|
|
|
|
startvalue=datatimetwo;
|
|
|
|
|
}
|
|
|
|
|
// if(datatimetwo!==undefined){
|
|
|
|
|
// startvalue=datatimetwo;
|
|
|
|
|
startvalue=moment(datatimetwo, dateFormat);
|
|
|
|
|
// }else {
|
|
|
|
|
// startvalue=datatimetwo;
|
|
|
|
|
// }
|
|
|
|
|
// console.log("结束时间");
|
|
|
|
|
// console.log(endValue);
|
|
|
|
|
// console.log(startvalue);
|
|
|
|
@ -359,9 +359,12 @@ class Goldsubject extends Component {
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
debugger
|
|
|
|
|
|
|
|
|
|
this.props.form.validateFields((err, values) => {
|
|
|
|
|
console.log("错误信息信息信息2");
|
|
|
|
|
console.log(err);
|
|
|
|
|
console.log("xingxixingxi");
|
|
|
|
|
if (err) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -384,7 +387,7 @@ class Goldsubject extends Component {
|
|
|
|
|
// console.log('Received values of form: ', values);
|
|
|
|
|
let subjectid = this.props.match.params.subjectid;
|
|
|
|
|
let url = "/courses.json";
|
|
|
|
|
axios.post(url, {
|
|
|
|
|
var ysldatas={
|
|
|
|
|
subject_id:subjectid, //这是带过来的值
|
|
|
|
|
name: values.classroom,
|
|
|
|
|
class_period: values.period,
|
|
|
|
@ -394,7 +397,12 @@ class Goldsubject extends Component {
|
|
|
|
|
is_public: is_public, //这是也是带过来的值
|
|
|
|
|
course_module_types: values.checkboxgroup,
|
|
|
|
|
school:values.school
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
console.log("提交的ysldatas数据");
|
|
|
|
|
console.log(ysldatas);
|
|
|
|
|
console.log(JSON.stringify(ysldatas));
|
|
|
|
|
axios.post(url,
|
|
|
|
|
ysldatas
|
|
|
|
|
).then((response) => {
|
|
|
|
|
if (response.status === 200) {
|
|
|
|
|
// this.goback
|
|
|
|
|