diff --git a/public/react/src/modules/courses/signin/model/Createsignmodel.js b/public/react/src/modules/courses/signin/model/Createsignmodel.js
index 99f616204..111e029c4 100644
--- a/public/react/src/modules/courses/signin/model/Createsignmodel.js
+++ b/public/react/src/modules/courses/signin/model/Createsignmodel.js
@@ -36,7 +36,8 @@ const CollectionCreateForm = Form.create({ name: 'form_in_modal' })(
start_time:"",
end_time:"",
attendance_date:"",
- newmode:null
+ newmode:null,
+ groupstype:false
}
}
@@ -54,7 +55,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 +65,26 @@ 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,
+ groupstype:newlist.length===0?true:false
})
@@ -85,6 +98,8 @@ 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,
+ groupstype:false
})
this.props.form.setFieldsValue({
@@ -92,15 +107,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
- })
- })
}
@@ -226,7 +241,7 @@ const CollectionCreateForm = Form.create({ name: 'form_in_modal' })(
}
render() {
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 { Option } = Select;
const formItemLayout = {
@@ -268,13 +283,13 @@ const CollectionCreateForm = Form.create({ name: 'form_in_modal' })(
{getFieldDecorator('group_ids')(
-