|
@ -127,51 +127,58 @@ function CarGroupMgm({ id }) { |
|
|
}, []); |
|
|
}, []); |
|
|
|
|
|
|
|
|
const toCarGroup = (type) => { |
|
|
const toCarGroup = (type) => { |
|
|
let data = editForm.getFieldsValue() |
|
|
|
|
|
type == 1 ? |
|
|
|
|
|
ajax |
|
|
|
|
|
.getAddCarGroup(data) |
|
|
|
|
|
.then((res) => { |
|
|
|
|
|
if (res.status === 20000) { |
|
|
|
|
|
message.success(res.message) |
|
|
|
|
|
setEditModal({ |
|
|
|
|
|
visible: false, |
|
|
|
|
|
data: {}, |
|
|
|
|
|
add: 0, |
|
|
|
|
|
|
|
|
editForm |
|
|
|
|
|
.validateFields() |
|
|
|
|
|
.then((data) => { |
|
|
|
|
|
type == 1 ? |
|
|
|
|
|
ajax |
|
|
|
|
|
.getAddCarGroup({ ...data, road_id: id }) |
|
|
|
|
|
.then((res) => { |
|
|
|
|
|
if (res.status === 20000) { |
|
|
|
|
|
message.success(res.message) |
|
|
|
|
|
setEditModal({ |
|
|
|
|
|
visible: false, |
|
|
|
|
|
data: {}, |
|
|
|
|
|
add: 0, |
|
|
|
|
|
}); |
|
|
|
|
|
setPageData({ |
|
|
|
|
|
pn: 1, |
|
|
|
|
|
page_size: 15, |
|
|
|
|
|
}); |
|
|
|
|
|
} else { |
|
|
|
|
|
message.error(res.message); |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
.catch((err) => { |
|
|
|
|
|
console.log(err); |
|
|
|
|
|
}) |
|
|
|
|
|
: |
|
|
|
|
|
ajax |
|
|
|
|
|
.getEditCarGroup({ ...data, road_id: id }) |
|
|
|
|
|
.then((res) => { |
|
|
|
|
|
if (res.status === 20000) { |
|
|
|
|
|
message.success(res.message) |
|
|
|
|
|
setEditModal({ |
|
|
|
|
|
visible: false, |
|
|
|
|
|
data: {}, |
|
|
|
|
|
add: 0, |
|
|
|
|
|
}); |
|
|
|
|
|
setPageData({ |
|
|
|
|
|
pn: 1, |
|
|
|
|
|
page_size: 15, |
|
|
|
|
|
}); |
|
|
|
|
|
} else { |
|
|
|
|
|
message.error(res.message); |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
.catch((err) => { |
|
|
|
|
|
console.log(err); |
|
|
}); |
|
|
}); |
|
|
setPageData({ |
|
|
|
|
|
pn: 1, |
|
|
|
|
|
page_size: 15, |
|
|
|
|
|
}); |
|
|
|
|
|
} else { |
|
|
|
|
|
message.error(res.message); |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
.catch((err) => { |
|
|
|
|
|
console.log(err); |
|
|
|
|
|
}) |
|
|
|
|
|
: |
|
|
|
|
|
ajax |
|
|
|
|
|
.getEditCarGroup(data) |
|
|
|
|
|
.then((res) => { |
|
|
|
|
|
if (res.status === 20000) { |
|
|
|
|
|
message.success(res.message) |
|
|
|
|
|
setEditModal({ |
|
|
|
|
|
visible: false, |
|
|
|
|
|
data: {}, |
|
|
|
|
|
add: 0, |
|
|
|
|
|
}); |
|
|
|
|
|
setPageData({ |
|
|
|
|
|
pn: 1, |
|
|
|
|
|
page_size: 15, |
|
|
|
|
|
}); |
|
|
|
|
|
} else { |
|
|
|
|
|
message.error(res.message); |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
.catch((err) => { |
|
|
|
|
|
console.log(err); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
.catch((err) => { |
|
|
|
|
|
console.log(err); |
|
|
|
|
|
return |
|
|
|
|
|
}); |
|
|
} |
|
|
} |
|
|
useEffect(() => { |
|
|
useEffect(() => { |
|
|
getVehicleGroup(); |
|
|
getVehicleGroup(); |
|
@ -282,12 +289,12 @@ function CarGroupMgm({ id }) { |
|
|
<Form colon={false} labelCol={{ span: 6 }} form={editForm}> |
|
|
<Form colon={false} labelCol={{ span: 6 }} form={editForm}> |
|
|
<Row> |
|
|
<Row> |
|
|
<Col span="4_8" style={{ width: "30%" }}> |
|
|
<Col span="4_8" style={{ width: "30%" }}> |
|
|
<Form.Item label="车辆组名称" name="name"> |
|
|
|
|
|
|
|
|
<Form.Item label="车辆组名称" name="name" rules={[{ required: true }]}> |
|
|
<Input maxLength={15} showCount={true} /> |
|
|
<Input maxLength={15} showCount={true} /> |
|
|
</Form.Item> |
|
|
</Form.Item> |
|
|
</Col> |
|
|
</Col> |
|
|
<Col span="4_8" style={{ width: "30%" }}> |
|
|
<Col span="4_8" style={{ width: "30%" }}> |
|
|
<Form.Item label="车辆类型" name="vehicle_type"> |
|
|
|
|
|
|
|
|
<Form.Item label="车辆类型" name="vehicle_type" rules={[{ required: true }]}> |
|
|
<Select |
|
|
<Select |
|
|
options={[ |
|
|
options={[ |
|
|
{ label: "免费车", value: 1 }, |
|
|
{ label: "免费车", value: 1 }, |
|
@ -299,7 +306,7 @@ function CarGroupMgm({ id }) { |
|
|
</Form.Item> |
|
|
</Form.Item> |
|
|
</Col> |
|
|
</Col> |
|
|
<Col span="4_8" style={{ width: "30%" }}> |
|
|
<Col span="4_8" style={{ width: "30%" }}> |
|
|
<Form.Item label="状态" name="status"> |
|
|
|
|
|
|
|
|
<Form.Item label="状态" name="status" rules={[{ required: true }]}> |
|
|
<Select |
|
|
<Select |
|
|
options={[ |
|
|
options={[ |
|
|
{ label: "启用", value: 2 }, |
|
|
{ label: "启用", value: 2 }, |
|
|