Browse Source

功能完善

release_0.0.4
xingyongchun 2 years ago
parent
commit
a505f33556
  1. 33
      web/client/src/sections/fillion/actions/infor.js
  2. 36
      web/client/src/sections/fillion/components/infor/details.js
  3. 192
      web/client/src/sections/fillion/components/inforTable.js
  4. 3
      web/client/src/sections/fillion/components/operationalTable.js
  5. 8
      web/client/src/utils/webapi.js

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

@ -290,4 +290,37 @@ export function delVehicle(query) {
msg: { error: '删除车辆信息失败' },
// reducer: { name: 'reportstatistic' }
});
}
export function getPurchase(query) {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
query: query,
actionType: 'GET_PURCHASE',
url: ApiTable.getPurchase,
msg: { error: '获取治超信息失败' },
// reducer: { name: 'reportstatistic' }
});
}
export function putPurchase(query) {
return dispatch => basicAction({
type: 'put',
dispatch: dispatch,
data: query,
actionType: 'PUT_PURCHASE',
url: ApiTable.putPurchase,
msg: { error: '获取治超信息失败' },
// reducer: { name: 'reportstatistic' }
});
}
export function delPurchase(query) {
return dispatch => basicAction({
type: 'del',
dispatch: dispatch,
actionType: 'DEL_PURCHASE',
url: ApiTable.delPurchase.replace("{overspeedId}", query?.overspeedId),
msg: { error: '删除车辆信息失败' },
// reducer: { name: 'reportstatistic' }
});
}

36
web/client/src/sections/fillion/components/infor/details.js

@ -2,11 +2,11 @@ import React, { useEffect, useState } from 'react';
import { connect } from 'react-redux';
import { Form, Spin, Table } from 'antd';
import { DrawerForm, ProForm, ProFormText, ProFormSelect } from '@ant-design/pro-form';
import { putRoadway, putSpecificVehicle, putHouseholds,putCircuit,putVehicle } from "../../actions/infor"
import { putRoadway, putSpecificVehicle, putHouseholds,putCircuit,putVehicle,putPurchase } from "../../actions/infor"
import { putBridge } from "../../actions/infor"
const UserModal = (props) => {
const { visible, onVisibleChange, typecard, rewkeys, data, recortd, sitename, dispatch, setRecortd, engineering } = props
const { visible, onVisibleChange, typecard, rewkeys, data, recortd, sitename, dispatch, setRecortd, setMonitor } = props
const [newlys, setNewlys] = useState() //必填数据
const [newlysay, setNewlysay] = useState() //处理hou
const [records, setRecords] = useState()//处理
@ -65,6 +65,13 @@ const UserModal = (props) => {
setNewlys(array?.splice(0, 2))
setNewlysay(array)
}
if (rewkeys === 'zhichao') {
_.forIn(data, function (value, key) {
array.push({ name: value, type: key })
});
setNewlys(array?.splice(0, 2))
setNewlysay(array)
}
}, [])
useEffect(() => {
const arr = []
@ -117,6 +124,13 @@ const UserModal = (props) => {
setRecordsay(arr.splice(1, 2))
// setEstablishment(arr.splice(-1, 1))
setRecords(arr)
}if (rewkeys === 'zhichao') {
_.forIn(recortd, function (value, key) {
arr.push({ value: value, type: key })
});
setRecordsay(arr.splice(1, 2))
// setEstablishment(arr.splice(-1, 1))
setRecords(arr)
}
}, [recortd])
useEffect(() => {
@ -230,6 +244,24 @@ const UserModal = (props) => {
return true
}
}
if (rewkeys === 'zhichao') {
if (typecard == '111') {
console.log(values)
const query = { ...values, overspeedId:records?.[0]?.value || '' }
dispatch(putPurchase(query)).then((res) => {
setSuccess(res.success)
setMonitor(res)
})
return true
} else {
const query = { ...values }
dispatch(putPurchase(query)).then((res) => {
setSuccess(res.success)
setMonitor(res)
})
return true
}
}
} else { return false }
}}

