From a3c46ee41ac79619d0a07231a540b78e33099f81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 16 Mar 2020 15:14:39 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AB=8B=E5=8D=B3=E5=8F=91=E5=B8=83=E5=BC=B9?= =?UTF-8?q?=E7=AA=97=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../coursesPublic/OneSelfOrderModal.js | 33 ++++++++++--------- .../shixunHomework/Trainingjobsetting.js | 5 +++ 2 files changed, 23 insertions(+), 15 deletions(-) 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} /> : ""}