|
|
|
|
@ -1,10 +1,12 @@
|
|
|
|
|
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
|
|
|
|
import { Button, Space } from "antd";
|
|
|
|
|
import { Button, message, Modal, Space } from "antd";
|
|
|
|
|
import { useState } from "react";
|
|
|
|
|
import ExportIcon from "zy-react-library/components/Icon/ExportIcon";
|
|
|
|
|
import Page from "zy-react-library/components/Page";
|
|
|
|
|
import Search from "zy-react-library/components/Search";
|
|
|
|
|
import Table from "zy-react-library/components/Table";
|
|
|
|
|
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
|
|
|
|
import useDownloadBlob from "zy-react-library/hooks/useDownloadBlob";
|
|
|
|
|
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
|
|
|
|
import useTable from "zy-react-library/hooks/useTable";
|
|
|
|
|
import { getLabelName } from "zy-react-library/utils";
|
|
|
|
|
@ -26,7 +28,8 @@ function List(props) {
|
|
|
|
|
const [closeReason, setCloseReason] = useState("");
|
|
|
|
|
const [closeTime, setCloseTime] = useState("");
|
|
|
|
|
const [closeReasonModalOpen, setCloseReasonModalOpen] = useState(false);
|
|
|
|
|
|
|
|
|
|
const [selectedRowKeys, setSelectedRowKeys] = useState([]);
|
|
|
|
|
const { downloadBlob } = useDownloadBlob();
|
|
|
|
|
const { tableProps, getData } = useTable(props["eightworkList"], {
|
|
|
|
|
form,
|
|
|
|
|
params: { eqWorkType: "confinedspace_work" },
|
|
|
|
|
@ -37,7 +40,37 @@ function List(props) {
|
|
|
|
|
corpinfoId: formData.corpinfoId ? formData.corpinfoId : query.corpinfoId,
|
|
|
|
|
}),
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const onExportExcel = () => {
|
|
|
|
|
if (selectedRowKeys.length === 0) {
|
|
|
|
|
return message.warning("请先选择数据再导出!");
|
|
|
|
|
}
|
|
|
|
|
Modal.confirm({
|
|
|
|
|
title: "提示",
|
|
|
|
|
content: "确定要导出到excel吗?",
|
|
|
|
|
onOk: () => {
|
|
|
|
|
downloadBlob(
|
|
|
|
|
`/eightwork/eightworkInfo/exportConfinedspace?ids=${selectedRowKeys.join(",")}&menuPath=${window.location.pathname}&eqWorkType=confinedspace_work`,
|
|
|
|
|
{
|
|
|
|
|
name: "",
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
const onExportExcelAll = () => {
|
|
|
|
|
Modal.confirm({
|
|
|
|
|
title: "提示",
|
|
|
|
|
content: "确定要导出到excel吗?",
|
|
|
|
|
onOk: () => {
|
|
|
|
|
downloadBlob(
|
|
|
|
|
`/eightwork/eightworkInfo/exportConfinedspace?menuPath=${window.location.pathname}&eqWorkType=confinedspace_work&corpinfoId=${query.corpinfoId}`,
|
|
|
|
|
{
|
|
|
|
|
name: "",
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
return (
|
|
|
|
|
<Page isShowAllAction={query.headerTitle || false} headerTitle={query.headerTitle}>
|
|
|
|
|
<Search
|
|
|
|
|
@ -79,6 +112,31 @@ function List(props) {
|
|
|
|
|
onFinish={getData}
|
|
|
|
|
/>
|
|
|
|
|
<Table
|
|
|
|
|
rowSelection={{
|
|
|
|
|
selectedRowKeys,
|
|
|
|
|
onChange: selectedRowKeys => setSelectedRowKeys(selectedRowKeys),
|
|
|
|
|
preserveSelectedRowKeys: true,
|
|
|
|
|
}}
|
|
|
|
|
toolBarRender={() => (
|
|
|
|
|
<>
|
|
|
|
|
<Button
|
|
|
|
|
type="primary"
|
|
|
|
|
icon={<ExportIcon />}
|
|
|
|
|
ghost
|
|
|
|
|
onClick={() => onExportExcel()}
|
|
|
|
|
>
|
|
|
|
|
导出
|
|
|
|
|
</Button>
|
|
|
|
|
<Button
|
|
|
|
|
type="primary"
|
|
|
|
|
icon={<ExportIcon />}
|
|
|
|
|
ghost
|
|
|
|
|
onClick={() => onExportExcelAll()}
|
|
|
|
|
>
|
|
|
|
|
导出全部
|
|
|
|
|
</Button>
|
|
|
|
|
</>
|
|
|
|
|
)}
|
|
|
|
|
columns={[
|
|
|
|
|
{ title: "服务单位", dataIndex: "corpinfoName", hidden: !(props.entrance === "stakeholder") },
|
|
|
|
|
{ title: "编号", dataIndex: "checkNo" },
|
|
|
|
|
|