10 changed files with 848 additions and 59 deletions
-
32src/config/character.config.js
-
67src/pages/DataAnalysisPrediction/ParkingIncomeAly/ArrearageAly/Overview/echarts.config.js
-
64src/pages/DataAnalysisPrediction/ParkingIncomeAly/ArrearageAly/Overview/index.jsx
-
167src/pages/DataAnalysisPrediction/ParkingIncomeAly/ArrearageAly/ParkArrear/index.jsx
-
40src/pages/DataAnalysisPrediction/ParkingIncomeAly/ArrearageAly/ParkArrear/index.scss
-
295src/pages/DataAnalysisPrediction/ParkingIncomeAly/ArrearageAly/PlateArrear/index.jsx
-
56src/pages/DataAnalysisPrediction/ParkingIncomeAly/ArrearageAly/PlateArrear/index.scss
-
5src/pages/DataAnalysisPrediction/ParkingIncomeAly/ArrearageAly/index.scss
-
73src/pages/DataAnalysisPrediction/ParkingIncomeAly/ArrearageAly/loadable.jsx
-
28src/services/DataAnalysisPrediction/ParkingIncomeAly/index.js
@ -1,11 +1,170 @@ |
|||
import React from 'react' |
|||
import React, { useEffect, useState, useImperativeHandle, forwardRef } from 'react' |
|||
import { Table, Pagination, Button } from 'antd' |
|||
import { ResultFlowResult, ExportBtnNew } from '@/components' |
|||
import { dictionary } from "@/config/common" |
|||
import ajax from "@/services" |
|||
import './index.scss' |
|||
|
|||
const ParkArrear = forwardRef((props, ref) => { |
|||
const { |
|||
formData |
|||
} = props |
|||
const [tableLoading, setTableLoading] = useState(false) |
|||
const [pageInfo, setPageInfo] = useState({ |
|||
pn: 1, |
|||
length: 10 |
|||
}) |
|||
const [exportData, setExportData] = useState({ |
|||
start: 1, |
|||
end: 10 |
|||
}) |
|||
const [resultData, setResultData] = useState({ |
|||
list: [], |
|||
totalRecords: 0 |
|||
}) |
|||
|
|||
const tableColumns = [ |
|||
{ |
|||
title: "序号", |
|||
width: 60, |
|||
align: 'center', |
|||
render: (text, record, index) => index + 1, |
|||
}, |
|||
{ |
|||
title: "停车场名称", |
|||
align: 'center', |
|||
dataIndex: "name", |
|||
}, |
|||
{ |
|||
title: "区域", |
|||
align: 'center', |
|||
dataIndex: "area", |
|||
}, |
|||
{ |
|||
title: "累计营收金额", |
|||
align: 'center', |
|||
dataIndex: "ljys", |
|||
}, |
|||
{ |
|||
title: "累计实收金额", |
|||
align: 'center', |
|||
dataIndex: "ljss", |
|||
}, |
|||
{ |
|||
title: "现存欠费金额", |
|||
align: 'center', |
|||
dataIndex: "xcqfje", |
|||
}, |
|||
{ |
|||
title: "现存欠费订单", |
|||
align: 'center', |
|||
dataIndex: 'xcqfdd' |
|||
}, |
|||
{ |
|||
title: '欠费金额占比', |
|||
align: 'center', |
|||
dataIndex: 'ratio', |
|||
render: (text, record) => { |
|||
return text + '%' |
|||
} |
|||
} |
|||
] |
|||
|
|||
const paginationProps = { |
|||
className: "pagination-common", |
|||
showQuickJumper: true, |
|||
showSizeChanger: true, |
|||
current: pageInfo.pn, |
|||
total: resultData?.totalRecords, |
|||
pageSize: pageInfo.length, |
|||
pageSizeOptions: Array.from( |
|||
new Set([...[15], ...(dictionary?.pageSizeOptions || [])]) |
|||
), |
|||
onChange: (current, size) => { |
|||
setPageInfo({ |
|||
...pageInfo, |
|||
...{ pn: current, length: size } |
|||
}); |
|||
} |
|||
} |
|||
|
|||
const ajaxGetTableData = (data) => { |
|||
setTableLoading(true) |
|||
ajax.getIncomeParkArrearData({ |
|||
...data |
|||
}).then(res => { |
|||
if (res.status == 20000) { |
|||
setTableLoading(false) |
|||
setResultData({ |
|||
list: res.data, |
|||
totalRecords: res.totalRecords |
|||
}) |
|||
setExportData({ |
|||
...exportData, |
|||
start: 1, |
|||
end: res.totalRecords |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
const getData = (newPageInfo) => { |
|||
setPageInfo({ |
|||
...newPageInfo |
|||
}) |
|||
ajaxGetTableData({ |
|||
...formData, |
|||
...newPageInfo |
|||
}) |
|||
} |
|||
|
|||
useImperativeHandle(ref, () => ({ |
|||
getData |
|||
})) |
|||
|
|||
useEffect(() => { |
|||
ajaxGetTableData({ |
|||
...formData, |
|||
...pageInfo |
|||
}) |
|||
}, [JSON.stringify(pageInfo)]) |
|||
|
|||
const ParkArrear = function(props) { |
|||
return ( |
|||
<div className="park-arrear-container"> |
|||
ParkArrear |
|||
<div className="park-table-title"> |
|||
<div className="park-table-info">共查询到<span>{ resultData.totalRecords || 0 }</span>条结果</div> |
|||
<div className="park-table-export"> |
|||
<ExportBtnNew |
|||
children={<Button className="export-btn" size='medium' type="primary">导出</Button>} |
|||
modalType="noImg" |
|||
totalRecords={resultData.totalRecords} |
|||
exportUrl="/api/dataAnalysis/arrearsPark/export" |
|||
postdata={{ |
|||
formData: {...formData, ...pageInfo} |
|||
}} |
|||
imgno={false} |
|||
/> |
|||
</div> |
|||
</div> |
|||
<div className="park-table-content"> |
|||
<ResultFlowResult |
|||
ajaxLoad={tableLoading} |
|||
resultData={resultData?.list || []} |
|||
> |
|||
<Table |
|||
className='park-table' |
|||
// rowKey={(row) => row.id} |
|||
dataSource={resultData?.list || []} |
|||
columns={tableColumns} |
|||
pagination={false} |
|||
scroll={{y: 585}} |
|||
loading={tableLoading} |
|||
/> |
|||
<Pagination {...paginationProps} className="pagination-common" /> |
|||
</ResultFlowResult> |
|||
</div> |
|||
</div> |
|||
) |
|||
} |
|||
}) |
|||
|
|||
export default ParkArrear |
@ -0,0 +1,40 @@ |
|||
@import "@/assets/css/mixin.scss"; |
|||
|
|||
.park-table-title { |
|||
margin-bottom: 10px; |
|||
display: flex; |
|||
justify-content: space-between; |
|||
align-items: center; |
|||
.park-table-info { |
|||
span { |
|||
color: var(--color-primary); |
|||
} |
|||
} |
|||
.park-table-export { |
|||
|
|||
} |
|||
} |
|||
.park-arrear-container { |
|||
height: 100%; |
|||
display: flex; |
|||
flex-direction: column; |
|||
.park-table-title { |
|||
height: 25px; |
|||
} |
|||
.park-table-content { |
|||
flex: 1; |
|||
.park-table { |
|||
flex: 1; |
|||
.ant-table-body { |
|||
@include scrollBar(var(--color-user-list-bg), #3B97FF); |
|||
} |
|||
.ant-table-fixed-header .ant-table-tbody tr:nth-child(2n+1) > td { |
|||
background: unset !important; |
|||
background-color: #3e4557 !important; |
|||
} |
|||
.ant-table-fixed-header .ant-table-tbody tr:nth-child(2n+1) > td { |
|||
|
|||
} |
|||
} |
|||
} |
|||
} |
@ -1,10 +1,299 @@ |
|||
import React from 'react' |
|||
import React, {useEffect, useState, useImperativeHandle, forwardRef} from 'react' |
|||
import { ResultFlowResult, ExportBtnNew } from '@/components' |
|||
import { Table, Pagination, Button, Modal } from 'antd' |
|||
import { dictionary } from "@/config/common" |
|||
import ajax from "@/services" |
|||
import './index.scss' |
|||
|
|||
const PlateArrear = function(props) { |
|||
|
|||
const PlateArrear = forwardRef((props, ref) => { |
|||
const { |
|||
formData |
|||
} = props |
|||
const [tableLoading, setTableLoading] = useState(false) |
|||
const [detailVisble, setDetailVisible] = useState(false) |
|||
const [detailPlate, setDetailPlate] = useState('') |
|||
const [pageInfo, setPageInfo] = useState({ |
|||
pn: 1, |
|||
length: 10 |
|||
}) |
|||
const [exportData, setExportData] = useState({ |
|||
start: 1, |
|||
end: 10 |
|||
}) |
|||
const [resultData, setResultData] = useState({ |
|||
list: [], |
|||
totalRecords: 0 |
|||
}) |
|||
|
|||
const handleDetail = (data) => { |
|||
setDetailPlate(data.plate) |
|||
setDetailVisible(true) |
|||
} |
|||
|
|||
const tableColumns = [ |
|||
{ |
|||
title: "序号", |
|||
width: 60, |
|||
align: 'center', |
|||
render: (text, record, index) => index + 1, |
|||
}, |
|||
{ |
|||
title: "车牌号", |
|||
align: 'center', |
|||
dataIndex: "plate", |
|||
}, |
|||
{ |
|||
title: "手机号", |
|||
align: 'center', |
|||
dataIndex: "phone", |
|||
}, |
|||
{ |
|||
title: "欠费金额", |
|||
align: 'center', |
|||
dataIndex: "money", |
|||
}, |
|||
{ |
|||
title: '操作', |
|||
width: 200, |
|||
align: 'center', |
|||
render: (text, record) => { |
|||
return ( |
|||
<Button type='primary' onClick={() => handleDetail(record)}>详情</Button> |
|||
) |
|||
} |
|||
} |
|||
] |
|||
|
|||
const paginationProps = { |
|||
className: "pagination-common", |
|||
showQuickJumper: true, |
|||
showSizeChanger: true, |
|||
current: pageInfo.pn, |
|||
total: resultData?.totalRecords, |
|||
pageSize: pageInfo.length, |
|||
pageSizeOptions: Array.from( |
|||
new Set([...[15], ...(dictionary?.pageSizeOptions || [])]) |
|||
), |
|||
onChange: (current, size) => { |
|||
setPageInfo({ |
|||
...pageInfo, |
|||
...{ pn: current, length: size } |
|||
}); |
|||
} |
|||
} |
|||
|
|||
const ajaxGetTableData = (data) => { |
|||
setTableLoading(true) |
|||
ajax.getIncomePlateArrearData({ |
|||
...data |
|||
}).then(res => { |
|||
if (res.status == 20000) { |
|||
setTableLoading(false) |
|||
setResultData({ |
|||
list: res.data, |
|||
totalRecords: res.totalRecords |
|||
}) |
|||
setExportData({ |
|||
...exportData, |
|||
start: 1, |
|||
end: res.totalRecords |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
const getData = (newPageInfo) => { |
|||
setPageInfo({ |
|||
...newPageInfo |
|||
}) |
|||
ajaxGetTableData({ |
|||
...formData, |
|||
...newPageInfo |
|||
}) |
|||
} |
|||
|
|||
useImperativeHandle(ref, () => ({ |
|||
getData |
|||
})) |
|||
|
|||
useEffect(() => { |
|||
ajaxGetTableData({ |
|||
...formData, |
|||
...pageInfo |
|||
}) |
|||
}, [JSON.stringify(pageInfo)]) |
|||
return ( |
|||
<div className="plate-arrear-container"> |
|||
PlateArrear |
|||
<div className="park-table-title"> |
|||
<div className="park-table-info">共查询到<span>{ resultData.totalRecords || 0 }</span>条结果</div> |
|||
<div className="park-table-export"> |
|||
<ExportBtnNew |
|||
children={<Button className="export-btn" size='medium' type="primary">导出</Button>} |
|||
modalType="noImg" |
|||
totalRecords={resultData.totalRecords} |
|||
exportUrl="/api/dataAnalysis/arrearsPlate/export" |
|||
postdata={{ |
|||
formData: {...formData, ...pageInfo} |
|||
}} |
|||
imgno={false} |
|||
/> |
|||
</div> |
|||
</div> |
|||
<div className="park-table-content"> |
|||
<ResultFlowResult |
|||
ajaxLoad={tableLoading} |
|||
resultData={resultData?.list || []} |
|||
> |
|||
<Table |
|||
className='park-table' |
|||
// rowKey={(row) => row.id} |
|||
dataSource={resultData?.list || []} |
|||
columns={tableColumns} |
|||
pagination={false} |
|||
scroll={{y: 585}} |
|||
loading={tableLoading} |
|||
/> |
|||
<Pagination {...paginationProps} className="pagination-common" /> |
|||
</ResultFlowResult> |
|||
</div> |
|||
<ModalDetail |
|||
visible={detailVisble} |
|||
plate_number={detailPlate} |
|||
onOk={() => setDetailVisible(false)} |
|||
onCancel={() => setDetailVisible(false)} |
|||
/> |
|||
</div> |
|||
) |
|||
}) |
|||
|
|||
const ModalDetail = (props) => { |
|||
const { |
|||
visible, |
|||
onOk, |
|||
plate_number, |
|||
onCancel |
|||
} = props |
|||
|
|||
const [tableLoading, setTableLoading] = useState(false) |
|||
const [resultData, setResultData] = useState({ |
|||
list: [], |
|||
totalRecords: 0 |
|||
}) |
|||
const [formData, setFormData] = useState({ |
|||
pn: 1, |
|||
length: 10, |
|||
plate_number: plate_number |
|||
}) |
|||
const [pageInfo, setPageInfo] = useState({ |
|||
pn: 1, |
|||
length: 10 |
|||
}) |
|||
|
|||
const tableColumns = [ |
|||
{ |
|||
title: "车牌号", |
|||
align: 'center', |
|||
dataIndex: "plate", |
|||
}, |
|||
{ |
|||
title: "停车场", |
|||
align: 'center', |
|||
dataIndex: "park", |
|||
}, |
|||
{ |
|||
title: "入场时间", |
|||
align: 'center', |
|||
dataIndex: "entry_time", |
|||
}, |
|||
{ |
|||
title: "出场时间", |
|||
align: 'center', |
|||
dataIndex: "leave_time", |
|||
}, |
|||
{ |
|||
title: "停车时长", |
|||
align: 'center', |
|||
dataIndex: "duration", |
|||
}, |
|||
{ |
|||
title: "欠费金额", |
|||
align: 'center', |
|||
dataIndex: "money", |
|||
}, |
|||
] |
|||
|
|||
const paginationProps = { |
|||
className: "pagination-common", |
|||
showQuickJumper: true, |
|||
showSizeChanger: true, |
|||
current: pageInfo.pn, |
|||
total: resultData?.totalRecords, |
|||
pageSize: pageInfo.length, |
|||
pageSizeOptions: Array.from( |
|||
new Set([...[15], ...(dictionary?.pageSizeOptions || [])]) |
|||
), |
|||
onChange: (current, size) => { |
|||
setPageInfo({ |
|||
...pageInfo, |
|||
...{ pn: current, length: size } |
|||
}); |
|||
} |
|||
} |
|||
|
|||
const ajaxGetDetailData = () => { |
|||
setTableLoading(true) |
|||
ajax.getPlateArrearData({...formData, ...pageInfo}).then(res => { |
|||
if (res.status == 20000) { |
|||
setTableLoading(false) |
|||
setResultData({ |
|||
list: res.data, |
|||
totalRecords: res.totalRecords |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
useEffect(() => { |
|||
setFormData({ |
|||
pn: 1, |
|||
length: 10, |
|||
plate_number: plate_number |
|||
}) |
|||
}, [plate_number]) |
|||
|
|||
useEffect(() => { |
|||
ajaxGetDetailData() |
|||
}, [JSON.stringify(formData), JSON.stringify(pageInfo)]) |
|||
|
|||
return ( |
|||
<Modal |
|||
className="yisa-modal detail-modal" |
|||
title={"弹窗详情"} |
|||
open={visible} |
|||
width={700} |
|||
onCancel={onCancel} |
|||
onOk={onOk} |
|||
> |
|||
<div className="detail-modal-container"> |
|||
<div className="detail-title">欠费总分析详情</div> |
|||
<ResultFlowResult |
|||
ajaxLoad={tableLoading} |
|||
resultData={resultData?.list || []} |
|||
> |
|||
<Table |
|||
className='park-table' |
|||
// rowKey={(row) => row.id} |
|||
dataSource={resultData?.list || []} |
|||
columns={tableColumns} |
|||
pagination={false} |
|||
scroll={{y: 200}} |
|||
loading={tableLoading} |
|||
/> |
|||
<Pagination {...paginationProps} className="pagination-common" /> |
|||
</ResultFlowResult> |
|||
</div> |
|||
</Modal> |
|||
) |
|||
} |
|||
|
@ -0,0 +1,56 @@ |
|||
@import "@/assets/css/mixin.scss"; |
|||
|
|||
.park-table-title { |
|||
margin-bottom: 10px; |
|||
display: flex; |
|||
justify-content: space-between; |
|||
align-items: center; |
|||
.park-table-info { |
|||
span { |
|||
color: var(--color-primary); |
|||
} |
|||
} |
|||
.park-table-export { |
|||
|
|||
} |
|||
} |
|||
.plate-arrear-container { |
|||
height: 100%; |
|||
display: flex; |
|||
flex-direction: column; |
|||
.park-table-title { |
|||
height: 25px; |
|||
} |
|||
.park-table-content { |
|||
flex: 1; |
|||
.park-table { |
|||
flex: 1; |
|||
.ant-table-body { |
|||
@include scrollBar(var(--color-user-list-bg), #3B97FF); |
|||
} |
|||
.ant-table-fixed-header .ant-table-tbody tr:nth-child(2n+1) > td { |
|||
background: unset !important; |
|||
background-color: #3e4557 !important; |
|||
} |
|||
.ant-table-fixed-header .ant-table-tbody tr:nth-child(2n+1) > td { |
|||
|
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
.detail-modal { |
|||
.ant-modal-body { |
|||
padding-top: 0; |
|||
padding-bottom: 5px; |
|||
.detail-title { |
|||
margin-bottom: 10px; |
|||
} |
|||
.ant-table-thead>tr>th { |
|||
background-color: #616b83; |
|||
} |
|||
.ant-table-body { |
|||
@include scrollBar(var(--color-user-list-bg), #3B97FF); |
|||
} |
|||
} |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue