diff --git a/public/react/src/modules/courses/coursesPublic/OneSelfOrderModal.js b/public/react/src/modules/courses/coursesPublic/OneSelfOrderModal.js index 1f7fec57a..fb915164c 100644 --- a/public/react/src/modules/courses/coursesPublic/OneSelfOrderModal.js +++ b/public/react/src/modules/courses/coursesPublic/OneSelfOrderModal.js @@ -202,29 +202,32 @@ class OneSelfOrderModal extends Component{ } propsSaves=(ds,endtime)=>{ + debugger let {course_groups}=this.state; if(this.props.typs=="end"){ this.props.Saves() }else{ - - if(this.props.typs!="end"){ - if(!endtime){ - this.setState({ - endtimetype:true, - endtimetypevalue:"截止时间不能为空" - }) - return - } - if(moment(endtime,"YYYY-MM-DD HH:mm") <= moment(this.props.starttime,"YYYY-MM-DD HH:mm")){ - this.setState({ - endtimetype:true, - endtimetypevalue:"必须晚于当前时间" - }) - return + if(!this.props.immediatelyopen){ + if(this.props.typs!="end"){ + if(!endtime){ + this.setState({ + endtimetype:true, + endtimetypevalue:"截止时间不能为空" + }) + return + } + if(moment(endtime,"YYYY-MM-DD HH:mm") <= moment(this.props.starttime,"YYYY-MM-DD HH:mm")){ + this.setState({ + endtimetype:true, + endtimetypevalue:"必须晚于当前时间" + }) + return + } } } + let type=false if(course_groups===undefined||course_groups.length===0){ this.props.Saves(ds,moment(handleDateString(endtime),"YYYY-MM-DD HH:mm").format("YYYY-MM-DD HH:mm")) diff --git a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js index a6cefb466..427354bae 100644 --- a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js +++ b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js @@ -135,6 +135,7 @@ class Trainingjobsetting extends Component { borredszfls:'', total_scoretwo:0, total_score:0, + immediatelyopen:false } // console.log("获取到的值") // console.log("Trainingjobsetting") @@ -1758,6 +1759,7 @@ class Trainingjobsetting extends Component { Cancel: this.homeworkhide, Saves: this.homeworkstartend, course_groups: response.data.course_groups, + immediatelyopen:true }) } }).catch((error) => { @@ -1799,6 +1801,7 @@ class Trainingjobsetting extends Component { } // 立即发布 homeworkstartend = (ds, endtime) => { + debugger var homeworkid = this.props.match.params.homeworkid; let data = {} @@ -1914,6 +1917,7 @@ class Trainingjobsetting extends Component { typs: undefined, starttimes: undefined, starttimesend: undefined, + immediatelyopen:false }) } cancelBox = () => { @@ -2401,6 +2405,7 @@ class Trainingjobsetting extends Component { starttimes={this.state.starttimes} starttimesend={this.state.starttimesend} typs={this.state.typs} + immediatelyopen={this.state.immediatelyopen} /> : ""}