Browse Source

调整日志

dev
wenlele 1 year ago
parent
commit
502f6397d7
  1. 317
      api/app/lib/controllers/data/road.js
  2. 1919
      api/app/lib/controllers/report/index.js
  3. 100
      web/client/src/sections/fillion/actions/infor.js
  4. 98
      web/client/src/sections/fillion/actions/spotCheck.js
  5. 181
      web/client/src/sections/fillion/components/adjustment.js
  6. 841
      web/client/src/sections/fillion/containers/adjustLog.js
  7. 526
      web/client/src/sections/fillion/containers/maintenanceSpotCheck-new.js

317
api/app/lib/controllers/data/road.js

@ -2,176 +2,179 @@
const roadKeyMap = require('./road.json')
async function importIn (ctx) {
// 数据导入
try {
const models = ctx.fs.dc.models;
const { level, } = ctx.query;
const data = ctx.request.body;
const roadRes = await models.Road.findAll({
where: {
level
}
})
let preCreateArr = []
for (let d of data) {
if (roadRes.some(r => r.routeCode + r.sectionNo == d['路线代码'] + d['路段序号'])) {
//repeat
} else {
// await models.Road.create(d);
}
}
ctx.status = 204
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400;
ctx.body = {
message: typeof error == 'string' ? error : undefined
}
}
// 数据导入
try {
const models = ctx.fs.dc.models;
const { level, } = ctx.query;
const data = ctx.request.body;
const roadRes = await models.Road.findAll({
where: {
level
}
})
let preCreateArr = []
for (let d of data) {
if (roadRes.some(r => r.routeCode + r.sectionNo == d['路线代码'] + d['路段序号'])) {
//repeat
} else {
// await models.Road.create(d);
}
}
ctx.status = 204
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400;
ctx.body = {
message: typeof error == 'string' ? error : undefined
}
}
}
async function get (ctx) {
try {
const models = ctx.fs.dc.models;
const { codePrefix, level, road, sectionStart, sectionEnd } = ctx.query;
let findOption = {
where: {},
order: [['id', 'DESC']]
}
if (codePrefix) {
findOption.where.routeCode = { $like: `${codePrefix}%` }
}
if (level) {
findOption.where.level = level
}
if (road || sectionStart || sectionEnd) {
findOption.where['$or'] = {}
if (road) {
findOption.where['$or'].
routeName = { $like: `%${road}%` }
}
if (sectionStart) {
findOption.where['$or'].
startingPlaceName = { $like: `%${sectionStart}%` }
}
if (sectionEnd) {
findOption.where['$or'].
stopPlaceName = { $like: `%${sectionEnd}%` }
}
}
const roadRes = await models.Road.findAll(findOption)
ctx.status = 200;
ctx.body = roadRes
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400;
ctx.body = {
message: typeof error == 'string' ? error : undefined
}
}
try {
const models = ctx.fs.dc.models;
const { codePrefix, level, road, sectionStart, sectionEnd, alterId } = ctx.query;
let findOption = {
where: {},
order: [['id', 'DESC']]
}
if (alterId) {
findOption.where.id = { $notIn: alterId }
}
if (codePrefix) {
findOption.where.routeCode = { $like: `${codePrefix}%` }
}
if (level) {
findOption.where.level = level
}
if (road || sectionStart || sectionEnd) {
findOption.where['$or'] = {}
if (road) {
findOption.where['$or'].
routeName = { $like: `%${road}%` }
}
if (sectionStart) {
findOption.where['$or'].
startingPlaceName = { $like: `%${sectionStart}%` }
}
if (sectionEnd) {
findOption.where['$or'].
stopPlaceName = { $like: `%${sectionEnd}%` }
}
}
const roadRes = await models.Road.findAll(findOption)
ctx.status = 200;
ctx.body = roadRes
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400;
ctx.body = {
message: typeof error == 'string' ? error : undefined
}
}
}
async function getRoadSection (ctx) {
try {
const models = ctx.fs.dc.models;
const { level, road, sectionStart, sectionEnd } = ctx.query;
let findOption = {
where: {},
order: [['id', 'DESC']],
attributes: ['id', 'routeName', 'startingPlaceName', 'stopPlaceName', 'routeCode']
}
if (level) {
findOption.where.level = level
}
if (road || sectionStart || sectionEnd) {
findOption.where['$or'] = {}
if (road) {
findOption.where['$or'].
routeName = { $like: `%${road}%` }
}
if (sectionStart) {
findOption.where['$or'].
startingPlaceName = { $like: `%${sectionStart}%` }
}
if (sectionEnd) {
findOption.where['$or'].
stopPlaceName = { $like: `%${sectionEnd}%` }
}
}
const roadRes = await models.Road.findAll(findOption)
ctx.status = 200;
ctx.body = roadRes
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400;
ctx.body = {
message: typeof error == 'string' ? error : undefined
}
}
try {
const models = ctx.fs.dc.models;
const { level, road, sectionStart, sectionEnd } = ctx.query;
let findOption = {
where: {},
order: [['id', 'DESC']],
attributes: ['id', 'routeName', 'startingPlaceName', 'stopPlaceName', 'routeCode']
}
if (level) {
findOption.where.level = level
}
if (road || sectionStart || sectionEnd) {
findOption.where['$or'] = {}
if (road) {
findOption.where['$or'].
routeName = { $like: `%${road}%` }
}
if (sectionStart) {
findOption.where['$or'].
startingPlaceName = { $like: `%${sectionStart}%` }
}
if (sectionEnd) {
findOption.where['$or'].
stopPlaceName = { $like: `%${sectionEnd}%` }
}
}
const roadRes = await models.Road.findAll(findOption)
ctx.status = 200;
ctx.body = roadRes
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400;
ctx.body = {
message: typeof error == 'string' ? error : undefined
}
}
}
async function edit (ctx) {
try {
const models = ctx.fs.dc.models;
const data = ctx.request.body;
if (!data.roadId) {
await models.Road.create(data)
} else {
await models.Road.update(
data, {
where: {
id: data.roadId
}
})
}
ctx.status = 204
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400;
ctx.body = {
message: typeof error == 'string' ? error : undefined
}
}
try {
const models = ctx.fs.dc.models;
const data = ctx.request.body;
if (!data.roadId) {
await models.Road.create(data)
} else {
await models.Road.update(
data, {
where: {
id: data.roadId
}
})
}
ctx.status = 204
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400;
ctx.body = {
message: typeof error == 'string' ? error : undefined
}
}
}
async function del (ctx) {
try {
const models = ctx.fs.dc.models;
const { roadId } = ctx.params;
await models.Road.destroy({
where: {
id: roadId
}
})
ctx.status = 204
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400;
ctx.body = {
message: typeof error == 'string' ? error : undefined
}
}
try {
const models = ctx.fs.dc.models;
const { roadId } = ctx.params;
await models.Road.destroy({
where: {
id: roadId
}
})
ctx.status = 204
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400;
ctx.body = {
message: typeof error == 'string' ? error : undefined
}
}
}
module.exports = {
importIn,
getRoadSection,
get, edit, del,
importIn,
getRoadSection,
get, edit, del,
};

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

File diff suppressed because it is too large

100
web/client/src/sections/fillion/actions/infor.js

