import React, { useState,useRef } from 'react';
import { PlusOutlined} from '@ant-design/icons';
import { Modal, Form, Input, Button, Select,Divider,Space,message} from 'antd';
import { AddBomType } from '../service';
const GoodsbomFrom = (props) => {
  const { Option, OptGroup } = Select;

  return (
    <Modal
      title={'关联商品配方'}
      width={640}
      visible={props.createModalVisible}
      bodyStyle={{ padding: '32px 40px 1px 48px' }}
      footer={null}
      onCancel={() => {
        props.onCancel();
      }}
      maskClosable={false}
      destroyOnClose
    >
      <Form labelCol={{ span: 4 }} layout="horizontal" preserve={false} onFinish={props.onFinish}>
     
        <Form.Item name="bomId" label="配方信息" rules={[{ required: true, message: '配方信息' }]}>
          <Select
            showSearch
            mode="multiple"
            optionFilterProp="children"
            placeholder="请选配方信息">
            {props.Bomdata?.map((item, index) => {
              return (
                <Option index={index} value={item.id} key={item.id}>
                  {item.name}
                </Option>
              );
            })}
          </Select>
        </Form.Item>
        <Form.Item>
        <Button  htmlType="button" style={{float:'right',left:10}} onClick={props.onCancel} >
                        取消
                    </Button>
        <Button type="primary" htmlType="submit" style={{float:'right'}} >
                        保存
                    </Button>
        </Form.Item>
      </Form>
    </Modal>
  );
};

export default GoodsbomFrom;
