Browse Source

养护抽查 道路名称搜索

dev
wenlele 1 year ago
parent
commit
095d224d62
  1. 1912
      api/app/lib/controllers/report/index.js
  2. 5
      web/client/src/sections/fillion/components/adjustment.js
  3. 100
      web/client/src/sections/fillion/containers/maintenanceSpotCheck-new.js

1912
api/app/lib/controllers/report/index.js

File diff suppressed because it is too large

5
web/client/src/sections/fillion/components/adjustment.js

@ -156,9 +156,10 @@ const Adjustment = (props) => {
if (allValues?.routeName && allValues?.routeCode && allValues?.sectionNo) { if (allValues?.routeName && allValues?.routeCode && allValues?.sectionNo) {
let find = road?.find(s => allValues?.routeName == s.routeName && allValues?.routeCode == s.routeCode && allValues?.sectionNo == s.sectionNo)
form.setFieldsValue({ form.setFieldsValue({
'startingPlaceName': data[0]?.startingPlaceName, 'startingPlaceName': find?.startingPlaceName,
'stopPlaceName': data[0]?.stopPlaceName 'stopPlaceName': find?.stopPlaceName
}) })
} else { } else {
form.setFieldsValue({ form.setFieldsValue({

100
web/client/src/sections/fillion/containers/maintenanceSpotCheck-new.js

@ -15,6 +15,7 @@ const MaintenanceSpotCheck = (props) => {
const [vis, setVis] = useState(false)//模态框的显示与隐藏变量 const [vis, setVis] = useState(false)//模态框的显示与隐藏变量
const [count, setCount] = useState(0) const [count, setCount] = useState(0)
const [page, setPage] = useState(1) const [page, setPage] = useState(1)
const [innerPage, setInnerPage] = useState(1)
const [depName, setDepName] = useState('') const [depName, setDepName] = useState('')
const [total, setTotal] = useState(0) const [total, setTotal] = useState(0)
const [previewId, setPreviewId] = useState(0) const [previewId, setPreviewId] = useState(0)
@ -26,6 +27,7 @@ const MaintenanceSpotCheck = (props) => {
const [expandedRowKeys, setExpandedRowKeys] = useState([]); const [expandedRowKeys, setExpandedRowKeys] = useState([]);
const [isAdjustment, setIsAdjustment] = useState(false); const [isAdjustment, setIsAdjustment] = useState(false);
const [editData, setEditData] = useState({}); const [editData, setEditData] = useState({});
const [keyword, setKeyword] = useState("");
@ -71,6 +73,7 @@ const MaintenanceSpotCheck = (props) => {
dispatch(roadSpotList(data)).then(res => { dispatch(roadSpotList(data)).then(res => {
if (res.success) { if (res.success) {
setReportData(res?.payload.data) setReportData(res?.payload.data)
setKeyword("")
} }
}) })
} }
@ -78,6 +81,7 @@ const MaintenanceSpotCheck = (props) => {
const detailData = (data = {}) => { const detailData = (data = {}) => {
dispatch(roadSpotDetail(data)).then(res => { dispatch(roadSpotDetail(data)).then(res => {
if (res.success) { if (res.success) {
setInnerPage(1)
setDetailList(res?.payload.data) setDetailList(res?.payload.data)
} }
}) })
@ -120,6 +124,7 @@ const MaintenanceSpotCheck = (props) => {
setVis(true) setVis(true)
}} type='primary' style={{ marginLeft: 10 }}> 新增 </Button> }} type='primary' style={{ marginLeft: 10 }}> 新增 </Button>
<div> <div>
<RangePicker value={dateRange[0] ? [moment(dateRange[0]), moment(dateRange[1])] : []} onChange={(date, dateString) => { <RangePicker value={dateRange[0] ? [moment(dateRange[0]), moment(dateRange[1])] : []} onChange={(date, dateString) => {
setDateRange(dateString) setDateRange(dateString)
}} style={{ marginRight: 20 }} /> }} style={{ marginRight: 20 }} />
@ -143,6 +148,7 @@ const MaintenanceSpotCheck = (props) => {
expandedRowKeys: expandedRowKeys, // 控制哪些行展开,这里需要通过 state 管理 expandedRowKeys: expandedRowKeys, // 控制哪些行展开,这里需要通过 state 管理
// defaultExpandedRowKeys: ['0'], // defaultExpandedRowKeys: ['0'],
onExpand: (expanded, record) => { onExpand: (expanded, record) => {
setKeyword("")
if (expanded) { if (expanded) {
setExpandedRowKeys([record?.id]) setExpandedRowKeys([record?.id])
detailData({ previewId: record?.id }) detailData({ previewId: record?.id })
@ -152,44 +158,62 @@ const MaintenanceSpotCheck = (props) => {
} }
}, },
expandedRowRender: (record) => ( expandedRowRender: (record) => (
< Table <>
pagination={{ <div style={{ textAlign: 'end' }}>
pageSize: 10, <Input style={{ width: 160, marginRight: 16 }} onPressEnter={() => {
defaultPageSize: 10, detailData({ previewId: record?.id, keyword: keyword })
showSizeChanger: false, }} value={keyword} placeholder='道路名称关键字' onChange={(e) => {
}} setKeyword(e.target.value)
loading={detailLoading} }} />
style={{ margin: 0 }} <Button style={{ marginRight: 20 }} onClick={() => {
dataSource={detailList} detailData({ previewId: record?.id, keyword: keyword })
columns={ }} > 查询 </Button>
[ </div>
{ < Table
title: '道路类型', key: 'level', dataIndex: 'level', render: (_, r) => r?.road?.level ? (r?.road?.level + '道') : '--' pagination={{
}, total: detailList?.length || 0,
{ title: '道路名称', key: 'routeName', dataIndex: 'routeName', render: (_, r) => r.road?.routeName || '--' }, pageSize: 10,
{ title: '道路代码', key: 'routeCode', dataIndex: 'routeCode', render: (_, r) => r.road?.routeCode || '--' }, current: innerPage || 1,
{ title: '路段序号', key: 'sectionNo', dataIndex: 'sectionNo', render: (_, r) => r.road?.sectionNo || '--' }, defaultPageSize: 10,
{ title: '起点地名', key: 'startingPlaceName', dataIndex: 'startingPlaceName', render: (_, r) => r.road?.startingPlaceName || '--' }, showSizeChanger: false,
{ title: '止点地名', key: 'stopPlaceName', dataIndex: 'stopPlaceName', render: (_, r) => r.road?.stopPlaceName || '--' }, onChange: (page, pageSize) => {
{ title: '里程', key: 'chainageMileage', dataIndex: 'chainageMileage', render: (_, r) => r.road?.chainageMileage || '--' }, setInnerPage(page)
{ title: '养护次数(次)', key: 'maintenanceCount', dataIndex: 'maintenanceCount' }, }
{ }}
title: '操作', loading={detailLoading}
key: 'action', style={{ margin: 0 }}
dataIndex: 'action', dataSource={detailList}
render: (_, r, index) => <Button disabled={reportData[0]?.id == record?.id ? false : true} type="link" onClick={() => { columns={
setEditData({ [
...r, alterId: r?.road?.level == '县' ? record?.countyRoadId {
: r?.road?.level == '乡' ? record?.townshipRoadId title: '道路类型', key: 'level', dataIndex: 'level', render: (_, r) => r?.road?.level ? (r?.road?.level + '道') : '--'
: r?.road?.level == '村' ? record?.villageId : [], },
previewId: record?.id { title: '道路名称', key: 'routeName', dataIndex: 'routeName', render: (_, r) => r.road?.routeName || '--' },
}) { title: '道路代码', key: 'routeCode', dataIndex: 'routeCode', render: (_, r) => r.road?.routeCode || '--' },
setIsAdjustment(true) { title: '路段序号', key: 'sectionNo', dataIndex: 'sectionNo', render: (_, r) => r.road?.sectionNo || '--' },
}}> 调整 </Button > { title: '起点地名', key: 'startingPlaceName', dataIndex: 'startingPlaceName', render: (_, r) => r.road?.startingPlaceName || '--' },
}, { title: '止点地名', key: 'stopPlaceName', dataIndex: 'stopPlaceName', render: (_, r) => r.road?.stopPlaceName || '--' },
]} { title: '里程', key: 'chainageMileage', dataIndex: 'chainageMileage', render: (_, r) => r.road?.chainageMileage || '--' },
{ title: '养护次数(次)', key: 'maintenanceCount', dataIndex: 'maintenanceCount' },
/> {
title: '操作',
key: 'action',
dataIndex: 'action',
render: (_, r, index) => <Button disabled={reportData[0]?.id == record?.id ? false : true} type="link" onClick={() => {
setEditData({
...r, alterId: r?.road?.level == '县' ? record?.countyRoadId
: r?.road?.level == '乡' ? record?.townshipRoadId
: r?.road?.level == '村' ? record?.villageId : [],
previewId: record?.id
})
setIsAdjustment(true)
}}> 调整 </Button >
},
]}
/>
</>
), ),
}} }}
pagination={{ pagination={{

Loading…
Cancel
Save