PCqiandao
parent
c5bac09491
commit
ef061d4be8
@ -0,0 +1,105 @@
|
|||||||
|
import React,{ Component } from "react";
|
||||||
|
|
||||||
|
import { Modal , Form, Input,Button} from 'antd';
|
||||||
|
import axios from 'axios';
|
||||||
|
|
||||||
|
class Signinname extends Component {
|
||||||
|
constructor(props) {
|
||||||
|
super(props)
|
||||||
|
}
|
||||||
|
setdatas=()=>{
|
||||||
|
this.props.form.validateFields((err, values) => {
|
||||||
|
if (!err) {
|
||||||
|
const url = `/weapps/attendances/${this.props.switattendance_id}.json`;
|
||||||
|
let data={
|
||||||
|
name:values.name,
|
||||||
|
}
|
||||||
|
axios.put(url, data)
|
||||||
|
.then((result) => {
|
||||||
|
if (result.data.status === 0) {
|
||||||
|
try {
|
||||||
|
this.props.showNotification(`修改成功`);
|
||||||
|
}catch (e) {
|
||||||
|
|
||||||
|
}
|
||||||
|
this.props.getsetdatas();
|
||||||
|
this.props.Signinnamestypes(null,false,"")
|
||||||
|
}else{
|
||||||
|
this.props.showNotification(result.data.message);
|
||||||
|
|
||||||
|
}
|
||||||
|
}).catch((error) => {
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
render() {
|
||||||
|
const { getFieldDecorator } = this.props.form;
|
||||||
|
const formItemLayout = {
|
||||||
|
wrapperCol: { span: 25},
|
||||||
|
};
|
||||||
|
|
||||||
|
const leftbuton={
|
||||||
|
"width":"130px",
|
||||||
|
"height":"40px",
|
||||||
|
"border":"1px solid rgba(76,172,255,1)",
|
||||||
|
"border-radius":"4px",
|
||||||
|
}
|
||||||
|
|
||||||
|
const rightbuton={
|
||||||
|
"width":"130px",
|
||||||
|
"height":"40px",
|
||||||
|
"background":"#4CACFF",
|
||||||
|
"border-radius":"4px",
|
||||||
|
}
|
||||||
|
return(
|
||||||
|
<React.Fragment>
|
||||||
|
{this.props.Signinnamestype?<Modal
|
||||||
|
title="提示"
|
||||||
|
visible={this.props.Signinnamestype}
|
||||||
|
closable={false}
|
||||||
|
footer={null}
|
||||||
|
>
|
||||||
|
|
||||||
|
<Form {...formItemLayout}>
|
||||||
|
|
||||||
|
<Form.Item>
|
||||||
|
{getFieldDecorator('name', {initialValue: this.props.mybianjiname,
|
||||||
|
rules: [{ required: true, message: '请输入签到名称' }],
|
||||||
|
})(<Input placeholder="请输入签到名称"/>)}
|
||||||
|
</Form.Item>
|
||||||
|
|
||||||
|
<div className={"mt20 marginauto clearfix edu-txt-center"}>
|
||||||
|
<a>
|
||||||
|
<Button type="primary" ghost style={leftbuton} onClick={()=>this.props.Signinnamestypes(null,false,"")}>
|
||||||
|
取消
|
||||||
|
</Button>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<a>
|
||||||
|
<Button type="primary" className={"ml20"} style={rightbuton} onClick={()=>this.setdatas()}>
|
||||||
|
确定
|
||||||
|
</Button>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</Form>
|
||||||
|
</Modal>:""}
|
||||||
|
</React.Fragment>
|
||||||
|
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const Signinnames = Form.create({ name: 'Signinnames' })(Signinname);
|
||||||
|
|
||||||
|
export default Signinnames
|
Loading…
Reference in new issue