Browse Source

fix():bug修改

tags/PMS_V1.0.0_Alpha5
xingjx 1 year ago
parent
commit
b0695114ee
  1. 59
      src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/BusinessParameterConfig.jsx
  2. 17
      src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/CarMgm/BlacklistManagement.jsx
  3. 100
      src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/CarMgm/CarGroupMgm.jsx
  4. 73
      src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/CarMgm/CarManagement.jsx
  5. 16
      src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/CarMgm/OffPeakVehicleManagement.jsx
  6. 17
      src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/CarMgm/WhitelistManagement.jsx
  7. 11
      src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/LEDConfiguration.jsx
  8. 2
      src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/index.jsx
  9. 3
      src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/Detail.jsx
  10. 4
      src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/loadable.jsx
  11. 19
      src/services/OutRoadMgm/OutSegment.js

59
src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/BusinessParameterConfig.jsx

@ -3,7 +3,8 @@ import { Button, Form, Radio, InputNumber, Select, Row, Col, message } from "ant
import ajax from "@/services";
import "./BusinessParameterConfig.scss";
function BusinessParameterConfig(props) {
const { id } = props;
console.log(props)
const { id, type } = props;
const [form] = Form.useForm();
const [childList, setChildList] = useState([]);
@ -123,32 +124,36 @@ function BusinessParameterConfig(props) {
/>
</Form.Item>
</Col>
<Col span={12}>
<Form.Item label="场内缴费后免费离场时间" name="free_time">
<InputNumber min={0} max={60} addonAfter="分钟"/>
</Form.Item>
</Col>
<Col span={12}>
<Form.Item label="断网时是否允许车辆欠费离场" name="arrearage">
<Radio.Group
options={[
{
label: "是",
value: 1,
},
{
label: "否",
value: 0,
},
]}
/>
</Form.Item>
</Col>
<Col span={12}>
<Form.Item label="记录缺失收费区域偏向" name="road_bias">
<Select options={childList} />
</Form.Item>
</Col>
{
type ? <>
<Col span={12}>
<Form.Item label="场内缴费后免费离场时间" name="free_time">
<InputNumber min={0} max={60} addonAfter="分钟" />
</Form.Item>
</Col>
<Col span={12}>
<Form.Item label="断网时是否允许车辆欠费离场" name="arrearage">
<Radio.Group
options={[
{
label: "是",
value: 1,
},
{
label: "否",
value: 0,
},
]}
/>
</Form.Item>
</Col>
<Col span={12}>
<Form.Item label="记录缺失收费区域偏向" name="road_bias">
<Select options={childList} />
</Form.Item>
</Col>
</> : null
}
<Col span={24}>
<Form.Item>
<div className="bottom-button">

17
src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/CarMgm/BlacklistManagement.jsx

@ -21,6 +21,7 @@ const { TextArea } = Input;
function BlacklistManagement({ id }) {
const [searchForm] = Form.useForm();
const [editForm] = Form.useForm();
const [deleteModal, setDeleteModal] = useState(false);
const columns = [
{
title: "序号",
@ -113,7 +114,8 @@ function BlacklistManagement({ id }) {
<div>
<a
onClick={() => {
deleteBlackVehicle(record.id);
setCurrentId(record.id);
setDeleteModal(true)
}}
>
删除
@ -205,6 +207,7 @@ function BlacklistManagement({ id }) {
ajax.deleteBlackVehicle({ id }).then((res) => {
if (res.status === 20000) {
message.success("删除成功");
setDeleteModal(false);
submit();
} else {
message.error(res.message);
@ -452,6 +455,18 @@ function BlacklistManagement({ id }) {
</Form>
</Modal>
<Modal
open={deleteModal}
onCancel={() => { setDeleteModal(false) }}
onOk={() => { deleteBlackVehicle(currentId); }}
//footer={null}
className="applyCopyModal"
title='提示'
>
<div className="enableStatus">
确认是否删除该记录
</div>
</Modal>
<Modal
open={batchUploadModal}
onCancel={() => { setBatchUploadModal(false) }}
onOk={() => { }}

100
src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/CarMgm/CarGroupMgm.jsx

@ -16,6 +16,8 @@ const { TextArea } = Input;
function CarGroupMgm({ id }) {
const [searchForm] = Form.useForm();
const [editForm] = Form.useForm();
const [total, setTotal] = useState(0);
const [deleteModal, setDeleteModal] = useState(false);
const columns = [
{
title: "车辆组名称",
@ -25,8 +27,8 @@ function CarGroupMgm({ id }) {
},
{
title: "车辆类型",
dataIndex: "vehicle_type",
key: "vehicle_type",
dataIndex: "vehicle_type_name",
key: "vehicle_type_name",
align: "center",
},
// [
@ -54,24 +56,49 @@ function CarGroupMgm({ id }) {
align: "center",
render: (_, record) => {
return (
<Button
type="primary"
onClick={() => {
setEditModal({
visible: true,
data: record,
add: 0,
});
editForm.setFieldsValue({
name: record.name,
vehicle_type: record.vehicle_type,
status: record.status,
note: record.note,
});
}}
<Popover
trigger="hover"
content={
<>
<div>
<a
onClick={() => {
setEditModal({
visible: true,
data: record,
add: 0,
});
setCurrentId(record.id)
editForm.setFieldsValue({
name: record.name,
vehicle_type: record.vehicle_type,
status: record.status,
note: record.note,
});
}}
>
编辑
</a>
</div>
{
record.can_del == 1 ?
<div>
<a
onClick={() => {
setCurrentId(record.id);
setDeleteModal(true)
}}
>
删除
</a>
</div>
: null
}
</>
}
>
编辑
</Button>
<Button type="primary">编辑</Button>
</Popover>
);
},
},
@ -88,6 +115,7 @@ function CarGroupMgm({ id }) {
page_size: 10,
total: 0,
});
const [currentId, setCurrentId] = useState("");
const getVehicleGroup = () => {
const params = { ...searchForm.getFieldsValue(), ...pageData, road_id: id };
ajax
@ -95,6 +123,7 @@ function CarGroupMgm({ id }) {
.then((res) => {
if (res.status === 20000) {
setCarList(res.data.list);
setTotal(res.data.total)
} else {
message.error(res.message);
}
@ -103,7 +132,18 @@ function CarGroupMgm({ id }) {
console.log(err);
});
};
//
const getDelCarGroup = (id) => {
ajax.getDelCarGroup({ id }).then((res) => {
if (res.status === 20000) {
message.success("删除成功");
setDeleteModal(false);
getVehicleGroup();
} else {
message.error(res.message);
}
});
};
function changePage(pn, page_size) {
setPageData({
pn,
@ -154,7 +194,7 @@ function CarGroupMgm({ id }) {
})
:
ajax
.getEditCarGroup({ ...data, road_id: id })
.getEditCarGroup({ ...data, road_id: id, id: currentId })
.then((res) => {
if (res.status === 20000) {
message.success(res.message)
@ -271,7 +311,7 @@ function CarGroupMgm({ id }) {
position: ["bottomCenter"],
current: pageData.pn,
pageSize: pageData.page_size,
total: pageData.total,
total: total,
pageSizeOptions: dictionary?.pageSizeOptions,
onChange: changePage,
onShowSizeChange: changePage,
@ -309,8 +349,8 @@ function CarGroupMgm({ id }) {
<Form.Item label="状态" name="status" rules={[{ required: true }]}>
<Select
options={[
{ label: "启用", value: 2 },
{ label: "禁用", value: 1 },
{ label: "启用", value: '2' },
{ label: "禁用", value: '1' },
]}
/>
</Form.Item>
@ -323,6 +363,18 @@ function CarGroupMgm({ id }) {
</Row>
</Form>
</Modal>
<Modal
open={deleteModal}
onCancel={() => { setDeleteModal(false) }}
onOk={() => { getDelCarGroup(currentId) }}
//footer={null}
className="applyCopyModal"
title='提示'
>
<div className="enableStatus">
确认是否删除该记录
</div>
</Modal>
</div>
);
}

73
src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/CarMgm/CarManagement.jsx

@ -103,6 +103,7 @@ function CarManagement({ id }) {
<a
onClick={() => {
setEditModal({ visible: true, record, status: "edit" });
setCurrentId(record.id);
editForm.setFieldsValue({
plate: record.plate,
plate_color: record.plate_color,
@ -110,6 +111,10 @@ function CarManagement({ id }) {
status: record.status,
car_owner_name: record.car_owner_name,
group_id: record.group_id,
effective_date: [
moment(record.effective_begin_date),
moment(record.effective_end_date),
],
note: record.note,
});
}}
@ -157,6 +162,7 @@ function CarManagement({ id }) {
pn: 1,
page_size: 10,
});
const [currentId, setCurrentId] = useState("");
//
const [editModal, setEditModal] = useState({
visible: false,
@ -164,28 +170,28 @@ function CarManagement({ id }) {
status: "edit",
});
const [batchUploadModal ,setBatchUploadModal] = useState(false)
const [batchUploadModal, setBatchUploadModal] = useState(false)
const props = {
action: process.env.NODE_ENV == "development" ? 'http://10.10.128.65:3001/mock/11/api/ope/coupon/import':`${baseApi}/api/ope/coupon/import`,
action: process.env.NODE_ENV == "development" ? 'http://10.10.128.65:3001/mock/11/api/ope/coupon/import' : `${baseApi}/api/ope/coupon/import`,
multiple: false,
showUploadList: false,
method: 'post',
beforeUpload : (file, fileList)=>{
beforeUpload: (file, fileList) => {
console.log(file, 'file')
if(fileList.length > 1){
if (fileList.length > 1) {
message.error('只支撑同时上传一个文件')
return
}
return true
},
onChange: (res)=>{
if(res.file.status == 'done'){
onChange: (res) => {
if (res.file.status == 'done') {
console.log(res)
}
}
};
const excuteUploadBatchData = ()=>{
const excuteUploadBatchData = () => {
// ajax.getVehicleList(values).then((res) => {
// if (res.status === 20000) {
// setDataSource(res.data.list);
@ -215,20 +221,43 @@ function CarManagement({ id }) {
effective_begin_date: moment(res.effective_date[0]).format("YYYY-MM-DD HH:mm:ss"),
effective_end_date: moment(res.effective_date[1]).format("YYYY-MM-DD HH:mm:ss")
};
if(new Date(res.effective_date[0]).getTime() < new Date().getTime()){
if (res.plate != '' && !utils?.validationPlate(res.plate)) {
message.error('请输入正确的车牌号')
return
}
let phoneReg = new RegExp(/^(?:(?:\+|00)86)?1[3-9]\d{9}$/)
if (res.phone && !phoneReg.test(res.phone)) {
message.error('请输入正确的手机号')
return
}
if (new Date(res.effective_date[0]).getTime() < new Date().getTime()) {
message.error('生效日期必须为当前时间以后的时间')
return
}
ajax.addVehicle(res).then((res) => {
if (res.status === 20000) {
message.success(res.message);
setEditModal({ visible: false });
submit(form.getFieldValue());
editForm.resetFields();
} else {
message.error(res.message)
}
});
if (editModal.status === "add") {
ajax.addVehicle(res).then((res) => {
if (res.status === 20000) {
message.success(res.message);
setEditModal({ visible: false });
submit(form.getFieldValue());
editForm.resetFields();
} else {
message.error(res.message)
}
});
} else {
res.id = currentId;
ajax.editVehicle(res).then((res) => {
if (res.status === 20000) {
message.success(res.message);
setEditModal({ visible: false });
submit(form.getFieldValue());
editForm.resetFields();
} else {
message.error(res.message)
}
});
}
})
.catch((err) => {
console.error(err);
@ -409,7 +438,7 @@ function CarManagement({ id }) {
rules={[{ required: true }]}
name="plate_color"
>
<Select disabled={editModal.status === "edit"} options={sysConfig.plateColor} />
<Select disabled={editModal.status === "edit"} options={sysConfig.plateColor.slice(1)} />
</Form.Item>
</Col>
<Col span={12}>
@ -486,15 +515,15 @@ function CarManagement({ id }) {
<Modal
open={batchUploadModal}
onCancel={() => { setBatchUploadModal(false) }}
onOk={() => { }}
onOk={() => { }}
//footer={null}
className="batchUploadModal"
title='批量上传'
zIndex={2000}
>
<div className="batch-upload-car">
<Upload
{...props}
<Upload
{...props}
// fileList={fileList}
>
<Button type="primary">上传</Button>

16
src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/CarMgm/OffPeakVehicleManagement.jsx

@ -27,12 +27,12 @@ function OffPeakVehicleManagement({ id }) {
key: "orderAmount",
align: "center",
},
{
title: "同步MS状态",
dataIndex: "msSyncStatus",
key: "msSyncStatus",
align: "center",
},
// {
// title: "MS",
// dataIndex: "msSyncStatus",
// key: "msSyncStatus",
// align: "center",
// },
{
title: "订购时间",
dataIndex: "orderTime",
@ -64,11 +64,11 @@ function OffPeakVehicleManagement({ id }) {
<Input />
</Form.Item>
</Col>
<Col span="4_8" style={{ width: "30%" }}>
{/* <Col span="4_8" style={{ width: "30%" }}>
<Form.Item label="同步状态">
<Select />
</Form.Item>
</Col>
</Col> */}
<Col span="4_8" style={{ width: "30%" }}>
<Form.Item>
<div className="CGM-button">

17
src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/CarMgm/WhitelistManagement.jsx

@ -20,6 +20,7 @@ const { TextArea } = Input;
function WhitelistManagement({ id }) {
const [searchForm] = Form.useForm();
const [editForm] = Form.useForm();
const [deleteModal, setDeleteModal] = useState(false);
const columns = [
{
title: "序号",
@ -112,7 +113,8 @@ function WhitelistManagement({ id }) {
<div>
<a
onClick={() => {
deleteWhiteVehicle(record.id);
setCurrentId(record.id);
setDeleteModal(true)
}}
>
删除
@ -174,6 +176,7 @@ function WhitelistManagement({ id }) {
ajax.deleteWhiteVehicle({ id }).then((res) => {
if (res.status === 20000) {
message.success("删除成功");
setDeleteModal(false);
submit();
} else {
message.error(res.message);
@ -421,6 +424,18 @@ function WhitelistManagement({ id }) {
</Row>
</Form>
</Modal>
<Modal
open={deleteModal}
onCancel={() => { setDeleteModal(false) }}
onOk={() => { deleteWhiteVehicle(currentId); }}
//footer={null}
className="applyCopyModal"
title='提示'
>
<div className="enableStatus">
确认是否删除该记录
</div>
</Modal>
</div>
);
}

11
src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/LEDConfiguration.jsx

@ -225,7 +225,16 @@ function LEDConfiguration({ id }) {
<Table
dataSource={dataSource}
columns={columns}
// className="yisa-table"
// className="yisa-table"
pagination={{
position: ["bottomCenter"],
current: pageData.pn,
pageSize: pageData.page_size,
total: total,
pageSizeOptions: dictionary?.pageSizeOptions,
onChange: changePage,
onShowSizeChange: changePage,
}}
/>
</main>
<Modal

2
src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/ConfigParking/index.jsx

@ -26,7 +26,7 @@ function ConfigParking(props) {
{
label: "业务参数配置",
key: "2",
children: <BusinessParameterConfig id={itemData.id} />,
children: <BusinessParameterConfig type={true} id={itemData.id} />,
},
{
label: "车辆管理",

3
src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/Detail.jsx

@ -80,7 +80,7 @@ function ParkingDetail(props) {
{
label: "子车场信息",
key: "2",
children: <ChildParkingContent id={itemData.id} ChildParkingContent setEditModal={setEditModal} setConfigModal={setConfigModal} />,
children: <ChildParkingContent itemData={itemData} id={itemData.id} ChildParkingContent setEditModal={setEditModal} setConfigModal={setConfigModal} />,
},
]}
></Tabs>
@ -234,6 +234,7 @@ function ChildParkingContent(props) {
key: "operate",
align: "center",
render: (_, record) => {
console.log(record)
return (
<Popover
content={

4
src/pages/OutRoadMgm/OutSegmentMgm/OutSegment/loadable.jsx

@ -193,9 +193,9 @@ function OutSegment() {
修改剩余泊位
</a>
</div>
<div>
{/* <div>
<a>开通支付宝免密支付</a>
</div>
</div> */}
</div>
}
>

19
src/services/OutRoadMgm/OutSegment.js

@ -155,6 +155,14 @@ const getEditCarGroup = (params) => {
data: params,
});
};
/// 删除路段车辆组
const getDelCarGroup = (params) => {
return ajax({
url: "/api/orp/road/del_vehicle_group",
type: "post",
data: params,
});
};
///api/orp/road/get_road_vehicle_group 获取路段车辆组列表
const getRoadVehicleGroup = (params) => {
@ -181,6 +189,15 @@ const addVehicle = (params) => {
data: params,
});
};
///api/orp/road/edit_vehicle 编辑车辆
const editVehicle = (params) => {
return ajax({
url: "/api/orp/road/edit_vehicle",
type: "post",
data: params,
});
};
///api/orp/road/del_vehicle 删除车辆
const deleteVehicle = (params) => {
return ajax({
@ -502,9 +519,11 @@ export default {
getAllCarGroup,
getAddCarGroup,
getEditCarGroup,
getDelCarGroup,
getRoadVehicleGroup,
getVehicleList,
addVehicle,
editVehicle,
deleteVehicle,
enableVehicle,
disableVehicle,

Loading…
Cancel
Save