import React, { useState, useEffect } from 'react';
import { Modal, Form, Input, Button, Select } from 'antd';
const CreateForm = (props) => {
  const { Option, OptGroup } = Select;
  return (
    <Modal
      title={props.values.id ? '编辑' + props.values.orderNumId : '新建退款记录'}
      width={640}
      visible={props.createModalVisible}
      bodyStyle={{ padding: '32px 40px 48px' }}
      footer={null}
      onCancel={() => {
        props.onCancel();
      }}
      destroyOnClose
    >
      <Form
        layout="vertical"
        preserve={false}
        initialValues={props.values}
        onFinish={props.onFinish}
      >
        <Form.Item name="id" hidden={true}>
          <Input />
        </Form.Item>
        <Form.Item name="orderNumId" label="退款单号" rules={[{ required: true }]}>
          <Input placeholder="请输入退款单号" />
        </Form.Item>
        <Form.Item name="refundType" label="退款类型" rules={[{ required: true }]}>
          <Select showArrow placeholder="请选择退款类型" style={{ width: '100%' }}>
            <Option key={1}>帮客户退款</Option>
            <Option key={2}>测试退款</Option>
          </Select>
        </Form.Item>
        <Form.Item name="orderCustomerNumId" label="客户单号">
          <Input placeholder="请输入客户单号" />
        </Form.Item>
        <Form.Item name="remark" label="退款备注" rules={[{ required: true }]}>
          <Input placeholder="请输入退款备注" />
        </Form.Item>
        <Form.Item>
          <Button type="primary" htmlType="submit">
            保存
          </Button>
        </Form.Item>
      </Form>
    </Modal>
  );
};

export default CreateForm;
