|
@ -1,9 +1,9 @@ |
|
|
import React, { useEffect, useState,useRef } from 'react'; |
|
|
import React, { useEffect, useState, useRef } from 'react'; |
|
|
import { connect } from 'react-redux'; |
|
|
import { connect } from 'react-redux'; |
|
|
import { Spin, Button, Popconfirm, Badge } from 'antd'; |
|
|
import { Spin, Button, Popconfirm, Badge } from 'antd'; |
|
|
import ProTable from '@ant-design/pro-table'; |
|
|
import ProTable from '@ant-design/pro-table'; |
|
|
import './protable.less' |
|
|
import './protable.less' |
|
|
import { getOperaTional, getSpecificVehicle, getHouseholds,delSpecificVehicle,delHouseholds } from "../actions/infor" |
|
|
import { getOperaTional, getSpecificVehicle, getHouseholds, delSpecificVehicle, delHouseholds } from "../actions/infor" |
|
|
import UserModal from './infor/details'; |
|
|
import UserModal from './infor/details'; |
|
|
import HightModal from './highways/highwaysdata'; |
|
|
import HightModal from './highways/highwaysdata'; |
|
|
|
|
|
|
|
@ -24,7 +24,7 @@ const OperaTionalTable = (props) => { |
|
|
const [delet, setDelet] = useState() |
|
|
const [delet, setDelet] = useState() |
|
|
|
|
|
|
|
|
const ref = useRef() |
|
|
const ref = useRef() |
|
|
useEffect(() => { ref.current.reload() }, [rewkeys,activeKey,delet]) |
|
|
useEffect(() => { ref.current.reload() }, [rewkeys, activeKey, delet]) |
|
|
//打开弹窗
|
|
|
//打开弹窗
|
|
|
const openModal = (type, record) => { |
|
|
const openModal = (type, record) => { |
|
|
setModalVisible(true); |
|
|
setModalVisible(true); |
|
@ -35,6 +35,23 @@ const OperaTionalTable = (props) => { |
|
|
setModalRecord(null); |
|
|
setModalRecord(null); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
const deldata = (id) => { // 出租危货
|
|
|
|
|
|
const query = { |
|
|
|
|
|
vehicleId: id |
|
|
|
|
|
} |
|
|
|
|
|
dispatch(delSpecificVehicle(query)).then((res) => { |
|
|
|
|
|
setDelet(res) |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const deldatas = (id) => { // 业户
|
|
|
|
|
|
const query = { |
|
|
|
|
|
businessId: id |
|
|
|
|
|
} |
|
|
|
|
|
dispatch(delHouseholds(query)).then((res) => { |
|
|
|
|
|
setDelet(res) |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
//打开弹窗
|
|
|
//打开弹窗
|
|
|
const hightModal = (type, record) => { |
|
|
const hightModal = (type, record) => { |
|
|
setModalVisibleyilan(true); |
|
|
setModalVisibleyilan(true); |
|
@ -73,7 +90,7 @@ const OperaTionalTable = (props) => { |
|
|
search: false, |
|
|
search: false, |
|
|
|
|
|
|
|
|
fieldProps: { |
|
|
fieldProps: { |
|
|
|
|
|
|
|
|
placeholder: '请输入道路名称进行搜索', |
|
|
placeholder: '请输入道路名称进行搜索', |
|
|
getPopupContainer: (triggerNode) => triggerNode.parentNode, |
|
|
getPopupContainer: (triggerNode) => triggerNode.parentNode, |
|
|
}, |
|
|
}, |
|
@ -132,7 +149,7 @@ const OperaTionalTable = (props) => { |
|
|
render: (dom, record) => { |
|
|
render: (dom, record) => { |
|
|
return record.nameOfBusinessOwner |
|
|
return record.nameOfBusinessOwner |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
title: '车籍地', |
|
|
title: '车籍地', |
|
|
search: false, |
|
|
search: false, |
|
@ -696,16 +713,9 @@ const OperaTionalTable = (props) => { |
|
|
setTypecard('111') |
|
|
setTypecard('111') |
|
|
setRecortd(record) |
|
|
setRecortd(record) |
|
|
}} |
|
|
}} |
|
|
>编辑</Button><Button type="link" |
|
|
>编辑</Button> <Popconfirm title='是否确认删除' onConfirm={() => { deldata(record.id) }}> |
|
|
onClick={() => { |
|
|
<Button type="link">删除</Button> |
|
|
const query = { |
|
|
</Popconfirm></div> |
|
|
vehicleId: record.id |
|
|
|
|
|
} |
|
|
|
|
|
dispatch(delSpecificVehicle(query)).then((res) => { |
|
|
|
|
|
setDelet(res) |
|
|
|
|
|
}) |
|
|
|
|
|
}} |
|
|
|
|
|
>删除</Button></div> |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
@ -759,7 +769,7 @@ const OperaTionalTable = (props) => { |
|
|
render: (dom, record) => { |
|
|
render: (dom, record) => { |
|
|
return record.nameOfBusinessOwner |
|
|
return record.nameOfBusinessOwner |
|
|
}, |
|
|
}, |
|
|
}, { |
|
|
}, { |
|
|
title: '品名', |
|
|
title: '品名', |
|
|
search: false, |
|
|
search: false, |
|
|
dataIndex: 'containers', |
|
|
dataIndex: 'containers', |
|
@ -1336,16 +1346,9 @@ const OperaTionalTable = (props) => { |
|
|
setTypecard('111') |
|
|
setTypecard('111') |
|
|
setRecortd(record) |
|
|
setRecortd(record) |
|
|
}} |
|
|
}} |
|
|
>编辑</Button><Button type="link" |
|
|
>编辑</Button> <Popconfirm title='是否确认删除' onConfirm={() => { deldata(record.id) }}> |
|
|
onClick={() => { |
|
|
<Button type="link">删除</Button> |
|
|
const query = { |
|
|
</Popconfirm></div> |
|
|
vehicleId: record.id |
|
|
|
|
|
} |
|
|
|
|
|
dispatch(delSpecificVehicle(query)).then((res) => { |
|
|
|
|
|
setDelet(res) |
|
|
|
|
|
}) |
|
|
|
|
|
}} |
|
|
|
|
|
>删除</Button></div> |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
@ -1813,16 +1816,9 @@ const OperaTionalTable = (props) => { |
|
|
setTypecard('111') |
|
|
setTypecard('111') |
|
|
setRecortd(record) |
|
|
setRecortd(record) |
|
|
}} |
|
|
}} |
|
|
>编辑</Button><Button type="link" |
|
|
>编辑</Button><Popconfirm title='是否确认删除' onConfirm={() => { deldatas(record.id) }}> |
|
|
onClick={() => { |
|
|
<Button type="link">删除</Button> |
|
|
const query = { |
|
|
</Popconfirm></div> |
|
|
businessId: record.id |
|
|
|
|
|
} |
|
|
|
|
|
dispatch(delHouseholds(query)).then((res) => { |
|
|
|
|
|
setDelet(res) |
|
|
|
|
|
}) |
|
|
|
|
|
}} |
|
|
|
|
|
>删除</Button></div> |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
@ -1881,16 +1877,20 @@ const OperaTionalTable = (props) => { |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
key: 'tab2', |
|
|
key: 'tab2', |
|
|
label: <span onClick={() => { { |
|
|
label: <span onClick={() => { |
|
|
setRewkeys('chuzu') |
|
|
{ |
|
|
} }}>出租车{activeKey === 'tab2'}</span>, |
|
|
setRewkeys('chuzu') |
|
|
|
|
|
} |
|
|
|
|
|
}}>出租车{activeKey === 'tab2'}</span>, |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
key: 'tab3', |
|
|
key: 'tab3', |
|
|
label: <span onClick={() => { { |
|
|
label: <span onClick={() => { |
|
|
setRewkeys('weihuo') |
|
|
{ |
|
|
} }}>危险货运{activeKey === 'tab3'}</span>, |
|
|
setRewkeys('weihuo') |
|
|
|
|
|
} |
|
|
|
|
|
}}>危险货运{activeKey === 'tab3'}</span>, |
|
|
|
|
|
|
|
|
}, { |
|
|
}, { |
|
|
key: 'tab4', |
|
|
key: 'tab4', |
|
@ -1918,58 +1918,62 @@ const OperaTionalTable = (props) => { |
|
|
}} |
|
|
}} |
|
|
columns={columns[activeKey]} |
|
|
columns={columns[activeKey]} |
|
|
|
|
|
|
|
|
dataSource={counts || []} |
|
|
dataSource={counts || []} |
|
|
request={async (params, sort, filter) => { |
|
|
request={async (params, sort, filter) => { |
|
|
if(rewkeys=='keyun'){ |
|
|
if (rewkeys == 'keyun') { |
|
|
const query = {} |
|
|
const query = {} |
|
|
setRowSelected([]); |
|
|
setRowSelected([]); |
|
|
const res = await dispatch(getOperaTional(query)); |
|
|
const res = await dispatch(getOperaTional(query)); |
|
|
setCounts(res.payload.data) |
|
|
setCounts(res.payload.data) |
|
|
return { |
|
|
return { |
|
|
...res, |
|
|
...res, |
|
|
total: res.payload.data ? res.payload.data.count : 0 |
|
|
total: res.payload.data ? res.payload.data.count : 0 |
|
|
}} |
|
|
} |
|
|
if(rewkeys=='chuzu'){ |
|
|
} |
|
|
|
|
|
if (rewkeys == 'chuzu') { |
|
|
const query = { |
|
|
const query = { |
|
|
type:'出租车', |
|
|
type: '出租车', |
|
|
nameOfBusinessOwner:sitename |
|
|
nameOfBusinessOwner: sitename |
|
|
} |
|
|
} |
|
|
setRowSelected([]); |
|
|
setRowSelected([]); |
|
|
const res = await dispatch(getSpecificVehicle(query)); |
|
|
const res = await dispatch(getSpecificVehicle(query)); |
|
|
setCounts(res.payload.data) |
|
|
setCounts(res.payload.data) |
|
|
return { |
|
|
return { |
|
|
...res, |
|
|
...res, |
|
|
total: res.payload.data ? res.payload.data.count : 0 |
|
|
total: res.payload.data ? res.payload.data.count : 0 |
|
|
}} |
|
|
} |
|
|
if(rewkeys=='weihuo'){ |
|
|
} |
|
|
|
|
|
if (rewkeys == 'weihuo') { |
|
|
const query = { |
|
|
const query = { |
|
|
type:'危货', |
|
|
type: '危货', |
|
|
nameOfBusinessOwner:sitename |
|
|
nameOfBusinessOwner: sitename |
|
|
} |
|
|
} |
|
|
setRowSelected([]); |
|
|
setRowSelected([]); |
|
|
const res = await dispatch(getSpecificVehicle(query)); |
|
|
const res = await dispatch(getSpecificVehicle(query)); |
|
|
setCounts(res.payload.data) |
|
|
setCounts(res.payload.data) |
|
|
return { |
|
|
return { |
|
|
...res, |
|
|
...res, |
|
|
total: res.payload.data ? res.payload.data.count : 0 |
|
|
total: res.payload.data ? res.payload.data.count : 0 |
|
|
}} |
|
|
} |
|
|
if(rewkeys=='yehu'){ |
|
|
} |
|
|
|
|
|
if (rewkeys == 'yehu') { |
|
|
const query = { |
|
|
const query = { |
|
|
nameOfBusinessOwner:sitename |
|
|
nameOfBusinessOwner: sitename |
|
|
} |
|
|
} |
|
|
setRowSelected([]); |
|
|
setRowSelected([]); |
|
|
const res = await dispatch(getHouseholds(query)); |
|
|
const res = await dispatch(getHouseholds(query)); |
|
|
setCounts(res.payload.data) |
|
|
setCounts(res.payload.data) |
|
|
return { |
|
|
return { |
|
|
...res, |
|
|
...res, |
|
|
total: res.payload.data ? res.payload.data.count : 0 |
|
|
total: res.payload.data ? res.payload.data.count : 0 |
|
|
}} |
|
|
} |
|
|
|
|
|
} |
|
|
}} |
|
|
}} |
|
|
search={{ |
|
|
search={{ |
|
|
defaultCollapsed: false, |
|
|
defaultCollapsed: false, |
|
|
optionRender: (searchConfig, formProps, dom) => [ |
|
|
optionRender: (searchConfig, formProps, dom) => [ |
|
|
...dom.reverse(), |
|
|
...dom.reverse(), |
|
|
['tab2','tab3','tab4'].includes(activeKey) ? <Popconfirm title="确认导出?" onConfirm={() => { props.exports(rowSelected, counts) }}> |
|
|
['tab2', 'tab3', 'tab4'].includes(activeKey) ? <Popconfirm title="确认导出?" onConfirm={() => { props.exports(rowSelected, counts) }}> |
|
|
<Button |
|
|
<Button |
|
|
> |
|
|
> |
|
|
导出 |
|
|
导出 |
|
@ -1981,13 +1985,13 @@ const OperaTionalTable = (props) => { |
|
|
|
|
|
|
|
|
> |
|
|
> |
|
|
</ProTable></div> |
|
|
</ProTable></div> |
|
|
{modalVisible ? <UserModal |
|
|
{modalVisible ? <UserModal |
|
|
visible={modalVisible} |
|
|
visible={modalVisible} |
|
|
onVisibleChange={setModalVisible} |
|
|
onVisibleChange={setModalVisible} |
|
|
modalRecord={modalRecord} |
|
|
modalRecord={modalRecord} |
|
|
typecard={typecard} |
|
|
typecard={typecard} |
|
|
rewkeys={rewkeys} |
|
|
rewkeys={rewkeys} |
|
|
data={rewkeys==='yehu'?data:date} |
|
|
data={rewkeys === 'yehu' ? data : date} |
|
|
recortd={recortd} |
|
|
recortd={recortd} |
|
|
// sitename={sitename}
|
|
|
// sitename={sitename}
|
|
|
setDelet={setDelet} |
|
|
setDelet={setDelet} |
|
@ -2006,7 +2010,7 @@ const OperaTionalTable = (props) => { |
|
|
</Spin > |
|
|
</Spin > |
|
|
) |
|
|
) |
|
|
} |
|
|
} |
|
|
const date={ |
|
|
const date = { |
|
|
"nameOfBusinessOwner": "业户名称", |
|
|
"nameOfBusinessOwner": "业户名称", |
|
|
"productName": "品名", |
|
|
"productName": "品名", |
|
|
"vehicleRegistry": "车籍地", |
|
|
"vehicleRegistry": "车籍地", |
|
@ -2047,7 +2051,7 @@ const date={ |
|
|
"nextRatingDate": "下次等级评定日期", |
|
|
"nextRatingDate": "下次等级评定日期", |
|
|
"creationDate": "创建日期" |
|
|
"creationDate": "创建日期" |
|
|
} |
|
|
} |
|
|
const data={ |
|
|
const data = { |
|
|
"nameOfBusinessOwner": "业户名称", |
|
|
"nameOfBusinessOwner": "业户名称", |
|
|
"productName": "品名", |
|
|
"productName": "品名", |
|
|
"creditSocialCode": "信用社会代码", |
|
|
"creditSocialCode": "信用社会代码", |
|
@ -2076,7 +2080,7 @@ const data={ |
|
|
"licenseIssuanceType": "证照发放类型", |
|
|
"licenseIssuanceType": "证照发放类型", |
|
|
"numberOfSharedVehicles": "共有车辆数", |
|
|
"numberOfSharedVehicles": "共有车辆数", |
|
|
"creationDate": "创建日期", |
|
|
"creationDate": "创建日期", |
|
|
'type':'类型' |
|
|
'type': '类型' |
|
|
} |
|
|
} |
|
|
function mapStateToProps(state) { |
|
|
function mapStateToProps(state) { |
|
|
const { auth, depMessage } = state; |
|
|
const { auth, depMessage } = state; |
|
|