调整立即发布

courseware
杨树明 5 years ago
parent 038b967950
commit 68fff07ae1

@ -35,7 +35,10 @@ class OneSelfOrderModal extends Component{
group_ids:[], group_ids:[],
endtime:"", endtime:"",
course_groups:undefined, course_groups:undefined,
Checkboxtype:true Checkboxtype:true,
endtimetypevalue:undefined,
endtimetypeid:undefined,
endtimetypename:undefined
} }
} }
componentDidMount() { componentDidMount() {
@ -203,6 +206,9 @@ class OneSelfOrderModal extends Component{
propsSaves=(ds,endtime)=>{ propsSaves=(ds,endtime)=>{
debugger debugger
this.setState({
endtimetype:false
})
let {course_groups}=this.state; let {course_groups}=this.state;
if(this.props.typs=="end"){ if(this.props.typs=="end"){
@ -241,6 +247,7 @@ class OneSelfOrderModal extends Component{
this.setState({ this.setState({
endtimetype:true, endtimetype:true,
endtimetypeid:items.id, endtimetypeid:items.id,
endtimetypename:items.name,
endtimetypevalue:"截止时间不能为空" endtimetypevalue:"截止时间不能为空"
}) })
return return
@ -248,12 +255,29 @@ class OneSelfOrderModal extends Component{
// arr.push(moment(moment(handleDateString(this.props.staytime)).add(1, 'week')).format("YYYY-MM-DD HH:mm")) // arr.push(moment(moment(handleDateString(this.props.staytime)).add(1, 'week')).format("YYYY-MM-DD HH:mm"))
}else{ }else{
if(moment(items.end_time,"YYYY-MM-DD HH:mm") <= moment(this.props.starttime,"YYYY-MM-DD HH:mm")){ if(moment(items.end_time,"YYYY-MM-DD HH:mm") <= moment(this.props.starttime,"YYYY-MM-DD HH:mm")){
type=true
this.setState({ this.setState({
endtimetype:true, endtimetype:true,
endtimetypevalue:"必须晚于当前时间" endtimetypeid:items.id,
endtimetypename:items.name,
endtimetypevalue:"截止时间必须晚于当前时间"
}) })
return return
} }
if(this.props.modallate_time){
if(moment(items.end_time,"YYYY-MM-DD HH:mm") >= moment(this.props.modallate_time,"YYYY-MM-DD HH:mm")){
type=true
this.setState({
endtimetype:true,
endtimetypeid:items.id,
endtimetypename:items.name,
endtimetypevalue:"截止时间必须晚于补交结束时间"
})
return
}
}
arr.push(handleDateString(items.end_time)) arr.push(handleDateString(items.end_time))
} }
} }
@ -459,7 +483,7 @@ class OneSelfOrderModal extends Component{
</ul> </ul>
} }
{this.state.endtimetype===true&&course_groupstype===true?<div className={"color-red"} style={{'text-align': 'center'}}>{this.state.endtimetypevalue}</div>:""} {this.state.endtimetype===true&&course_groupstype===true?<div className={"color-red"} style={{'text-align': 'center'}}>{this.state.endtimetypevalue}</div>:""}
{this.state.endtimetypeid!=undefined&&this.state.endtimetype===true?<div className={"color-red fl ml10 mb20"}>{this.state.endtimetypevalue}</div>:""} {this.state.endtimetypeid!=undefined&&this.state.endtimetype===true?<div className={"color-red fl ml10 mb20"}>{this.state.endtimetypename}{this.state.endtimetypevalue}</div>:""}
{course_groupstype===true?<div className={this.state.endtimetype===true&&course_groupstype===true?"clearfix mt10 edu-txt-center mb10":"clearfix mt20 edu-txt-center mb10"}> {course_groupstype===true?<div className={this.state.endtimetype===true&&course_groupstype===true?"clearfix mt10 edu-txt-center mb10":"clearfix mt20 edu-txt-center mb10"}>
<a className="task-btn color-white mr30" onClick={this.props.Cancel}>{this.props.Cancelname}</a> <a className="task-btn color-white mr30" onClick={this.props.Cancel}>{this.props.Cancelname}</a>
<a className="task-btn task-btn-orange" onClick={()=>this.propsSaves(group_ids,this.state.endtime)}>{this.props.Savesname}</a> <a className="task-btn task-btn-orange" onClick={()=>this.propsSaves(group_ids,this.state.endtime)}>{this.props.Savesname}</a>

@ -135,7 +135,8 @@ class Trainingjobsetting extends Component {
borredszfls:'', borredszfls:'',
total_scoretwo:0, total_scoretwo:0,
total_score:0, total_score:0,
immediatelyopen:false immediatelyopen:false,
modallate_time:undefined
} }
// console.log("获取到的值") // console.log("获取到的值")
// console.log("Trainingjobsetting") // console.log("Trainingjobsetting")
@ -1758,8 +1759,9 @@ class Trainingjobsetting extends Component {
Savesname: "立即发布", Savesname: "立即发布",
Cancel: this.homeworkhide, Cancel: this.homeworkhide,
Saves: this.homeworkstartend, Saves: this.homeworkstartend,
course_groups: response.data.course_groups, course_groups:response.data.course_groups,
immediatelyopen:true immediatelyopen:true,
modallate_time:response.data.late_time,
}) })
} }
}).catch((error) => { }).catch((error) => {
@ -1917,7 +1919,8 @@ class Trainingjobsetting extends Component {
typs: undefined, typs: undefined,
starttimes: undefined, starttimes: undefined,
starttimesend: undefined, starttimesend: undefined,
immediatelyopen:false immediatelyopen:false,
modallate_time:undefined,
}) })
} }
cancelBox = () => { cancelBox = () => {
@ -2406,6 +2409,7 @@ class Trainingjobsetting extends Component {
starttimesend={this.state.starttimesend} starttimesend={this.state.starttimesend}
typs={this.state.typs} typs={this.state.typs}
immediatelyopen={this.state.immediatelyopen} immediatelyopen={this.state.immediatelyopen}
modallate_time={this.state.modallate_time}
/> : ""} /> : ""}
<Modals <Modals

Loading…
Cancel
Save