import React from 'react';
|
// import { Link } from 'react-router-dom';
|
// import { Modal } from 'antd-mobile';
|
// import { Icon } from 'antd';
|
|
import { Form, Row, Col, Input, DatePicker, Button } from 'antd';
|
// import moment from 'moment';
|
const { RangePicker } = DatePicker;
|
|
import './index.scss';
|
|
export default class ToReviewForm extends React.Component {
|
constructor(props) {
|
super(props);
|
this.state = {
|
key: 0
|
};
|
}
|
onReset = () => {
|
this.props.onChange('reset');
|
this.setState(prev => ({
|
key: prev.key + 1
|
}));
|
}
|
|
disabledTimeStart = current => {
|
const { formdata: { endTime } } = this.props;
|
if (!current || !endTime) return false;
|
return current.valueOf() > endTime + 3600 * 1000;
|
}
|
disabledTimeEnd = current => {
|
const { formdata: { startTime } } = this.props;
|
if (!current || !startTime) return false;
|
return current.valueOf() < startTime;
|
}
|
render() {
|
const { onSubmit, onChange } = this.props;
|
return (
|
<Form className="form-main" key={this.state.key}>
|
<Row gutter={16}>
|
<Col span={5}>
|
<Input placeholder="姓名" onPressEnter={onSubmit}
|
onChange={e => onChange('name', e.target.value)} />
|
</Col>
|
<Col span={5}>
|
<Input placeholder="职位" onPressEnter={onSubmit}
|
onChange={e => onChange('upasPostname', encodeURIComponent(e.target.value))} />
|
</Col>
|
<Col span={5}>
|
<Input placeholder="联系方式" onPressEnter={onSubmit}
|
onChange={e => onChange('mobile', encodeURIComponent(e.target.value))} />
|
</Col>
|
<Col span={2}>
|
<Button type="primary" onClick={onSubmit}>查询</Button>
|
</Col>
|
<Col span={2}>
|
<Button onClick={this.onReset}>重置</Button>
|
</Col>
|
</Row>
|
</Form>
|
);
|
}
|
}
|