|
|
@ -36,7 +36,8 @@ const CollectionCreateForm = Form.create({ name: 'form_in_modal' })(
|
|
|
|
start_time:"",
|
|
|
|
start_time:"",
|
|
|
|
end_time:"",
|
|
|
|
end_time:"",
|
|
|
|
attendance_date:"",
|
|
|
|
attendance_date:"",
|
|
|
|
newmode:null
|
|
|
|
newmode:null,
|
|
|
|
|
|
|
|
groupstype:false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -54,7 +55,8 @@ const CollectionCreateForm = Form.create({ name: 'form_in_modal' })(
|
|
|
|
end_time: date
|
|
|
|
end_time: date
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
componentDidMount() {
|
|
|
|
getgroup_idss=(course_groups)=>{
|
|
|
|
|
|
|
|
let newcourse_groups=course_groups;
|
|
|
|
if(this.props.type==="edit"){
|
|
|
|
if(this.props.type==="edit"){
|
|
|
|
let newlist=[]
|
|
|
|
let newlist=[]
|
|
|
|
if(this.props.attendancesdata.groups.length>0){
|
|
|
|
if(this.props.attendancesdata.groups.length>0){
|
|
|
@ -63,15 +65,26 @@ const CollectionCreateForm = Form.create({ name: 'form_in_modal' })(
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
console.log(this.props.attendancesdata.start_time)
|
|
|
|
newlist.map((item,key)=>{
|
|
|
|
// console.log()
|
|
|
|
newcourse_groups.map((i,k)=>{
|
|
|
|
|
|
|
|
if(i.id===item){
|
|
|
|
|
|
|
|
i.disabled=true
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// console.log(newlist)
|
|
|
|
|
|
|
|
// this.setState({
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
attendance_date: this.props.attendancesdata.attendance_date,
|
|
|
|
attendance_date: this.props.attendancesdata.attendance_date,
|
|
|
|
start_time:new Date(this.props.attendancesdata.start_time),
|
|
|
|
start_time:new Date(this.props.attendancesdata.start_time),
|
|
|
|
end_time:new Date(this.props.attendancesdata.end_time),
|
|
|
|
end_time:new Date(this.props.attendancesdata.end_time),
|
|
|
|
newmode:this.props.attendancesdata.mode,
|
|
|
|
newmode:this.props.attendancesdata.mode,
|
|
|
|
|
|
|
|
course_groups:newcourse_groups,
|
|
|
|
|
|
|
|
groupstype:newlist.length===0?true:false
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -85,6 +98,8 @@ const CollectionCreateForm = Form.create({ name: 'form_in_modal' })(
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
start_time: new Date("2000-01-01T09:00:00.000+08:00"),
|
|
|
|
start_time: new Date("2000-01-01T09:00:00.000+08:00"),
|
|
|
|
|
|
|
|
course_groups:newcourse_groups,
|
|
|
|
|
|
|
|
groupstype:false
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
this.props.form.setFieldsValue({
|
|
|
|
this.props.form.setFieldsValue({
|
|
|
@ -92,15 +107,15 @@ const CollectionCreateForm = Form.create({ name: 'form_in_modal' })(
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
componentDidMount() {
|
|
|
|
const coursesId=this.props.match.params.coursesId;
|
|
|
|
const coursesId=this.props.match.params.coursesId;
|
|
|
|
let newurl=`/courses/${coursesId}/all_course_groups.json`;
|
|
|
|
let newurl=`/courses/${coursesId}/all_course_groups.json`;
|
|
|
|
axios.get(newurl).then((response) => {
|
|
|
|
axios.get(newurl).then((response) => {
|
|
|
|
|
|
|
|
this.getgroup_idss(response.data.course_groups)
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
course_groups:response.data.course_groups
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -226,7 +241,7 @@ const CollectionCreateForm = Form.create({ name: 'form_in_modal' })(
|
|
|
|
}
|
|
|
|
}
|
|
|
|
render() {
|
|
|
|
render() {
|
|
|
|
const { visible,form ,setRadio,Radiolist,hideCreatesign,editvisible} = this.props;
|
|
|
|
const { visible,form ,setRadio,Radiolist,hideCreatesign,editvisible} = this.props;
|
|
|
|
let {course_groups,newmode}=this.state;
|
|
|
|
let {course_groups,newmode,groupstype}=this.state;
|
|
|
|
const { getFieldDecorator } = form;
|
|
|
|
const { getFieldDecorator } = form;
|
|
|
|
const { Option } = Select;
|
|
|
|
const { Option } = Select;
|
|
|
|
const formItemLayout = {
|
|
|
|
const formItemLayout = {
|
|
|
@ -268,13 +283,13 @@ const CollectionCreateForm = Form.create({ name: 'form_in_modal' })(
|
|
|
|
|
|
|
|
|
|
|
|
<Form.Item label="签到班级:">
|
|
|
|
<Form.Item label="签到班级:">
|
|
|
|
{getFieldDecorator('group_ids')(
|
|
|
|
{getFieldDecorator('group_ids')(
|
|
|
|
<Select mode="multiple" placeholder={course_groups.length>0?"不选择分班时默认选择全部学生":'暂无分班,将默认选择课堂全部学生'} getPopupContainer={trigger => trigger.parentNode}
|
|
|
|
<Select mode="multiple" placeholder={this.props&&this.props.type==="edit"&&this.state.groupstype===true?"已选择全部分班":course_groups.length>0?"不选择分班时默认选择全部学生":'暂无分班,将默认选择课堂全部学生'} getPopupContainer={trigger => trigger.parentNode}
|
|
|
|
disabled={this.props&&this.props.type==="edit"?true:false}
|
|
|
|
disabled={this.props&&this.props.type==="edit"&&this.state.groupstype===true?true:false}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
|
|
|
|
|
|
|
|
{course_groups.map((item,key)=>{
|
|
|
|
{course_groups.map((item,key)=>{
|
|
|
|
return(
|
|
|
|
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>
|
|
|
|
)
|
|
|
|
)
|
|
|
|
})}
|
|
|
|
})}
|
|
|
|
|
|
|
|
|
|
|
|