|
@@ -119,14 +119,25 @@ function Department(props) {
|
|
callback: list => handleChangeCurrent(list[0]),
|
|
callback: list => handleChangeCurrent(list[0]),
|
|
});
|
|
});
|
|
};
|
|
};
|
|
- const handleDownload = () => {
|
|
|
|
|
|
+ const handleDownload = finance => {
|
|
const token = getToken();
|
|
const token = getToken();
|
|
const s_time = !filterRef.current.s_time ? '' : filterRef.current.s_time;
|
|
const s_time = !filterRef.current.s_time ? '' : filterRef.current.s_time;
|
|
const e_time = !filterRef.current.e_time ? '' : filterRef.current.e_time;
|
|
const e_time = !filterRef.current.e_time ? '' : filterRef.current.e_time;
|
|
- downloadFile(
|
|
|
|
- `/api/v2/workload/rpt/dep/export2excel?JWT-TOKEN=${token}&s_time=${s_time}&e_time=${e_time}`,
|
|
|
|
- `项目报表${moment().format('YYYYMMDDHHMMSS')}.xlsx`
|
|
|
|
- );
|
|
|
|
|
|
+
|
|
|
|
+ console.log(s_time, e_time);
|
|
|
|
+
|
|
|
|
+ if (finance) {
|
|
|
|
+ console.log(1);
|
|
|
|
+ downloadFile(
|
|
|
|
+ `/api/v2/workload/finance/people/export?JWT-TOKEN=${token}&s_time=${s_time}&e_time=${e_time}`,
|
|
|
|
+ `财务报表_部门${moment().format('YYYYMMDDHHMMSS')}.xlsx`
|
|
|
|
+ );
|
|
|
|
+ console.log(2);
|
|
|
|
+ } else
|
|
|
|
+ downloadFile(
|
|
|
|
+ `/api/v2/workload/rpt/dep/export2excel?JWT-TOKEN=${token}&s_time=${s_time}&e_time=${e_time}`,
|
|
|
|
+ `部门报表${moment().format('YYYYMMDDHHMMSS')}.xlsx`
|
|
|
|
+ );
|
|
};
|
|
};
|
|
const renderSearch = () => {
|
|
const renderSearch = () => {
|
|
return (
|
|
return (
|
|
@@ -285,9 +296,14 @@ function Department(props) {
|
|
<div>
|
|
<div>
|
|
<div className={styles.topPart}>
|
|
<div className={styles.topPart}>
|
|
{renderSearch()}
|
|
{renderSearch()}
|
|
- <Button type="primary" onClick={handleDownload}>
|
|
|
|
- 导出
|
|
|
|
- </Button>
|
|
|
|
|
|
+ <div>
|
|
|
|
+ <Button type="primary" onClick={() => handleDownload(1)} style={{ marginRight: '10px' }}>
|
|
|
|
+ 财务报表导出
|
|
|
|
+ </Button>
|
|
|
|
+ <Button type="primary" onClick={() => handleDownload(0)}>
|
|
|
|
+ 导出
|
|
|
|
+ </Button>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
<div style={{ marginTop: 20, display: 'flex' }}>
|
|
<div style={{ marginTop: 20, display: 'flex' }}>
|
|
<Table
|
|
<Table
|