192
web/client/src/sections/fillion/components/inforTable.js

@ -1,21 +1,30 @@
import React, { useEffect, useState } from 'react';
import React, { useEffect, useState,useRef } from 'react';
import { connect } from 'react-redux';
import { Spin, Button, Popconfirm, Col, Input,Row } from 'antd';
import ProTable from '@ant-design/pro-table';
import './protable.less'
import moment from 'moment';
import { getReportStatistic } from "../actions/infor"
import { getPurchase,delPurchase } from "../actions/infor"
import UserModal from './infor/details';
const InForTable = (props) => {
const { dispatch, user, depData, depMessage, depLoading } = props
const [rowSelected, setRowSelected] = useState([])
const [counts, setCounts] = useState()//shuju
const [modalVisible, setModalVisible] = useState(false);
const [modalRecord, setModalRecord] = useState();
const [typecard, setTypecard] = useState();
const [recortd, setRecortd] = useState()
const [monitor, setMonitor] = useState()
const [delet, setDelet] = useState()
const [nameOfInspectionPoint, setNameOfInspectionPoint] = useState()//检测点名称
const [licensePlate, setLicensePlate] = useState()//车牌号
const [numberOfAxles, setNumberOfAxles] = useState()//车轴数
const [overrunRateUpper, setOverrunRateUpper] = useState()//超限率上限
const [overrunRateFloor, setOverrunRateFloor] = useState()//超限率下限
const [testTime, setTestTime] = useState()//超限率下限
const ref = useRef()
useEffect(() => { ref.current.reload() }, [monitor,delet,modalVisible])
//打开弹窗
const openModal = (type, record) => {
setModalVisible(true);
@ -45,31 +54,52 @@ const InForTable = (props) => {
const columns =
[
{
title: '检测点名称',
title: '区/县',
dataIndex: 'placeName',
fixed: 'left',
width: 120,
options: 1,
search: false,
backgroundColor: "#ffffff",
fieldProps: {
onChange: (value, cs) => {
setSitename(value.currentTarget.value)
},
placeholder: '请输入检测点名称进行搜索',
getPopupContainer: (triggerNode) => triggerNode.parentNode,
},
render: (dom, record) => {
return record.districtcounty
},
},
{
title: '车牌号',
title: '检测点名称',
// search: false,
dataIndex: 'containers1',
fixed: 'left',
width: 120,
render: (dom, record) => {
return record.address
return record.nameOfInspectionPoint
},
fieldProps: {
onChange: (value, cs) => {
setNameOfInspectionPoint(value.currentTarget.value)
},
placeholder: '请输入车牌号进行搜索',
getPopupContainer: (triggerNode) => triggerNode.parentNode,
}
},{
title: '车牌号码',
// search: false,
dataIndex: 'containers444',
fixed: 'left',
width: 120,
render: (dom, record) => {
return record.licensePlate
},
fieldProps: {
onChange: (value, cs) => {
setLicensePlate(value.currentTarget.value)
},
placeholder: '请输入车牌号进行搜索',
getPopupContainer: (triggerNode) => triggerNode.parentNode,
}
@ -80,9 +110,12 @@ const InForTable = (props) => {
dataIndex: 'containers2',
width: 120,
render: (dom, record) => {
return record.address
return record.numberOfAxles
},
fieldProps: {
onChange: (value, cs) => {
setNumberOfAxles(value.currentTarget.value)
},
placeholder: '请输入车轴数进行搜索',
getPopupContainer: (triggerNode) => triggerNode.parentNode,
}
@ -95,20 +128,28 @@ const InForTable = (props) => {
//
width: 120,
render: (dom, record) => {
return record.address
return record.overrunRate
},
fieldProps: {
placeholder: '请输入超限率进行搜索',
getPopupContainer: (triggerNode) => triggerNode.parentNode,
},
// fieldProps: {
// placeholder: '请输入超限率进行搜索',
// getPopupContainer: (triggerNode) => triggerNode.parentNode,
// },
renderFormItem: (item, { type, defaultRender, formItemProps, fieldProps, ...rest }, form) => {
return <Input.Group >
<Row gutter={8}>
<Col span={8}>
<Input placeholder='输入超限率'/>
<Input
onChange={(value)=>{
setOverrunRateUpper(value.currentTarget.value)
}}
placeholder='输入超限率上限'/>
</Col>
<Col span={8}>
<Input placeholder='输入超限率'/>
<Input
onChange={(value)=>{
setOverrunRateFloor(value.currentTarget.value)
}}
placeholder='输入超限率下限'/>
</Col>
</Row>
</Input.Group>
@ -123,7 +164,7 @@ const InForTable = (props) => {
width: 120,
render: (dom, record) => {
return record.address
return record.overrunWeight
},
fieldProps: {
getPopupContainer: (triggerNode) => triggerNode.parentNode,
@ -137,7 +178,7 @@ const InForTable = (props) => {
width: 120,
render: (dom, record) => {
return record.address
return record.grossVehicleWeight
},
fieldProps: {
getPopupContainer: (triggerNode) => triggerNode.parentNode,
@ -151,7 +192,7 @@ const InForTable = (props) => {
width: 120,
render: (dom, record) => {
return record.address
return record.vehicleCargoWeightLimit
},
fieldProps: {
getPopupContainer: (triggerNode) => triggerNode.parentNode,
@ -164,9 +205,12 @@ const InForTable = (props) => {
valueType: 'dateTime',
width: 120,
render: (dom, record) => {
return record.address
return record.testTime
},
fieldProps: {
onChange: (value, cs) => {
setTestTime(cs)
},
getPopupContainer: (triggerNode) => triggerNode.parentNode,
}
}, {
@ -178,7 +222,7 @@ const InForTable = (props) => {
width: 120,
render: (dom, record) => {
return record.address
return record.nameOfBusinessOwner
},
fieldProps: {
getPopupContainer: (triggerNode) => triggerNode.parentNode,
@ -193,7 +237,7 @@ const InForTable = (props) => {
width: 140,
render: (dom, record) => {
return record.address
return record.businessAddress
},
fieldProps: {
getPopupContainer: (triggerNode) => triggerNode.parentNode,
@ -208,7 +252,7 @@ const InForTable = (props) => {
width: 140,
render: (dom, record) => {
return record.address
return record.notifier
},
fieldProps: {
getPopupContainer: (triggerNode) => triggerNode.parentNode,
@ -223,7 +267,7 @@ const InForTable = (props) => {
width: 140,
render: (dom, record) => {
return record.address
return record.notificationMethod
},
fieldProps: {
getPopupContainer: (triggerNode) => triggerNode.parentNode,
@ -235,10 +279,10 @@ const InForTable = (props) => {
valueType: 'dateRange',
width: 140,
width: 240,
render: (dom, record) => {
return record.address
return record.notificationResults
},
fieldProps: {
getPopupContainer: (triggerNode) => triggerNode.parentNode,
@ -253,7 +297,7 @@ const InForTable = (props) => {
width: 140,
render: (dom, record) => {
return record.address
return record.processingTime
},
fieldProps: {
getPopupContainer: (triggerNode) => triggerNode.parentNode,
@ -268,7 +312,7 @@ const InForTable = (props) => {
width: 140,
render: (dom, record) => {
return record.address
return record.deductPoints
},
fieldProps: {
getPopupContainer: (triggerNode) => triggerNode.parentNode,
@ -283,7 +327,23 @@ const InForTable = (props) => {
width: 140,
render: (dom, record) => {
return record.address
return record.fine
},
fieldProps: {
getPopupContainer: (triggerNode) => triggerNode.parentNode,
}
},
{
title: '备注',
search: false,
dataIndex: 'containers14',
valueType: 'dateRange',
width: 140,
render: (dom, record) => {
return record.remarks
},
fieldProps: {
getPopupContainer: (triggerNode) => triggerNode.parentNode,
@ -301,9 +361,18 @@ const InForTable = (props) => {
onClick={() => {
openModal('edit', record)
setTypecard('111')
setRecortd(record)
}}
>编辑</Button><Button type="link"></Button></div>
>编辑</Button><Button type="link"
onClick={() => {
const query = {
overspeedId: record.id
}
dispatch(delPurchase(query)).then((res) => {
setDelet(res)
})
}}
>删除</Button></div>
}
},
@ -342,6 +411,7 @@ const InForTable = (props) => {
<Spin spinning={false}>
<div className='protable-transpor'>
<ProTable
actionRef={ref}
scroll={{ x: 800 }}
options={false}
ref={c => { finishedProductTable = c; }}
@ -355,20 +425,26 @@ const InForTable = (props) => {
},
}}
columns={columns}
dataSource={(counts || {}).rows || []}
dataSource={counts || []}
onReset={(v) => {
setNameOfInspectionPoint('')
setLicensePlate('')
setNumberOfAxles('')
setOverrunRateUpper('')
setOverrunRateFloor('')
setTestTime('')
}}
request={async (params) => {
const query = {
startDate: day[0],
endDate: day[1],
placeType: placeType,
regionId: regionId,
placeName: sitename,
limit: params.pageSize,
offset: ((params.current ? params.current : 1) - 1) * params.pageSize
nameOfInspectionPoint:nameOfInspectionPoint,
licensePlate:licensePlate,
numberOfAxles:numberOfAxles,
overrunRateUpper:overrunRateUpper,
overrunRateFloor:overrunRateFloor,
testTime:testTime
}
setRowSelected([]);
const res = await dispatch(getReportStatistic(query));
const res = await dispatch(getPurchase(query));
setCounts(res.payload.data)
return {
...res,
@ -390,15 +466,41 @@ const InForTable = (props) => {
>
</ProTable></div>
<UserModal
{modalVisible ? <UserModal
visible={modalVisible}
onVisibleChange={setModalVisible}
modalRecord={modalRecord}
typecard={typecard}
/>
rewkeys={'zhichao'}
data={data}
recortd={recortd}
setMonitor={setMonitor}
// sitename={sitename}
setRecortd={setRecortd}
/> : ''}
</Spin >
)
}
const data={
"districtcounty": "区/县",
"nameOfInspectionPoint": "检测点名称",
"licensePlate": "车牌号码",
"numberOfAxles": "车轴数",
"overrunRate": "超限率",
"overrunWeight": "超限重量",
"grossVehicleWeight": "车货总重",
"vehicleCargoWeightLimit": "车货限重",
"testTime": "检测时间",
"nameOfBusinessOwner": "经营业户名称",
"businessAddress": "经营业户地址",
"notifier": "通知人",
"notificationMethod": "通知方式",
"notificationResults": "通知结果",
"processingTime": "处理时间",
"deductPoints": "扣分",
"fine": "罚款",
"remarks": "备注"
}
function mapStateToProps(state) {
const { auth, depMessage } = state;
const pakData = (dep) => {

3
web/client/src/sections/fillion/components/operationalTable.js

@ -11,9 +11,6 @@ import HightModal from './highways/highwaysdata';
const OperaTionalTable = (props) => {
const { dispatch, user, depData, depMessage, depLoading } = props
const [rowSelected, setRowSelected] = useState([])
// const [regionId, setRegionId] = useState()//区域id
// const [placeType, setPlaceType] = useState()//场所
// const [day, setDay] = useState([moment('2022-03-01').format('YYYY-MM-DD'), moment().format('YYYY-MM-DD')])//日期
const [sitename, setSitename] = useState()//场所名称
const [counts, setCounts] = useState()//shuju
const [modalVisible, setModalVisible] = useState(false);

8
web/client/src/utils/webapi.js

@ -90,6 +90,14 @@ delRoadway:'road/{roadId}',
//公交信息
getCircuit:'bus/line',putCircuit:'bus/line',delCircuit:'bus/line/{lineId}',
getVehicle:'bus/car',putVehicle:'bus/car',delVehicle:'bus/car/{carId}',
//治超管理
getPurchase:'overspeed',
putPurchase:'overspeed',
delPurchase:'overspeed/{overspeedId}',
};

Loading…
Cancel
Save