PCqiandao
杨树林 5 years ago
parent 2f0ea73e66
commit 103c0f39a4

@ -42,11 +42,11 @@ if (isDev) {
window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin' window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin'
} }
// 超管 // 超管
debugType="admin"; // debugType="admin";
// 老师 // 老师
// debugType="teacher"; // debugType="teacher";
// 学生 // 学生
// debugType="student"; debugType="student";

@ -112,10 +112,24 @@ class Teacherentry extends Component {
( (
this.props.defaultActiveKey === "1" ? this.props.defaultActiveKey === "1" ?
<div className="ws100s xaxisreverseorder"> <div className="ws100s xaxisreverseorder">
{
item.attendance_status?
(
item.attendance_status==="ABSENCE"?
<div className="qiandaobutton xiaoshou" onClick={()=>this.props.Signin(item.mode,item.id,item.attendance_code)}>
签到
</div>
:
item.attendance_status==="NORMAL"?
<div className="qiandaobutton" >
正常签到
</div>
:""
)
:
""
}
<div className="qiandaobutton xiaoshou" onClick={()=>this.props.Signin(item.mode,item.id,item.attendance_code)}>
签到
</div>
</div> </div>
: :
<div className="ws100s xaxisreverseorder"> <div className="ws100s xaxisreverseorder">

@ -4,8 +4,9 @@ import axios from 'axios';
import Teacherentry from "../Teacherentry"; import Teacherentry from "../Teacherentry";
import NoneDatas from '../NoneDatas'; import NoneDatas from '../NoneDatas';
import LoadingSpin from '../../../../../common/LoadingSpin'; import LoadingSpin from '../../../../../common/LoadingSpin';
import { Modal, Button } from 'antd';
import Listjihe from "../../../../question/component/Listjihe"; const { confirm } = Modal;
//在线学习 //在线学习
class Teaccomponent extends Component{ class Teaccomponent extends Component{
@ -34,55 +35,76 @@ class Teaccomponent extends Component{
} }
//截止 //截止
thisEnd=(attendance_id)=>{ thisEnd=(attendance_id)=>{
const url = `/weapps/attendances/${attendance_id}/end.json`;
var data={
} confirm({
axios.post(url, data) title: '提示',
.then((result) => { content: '确认截止此签到吗?',
if (result.data.status === 0) { onOk() {
// try { const url = `/weapps/attendances/${attendance_id}/end.json`;
// this.props.showNotification(`截止成功`); var data={
// }catch (e) {
//
// }
this.props.getsetdatas();
}else{
this.props.showNotification(result.data.message);
} }
}).catch((error) => { axios.post(url, data)
//console.log(error); .then((result) => {
}) if (result.data.status === 0) {
// try {
// this.props.showNotification(`截止成功`);
// }catch (e) {
//
// }
this.props.getsetdatas();
}else{
this.props.showNotification(result.data.message);
}
}).catch((error) => {
//console.log(error);
})
},
onCancel() {
},
});
} }
//删除 //删除
thisdelete=(attendance_id)=>{ thisdelete=(attendance_id)=>{
const url = `/weapps/attendances/${attendance_id}.json`; confirm({
var data={ title: '提示',
content: '确认删除此签到吗?',
} onOk () {
axios.delete(url, data) const url = `/weapps/attendances/${attendance_id}.json`;
.then((result) => { var data={
if (result.data.status === 0) {
// try {
// this.props.showNotification(`删除成功`);
// }catch (e) {
//
// }
this.props.getsetdatas();
}else{
this.props.showNotification(result.data.message);
} }
}).catch((error) => { axios.delete(url, data)
//console.log(error); .then((result) => {
}) if (result.data.status === 0) {
try {
this.props.showNotification(`删除成功`);
}catch (e) {
}
this.props.getsetdatas();
}else{
this.props.showNotification(result.data.message);
}
}).catch((error) => {
//console.log(error);
})
},
onCancel() {
},
});
} }
//学生签到 //学生签到
Signin=(attendance_mode,attendance_id,code)=>{ Signin=(attendance_mode,attendance_id,code)=>{
debugger
const url = `/weapps/course_member_attendances.json`; const url = `/weapps/course_member_attendances.json`;
var data={ var data={

Loading…
Cancel
Save