BOD-11 BOD-12 BOD-10 WIP Guided manual estimate creation.
This commit is contained in:
@@ -1,12 +1,10 @@
|
||||
import { Checkbox, Col, Row, Typography } from "antd";
|
||||
import React, { useContext } from "react";
|
||||
import JobCreateContext from "../../pages/jobs-create/jobs-create.context";
|
||||
import { Col, Row, Typography } from "antd";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import JobsCreateVehicleInfoNewComponent from "./jobs-create-vehicle-info.new.component";
|
||||
import JobsCreateVehicleInfoSearchComponent from "./jobs-create-vehicle-info.search.component";
|
||||
|
||||
export default function JobsCreateVehicleInfoComponent({ loading, vehicles }) {
|
||||
const [state, setState] = useContext(JobCreateContext);
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<div>
|
||||
@@ -19,22 +17,6 @@ export default function JobsCreateVehicleInfoComponent({ loading, vehicles }) {
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Checkbox
|
||||
defaultChecked={state.vehicle.new}
|
||||
checked={state.vehicle.new}
|
||||
onChange={() => {
|
||||
setState({
|
||||
...state,
|
||||
vehicle: {
|
||||
...state.vehicle,
|
||||
new: !state.vehicle.new,
|
||||
selectedid: null
|
||||
}
|
||||
});
|
||||
}}
|
||||
>
|
||||
{t("jobs.labels.create.newvehicle")}
|
||||
</Checkbox>
|
||||
<JobsCreateVehicleInfoNewComponent />
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
@@ -1,14 +1,30 @@
|
||||
import { DatePicker, Form, Input } from "antd";
|
||||
import { DatePicker, Form, Input, Checkbox } from "antd";
|
||||
import React, { useContext } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import JobCreateContext from "../../pages/jobs-create/jobs-create.context";
|
||||
|
||||
export default function JobsCreateVehicleInfoNewComponent() {
|
||||
const [state] = useContext(JobCreateContext);
|
||||
const [state, setState] = useContext(JobCreateContext);
|
||||
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<div>
|
||||
<Checkbox
|
||||
defaultChecked={state.vehicle.new}
|
||||
checked={state.vehicle.new}
|
||||
onChange={() => {
|
||||
setState({
|
||||
...state,
|
||||
vehicle: {
|
||||
...state.vehicle,
|
||||
new: !state.vehicle.new,
|
||||
selectedid: null
|
||||
}
|
||||
});
|
||||
}}
|
||||
>
|
||||
{t("jobs.labels.create.newvehicle")}
|
||||
</Checkbox>
|
||||
<Form.Item
|
||||
label={t("vehicles.fields.v_vin")}
|
||||
name={["vehicle", "data", "v_vin"]}
|
||||
|
||||
@@ -55,7 +55,6 @@ export default function JobsCreateVehicleInfoSearchComponent({
|
||||
};
|
||||
//TODO Implement searching & pagination
|
||||
|
||||
console.log("vehicles", vehicles);
|
||||
return (
|
||||
<Table
|
||||
loading={loading}
|
||||
@@ -102,7 +101,7 @@ export default function JobsCreateVehicleInfoSearchComponent({
|
||||
selectedid: record.id
|
||||
}
|
||||
});
|
||||
console.log("Should be clearing fields.");
|
||||
console.log("Should be clearing fields here...");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user