Commit a1a460a3 authored by XieZhiXiong's avatar XieZhiXiong

fix: 上传时按钮禁用

parent 605665bd
......@@ -63,6 +63,7 @@ const UploadVoucher: React.FC<UploadVoucherProps> = ({
id: 0,
});
const [loading, setLoading] = useState(false);
const [refundDisabled, setRefundDisabled] = useState(false);
// 获取对公账户信息
const getSettleAccountsGetMemberAccountConfig = () => {
......@@ -91,6 +92,7 @@ const UploadVoucher: React.FC<UploadVoucherProps> = ({
message.warning('图片大小超过200K');
return Promise.reject();
}
setRefundDisabled(true);
};
const handleUploadVoucherSubmit = values => {
......@@ -114,6 +116,10 @@ const UploadVoucher: React.FC<UploadVoucherProps> = ({
}
};
const handleUploadChange = (file) => {
setRefundDisabled(false);
};
return (
<Spin spinning={loading}>
<Wrap>
......@@ -125,6 +131,7 @@ const UploadVoucher: React.FC<UploadVoucherProps> = ({
}}
expressionScope={{
beforeUpload: beforeUploadVoucher,
onUploadChange: handleUploadChange,
}}
actions={uploadVoucherFormActions}
schema={uploadVoucherModalSchema}
......@@ -142,6 +149,7 @@ const UploadVoucher: React.FC<UploadVoucherProps> = ({
type="primary"
onClick={() => uploadVoucherFormActions.submit()}
loading={submitLoading}
disabled={refundDisabled}
>
退款
</Button>
......
......@@ -47,6 +47,7 @@ export const uploadVoucherModalSchema: ISchema = {
prefix: '/returnManage/refundVoucher/',
},
beforeUpload: '{{beforeUpload}}',
onChange: '{{onUploadChange}}',
accept: '.png, .jpg, .jpeg',
},
'x-mega-props': {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment