|
@@ -1,10 +1,16 @@
|
|
|
import React, { useEffect, useState } from 'react';
|
|
|
import { Button, Card, Form, Input, message, Modal, Space, Table } from 'antd';
|
|
|
-import { PlusCircleOutlined, ReloadOutlined, SearchOutlined } from '@ant-design/icons';
|
|
|
+import {
|
|
|
+ PlusCircleOutlined,
|
|
|
+ CloudDownloadOutlined,
|
|
|
+ ReloadOutlined,
|
|
|
+ SearchOutlined,
|
|
|
+} from '@ant-design/icons';
|
|
|
import { PageContainer } from '@ant-design/pro-components';
|
|
|
import type { ColumnsType } from 'antd/es/table';
|
|
|
import Edit from './edit';
|
|
|
import {
|
|
|
+ queryExport,
|
|
|
queryReportHome,
|
|
|
queryReportHomeDetail,
|
|
|
reportHomeAbandon,
|
|
@@ -108,6 +114,25 @@ const CommunityManagement: React.FC = () => {
|
|
|
setCheckVisible(false);
|
|
|
};
|
|
|
|
|
|
+ // 导出
|
|
|
+ const onDownLoad = () => {
|
|
|
+ form.validateFields().then((data) => {
|
|
|
+ queryExport(data)
|
|
|
+ .then((res: any) => {
|
|
|
+ const link = document.createElement('a');
|
|
|
+ link.style.display = 'none';
|
|
|
+ link.href = window.URL.createObjectURL(new Blob([res]));
|
|
|
+ link.setAttribute('download', '零售报备列表.xlsx');
|
|
|
+ document.body.appendChild(link);
|
|
|
+ link.click();
|
|
|
+ document.body.removeChild(link);
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ message.error('导出失败');
|
|
|
+ });
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
// 成交
|
|
|
const toDeal = (record: any) => {
|
|
|
Modal.confirm({
|
|
@@ -178,6 +203,12 @@ const CommunityManagement: React.FC = () => {
|
|
|
title: '门牌号',
|
|
|
dataIndex: 'doorplate',
|
|
|
key: 'doorplate',
|
|
|
+ render: (_, res: any) =>
|
|
|
+ res && (
|
|
|
+ <span>
|
|
|
+ {res?.building}-{res?.unit}-{res?.doorplate}
|
|
|
+ </span>
|
|
|
+ ),
|
|
|
},
|
|
|
{
|
|
|
title: '详细地址',
|
|
@@ -280,6 +311,10 @@ const CommunityManagement: React.FC = () => {
|
|
|
<PlusCircleOutlined />
|
|
|
新增报备
|
|
|
</Button>
|
|
|
+ <Button htmlType="button" style={{ margin: '20px 10px' }} onClick={onDownLoad}>
|
|
|
+ <CloudDownloadOutlined />
|
|
|
+ 导出
|
|
|
+ </Button>
|
|
|
<Table
|
|
|
columns={columns}
|
|
|
dataSource={dataList}
|