|
|
@ -1,11 +1,14 @@ |
|
|
|
import React, { useEffect, useState } from 'react'; |
|
|
|
import { connect } from 'react-redux'; |
|
|
|
import { Select, Input, Button, RadioGroup, Radio, Tooltip, Table } from '@douyinfe/semi-ui'; |
|
|
|
import { Select, Input, Button, Banner, Radio, Tooltip, Table } from '@douyinfe/semi-ui'; |
|
|
|
import { IconSearch } from '@douyinfe/semi-icons'; |
|
|
|
import '../style.less' |
|
|
|
import moment from 'moment' |
|
|
|
|
|
|
|
const ReserveItemsReporting = (props) => { |
|
|
|
const [downloadUrl, setDownloadUrl] = useState(null); |
|
|
|
const [warningBanner, setWarningBanner] = useState(null); |
|
|
|
|
|
|
|
const columns = [ |
|
|
|
{ |
|
|
|
title: '序号', |
|
|
@ -67,11 +70,18 @@ const ReserveItemsReporting = (props) => { |
|
|
|
}, |
|
|
|
]; |
|
|
|
const data = []; |
|
|
|
|
|
|
|
const exportAll = () => { |
|
|
|
const { dispatch, actions } = props; |
|
|
|
dispatch(actions.businessManagement.getFilingReport()); |
|
|
|
dispatch(actions.businessManagement.getFilingReport()).then(res => { |
|
|
|
const { payload } = res; |
|
|
|
if (payload && payload.url) { |
|
|
|
setDownloadUrl(`${payload.url}/week_report/reserve`); |
|
|
|
} else { |
|
|
|
setWarningBanner("导出地址有误,导出失败"); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
return ( |
|
|
|
<> |
|
|
|
<div style={{ padding: '0px 12px' }}> |
|
|
@ -90,6 +100,13 @@ const ReserveItemsReporting = (props) => { |
|
|
|
<div style={{ marginLeft: 6, fontSize: 12, color: '#969799', fontFamily: "DINExp", }}>REPORT FORM OF RESERVE ITEMS</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
{ |
|
|
|
warningBanner && |
|
|
|
(<Banner |
|
|
|
type="danger" |
|
|
|
description={warningBanner} |
|
|
|
onClose={() => setWarningBanner(null)} |
|
|
|
/>)} |
|
|
|
<div style={{ display: 'flex', marginTop: 16, marginBottom: 17 }}> |
|
|
|
{/* <div style={{ marginLeft: 12, marginRight: 18 }}> |
|
|
|
<Input suffix={<IconSearch />} |
|
|
@ -108,6 +125,7 @@ const ReserveItemsReporting = (props) => { |
|
|
|
// } |
|
|
|
// }) |
|
|
|
}}>查询</Button> */} |
|
|
|
|
|
|
|
<Button theme='solid' type='secondary' style={{ width: 80, borderRadius: 2, marginLeft: 15 }} |
|
|
|
onClick={exportAll}>导出全部</Button> |
|
|
|
</div> |
|
|
@ -115,6 +133,9 @@ const ReserveItemsReporting = (props) => { |
|
|
|
|
|
|
|
<Table columns={columns} dataSource={data} pagination={false} /> |
|
|
|
</div> |
|
|
|
{ |
|
|
|
downloadUrl ? <iframe key={downloadUrl} src={downloadUrl} style={{ display: 'none' }} /> : '' |
|
|
|
} |
|
|
|
</div> |
|
|
|
</> |
|
|
|
) |
|
|
|