From 5e08dc6bf3a8987b12901c1a394ff5c4b52804e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Fri, 13 Mar 2020 15:48:47 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AD=BE=E5=88=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/signin/model/Studentssignmodel.js | 48 +++++++++++-------- 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/public/react/src/modules/courses/signin/model/Studentssignmodel.js b/public/react/src/modules/courses/signin/model/Studentssignmodel.js index 32ece78b1..7650d103d 100644 --- a/public/react/src/modules/courses/signin/model/Studentssignmodel.js +++ b/public/react/src/modules/courses/signin/model/Studentssignmodel.js @@ -8,28 +8,34 @@ class Studentssignmodel extends Component { 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); - + this.props.form.validateFields((err, values) => { + if (!err) { + const url = `/weapps/course_member_attendances.json`; + let data={ + code:values.name, + attendance_mode:"NUMBER", + attendance_id:this.props.Studentssigntypedata.attendance_id, } - }).catch((error) => { - }) + 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() {