立即发布弹窗调整

courseware
杨树明 5 years ago
parent 97cfd17d11
commit a3c46ee41a

@ -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"))

@ -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}
/> : ""}
<Modals

Loading…
Cancel
Save