Commit 75492193 authored by baixian's avatar baixian

优化

parent b7d73d48
...@@ -12,11 +12,11 @@ ...@@ -12,11 +12,11 @@
<![endif]--> <![endif]-->
<script charset="utf-8" src="https://map.qq.com/api/js?v=2.exp&key=XSZBZ-5LHCV-5I2P7-UQHPW-6456F-JBB3B"></script> <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?20191012222" 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>
</head> </head>
<body> <body>
<div id="root"></div> <div id="root"></div>
<script src="https://cdn.img.shangjiadao.cn/qingxiao/biz/dist/main.js?1575613527689" charset="utf-8"></script> <script src="dist/main.js?1576036639318" charset="utf-8"></script>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -105,7 +105,7 @@ class LeaveDetailModal extends React.Component { ...@@ -105,7 +105,7 @@ class LeaveDetailModal extends React.Component {
</div> </div>
<div className={pageStyle.modalBody}> <div className={pageStyle.modalBody}>
<Descriptions> <Descriptions>
<Descriptions.Item label="请假课次" className={pageStyle.size}>{detail.course.title}{moment(detail.schedule.start_time).format('YYYY-MM-DD HH:mm')}~{moment(detail.schedule.end_time).format('HH:mm')}</Descriptions.Item> <Descriptions.Item label="请假课次" className={pageStyle.size}>{detail.course.title}&nbsp;&nbsp;{detail.schedule && `${moment(detail.schedule.start_time).format('YYYY-MM-DD HH:mm')}~${moment(detail.schedule.end_time).format('HH:mm')}`}</Descriptions.Item>
</Descriptions> </Descriptions>
<Descriptions> <Descriptions>
<Descriptions.Item label="请假原因" className={pageStyle.size}>{detail.content}</Descriptions.Item> <Descriptions.Item label="请假原因" className={pageStyle.size}>{detail.content}</Descriptions.Item>
...@@ -116,17 +116,13 @@ class LeaveDetailModal extends React.Component { ...@@ -116,17 +116,13 @@ class LeaveDetailModal extends React.Component {
<div className={pageStyle.formBox}> <div className={pageStyle.formBox}>
<Form layout="inline" labelAlign="right" onSubmit={this.handleSubmit}> <Form layout="inline" labelAlign="right" onSubmit={this.handleSubmit}>
<FormItem label="额外扣除课时"> <FormItem label="额外扣除课时">
{getFieldDecorator('expend', {getFieldDecorator('expend')(
{ <InputNumber
rules: [{ required: true, message: '请输入额外扣除课时' }], min={0}
}, onBlur={e => this.expendChange(e)}
)( style={{ width: 200 }}
<InputNumber placeholder="请输入额外扣除课时"
min={0} />,
onBlur={e => this.expendChange(e)}
style={{ width: 200 }}
placeholder="请输入额外扣除课时"
/>,
)} )}
</FormItem> </FormItem>
<div className={pageStyle.btnList}> <div className={pageStyle.btnList}>
...@@ -146,10 +142,15 @@ class LeaveDetailModal extends React.Component { ...@@ -146,10 +142,15 @@ class LeaveDetailModal extends React.Component {
</Descriptions> </Descriptions>
{detail.status === 2 && {detail.status === 2 &&
<Descriptions> <Descriptions>
<Descriptions.Item label="撤销时间" className={pageStyle.size1}>{detail.handled_at}</Descriptions.Item> <Descriptions.Item label="撤销时间" className={pageStyle.size1}>{detail.handled_at || '-'}</Descriptions.Item>
</Descriptions> </Descriptions>
} }
{(detail.status === 3 || detail.status === 4) && {(detail.status === 3 || detail.status === 4) &&
<Descriptions>
<Descriptions.Item label="审批时间" className={pageStyle.size1}>{detail.handled_at || '-'}</Descriptions.Item>
</Descriptions>
}
{(detail.status === 3 || detail.status === 4) &&
<Descriptions> <Descriptions>
<Descriptions.Item label="审批人" className={pageStyle.size1}>{detail.operator && detail.operator.nickname}</Descriptions.Item> <Descriptions.Item label="审批人" className={pageStyle.size1}>{detail.operator && detail.operator.nickname}</Descriptions.Item>
</Descriptions> </Descriptions>
......
...@@ -79,6 +79,7 @@ export default { ...@@ -79,6 +79,7 @@ export default {
leaveList: [], leaveList: [],
leaveTotal: 0, leaveTotal: 0,
leaveSubmitLoading: false, leaveSubmitLoading: false,
leaveNum: 0,
}, },
subscriptions: { subscriptions: {
setup({ dispatch, history }) { // eslint-disable-line setup({ dispatch, history }) { // eslint-disable-line
...@@ -620,6 +621,26 @@ export default { ...@@ -620,6 +621,26 @@ export default {
}); });
} }
}, },
* queryLeaveTotal({ payload }, { call, put, select }) {
const { sid } = yield select(state => state.webapp);
const { leaveNum } = yield select(state => state.indexstaic);
const data = yield call(leaveAjax.getLeaveList, {
school_id: sid,
status: 1,
});
let newTotal = leaveNum;
if (data.code === 200) {
if (data.data.total != undefined) {
newTotal = data.data.total;
}
yield put({
type: 'updateState',
payload: {
leaveNum: newTotal,
},
});
}
},
* queryLeaveDetail({ payload }, { call, put, select }) { * queryLeaveDetail({ payload }, { call, put, select }) {
const { id } = payload; const { id } = payload;
const data = yield call(leaveAjax.getDetail, { const data = yield call(leaveAjax.getDetail, {
...@@ -740,6 +761,7 @@ export default { ...@@ -740,6 +761,7 @@ export default {
leaveList: [], leaveList: [],
leaveTotal: 0, leaveTotal: 0,
leaveSubmitLoading: false, leaveSubmitLoading: false,
leaveNum: 0,
}); });
}, },
}, },
......
...@@ -75,7 +75,7 @@ export default { ...@@ -75,7 +75,7 @@ export default {
wechat_status: '', wechat_status: '',
assign_class_status: '', assign_class_status: '',
schedule_id: '', schedule_id: '',
extra: 'time,recently_course', extra: 'time,recently_course,leaves_count ',
birthday_start: '', birthday_start: '',
birthday_end: '', birthday_end: '',
status: 1, status: 1,
...@@ -96,7 +96,7 @@ export default { ...@@ -96,7 +96,7 @@ export default {
wechat_status: '', wechat_status: '',
assign_class_status: '', assign_class_status: '',
schedule_id: '', schedule_id: '',
extra: 'time,recently_course', extra: 'time,recently_course,leaves_count ',
birthday_start: '', birthday_start: '',
birthday_end: '', birthday_end: '',
}, },
...@@ -1185,7 +1185,7 @@ export default { ...@@ -1185,7 +1185,7 @@ export default {
wechat_status: '', wechat_status: '',
assign_class_status: '', assign_class_status: '',
schedule_id: '', schedule_id: '',
extra: 'time,recently_course', extra: 'time,recently_course,leaves_count ',
birthday_start: '', birthday_start: '',
birthday_end: '', birthday_end: '',
status: 1, status: 1,
...@@ -1206,7 +1206,7 @@ export default { ...@@ -1206,7 +1206,7 @@ export default {
wechat_status: '', wechat_status: '',
assign_class_status: '', assign_class_status: '',
schedule_id: '', schedule_id: '',
extra: 'time,recently_course', extra: 'time,recently_course,leaves_count ',
birthday_start: '', birthday_start: '',
birthday_end: '', birthday_end: '',
}, },
......
...@@ -146,6 +146,9 @@ export default { ...@@ -146,6 +146,9 @@ export default {
dispatch({ dispatch({
type: 'indexstaic/queryinfo', type: 'indexstaic/queryinfo',
}); });
dispatch({
type: 'indexstaic/queryLeaveTotal',
});
dispatch({ dispatch({
type: 'indexstaic/call', type: 'indexstaic/call',
}); });
......
...@@ -152,7 +152,13 @@ class StudentLeaveModal extends React.Component { ...@@ -152,7 +152,13 @@ class StudentLeaveModal extends React.Component {
return ( return (
<div> <div>
<span>{text}</span> <br /> <span>{text}</span> <br />
<span> {moment(record.schedule.start_time).format('YYYY-MM-DD HH:mm')}~{moment(record.schedule.end_time).format('HH:mm')}</span> <span>
{
record.schedule ?
`${moment(record.schedule.start_time).format('YYYY-MM-DD HH:mm')}~${moment(record.schedule.end_time).format('HH:mm')}`
: '-'
}
</span>
</div> </div>
); );
}, },
......
...@@ -657,10 +657,19 @@ class StaticCenter extends React.Component { ...@@ -657,10 +657,19 @@ class StaticCenter extends React.Component {
} }
// 请假弹框 // 请假弹框
goLeaveShow = () => { goLeaveShow = () => {
const { dispatch, leaveTotal } = this.props; const { dispatch, leaveNum } = this.props;
if (leaveTotal === 0) { if (leaveNum === 0) {
message.warning('当前暂无学员请假喔'); dispatch({
return; type: 'indexstaic/queryLeaveList',
payload: {
params: {
status: '',
page: 1,
perPage: 10,
name: '',
},
},
});
} }
dispatch({ dispatch({
type: 'indexstaic/updateState', type: 'indexstaic/updateState',
...@@ -708,6 +717,7 @@ class StaticCenter extends React.Component { ...@@ -708,6 +717,7 @@ class StaticCenter extends React.Component {
studentChangeScheduleListQueryParams, studentChangeScheduleListQueryParams,
leaveVisible, leaveVisible,
leaveTotal, leaveTotal,
leaveNum,
} = this.props; } = this.props;
const studentChangeScheduleColumns = [ const studentChangeScheduleColumns = [
{ {
...@@ -959,7 +969,7 @@ class StaticCenter extends React.Component { ...@@ -959,7 +969,7 @@ class StaticCenter extends React.Component {
<Col xs={{ span: 8, offset: 0 }} sm={{ span: 8, offset: 0 }} md={{ span: 4, offset: 0 }} lg={{ span: 4, offset: 0 }} xl={{ span: 4, offset: 0 }}> <Col xs={{ span: 8, offset: 0 }} sm={{ span: 8, offset: 0 }} md={{ span: 4, offset: 0 }} lg={{ span: 4, offset: 0 }} xl={{ span: 4, offset: 0 }}>
<div className={pageStyle.informItem} onClick={this.goLeaveShow}> <div className={pageStyle.informItem} onClick={this.goLeaveShow}>
<div className={pageStyle.informImg} id="index_paywarn"><img src={`${__IMGCDN__}index/inform_icon6.png`} alt="" /> <div className={pageStyle.informImg} id="index_paywarn"><img src={`${__IMGCDN__}index/inform_icon6.png`} alt="" />
<Badge className={pageStyle.informNum} overflowCount={999} count={leaveTotal}> <Badge className={pageStyle.informNum} overflowCount={999} count={leaveNum}>
</Badge> </Badge>
</div> </div>
<div className={pageStyle.informTip}>请假提醒</div> <div className={pageStyle.informTip}>请假提醒</div>
...@@ -1070,6 +1080,7 @@ function mapStateToProps(state) { ...@@ -1070,6 +1080,7 @@ function mapStateToProps(state) {
datetime, datetime,
leaveVisible, leaveVisible,
leaveTotal, leaveTotal,
leaveNum,
} = state.indexstaic; } = state.indexstaic;
// eslint-disable-next-line no-empty-pattern // eslint-disable-next-line no-empty-pattern
const {} = state.createtheme; const {} = state.createtheme;
...@@ -1154,6 +1165,7 @@ function mapStateToProps(state) { ...@@ -1154,6 +1165,7 @@ function mapStateToProps(state) {
guideShow, guideShow,
leaveVisible, leaveVisible,
leaveTotal, leaveTotal,
leaveNum,
}; };
} }
export default connect(mapStateToProps)(StaticCenter); export default connect(mapStateToProps)(StaticCenter);
......
...@@ -866,9 +866,9 @@ class StudentMgt extends React.Component { ...@@ -866,9 +866,9 @@ class StudentMgt extends React.Component {
key: 'surplus', key: 'surplus',
}, },
{ {
title: '缺课次数', title: '请假次数',
dataIndex: 'truancy_count', dataIndex: 'leaves_count',
key: 'truancy_count', key: 'leaves_count',
}, },
{ {
title: '操作', title: '操作',
......
...@@ -893,6 +893,8 @@ class StudentMgt extends React.Component { ...@@ -893,6 +893,8 @@ class StudentMgt extends React.Component {
return <div className={pageStyle.logitem}> {item.created_at} 老师:<span className={pageStyle.logTeacherName}>{item.data.teacher_name || '-'}</span> 为学员:<span className={pageStyle.logTeacherName}>{item.data.student_name || '-'}</span>转为<span className={pageStyle.logAction}>历史在读学员</span> &nbsp;{Number(item.data.stat_time_status) === 1 ? '没有清除' : '并清除'}<span className={pageStyle.logTeacherName}>{item.data.student_name || '-'}</span>在机构中的历史课程数据</div>; return <div className={pageStyle.logitem}> {item.created_at} 老师:<span className={pageStyle.logTeacherName}>{item.data.teacher_name || '-'}</span> 为学员:<span className={pageStyle.logTeacherName}>{item.data.student_name || '-'}</span>转为<span className={pageStyle.logAction}>历史在读学员</span> &nbsp;{Number(item.data.stat_time_status) === 1 ? '没有清除' : '并清除'}<span className={pageStyle.logTeacherName}>{item.data.student_name || '-'}</span>在机构中的历史课程数据</div>;
case 12: case 12:
return <div className={pageStyle.logitem}> {item.created_at} 老师:<span className={pageStyle.logTeacherName}>{item.data.teacher_name || '-'}</span> 为学员:<span className={pageStyle.logTeacherName}>{item.data.student_name || '-'}</span>转为<span className={pageStyle.logAction}>在读学员</span></div>; return <div className={pageStyle.logitem}> {item.created_at} 老师:<span className={pageStyle.logTeacherName}>{item.data.teacher_name || '-'}</span> 为学员:<span className={pageStyle.logTeacherName}>{item.data.student_name || '-'}</span>转为<span className={pageStyle.logAction}>在读学员</span></div>;
case 13:
return <div className={pageStyle.logitem}> {item.created_at} 老师:<span className={pageStyle.logTeacherName}>{item.data.teacher_name || '-'}</span> <span className={pageStyle.logAction}>额外扣除请假学员</span><span className={pageStyle.logTeacherName}>{item.data.student_name || '-'}</span>&nbsp;&nbsp;{item.data.expend}课时<span className={pageStyle.logTeacherName}>({item.data.course_title || '-'})</span> </div>;
default: return null; default: return null;
} }
})()} })()}
......
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