PCqiandao
杨树林 5 years ago
parent a1c9a24cde
commit f6c7b00724

@ -61,6 +61,7 @@
"postcss-loader": "2.0.8", "postcss-loader": "2.0.8",
"promise": "8.0.1", "promise": "8.0.1",
"prop-types": "^15.6.1", "prop-types": "^15.6.1",
"qrcode.react": "^1.0.0",
"qs": "^6.6.0", "qs": "^6.6.0",
"quill": "^1.3.7", "quill": "^1.3.7",
"quill-delta-to-html": "^0.11.0", "quill-delta-to-html": "^0.11.0",

@ -113,7 +113,7 @@ class Teaccomponent extends Component{
attendance_id:attendance_id, attendance_id:attendance_id,
code:code, code:code,
} }
this.props.GotomQrcodesodesy(data,true)
}else if(attendance_mode==="NUMBER"){ }else if(attendance_mode==="NUMBER"){
//数字签到 //数字签到
data={ data={
@ -121,6 +121,7 @@ class Teaccomponent extends Component{
attendance_id:attendance_id, attendance_id:attendance_id,
code:code, code:code,
} }
this.props.Gotomodes(data,true)
} }

@ -1,12 +1,11 @@
import React,{ Component } from "react"; import React,{ Component } from "react";
import { Modal , Button} from 'antd'; import { Modal , Button} from 'antd';
import QRCode from 'qrcode.react';
class Qrcodesignin extends Component { class Qrcodesignin extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
} }
render() { render() {
const leftbuton={ const leftbuton={
@ -33,7 +32,11 @@ class Qrcodesignin extends Component {
<div> <div>
<div className={" marginauto clearfix edu-txt-center"}> <div className={" marginauto clearfix edu-txt-center"}>
<a><img alt="example" src="https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png" style={{"width": "100%"}} /></a> <QRCode
value={this.props.Qrcodesignintypedata.code} //value参数为生成二维码的链接
size={200} //二维码的宽高尺寸
fgColor="#000000" //二维码的颜色
/>
</div> </div>
@ -43,13 +46,13 @@ class Qrcodesignin extends Component {
<div className={"mt20 marginauto clearfix edu-txt-center"}> <div className={"mt20 marginauto clearfix edu-txt-center"}>
<a> <a>
<Button type="primary" ghost style={leftbuton}> <Button type="primary" ghost style={leftbuton} onClick={()=>this.props.GotomQrcodesodesy(null,false)}>
取消 取消
</Button> </Button>
</a> </a>
<a> <a>
<Button type="primary" className={"ml20"} style={rightbuton}> <Button type="primary" className={"ml20"} style={rightbuton} onClick={()=>this.props.GotomQrcodesodesy(null,false)}>
确定 确定
</Button> </Button>
</a> </a>
@ -71,4 +74,4 @@ class Qrcodesignin extends Component {
export default Qrcodesignin export default Qrcodesignin

@ -1,12 +1,37 @@
import React,{ Component } from "react"; import React,{ Component } from "react";
import { Modal , Form, Input,Button} from 'antd'; import { Modal , Form, Input,Button} from 'antd';
import axios from 'axios';
class Studentssignmodel extends Component { class Studentssignmodel extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
} }
setdatas=()=>{
const url = `/weapps/course_member_attendances.json`;
let data={
code:this.props.Studentssigntypedata.code,
attendance_mode:"NUMBER",
attendance_id:this.props.Studentssigntypedata.attendance_id,
}
axios.post(url, data)
.then((result) => {
if (result.data.status === 0) {
try {
this.props.showNotification(`签到成功`);
}catch (e) {
}
this.props.getsetdatas();
this.props.Gotomodes(null,false)
}else{
this.props.showNotification(result.data.message);
}
}).catch((error) => {
})
}
render() { render() {
const { getFieldDecorator } = this.props.form; const { getFieldDecorator } = this.props.form;
const formItemLayout = { const formItemLayout = {
@ -45,13 +70,13 @@ class Studentssignmodel extends Component {
<div className={"mt20 marginauto clearfix edu-txt-center"}> <div className={"mt20 marginauto clearfix edu-txt-center"}>
<a> <a>
<Button type="primary" ghost style={leftbuton}> <Button type="primary" ghost style={leftbuton} onClick={()=>this.props.Gotomodes(null,false)}>
取消 取消
</Button> </Button>
</a> </a>
<a> <a>
<Button type="primary" className={"ml20"} style={rightbuton}> <Button type="primary" className={"ml20"} style={rightbuton} onClick={()=>this.setdatas()}>
确定 确定
</Button> </Button>
</a> </a>
@ -73,4 +98,4 @@ class Studentssignmodel extends Component {
const Studentssignmodels = Form.create({ name: 'Studentssignmodel' })(Studentssignmodel); const Studentssignmodels = Form.create({ name: 'Studentssignmodel' })(Studentssignmodel);
export default Studentssignmodels export default Studentssignmodels

@ -25,6 +25,10 @@ class Students_signin extends Component{
normal_count:0, normal_count:0,
leave_count:0, leave_count:0,
absence_count:0, absence_count:0,
Studentssigntype:false,
Studentssigntypedata:null,
Qrcodesignintype:false,
Qrcodesignintypedata:null,
} }
} }
@ -136,10 +140,47 @@ class Students_signin extends Component{
this.gogetdatas(data); this.gogetdatas(data);
} }
Gotomodes(data,bool){
if(bool===true){
this.setState({
Studentssigntypedata:data,
Studentssigntype:true
})
}else{
this.setState({
Studentssigntype:false,
Studentssigntypedata:null,
})
}
}
GotomQrcodesodesy(data,bool){
if(bool===true){
this.setState({
Qrcodesignintype:false,
Qrcodesignintypedata:data,
})
}else{
this.setState({
Qrcodesignintype:false,
Qrcodesignintypedata:null,
})
}
}
render(){ render(){
let {page,per_page,count,defaultActiveKey,limit,attendances_count,datas,absence_count,leave_count,normal_count} =this.state; let {page,per_page,count,defaultActiveKey,limit,attendances_count,datas,absence_count,leave_count,normal_count,
Studentssigntype,Studentssigntypedata,Qrcodesignintype,Qrcodesignintypedata,
} =this.state;
const isAdmin =this.props.isAdmin(); const isAdmin =this.props.isAdmin();
return( return(
@ -155,11 +196,19 @@ class Students_signin extends Component{
<Studentssignmodels <Studentssignmodels
{...this.state} {...this.state}
{...this.props} {...this.props}
Studentssigntype={Studentssigntype}
Studentssigntypedata={Studentssigntypedata}
Gotomodes={(d,b)=>this.Gotomodes(d,b)}
getsetdatas={()=>this.getsetdatas()}
/> />
{/*二维码*/} {/*二维码*/}
<Qrcodesignin <Qrcodesignin
{...this.state} {...this.state}
{...this.props} {...this.props}
Qrcodesignintype={Qrcodesignintype}
Qrcodesignintypedata={Qrcodesignintypedata}
getsetdatas={()=>this.getsetdatas()}
GotomQrcodesodesy={(d,b)=>this.GotomQrcodesodesy(d,b)}
/> />
<div className="clearfix yslmaxheigthk" > <div className="clearfix yslmaxheigthk" >
@ -169,7 +218,14 @@ class Students_signin extends Component{
<Tabs defaultActiveKey="1" onChange={this.callback}> <Tabs defaultActiveKey="1" onChange={this.callback}>
<TabPane tab="正在签到" key="1"> <TabPane tab="正在签到" key="1">
<p className="mt20 mysligtes">{attendances_count}个签到正在进行</p> <p className="mt20 mysligtes">{attendances_count}个签到正在进行</p>
<Teaccomponent getsetdatas={()=>this.getsetdatas()} datas={datas} defaultActiveKey={defaultActiveKey} {...this.state} {...this.props} <Teaccomponent
Gotomodes={(d,b)=>this.Gotomodes(d,b)}
GotomQrcodesodesy={(d,b)=>this.GotomQrcodesodesy(d,b)}
getsetdatas={()=>this.getsetdatas()}
datas={datas}
defaultActiveKey={defaultActiveKey}
{...this.state}
{...this.props}
></Teaccomponent> ></Teaccomponent>
@ -199,7 +255,15 @@ class Students_signin extends Component{
<Teaccomponent getsetdatas={()=>this.getsetdatas()} datas={datas} defaultActiveKey={defaultActiveKey} {...this.state} {...this.props}></Teaccomponent> <Teaccomponent
Gotomodes={(d,b)=>this.Gotomodes(d,b)}
GotomQrcodesodesy={(d,b)=>this.GotomQrcodesodesy(d,b)}
getsetdatas={()=>this.getsetdatas()}
datas={datas}
defaultActiveKey={defaultActiveKey}
{...this.state}
{...this.props}
></Teaccomponent>
<div className="mb30 clearfix educontent mt40 intermediatecenter"> <div className="mb30 clearfix educontent mt40 intermediatecenter">

Loading…
Cancel
Save