|
|
@ -4,7 +4,7 @@ import { Spin, Button, Popconfirm, Badge } from 'antd'; |
|
|
|
import ProTable from '@ant-design/pro-table'; |
|
|
|
import './protable.less' |
|
|
|
import moment from 'moment'; |
|
|
|
import { getCircuit,getVehicle,delCircuit,delVehicle } from "../actions/infor" |
|
|
|
import { getCircuit, getVehicle, delCircuit, delVehicle } from "../actions/infor" |
|
|
|
import UserModal from './infor/details'; |
|
|
|
|
|
|
|
const PublicTable = (props) => { |
|
|
@ -24,23 +24,23 @@ const PublicTable = (props) => { |
|
|
|
const [delet, setDelet] = useState() |
|
|
|
|
|
|
|
const ref = useRef() |
|
|
|
useEffect(() => { ref.current.reload() }, [delet,rewkeys]) |
|
|
|
//xianlu请求
|
|
|
|
const requestxianlu = (name) => { |
|
|
|
const query = name |
|
|
|
setRowSelected([]); |
|
|
|
dispatch(getCircuit(query)).then((res)=>{ |
|
|
|
setCounts(res.payload.data) |
|
|
|
}) |
|
|
|
} |
|
|
|
//cheliang请求
|
|
|
|
const requestcheliang = (name) => { |
|
|
|
const query = '' |
|
|
|
setRowSelected([]); |
|
|
|
dispatch(getVehicle(query)).then((res)=>{ |
|
|
|
setCounts(res.payload.data) |
|
|
|
}) |
|
|
|
} |
|
|
|
useEffect(() => { ref.current.reload() }, [delet, rewkeys]) |
|
|
|
//xianlu请求
|
|
|
|
const requestxianlu = (name) => { |
|
|
|
const query = name |
|
|
|
setRowSelected([]); |
|
|
|
dispatch(getCircuit(query)).then((res) => { |
|
|
|
setCounts(res.payload.data) |
|
|
|
}) |
|
|
|
} |
|
|
|
//cheliang请求
|
|
|
|
const requestcheliang = (name) => { |
|
|
|
const query = '' |
|
|
|
setRowSelected([]); |
|
|
|
dispatch(getVehicle(query)).then((res) => { |
|
|
|
setCounts(res.payload.data) |
|
|
|
}) |
|
|
|
} |
|
|
|
//打开弹窗
|
|
|
|
const openModal = (type, record) => { |
|
|
|
setModalVisible(true); |
|
|
@ -67,6 +67,22 @@ const requestcheliang = (name) => { |
|
|
|
`attachments?src=files/${resTextIs}&filename=${encodeURIComponent(resTextIs)}&token=${user.token}`) |
|
|
|
}) |
|
|
|
} |
|
|
|
const deldata = (id) => { // 线路
|
|
|
|
const query = { |
|
|
|
lineId: id |
|
|
|
} |
|
|
|
dispatch(delCircuit(query)).then((res) => { |
|
|
|
setDelet(res) |
|
|
|
}) |
|
|
|
} |
|
|
|
const deldatas = (id) => { // 车辆
|
|
|
|
const query = { |
|
|
|
carId: id |
|
|
|
} |
|
|
|
dispatch(delVehicle(query)).then((res) => { |
|
|
|
setDelet(res) |
|
|
|
}) |
|
|
|
} |
|
|
|
const columns = { |
|
|
|
tab1: [ |
|
|
|
{ |
|
|
@ -411,16 +427,9 @@ const requestcheliang = (name) => { |
|
|
|
setTypecard('111') |
|
|
|
setRecortd(record) |
|
|
|
}} |
|
|
|
>编辑</Button><Button type="link" |
|
|
|
onClick={() => { |
|
|
|
const query = { |
|
|
|
lineId: record.id |
|
|
|
} |
|
|
|
dispatch(delCircuit(query)).then((res) => { |
|
|
|
setDelet(res) |
|
|
|
}) |
|
|
|
}} |
|
|
|
>删除</Button></div> |
|
|
|
>编辑</Button><Popconfirm title='是否确认删除' onConfirm={() => { deldata(record.id) }}> |
|
|
|
<Button type="link">删除</Button> |
|
|
|
</Popconfirm></div> |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
@ -1113,16 +1122,9 @@ const requestcheliang = (name) => { |
|
|
|
setTypecard('111') |
|
|
|
setRecortd(record) |
|
|
|
}} |
|
|
|
>编辑</Button><Button type="link" |
|
|
|
onClick={() => { |
|
|
|
const query = { |
|
|
|
carId: record.id |
|
|
|
} |
|
|
|
dispatch(delVehicle(query)).then((res) => { |
|
|
|
setDelet(res) |
|
|
|
}) |
|
|
|
}} |
|
|
|
>删除</Button></div> |
|
|
|
>编辑</Button><Popconfirm title='是否确认删除' onConfirm={() => { deldatas(record.id) }}> |
|
|
|
<Button type="link">删除</Button> |
|
|
|
</Popconfirm></div> |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
@ -1173,16 +1175,20 @@ const requestcheliang = (name) => { |
|
|
|
items: [ |
|
|
|
{ |
|
|
|
key: 'tab1', |
|
|
|
label: <span onClick={() => { { |
|
|
|
setRewkeys('xianlu') |
|
|
|
} }}>运营线路{activeKey === 'tab1'}</span>, |
|
|
|
label: <span onClick={() => { |
|
|
|
{ |
|
|
|
setRewkeys('xianlu') |
|
|
|
} |
|
|
|
}}>运营线路{activeKey === 'tab1'}</span>, |
|
|
|
|
|
|
|
}, |
|
|
|
{ |
|
|
|
key: 'tab2', |
|
|
|
label: <span onClick={() => { { |
|
|
|
setRewkeys('cheliang') |
|
|
|
} }}>车辆信息{activeKey === 'tab2'}</span>, |
|
|
|
label: <span onClick={() => { |
|
|
|
{ |
|
|
|
setRewkeys('cheliang') |
|
|
|
} |
|
|
|
}}>车辆信息{activeKey === 'tab2'}</span>, |
|
|
|
|
|
|
|
} |
|
|
|
], |
|
|
@ -1211,31 +1217,31 @@ const requestcheliang = (name) => { |
|
|
|
|
|
|
|
dataSource={counts || []} |
|
|
|
request={async (params) => { |
|
|
|
if(rewkeys=='xianlu'){ |
|
|
|
if (rewkeys == 'xianlu') { |
|
|
|
const query = { |
|
|
|
fleet:sitename |
|
|
|
fleet: sitename |
|
|
|
} |
|
|
|
setRowSelected([]); |
|
|
|
const res = await dispatch(getCircuit(query)); |
|
|
|
setCounts(res.payload.data) |
|
|
|
return { |
|
|
|
...res, |
|
|
|
total: res.payload.data ? res.payload.data.count : 0 |
|
|
|
} |
|
|
|
} |
|
|
|
setRowSelected([]); |
|
|
|
const res = await dispatch(getCircuit(query)); |
|
|
|
setCounts(res.payload.data) |
|
|
|
return { |
|
|
|
...res, |
|
|
|
total: res.payload.data ? res.payload.data.count : 0 |
|
|
|
} |
|
|
|
} |
|
|
|
if(rewkeys=='cheliang'){ |
|
|
|
if (rewkeys == 'cheliang') { |
|
|
|
const query = { |
|
|
|
fleet:sitename |
|
|
|
} |
|
|
|
setRowSelected([]); |
|
|
|
const res = await dispatch(getVehicle(query)); |
|
|
|
setCounts(res.payload.data) |
|
|
|
return { |
|
|
|
...res, |
|
|
|
total: res.payload.data ? res.payload.data.count : 0 |
|
|
|
fleet: sitename |
|
|
|
} |
|
|
|
setRowSelected([]); |
|
|
|
const res = await dispatch(getVehicle(query)); |
|
|
|
setCounts(res.payload.data) |
|
|
|
return { |
|
|
|
...res, |
|
|
|
total: res.payload.data ? res.payload.data.count : 0 |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}} |
|
|
|
search={{ |
|
|
|
defaultCollapsed: false, |
|
|
@ -1252,13 +1258,13 @@ const requestcheliang = (name) => { |
|
|
|
|
|
|
|
> |
|
|
|
</ProTable></div> |
|
|
|
{modalVisible ? <UserModal |
|
|
|
{modalVisible ? <UserModal |
|
|
|
visible={modalVisible} |
|
|
|
onVisibleChange={setModalVisible} |
|
|
|
modalRecord={modalRecord} |
|
|
|
typecard={typecard} |
|
|
|
rewkeys={rewkeys} |
|
|
|
data={rewkeys==='xianlu'?data:date} |
|
|
|
data={rewkeys === 'xianlu' ? data : date} |
|
|
|
recortd={recortd} |
|
|
|
// sitename={sitename}
|
|
|
|
setDelet={setDelet} |
|
|
@ -1292,58 +1298,59 @@ const data = { |
|
|
|
"area": "所属区域", |
|
|
|
"remarks": "备注" |
|
|
|
} |
|
|
|
const date={ "company": "所属公司", |
|
|
|
"fleet": "所属车队", |
|
|
|
"line": "所属线路", |
|
|
|
"vehicleNumber": "车辆编号", |
|
|
|
"vehicleLicensePlateNumber": "车辆牌照号", |
|
|
|
"operationCategory": "运营类别", |
|
|
|
"serviceLife": "已使用年限", |
|
|
|
"engineModel": "发动机型号", |
|
|
|
"vehicleModel": "车辆型号", |
|
|
|
"vehicleCategory": "车辆类别", |
|
|
|
"vehicleStatus": "车辆状态", |
|
|
|
"dateOfEntry": "入户日期", |
|
|
|
"purchaseDate": "购进日期", |
|
|
|
"energyConsumptionType": "能耗类型", |
|
|
|
"numberOfStandardUnits": "标台数", |
|
|
|
"maintenanceUnit": "维保单位", |
|
|
|
"vehicleType": "车辆类型", |
|
|
|
"brandAndModel": "厂牌型号", |
|
|
|
"manufacturer": "生产厂家", |
|
|
|
"drivingLicenseNo": "行驶证编号", |
|
|
|
"engineNumber": "发动机编号", |
|
|
|
"mainEnergyConsumption": "主能耗", |
|
|
|
"secondaryEnergyConsumption": "副能耗", |
|
|
|
"emissionStandard": "排放标准", |
|
|
|
"startDate": "启用日期", |
|
|
|
"lastTransferDate": "最近一次调动日期", |
|
|
|
"conductor": "车长", |
|
|
|
"vehicleWidth": "车宽", |
|
|
|
"carHeight": "车高", |
|
|
|
"approvedPassengerCapacity": "核定载客数", |
|
|
|
"vehicleIdentificationNumber": "车辆识别号", |
|
|
|
"gearboxBrand": "变速箱品牌", |
|
|
|
"manualCarWashingFee": "人工洗车费", |
|
|
|
"laborCost": "劳务费", |
|
|
|
"curbWeight": "整备质量", |
|
|
|
"totalMass": "总质量", |
|
|
|
"airConditioningTemperature": "空调温度", |
|
|
|
"airConditionedCarOrNot": "是否空调车", |
|
|
|
"turnOnTheAirConditioningTemperature": "开空调温度", |
|
|
|
"power": "功率", |
|
|
|
"transmission": "变速器", |
|
|
|
"seatingCapacity": "座位数", |
|
|
|
"airConditioningBrand": "空调品牌", |
|
|
|
"seatType": "座椅类型", |
|
|
|
"tireSpecifications": "轮胎规格", |
|
|
|
"roadTransportCertificateNo": "道路运输证号", |
|
|
|
"parkingPoint": "停放点", |
|
|
|
"carWashingType": "洗车类型", |
|
|
|
"maintenanceFreeWheelEnd": "免维护轮端", |
|
|
|
"firstGuaranteeDate": "首保日期", |
|
|
|
"dateOfRenovation": "整修日期", |
|
|
|
"motorVehicleOwner": "机动车所有人" |
|
|
|
const date = { |
|
|
|
"company": "所属公司", |
|
|
|
"fleet": "所属车队", |
|
|
|
"line": "所属线路", |
|
|
|
"vehicleNumber": "车辆编号", |
|
|
|
"vehicleLicensePlateNumber": "车辆牌照号", |
|
|
|
"operationCategory": "运营类别", |
|
|
|
"serviceLife": "已使用年限", |
|
|
|
"engineModel": "发动机型号", |
|
|
|
"vehicleModel": "车辆型号", |
|
|
|
"vehicleCategory": "车辆类别", |
|
|
|
"vehicleStatus": "车辆状态", |
|
|
|
"dateOfEntry": "入户日期", |
|
|
|
"purchaseDate": "购进日期", |
|
|
|
"energyConsumptionType": "能耗类型", |
|
|
|
"numberOfStandardUnits": "标台数", |
|
|
|
"maintenanceUnit": "维保单位", |
|
|
|
"vehicleType": "车辆类型", |
|
|
|
"brandAndModel": "厂牌型号", |
|
|
|
"manufacturer": "生产厂家", |
|
|
|
"drivingLicenseNo": "行驶证编号", |
|
|
|
"engineNumber": "发动机编号", |
|
|
|
"mainEnergyConsumption": "主能耗", |
|
|
|
"secondaryEnergyConsumption": "副能耗", |
|
|
|
"emissionStandard": "排放标准", |
|
|
|
"startDate": "启用日期", |
|
|
|
"lastTransferDate": "最近一次调动日期", |
|
|
|
"conductor": "车长", |
|
|
|
"vehicleWidth": "车宽", |
|
|
|
"carHeight": "车高", |
|
|
|
"approvedPassengerCapacity": "核定载客数", |
|
|
|
"vehicleIdentificationNumber": "车辆识别号", |
|
|
|
"gearboxBrand": "变速箱品牌", |
|
|
|
"manualCarWashingFee": "人工洗车费", |
|
|
|
"laborCost": "劳务费", |
|
|
|
"curbWeight": "整备质量", |
|
|
|
"totalMass": "总质量", |
|
|
|
"airConditioningTemperature": "空调温度", |
|
|
|
"airConditionedCarOrNot": "是否空调车", |
|
|
|
"turnOnTheAirConditioningTemperature": "开空调温度", |
|
|
|
"power": "功率", |
|
|
|
"transmission": "变速器", |
|
|
|
"seatingCapacity": "座位数", |
|
|
|
"airConditioningBrand": "空调品牌", |
|
|
|
"seatType": "座椅类型", |
|
|
|
"tireSpecifications": "轮胎规格", |
|
|
|
"roadTransportCertificateNo": "道路运输证号", |
|
|
|
"parkingPoint": "停放点", |
|
|
|
"carWashingType": "洗车类型", |
|
|
|
"maintenanceFreeWheelEnd": "免维护轮端", |
|
|
|
"firstGuaranteeDate": "首保日期", |
|
|
|
"dateOfRenovation": "整修日期", |
|
|
|
"motorVehicleOwner": "机动车所有人" |
|
|
|
} |
|
|
|
function mapStateToProps(state) { |
|
|
|
const { auth, depMessage } = state; |
|
|
|