|
@ -1,5 +1,5 @@ |
|
|
import React, { useState, useRef, useEffect } from "react"; |
|
|
import React, { useState, useRef, useEffect } from "react"; |
|
|
import { ResultFlowResult } from "@/components" |
|
|
import { ResultFlowResult, ExportBtnNew } from "@/components" |
|
|
import { Button, Table, message, Pagination, Input, Modal, Image, DatePicker, Space } from 'antd' |
|
|
import { Button, Table, message, Pagination, Input, Modal, Image, DatePicker, Space } from 'antd' |
|
|
import { |
|
|
import { |
|
|
pageSizeOptions |
|
|
pageSizeOptions |
|
@ -27,6 +27,7 @@ function LiftUpPoleRecord(props) { |
|
|
pn: 1, |
|
|
pn: 1, |
|
|
page_size: Number(pageSizeOptions[0]), // 每页条数 |
|
|
page_size: Number(pageSizeOptions[0]), // 每页条数 |
|
|
} |
|
|
} |
|
|
|
|
|
const exportRef = useRef(null) |
|
|
const [formData, setFormData] = useState(parameter) |
|
|
const [formData, setFormData] = useState(parameter) |
|
|
const [lastFormData, setLastFormData] = useState(formData) |
|
|
const [lastFormData, setLastFormData] = useState(formData) |
|
|
const lastFormDataRef = useRef(formData) |
|
|
const lastFormDataRef = useRef(formData) |
|
@ -198,15 +199,20 @@ function LiftUpPoleRecord(props) { |
|
|
getData({...data, pn: 1}) |
|
|
getData({...data, pn: 1}) |
|
|
} |
|
|
} |
|
|
//导出 |
|
|
//导出 |
|
|
const salesData = () => { |
|
|
const salesData = (start, end) => { |
|
|
let data = { |
|
|
let data = { |
|
|
...formData |
|
|
...formData, |
|
|
|
|
|
start: start, |
|
|
|
|
|
end: end |
|
|
} |
|
|
} |
|
|
ajax.poleExport(data).then(res => { |
|
|
ajax.poleExport(data).then(res => { |
|
|
if (res.status == 20000) { |
|
|
if (res.status == 20000) { |
|
|
window.open(res.data.url || res.data.export_url) |
|
|
// window.open(res.data.url || res.data.export_url) |
|
|
|
|
|
message.success(res.message) |
|
|
|
|
|
exportRef.current.handleCancel() |
|
|
} else { |
|
|
} else { |
|
|
message.error(res.message) |
|
|
message.error(res.message) |
|
|
|
|
|
exportRef.current.handleError() |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
@ -276,7 +282,19 @@ function LiftUpPoleRecord(props) { |
|
|
<div className="result"> |
|
|
<div className="result"> |
|
|
<span className="font">共检索到<em>{resultData.total_records}</em>条结果</span> |
|
|
<span className="font">共检索到<em>{resultData.total_records}</em>条结果</span> |
|
|
<div className="header-button"> |
|
|
<div className="header-button"> |
|
|
<Button type="primary" onClick={() => { salesData() }}>导出</Button> |
|
|
{/* <Button type="primary" onClick={() => { salesData() }}>导出</Button> */} |
|
|
|
|
|
<ExportBtnNew |
|
|
|
|
|
children={<Button className="export-btn" size='medium' type="primary">导出</Button>} |
|
|
|
|
|
modalType="noImg" |
|
|
|
|
|
ref={exportRef} |
|
|
|
|
|
totalRecords={resultData.total_records} |
|
|
|
|
|
imgno={false} |
|
|
|
|
|
postdata={{ |
|
|
|
|
|
formData: formData |
|
|
|
|
|
}} |
|
|
|
|
|
isTableModule={true} |
|
|
|
|
|
onOk={salesData} |
|
|
|
|
|
/> |
|
|
</div> |
|
|
</div> |
|
|
<ResultFlowResult ajaxLoad={ajaxLoading} resultData={resultData.data ? resultData.data : []}> |
|
|
<ResultFlowResult ajaxLoad={ajaxLoading} resultData={resultData.data ? resultData.data : []}> |
|
|
<Table |
|
|
<Table |
|
|
xxxxxxxxxx