ttk-server-parent
Version:
62 lines (54 loc) • 1.83 kB
JavaScript
import React from 'react'
import { Form, DatePicker, Radio, Button } from 'edf-component'
import moment from 'moment'
const FormItem = Form.Item
const RadioGroup = Radio.Group;
const MonthPicker = DatePicker.MonthPicker
class ResetArApAccount extends React.Component{
constructor(props){
super(props)
this.state = {
radio: true
}
}
componentDidMount = () => {
if(this.props.initData){
this.setState({
radio: this.props.initData.resetArApAccount
})
}
}
dateChange =( key, value ) => {
this.setState({
[key]: value
})
}
getValue= () => {
return this.state
}
confirm = async () => {
await this.props.closeModal()
await this.props.callBack({ resetArApAccount: this.state.radio})
}
cancel = () => {
this.props.closeModal()
}
render(){
const { radio } = this.state
return (
<div className="resetArApAccount" id="resetArApAccount" style = {{padding: '20px 20px'}}>
<FormItem label={'往来项目重分类'} style={{display:'flex'}}>
<RadioGroup value={radio} onChange={(e)=>this.dateChange('radio', e.target.value)} >
<Radio value={true} >重分类</Radio>
<Radio value={false} >不重分类</Radio>
</RadioGroup>
</FormItem>
<div style={{ width: '100%', textAlign: 'center' }}>
<Button onClick={this.cancel}>取消</Button>
<Button style={{marginLeft: '8px'}} type='primary' onClick={this.confirm}>确定</Button>
</div>
</div>
)
}
}
export default ResetArApAccount