import React from 'react';
import { Input, Modal, Form, Select, Button, InputNumber } from 'antd';
const CreateForm = (props) => {
  const { Option, OptGroup } = Select;
  return (
    <Modal
      title={props.values.id ? '编辑' : '新建'}
      width={640}
      visible={props.modalVisible}
      bodyStyle={{ padding: '32px 40px 48px' }}
      footer={null}
      onCancel={() => {
        props.onCancel();
      }}
      destroyOnClose
      maskClosable={false}
    >
      <Form
        layout="horizontal"
        labelCol={{ span: 4 }}
        preserve={false}
        initialValues={props.values}
        onFinish={props.onFinish}
      >
        <Form.Item name="id" hidden={true}>
          <Input />
        </Form.Item>
        <Form.Item name="companyName" label="企业名称" rules={[{ required: true, max: 30 }]}>
          <Input placeholder="请输入企业名称" disabled={true} />
        </Form.Item>
        <Form.Item name="userName" label="联系人" rules={[{ required: true, max: 20 }]}>
          <Input placeholder="请输入联系人" disabled={true} />
        </Form.Item>

        <Form.Item name="phone" label="电话" rules={[{
          max: 20, pattern: /0?(13|14|15|18|17)[0-9]{9}$/,
          message: '手机号格式不正确'
        }]}>
          <Input placeholder="请输入电话" disabled={true} />
        </Form.Item>
        {/* <Form.Item name="StoreNum" label="结算周期" rules={[{ required: true}]}>
          <InputNumber step={1} min={1} max={100}  precision={0} />
        </Form.Item> */}
        <Form.Item name="TMCDeviceNum" label="设备数量" rules={[{ required: true }]}>
          <InputNumber step={1} min={1} max={1000} precision={10} />
        </Form.Item>
        {/* <Form.Item name="UserNum" label="结算周期" rules={[{ required: true}]}>
          <InputNumber step={1} min={1} max={100}  precision={0} />
        </Form.Item> */}
        <Form.Item>
          <Button type="primary" htmlType="submit">
            审核通过
          </Button>
        </Form.Item>
      </Form>
    </Modal>
  );
};

export default CreateForm;
