CODE
1 year ago
12 changed files with 1530 additions and 741 deletions
@ -0,0 +1,111 @@ |
|||
import { basicAction } from '@peace/utils' |
|||
import { ApiTable } from '$utils' |
|||
|
|||
export function roadSpotList (query = {}) { |
|||
return dispatch => basicAction({ |
|||
type: 'get', |
|||
dispatch: dispatch, |
|||
query: query, |
|||
actionType: 'GET_ROAD_STOP_LIST', |
|||
url: 'road/spot/list', |
|||
msg: { error: '获取抽查列表失败' }, |
|||
reducer: { name: 'roadSpotList' } |
|||
}); |
|||
} |
|||
|
|||
|
|||
export function roadSpotDetail (query = {}) { |
|||
return dispatch => basicAction({ |
|||
type: 'get', |
|||
dispatch: dispatch, |
|||
query: query, |
|||
actionType: 'GET_ROAD_STOP_DETAIL', |
|||
url: 'road/spot/detail', |
|||
msg: { error: '获取抽查详情失败' }, |
|||
reducer: { name: 'roadSpotDetail' } |
|||
}); |
|||
} |
|||
|
|||
|
|||
export function roadSpotPrepare (data = {}) { |
|||
return dispatch => basicAction({ |
|||
type: 'post', |
|||
dispatch: dispatch, |
|||
data: data, |
|||
actionType: 'POST_ROAD_STOP_PREPARE', |
|||
url: 'road/spot/prepare', |
|||
msg: { option: '抽取' }, |
|||
reducer: { name: 'roadSpotPrepare' } |
|||
}); |
|||
} |
|||
|
|||
|
|||
export function confirmRoadSpot (data = {}) { |
|||
return dispatch => basicAction({ |
|||
type: 'post', |
|||
dispatch: dispatch, |
|||
data: data, |
|||
actionType: 'POST_ROAD_STOP_CONFIRM', |
|||
url: 'road/spot/confirm', |
|||
msg: { option: '确认抽取' }, |
|||
reducer: { name: 'confirmRoadSpot' } |
|||
}); |
|||
} |
|||
|
|||
export function exportSpotRode (query = {}) { |
|||
return dispatch => basicAction({ |
|||
type: 'get', |
|||
dispatch: dispatch, |
|||
query: query, |
|||
actionType: 'GET_ROAD_STOP_EXPORT', |
|||
url: 'road/spot/export', |
|||
msg: { option: '导出路线抽查' }, |
|||
reducer: { name: '' } |
|||
}); |
|||
} |
|||
|
|||
export function roadSpotChangList (query = {}) { |
|||
return dispatch => basicAction({ |
|||
type: 'get', |
|||
dispatch: dispatch, |
|||
query: query, |
|||
actionType: 'GET_ROAD_STOP_CHANG_LIST', |
|||
url: 'road/spot/change', |
|||
msg: { error: '获取抽查路线更改列表' }, |
|||
reducer: { name: 'roadSpotChangList' } |
|||
}); |
|||
} |
|||
|
|||
|
|||
export function roadSpotChange (data = {}) { |
|||
return dispatch => basicAction({ |
|||
type: 'post', |
|||
dispatch: dispatch, |
|||
data: data, |
|||
actionType: 'POST_ROAD_STOP_CHANGE', |
|||
url: 'road/spot/change', |
|||
msg: { option: '更改抽查路线' }, |
|||
reducer: { name: '' } |
|||
}); |
|||
} |
|||
|
|||
// export function delAssess (query) {
|
|||
// return dispatch => basicAction({
|
|||
// type: 'del',
|
|||
// dispatch: dispatch,
|
|||
// actionType: 'DEL_ASSESS',
|
|||
// url: ApiTable.delAssess.replace("{assessId}", query?.id),
|
|||
// msg: { option: '删除考核评分信息' },
|
|||
// });
|
|||
// }
|
|||
|
|||
// export function editAssess (query) {
|
|||
// return dispatch => basicAction({
|
|||
// type: 'put',
|
|||
// dispatch: dispatch,
|
|||
// data: query,
|
|||
// actionType: 'PUT_ASSESS',
|
|||
// url: ApiTable.editAssess,
|
|||
// msg: { option: '编辑/新增考核评分信息' },
|
|||
// });
|
|||
// }
|
@ -0,0 +1,181 @@ |
|||
import { connect } from 'react-redux'; |
|||
import React, { useEffect, useState } from 'react'; |
|||
import { Button, Modal, Form, Input, Divider, Spin, Select, DatePicker, Descriptions, Table } from 'antd' |
|||
import { roadSpotChange } from '../actions/spotCheck'; |
|||
import { getRoadway } from "../actions/infor" |
|||
|
|||
import moment from 'moment' |
|||
import '../components/maintenanceTable.less' |
|||
|
|||
|
|||
|
|||
const Adjustment = (props) => { |
|||
const { dispatch, user, loading, reportDetail, editData, onCancel, road, onOk } = props |
|||
const [data, setData] = useState()//外层表格的数据
|
|||
const [vis, setVis] = useState(false)//模态框的显示与隐藏变量
|
|||
const [count, setCount] = useState(0) |
|||
const [page, setPage] = useState(1) |
|||
const [depName, setDepName] = useState('') |
|||
const [total, setTotal] = useState(0) |
|||
const [previewId, setPreviewId] = useState(0) |
|||
const [reportData, setReportData] = useState([]) |
|||
const [detailList, setDetailList] = useState([]) |
|||
const [detailVisible, setDetailVisible] = useState(false) |
|||
const [dateRange, setDateRange] = useState([]); |
|||
const { RangePicker } = DatePicker |
|||
const [nameList, setNameList] = useState([]); |
|||
const [codeList, setCodeList] = useState([]); |
|||
const [indexList, setIndexList] = useState([]); |
|||
const [roadFind, setRoadFind] = useState({}); |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
useEffect(() => { |
|||
if (editData?.id) { |
|||
dispatch(getRoadway({ level: editData?.road?.level, alterId: editData?.alterId })).then(res => { |
|||
if (res.success) { |
|||
let name = [] |
|||
let code = [] |
|||
let index = [] |
|||
res?.payload.data?.forEach(v => { |
|||
if (v.routeName && !name.includes(v.routeName)) { |
|||
name.push(v.routeName) |
|||
} |
|||
if (v.routeCode && !code.includes(v.routeCode)) { |
|||
code.push(v.routeCode) |
|||
} |
|||
if (v.sectionNo && !index.includes(v.sectionNo)) { |
|||
index.push(v.sectionNo) |
|||
} |
|||
}); |
|||
setNameList(name) |
|||
setCodeList(code) |
|||
setIndexList(index) |
|||
} |
|||
}) |
|||
} |
|||
}, []) |
|||
|
|||
|
|||
const [form] = Form.useForm() |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
return ( |
|||
<Modal visible={true} |
|||
onCancel={() => { |
|||
onCancel() |
|||
}} |
|||
title='调整' onOk={() => { |
|||
form.validateFields().then((values) => { |
|||
let data = road?.find(d => values?.routeName == d?.routeName |
|||
&& values?.routeCode == d?.routeCode && values?.sectionNo == d?.sectionNo) |
|||
dispatch(roadSpotChange({ |
|||
previewId: editData?.previewId, |
|||
originRoadId: editData?.id, |
|||
changeRoadId: data?.id |
|||
})).then(res => { |
|||
if (res.success) { |
|||
onCancel() |
|||
onOk() |
|||
} |
|||
}); |
|||
}) |
|||
|
|||
|
|||
|
|||
|
|||
}}> |
|||
<Form form={form} labelCol={{ span: 4 }} onValuesChange={(changedValues, allValues) => { |
|||
let name = [] |
|||
let code = [] |
|||
let index = [] |
|||
let data = road?.filter(d => (allValues?.routeName ? allValues?.routeName == d?.routeName : true) |
|||
&& (allValues?.routeCode ? allValues?.routeCode == d?.routeCode : true) && |
|||
(allValues?.sectionNo ? allValues?.sectionNo == d?.sectionNo : true)) |
|||
|
|||
data?.forEach(v => { |
|||
if (v.routeName && !name.includes(v.routeName)) { |
|||
name.push(v.routeName) |
|||
} |
|||
if (v.routeCode && !code.includes(v.routeCode)) { |
|||
code.push(v.routeCode) |
|||
} |
|||
if (v.sectionNo && !index.includes(v.sectionNo)) { |
|||
index.push(v.sectionNo) |
|||
} |
|||
}); |
|||
setNameList(name) |
|||
setCodeList(code) |
|||
setIndexList(index) |
|||
|
|||
if (allValues?.routeName && allValues?.routeCode && allValues?.sectionNo) { |
|||
form.setFieldsValue({ |
|||
'startingPlaceName': data[0]?.startingPlaceName, |
|||
'stopPlaceName': data[0]?.stopPlaceName |
|||
}) |
|||
} else { |
|||
form.setFieldsValue({ |
|||
'startingPlaceName': null, |
|||
'stopPlaceName': null |
|||
}) |
|||
} |
|||
|
|||
}}> |
|||
<Form.Item label='道路类型' name='type' initialValue={editData?.road?.level ? (editData?.road?.level + "道") : ""} > |
|||
<Input disabled style={{ marginBottom: 10 }} /> |
|||
</Form.Item> |
|||
<Form.Item |
|||
label="路线名称" |
|||
name="routeName" |
|||
rules={[{ required: true, message: '请选择路线名称' }]} |
|||
> |
|||
<Select style={{ marginBottom: 10 }} allowClear showSearch={true} placeholder="请选择路线名称" options={nameList?.map(v => ({ value: v, label: v })) || []} /> |
|||
</Form.Item> |
|||
<Form.Item |
|||
label="路线代码" |
|||
name="routeCode" |
|||
rules={[{ required: true, message: '请选择路线代码' }]} |
|||
> |
|||
<Select style={{ marginBottom: 10 }} allowClear showSearch={true} placeholder="请选择路线代码" options={codeList?.map(v => ({ value: v, label: v })) || []} /> |
|||
</Form.Item> |
|||
<Form.Item |
|||
label="路段序号" |
|||
name="sectionNo" |
|||
rules={[{ required: true, message: '请选择抽取比例' }]} |
|||
> |
|||
<Select style={{}} allowClear showSearch={true} placeholder="请选择抽取比例" options={indexList?.map(v => ({ value: v, label: v })) || []} /> |
|||
</Form.Item> |
|||
|
|||
<Form.Item label='起点地名' name='startingPlaceName'> |
|||
<Input disabled /> |
|||
</Form.Item> |
|||
<Form.Item label='止点地名' name='stopPlaceName'> |
|||
<Input disabled /> |
|||
</Form.Item> |
|||
</Form> |
|||
</Modal> |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
) |
|||
} |
|||
function mapStateToProps (state) { |
|||
const { auth, road } = state |
|||
//('state1', state)
|
|||
return { |
|||
user: auth.user, |
|||
road: road?.data || [], |
|||
} |
|||
} |
|||
export default connect(mapStateToProps)(Adjustment); |
@ -0,0 +1,190 @@ |
|||
import { connect } from 'react-redux'; |
|||
import React, { useEffect, useState } from 'react'; |
|||
import { Button, Modal, Form, Input, Divider, Spin, Select, DatePicker, Descriptions, Table } from 'antd' |
|||
const { TextArea } = Input; |
|||
import { roadSpotChangList } from '../actions/spotCheck'; |
|||
import moment from 'moment' |
|||
import '../components/maintenanceTable.less' |
|||
|
|||
|
|||
|
|||
const AdjustLog = (props) => { |
|||
const { dispatch, user, loading, reportDetail, reportDetailLoading, detailLoading } = props |
|||
const [data, setData] = useState()//外层表格的数据
|
|||
const [vis, setVis] = useState(false)//模态框的显示与隐藏变量
|
|||
const [count, setCount] = useState(0) |
|||
const [page, setPage] = useState(1) |
|||
const [depName, setDepName] = useState('') |
|||
const [total, setTotal] = useState(0) |
|||
const [previewId, setPreviewId] = useState(0) |
|||
const [reportData, setReportData] = useState([]) |
|||
const [detailList, setDetailList] = useState([]) |
|||
const [detailVisible, setDetailVisible] = useState(false) |
|||
const [dateRange, setDateRange] = useState([]); |
|||
const { RangePicker } = DatePicker |
|||
const [expandedRowKeys, setExpandedRowKeys] = useState([]); |
|||
|
|||
|
|||
//console.log('reportData', reportData)
|
|||
const [form] = Form.useForm() |
|||
|
|||
|
|||
|
|||
//里层列名
|
|||
const columns = [ |
|||
{ |
|||
title: '抽查日期', |
|||
key: 'date', |
|||
dataIndex: 'date', |
|||
render: (_, record) => record?.roadSpotCheckPreview?.date && moment(record?.roadSpotCheckPreview?.date).format('YYYY-MM-DD') || '--' |
|||
}, |
|||
{ |
|||
title: '调整内容', |
|||
key: 'content', |
|||
dataIndex: 'content', |
|||
}, |
|||
{ |
|||
title: '调整人员', |
|||
key: 'user', |
|||
dataIndex: 'user', |
|||
render: (_, record) => record?.user?.name || '--' |
|||
}, |
|||
{ |
|||
title: '调整时间', |
|||
key: 'time', |
|||
dataIndex: 'time', |
|||
render: (_, record) => record?.time && moment(record?.time).format('YYYY-MM-DD HH:mm:ss') || '--' |
|||
|
|||
}, |
|||
{ |
|||
title: '操作', |
|||
key: 'operation', |
|||
dataIndex: 'operation', |
|||
render: (_, record) => <Button type="link" onClick={() => { |
|||
setVis(true) |
|||
form.setFieldsValue({ |
|||
'date': record?.roadSpotCheckPreview?.date && moment(record?.roadSpotCheckPreview?.date).format('YYYY-MM-DD') || '--', |
|||
'content': record?.content, |
|||
'user': record?.user?.name || '--', |
|||
'time': record?.time && moment(record?.time).format('YYYY-MM-DD HH:mm:ss') || '--', |
|||
}) |
|||
}}> 查看详情 </Button > |
|||
|
|||
}, |
|||
|
|||
] |
|||
const queryData = (data = {}) => { |
|||
dispatch(roadSpotChangList(data)).then(res => { |
|||
if (res.success) { |
|||
setReportData(res?.payload.data) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
useEffect(() => { |
|||
queryData() |
|||
}, []) |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
const cancelHandler = () => { |
|||
setVis(false) |
|||
form.resetFields() |
|||
} |
|||
|
|||
|
|||
|
|||
return ( |
|||
<div> |
|||
|
|||
<div style={{ marginBottom: 16 }}> |
|||
抽查日期: |
|||
<RangePicker value={dateRange[0] ? [moment(dateRange[0]), moment(dateRange[1])] : []} onChange={(date, dateString) => { |
|||
setDateRange(dateString) |
|||
}} style={{ marginRight: 20 }} /> |
|||
<Button style={{ marginRight: 20 }} onClick={() => { |
|||
setPage(1) |
|||
setExpandedRowKeys([]) |
|||
queryData({ startTime: dateRange[0], endTime: dateRange[1] }) |
|||
}} > 查询 </Button> |
|||
<Button style={{ marginRight: 20 }} onClick={() => { |
|||
setDateRange([]) |
|||
}} > 重置 </Button> |
|||
|
|||
</div> |
|||
|
|||
|
|||
<Table |
|||
columns={columns} |
|||
dataSource={reportData} |
|||
loading={loading} |
|||
pagination={{ |
|||
total: reportData?.length || 0, |
|||
pageSize: 10, |
|||
current: page || 1, |
|||
defaultPageSize: 10, |
|||
showSizeChanger: false, |
|||
onChange: (page, pageSize) => { |
|||
setPage(page) |
|||
} |
|||
}} |
|||
rowKey={(record) => { return record.id }} |
|||
/> |
|||
|
|||
|
|||
{vis && <Modal visible={vis} onCancel={cancelHandler} title='查看详情' |
|||
footer={<Button onClick={() => { |
|||
setVis(false) |
|||
form.resetFields() |
|||
}} > 重置 </Button>} |
|||
onOk={() => { |
|||
form.resetFields() |
|||
setVis(false) |
|||
}}> |
|||
<Form form={form}> |
|||
|
|||
<Form.Item label='抽查日期' name='date'> |
|||
<Input disabled /> |
|||
</Form.Item> |
|||
<Form.Item label='调整内容' name='content'> |
|||
<TextArea |
|||
disabled |
|||
placeholder="" |
|||
autoSize={{ |
|||
minRows: 2, |
|||
maxRows: 6, |
|||
}} |
|||
/> |
|||
</Form.Item> |
|||
<Form.Item label='调整人员' name='user'> |
|||
<Input disabled /> |
|||
</Form.Item> |
|||
<Form.Item label='调整时间' name='time'> |
|||
<Input disabled /> |
|||
</Form.Item> |
|||
</Form> |
|||
</Modal>} |
|||
|
|||
|
|||
|
|||
</div> |
|||
) |
|||
} |
|||
function mapStateToProps (state) { |
|||
const { auth, roadSpotList, reportDetail, roadSpotDetail } = state |
|||
//('state1', state)
|
|||
return { |
|||
user: auth.user, |
|||
loading: roadSpotList?.isRequesting, |
|||
detailLoading: roadSpotDetail?.isRequesting, |
|||
reportDetailLoading: reportDetail.isRequesting, |
|||
reportDetail: reportDetail.data, |
|||
|
|||
} |
|||
} |
|||
export default connect(mapStateToProps)(AdjustLog); |
@ -0,0 +1,290 @@ |
|||
import { connect } from 'react-redux'; |
|||
import React, { useEffect, useState } from 'react'; |
|||
import { Button, Modal, Form, Input, Divider, Spin, Select, DatePicker, Descriptions, Table } from 'antd' |
|||
import { roadSpotList, roadSpotDetail, roadSpotPrepare, confirmRoadSpot, exportSpotRode } from '../actions/spotCheck'; |
|||
import moment from 'moment' |
|||
import Adjustment from '../components/adjustment' |
|||
import '../components/maintenanceTable.less' |
|||
|
|||
|
|||
|
|||
const MaintenanceSpotCheck = (props) => { |
|||
const { dispatch, user, loading, reportDetail, reportDetailLoading, detailLoading } = props |
|||
const [data, setData] = useState()//外层表格的数据
|
|||
const [vis, setVis] = useState(false)//模态框的显示与隐藏变量
|
|||
const [count, setCount] = useState(0) |
|||
const [page, setPage] = useState(1) |
|||
const [depName, setDepName] = useState('') |
|||
const [total, setTotal] = useState(0) |
|||
const [previewId, setPreviewId] = useState(0) |
|||
const [reportData, setReportData] = useState([]) |
|||
const [detailList, setDetailList] = useState([]) |
|||
const [detailVisible, setDetailVisible] = useState(false) |
|||
const [dateRange, setDateRange] = useState([]); |
|||
const { RangePicker } = DatePicker |
|||
const [expandedRowKeys, setExpandedRowKeys] = useState([]); |
|||
const [isAdjustment, setIsAdjustment] = useState(false); |
|||
const [editData, setEditData] = useState({}); |
|||
|
|||
|
|||
|
|||
|
|||
//里层列名
|
|||
const columns = [ |
|||
{ |
|||
title: '抽查日期', |
|||
key: 'date', |
|||
dataIndex: 'date', |
|||
render: (_, record) => record?.date && moment(record?.date).format('YYYY-MM-DD') || '--' |
|||
}, |
|||
{ |
|||
title: '抽查县道比率(%)', |
|||
key: 'countyPercentage', |
|||
dataIndex: 'countyPercentage', |
|||
}, |
|||
{ |
|||
title: '抽查县道', |
|||
key: 'spotCountyRoadCount', |
|||
dataIndex: 'spotCountyRoadCount', |
|||
}, |
|||
{ |
|||
title: '抽查乡道', |
|||
key: 'spotTownRoadCount', |
|||
dataIndex: 'spotTownRoadCount', |
|||
}, |
|||
{ |
|||
title: '抽查村道', |
|||
key: 'spotVillageRoadCount', |
|||
dataIndex: 'spotVillageRoadCount', |
|||
}, |
|||
{ |
|||
title: '操作', |
|||
key: 'operation', |
|||
dataIndex: 'operation', |
|||
render: (_, record) => |
|||
<a href={`/_api/road/spot/export?token=${user?.token}&previewId=${record.id}`}>导出</a> |
|||
}, |
|||
|
|||
] |
|||
const queryData = (data = {}) => { |
|||
dispatch(roadSpotList(data)).then(res => { |
|||
if (res.success) { |
|||
setReportData(res?.payload.data) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
const detailData = (data = {}) => { |
|||
dispatch(roadSpotDetail(data)).then(res => { |
|||
if (res.success) { |
|||
setDetailList(res?.payload.data) |
|||
} |
|||
}) |
|||
} |
|||
|
|||
|
|||
|
|||
useEffect(() => { |
|||
queryData() |
|||
}, []) |
|||
|
|||
|
|||
const [form] = Form.useForm() |
|||
|
|||
|
|||
const extractHandler = () => { |
|||
form.validateFields(['percentValue']).then(async (values) => { |
|||
if (Number(values.percentValue) > 0) { |
|||
const res = await dispatch(roadSpotPrepare({ countyPercentage: values.percentValue })) |
|||
setPreviewId(res?.payload.data?.previewId) |
|||
form.setFieldsValue({ |
|||
'spotCountyRoadCount': res?.payload.data?.spotCountyRoadCount, |
|||
'spotTownRoadCount': res?.payload.data?.spotTownRoadCount, |
|||
'spotVillageRoadCount': res?.payload.data?.spotVillageRoadCount, |
|||
}) |
|||
} |
|||
}) |
|||
} |
|||
const cancelHandler = () => { |
|||
setVis(false) |
|||
form.resetFields() |
|||
} |
|||
|
|||
|
|||
|
|||
return ( |
|||
<div> |
|||
|
|||
<div style={{ display: "flex", alignItems: 'center', justifyContent: 'space-between', marginBottom: 16 }}> |
|||
<Button onClick={() => { |
|||
setVis(true) |
|||
}} type='primary' style={{ marginLeft: 10 }}> 新增 </Button> |
|||
<div> |
|||
<RangePicker value={dateRange[0] ? [moment(dateRange[0]), moment(dateRange[1])] : []} onChange={(date, dateString) => { |
|||
setDateRange(dateString) |
|||
}} style={{ marginRight: 20 }} /> |
|||
<Button style={{ marginRight: 20 }} onClick={() => { |
|||
setPage(1) |
|||
setExpandedRowKeys([]) |
|||
queryData({ startTime: dateRange[0], endTime: dateRange[1] }) |
|||
}} > 查询 </Button> |
|||
<Button style={{ marginRight: 20 }} onClick={() => { |
|||
setDateRange([]) |
|||
}} > 重置 </Button> |
|||
</div> |
|||
</div> |
|||
|
|||
|
|||
<Table |
|||
columns={columns} |
|||
dataSource={reportData} |
|||
loading={loading} |
|||
expandable={{ |
|||
expandedRowKeys: expandedRowKeys, // 控制哪些行展开,这里需要通过 state 管理
|
|||
// defaultExpandedRowKeys: ['0'],
|
|||
onExpand: (expanded, record) => { |
|||
if (expanded) { |
|||
setExpandedRowKeys([record?.id]) |
|||
detailData({ previewId: record?.id }) |
|||
} else { |
|||
setExpandedRowKeys([]) |
|||
|
|||
} |
|||
}, |
|||
expandedRowRender: (record) => ( |
|||
< Table |
|||
pagination={{ |
|||
pageSize: 10, |
|||
defaultPageSize: 10, |
|||
showSizeChanger: false, |
|||
}} |
|||
loading={detailLoading} |
|||
style={{ margin: 0 }} |
|||
dataSource={detailList} |
|||
columns={ |
|||
[ |
|||
{ |
|||
title: '道路类型', key: 'level', dataIndex: 'level', render: (_, r) => r?.road?.level ? (r?.road?.level + '道') : '--' |
|||
}, |
|||
{ title: '道路名称', key: 'routeName', dataIndex: 'routeName', render: (_, r) => r.road?.routeName || '--' }, |
|||
{ title: '道路代码', key: 'routeCode', dataIndex: 'routeCode', render: (_, r) => r.road?.routeCode || '--' }, |
|||
{ title: '路段序号', key: 'sectionNo', dataIndex: 'sectionNo', render: (_, r) => r.road?.sectionNo || '--' }, |
|||
{ 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) => <Button 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={{ |
|||
total: reportData?.length || 0, |
|||
pageSize: 10, |
|||
current: page || 1, |
|||
defaultPageSize: 10, |
|||
showSizeChanger: false, |
|||
onChange: (page, pageSize) => { |
|||
setPage(page) |
|||
} |
|||
}} |
|||
rowKey={(record) => { return record.id }} |
|||
// toolBarRender={false}
|
|||
// search={false}
|
|||
/> |
|||
|
|||
|
|||
{ |
|||
vis && <Modal visible={vis} onCancel={cancelHandler} title='养护抽查' onOk={() => { |
|||
dispatch(confirmRoadSpot({ previewId })).then(res => { |
|||
if (res.success) { |
|||
setPage(1) |
|||
setExpandedRowKeys([]) |
|||
queryData({ startTime: dateRange[0], endTime: dateRange[1] }) |
|||
form.resetFields() |
|||
setVis(false) |
|||
} |
|||
}); |
|||
|
|||
|
|||
}}> |
|||
<Form form={form}> |
|||
|
|||
<Form.Item |
|||
label="抽取比例(%)" |
|||
name="percentValue" |
|||
rules={[ |
|||
{ required: true, message: '请选择抽取比例' }, |
|||
// {
|
|||
// pattern: /^(100|\d{1,2})(\.\d{1,2})?$/,
|
|||
// message: '请输入有效的比例',
|
|||
// },
|
|||
]} |
|||
> |
|||
<Select style={{}} placeholder="请选择抽取比例" options={[{ value: 25, label: '25%', }, { value: 50, label: '50%', }]} /> |
|||
</Form.Item> |
|||
|
|||
<Form.Item className="ant-row" style={{ |
|||
textAlign: 'center', |
|||
}}> |
|||
<Button style={{}} type='primary' onClick={extractHandler}>开始抽取</Button> |
|||
</Form.Item> |
|||
<Form.Item label='抽查县道(条)' name='spotCountyRoadCount'> |
|||
<Input disabled /> |
|||
</Form.Item> |
|||
<Form.Item label='抽查乡道(条)' name='spotTownRoadCount'> |
|||
<Input disabled /> |
|||
</Form.Item> |
|||
<Form.Item label='抽查村道(条)' name='spotVillageRoadCount'> |
|||
<Input disabled /> |
|||
</Form.Item> |
|||
</Form> |
|||
</Modal> |
|||
} |
|||
|
|||
{ |
|||
isAdjustment && |
|||
<Adjustment |
|||
editData={editData} |
|||
onCancel={() => { |
|||
setEditData({}) |
|||
setIsAdjustment(false) |
|||
}} |
|||
onOk={() => { |
|||
queryData({ startTime: dateRange[0], endTime: dateRange[1] }) |
|||
}} |
|||
/> |
|||
} |
|||
|
|||
|
|||
|
|||
</div > |
|||
) |
|||
} |
|||
function mapStateToProps (state) { |
|||
const { auth, roadSpotList, reportDetail, roadSpotDetail } = state |
|||
//('state1', state)
|
|||
return { |
|||
user: auth.user, |
|||
loading: roadSpotList?.isRequesting, |
|||
detailLoading: roadSpotDetail?.isRequesting, |
|||
reportDetailLoading: reportDetail.isRequesting, |
|||
reportDetail: reportDetail.data, |
|||
|
|||
} |
|||
} |
|||
export default connect(mapStateToProps)(MaintenanceSpotCheck); |
Loading…
Reference in new issue