提交 5a0e00f3 authored 作者: 钟是志's avatar 钟是志

在批量审核的时候 默认给一个审批理由让用户填写

钟是志
上级 f400ef7d
import { Modal, Spin, Form } from 'antd'; import { Modal, Spin, Form, Input } from 'antd';
import { useState, useEffect } from 'react'; import { useState, useEffect } from 'react';
import styles from '../../RenderForm/index.less'; import styles from '../../RenderForm/index.less';
import { getHistoryFormDetail } from '../../../Services'; import { getHistoryFormDetail } from '../../../Services';
...@@ -9,7 +9,7 @@ import { ModalInfo } from '@/baseComponent/Modal'; ...@@ -9,7 +9,7 @@ import { ModalInfo } from '@/baseComponent/Modal';
import { router } from 'umi'; import { router } from 'umi';
import RenderForm from '../../RenderForm'; import RenderForm from '../../RenderForm';
const isNewForm = true; const TextArea = Input.TextArea;
function AuditModal({ form, selectRows, children, getPage }) { function AuditModal({ form, selectRows, children, getPage }) {
const [visible, setVisible] = useState(false); const [visible, setVisible] = useState(false);
...@@ -23,6 +23,7 @@ function AuditModal({ form, selectRows, children, getPage }) { ...@@ -23,6 +23,7 @@ function AuditModal({ form, selectRows, children, getPage }) {
}, },
}); });
} }
const [data, setData] = useState(null); const [data, setData] = useState(null);
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
...@@ -41,7 +42,7 @@ function AuditModal({ form, selectRows, children, getPage }) { ...@@ -41,7 +42,7 @@ function AuditModal({ form, selectRows, children, getPage }) {
} }
}); });
}, },
[visible] [visible],
); );
const footer = data ? ( const footer = data ? (
...@@ -54,6 +55,7 @@ function AuditModal({ form, selectRows, children, getPage }) { ...@@ -54,6 +55,7 @@ function AuditModal({ form, selectRows, children, getPage }) {
/> />
</div> </div>
) : null; ) : null;
const { getFieldDecorator } = form;
return ( return (
<> <>
...@@ -75,10 +77,22 @@ function AuditModal({ form, selectRows, children, getPage }) { ...@@ -75,10 +77,22 @@ function AuditModal({ form, selectRows, children, getPage }) {
form={form} form={form}
/> />
) : null} ) : null}
<div>
<h3 style={{ padding: 12, paddingBottom: 0, fontWeight: 'bold' }}>审批说明:</h3>
<span style={{ display: 'block', textAlign: 'center' }}>
{getFieldDecorator('reason')(
<TextArea
placeholder="请输入审批理由"
style={{ width: '95%', margin: 12, height: 120, color: '#7F8B95' }}
/>,
)}
</span>
</div>
</Spin> </Spin>
</Modal> </Modal>
{children({ onShow: () => setVisible(true) })} {children({ onShow: () => setVisible(true) })}
</> </>
); );
} }
export default Form.create()(AuditModal); export default Form.create()(AuditModal);
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论