Commit 75492193 authored by baixian's avatar baixian

优化

parent b7d73d48
......@@ -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?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>
<body>
<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>
</html>
\ No newline at end of file
......@@ -105,7 +105,7 @@ class LeaveDetailModal extends React.Component {
</div>
<div className={pageStyle.modalBody}>
<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.Item label="请假原因" className={pageStyle.size}>{detail.content}</Descriptions.Item>
......@@ -116,17 +116,13 @@ class LeaveDetailModal extends React.Component {
<div className={pageStyle.formBox}>
<Form layout="inline" labelAlign="right" onSubmit={this.handleSubmit}>
<FormItem label="额外扣除课时">
{getFieldDecorator('expend',
{
rules: [{ required: true, message: '请输入额外扣除课时' }],
},
)(
<InputNumber
min={0}
onBlur={e => this.expendChange(e)}
style={{ width: 200 }}
placeholder="请输入额外扣除课时"
/>,
{getFieldDecorator('expend')(
<InputNumber
min={0}
onBlur={e => this.expendChange(e)}
style={{ width: 200 }}
placeholder="请输入额外扣除课时"
/>,
)}
</FormItem>
<div className={pageStyle.btnList}>
......@@ -146,10 +142,15 @@ class LeaveDetailModal extends React.Component {
</Descriptions>
{detail.status === 2 &&
<Descriptions>
<Descriptions.Item label="撤销时间" className={pageStyle.size1}>{detail.handled_at}</Descriptions.Item>
<Descriptions.Item label="撤销时间" className={pageStyle.size1}>{detail.handled_at || '-'}</Descriptions.Item>
</Descriptions>
}
{(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.Item label="审批人" className={pageStyle.size1}>{detail.operator && detail.operator.nickname}</Descriptions.Item>
</Descriptions>
......
......@@ -79,6 +79,7 @@ export default {
leaveList: [],
leaveTotal: 0,
leaveSubmitLoading: false,
leaveNum: 0,
},
subscriptions: {
setup({ dispatch, history }) { // eslint-disable-line
......@@ -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 }) {
const { id } = payload;
const data = yield call(leaveAjax.getDetail, {
......@@ -740,6 +761,7 @@ export default {
leaveList: [],
leaveTotal: 0,
leaveSubmitLoading: false,
leaveNum: 0,
});
},
},
......
......@@ -75,7 +75,7 @@ export default {
wechat_status: '',
assign_class_status: '',
schedule_id: '',
extra: 'time,recently_course',
extra: 'time,recently_course,leaves_count ',
birthday_start: '',
birthday_end: '',
status: 1,
......@@ -96,7 +96,7 @@ export default {
wechat_status: '',
assign_class_status: '',
schedule_id: '',
extra: 'time,recently_course',
extra: 'time,recently_course,leaves_count ',
birthday_start: '',
birthday_end: '',
},
......@@ -1185,7 +1185,7 @@ export default {
wechat_status: '',
assign_class_status: '',
schedule_id: '',
extra: 'time,recently_course',
extra: 'time,recently_course,leaves_count ',
birthday_start: '',
birthday_end: '',
status: 1,
......@@ -1206,7 +1206,7 @@ export default {
wechat_status: '',
assign_class_status: '',
schedule_id: '',
extra: 'time,recently_course',
extra: 'time,recently_course,leaves_count ',
birthday_start: '',
birthday_end: '',
},
......
......@@ -146,6 +146,9 @@ export default {
dispatch({
type: 'indexstaic/queryinfo',
});
dispatch({
type: 'indexstaic/queryLeaveTotal',
});
dispatch({
type: 'indexstaic/call',
});
......
......@@ -152,7 +152,13 @@ class StudentLeaveModal extends React.Component {
return (
<div>
<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>
);
},
......
......@@ -657,10 +657,19 @@ class StaticCenter extends React.Component {
}
// 请假弹框
goLeaveShow = () => {
const { dispatch, leaveTotal } = this.props;
if (leaveTotal === 0) {
message.warning('当前暂无学员请假喔');
return;
const { dispatch, leaveNum } = this.props;
if (leaveNum === 0) {
dispatch({
type: 'indexstaic/queryLeaveList',
payload: {
params: {
status: '',
page: 1,
perPage: 10,
name: '',
},
},
});
}
dispatch({
type: 'indexstaic/updateState',
......@@ -708,6 +717,7 @@ class StaticCenter extends React.Component {
studentChangeScheduleListQueryParams,
leaveVisible,
leaveTotal,
leaveNum,
} = this.props;
const studentChangeScheduleColumns = [
{
......@@ -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 }}>
<div className={pageStyle.informItem} onClick={this.goLeaveShow}>
<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>
</div>
<div className={pageStyle.informTip}>请假提醒</div>
......@@ -1070,6 +1080,7 @@ function mapStateToProps(state) {
datetime,
leaveVisible,
leaveTotal,
leaveNum,
} = state.indexstaic;
// eslint-disable-next-line no-empty-pattern
const {} = state.createtheme;
......@@ -1154,6 +1165,7 @@ function mapStateToProps(state) {
guideShow,
leaveVisible,
leaveTotal,
leaveNum,
};
}
export default connect(mapStateToProps)(StaticCenter);
......
......@@ -866,9 +866,9 @@ class StudentMgt extends React.Component {
key: 'surplus',
},
{
title: '缺课次数',
dataIndex: 'truancy_count',
key: 'truancy_count',
title: '请假次数',
dataIndex: 'leaves_count',
key: 'leaves_count',
},
{
title: '操作',
......
......@@ -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>;
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>;
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;
}
})()}
......
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