|
|
|
@ -54,7 +54,8 @@ const CollectionCreateForm = Form.create({ name: 'form_in_modal' })(
|
|
|
|
|
end_time: date
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
componentDidMount() {
|
|
|
|
|
getgroup_idss=(course_groups)=>{
|
|
|
|
|
let newcourse_groups=course_groups;
|
|
|
|
|
if(this.props.type==="edit"){
|
|
|
|
|
let newlist=[]
|
|
|
|
|
if(this.props.attendancesdata.groups.length>0){
|
|
|
|
@ -63,15 +64,25 @@ const CollectionCreateForm = Form.create({ name: 'form_in_modal' })(
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
console.log(this.props.attendancesdata.start_time)
|
|
|
|
|
// console.log()
|
|
|
|
|
newlist.map((item,key)=>{
|
|
|
|
|
newcourse_groups.map((i,k)=>{
|
|
|
|
|
if(i.id===item){
|
|
|
|
|
i.disabled=true
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
console.log(newlist)
|
|
|
|
|
// this.setState({
|
|
|
|
|
//
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
attendance_date: this.props.attendancesdata.attendance_date,
|
|
|
|
|
start_time:new Date(this.props.attendancesdata.start_time),
|
|
|
|
|
end_time:new Date(this.props.attendancesdata.end_time),
|
|
|
|
|
newmode:this.props.attendancesdata.mode,
|
|
|
|
|
course_groups:newcourse_groups
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -85,6 +96,7 @@ const CollectionCreateForm = Form.create({ name: 'form_in_modal' })(
|
|
|
|
|
}else{
|
|
|
|
|
this.setState({
|
|
|
|
|
start_time: new Date("2000-01-01T09:00:00.000+08:00"),
|
|
|
|
|
course_groups:newcourse_groups
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
this.props.form.setFieldsValue({
|
|
|
|
@ -92,15 +104,15 @@ const CollectionCreateForm = Form.create({ name: 'form_in_modal' })(
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
componentDidMount() {
|
|
|
|
|
const coursesId=this.props.match.params.coursesId;
|
|
|
|
|
let newurl=`/courses/${coursesId}/all_course_groups.json`;
|
|
|
|
|
axios.get(newurl).then((response) => {
|
|
|
|
|
this.getgroup_idss(response.data.course_groups)
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
course_groups:response.data.course_groups
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -269,12 +281,12 @@ const CollectionCreateForm = Form.create({ name: 'form_in_modal' })(
|
|
|
|
|
<Form.Item label="签到班级:">
|
|
|
|
|
{getFieldDecorator('group_ids')(
|
|
|
|
|
<Select mode="multiple" placeholder={course_groups.length>0?"不选择分班时默认选择全部学生":'暂无分班,将默认选择课堂全部学生'} getPopupContainer={trigger => trigger.parentNode}
|
|
|
|
|
disabled={this.props&&this.props.type==="edit"?true:false}
|
|
|
|
|
// disabled={this.props&&this.props.type==="edit"?true:false}
|
|
|
|
|
>
|
|
|
|
|
|
|
|
|
|
{course_groups.map((item,key)=>{
|
|
|
|
|
return(
|
|
|
|
|
<Option value={item.id} key={key}>{item.name}</Option>
|
|
|
|
|
<Option value={item.id} key={key} disabled={item.disabled?item.disabled:false}>{item.name}</Option>
|
|
|
|
|
)
|
|
|
|
|
})}
|
|
|
|
|
|
|
|
|
|