import React, { useState } from 'react';
import {
  ProFormSelect,
  ProFormText,
  ModalForm,
  ProFormDependency
} from '@ant-design/pro-form';
import { useIntl, FormattedMessage } from 'umi';

import { getApportionmentLevelListNoPage } from '../apportionmentLevel/service';


const UpdateForm = (props) => {
  const { updateModalVisible, updateModalVisibleChange, values, onSubmit } = props;
  const [selectedLevelList, setSelectedLevelList] = useState(null); //可选的分摊层级列表
  const [selectedLevel, setSelectedLevel] = useState(null);
  // console.log({values});
  return (
    <>
      {
        JSON.stringify(values) !== '{}' && <ModalForm
          title="编辑医院"
          width="800px"
          initialValues={{ ...values }}
          labelCol={{ span: 5, offset: 3 }}
          layout={'horizontal'}
          visible={updateModalVisible}
          onVisibleChange={(visible) => updateModalVisibleChange(visible)}
          onFinish={(value) => onSubmit({ ...values, ...value })}
        >
          <ProFormText
            label="会计科目编码"
            rules={[
              {
                required: true,
                message: (
                  <FormattedMessage id="pages.searchTable.accountingCode" defaultMessage="会计科目编码是必填项" />
                ),
              },
            ]}
            width="sm"
            name="accountingCode"
          />
          <ProFormText
            label="会计科目名"
            rules={[
              {
                required: true,
                message: (
                  <FormattedMessage id="pages.searchTable.accountingName" defaultMessage="会计科目名是必填项" />
                ),
              },
            ]}
            width="sm"
            name="accountingName"
          />
          
        </ModalForm>
      }
    </>
  );
};

export default UpdateForm;
