diff --git a/src/components/Export/ExportBtnNew/index.jsx b/src/components/Export/ExportBtnNew/index.jsx index edae12c..c79774f 100644 --- a/src/components/Export/ExportBtnNew/index.jsx +++ b/src/components/Export/ExportBtnNew/index.jsx @@ -193,12 +193,12 @@ const ExportBtn = forwardRef((props, ref) => { let url = exportUrl; if (imgno) { ajax({ url, type: ajaxType, data: { export_type: checkedType, start, end, isimg:exportType == "hasImg" ? 1 : 0, ...formData, ...other } }).then((res) => { - if (pageName == 'parkingOverview') { - downloadFile(res.export_url) - handleCancel() - setBtnLoading(false); - return - } + // if (pageName == 'parkingOverview') { + // downloadFile(res.export_url) + // handleCancel() + // setBtnLoading(false); + // return + // } if (res.status === 20000) { // if (end - start > 500) { // message.info('当前导出任务, 已加入导出任务列表') @@ -222,12 +222,12 @@ const ExportBtn = forwardRef((props, ref) => { }); } else { ajax({ url, type: ajaxType, data: { export_type: checkedType, start, end, isimg:0, ...formData, ...other } }).then((res) => { - if (pageName == 'parkingOverview') { - downloadFile(res.export_url) - handleCancel() - setBtnLoading(false); - return - } + // if (pageName == 'parkingOverview') { + // downloadFile(res.export_url) + // handleCancel() + // setBtnLoading(false); + // return + // } if (res.status === 20000) { // if (end - start > 500) { // message.info('当前导出任务, 已加入导出任务列表') diff --git a/src/pages/DataAnalysisPrediction/MemberStat/PayAly/loadable.jsx b/src/pages/DataAnalysisPrediction/MemberStat/PayAly/loadable.jsx index 9d472d3..aef0935 100644 --- a/src/pages/DataAnalysisPrediction/MemberStat/PayAly/loadable.jsx +++ b/src/pages/DataAnalysisPrediction/MemberStat/PayAly/loadable.jsx @@ -4,6 +4,7 @@ import { Pagination, Table, Select, + Button, Input, Popover, Cascader, @@ -18,9 +19,10 @@ import moment from "moment"; import ReactEcharts from "echarts-for-react"; import ajax from "@/services"; // import { useSessionStorageState, useUpdateEffect, useSize, useUpdate } from 'ahooks'; -import { ResultFlow } from "@/components"; +import { ResultFlow, ExportBtnNew } from "@/components"; import "./index.scss"; function PayAly() { + const exportRef = useRef(null) const formdata = { operator_id: "0", //商户 data_source: "", //车场类型 1=路内 2=路外 @@ -248,16 +250,21 @@ function PayAly() { document.body.removeChild(link); }; //导出 - const ReportPaySummaryReport = () => { + const ReportPaySummaryReport = (start, end) => { ajax.ElectInvoice.exportPayFx({ ...FormDatas, ...DateFormt(FormDatas.date_type), + start: start, + end: end }).then( (res) => { if (parseInt(res?.status) === 20000) { - Daownload(res?.data?.export_url); + // Daownload(res?.data?.export_url); + message.success(res.message) + exportRef.current.handleCancel() } else { message.error(res?.message); + exportRef.current.handleError() } }, (err) => { @@ -979,7 +986,7 @@ function PayAly() { <p> 共查询到<span> {Data?.total || 0}</span>条数据 </p> - <span + {/* <span className={"sear_ser"} onClick={() => { Data?.total && ReportPaySummaryReport(); @@ -987,7 +994,19 @@ function PayAly() { }} > 导出 - </span> + </span> */} + <ExportBtnNew + children={<Button className="export-btn" size='medium' type="primary">导出</Button>} + modalType="noImg" + ref={exportRef} + totalRecords={Data?.total || 0} + imgno={false} + postdata={{ + formData: FormDatas + }} + isTableModule={true} + onOk={ReportPaySummaryReport} + /> </div> <ResultFlow hasLoad={true} diff --git a/src/pages/DataAnalysisPrediction/MemberStat/RegisterAly/loadable.jsx b/src/pages/DataAnalysisPrediction/MemberStat/RegisterAly/loadable.jsx index 35d7033..f4e9ae8 100644 --- a/src/pages/DataAnalysisPrediction/MemberStat/RegisterAly/loadable.jsx +++ b/src/pages/DataAnalysisPrediction/MemberStat/RegisterAly/loadable.jsx @@ -4,6 +4,7 @@ import { Pagination, Table, Select, + Button, Input, Popover, Cascader, @@ -18,9 +19,10 @@ import moment from "moment"; import ReactEcharts from "echarts-for-react"; import ajax from "@/services"; // import { useSessionStorageState, useUpdateEffect, useSize, useUpdate } from 'ahooks'; -import { ResultFlow } from "@/components"; +import { ResultFlow, ExportBtnNew } from "@/components"; import "./index.scss"; function RegisterAly() { + const exportRef = useRef(null) const formdata = { date_type: "1", start_date: moment().startOf("day").format("YYYY-MM-DD"), @@ -239,15 +241,20 @@ function RegisterAly() { document.body.removeChild(link); }; //导出 - const ReportPaySummaryReport = () => { + const ReportPaySummaryReport = (start, end) => { ajax.ElectInvoice.exportRegister({ ...FormDatas, ...DateFormt(FormDatas.date_type), + start: start, + end: end }).then( (res) => { if (parseInt(res?.status) === 20000) { - Daownload(res?.data?.export_url); + // Daownload(res?.data?.export_url); + message.success(res.message) + exportRef.current.handleCancel() } else { + exportRef.current.handleError() message.error(res?.message); } }, @@ -802,7 +809,7 @@ function RegisterAly() { <p> 共查询到<span> {Data?.total || 0}</span>条数据 </p> - <span + {/* <span className={"sear_ser"} onClick={() => { Data?.total && ReportPaySummaryReport(); @@ -810,7 +817,19 @@ function RegisterAly() { }} > 导出 - </span> + </span> */} + <ExportBtnNew + children={<Button className="export-btn" size='medium' type="primary">导出</Button>} + modalType="noImg" + ref={exportRef} + totalRecords={Data?.total || 0} + imgno={false} + postdata={{ + formData: FormDatas + }} + isTableModule={true} + onOk={ReportPaySummaryReport} + /> </div> <ResultFlow hasLoad={true} diff --git a/src/pages/DataAnalysisPrediction/ParkingBusinessAly/CarTypeAly/loadable.jsx b/src/pages/DataAnalysisPrediction/ParkingBusinessAly/CarTypeAly/loadable.jsx index df4efc8..db97457 100644 --- a/src/pages/DataAnalysisPrediction/ParkingBusinessAly/CarTypeAly/loadable.jsx +++ b/src/pages/DataAnalysisPrediction/ParkingBusinessAly/CarTypeAly/loadable.jsx @@ -709,7 +709,7 @@ function CarTypeAly() { exportUrl="/api/ana/dataanalysis/carType_export" postdata={{ // formData: {...pageInfo, export_type: 'all', area_id: sessionTabList?.show} - formData: { ...pageInfo, export: 1, type: tabKey == 2 ? 'road' : 'region', area_id: sessionTabList?.show} + formData: { ...pageInfo, export: 1, type: tabKey == 2 ? 'road' : 'region', ...formData, sort: 'desc', area_id: sessionTabList?.show} }} imgno={false} /> diff --git a/src/pages/InRoadMgm/PersonMgm/Performance/SalesStat/loadable.jsx b/src/pages/InRoadMgm/PersonMgm/Performance/SalesStat/loadable.jsx index 58ad259..833b78a 100644 --- a/src/pages/InRoadMgm/PersonMgm/Performance/SalesStat/loadable.jsx +++ b/src/pages/InRoadMgm/PersonMgm/Performance/SalesStat/loadable.jsx @@ -225,7 +225,7 @@ function SalesStat(props) { setResultData({ ...resultData, data: resDataArr, - total_records: res.data.total_records + total_records: Number(res.data.total_records) }) } else { setResultData({ diff --git a/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/loadable.jsx b/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/loadable.jsx index 114c627..efdbd74 100644 --- a/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/loadable.jsx +++ b/src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/loadable.jsx @@ -398,7 +398,7 @@ function OutSegment() { const handleExport = (start, end) => { if (tableData.length > 0) { let values = searchForm.getFieldsValue(); - let end = values.area?.length > 0 ? values.area.slice(-1) : null; + // let end = values.area?.length > 0 ? values.area.slice(-1) : null; let params = { ...values, start: start, @@ -414,15 +414,15 @@ function OutSegment() { if (res) { // window.open(res.data.export_url) message.success(res.message) - tableRef.current.handleCancel() + exportRef.current.handleCancel() } else { message.error(res?.message); - tableRef.current.handleError() + exportRef.current.handleError() } }, (err) => { console.log(err); - tableRef.current.handleError() + exportRef.current.handleError() } ); } else { @@ -631,7 +631,10 @@ function OutSegment() { totalRecords={total} imgno={false} postdata={{ - formData: formData + formData: { + ...formData, + ...pageData + } }} isTableModule={true} onOk={handleExport} diff --git a/src/services/OutRoadMgm/LiftUpPoleRecord/index.js b/src/services/OutRoadMgm/LiftUpPoleRecord/index.js index e8b450d..528ad68 100644 --- a/src/services/OutRoadMgm/LiftUpPoleRecord/index.js +++ b/src/services/OutRoadMgm/LiftUpPoleRecord/index.js @@ -12,7 +12,7 @@ const getPoleList = (params) => { const poleExport = (params) => { return ajax({ url: "/api/bpm/abnormal/export_lift", - type: "get", + type: "post", data: params, }); };