Commit 38f0d7ef authored by 卢均锐's avatar 卢均锐

chore: 采购竞价 确认竞价结果弹框增加loading

parent 56c23826
......@@ -36,7 +36,12 @@ const ConfirmBidResultModal: React.FC<ConfirmBidResultModalProps> = (props: any)
// 控制tabkey
const [activeKey, setActiveKey] = useState<string>('1');
const [confirmLoading, setConfirmLoading] = useState<boolean>(false);
const handleOk = () => {
if (confirmLoading) {
return
}
form.validateFields().then(res => {
const _params = {
id: record.id,
......@@ -47,12 +52,13 @@ const ConfirmBidResultModal: React.FC<ConfirmBidResultModalProps> = (props: any)
awardResults: res.awardResults,
content: res.content
}
setConfirmLoading(true)
fetch && fetch(_params).then(res => {
console.log(res)
if (res.code === 1000) {
onOk && onOk();
}
})
}).finally(() => setConfirmLoading(false))
})
}
......@@ -94,6 +100,7 @@ const ConfirmBidResultModal: React.FC<ConfirmBidResultModalProps> = (props: any)
wrapClassName={styles.wrap}
onOk={() => { handleOk() }}
afterClose={() => { form.resetFields() }}
confirmLoading={confirmLoading}
>
<Form
form={form}
......
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