Commit 9a8d97c1 authored by sujie@126.com's avatar sujie@126.com

dd

parent a8c70bf1
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
"react/sort-comp": 0, "react/sort-comp": 0,
"jsx-a11y/no-noninteractive-element-interactions": 0, "jsx-a11y/no-noninteractive-element-interactions": 0,
"react/no-danger": "off", "react/no-danger": "off",
"no-underscore-dangle": 0 "no-underscore-dangle": 0,
"react/no-did-mount-set-state": 0
} }
} }
\ No newline at end of file
...@@ -399,7 +399,7 @@ class CallStudents extends React.Component { ...@@ -399,7 +399,7 @@ class CallStudents extends React.Component {
<div> <div>
<Modal <Modal
visible={callStudentsShow} visible={callStudentsShow}
title="一键排课" title="班级点名"
okText="确定" okText="确定"
onCancel={this.hideCallStudents} onCancel={this.hideCallStudents}
onOk={this.studentCallPost} onOk={this.studentCallPost}
......
...@@ -246,7 +246,7 @@ export default { ...@@ -246,7 +246,7 @@ export default {
keyword: '', keyword: '',
course_id: '', course_id: '',
class_id: '', class_id: '',
student_status: 1, student_status: '',
age_start: 0, age_start: 0,
age_end: 0, age_end: 0,
birthday_month: 0, birthday_month: 0,
...@@ -533,6 +533,7 @@ export default { ...@@ -533,6 +533,7 @@ export default {
student_id: selectdeStudent.id, student_id: selectdeStudent.id,
course_id: values.course_id, course_id: values.course_id,
expend: values.expend, expend: values.expend,
mode_type: values.course_mode || 1,
}); });
yield put({ yield put({
type: 'updateState', type: 'updateState',
......
...@@ -407,7 +407,7 @@ export default { ...@@ -407,7 +407,7 @@ export default {
const studentsLogsData = yield call(studentsAjax.studentsLog, { const studentsLogsData = yield call(studentsAjax.studentsLog, {
student_id: studentId, student_id: studentId,
page: 1, page: 1,
perPage: 10, perPage: 1999,
// class_id: payload.class_id, // class_id: payload.class_id,
}); });
setTimeout(loadmessage); setTimeout(loadmessage);
......
...@@ -9,12 +9,20 @@ const { TextArea } = Input; ...@@ -9,12 +9,20 @@ const { TextArea } = Input;
class EditClassModal extends React.Component { class EditClassModal extends React.Component {
state = { state = {
classRoomId: '', classRoomId: '',
title: '',
}; };
componentWillMount() {
}
componentDidMount() { // 挂载 componentDidMount() { // 挂载
pageIn('班级管理'); pageIn('班级管理');
// 初始化地图函数 自定义函数名init // 初始化地图函数 自定义函数名init
// 定义map变量 调用 qq.maps.Map() 构造函数 获取地图显示容器 // 定义map变量 调用 qq.maps.Map() 构造函数 获取地图显示容器
this.setState({
title: this.props.editClassInfo.title,
});
} }
componentWillUnmount() { // 卸载 componentWillUnmount() { // 卸载
} }
...@@ -36,6 +44,11 @@ class EditClassModal extends React.Component { ...@@ -36,6 +44,11 @@ class EditClassModal extends React.Component {
classRoomId: e, classRoomId: e,
}); });
} }
titleChange = (e) => {
this.setState({
title: e.target.value,
});
}
render() { render() {
const { const {
visible, visible,
...@@ -49,7 +62,7 @@ class EditClassModal extends React.Component { ...@@ -49,7 +62,7 @@ class EditClassModal extends React.Component {
isEdit, isEdit,
form, form,
} = this.props; } = this.props;
const { classRoomId } = this.state; const { classRoomId, title } = this.state;
let classRoom; let classRoom;
let class_room_id; let class_room_id;
if (isEdit == 1) { if (isEdit == 1) {
...@@ -57,6 +70,9 @@ class EditClassModal extends React.Component { ...@@ -57,6 +70,9 @@ class EditClassModal extends React.Component {
class_room_id = classRoom ? editClassInfo.class_room_id : ''; class_room_id = classRoom ? editClassInfo.class_room_id : '';
} }
const { getFieldDecorator } = this.props.form; const { getFieldDecorator } = this.props.form;
const selectBefore = (
<div>{title.length || 0}/20</div>
);
return ( return (
<Modal <Modal
visible={visible} visible={visible}
...@@ -68,7 +84,7 @@ class EditClassModal extends React.Component { ...@@ -68,7 +84,7 @@ class EditClassModal extends React.Component {
confirmLoading={classSubmitting} confirmLoading={classSubmitting}
zIndex={110} zIndex={110}
> >
<Form className="modalform" hideRequiredMark={() => (true)}> <Form className="modalform">
<Form.Item <Form.Item
label="课程名称:" label="课程名称:"
labelCol={{ labelCol={{
...@@ -84,10 +100,12 @@ class EditClassModal extends React.Component { ...@@ -84,10 +100,12 @@ class EditClassModal extends React.Component {
initialValue: editClassInfo.course_id, initialValue: editClassInfo.course_id,
rules: [{ required: true, message: '课程不能为空' }], rules: [{ required: true, message: '课程不能为空' }],
})( })(
<Select> isEdit == 1 ?
<Option value="">请选择课程名称</Option> <span>{ courseList.find(ele => ele.id == editClassInfo.course_id) && courseList.find(ele => ele.id == editClassInfo.course_id).title }</span> :
{courseList.map(ele => <Option value={ele.id}>{ele.title}</Option>)} <Select>
</Select>)} <Option value="">请选择课程名称</Option>
{courseList.map(ele => <Option value={ele.id}>{ele.title}</Option>)}
</Select>)}
</Form.Item> </Form.Item>
<Form.Item <Form.Item
label="班级名称:" label="班级名称:"
...@@ -106,7 +124,7 @@ class EditClassModal extends React.Component { ...@@ -106,7 +124,7 @@ class EditClassModal extends React.Component {
{ required: true, message: '班级名称不能为空' }, { required: true, message: '班级名称不能为空' },
{ max: 20, message: '班级名称最多20字符' }, { max: 20, message: '班级名称最多20字符' },
], ],
})(<Input type="text" placeholder="请输入班级名称" />)} })(<Input type="text" maxLength={20} onChange={e => this.titleChange(e)} addonAfter={selectBefore} placeholder="请输入班级名称" />)}
</Form.Item> </Form.Item>
<Form.Item <Form.Item
label="班级容量:" label="班级容量:"
...@@ -127,6 +145,10 @@ class EditClassModal extends React.Component { ...@@ -127,6 +145,10 @@ class EditClassModal extends React.Component {
pattern: /^\d+$/, pattern: /^\d+$/,
message: '请输入大于0的整数', message: '请输入大于0的整数',
}, },
{
max: 9999,
message: '容量最多为9999',
},
], ],
})(<InputNumber placeholder="请输入班级容量" style={{ width: '100%' }} />)} })(<InputNumber placeholder="请输入班级容量" style={{ width: '100%' }} />)}
</Form.Item> </Form.Item>
......
...@@ -9,6 +9,7 @@ class ClassMgtForm extends React.Component { ...@@ -9,6 +9,7 @@ class ClassMgtForm extends React.Component {
state = { state = {
modalVisible: false, modalVisible: false,
isEdit: false, isEdit: false,
title: '',
} }
componentDidMount() { // 挂载 componentDidMount() { // 挂载
pageIn('课程管理'); pageIn('课程管理');
...@@ -21,6 +22,10 @@ class ClassMgtForm extends React.Component { ...@@ -21,6 +22,10 @@ class ClassMgtForm extends React.Component {
const { dispatch, form } = this.props; const { dispatch, form } = this.props;
if (modalVisible) { if (modalVisible) {
this.state.isEdit = false; this.state.isEdit = false;
} else {
this.setState({
title: '',
});
} }
form.resetFields(); form.resetFields();
dispatch({ dispatch({
...@@ -45,6 +50,9 @@ class ClassMgtForm extends React.Component { ...@@ -45,6 +50,9 @@ class ClassMgtForm extends React.Component {
this.state.modalVisible = true; this.state.modalVisible = true;
this.state.isEdit = true; this.state.isEdit = true;
const { dispatch } = this.props; const { dispatch } = this.props;
this.setState({
title: course.title,
});
dispatch({ dispatch({
type: 'course/getSelectedCourse', type: 'course/getSelectedCourse',
payload: { payload: {
...@@ -61,6 +69,11 @@ class ClassMgtForm extends React.Component { ...@@ -61,6 +69,11 @@ class ClassMgtForm extends React.Component {
}, },
}); });
} }
titleChange = (e) => {
this.setState({
title: e.target.value,
});
}
courseDelete = (id, courseDelete) => { courseDelete = (id, courseDelete) => {
const { dispatch } = this.props; const { dispatch } = this.props;
Modal.confirm({ Modal.confirm({
...@@ -123,7 +136,7 @@ class ClassMgtForm extends React.Component { ...@@ -123,7 +136,7 @@ class ClassMgtForm extends React.Component {
}); });
} }
render() { render() {
const { isEdit } = this.state; const { isEdit, title } = this.state;
const { getFieldDecorator } = this.props.form; const { getFieldDecorator } = this.props.form;
const { const {
coursesinfo, coursesinfo,
...@@ -191,6 +204,9 @@ class ClassMgtForm extends React.Component { ...@@ -191,6 +204,9 @@ class ClassMgtForm extends React.Component {
}, },
}, },
]; ];
const selectBefore = (
<div>{title.length || 0}/20</div>
);
return ( return (
<div className={pageStyle.container}> <div className={pageStyle.container}>
<div className={pageStyle.headerbox}> <div className={pageStyle.headerbox}>
...@@ -216,7 +232,7 @@ class ClassMgtForm extends React.Component { ...@@ -216,7 +232,7 @@ class ClassMgtForm extends React.Component {
destroyOnClose destroyOnClose
> >
<Form> <Form>
<Form.Item hasFeedback> <Form.Item>
<span style={{ paddingLeft: 45 }}>课程名称*</span> <span style={{ paddingLeft: 45 }}>课程名称*</span>
{getFieldDecorator('title', { {getFieldDecorator('title', {
initialValue: editCourseInfo.title, initialValue: editCourseInfo.title,
...@@ -230,7 +246,7 @@ class ClassMgtForm extends React.Component { ...@@ -230,7 +246,7 @@ class ClassMgtForm extends React.Component {
message: '课程名称最多20个字符', message: '课程名称最多20个字符',
}, },
], ],
})(<Input style={{ width: 200 }} maxLength={20} placeholder="输入课程名称" />)} })(<Input style={{ width: 200 }} onChange={e => this.titleChange(e)} addonAfter={selectBefore} maxLength={20} placeholder="输入课程名称" />)}
</Form.Item> </Form.Item>
<Form.Item> <Form.Item>
<span style={{ paddingLeft: 45 }}>课表颜色*</span> <span style={{ paddingLeft: 45 }}>课表颜色*</span>
......
...@@ -135,10 +135,10 @@ class HeadquarterMgtForm extends React.Component { ...@@ -135,10 +135,10 @@ class HeadquarterMgtForm extends React.Component {
rules: [ rules: [
{ {
required: true, required: true,
message: '请输入课程名称', message: '请输入机构码',
}, },
], ],
})(<Input className={pageStyle.inputbtn} style={{ width: 200 }} placeholder="输入课程名称" />)} })(<Input className={pageStyle.inputbtn} style={{ width: 200 }} placeholder="请输入机构码" />)}
</Form.Item> </Form.Item>
</div> </div>
<Alert <Alert
......
...@@ -21,7 +21,10 @@ class eliminateEdit extends React.Component { ...@@ -21,7 +21,10 @@ class eliminateEdit extends React.Component {
const { save } = this.props; const { save } = this.props;
this.props.form.validateFields((err, values) => { this.props.form.validateFields((err, values) => {
if (!err) { if (!err) {
save(values); save({
...values,
course_mode: this.state.currentCourse.course_mode,
});
} }
}); });
} }
...@@ -105,7 +108,11 @@ class eliminateEdit extends React.Component { ...@@ -105,7 +108,11 @@ class eliminateEdit extends React.Component {
sm: { span: 20 }, sm: { span: 20 },
}} }}
> >
<InputNumber max={currentCourse.surplus || 0} style={{ width: 200 }} />, {getFieldDecorator('expend', {
rules: [{ required: true, message: '课程不能为空' }],
})(
<InputNumber max={currentCourse.surplus || 0} style={{ width: 200 }} />,
)}
</Form.Item> </Form.Item>
<Form.Item <Form.Item
label="操作人" label="操作人"
......
...@@ -366,7 +366,7 @@ class StudentMgt extends React.Component { ...@@ -366,7 +366,7 @@ class StudentMgt extends React.Component {
<Col className={pageStyle.formitem} xs={{ span: 12 }} sm={{ span: 12 }} md={{ span: 12 }} lg={{ span: 6 }}> <Col className={pageStyle.formitem} xs={{ span: 12 }} sm={{ span: 12 }} md={{ span: 12 }} lg={{ span: 6 }}>
<div className={pageStyle.formitemlabel}>学员状态</div> <div className={pageStyle.formitemlabel}>学员状态</div>
<Select className={pageStyle.selectitem} placeholder="请选择" value={searchstudentListQueryParams.student_status} onChange={e => this.searchParamsChange(e, 'Select', 'student_status')}> <Select className={pageStyle.selectitem} placeholder="请选择" value={searchstudentListQueryParams.student_status} onChange={e => this.searchParamsChange(e, 'Select', 'student_status')}>
<Option value=""></Option> <Option value="">全部</Option>
<Option value={1}>在读</Option> <Option value={1}>在读</Option>
<Option value={2}>到期</Option> <Option value={2}>到期</Option>
</Select> </Select>
......
...@@ -452,10 +452,10 @@ class StudentMgt extends React.Component { ...@@ -452,10 +452,10 @@ class StudentMgt extends React.Component {
<div className={pageStyle.tableoperatebox}> <div className={pageStyle.tableoperatebox}>
<a className={pageStyle.alink} href="javascript:;" onClick={() => this.toRenewCourse(record)}>续课</a> <a className={pageStyle.alink} href="javascript:;" onClick={() => this.toRenewCourse(record)}>续课</a>
<span className={pageStyle.divideline}>|</span> <span className={pageStyle.divideline}>|</span>
<a className={pageStyle.alink} href="javascript:;" onClick={() => this.toChangeCourse(record)} >转课</a> { record.surplus > 0 && <a className={pageStyle.alink} href="javascript:;" onClick={() => this.toChangeCourse(record)} >转课</a>}
<span className={pageStyle.divideline}>|</span> { record.surplus > 0 && <span className={pageStyle.divideline}>|</span>}
<a className={pageStyle.alink} href="javascript:;" onClick={() => this.showDeleteConfirm(record.id)}>退课</a> { record.surplus > 0 && <a className={pageStyle.alink} href="javascript:;" onClick={() => this.showDeleteConfirm(record.id)}>退课</a>}
<span className={pageStyle.divideline}>|</span> { record.surplus > 0 && <span className={pageStyle.divideline}>|</span>}
</div> </div>
); );
}, },
...@@ -565,7 +565,7 @@ class StudentMgt extends React.Component { ...@@ -565,7 +565,7 @@ class StudentMgt extends React.Component {
<div className={pageStyle.tabselect}>选择课程:</div> <div className={pageStyle.tabselect}>选择课程:</div>
<Col span={4}> <Col span={4}>
<Select placeholder="课程列表" style={{ width: 233 }} onChange={this.OperationLog}> <Select placeholder="课程列表" style={{ width: 233 }} onChange={this.OperationLog}>
{courseList.map(ele => <Option value={ele.id}>{ele.title}</Option>)} {studentsdetail.student_courses.map(ele => <Option value={ele.id}>{ele.course.title}</Option>)}
</Select> </Select>
</Col> </Col>
<div className={pageStyle.tablebox}> <div className={pageStyle.tablebox}>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment