import React from 'react';
import ExtendsComponent from '../../../components/ExtendsComponent';
import {
  message,
  notification,
  Form,
  Card,
  Row,
  Col,
  Input,
  Select,
  Radio,
  InputNumber,
  Button,
  Icon,
  DatePicker,
  Divider,
  Upload,
  Spin,
  Modal
} from 'antd';
import {
  SUPPLIER_TYPE_ENUM,
  URL_TYPE_ENUM,
  COLLABORATION_UNIT_ENUM,
  MATERIAL_TYPE_ENUM
} from '../../enums/supplier_enums';
import ReturnPointListField from './components/return-point-list-field';
import DockingInfoField from './components/docking-info-field';
import CapacityInfoField from './components/capacity-info-field';
import PCBCascaderField from './components/pcb-cascader';
import SingleImgUpload from '../../../components/ImgUploader/SingleImgUpload';
import SelectField from '../../../components/FormItem/select-field';
import BrandListField from './components/brand-list-field';
import AddBrand from './components/add-brand';
import { booleanEnumFactory } from '../../enums/common_enums';
import _ from 'lodash';
import moment from 'moment';
import regExp from '../../../utils/regExp';
import req_url from '../../config/req_url';
import { get, post } from '../../../utils/request';
import './styles.less';

const BOOLEAN_ENUM = booleanEnumFactory();
const { TRUE: BOOLEAN_TRUE_ENUM, FALSE: BOOLEAN_FALSE_ENUM } = BOOLEAN_ENUM;

class SupplierEdit extends ExtendsComponent {
  constructor(props) {
    super(props);
    this.need_init_factory_info = true;
    this.factory_info_max_idx = -1;
    this.factory_info_idx_arr = [];
    this.id = props.match ? props.match.params.id : sessionStorage.getItem('supplier.detail.id');
    this.supplier_id = null;

    this.state = {
      mode: props.match ? props.match.params.type: 'add',
      show_others: true,
      fetching: false,
      fetchBrandName: '',
      brandOptions: [],
      modalOption: {
        visible: false,
        title: '',
        modalData: {}
      },
      formOptions: {
        logisticsList: [],
        bankList: [],
        brandList: [],
        styleList: [],
        paintBrandList: [],
        adhesiveList: []
      }
    };
  }
  componentWillMount() {
    const { mode } = this.state;
    if (this.id && (mode === 'detail' || mode === 'edit')) {
      const supplierDetailJson = sessionStorage.getItem(
        `supplier.detail.${this.id}`
      );
      // console.log('componentDidMount', JSON.parse(supplierDetailJson));
      if (!supplierDetailJson) {
        notification.warning({
          message: '提示',
          description: '没有找到对应的供应商信息'
        });
        return false;
      }
      const supplierDetail = JSON.parse(supplierDetailJson);
      console.log('初始值', supplierDetail);
      const { factory_info } = supplierDetail;
      if (Array.isArray(factory_info) && factory_info.length > 0) {
        this.factory_info_max_idx = factory_info.length - 1;
        this.factory_info_idx_arr = factory_info.map((item, index) => index);
      }
      this.supplierDetail = supplierDetail;
    }
  }

  getOptionsAll = arr => {
    arr.forEach(item => {
      const { url, optionsKey } = item;
      get(url, {}).then(resp => {
        this.updateStateData([{ key: 'formOptions', path: optionsKey, value: resp.data || [] }]);
      });
    });
  };

  componentDidMount() {
    const { mode } = this.state;
    this.getOptionsAll([
      {
        url: req_url.supplier.common.logistics_options,
        optionsKey: 'logisticsList'
      },
      { url: req_url.supplier.common.bank_options, optionsKey: 'bankList' },
      { url: req_url.supplier.common.brand_options, optionsKey: 'brandList' },
      { url: req_url.supplier.common.style_options, optionsKey: 'styleList' },
      {
        url: req_url.supplier.common.paint_options,
        optionsKey: 'paintBrandList'
      },
      {
        url: req_url.supplier.common.adhesive_options,
        optionsKey: 'adhesiveList'
      }
    ]);
    this.fetchBrandByName('');
    this.initFormField();
    // console.log('MATERIAL_TYPE_ENUM.OPTIONS', MATERIAL_TYPE_ENUM.OPTIONS.filter(item => item.value !== MATERIAL_TYPE_ENUM.ALL));
  }

  initFormField = () => {
    const { mode } = this.state;
    const form = this.props.form;
    this.factory_info_max_idx = -1;
    this.factory_info_idx_arr = [];
    if (this.id && (mode === 'detail' || mode === 'edit')) {
      let {
        supplier_id,
        type,
        name,
        url,
        url_type,
        is_cooperation = BOOLEAN_FALSE_ENUM,
        docking_info = {},
        contract_return_point = [],
        factory_info = [],
        bank_info = {},
        collaboration_info = {},
        company_info = {},
        goods_info = {},
        other_info = {},
        brand_id
      } = JSON.parse(JSON.stringify(this.supplierDetail));
      this.supplier_id = supplier_id;
      // console.log('did mount contract_return_point', contract_return_point);

      if (!brand_id) {
        brand_id = [];
      }
      if (is_cooperation === BOOLEAN_TRUE_ENUM) {
        // console.log('initFormField is_cooperation true');
        // 渠道对接-合同返点信息
        if (
          !Array.isArray(contract_return_point) ||
          contract_return_point.length === 0
        ) {
          contract_return_point = [
            {
              min_return_point: 0,
              max_return_point: 0,
              return_point: 0
            }
          ];
        }

        // 工厂信息
        if (Array.isArray(factory_info) && factory_info.length > 0) {
          factory_info.forEach((item, index) => {
            this.factory_info_idx_arr.push(index);
            this.factory_info_max_idx = index;
            const {
              capacity,
              capacity_unit,
              receive_province,
              receive_city,
              receive_block,
              send_province,
              send_city,
              send_block
            } = item;
            item.capacity_info = {
              capacity,
              capacity_unit
            };
            item.receive_pcb = [receive_province, receive_city, receive_block];
            item.send_pcb = [send_province, send_city, send_block];
          });
        }
        // 入驻时间信息
        if (collaboration_info) {
          const { collaboration_time } = collaboration_info;
          collaboration_info.collaboration_time = moment(collaboration_time);
        }
      }
      // 对接信息
      let expiration_info;
      if (docking_info) {
        const { expiration_value = 0, expiration_unit = 1 } = docking_info;
        expiration_info = {
          expiration_value,
          expiration_unit
        };
      } else {
        expiration_info = {
          expiration_value: 0,
          expiration_unit: 1
        };
      }

      // 商品信息相关
      if (goods_info && goods_info.images && Array.isArray(goods_info.images)) {
        goods_info.images = (goods_info.images || []).map(item => ({
          uid: new Date().getTime() + Math.round(Math.random() * 1000),
          name: '',
          status: 'done',
          url: item
        }));
      }

      // console.log('did mount factory_info', factory_info);
      // 初始化Form表单

      // form 初始化
      form.getFieldDecorator('docking_info', { initialValue: {} });

      let dynamicFields = {};
      if (is_cooperation === BOOLEAN_TRUE_ENUM) {
        form.getFieldDecorator('expiration_info', { initialValue: {} });
        form.getFieldDecorator('contract_return_point', { initialValue: [] });
        form.getFieldDecorator('factory_info', { initialValue: [] });
        form.getFieldDecorator('bank_info', { initialValue: [] });
        form.getFieldDecorator('collaboration_info', { initialValue: [] });
        form.getFieldDecorator('company_info', { initialValue: {} });
        form.getFieldDecorator('goods_info', { initialValue: {} });
        form.getFieldDecorator('other_info', { initialValue: {} });

        if (type === SUPPLIER_TYPE_ENUM.FACTORY_BRAND) {
          form.getFieldDecorator('brand_id', { initialValue: [] });
        }

        dynamicFields.expiration_info = expiration_info;
        dynamicFields.contract_return_point = contract_return_point;
        dynamicFields.factory_info = factory_info;
        dynamicFields.bank_info = bank_info;
        dynamicFields.collaboration_info = collaboration_info;
        dynamicFields.company_info = company_info;
        dynamicFields.goods_info = goods_info;
        dynamicFields.other_info = other_info;

        if (type === SUPPLIER_TYPE_ENUM.FACTORY_BRAND) {
          dynamicFields.brand_id = brand_id;
        }
      }

      // console.log('setFieldsValue', {
      //   // supplier_id,
      //   // type,
      //   // name,
      //   // url,
      //   // url_type,
      //   // is_cooperation,
      //   // docking_info,
      //   ...dynamicFields,
      // });

      form.setFieldsValue({
        supplier_id,
        type,
        name,
        url,
        url_type,
        is_cooperation,
        docking_info,
        ...dynamicFields
      });
    } else {
      form.setFieldsValue({
        name: '',
        url: '',
        url_type:
          (
            SUPPLIER_TYPE_ENUM.EXTRA[SUPPLIER_TYPE_ENUM.SHOP_BRAND]
              .urlTypeEnumOptions[1] || {}
          ).value || '',
        docking_info: {}
      });
    }
  };

  addFactoryInfo = () => {
    this.factory_info_idx_arr.push(++this.factory_info_max_idx);
    const { getFieldValue, setFieldsValue } = this.props.form;
    const factory_info = getFieldValue('factory_info') || [];
    factory_info.push({
      people_num: 0,
      capacity_info: {
        capacity: 0,
        capacity_unit: 2
      },
      receive_name: '',
      receive_phone: '',
      receive_pcb: [],
      receive_province: '',
      receive_city: '',
      receive_block: '',
      receive_address: '',
      send_province: '',
      send_city: '',
      send_block: '',
      send_address: '',
      logistics: 1,
      is_door_return: 1
    });
    setFieldsValue({ factory_info: factory_info });
  };

  removeFactoryInfo = index => {
    this.factory_info_idx_arr.splice(index, 1);
    const { getFieldValue, setFieldsValue } = this.props.form;
    const factory_info = getFieldValue('factory_info');
    factory_info.splice(index, 1);
    setFieldsValue({ factory_info: factory_info });
  };

  normFile = e => {
    // console.log('Upload event:', e);
    if (Array.isArray(e)) {
      return e;
    }
    return e && e.fileList;
  };

  fetchBrandByName = value => {
    this.updateStateData(
      [
        {
          key: 'fetching',
          value: true
        },
        {
          key: 'fetchBrandName',
          value
        }
      ],
      () => {
        get(req_url.brand.list.get_list, {
          name: value,
          is_page: false
        }).then(resp => {
          if (resp.code === 200) {
            const { list = [] } = resp.data;
            this.updateStateData([
              {
                key: 'brandOptions',
                value: list
              },
              {
                key: 'fetching',
                value: false
              }
            ]);
          }
        });
      }
    );
  };

  handleDeselect = value => {
    // console.log('handleDeselect', { value, option });
    const { getFieldValue, setFieldsValue } = this.props.form;
    const brand_id = getFieldValue('brand_id') || [];
    _.remove(brand_id, id => id === value);
    setFieldsValue({
      brand_id
    });
  };

  handleSelect = value => {
    // console.log('handleSelect', { value, option });
    const { fetchBrandName } = this.state;
    const { getFieldValue, setFieldsValue } = this.props.form;
    const brand_id = getFieldValue('brand_id') || [];
    brand_id.push(value);
    setFieldsValue(
      {
        brand_id
      },
      () => {
        if (fetchBrandName !== '') {
          this.fetchBrandByName('');
        }
      }
    );
  };

  getBrandExtra = () => {
    const { mode } = this.state;
    const is_disabled = mode === 'detail';
    const { fetching = false, brandOptions = [] } = this.state;
    const { getFieldValue } = this.props.form;
    let brand_id = getFieldValue('brand_id') || [];
    let supplier_type = getFieldValue('type') || [];
    // console.log('brandOptions', brandOptions);
    return (
      <div className={'brand-extra'}>
        <div className={'select-field'}>
          <Select
            disabled={is_disabled}
            dropdownClassName={'brand-select'}
            mode='multiple'
            value={brand_id}
            optionLabelProp='label'
            placeholder='选择已有品牌'
            notFoundContent={fetching ? <Spin size='small' /> : null}
            filterOption={false}
            onSearch={this.fetchBrandByName}
            onSelect={this.handleSelect}
            onDeselect={this.handleDeselect}
            checkable={true}
            style={{ width: '100%' }}
          >
            {brandOptions.map(item => (
              <Select.Option key={item.id} value={item.id} label={item.name}>
                <span role='img' aria-label={item.name}>
                  <img
                    src={item.logo}
                    style={{ width: 16, height: 16 }}
                    alt='logo'
                  />
                </span>
                {item.name}
              </Select.Option>
            ))}
          </Select>
        </div>
        {!is_disabled ? (
          <Button
            type='link'
            onClick={() => {
              this.updateStateData([
                {
                  key: 'modalOption',
                  value: {
                    visible: true,
                    title: `添加品牌`,
                    modalData: {}
                  }
                }
              ]);
            }}
          >
            添加品牌
          </Button>
        ) : (
          ''
        )}
      </div>
    );
  };

  resetField = () => {
    // 先将非a.b类型的值（如：is_cooperation ）变化，将a.b的值刷掉
    this.props.form.setFieldsValue(
      {
        is_cooperation: BOOLEAN_FALSE_ENUM,
        type: SUPPLIER_TYPE_ENUM.SHOP_BRAND
      },
      () => {
        this.initFormField();
      }
    );
  };

  handleSubmit = ({ is_draft = false }) => {
    const { mode } = this.state;
    const { getFieldsValue, validateFieldsAndScroll } = this.props.form;
    if (is_draft) {
      let values = getFieldsValue();
      // console.log('handleSubmit', { supplier_id: this.id, mode: this.mode, is_draft, values });
      this.postDispatch({
        mode,
        is_draft,
        supplier_id: this.supplier_id,
        ...values
      });
    } else {
      // 提交时就不考虑is CooperationValidator 为0时 factory_info的数据初始化
      this.need_init_factory_info = false;
      validateFieldsAndScroll((err, values) => {
        if (!err) {
          // console.log('handleSubmit', { supplier_id: this.id, mode: this.mode, is_draft, values });
          this.postDispatch({
            mode,
            is_draft,
            supplier_id: this.supplier_id,
            ...values
          });
        }
      });
    }
  };

  postDispatch = values => {
    const {
      factory_info,
      collaboration_info,
      docking_info,
      expiration_info,
      goods_info,
      ...others
    } = values;
    let params = {};
    if (Array.isArray(factory_info)) {
      factory_info.forEach(item => {
        const { capacity_info, receive_pcb, send_pcb } = item;
        item.capacity = capacity_info.capacity;
        item.capacity_unit = capacity_info.capacity_unit;
        // 收货省市区
        if (Array.isArray(receive_pcb) && receive_pcb.length > 0) {
          let [receive_province, receive_city, receive_block] = receive_pcb;
          item.receive_province = receive_province;
          item.receive_city = receive_city;
          item.receive_block = receive_block;
        }
        // 发货省市区
        if (Array.isArray(send_pcb) && send_pcb.length > 0) {
          let [send_province, send_city, send_block] = send_pcb;
          item.send_province = send_province;
          item.send_city = send_city;
          item.send_block = send_block;
        }

        delete item.capacity_info;
        delete item.receive_pcb;
        delete item.send_pcb;
      });
      params.factory_info = factory_info;
    }
    if (collaboration_info) {
      const { collaboration_time } = collaboration_info;
      if (collaboration_time) {
        collaboration_info.collaboration_time = collaboration_time.format(
          'YYYY-MM-DD'
        );
      }
      params.collaboration_info = collaboration_info;
    }
    if (expiration_info) {
      const { expiration_value, expiration_unit } = expiration_info;
      docking_info.expiration_value = expiration_value;
      docking_info.expiration_unit = expiration_unit;
    }
    params.docking_info = docking_info;

    if (goods_info) {
      const { images } = goods_info;
      goods_info.images = images.map(
        item => item.url || item.response.data.url
      );
      params.goods_info = goods_info;
    }
    // console.log('postDispatch', {
    //   ...params,
    //   ...others,
    // });
    const { mode, is_cooperation, is_draft = true, ...otherParams } = {...params, ...others};
    let url = '';
    if (mode === 'edit') {
      if (is_cooperation === BOOLEAN_TRUE_ENUM) {
        url = is_draft ? req_url.supplier.edit.edit_supplier_draft : req_url.supplier.edit.edit_supplier;
      } else {
        url = is_draft
          ? req_url.supplier.edit.edit_supplier_draft_uncoop
          : req_url.supplier.edit.edit_supplier_uncoop
      }
    }
    if (mode === 'add') {
      if (is_cooperation === BOOLEAN_TRUE_ENUM) {
        url = is_draft ? req_url.supplier.add.add_supplier_draft : req_url.supplier.add.add_supplier;
      } else {
        url = is_draft
          ? req_url.supplier.add.add_supplier_draft_uncoop
          : req_url.supplier.add.add_supplier_uncoop
      }
    }

    post(url, {
      is_cooperation,
      ...otherParams,
    }).then(resp => {
      if (resp.code === 200) {
        message.success('操作成功');
      }
    });
  };

  render() {
    const { mode } = this.state;
    const { getFieldDecorator, getFieldValue } = this.props.form;

    // const supplier_id = getFieldValue('getFieldValue');
    // const contract_return_point = getFieldValue('contract_return_point');

    // console.log('contract_return_point', contract_return_point);
    // console.log('render factory_info', factory_info);

    const FORM_LAYOUT = {
      labelCol: {
        span: 6,
        offset: 2
      },
      wrapperCol: {
        span: 16
      }
    };

    const returnPointValidator = (rule, value, callback) => {
      if (!Array.isArray(value) || value.length === 0) {
        callback('合同返点必填');
      }
      callback();
    };
    const expirationInfoValidator = (rule, value, callback) => {
      if (!value || !value.expiration_value || isNaN(value.expiration_value)) {
        callback('质保期限必填且为大于0的数字');
        return false;
      }
      // console.log('value', value);
      callback();
    };
    const isCooperationValidator = (rule, value, callback) => {
      if (this.need_init_factory_info) {
        // console.log('isCooperationValidator will run');
        const { setFieldsValue } = this.props.form;
        if (value === BOOLEAN_TRUE_ENUM) {
          this.factory_info_idx_arr = [0];
          // const factory_info = getFieldValue('factory_info');
          const factory_info = [
            {
              people_num: 0,
              capacity_info: {
                capacity: 0,
                capacity_unit: 2
              },
              receive_name: '',
              receive_phone: '',
              receive_pcb: [],
              receive_province: '',
              receive_city: '',
              receive_block: '',
              receive_address: '',
              send_province: '',
              send_city: '',
              send_block: '',
              send_address: '',
              logistics: [],
              is_door_return: 1
            }
          ];
          setFieldsValue({ factory_info: factory_info });
        } else {
          this.factory_info_idx_arr = [];
        }
      }
      // console.log('value', value);
      callback();
    };

    const typeValidator = (rule, value, callback) => {
      if (this.need_init_factory_info) {
        let url_type =
          SUPPLIER_TYPE_ENUM.EXTRA[value].urlTypeEnumOptions[0].value;
        setFieldsValue({ url_type });
      }
      callback();
    };

    const is_cooperation = getFieldValue('is_cooperation');
    const docking_info = getFieldValue('docking_info') || {};
    const expiration_info = getFieldValue('expiration_info');
    const factory_info = getFieldValue('factory_info') || [];
    if ((factory_info.length === 0 && mode === 'add') || mode === 'edit') {
      this.factory_info_max_idx = 0;
      this.factory_info_idx_arr = [0];
      factory_info.push({
        people_num: 0,
        capacity_info: {
          capacity: 0,
          capacity_unit: 2
        },
        receive_name: '',
        receive_phone: '',
        receive_pcb: [],
        receive_province: '',
        receive_city: '',
        receive_block: '',
        receive_address: '',
        send_province: '',
        send_city: '',
        send_block: '',
        send_address: '',
        logistics: [],
        is_door_return: 1
      });
    }
    // console.log('render docking_info', docking_info);
    const bank_info = getFieldValue('bank_info') || {};
    const collaboration_info = getFieldValue('collaboration_info') || {};
    const company_info = getFieldValue('company_info') || {};
    const goods_info = getFieldValue('goods_info') || {};
    const other_info = getFieldValue('other_info') || {};
    const brand_id = getFieldValue('brand_id') || [];
    // console.log('render goods_info', goods_info);
    const urlTypeEnumOptions =
      (SUPPLIER_TYPE_ENUM.EXTRA[getFieldValue('type')] || {})
        .urlTypeEnumOptions || [];

    const { show_others, modalOption = {} } = this.state;

    const is_disabled = mode === 'detail';

    return (
      <div>
        <div className={'supplier-form'}>
          <Form {...FORM_LAYOUT}>
            <Card type='inner' title='供应商类型'>
              <Row>
                <Col span={12}>
                  <Form.Item label='类型选择'>
                    {getFieldDecorator('type', {
                      initialValue: SUPPLIER_TYPE_ENUM.SHOP_BRAND,
                      rules: [{ required: true, validator: typeValidator }]
                    })(
                      <Radio.Group disabled={is_disabled}>
                        {SUPPLIER_TYPE_ENUM.OPTIONS.filter(
                          item => item.value
                        ).map(item => {
                          const { label, value } = item;
                          return (
                            <Radio key={value} value={value}>
                              {label}
                            </Radio>
                          );
                        })}
                      </Radio.Group>
                    )}
                  </Form.Item>
                </Col>
              </Row>
            </Card>
            <Card type='inner' title='基本信息'>
              <Row>
                <Col span={12}>
                  <Form.Item label='供应商名称'>
                    {getFieldDecorator('name', {
                      initialValue: '',
                      rules: [{ required: true, message: '供应商名称必填' }]
                    })(
                      <Input
                        disabled={is_disabled}
                        placeholder='输入供应商名称'
                      />
                    )}
                  </Form.Item>
                </Col>
                <Col span={12}>
                  <Form.Item label='是否合作'>
                    {getFieldDecorator('is_cooperation', {
                      initialValue: BOOLEAN_ENUM.FALSE,
                      rules: [
                        { required: true, validator: isCooperationValidator }
                      ]
                    })(
                      <Radio.Group disabled={is_disabled}>
                        <Radio value={BOOLEAN_TRUE_ENUM}>
                          {BOOLEAN_ENUM.EXTRA[BOOLEAN_TRUE_ENUM].label}
                        </Radio>
                        <Radio value={BOOLEAN_FALSE_ENUM}>
                          {BOOLEAN_ENUM.EXTRA[BOOLEAN_FALSE_ENUM].label}
                        </Radio>
                      </Radio.Group>
                    )}
                  </Form.Item>
                </Col>
              </Row>
              <Row>
                <Col span={12}>
                  <Form.Item label='供应商网址'>
                    {getFieldDecorator('url', {
                      initialValue: ''
                    })(
                      <Input
                        disabled={is_disabled}
                        placeholder='输入供应商网址'
                      />
                    )}
                  </Form.Item>
                </Col>
                <Col span={12}>
                  <Form.Item label='网址类型'>
                    {getFieldDecorator('url_type', {
                      initialValue: (urlTypeEnumOptions[1] || {}).value || ''
                    })(
                      <Select disabled={is_disabled}>
                        {urlTypeEnumOptions
                          .filter(item => item.value !== URL_TYPE_ENUM.ALL)
                          .map(item => {
                            const { label, value } = item;
                            return (
                              <Select.Option key={value} value={value}>
                                {label}
                              </Select.Option>
                            );
                          })}
                      </Select>
                    )}
                  </Form.Item>
                </Col>
              </Row>
            </Card>
            {getFieldValue('is_cooperation') === BOOLEAN_TRUE_ENUM ||
            SUPPLIER_TYPE_ENUM.EXTRA[getFieldValue('type')].showDockingInfo ? (
              <Card type='inner' title='渠道对接'>
                <Row>
                  <Col span={12}>
                    <Form.Item label='对接人姓名'>
                      {getFieldDecorator('docking_info.docking_name', {
                        initialValue: docking_info.docking_name || '',
                        rules: [{ required: true, message: '对接人姓名必填' }]
                      })(
                        <Input
                          disabled={is_disabled}
                          placeholder='输入对接人姓名'
                        />
                      )}
                    </Form.Item>
                  </Col>
                  <Col span={12}>
                    <Form.Item label='对接人电话'>
                      {getFieldDecorator('docking_info.docking_phone', {
                        initialValue: docking_info.docking_phone || '',
                        rules: [
                          {
                            required: true,
                            message: '对接人电话不能为空或格式不正确',
                            pattern: regExp.mobile
                          }
                        ]
                      })(
                        <Input
                          disabled={is_disabled}
                          placeholder='输入对接人电话'
                        />
                      )}
                    </Form.Item>
                  </Col>
                </Row>
                {getFieldValue('is_cooperation') === BOOLEAN_TRUE_ENUM && (
                  <Row>
                    <Col span={12}>
                      <Form.Item label='合同返点'>
                        {getFieldDecorator('contract_return_point', {
                          initialValue: [
                            {
                              min_return_point: 0,
                              max_return_point: 0,
                              return_point: 0
                            }
                          ],
                          rules: [
                            { required: true, validator: returnPointValidator }
                          ]
                        })(
                          <ReturnPointListField
                            disabled={is_disabled}
                            currentVal={
                              getFieldValue('contract_return_point') || []
                            }
                            onChange={e => e}
                          />
                        )}
                      </Form.Item>
                    </Col>
                    <Col span={12}>
                      <Form.Item label='质保期限'>
                        {getFieldDecorator('expiration_info', {
                          initialValue: expiration_info || {
                            expiration_value: 0,
                            expiration_unit: 2
                          },
                          rules: [
                            {
                              required: true,
                              validator: expirationInfoValidator
                            }
                          ]
                        })(
                          <DockingInfoField
                            disabled={is_disabled}
                            currentVal={getFieldValue('expiration_info')}
                            onChange={e => e}
                          />
                        )}
                      </Form.Item>
                    </Col>
                  </Row>
                )}
              </Card>
            ) : (
              ''
            )}
            {is_cooperation === BOOLEAN_TRUE_ENUM ? (
              <>
                <Card
                  type='inner'
                  title='供应商信息及售后'
                  extra={
                    !is_disabled ? (
                      <Button type='link' onClick={this.addFactoryInfo}>
                        添加
                      </Button>
                    ) : (
                      ''
                    )
                  }
                >
                  {this.factory_info_idx_arr.map((idxKey, index) => (
                    <div key={idxKey} className={'factory-info'}>
                      {!is_disabled && (factory_info || []).length > 1 ? (
                        <span
                          className={'factory-info-close'}
                          onClick={() => this.removeFactoryInfo(index)}
                        >
                          删除
                        </span>
                      ) : (
                        ''
                      )}
                      <Row>
                        <Col span={12}>
                          <Form.Item label='人员规模'>
                            {getFieldDecorator(
                              `factory_info[${index}].people_num`,
                              {
                                initialValue:
                                  factory_info[index].people_num || 0
                              }
                            )(
                              <InputNumber
                                disabled={is_disabled}
                                style={{ width: '100%' }}
                              />
                            )}
                            <span className={'number-right'}>人</span>
                          </Form.Item>
                        </Col>
                        <Col span={12}>
                          <Form.Item label='供应商产能'>
                            {getFieldDecorator(
                              `factory_info[${index}].capacity_info`,
                              {
                                initialValue:
                                  factory_info[index].capacity_info || {}
                              }
                            )(
                              <CapacityInfoField
                                disabled={is_disabled}
                                currentVal={getFieldValue(
                                  `factory_info[${index}].capacity_info`
                                )}
                                onChange={e => e}
                              />
                            )}
                          </Form.Item>
                        </Col>
                      </Row>
                      <Row>
                        <Col span={12}>
                          <Form.Item label='收件人姓名'>
                            {getFieldDecorator(
                              `factory_info[${index}].receive_name`,
                              {
                                initialValue:
                                  factory_info[index].receive_name || '',
                                rules: [
                                  { required: true, message: '收件人姓名必填' }
                                ]
                              }
                            )(
                              <Input
                                disabled={is_disabled}
                                placeholder='输入收件人姓名'
                              />
                            )}
                          </Form.Item>
                        </Col>
                        <Col span={12}>
                          <Form.Item label='收件人电话'>
                            {getFieldDecorator(
                              `factory_info[${index}].receive_phone`,
                              {
                                initialValue:
                                  factory_info[index].receive_phone || '',
                                rules: [
                                  {
                                    required: true,
                                    message: '收件人电话不能为空或格式不正确',
                                    pattern: regExp.mobile
                                  }
                                ]
                              }
                            )(
                              <Input
                                disabled={is_disabled}
                                placeholder='输入收件人电话'
                              />
                            )}
                          </Form.Item>
                        </Col>
                      </Row>
                      <Row>
                        <Col span={12}>
                          <Form.Item label='退(收)货地址'>
                            {getFieldDecorator(
                              `factory_info[${index}].receive_pcb`,
                              {
                                initialValue:
                                  factory_info[index].receive_pcb || [],
                                rules: [
                                  {
                                    required: true,
                                    message: '退(收)货地址必选'
                                  }
                                ]
                              }
                            )(
                              <PCBCascaderField
                                itemConfig={{ disabled: is_disabled }}
                                currentVal={
                                  factory_info[index].receive_pcb || []
                                }
                                onChange={e => e}
                              />
                            )}
                          </Form.Item>
                        </Col>
                        <Col span={12}>
                          <Form.Item label='退(收)货详细地址'>
                            {getFieldDecorator(
                              `factory_info[${index}].receive_address`,
                              {
                                initialValue:
                                  factory_info[index].receive_address || '',
                                rules: [
                                  {
                                    required: true,
                                    message: '退(收)货详细地址必填'
                                  }
                                ]
                              }
                            )(
                              <Input
                                disabled={is_disabled}
                                placeholder='输入退(收)货详细地址'
                              />
                            )}
                          </Form.Item>
                        </Col>
                      </Row>
                      <Row>
                        <Col span={12}>
                          <Form.Item label='发货地址'>
                            {getFieldDecorator(
                              `factory_info[${index}].send_pcb`,
                              {
                                initialValue:
                                  factory_info[index].send_pcb || [],
                                rules: [
                                  { required: true, message: '发货地址必选' }
                                ]
                              }
                            )(
                              <PCBCascaderField
                                itemConfig={{ disabled: is_disabled }}
                                currentVal={factory_info[index].send_pcb || []}
                                onChange={e => e}
                              />
                            )}
                          </Form.Item>
                        </Col>
                        <Col span={12}>
                          <Form.Item label='发货详细地址'>
                            {getFieldDecorator(
                              `factory_info[${index}].send_address`,
                              {
                                initialValue:
                                  factory_info[index].send_address || '',
                                rules: [
                                  {
                                    required: true,
                                    message: '发货详细地址必填'
                                  }
                                ]
                              }
                            )(
                              <Input
                                disabled={is_disabled}
                                placeholder='输入发货详细地址'
                              />
                            )}
                          </Form.Item>
                        </Col>
                      </Row>
                      <Row>
                        <Col span={12}>
                          <Form.Item label='常用物流'>
                            {getFieldDecorator(
                              `factory_info[${index}].logistics`,
                              {
                                initialValue:
                                  factory_info[index].logistics || [],
                                rules: [
                                  { required: true, message: '常用物流必选' }
                                ]
                              }
                            )(
                              <Select
                                disabled={is_disabled}
                                mode='multiple'
                                showArrow
                              >
                                {(this.state.formOptions.logisticsList || []).map(item => {
                                  const { id, name } = item;
                                  return (
                                    <Select.Option key={id} value={id}>
                                      {name}
                                    </Select.Option>
                                  );
                                })}
                              </Select>
                            )}
                          </Form.Item>
                        </Col>
                        <Col span={12}>
                          <Form.Item label='是否退换货'>
                            {getFieldDecorator(
                              `factory_info[${[index]}].is_door_return`,
                              {
                                initialValue:
                                  factory_info[index].is_door_return ||
                                  BOOLEAN_TRUE_ENUM
                              }
                            )(
                              <Radio.Group disabled={is_disabled}>
                                <Radio value={BOOLEAN_TRUE_ENUM}>
                                  {BOOLEAN_ENUM.EXTRA[BOOLEAN_TRUE_ENUM].label}
                                </Radio>
                                <Radio value={BOOLEAN_FALSE_ENUM}>
                                  {BOOLEAN_ENUM.EXTRA[BOOLEAN_FALSE_ENUM].label}
                                </Radio>
                              </Radio.Group>
                            )}
                          </Form.Item>
                        </Col>
                      </Row>
                    </div>
                  ))}
                </Card>
                <Card type='inner' title='主体账户信息'>
                  <Row>
                    <Col span={12}>
                      <Form.Item label='银行名称'>
                        {getFieldDecorator('bank_info.bank_name', {
                          initialValue:
                            bank_info.bank_name ||
                            (this.state.formOptions.bankList[0] || {}).id
                        })(
                          <Select disabled={is_disabled}>
                            {(this.state.formOptions.bankList || []).map(item => {
                              const { id, name } = item;
                              return (
                                <Select.Option key={id} value={id}>
                                  {name}
                                </Select.Option>
                              );
                            })}
                          </Select>
                        )}
                      </Form.Item>
                    </Col>
                    <Col span={12}>
                      <Form.Item label='支行名称'>
                        {getFieldDecorator('bank_info.sub_bank_name', {
                          initialValue: bank_info.sub_bank_name || ''
                        })(
                          <Input
                            disabled={is_disabled}
                            placeholder='输入支行名称'
                          />
                        )}
                      </Form.Item>
                    </Col>
                  </Row>
                  <Row>
                    <Col span={12}>
                      <Form.Item label='银行账户'>
                        {getFieldDecorator('bank_info.bank_account', {
                          initialValue: bank_info.bank_account || ''
                        })(
                          <Input
                            disabled={is_disabled}
                            placeholder='输入银行账户'
                          />
                        )}
                      </Form.Item>
                    </Col>
                    <Col span={12}>
                      <Form.Item label='账户类型'>
                        {getFieldDecorator('bank_info.account_type', {
                          initialValue: bank_info.account_type || 1
                        })(
                          <Select disabled={is_disabled}>
                            <Select.Option value={1}>对公</Select.Option>
                            <Select.Option value={2}>对私</Select.Option>
                          </Select>
                        )}
                      </Form.Item>
                    </Col>
                  </Row>
                  <Row>
                    <Col span={12}>
                      <Form.Item label='结算方式'>
                        {getFieldDecorator('bank_info.settlement_unit', {
                          initialValue: bank_info.settlement_unit || 1,
                          rules: [
                            {
                              required: true
                            }
                          ]
                        })(
                          <Select disabled={is_disabled}>
                            <Select.Option value={1}>单结</Select.Option>
                            <Select.Option value={2}>月结</Select.Option>
                          </Select>
                        )}
                      </Form.Item>
                    </Col>
                  </Row>
                </Card>
                <Card type='inner' title='入驻退出时间'>
                  <Row>
                    <Col span={12}>
                      <Form.Item label='合作日期(起)'>
                        {getFieldDecorator(
                          'collaboration_info.collaboration_time',
                          {
                            initialValue:
                              collaboration_info.collaboration_time || moment(),
                            rules: [
                              { required: true, message: '合作日期(起)必选' }
                            ]
                          }
                        )(
                          <DatePicker
                            disabled={is_disabled}
                            style={{ width: '100%' }}
                          />
                        )}
                      </Form.Item>
                    </Col>
                    <Col span={12}>
                      <Form.Item label='合作期限'>
                        {getFieldDecorator(
                          'collaboration_info.collaboration_unit',
                          {
                            initialValue:
                              collaboration_info.collaboration_unit ||
                              COLLABORATION_UNIT_ENUM.HALF_YEAR,
                            rules: [{ required: true }]
                          }
                        )(
                          <Select disabled={is_disabled}>
                            {COLLABORATION_UNIT_ENUM.OPTIONS.filter(
                              item => item.value !== COLLABORATION_UNIT_ENUM.ALL
                            ).map(item => {
                              const { label, value } = item;
                              return (
                                <Select.Option key={value} value={value}>
                                  {label}
                                </Select.Option>
                              );
                            })}
                          </Select>
                        )}
                      </Form.Item>
                    </Col>
                  </Row>
                </Card>
                {SUPPLIER_TYPE_ENUM.EXTRA[getFieldValue('type')]
                  .showBrandInfo ? (
                  <Card
                    type='inner'
                    title='经营品牌'
                    extra={this.getBrandExtra()}
                  >
                    {getFieldDecorator('brand_id', {
                      initialValue: brand_id
                    })(
                      <BrandListField
                        disabled={is_disabled}
                        brand_ids={brand_id}
                        showDetail={brandId => {
                          this.updateStateData([
                            {
                              key: 'modalOption',
                              value: {
                                visible: true,
                                title: '品牌详情',
                                modalData: {
                                  id: brandId
                                }
                              }
                            }
                          ]);
                        }}
                        onChange={e => e}
                      />
                    )}
                  </Card>
                ) : (
                  ''
                )}
                <Card
                  type='inner'
                  title='其他信息'
                  extra={
                    <Button
                      type='link'
                      onClick={() => {
                        this.updateStateData([
                          {
                            key: 'show_others',
                            value: !show_others
                          }
                        ]);
                      }}
                    >
                      {show_others ? '收起' : '展开'}
                    </Button>
                  }
                >
                  <div className={show_others ? '' : 'hidden-others'}>
                    <Row>
                      <Col span={12}>
                        <Form.Item label='公司主体名称'>
                          {getFieldDecorator('company_info.company_name', {
                            initialValue: company_info.company_name || ''
                          })(
                            <Input
                              disabled={is_disabled}
                              placeholder='输入公司主体名称'
                            />
                          )}
                        </Form.Item>
                      </Col>
                      <Col span={12}>
                        <Form.Item label='组织机构代码'>
                          {getFieldDecorator('company_info.company_code', {
                            initialValue: company_info.company_code || ''
                          })(
                            <Input
                              disabled={is_disabled}
                              placeholder='输入组织机构代码'
                            />
                          )}
                        </Form.Item>
                      </Col>
                    </Row>
                    <Row>
                      <Col span={12}>
                        <Form.Item label='公司地址'>
                          {getFieldDecorator('company_info.company_address', {
                            initialValue: company_info.company_address || ''
                          })(
                            <Input.TextArea
                              disabled={is_disabled}
                              placeholder='输入公司地址'
                            />
                          )}
                        </Form.Item>
                      </Col>
                      <Col span={12}>
                        <Form.Item label='企业营业执照'>
                          {getFieldDecorator('company_info.company_images', {
                            initialValue: company_info.company_images || ''
                          })(
                            <SingleImgUpload
                              disabled={is_disabled}
                              src={company_info.company_images}
                              onChange={e => e}
                            />
                          )}
                        </Form.Item>
                      </Col>
                    </Row>
                    <Row className={'img-bottom-divider'}>
                      <Col span={22} offset={1}>
                        <Divider type='horizontal' />
                      </Col>
                    </Row>
                    <Row>
                      <Col span={24}>
                        <Form.Item
                          label='主营品类'
                          labelCol={{ span: 3, offset: 1 }}
                          wrapperCol={{ span: 20 }}
                        >
                          {getFieldDecorator('goods_info.category', {
                            initialValue: goods_info.category || []
                          })(
                            <SelectField
                              currentVal={goods_info.category || []}
                              itemProps={{
                                disabled: is_disabled,
                                showArrow: true,
                                allowClear: true,
                                placeholder: '选择主营品类',
                                options: this.state.formOptions.brandList,
                                mode: 'multiple',
                                labelKey: 'title',
                                valueKey: 'id'
                              }}
                            />
                          )}
                        </Form.Item>
                      </Col>
                    </Row>
                    <Row>
                      <Col span={12}>
                        <Form.Item label='主营风格'>
                          {getFieldDecorator('goods_info.style', {
                            initialValue: goods_info.style || []
                          })(
                            <SelectField
                              currentVal={goods_info.style || []}
                              itemProps={{
                                disabled: is_disabled,
                                showArrow: true,
                                allowClear: true,
                                placeholder: '选择主营风格',
                                options: this.state.formOptions.styleList,
                                mode: 'multiple',
                                labelKey: 'name',
                                valueKey: 'id'
                              }}
                            />
                          )}
                        </Form.Item>
                      </Col>
                      <Col span={12}>
                        <Form.Item label='主要木料'>
                          {getFieldDecorator('goods_info.material', {
                            initialValue: goods_info.material || []
                          })(
                            <SelectField
                              currentVal={goods_info.material || []}
                              itemProps={{
                                disabled: is_disabled,
                                showArrow: true,
                                allowClear: true,
                                placeholder: '选择主要木料',
                                options: MATERIAL_TYPE_ENUM.OPTIONS.filter(
                                  item => item.value !== MATERIAL_TYPE_ENUM.ALL
                                ),
                                mode: 'multiple'
                              }}
                            />
                          )}
                        </Form.Item>
                      </Col>
                    </Row>
                    <Row>
                      <Col span={12}>
                        <Form.Item label='油漆品牌'>
                          {getFieldDecorator('goods_info.paint_brand', {
                            initialValue: goods_info.paint_brand || []
                          })(
                            <SelectField
                              currentVal={goods_info.paint_brand || []}
                              itemProps={{
                                disabled: is_disabled,
                                showArrow: true,
                                allowClear: true,
                                placeholder: '选择油漆品牌',
                                options: this.state.formOptions.paintBrandList,
                                mode: 'multiple',
                                labelKey: 'name',
                                valueKey: 'id'
                              }}
                            />
                          )}
                        </Form.Item>
                      </Col>
                      <Col span={12}>
                        <Form.Item label='粘合剂品牌'>
                          {getFieldDecorator('goods_info.adhesive_brand', {
                            initialValue: goods_info.adhesive_brand || []
                          })(
                            <SelectField
                              currentVal={goods_info.adhesive_brand || []}
                              itemProps={{
                                disabled: is_disabled,
                                showArrow: true,
                                allowClear: true,
                                placeholder: '选择粘合剂品牌',
                                options: this.state.formOptions.adhesiveList,
                                mode: 'multiple',
                                labelKey: 'name',
                                valueKey: 'id'
                              }}
                            />
                          )}
                        </Form.Item>
                      </Col>
                    </Row>
                    <Row>
                      <Col span={12}>
                        <Form.Item label='拼接工艺'>
                          {getFieldDecorator('goods_info.technology', {
                            initialValue: goods_info.technology || []
                          })(
                            <SelectField
                              currentVal={goods_info.technology || []}
                              itemProps={{
                                disabled: is_disabled,
                                showArrow: true,
                                allowClear: true,
                                placeholder: '选择拼接工艺',
                                options: [
                                  { value: 1, label: '榫卯sǔn mǎo' },
                                  { value: 2, label: '钉接' },
                                  { value: 3, label: '胶粘' }
                                ],
                                mode: 'multiple'
                              }}
                            />
                          )}
                        </Form.Item>
                      </Col>
                      <Col span={12}>
                        <Form.Item label='环保等级'>
                          {getFieldDecorator('goods_info.green_level', {
                            initialValue: goods_info.green_level || 1
                          })(
                            <SelectField
                              currentVal={goods_info.green_level || 1}
                              itemProps={{
                                disabled: is_disabled,
                                options: [
                                  { value: 1, label: 'E0级' },
                                  { value: 2, label: 'F4星级' },
                                  { value: 3, label: 'E1级' },
                                  { value: 4, label: 'E2级' }
                                ]
                              }}
                            />
                          )}
                        </Form.Item>
                      </Col>
                    </Row>
                    <Row>
                      <Col span={12}>
                        <Form.Item label='环保证书'>
                          {getFieldDecorator('goods_info.images', {
                            initialValue: goods_info.images || [],
                            valuePropName: 'fileList',
                            getValueFromEvent: this.normFile
                          })(
                            <Upload
                              disabled={is_disabled}
                              accept='image/*'
                              name='contracts-img'
                              action='/old-admin-api/image/upload'
                              listType='picture'
                              className={is_disabled ? 'disabled-upload' : ''}
                              data={file => {
                                const fileName = file.name;
                                let obj = {
                                  name: fileName
                                };
                                obj[fileName] = file;
                                return obj;
                              }}
                              showUploadList={{
                                showPreviewIcon: true,
                                showRemoveIcon: true,
                                showDownloadIcon: false
                              }}
                              onPreview={file => {
                                // console.log('file', file);
                                window.open(
                                  file.url || file.response.data.url,
                                  '_blank'
                                );
                              }}
                            >
                              {!is_disabled && (
                                <Button>
                                  <Icon type='upload' /> 上传文件
                                </Button>
                              )}
                            </Upload>
                          )}
                        </Form.Item>
                      </Col>
                    </Row>
                    <Row>
                      <Col span={22} offset={1}>
                        <Divider type='horizontal' />
                      </Col>
                    </Row>
                    <Row>
                      <Col span={12}>
                        <Form.Item label='是否含票'>
                          {getFieldDecorator('other_info.has_bill', {
                            initialValue:
                              other_info.has_bill || BOOLEAN_ENUM.TRUE
                          })(
                            <Radio.Group disabled={is_disabled}>
                              <Radio value={BOOLEAN_ENUM.TRUE}>
                                {BOOLEAN_ENUM.EXTRA[BOOLEAN_ENUM.TRUE].label}
                              </Radio>
                              <Radio value={BOOLEAN_ENUM.FALSE}>
                                {BOOLEAN_ENUM.EXTRA[BOOLEAN_ENUM.FALSE].label}
                              </Radio>
                            </Radio.Group>
                          )}
                        </Form.Item>
                      </Col>
                      <Col span={12}>
                        <Form.Item label='发票类型'>
                          {getFieldDecorator('other_info.bill_type', {
                            initialValue: other_info.bill_type || 1
                          })(
                            <SelectField
                              currentVal={other_info.bill_type || 1}
                              itemProps={{
                                disabled: is_disabled,
                                options: [
                                  { value: 1, label: '普票' },
                                  { value: 2, label: '专票' }
                                ]
                              }}
                            />
                          )}
                        </Form.Item>
                      </Col>
                    </Row>
                    <Row>
                      <Col span={12}>
                        <Form.Item label='是否外贸'>
                          {getFieldDecorator('other_info.foreign_trade', {
                            initialValue:
                              other_info.foreign_trade || BOOLEAN_ENUM.TRUE
                          })(
                            <Radio.Group disabled={is_disabled}>
                              <Radio value={BOOLEAN_ENUM.TRUE}>
                                {BOOLEAN_ENUM.EXTRA[BOOLEAN_ENUM.TRUE].label}
                              </Radio>
                              <Radio value={BOOLEAN_ENUM.FALSE}>
                                {BOOLEAN_ENUM.EXTRA[BOOLEAN_ENUM.FALSE].label}
                              </Radio>
                            </Radio.Group>
                          )}
                        </Form.Item>
                      </Col>
                      <Col span={12}>
                        <Form.Item label='发票类型'>
                          {getFieldDecorator('other_info.package_type', {
                            initialValue: other_info.package_type || 1
                          })(
                            <SelectField
                              currentVal={other_info.package_type || 1}
                              itemProps={{
                                disabled: is_disabled,
                                options: [
                                  { value: 1, label: '选送后安装' },
                                  { value: 2, label: '安装、送同步' }
                                ]
                              }}
                            />
                          )}
                        </Form.Item>
                      </Col>
                    </Row>
                    <Row>
                      <Col span={12}>
                        <Form.Item label='供货周期'>
                          {getFieldDecorator('other_info.supply_clcle', {
                            initialValue: other_info.supply_clcle || 1
                          })(
                            <SelectField
                              currentVal={other_info.supply_clcle || 1}
                              itemProps={{
                                disabled: is_disabled,
                                options: [
                                  { value: 1, label: '0-15天' },
                                  { value: 2, label: '16-30 天' },
                                  { value: 3, label: '30-45 天' },
                                  { value: 4, label: '46-60 天' },
                                  { value: 5, label: '60天以上' }
                                ]
                              }}
                            />
                          )}
                        </Form.Item>
                      </Col>
                    </Row>
                  </div>
                </Card>
              </>
            ) : (
              ''
            )}
          </Form>
          <div className={'operate-btns'}>
            {mode === 'edit' || mode === 'add' ? (
              <>
                <Button
                  type='ghost'
                  onClick={() => {
                    router.goBack();
                  }}
                >
                  取消
                </Button>
                <Button type='ghost' onClick={this.resetField}>
                  重置
                </Button>
                <Button onClick={() => this.handleSubmit({ is_draft: true })}>
                  保存为草稿
                </Button>
                <Button
                  type='primary'
                  onClick={() => this.handleSubmit({ is_draft: false })}
                >
                  完成
                </Button>
              </>
            ) : (
              <>
                <Button
                  type='ghost'
                  onClick={() => {
                    router.goBack();
                  }}
                >
                  返回
                </Button>
                <Button
                  type='primary'
                  onClick={() => {
                    this.setState({
                      mode: 'edit'
                    });
                  }}
                >
                  编辑
                </Button>
              </>
            )}
          </div>
        </div>
        <Modal
          visible={modalOption.visible}
          width={800}
          title={modalOption.title}
          footer={false}
          closable={false}
        >
          {modalOption.visible ? (
            <AddBrand
              brandId={modalOption.modalData.id}
              onClose={() => {
                this.updateStateData([
                  {
                    key: 'modalOption',
                    path: 'visible',
                    value: false
                  }
                ]);
              }}
              addBrandId={brandId => this.handleSelect(brandId)}
            />
          ) : (
            ''
          )}
        </Modal>
      </div>
    );
  }
}

export default Form.create({ name: 'supplier-edit' })(SupplierEdit);
