Commit 958c7880 authored by sujie@126.com's avatar sujie@126.com

Merge branch 'wxl-develop' of git.server:wangxuelai/biz.qingxiao.com into wxl-develop

parents cb215049 b00cdc28
import React from 'react';
import { Button, Row, Icon, Col, Input, Select, Pagination, Radio, DatePicker, Modal, Form, TimePicker, InputNumber, Table } from 'antd';
const { Option } = Select;
class OpeartorChangeForm extends React.Component {
componentDidMount() { // 挂载
}
componentDidUpdate() {
}
componentWillUnmount() { // 卸载
}
sureOperate = () => {
const { form, sureOperateChange } = this.props;
form.validateFields((err, values) => {
if (!err) {
sureOperateChange(values);
}
});
}
render() {
const {
teacherList,
visible,
operator,
onHide,
} = this.props;
const { getFieldDecorator } = this.props.form;
return (
<div>
<Modal
visible={visible}
title="选择你要变更的操作人"
okText="确定"
onCancel={onHide}
onOk={this.sureOperate}
zIndex={111}
maskClosable={false}
width={433}
centered
>
<Form labelAlign="left" className="addstudentcontent">
<Form.Item
label="操作人"
labelCol={{
xs: { span: 24 },
sm: { span: 6 },
}}
wrapperCol={{
xs: { span: 24 },
sm: { span: 18 },
}}
>
{getFieldDecorator('operator_id', {
initialValue: operator.id,
rules: [
{
required: true,
message: '请选择操作人',
},
],
})(<Select>{teacherList.map(ele => <Option value={ele.id}>{ele.nickname}</Option>)}</Select>)
}
</Form.Item>
</Form>
</Modal>
</div>
);
}
}
OpeartorChangeForm.propTypes = {
};
const OpeartorChange = Form.create()(OpeartorChangeForm);
export default OpeartorChange;
......@@ -103,6 +103,10 @@ export default {
eliminateSubmitting: false,
courseRelateClassList: [],
datetime: '',
operator: {
id: '',
nickname: '',
},
},
subscriptions: {
setup({ dispatch, history }) { // eslint-disable-line
......@@ -172,7 +176,7 @@ export default {
},
* queryinfo({ payload }, { call, put, select }) {
yield put({
type: 'classmgt/queryTeacherList',
type: 'queryTeacherList',
});
yield put({
type: 'studentsList',
......@@ -430,12 +434,12 @@ export default {
reservemobile,
gender,
grade,
operatorid,
course_id,
mode_type,
buy,
give,
class_ids,
operator_id,
} = payload;
const classids = new Array(class_ids).join(',');
const loadmessage = message.loading('资料保存中...', 0);
......@@ -449,7 +453,7 @@ export default {
reservemobile,
gender,
grade,
operatorid,
operator_id,
});
yield put({
type: 'updateState',
......@@ -466,6 +470,7 @@ export default {
buy,
give,
class_ids: classids,
operator_id,
});
if (cousrsebordata.code == 200) {
message.success('保存成功', 1);
......@@ -473,6 +478,10 @@ export default {
type: 'updateState',
payload: {
addOrUpdateDiaShow: false,
operator: {
id: '',
nickname: '',
},
},
});
} else {
......
......@@ -59,6 +59,7 @@ class StudentAddForm extends React.Component {
buy,
give,
class_ids,
operator_id,
} = values;
save({
name,
......@@ -75,6 +76,7 @@ class StudentAddForm extends React.Component {
buy,
give,
class_ids,
operator_id,
});
}
});
......@@ -132,9 +134,13 @@ class StudentAddForm extends React.Component {
visible,
courseList,
hide,
operator,
teacherList,
toChangeOperator,
} = this.props;
const { usefulClassList } = this.state;
const { modeType, modeTypeArr } = this.state;
const {
usefulClassList, modeType, modeTypeArr,
} = this.state;
const { getFieldDecorator } = this.props.form;
return (
<Modal
......@@ -145,6 +151,7 @@ class StudentAddForm extends React.Component {
bodyStyle={{ paddingLeft: 0, paddingRight: 0 }}
onOk={this.handleSubmit}
width={570}
zIndex={110}
destroyOnClose
>
<Form labelAlign="left" className="addstudentcontent">
......@@ -440,25 +447,6 @@ class StudentAddForm extends React.Component {
)}
</Form.Item>
</Col>
<Col className={pageStyle.course}>
<Form.Item
label={<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>}
labelCol={{
xs: { span: 24 },
sm: { span: 6 },
}}
wrapperCol={{
xs: { span: 24 },
sm: { span: 18 },
}}
>
{getFieldDecorator('operator_id', {
})(
<span>马老师</span>,
)}
<a href="javascript:;" className={pageStyle.changeOperate} >修改</a>
</Form.Item>
</Col>
<Col className={pageStyle.course}>
<Form.Item
label="赠送课时"
......@@ -585,12 +573,28 @@ class StudentAddForm extends React.Component {
</Col>
</div>
}
<Col className={pageStyle.course}>
<Form.Item
label={<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>}
labelCol={{
xs: { span: 24 },
sm: { span: 6 },
}}
wrapperCol={{
xs: { span: 24 },
sm: { span: 18 },
}}
>
{getFieldDecorator('operator_id', {
initialValue: operator.id,
})(
<span>{operator.nickname}</span>,
)}
<a href="javascript:;" className={pageStyle.changeOperate} onClick={() => toChangeOperator(true)}>修改</a>
</Form.Item>
</Col>
</Row>
</Col>
<Col span={8} className={pageStyle.teacher}>
<div className={pageStyle.teacherinfo}>操作人:马老师</div>
<span onClick={() => this.teacherVisible(true)}>修改</span>
</Col>
</Row>
</Form>
</Modal>
......
......@@ -4,6 +4,7 @@ import { Icon, Button, Row, Col, Input, Select, Checkbox, Form, InputNumber, Tab
import pageStyle from './index.less';
import { pageIn, hasBtnPower } from '../../utils/index';
import RenewEdit from './RenewEdit';
import OperatorChange from '../../components/operatorChange';
import EliminateEdit from './eliminateEdit';
import StudentAdd from './StudentAdd';
const { Option } = Select;
......@@ -27,7 +28,13 @@ class StudentMgt extends React.Component {
this.state.cage = toyear - dateString.format('YYYY') || 0;
}
setModal1Visible(visible) {
const { dispatch } = this.props;
const { dispatch, schoolUserInfo } = this.props;
dispatch({
type: 'students/updateState',
payload: {
operator: { ...schoolUserInfo },
},
});
dispatch({
type: 'students/modalshoworhide',
payload: {
......@@ -218,6 +225,30 @@ class StudentMgt extends React.Component {
},
});
}
toChangeOperator = (visible) => {
const { dispatch } = this.props;
dispatch({
type: 'students/updateState',
payload: {
changeOperatorShow: visible,
},
});
}
sureOperateChange = (value) => {
const { dispatch, teacherList } = this.props;
const { operator_id } = value;
const teacherName = teacherList.find(ele => ele.id == operator_id).nickname;
dispatch({
type: 'students/updateState',
payload: {
changeOperatorShow: false,
operator: {
id: operator_id,
nickname: teacherName,
},
},
});
}
render() {
const { getFieldDecorator } = this.props.form;
const {
......@@ -241,6 +272,8 @@ class StudentMgt extends React.Component {
courseRelateClassList,
datetime,
schoolUserInfo,
changeOperatorShow,
operator,
} = this.props;
const columns = [
{
......@@ -486,8 +519,18 @@ class StudentMgt extends React.Component {
visible={addOrUpdateDiaShow}
save={this.saveStudent}
courseList={courseList}
teacherList={teacherList}
datetime={datetime}
operator={operator} // 默认操作人
hide={() => this.setModal1Visible(false)}
toChangeOperator={this.toChangeOperator}
/>
<OperatorChange
teacherList={teacherList}
visible={changeOperatorShow}
operator={operator}
onHide={() => this.toChangeOperator(false)}
sureOperateChange={this.sureOperateChange}
/>
</div>
);
......@@ -516,10 +559,10 @@ function mapStateToProps(state) {
renewCourses,
courseRelateClassList,
datetime,
} = state.students;
const {
teacherList,
} = state.classmgt;
changeOperatorShow,
operator,
} = state.students;
const {
schoolUserInfo,
} = state.webapp;
......@@ -543,6 +586,8 @@ function mapStateToProps(state) {
courseRelateClassList,
datetime,
schoolUserInfo,
changeOperatorShow,
operator,
};
}
export default connect(mapStateToProps)(ForgotPassword);
......
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