Commit 9a82d43f authored by baixian's avatar baixian

优化

parents 90fb70f3 cef4e8b6
......@@ -12,11 +12,11 @@
<![endif]-->
<script charset="utf-8" src="https://map.qq.com/api/js?v=2.exp&key=XSZBZ-5LHCV-5I2P7-UQHPW-6456F-JBB3B"></script>
<script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/js/console-polyfill.js?2011191012222" charset="utf-8"></script><script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/js/es6-shim.min.js?20191012222" charset="utf-8"></script><script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/js/es5-shim.js?20191012222" charset="utf-8"></script><script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/js/es5-sham.min.js?20191012222" charset="utf-8"></script><script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/js/json3.min.js?20191012222" charset="utf-8"></script><script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/js/html5shiv.min.js?20191012222" charset="utf-8"></script><script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/js/polyfill.js?20191012222" charset="utf-8"></script><script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/lib/vendor.dll.js?20191012222" charset="utf-8"></script>
<script src="js/console-polyfill.js?20191012222" charset="utf-8"></script><script src="js/es6-shim.min.js?20191012222" charset="utf-8"></script><script src="js/es5-shim.js?20191012222" charset="utf-8"></script><script src="js/es5-sham.min.js?20191012222" charset="utf-8"></script><script src="js/json3.min.js?20191012222" charset="utf-8"></script><script src="js/html5shiv.min.js?20191012222" charset="utf-8"></script><script src="js/polyfill.js?20191012222" charset="utf-8"></script><script src="lib/vendor.dll.js?20191012222" charset="utf-8"></script>
</head>
</head>
<body>
<div id="root"></div>
<script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/dist/main.js?15222111274997073861" charset="utf-8"></script>
<script src="dist/main.js?1575359807220" charset="utf-8"></script>
</body>
</html>
\ No newline at end of file
......@@ -73,8 +73,8 @@ export default {
width: '20px',
height: '20px',
},
activeurl: `${__IMGCDN__}menu/teacheractive.png`,
notactiveurl: `${__IMGCDN__}menu/teacher.png`,
activeurl: `${__IMGCDN__}menu/courserecordactive.png`,
notactiveurl: `${__IMGCDN__}menu/courserecord.png`,
path: '/sjd/record',
relativePath: ['/sjd/record'],
},
......
......@@ -124,13 +124,13 @@ class CallStudentsForm extends React.Component {
});
return;
}
if (callType == 1) {
if (callType == 1 || callType == 3) {
dispatch({
type: 'callstudents/studentCallPost',
payload: {
callBack: () => {
callBack: (id) => {
if (callBack && (typeof callBack == 'function')) {
callBack();
callBack(id);
}
},
},
......@@ -645,6 +645,41 @@ class CallStudentsForm extends React.Component {
</Col>
</Row>
</div>}
{callType == 3 &&
<div>
<Row gutter={16} className={pageStyle.detailrow}>
<Col xs={{ span: 24 }} sm={{ span: 12 }} md={{ span: 12 }} lg={{ span: 6 }} style={{ marginBottom: '20px' }}>
<span className={pageStyle.detailtitle}>上课班级:</span>
<span className={pageStyle.detaildesc}>{callStudentSchedule.class && callStudentSchedule.class.title}</span>
</Col>
<Col xs={{ span: 24 }} sm={{ span: 12 }} md={{ span: 12 }} lg={{ span: 6 }} style={{ marginBottom: '20px' }}>
<span className={pageStyle.detailtitle}>上课课程:</span>
<span className={pageStyle.detaildesc}>{callStudentSchedule.course && callStudentSchedule.course.title}</span>
</Col>
<Col xs={{ span: 24 }} sm={{ span: 12 }} md={{ span: 12 }} lg={{ span: 6 }} style={{ marginBottom: '20px' }}>
<span className={pageStyle.detailtitle}>上课日期:</span>
<span className={pageStyle.detaildesc}>{callStudentSchedule.start_date}</span>
</Col>
<Col xs={{ span: 24 }} sm={{ span: 12 }} md={{ span: 12 }} lg={{ span: 6 }} style={{ marginBottom: '20px' }}>
<span className={pageStyle.detailtitle}>上课老师:</span>
{callStudentSchedule.school_teacher && callStudentSchedule.school_teacher.nickname &&
<span className={pageStyle.detaildesc}>{callStudentSchedule.school_teacher.nickname}</span>
}
</Col>
<Col xs={{ span: 24 }} sm={{ span: 12 }} md={{ span: 12 }} lg={{ span: 6 }} style={{ marginBottom: '20px' }}>
<span className={pageStyle.detailtitle}>上课教室:</span>
<span className={pageStyle.detaildesc}>{(callStudentSchedule.class_room && callStudentSchedule.class_room.title) || '未设置'}</span>
</Col>
<Col xs={{ span: 24 }} sm={{ span: 12 }} md={{ span: 12 }} lg={{ span: 6 }}>
<span className={pageStyle.detailtitle}>上课时间:</span>
<span className={pageStyle.detaildesc}>{callStudentSchedule.start_date_format}-{callStudentSchedule.end_date_format}</span>
</Col>
<Col xs={{ span: 24 }} sm={{ span: 12 }} md={{ span: 12 }} lg={{ span: 6 }} >
<span className={pageStyle.detailtitle}>授课课时:</span>
<InputNumber value={expend} size="middle" className={pageStyle.hourInput} onChange={this.changeExpand} />
</Col>
</Row>
</div>}
{callType == 2 &&
<div>
<Row gutter={16} className={pageStyle.detailrow}>
......
This diff is collapsed.
.titlebox {
display: flex;
align-items: center;
justify-content: space-between;
// justify-content: space-between;
height: 55px;
padding: 0 22px 0 24px;
.title {
......@@ -68,8 +68,8 @@
.courseInfoBox {
position: absolute;
display: flex;
// align-items: center;
// justify-content: center;
align-items: center;
justify-content: center;
flex-direction: column;
word-break: break-all;
overflow: hidden;
......@@ -77,6 +77,9 @@
border-style: solid;
border-width: 1px;
border-top-width: 3px;
border-radius: 4px;
font-size: 14px;
padding: 10px;
}
}
.courseDetailStyle {
......@@ -85,7 +88,7 @@
align-items: center;
justify-content: space-between;
color: #FFFFFF;
padding: 0 15px 10px;
padding: 10px 15px 10px;
line-height: 1;
.left {
display: flex;
......@@ -107,43 +110,74 @@
display: flex;
align-items: center;
padding: 0 15px;
color: rgba(255,255,255,0.5);
color: rgba(255,255,255,0.7);
line-height: 1;
padding-bottom: 10px;
font-size: 12px;
word-break: break-all;
.whitedot {
width: 8px;
height: 4px;
border-radius: 2px;
margin-right: 9px;
background-color: rgba(255,255,255,0.5);
background-color: #A9A9A9;
}
.name {
margin-right: 5px;
}
}
.classtitlebox {
text-align: center;
// text-align: center;
color: #FFFFFF;
font-size: 14px;
word-break: break-all;
padding: 10px 15px;
text-align: center;
padding: 0 15px 11px;
// text-align: center;
}
.coursetitlebox {
color: rgba(255,255,255,0.7);
font-size: 14px;
padding: 0 15px 15px;
}
.divideline {
border-bottom: 1px solid rgba(255,255,255,0.1);
}
.btnbox {
display: flex;
align-items: center;
.btnitem {
flex-grow: 1;
text-align: center;
line-height: 50px;
color: #FFFFFF;
cursor: pointer;
&:hover {
background-color: rgba(0,0,0,1);
}
&:first-child {
border-right: 1px solid rgba(255,255,255,0.2);
border-bottom-left-radius: 6px;
}
&:last-child {
border-bottom-right-radius: 6px;
}
}
}
:global {
.ant-popover-content {
width: 280px;
overflow: hidden;
.ant-popover-content {
border-radius: 4px;
}
.ant-popover-inner-content {
background-color: rgba(0,0,0,0.7);
background-color: rgba(0,0,0,0.8);
border-radius: 4px;
padding: 15px 0 0;
}
.ant-popover-arrow {
border-top-color: rgba(0, 0, 0, 0.7);
border-left-color: rgba(0, 0, 0, 0.7);
border-top-color: rgba(0, 0, 0, 0.8);
border-left-color: rgba(0, 0, 0, 0.8);
}
}
}
......
......@@ -194,7 +194,7 @@ export default {
const { sid } = yield select(state => state.webapp);
let newcallStudentTotal = callStudentTotal;
let newqueryScheduleStudentListParams = {};
if (callType == 1) { // 正常点名
if (callType == 1 || callType == 3) { // 正常点名
newqueryScheduleStudentListParams = Object.assign(queryCallStudentListParams, {
school_id: sid,
extra: 'time,recently_course',
......@@ -322,6 +322,7 @@ export default {
course_id: callStudentSchedule.course_id,
});
const callStudengListDate = yield call(schedulemgtAjax.getStudentCalls, newqueryScheduleStudentListParams);
console.log('ddddddddddddddddddddddd');
yield put({
type: 'updateState',
payload: {
......@@ -586,7 +587,7 @@ export default {
});
const loading = message.loading('点名处理中...', 0);
const studentCallsDate = yield call(schedulemgtAjax.studentCalls, {
type: callType,
type: (callType == 1 || callType == 3) ? 1 : callType,
school_id: sid,
call_students: callStudent.join(';'),
expend,
......@@ -613,7 +614,7 @@ export default {
},
});
if (callBack && (typeof callBack == 'function')) {
callBack();
callBack(callStudentSchedule.id);
}
} else {
yield put({
......
......@@ -2,6 +2,7 @@
import { routerRedux } from 'dva/router';
import { message } from 'antd';
import { delay } from 'redux-saga';
import moment from 'moment';
import co from 'co';
import {
LocalStorage,
......@@ -38,6 +39,7 @@ export default {
perPage: 10,
schedule_id: 0,
},
callStudentTotal: 0,
},
subscriptions: {
setup({ dispatch, history }) { // eslint-disable-line
......@@ -46,11 +48,11 @@ export default {
effects: {
* queryinfo({ payload }, { call, put, select }) {
yield put({
type: 'webapp/querymemberinfo',
payload: {
},
});
// yield put({
// type: 'webapp/querymemberinfo',
// payload: {
// },
// });
yield delay(260);
yield put({
type: 'selectTeacher',
......@@ -68,6 +70,7 @@ export default {
type: 'selectRecord',
payload: {
params: {
end_time: moment().format('YYYY-MM-DD HH:mm:ss'),
},
},
});
......@@ -77,17 +80,12 @@ export default {
const { sid, schoolUserInfo } = yield select(state => state.webapp);
const { recordParams, recordTotal } = yield select(state => state.classrecord);
const loading = message.loading('数据加载中...', 0.5);
let newParams;
if (schoolUserInfo && schoolUserInfo.type === 1) {
newParams = Object.assign(recordParams, params, {
school_id: sid,
teacher_id: schoolUserInfo.id,
});
} else {
newParams = Object.assign(recordParams, params, {
school_id: sid,
});
}
// let newParams;
const newParams = Object.assign(recordParams, params, {
school_id: sid,
// teacher_id: schoolUserInfo.id,
my: LocalStorage.getItem('role') == 1 ? 1 : '',
});
let newTotal = recordTotal;
const data = yield call(classRecordAjax.getRecordList, newParams);
setTimeout(loading);
......@@ -100,6 +98,7 @@ export default {
payload: {
recordList: data.data && data.data.list,
recordTotal: newTotal,
recordParams: { ...newParams },
},
});
} else {
......@@ -268,8 +267,8 @@ export default {
ELE.student_type = ele.student_type;
ELE.expend = ele.expend; // 统一的扣课时
ELE.remark = decodeURIComponent(ele.remark);
ELE.name = ele.formal_school_student.name;
ELE.mobile = ele.formal_school_student.mobile;
ELE.name = ele.formal_school_student && ele.formal_school_student.name;
ELE.mobile = ele.formal_school_student && ele.formal_school_student.mobile;
ELE.surplus = ele.surplus;
callStudentOperateList.push(ELE);
});
......
......@@ -42,8 +42,8 @@ export default {
},
effects: {
* queryInfo({ payload }, { call, put, select }) {
const { dateTime } = payload;
const currentTimestamp = new Date(dateTime.replace(/-/g, '/')).getTime();
const { datetime } = payload;
const currentTimestamp = new Date(datetime.replace(/-/g, '/')).getTime();
yield put({
type: 'updateState',
payload: {
......
......@@ -54,7 +54,7 @@ export default {
teacherList: [],
courseList: [],
classroomList: [],
dateTime: '',
datetime: '',
classRoomMgtShow: false,
classRoomSubmitting: false,
addCourseTimeShow: false,
......@@ -66,6 +66,9 @@ export default {
end_time: '',
tabIndex: 1,
courseTimeListShow: false,
changeScheduleShow: false,
selectScheduleinfo: {},
changeScheduleIndex: 1,
},
subscriptions: {
setup({ dispatch, history }) { // eslint-disable-line
......@@ -163,8 +166,8 @@ export default {
},
* goBirthStudent({ payload }, { call, put, select }) {
const { studentListQueryParams } = yield select(state => state.students);
const { dateTime } = yield select(state => state.indexstaic);
const todayDate = new Date(dateTime.replace(/-/g, '-'));
const { datetime } = yield select(state => state.indexstaic);
const todayDate = new Date(datetime.replace(/-/g, '-'));
const month = todayDate.getMonth() + 1;
const day = todayDate.getDate();
studentListQueryParams.birthday_month = month;
......@@ -203,7 +206,7 @@ export default {
},
* goPlanStudent({ payload }, { call, put, select }) {
const { studentListQueryParams, searchstudentListQueryParams } = yield select(state => state.students);
const { dateTime } = yield select(state => state.indexstaic);
const { datetime } = yield select(state => state.indexstaic);
studentListQueryParams.assign_class_status = 2;
searchstudentListQueryParams.assign_class_status = 2;
studentListQueryParams.birthday_start = '';
......@@ -482,18 +485,18 @@ export default {
judgetodaycurrentTimestamp: (new Date(staticcenter.datetime.replace(/-/g, '/')).getTime()),
},
});
// yield put({
// type: 'coursechart/queryInfo',
// payload: {
// dateTime: staticcenter.datetime,
// },
// });
yield put({
type: 'coursechart/queryInfo',
payload: {
datetime: staticcenter.datetime,
},
});
if (staticcenter.code == 200) {
yield put({
type: 'updateState',
payload: {
sid,
dateTime: staticcenter.datetime,
datetime: staticcenter.datetime,
staticcenter: staticcenter.data,
},
});
......@@ -501,7 +504,7 @@ export default {
yield put({
type: 'updateState',
payload: {
dateTime: staticcenter.datetime,
datetime: staticcenter.datetime,
},
});
yield put({
......@@ -622,7 +625,7 @@ export default {
teacherList: [],
courseList: [],
classroomList: [],
dateTime: '',
datetime: '',
classRoomMgtShow: false,
classRoomSubmitting: false,
addCourseTimeShow: false,
......
import { routerRedux } from 'dva/router';
import moment from 'moment';
import { message } from 'antd';
import {
LocalStorage,
......@@ -246,7 +247,9 @@ export default {
yield put({
type: 'selectCourseStatistical',
payload: {
params: {},
params: {
end_time: moment().format('YYYY-MM-DD'),
},
},
});
},
......
......@@ -155,6 +155,9 @@ class StaticCenter extends React.Component {
},
});
}
disabledDate = (current) => {
return current && current > moment();
}
render() {
const {
form: { getFieldDecorator, getFieldValue },
......@@ -339,21 +342,28 @@ class StaticCenter extends React.Component {
<div className={pageStyle.container}>
<div className={pageStyle.headerWrap}>
<Card bordered={false} bodyStyle={{ padding: '15px 20px 0 20px', boxShadow: '0px 6px 6px 0px rgba(0, 0, 0, 0.04)' }}>
<Form labelAlign="left" onSubmit={this.handleSearch}>
<Form labelAlign="right" onSubmit={this.handleSearch}>
<Row
gutter={{
sm: 2, xs: 12, md: 24, lg: 24,
sm: 12, xs: 12, md: 12, lg: 12,
}}
>
<Col xs={{ span: 12 }} sm={{ span: 12 }} md={{ span: 12 }} lg={{ span: 6 }} xl={{ span: 6 }}>
<FormItem {...formItemLayout} label="上课时间">
{getFieldDecorator('time', { initialValue: '' })(
<RangePicker style={{ width: '100%' }} />,
{getFieldDecorator('time', {
initialValue: [recordParams.start_time == '' ? null : moment(recordParams.start_time), recordParams.end_time == '' ? null : moment(recordParams.end_time)],
})(
<RangePicker
style={{ width: '100%' }}
showTime
format="YYYY-MM-DD HH:mm:ss"
disabledDate={this.disabledDate}
/>,
)}
</FormItem>
</Col>
<Col xs={{ span: 12 }} sm={{ span: 12 }} md={{ span: 12 }} lg={{ span: 6 }} xl={{ span: 6 }}>
<FormItem {...formItemLayout} label="班&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;级">
<FormItem {...formItemLayout} label="班级">
{getFieldDecorator('class_id', { initialValue: '' })(
<Select>
<Option value="">全部</Option>
......@@ -374,7 +384,7 @@ class StaticCenter extends React.Component {
</FormItem>
</Col>
<Col xs={{ span: 12 }} sm={{ span: 12 }} md={{ span: 12 }} lg={{ span: 6 }} xl={{ span: 6 }}>
<FormItem {...formItemLayout} label="课&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;程">
<FormItem {...formItemLayout} label="课程">
{getFieldDecorator('course_id', { initialValue: '' })(
<Select>
<Option value="">全部</Option>
......@@ -386,7 +396,7 @@ class StaticCenter extends React.Component {
{
schoolUserInfo.type === 2 &&
<Col xs={{ span: 12 }} sm={{ span: 12 }} md={{ span: 12 }} lg={{ span: 6 }} xl={{ span: 6 }}>
<FormItem {...formItemLayout} label="老&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;师">
<FormItem {...formItemLayout} label="老师">
{getFieldDecorator('teacher_id', { initialValue: '' })(
<Select>
<Option value="">全部</Option>
......@@ -397,7 +407,7 @@ class StaticCenter extends React.Component {
</Col>
}
<Col xs={{ span: 12 }} sm={{ span: 12 }} md={{ span: 12 }} lg={{ span: 6 }} xl={{ span: 6 }}>
<FormItem {...formItemLayout} label="教&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;室">
<FormItem {...formItemLayout} label="教室">
{getFieldDecorator('class_room_id', { initialValue: '' })(
<Select>
<Option value="">全部</Option>
......
This diff is collapsed.
......@@ -106,6 +106,19 @@ class RenewEdit extends React.Component {
form.resetFields();
close();
}
checkData = (value) => {
let str = value.replace(/[^\d\.]/g, '');
const pointIndex = str.search(/\./);
if (pointIndex !== -1) {
str = str.substr(0, pointIndex + 1).replace(/\./, '.5');
}
return str;
}
changeValue = (e, type) => {
this.props.form.setFieldsValue({
[type]: this.checkData(e.target.value),
});
}
render() {
const {
visible,
......@@ -202,7 +215,7 @@ class RenewEdit extends React.Component {
},
],
})(
<InputNumber placeholder="请输入购买课时" style={{ width: 200 }} />,
<InputNumber onBlur={e => this.changeValue(e, 'buy')} placeholder="请输入购买课时" style={{ width: 200 }} />,
)}
</Form.Item>
</Col>
......@@ -226,7 +239,7 @@ class RenewEdit extends React.Component {
},
],
})(
<InputNumber placeholder="请输入赠送课时" style={{ width: 200 }} />,
<InputNumber onBlur={e => this.changeValue(e, 'give')} placeholder="请输入赠送课时" style={{ width: 200 }} />,
)}
</Form.Item>
</Col>
......@@ -249,9 +262,13 @@ class RenewEdit extends React.Component {
{getFieldDecorator('buy', {
rules: [
{
required: false,
required: true,
message: '请输入购买天数',
},
{
pattern: /^[1-9]\d*$/,
message: '请输入大于0的整数',
},
],
})(
<InputNumber placeholder="请输入购买天数" style={{ width: 200 }} />,
......@@ -272,10 +289,14 @@ class RenewEdit extends React.Component {
}}
>
{getFieldDecorator('give', {
rules: [
rules: [
{
required: false,
message: '请输入赠送天数',
message: '请输入在赠送天数',
},
{
pattern: /^[1-9]\d*$/,
message: '请输入大于0的整数',
},
],
})(
......
......@@ -31,7 +31,7 @@ class eliminateEdit extends React.Component {
const { currentCourse } = this.state;
this.props.form.validateFields((err, values) => {
if (!err) {
if (currentCourse.surplus <= 0) {
if (currentCourse.surplus <= 0 && Number(currentCourse.give) < 0) {
Modal.warn({
title: '学生的这个课程已经没有课时了,请提醒续费',
});
......@@ -77,16 +77,34 @@ class eliminateEdit extends React.Component {
payCourseValue: 0,
});
}
checkData = (value) => {
let str = value.replace(/[^\d\.]/g, '');
const pointIndex = str.search(/\./);
if (pointIndex !== -1) {
str = str.substr(0, pointIndex + 1).replace(/\./, '.5');
}
return str;
}
expendChange = (e) => {
const { currentCourse } = this.state;
const { studentinfo } = this.props;
const { getFieldDecorator, getFieldValue } = this.props.form;
this.props.form.validateFields((err, values) => {
if (!err) {
let value = 0;
if (currentCourse.course_mode === 1) {
value = this.checkData(e.target.value);
} else {
const { value: avalue } = e.target;
value = avalue;
}
this.props.form.setFieldsValue({
expend: value,
});
this.setState({
expendValue: Number(currentCourse.surplus - Number(e.target.value)),
giveCourseValue: Number(getFieldValue('course_type')) === 2 ? Number(studentinfo.surplus_give - Number(e.target.value)) : studentinfo.surplus_give,
payCourseValue: Number(getFieldValue('course_type')) === 1 ? Number(studentinfo.surplus_buy - Number(e.target.value)) : studentinfo.surplus_buy,
expendValue: Number(currentCourse.surplus - value),
giveCourseValue: Number(getFieldValue('course_type')) === 2 ? Number(studentinfo.surplus_give - value) : studentinfo.surplus_give,
payCourseValue: Number(getFieldValue('course_type')) === 1 ? Number(studentinfo.surplus_buy - Number(value)) : studentinfo.surplus_buy,
});
}
});
......@@ -201,11 +219,10 @@ class eliminateEdit extends React.Component {
>
{getFieldDecorator('expend', {
rules: [
{ required: true, message: '消耗课时不能为空' },
{
validator: (rule, value, callback) => {
if (value < 1) {
callback('消除课时不能小于1');
if (currentCourse.course_mode == 2 && !/^[1-9]\d*$/.test(value)) {
callback('请输入大于0的整数');
return;
}
if (currentCourse.surplus && currentCourse.surplus > 0 && value > currentCourse.surplus) {
......@@ -216,7 +233,7 @@ class eliminateEdit extends React.Component {
},
],
})(
<InputNumber step={currentCourse.course_mode === 1 ? 0.5 : 1} onBlur={e => this.expendChange(e)} placeholder="请输入消课数量" style={{ width: 200 }} />,
<InputNumber min={0} onBlur={e => this.expendChange(e)} placeholder="请输入消课数量" style={{ width: 200 }} />,
)}
<span className="ant-form-text">{currentCourse.course_mode === 1 ? '课时' : '天'}</span>
</Form.Item>
......
......@@ -43,6 +43,19 @@ class StudentAddForm extends React.Component {
}
});
}
checkData = (value) => {
let str = value.replace(/[^\d\.]/g, '');
const pointIndex = str.search(/\./);
if (pointIndex !== -1) {
str = str.substr(0, pointIndex + 1).replace(/\./, '.5');
}
return str;
}
changeValue = (e, type) => {
this.props.form.setFieldsValue({
[type]: this.checkData(e.target.value),
});
}
render() {
const {
visible,
......@@ -135,7 +148,7 @@ class StudentAddForm extends React.Component {
},
],
})(
<InputNumber min={1} style={{ width: 200 }} />,
<InputNumber min={1} onBlur={e => this.changeValue(e, 'buy')} style={{ width: 200 }} />,
)}
</Form.Item>
</Col>
......@@ -160,7 +173,7 @@ class StudentAddForm extends React.Component {
// },
],
})(
<InputNumber min={0} style={{ width: 200 }} />,
<InputNumber min={0} onBlur={e => this.changeValue(e, 'give')} style={{ width: 200 }} />,
)}
</Form.Item>
</Col>
......
......@@ -772,7 +772,7 @@ class StudentMgt extends React.Component {
</div>
<div className={pageStyle.table}>
<div className={pageStyle.title}>
<Tabs defaultActiveKey="1" onChange={this.tabChange}>
<Tabs defaultActiveKey="1" animated={false} onChange={this.tabChange}>
<TabPane tab="报读课程" key="1">
<div className={pageStyle.tabsbtn}>
<Button type={currentCourseQueryParams.type == 1 ? 'primary' : ''} style={{ marginRight: '15px' }} onClick={() => this.HistoryRead(1)}>当前报读课程</Button>
......
......@@ -375,6 +375,9 @@ class teachersForm extends React.Component {
},
});
}
disabledDate = (current) => {
return current && current > moment();
}
closeChangeSchedule = () => {
const { dispatch } = this.props;
dispatch({
......@@ -1080,8 +1083,13 @@ class teachersForm extends React.Component {
>
<Col xs={{ span: 24 }} sm={{ span: 24 }} md={{ span: 8 }} lg={{ span: 5 }} xl={{ span: 5 }}>
<FormItem {...formItemLayout} label="上课时间">
{getFieldDecorator('time', { initialValue: '' })(
<RangePicker style={{ width: '100%' }} />,
{getFieldDecorator('time', {
initialValue: [null, moment(moment().format('YYYY-MM-DD'))],
})(
<RangePicker
disabledDate={this.disabledDate}
style={{ width: '100%' }}
/>,
)}
</FormItem>
</Col>
......
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