@ -2,7 +2,7 @@ import { basicAction } from '@peace/utils'
import { ApiTable } from '$utils'
import { Request } from '@peace/utils'
export function getDepMessage() {
export function getDepMessage () {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
@ -24,7 +24,7 @@ export function getDepMessage() {
// });
// }
export function getOperaTional(query) {
export function getOperaTional (query) {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
@ -35,7 +35,7 @@ export function getOperaTional(query) {
});
}
export function putOperaTional(query) {
export function putOperaTional (query) {
return dispatch => basicAction({
type: 'put',
dispatch: dispatch,
@ -46,7 +46,7 @@ export function putOperaTional(query) {
});
}
export function getSpecificVehicle(query) {
export function getSpecificVehicle (query) {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
@ -57,7 +57,7 @@ export function getSpecificVehicle(query) {
});
}
export function putSpecificVehicle(query) {
export function putSpecificVehicle (query) {
return dispatch => basicAction({
type: 'put',
dispatch: dispatch,
@ -68,7 +68,7 @@ export function putSpecificVehicle(query) {
});
}
export function putHouseholds(query) {
export function putHouseholds (query) {
return dispatch => basicAction({
type: 'put',
dispatch: dispatch,
@ -79,7 +79,7 @@ export function putHouseholds(query) {
});
}
export function getHouseholds(query) {
export function getHouseholds (query) {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
@ -90,7 +90,7 @@ export function getHouseholds(query) {
});
}
export function getRoadway(query) {
export function getRoadway (query) {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
@ -98,20 +98,20 @@ export function getRoadway(query) {
actionType: 'GET_ROADWAY',
url: ApiTable.getRoadway,
msg: { error: '获取道路信息失败' },
reducer: { name: 'road' }
});
}
export function putRoadway(query) {
export function putRoadway (query) {
return dispatch => basicAction({
type: 'put',
dispatch: dispatch,
data: query,
actionType: 'PUT_ROADWAY',
url: ApiTable.putRoadway,
msg: { option: query?.roadId?'编辑':'新增' + '道路信息' },
msg: { option: query?.roadId ? '编辑' : '新增' + '道路信息' },
});
}
export function getBridge(query) {
export function getBridge (query) {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
@ -122,7 +122,7 @@ export function getBridge(query) {
});
}
export function putBridge(query) {
export function putBridge (query) {
return dispatch => basicAction({
type: 'put',
dispatch: dispatch,
@ -133,7 +133,7 @@ export function putBridge(query) {
});
}
export function getProject(query) {
export function getProject (query) {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
@ -141,10 +141,10 @@ export function getProject(query) {
actionType: 'GET_PROJECT',
url: ApiTable.getProject,
msg: { error: '获取工程信息失败' },
reducer: { name: 'projectList' }
reducer: { name: 'projectList' }
});
}
export function putProject(query) {
export function putProject (query) {
return dispatch => basicAction({
type: 'put',
dispatch: dispatch,
@ -155,7 +155,7 @@ export function putProject(query) {
});
}
export function getHighways(query) {
export function getHighways (query) {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
@ -166,7 +166,7 @@ export function getHighways(query) {
});
}
export function putHighways(query) {
export function putHighways (query) {
return dispatch => basicAction({
type: 'put',
dispatch: dispatch,
@ -177,7 +177,7 @@ export function putHighways(query) {
});
}
export function getCircuit(query) {
export function getCircuit (query) {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
@ -188,7 +188,7 @@ export function getCircuit(query) {
});
}
export function putCircuit(query) {
export function putCircuit (query) {
return dispatch => basicAction({
type: 'put',
dispatch: dispatch,
@ -199,7 +199,7 @@ export function putCircuit(query) {
});
}
export function getVehicle(query) {
export function getVehicle (query) {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
@ -210,7 +210,7 @@ export function getVehicle(query) {
});
}
export function putVehicle(query) {
export function putVehicle (query) {
return dispatch => basicAction({
type: 'put',
dispatch: dispatch,
@ -221,7 +221,7 @@ export function putVehicle(query) {
});
}
export function delRoadway(query) {
export function delRoadway (query) {
return dispatch => basicAction({
type: 'del',
dispatch: dispatch,
@ -231,7 +231,7 @@ export function delRoadway(query) {
});
}
export function delProject(query) {
export function delProject (query) {
return dispatch => basicAction({
type: 'del',
dispatch: dispatch,
@ -241,7 +241,7 @@ export function delProject(query) {
});
}
export function delBridge(query) {
export function delBridge (query) {
return dispatch => basicAction({
type: 'del',
dispatch: dispatch,
@ -251,7 +251,7 @@ export function delBridge(query) {
});
}
export function delSpecificVehicle(query) {
export function delSpecificVehicle (query) {
return dispatch => basicAction({
type: 'del',
dispatch: dispatch,
@ -261,7 +261,7 @@ export function delSpecificVehicle(query) {
});
}
export function delHouseholds(query) {
export function delHouseholds (query) {
return dispatch => basicAction({
type: 'del',
dispatch: dispatch,
@ -271,7 +271,7 @@ export function delHouseholds(query) {
});
}
export function delCircuit(query) {
export function delCircuit (query) {
return dispatch => basicAction({
type: 'del',
dispatch: dispatch,
@ -281,7 +281,7 @@ export function delCircuit(query) {
});
}
export function delVehicle(query) {
export function delVehicle (query) {
return dispatch => basicAction({
type: 'del',
dispatch: dispatch,
@ -292,7 +292,7 @@ export function delVehicle(query) {
});
}
export function getPurchase(query) {
export function getPurchase (query) {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
@ -303,7 +303,7 @@ export function getPurchase(query) {
});
}
export function putPurchase(query) {
export function putPurchase (query) {
return dispatch => basicAction({
type: 'put',
dispatch: dispatch,
@ -314,7 +314,7 @@ export function putPurchase(query) {
});
}
export function delPurchase(query) {
export function delPurchase (query) {
return dispatch => basicAction({
type: 'del',
dispatch: dispatch,
@ -325,7 +325,7 @@ export function delPurchase(query) {
});
}
export function getPropagata(query) {
export function getPropagata (query) {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
@ -336,7 +336,7 @@ export function getPropagata(query) {
// reducer: { name: 'reportstatistic' }
});
}
export function putAddPropagata(query) {
export function putAddPropagata (query) {
return dispatch => basicAction({
type: 'put',
dispatch: dispatch,
@ -347,7 +347,7 @@ export function putAddPropagata(query) {
// reducer: { name: 'reportstatistic' }
});
}
export function putEditPropagata(query) {
export function putEditPropagata (query) {
return dispatch => basicAction({
type: 'put',
dispatch: dispatch,
@ -358,7 +358,7 @@ export function putEditPropagata(query) {
// reducer: { name: 'reportstatistic' }
});
}
export function delPropagata(query) {
export function delPropagata (query) {
return dispatch => basicAction({
type: 'del',
dispatch: dispatch,
@ -369,7 +369,7 @@ export function delPropagata(query) {
});
}
export function getShippingList(query) {
export function getShippingList (query) {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
@ -380,7 +380,7 @@ export function getShippingList(query) {
});
}
export function putShippingList(query) {
export function putShippingList (query) {
return dispatch => basicAction({
type: 'put',
dispatch: dispatch,
@ -391,7 +391,7 @@ export function putShippingList(query) {
});
}
//获取管养单位概况
export function getCustodyunit() {
export function getCustodyunit () {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
@ -401,10 +401,10 @@ export function getCustodyunit() {
reducer: { name: 'roadMaintenances_management' }
});
}
export function getCustodyunitOne(query) {
export function getCustodyunitOne (query) {
return dispatch => basicAction({
type: 'get',
query:query,
query: query,
dispatch: dispatch,
actionType: 'GET_CUSTODY_UNIT_ONE',
url: ApiTable.getCustodyunit,
@ -412,7 +412,7 @@ export function getCustodyunitOne(query) {
// reducer: { name: 'roadMaintenances_management' }
});
}
export function postCustodyunit(query) {
export function postCustodyunit (query) {
return dispatch => basicAction({
type: 'post',
data: query,
@ -423,14 +423,14 @@ export function postCustodyunit(query) {
// reducer: { name: 'roadMaintenances' }
});
}
export function getxiuyangas(query) {
export function getxiuyangas (query) {
return dispatch => basicAction({
type: 'get',
query,
dispatch: dispatch,
actionType: 'GET_XIUYANG',
url: ApiTable.getXiuyang,
msg: { error: '获取信息失败' },
reducer: { name: 'xiuyang' }
type: 'get',
query,
dispatch: dispatch,
actionType: 'GET_XIUYANG',
url: ApiTable.getXiuyang,
msg: { error: '获取信息失败' },
reducer: { name: 'xiuyang' }
});
}

98
web/client/src/sections/fillion/actions/spotCheck.js

@ -1,17 +1,93 @@
import { basicAction } from '@peace/utils'
import { ApiTable } from '$utils'
// export function getAssess (query) {
// return dispatch => basicAction({
// type: 'get',
// dispatch: dispatch,
// query: query,
// actionType: 'GET_ASSESS',
// url: ApiTable.getAssess,
// msg: { error: '获取考核评分信息' },
// reducer: { name: 'assess' }
// });
// }
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({

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

@ -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);

841
web/client/src/sections/fillion/containers/adjustLog.js

@ -1,669 +1,190 @@
import { connect } from 'react-redux';
import React, { useEffect, useState } from 'react';
import { Button, Modal, Form, Input, Divider, Spin, Image, DatePicker, Descriptions, Table } from 'antd'
import ProTable from '@ant-design/pro-table';
import { getReportSpotPrepare, getSpotCheck, getSpotCheckDetail } from '../actions/extract'
import { getReportDetail } from '../actions/patrol';
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 DetailForm = (props) => {
const { visible, data, handleClose, loading } = props
//console.log('data1', data)
const [qndmn] = useState(localStorage.getItem('qndmn'))
const changeBoolean = (bool) => {
// console.log('bool', bool)
return bool ? '无异常' : '有异常'
}
const reportTypeText = (text) => {
switch (text) {
case 'road': return '道路';
//
case 'countyRoad': return '县道';
case 'villageRoad': return '乡道';
case 'rusticRoad': return '村道';
//
case 'bridge': return '桥梁';
case 'culvert': return '涵洞';
case 'other': return '其他';
//
case 'conserve': return '养护';
case 'patrol': return '巡查';
case 'construction': return '在建';
default: return text;
}
}
const keyList = [
{ key: '路线代码', name: 'codeRoad' },
{ key: '其他', name: 'projectType' },
{ key: '道路类型', name: 'reportType' },
{ key: '路线名称', name: 'road' },
{ key: '路线代码', name: 'codeRoad' },
{ key: '养护路段', name: 'roadSectionStart' },
{ key: '具体位置', name: 'address' },
{ key: '路面类型', name: 'roadType' },
{ key: '路面宽度(米)', name: 'roadWidth' },
{ key: '错车道(个)', name: 'wrongLane' },
{ key: '行道树(棵)', name: 'roadsideTrees' },
{ key: '边沟(米)', name: 'roadsideDitch' },
{ key: '护栏(米)', name: 'guardrail' },
{ key: '标线(米)', name: 'roadMarking' },
{ key: '养护人员人数(人)', name: 'maintenanceStaffCount' },
{ key: '修整路肩(平方米)', name: 'shoulderRepair' },
{ key: '清理边沟(米)', name: 'ditchCleaning' },
{ key: '修补沥青路面(平方米)', name: 'asphaltRepair' },
{ key: '修补水泥路面(平方米)', name: 'concreteRepair' },
{ key: '除草(米)', name: 'grassMowing' },
{ key: '树刷白(株/公里)', name: 'treeWhitening' },
{ key: '桩刷白(个)', name: 'pileWhitening' },
{ key: '维护护栏(个)', name: 'guardrailMaintenance' },
{ key: '修复端头(块)', name: 'endHeadRepair' },
{ key: '其他养护内容', name: 'otherDescription' },
{ key: '养护前图片', name: 'conserveBeforePic' },
{ key: '养护中图片', name: 'conserveUnderwayPic' },
{ key: '养护后图片', name: 'conserveAfterPic' },
{ key: '上报视频', name: 'videoUrl' },
];
const keyListOld = [
// { key: '编号', name: 'id' },
{ key: '工程类型', name: 'projectType' },
{ key: '所在路段', name: 'road' },
{ key: '具体位置', name: 'address' },
{ key: '巡查内容', name: 'content' },
{ key: '路线代码', name: 'codeRoad' },
// { key: '病害照片', name: 'scenePic' },
{ key: '养护前', name: 'conserveBeforePic' },
{ key: '养护中', name: 'conserveUnderwayPic' },
{ key: '养护后', name: 'conserveAfterPic' },
];
const roadInfo = [
{ key: '路面类型', name: 'roadType' },
{ key: '路面宽度/米', name: 'roadWidth' },
{ key: '错车道/个', name: 'wrongLane' },
{ key: '行道树/棵', name: 'roadsideTrees' },
{ key: '边沟/米', name: 'roadsideDitch' },
{ key: '护栏/米', name: 'guardrail' },
{ key: '标线/米', name: 'roadMarking' },
];
const mantenanceInfo = [
{ key: '养护人员人数/人', name: 'maintenanceStaffCount' },
{ key: '修整路肩/平方米', name: 'shoulderRepair' },
{ key: '开挖、清理边沟/米', name: 'ditchCleaning' },
{ key: '修补沥青路面/平米', name: 'asphaltRepair' },
{ key: '修补水泥路面/平米', name: 'concreteRepair' },
{ key: '除草/米', name: 'grassMowing' },
{ key: '行道树刷白/株/公里', name: 'treeWhitening' },
{ key: '公里桩/百米桩刷漆/个', name: 'pileWhitening' },
{ key: '维修护栏/米', name: 'guardrailMaintenance' },
{ key: '修复端头/块', name: 'endHeadRepair' },
{ key: '其他', name: 'otherDescription' },
];
const mantenancePic = [
{ key: '养护前图片', name: 'conserveBeforePic' },
{ key: '养护中图片', name: 'conserveUnderwayPic' },
{ key: '养护后图片', name: 'conserveAfterPic' },
];
const renderContent = (data) => {
if (data) {
console.log('data1111', data)
if (moment(data.time).isAfter(moment('2023-08-03 00:00:00'))) {
return <div className='maintenanceNew'>
<Descriptions title="基础信息" bordered style={{ marginBottom: 20 }}>
<Descriptions.Item label="道路类型">{data['codeRoad'] && data['codeRoad'].length ? data['codeRoad'][0] === 'X' ? '县道' : data['codeRoad'][0] === 'Y' ? '乡道' : '村道' : ''}</Descriptions.Item>
<Descriptions.item label="其他">{reportTypeText(data['projectType']) || ''}</Descriptions.item>
<Descriptions.item label="路线代码">{data['codeRoad'] || ''}</Descriptions.item>
<Descriptions.item label="路线名称">{data['code'] || ''}</Descriptions.item>
<Descriptions.item label="养护路段" span={2}>{data['roadSectionStart'] + '-' + data['roadSectionEnd'] || ''}</Descriptions.item>
<Descriptions.Item label="具体位置" span={3} >{data['address'] || ''}</Descriptions.Item>
</Descriptions>
<Descriptions title="道路信息" bordered style={{ marginBottom: 20 }}>
{roadInfo.map(item => (
<Descriptions.Item label={item.key}>
{data[item.name] || ''}
</Descriptions.Item>
))}
</Descriptions>
<Descriptions title="道路信息" bordered style={{ marginBottom: 20 }}>
{mantenanceInfo.map(item => (
<Descriptions.Item label={item.key}>
{data[item.name] || ''}
</Descriptions.Item>
))}
</Descriptions>
<Descriptions title="养护图片" bordered style={{ marginBottom: 20 }} >
{mantenancePic.map(item => (
<Descriptions.Item label={item.key} span={3} >
<div style={{ width: '70%', display: 'flex', position: 'relative', flexWrap: 'wrap' }}>
{data[item.name]?.map(imgSrc => {
return <div style={{ width: '50px', margin: 6, display: 'flex' }}>
<Image src={qndmn + '/' + imgSrc} width={'100%'} style={{ marginBottom: 4 }} />
</div>
}) || '暂无图片'}
</div>
</Descriptions.Item>
))}
</Descriptions>
<Descriptions title="养护视频" bordered style={{ marginBottom: 20 }} >
<Descriptions.Item label={'养护视频'} span={3}>
<div style={{ width: '70%', display: 'flex', position: 'relative', flexWrap: 'wrap' }}>
{data['videoUrl']?.map(videoSrc => {
return <div style={{ width: '44%', margin: 6, display: 'flex' }}>
<video src={qndmn + '/' + videoSrc} width={'100%'} style={{ marginBottom: 4 }} controls />
</div>
}) || '暂无视频'}
</div>
</Descriptions.Item>
</Descriptions>
</div>
// if (data) {
// if (moment(data.time).isAfter(moment('2023-08-03 00:00:00'))) {
// return keyList.map(obj => {
// return <div style={{ display: 'flex', width: '100%', justifyContent: 'space-between', margin: '12px 0' }}>
// <span style={{ fontSize: 16, color: 'gray', minWidth: '26%' }}>{obj.key}</span>
// {
// obj.name != 'conserveBeforePic' && obj.name != 'conserveAfterPic' && obj.name != 'roadSectionStart' && obj.name != 'videoUrl' && obj.name.indexOf('conserve') == -1 ?
// <Input
// style={{ width: '60%' }}
// value={
// obj.name == 'id' ?
// moment(data.time).format("YYYYMMDD") * 10000 + data.id
// :
// obj.name == 'projectType' ?
// reportTypeText(data[obj.name])
// : obj.name == 'reportType' && data['codeRoad'] ? data['codeRoad'][0] === 'X' ? '县道'
// : data['codeRoad'][0] === 'Y' ? '乡道' : '村道' :
// data[obj.name]
// }
// disabled
// />
// : obj.name != 'roadSectionStart' && obj.name != 'videoUrl' ?
// <div style={{ width: '70%', display: 'flex', position: 'relative', flexWrap: 'wrap' }}>
// {
// data[obj.name] && data[obj.name] instanceof Array ? data[obj.name].map(imgSrc => {
// return <div style={{ width: '44%', margin: 6 }}>
// <Image src={qndmn + '/' + imgSrc} width={'100%'} style={{ marginBottom: 4 }} />
// </div>
// }) : '暂无图片'
// }
// </div> : obj.name != 'videoUrl' ? <div style={{ width: '60%', display: 'flex', position: 'relative', flexWrap: 'wrap' }}>
// <Input style={{ width: '100%' }} disabled value={data[obj.name] + '-' + data['roadSectionEnd']} />
// </div> : <div style={{ width: '70%', display: 'flex', position: 'relative', flexWrap: 'wrap' }}>
// {
// data[obj.name] && data[obj.name] instanceof Array ? data[obj.name].map(videoUrl => {
// return <div style={{ width: '44%', margin: 6 }}>
// <video width={'100%'} style={{ marginBottom: 4 }} >
// <source src={qndmn + '/' + videoUrl} type="video/mp4" controls />
// </video>
// </div>
// }) : '暂无视频'
// }
// </div>
// }
// </div>
// })
// } else {
// return keyListOld.map(obj => {
// return <div style={{ display: 'flex', width: '100%', justifyContent: 'space-between', margin: '12px 0' }}>
// <span style={{ fontSize: 16, color: 'gray', minWidth: '26%' }}>{obj.key}</span>
// {
// obj.name != 'scenePic' && obj.name.indexOf('conserve') == -1 ?
// <Input
// style={{ width: '70%' }}
// value={
// obj.name == 'id' ?
// moment(data.time).format("YYYYMMDD") * 10000 + data.id
// :
// obj.name == 'projectType' ?
// reportTypeText(data[obj.name]) :
// data[obj.name]
// }
// disabled
// />
// :
// <div style={{ width: '70%', display: 'flex', position: 'relative', flexWrap: 'wrap' }}>
// {
// data[obj.name] && data[obj.name] instanceof Array ? data[obj.name].map(imgSrc => {
// return <div style={{ width: '44%', margin: 6 }}>
// <Image src={qndmn + '/' + imgSrc} width={'100%'} style={{ marginBottom: 4 }} />
// </div>
// }) : '暂无图片'
// }
// </div>
// }
// </div>
// })
// }
} else {
return <div className='maintenanceNew'>
<Descriptions title="养护信息" bordered style={{ marginBottom: 20 }} column={3}>
<Descriptions.Item label="道路类型">{data['codeRoad'] && data['codeRoad'].length ? data['codeRoad'][0] === 'X' ? '县道' : data['codeRoad'][0] === 'Y' ? '乡道' : '村道' : ''}</Descriptions.Item>
<Descriptions.item label="养护路段" >{data['roadSectionStart'] && data['roadSectionEnd'] ? (data['roadSectionStart'] + '-' + data['roadSectionEnd']) : ''}</Descriptions.item>
<Descriptions.item label="路线代码">{data['codeRoad'] || ''}</Descriptions.item>
{/* <Descriptions.item label="路线名称">{data['code'] || ''}</Descriptions.item> */}
<Descriptions.Item label="具体位置" span={3} >{data['address'] || ''}</Descriptions.Item>
<Descriptions.Item label="养护内容" span={3} >{data['content'] || ''}</Descriptions.Item>
</Descriptions>
<Descriptions title="养护图片" bordered style={{ marginBottom: 20 }} >
{mantenancePic.map(item => (
<Descriptions.Item label={item.key} className="custom-item" span={3}>
<div style={{ width: '70%', display: 'flex', position: 'relative', flexWrap: 'wrap' }}>
{data[item.name]?.map(imgSrc => {
return <div style={{ width: '50px', margin: 6, display: 'flex' }}>
<Image src={qndmn + '/' + imgSrc} width={'100%'} style={{ marginBottom: 4 }} />
</div>
}) || '暂无图片'}
</div>
</Descriptions.Item>
))}
</Descriptions>
<Descriptions title="养护视频" bordered style={{ marginBottom: 20 }} >
<Descriptions.Item label={'养护视频'} className="custom-item" >
<div style={{ width: '70%', display: 'flex', position: 'relative', flexWrap: 'wrap' }}>
{data['videoUrl']?.map(videoSrc => {
return <div style={{ width: '44%', margin: 6, display: 'flex' }}>
<video src={qndmn + '/' + videoSrc} width={'100%'} style={{ marginBottom: 4 }} controls />
</div>
}) || '暂无视频'}
</div>
</Descriptions.Item>
</Descriptions>
</div>
}
} else {
return '暂无数据'
}
}
// const renderContent = (data) => {
// if (data) {
// if (data['inspectionNoException']) {
// // 当'无异常'字段为true时,显示'无异常'和其他非异常相关字段
// return keyList.map(obj => {
// if (obj.name === 'inspectionNoException' || obj.name === 'reportType' || obj.name === 'projectType' || obj.name === 'road' || obj.name === 'roadSectionStart' || obj.name === 'address' || obj.name === 'codeRoad' || obj.name === 'scenePic' || obj.name === 'videoUrl') {
// return (
// <div style={{ display: 'flex', width: '100%', justifyContent: 'space-between', margin: '12px 0' }}>
// <span style={{ fontSize: 16, color: 'gray', minWidth: '26%' }}>{obj.key}</span>
// {
// obj.name === 'scenePic' && data[obj.name] instanceof Array ?
// <div style={{ width: '70%', display: 'flex', position: 'relative', flexWrap: 'wrap' }}>
// {
// data[obj.name].map(imgSrc => {
// return <div style={{ width: '44%', margin: 6 }}>
// <Image src={qndmn + '/' + imgSrc} width={'100%'} style={{ marginBottom: 4 }} />
// </div>
// })
// }
// </div>
// : obj.name === 'roadSectionStart' ?
// <div style={{ width: '70%', display: 'flex', position: 'relative', flexWrap: 'wrap' }}>
// <Input style={{ width: '100%' }} disabled value={data[obj.name] + '-' + data['roadSectionEnd']} />
// </div>
// :
// <Input
// style={{ width: '70%' }}
// value={
// obj.name === 'inspectionNoException' ?
// '无异常'
// :
// obj.name === 'id'
// ? moment(data.time).format("YYYYMMDD") * 10000 + data.id
// : obj.name === 'projectType' || obj.name === 'reportType'
// ? reportTypeText(data[obj.name])
// : data[obj.name]
// }
// disabled
// />
// }
// </div>
// );
// } else {
// return null; // 不渲染异常相关字段
// }
// });
// } else {
// // 当'无异常'字段为false或未定义时,显示其他异常相关字段
// return keyList.map(obj => {
// if (obj.name !== 'inspectionNoException') {
// return (
// <div style={{ display: 'flex', width: '100%', justifyContent: 'space-between', margin: '12px 0' }}>
// <span style={{ fontSize: 16, color: 'gray', minWidth: '26%' }}>{obj.key}</span>
// {
// obj.name !== 'scenePic' && obj.name !== 'roadSectionStart' && obj.name.indexOf('conserve') === -1 ?
// <Input
// style={{ width: '70%' }}
// value={
// obj.name === 'id'
// ? moment(data.time).format("YYYYMMDD") * 10000 + data.id
// : obj.name === 'projectType' || obj.name === 'reportType'
// ? reportTypeText(data[obj.name])
// : data[obj.name]
// }
// disabled
// />
// : obj.name !== 'roadSectionStart' ?
// <div style={{ width: '70%', display: 'flex', position: 'relative', flexWrap: 'wrap' }}>
// {
// data[obj.name] && data[obj.name] instanceof Array ? data[obj.name].map(imgSrc => {
// return <div style={{ width: '44%', margin: 6 }}>
// <Image src={qndmn + '/' + imgSrc} width={'100%'} style={{ marginBottom: 4 }} />
// </div>
// }) : '暂无图片'
// }
// </div>
// : <div style={{ width: '70%', display: 'flex', position: 'relative', flexWrap: 'wrap' }}>
// <Input style={{ width: '100%' }} disabled value={data[obj.name] + '-' + data['roadSectionEnd']} />
// </div>
// }
// </div>
// );
// } else {
// return null; // 不渲染其他异常字段
// }
// });
// }
// } else {
// return '暂无数据';
// }
// }
return (
<Modal
width={'60%'}
visible={visible}
footer={null}
onCancel={handleClose}
title={'养护管理详情'}
>
<Spin spinning={loading}>
{renderContent(data)}
</Spin>
</Modal>
)
}
const MaintenanceSpotCheck = (props) => {
const { dispatch, user, loading, reportDetail, reportDetailLoading } = props
const [data, setData] = useState()//外层表格的数据
const [vis, setVis] = useState(false)//模态框的显示与隐藏变量
const [count, setCount] = useState(0)
const [depId, setDepId] = useState(0)
const [depName, setDepName] = useState('')
const [total, setTotal] = useState(0)
const [previewId, setPreviewId] = useState(0)
const [reportData, setReportData] = useState([])
const [detailVisible, setDetailVisible] = useState(false)
const [dateRange, setDateRange] = useState(['1970-1-1', '2099-12-31']);
const { RangePicker } = DatePicker
const [expandedRowKeys, setExpandedRowKeys] = useState([]);
//console.log('reportData', reportData)
const checkDetail = (record) => {
dispatch(getReportDetail(record?.id))
}
const handleOpen = () => {
setDetailVisible(true)
}
const handleClose = () => {
setDetailVisible(false)
}
//里层列名
const columns = [
{
title: '抽查日期',
key: 'spotDate',
dataIndex: 'spotDate',
align: 'center',
// render: (_, record) => {
// return
// }
},
{
title: '抽查乡镇',
key: 'projectType',
dataIndex: 'depName',
align: 'center',
},
{
title: '抽查数量',
key: 'count',
dataIndex: 'count',
align: 'center',
},
{
title: '抽查总数',
key: 'reportCount',
dataIndex: 'reportCount',
align: 'center',
},
]
const queryData = (query = { startTime: '1970-1-1', endTime: '2099-12-31' }) => {
dispatch(getSpotCheckDetail(query)).then(res => {
if (res.success) {
const data = res?.payload.data?.map(item => {
return {
spotDate: moment(item.date).format('YYYY-MM-DD'),
depName: item.department?.name,
reportCount: item.reportCount,
count: Math.ceil((item.reportCount * item.percentage) / 100),
reportDetail: item.reportSpotChecks?.map(child => {
return child.report
}),
id: item.id
}
})
//console.log('data1', data)
setReportData(data)
}
})
}
useEffect(() => {
queryData()
}, [])
const [form] = Form.useForm()
const addHanler = () => {
setVis(true)
}
const extractHandler = () => {
form.validateFields(['percentValue']).then(async (values) => {
if (Number(values.percentValue) > 0) {
const res = await dispatch(getReportSpotPrepare({ percentage: Number(values.percentValue) }))
// setCount(res?.payload.data?.reportCount)
// setDepId(res?.payload.data?.lukyDepartment?.id)
// setDepName(res?.payload.data?.lukyDepartment?.name)
setPreviewId(res?.payload.data?.previewId)
// setTotal(Math.ceil((res?.payload.data?.reportCount) * (Number(values.percentValue) / 100)))
form.setFieldsValue({
'result': res?.payload.data?.reportCount,
'village': res?.payload.data?.lukyDepartment?.name,
'total': Math.ceil((res?.payload.data?.reportCount) * (Number(values.percentValue) / 100))
})
}
})
}
const cancelHandler = () => {
setVis(false)
form.resetFields()
}
const okHandler = async () => {
if (previewId !== 0) {
const res = await dispatch(getSpotCheck({ previewId }))
const rslt = res.payload.data.map(item => {
return {
spotDate: moment(item.date).format('YYYY-MM-DD'),
depName: item.department?.name,
reportCount: item.reportCount,
count: Math.ceil((item.reportCount * item.percentage) / 100),
reportDetail: item.reportSpotChecks?.map(child => {
return child.report
}),
id: item.id
}
}) || []
setReportData(rslt)
form.resetFields()
setVis(false)
}
}
//console.log('setReportData', reportData)
const lookhandler = () => {
if ((dateRange && dateRange instanceof Array && dateRange[0] != '')) {
queryData({ startTime: moment(dateRange[0]).startOf('day').format('YYYY-MM-DD HH:mm:ss'), endTime: moment(dateRange[1]).endOf('day').format('YYYY-MM-DD HH:mm:ss') })
}
}
return (
<div>
<Button onClick={addHanler} type='primary' style={{ marginRight: '50px' }}> 新增 </Button>
<RangePicker onChange={(date, dateString) => { setDateRange(dateString) }} style={{ marginRight: '50px' }} />
<Button onClick={lookhandler} > 查询 </Button>
<Divider />
<ProTable
columns={columns}
dataSource={reportData}
loading={loading}
expandable={{
//expandedRowKeys, // 控制哪些行展开,这里需要通过 state 管理
defaultExpandedRowKeys: ['0'],
// onExpand: handleExpand,
expandedRowRender: (record) => (
< Table
pagination={false}
dataSource={record?.reportDetail}
columns={
[
{ title: '所属道路', dataIndex: 'road' },
{
title: '所在路段',
key: 'address',
dataIndex: 'address',
align: 'center',
render: (_, r) => {
return `${r?.roadSectionStart || ''}-${r?.roadSectionEnd || ''}`
}
},
{ title: '具体位置', dataIndex: 'address' },
{
title: '上报人',
width: 100,
key: 'userName',
dataIndex: 'userName',
align: 'center',
render: (text, r) => {
return r?.user?.name || ''
}
},
{
title: '上报时间',
key: 'time',
dataIndex: 'time',
valueType: 'dateTime',
align: 'center',
render: (_, r) => {
return moment(r?.time).format('YYYY-MM-DD HH:mm:ss')
}
},
{
title: '操作',
key: 'caozuo',
align: 'center',
render: (_, r) => {
return <Button
onClick={() => { checkDetail(r); handleOpen() }}
style={{ marginRight: 10 }}>查看</Button>
}
}
// { title: '', dataIndex: 'subColumn1' },
// { title: '', dataIndex: 'subColumn2' },
// ... 其他子表格列配置
]}
/>
),
}}
pagination={{
pageSize: 10,
defaultPageSize: 10,
showSizeChanger: false,
}}
rowKey={(record) => { return record.id }}
toolBarRender={false}
search={false}
/>
<Modal visible={vis} onCancel={cancelHandler} title='养护抽查' onOk={okHandler}>
<Form form={form}>
<Form.Item
label="抽取比例(%)"
// name="percent"
rules={[{ required: true, message: '请填写抽取比例' }]}
>
<Input.Group compact>
<Form.Item
name="percentValue"
noStyle
rules={[
{ required: true, message: '请填写抽取比例' },
{
pattern: /^(100|\d{1,2})(\.\d{1,2})?$/,
message: '请输入有效的比例',
},
]}
>
<Input style={{ width: '80%' }} placeholder="请输入抽取比例" />
</Form.Item>
{/* <Form.Item
// name="percentSign"
noStyle
style={{ width: '20%', textAlign: 'center' }}
>
%
</Form.Item> */}
</Input.Group>
</Form.Item>
<Form.Item className="ant-row" style={{
textAlign: 'center',
}}>
<Button style={{}} type='primary' onClick={extractHandler}>开始抽取</Button>
</Form.Item>
<Form.Item label='抽查总数' name='result'>
<Input disabled />
</Form.Item>
<Form.Item label='抽查乡镇' name='village'>
<Input disabled />
</Form.Item>
<Form.Item label='抽查条数' name='total'>
<Input disabled />
</Form.Item>
</Form>
</Modal>
<DetailForm visible={detailVisible}
handleClose={handleClose}
data={reportDetail}
loading={reportDetailLoading} />
</div>
)
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, spotCheckDetail, reportDetail } = state
//('state1', state)
return {
user: auth.user,
loading: spotCheckDetail?.isRequesting,
reportDetailLoading: reportDetail.isRequesting,
reportDetail: reportDetail.data,
}
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);
export default connect(mapStateToProps)(AdjustLog);

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

@ -1,281 +1,106 @@
import { connect } from 'react-redux';
import React, { useEffect, useState } from 'react';
import { Button, Modal, Form, Input, Divider, Spin, Image, DatePicker, Descriptions, Table } from 'antd'
import ProTable from '@ant-design/pro-table';
import { getReportSpotPrepare, getSpotCheck, getSpotCheckDetail } from '../actions/extract'
import { getReportDetail } from '../actions/patrol';
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 DetailForm = (props) => {
const { visible, data, handleClose, loading } = props
//console.log('data1', data)
const [qndmn] = useState(localStorage.getItem('qndmn'))
const changeBoolean = (bool) => {
// console.log('bool', bool)
return bool ? '无异常' : '有异常'
}
const reportTypeText = (text) => {
switch (text) {
case 'road': return '道路';
//
case 'countyRoad': return '县道';
case 'villageRoad': return '乡道';
case 'rusticRoad': return '村道';
//
case 'bridge': return '桥梁';
case 'culvert': return '涵洞';
case 'other': return '其他';
//
case 'conserve': return '养护';
case 'patrol': return '巡查';
case 'construction': return '在建';
default: return text;
}
}
const roadInfo = [
{ key: '路面类型', name: 'roadType' },
{ key: '路面宽度/米', name: 'roadWidth' },
{ key: '错车道/个', name: 'wrongLane' },
{ key: '行道树/棵', name: 'roadsideTrees' },
{ key: '边沟/米', name: 'roadsideDitch' },
{ key: '护栏/米', name: 'guardrail' },
{ key: '标线/米', name: 'roadMarking' },
];
const mantenanceInfo = [
{ key: '养护人员人数/人', name: 'maintenanceStaffCount' },
{ key: '修整路肩/平方米', name: 'shoulderRepair' },
{ key: '开挖、清理边沟/米', name: 'ditchCleaning' },
{ key: '修补沥青路面/平米', name: 'asphaltRepair' },
{ key: '修补水泥路面/平米', name: 'concreteRepair' },
{ key: '除草/米', name: 'grassMowing' },
{ key: '行道树刷白/株/公里', name: 'treeWhitening' },
{ key: '公里桩/百米桩刷漆/个', name: 'pileWhitening' },
{ key: '维修护栏/米', name: 'guardrailMaintenance' },
{ key: '修复端头/块', name: 'endHeadRepair' },
{ key: '其他', name: 'otherDescription' },
];
const mantenancePic = [
{ key: '养护前图片', name: 'conserveBeforePic' },
{ key: '养护中图片', name: 'conserveUnderwayPic' },
{ key: '养护后图片', name: 'conserveAfterPic' },
];
const renderContent = (data) => {
if (data) {
if (moment(data.time).isAfter(moment('2023-08-03 00:00:00'))) {
return <div className='maintenanceNew'>
<Descriptions title="基础信息" bordered style={{ marginBottom: 20 }}>
<Descriptions.Item label="道路类型">{data['codeRoad'] && data['codeRoad'].length ? data['codeRoad'][0] === 'X' ? '县道' : data['codeRoad'][0] === 'Y' ? '乡道' : '村道' : ''}</Descriptions.Item>
<Descriptions.item label="其他">{reportTypeText(data['projectType']) || ''}</Descriptions.item>
<Descriptions.item label="路线代码">{data['codeRoad'] || ''}</Descriptions.item>
<Descriptions.item label="路线名称">{data['code'] || ''}</Descriptions.item>
<Descriptions.item label="养护路段" span={2}>{data['roadSectionStart'] + '-' + data['roadSectionEnd'] || ''}</Descriptions.item>
<Descriptions.Item label="具体位置" span={3} >{data['address'] || ''}</Descriptions.Item>
</Descriptions>
<Descriptions title="道路信息" bordered style={{ marginBottom: 20 }}>
{roadInfo.map(item => (
<Descriptions.Item label={item.key}>
{data[item.name] || ''}
</Descriptions.Item>
))}
</Descriptions>
<Descriptions title="道路信息" bordered style={{ marginBottom: 20 }}>
{mantenanceInfo.map(item => (
<Descriptions.Item label={item.key}>
{data[item.name] || ''}
</Descriptions.Item>
))}
</Descriptions>
<Descriptions title="养护图片" bordered style={{ marginBottom: 20 }} >
{mantenancePic.map(item => (
<Descriptions.Item label={item.key} span={3} >
<div style={{ width: '70%', display: 'flex', position: 'relative', flexWrap: 'wrap' }}>
{data[item.name]?.map(imgSrc => {
return <div style={{ width: '50px', margin: 6, display: 'flex' }}>
<Image src={qndmn + '/' + imgSrc} width={'100%'} style={{ marginBottom: 4 }} />
</div>
}) || '暂无图片'}
</div>
</Descriptions.Item>
))}
</Descriptions>
<Descriptions title="养护视频" bordered style={{ marginBottom: 20 }} >
<Descriptions.Item label={'养护视频'} span={3}>
<div style={{ width: '70%', display: 'flex', position: 'relative', flexWrap: 'wrap' }}>
{data['videoUrl']?.map(videoSrc => {
return <div style={{ width: '44%', margin: 6, display: 'flex' }}>
<video src={qndmn + '/' + videoSrc} width={'100%'} style={{ marginBottom: 4 }} controls />
</div>
}) || '暂无视频'}
</div>
</Descriptions.Item>
</Descriptions>
</div>
} else {
return <div className='maintenanceNew'>
<Descriptions title="养护信息" bordered style={{ marginBottom: 20 }} column={3}>
<Descriptions.Item label="道路类型">{data['codeRoad'] && data['codeRoad'].length ? data['codeRoad'][0] === 'X' ? '县道' : data['codeRoad'][0] === 'Y' ? '乡道' : '村道' : ''}</Descriptions.Item>
<Descriptions.item label="养护路段" >{data['roadSectionStart'] && data['roadSectionEnd'] ? (data['roadSectionStart'] + '-' + data['roadSectionEnd']) : ''}</Descriptions.item>
<Descriptions.item label="路线代码">{data['codeRoad'] || ''}</Descriptions.item>
{/* <Descriptions.item label="路线名称">{data['code'] || ''}</Descriptions.item> */}
<Descriptions.Item label="具体位置" span={3} >{data['address'] || ''}</Descriptions.Item>
<Descriptions.Item label="养护内容" span={3} >{data['content'] || ''}</Descriptions.Item>
</Descriptions>
<Descriptions title="养护图片" bordered style={{ marginBottom: 20 }} >
{mantenancePic.map(item => (
<Descriptions.Item label={item.key} className="custom-item" span={3}>
<div style={{ width: '70%', display: 'flex', position: 'relative', flexWrap: 'wrap' }}>
{data[item.name]?.map(imgSrc => {
return <div style={{ width: '50px', margin: 6, display: 'flex' }}>
<Image src={qndmn + '/' + imgSrc} width={'100%'} style={{ marginBottom: 4 }} />
</div>
}) || '暂无图片'}
</div>
</Descriptions.Item>
))}
</Descriptions>
<Descriptions title="养护视频" bordered style={{ marginBottom: 20 }} >
<Descriptions.Item label={'养护视频'} className="custom-item" >
<div style={{ width: '70%', display: 'flex', position: 'relative', flexWrap: 'wrap' }}>
{data['videoUrl']?.map(videoSrc => {
return <div style={{ width: '44%', margin: 6, display: 'flex' }}>
<video src={qndmn + '/' + videoSrc} width={'100%'} style={{ marginBottom: 4 }} controls />
</div>
}) || '暂无视频'}
</div>
</Descriptions.Item>
</Descriptions>
</div>
}
} else {
return '暂无数据'
}
}
return (
<Modal
width={'60%'}
visible={visible}
footer={null}
onCancel={handleClose}
title={'养护管理详情'}
>
<Spin spinning={loading}>
{renderContent(data)}
</Spin>
</Modal>
)
}
const MaintenanceSpotCheck = (props) => {
const { dispatch, user, loading, reportDetail, reportDetailLoading } = props
const { dispatch, user, loading, reportDetail, reportDetailLoading, detailLoading } = props
const [data, setData] = useState()//外层表格的数据
const [vis, setVis] = useState(false)//模态框的显示与隐藏变量
const [count, setCount] = useState(0)
const [depId, setDepId] = 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(['1970-1-1', '2099-12-31']);
const [dateRange, setDateRange] = useState([]);
const { RangePicker } = DatePicker
const [expandedRowKeys, setExpandedRowKeys] = useState([]);
const [isAdjustment, setIsAdjustment] = useState(false);
const [editData, setEditData] = useState({});
//console.log('reportData', reportData)
const checkDetail = (record) => {
dispatch(getReportDetail(record?.id))
}
const handleOpen = () => {
setDetailVisible(true)
}
const handleClose = () => {
setDetailVisible(false)
}
//里层列名
const columns = [
{
title: '抽查日期',
key: 'spotDate',
dataIndex: 'spotDate',
key: 'date',
dataIndex: 'date',
render: (_, record) => record?.date && moment(record?.date).format('YYYY-MM-DD') || '--'
},
{
title: '抽查县道比率(%)',
key: 'projeType',
dataIndex: 'dName',
key: 'countyPercentage',
dataIndex: 'countyPercentage',
},
{
title: '抽查县道',
key: 'proctType',
dataIndex: '',
key: 'spotCountyRoadCount',
dataIndex: 'spotCountyRoadCount',
},
{
title: '抽查乡道',
key: 'prectTye',
dataIndex: 'depame',
key: 'spotTownRoadCount',
dataIndex: 'spotTownRoadCount',
},
{
title: '抽查村道',
key: 'projeType',
dataIndex: 'dName',
key: 'spotVillageRoadCount',
dataIndex: 'spotVillageRoadCount',
},
{
title: '操作',
key: 'operation',
dataIndex: 'operation',
// render: (_, record) => {
// return
// }
render: (_, record) =>
<a href={`/_api/road/spot/export?token=${user?.token}&previewId=${record.id}`}>导出</a>
},
]
const queryData = (query = { startTime: '1970-1-1', endTime: '2099-12-31' }) => {
dispatch(getSpotCheckDetail(query)).then(res => {
const queryData = (data = {}) => {
dispatch(roadSpotList(data)).then(res => {
if (res.success) {
const data = res?.payload.data?.map(item => {
return {
spotDate: moment(item.date).format('YYYY-MM-DD'),
depName: item.department?.name,
reportCount: item.reportCount,
count: Math.ceil((item.reportCount * item.percentage) / 100),
reportDetail: item.reportSpotChecks?.map(child => {
return child.report
}),
id: item.id
}
})
setReportData(data)
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 addHanler = () => {
setVis(true)
}
const extractHandler = () => {
form.validateFields(['percentValue']).then(async (values) => {
if (Number(values.percentValue) > 0) {
const res = await dispatch(getReportSpotPrepare({ percentage: Number(values.percentValue) }))
// setCount(res?.payload.data?.reportCount)
// setDepId(res?.payload.data?.lukyDepartment?.id)
// setDepName(res?.payload.data?.lukyDepartment?.name)
const res = await dispatch(roadSpotPrepare({ countyPercentage: values.percentValue }))
setPreviewId(res?.payload.data?.previewId)
// setTotal(Math.ceil((res?.payload.data?.reportCount) * (Number(values.percentValue) / 100)))
form.setFieldsValue({
'result': res?.payload.data?.reportCount,
'village': res?.payload.data?.lukyDepartment?.name,
'total': Math.ceil((res?.payload.data?.reportCount) * (Number(values.percentValue) / 100))
'spotCountyRoadCount': res?.payload.data?.spotCountyRoadCount,
'spotTownRoadCount': res?.payload.data?.spotTownRoadCount,
'spotVillageRoadCount': res?.payload.data?.spotVillageRoadCount,
})
}
})
@ -284,45 +109,27 @@ const MaintenanceSpotCheck = (props) => {
setVis(false)
form.resetFields()
}
const okHandler = async () => {
if (previewId !== 0) {
const res = await dispatch(getSpotCheck({ previewId }))
const rslt = res.payload.data.map(item => {
return {
spotDate: moment(item.date).format('YYYY-MM-DD'),
depName: item.department?.name,
reportCount: item.reportCount,
count: Math.ceil((item.reportCount * item.percentage) / 100),
reportDetail: item.reportSpotChecks?.map(child => {
return child.report
}),
id: item.id
}
}) || []
setReportData(rslt)
form.resetFields()
setVis(false)
}
}
//console.log('setReportData', reportData)
const lookhandler = () => {
if ((dateRange && dateRange instanceof Array && dateRange[0] != '')) {
queryData({ startTime: moment(dateRange[0]).startOf('day').format('YYYY-MM-DD HH:mm:ss'), endTime: moment(dateRange[1]).endOf('day').format('YYYY-MM-DD HH:mm:ss') })
}
}
return (
<div>
<div style={{ display: "flex", alignItems: 'center', justifyContent: 'space-between', marginBottom: 16 }}>
<Button onClick={addHanler} type='primary' style={{ marginRight: '50px' }}> 新增 </Button>
<Button onClick={() => {
setVis(true)
}} type='primary' style={{ marginLeft: 10 }}> 新增 </Button>
<div>
<RangePicker onChange={(date, dateString) => { setDateRange(dateString) }} style={{ marginRight: 20 }} />
<Button style={{ marginRight: 20 }} onClick={lookhandler} > 查询 </Button>
<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>
@ -333,131 +140,148 @@ const MaintenanceSpotCheck = (props) => {
dataSource={reportData}
loading={loading}
expandable={{
//expandedRowKeys, // 控制哪些行展开,这里需要通过 state 管理
defaultExpandedRowKeys: ['0'],
// onExpand: handleExpand,
expandedRowKeys: expandedRowKeys, // 控制哪些行展开,这里需要通过 state 管理
// defaultExpandedRowKeys: ['0'],
onExpand: (expanded, record) => {
if (expanded) {
setExpandedRowKeys([record?.id])
detailData({ previewId: record?.id })
} else {
setExpandedRowKeys([])
}
},
expandedRowRender: (record) => (
< Table
pagination={false}
dataSource={record?.reportDetail}
pagination={{
pageSize: 10,
defaultPageSize: 10,
showSizeChanger: false,
}}
loading={detailLoading}
style={{ margin: 0 }}
dataSource={detailList}
columns={
[
{ title: '所属道路', dataIndex: 'road' },
{
title: '所在路段',
key: 'address',
dataIndex: 'address',
align: 'center',
render: (_, r) => {
return `${r?.roadSectionStart || ''}-${r?.roadSectionEnd || ''}`
}
},
{ title: '具体位置', dataIndex: 'address' },
{
title: '上报人',
width: 100,
key: 'userName',
dataIndex: 'userName',
align: 'center',
render: (text, r) => {
return r?.user?.name || ''
}
},
{
title: '上报时间',
key: 'time',
dataIndex: 'time',
valueType: 'dateTime',
align: 'center',
render: (_, r) => {
return moment(r?.time).format('YYYY-MM-DD HH:mm:ss')
}
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: 'caozuo',
align: 'center',
render: (_, r) => {
return <Button
onClick={() => { checkDetail(r); handleOpen() }}
style={{ marginRight: 10 }}>查看</Button>
}
}
// { title: '', dataIndex: 'subColumn1' },
// { title: '', dataIndex: 'subColumn2' },
// ... 其他子表格列配置
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}
// toolBarRender={false}
// search={false}
/>
<Modal visible={vis} onCancel={cancelHandler} title='养护抽查' onOk={okHandler}>
<Form form={form}>
<Form.Item
label="抽取比例(%)"
// name="percent"
rules={[{ required: true, message: '请填写抽取比例' }]}
>
<Input.Group compact>
<Form.Item
name="percentValue"
noStyle
rules={[
{ required: true, message: '请填写抽取比例' },
{
pattern: /^(100|\d{1,2})(\.\d{1,2})?$/,
message: '请输入有效的比例',
},
]}
>
<Input style={{ width: '80%' }} placeholder="请输入抽取比例" />
</Form.Item>
{/* <Form.Item
// name="percentSign"
noStyle
style={{ width: '20%', textAlign: 'center' }}
>
%
</Form.Item> */}
</Input.Group>
</Form.Item>
<Form.Item className="ant-row" style={{
textAlign: 'center',
}}>
<Button style={{}} type='primary' onClick={extractHandler}>开始抽取</Button>
</Form.Item>
<Form.Item label='抽查总数' name='result'>
<Input disabled />
</Form.Item>
<Form.Item label='抽查乡镇' name='village'>
<Input disabled />
</Form.Item>
<Form.Item label='抽查条数' name='total'>
<Input disabled />
</Form.Item>
</Form>
</Modal>
<DetailForm visible={detailVisible}
handleClose={handleClose}
data={reportDetail}
loading={reportDetailLoading} />
</div>
{
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, spotCheckDetail, reportDetail } = state
const { auth, roadSpotList, reportDetail, roadSpotDetail } = state
//('state1', state)
return {
user: auth.user,
loading: spotCheckDetail?.isRequesting,
loading: roadSpotList?.isRequesting,
detailLoading: roadSpotDetail?.isRequesting,
reportDetailLoading: reportDetail.isRequesting,
reportDetail: reportDetail.data,

Loading…
Cancel
Save