Added parts location to job line list view. BOD-208

This commit is contained in:
Patrick Fic
2020-07-31 10:25:58 -07:00
parent 23f8243002
commit 4d60ffd597
25 changed files with 933 additions and 1 deletions

View File

@@ -17,6 +17,7 @@ import ShopInfoSchedulingComponent from "./shop-info.scheduling.component";
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
import ShopInfoIntakeChecklistComponent from "./shop-info.intake.component";
import ShopInfoSpeedPrint from "./shop-info.speedprint.component";
import FormListMoveArrows from "../form-list-move-arrows/form-list-move-arrows.component";
export default function ShopInfoComponent({ form, saveLoading }) {
const { t } = useTranslation();
@@ -273,6 +274,61 @@ export default function ShopInfoComponent({ form, saveLoading }) {
);
}}
</Form.List>
<Form.List name={["md_parts_locations"]}>
{(fields, { add, remove, move }) => {
return (
<div>
{fields.map((field, index) => (
<Form.Item
key={field.key}
style={{ padding: 0, margin: 2 }}
>
<div className="imex-flex-row">
<Form.Item
className="imex-flex-row__margin"
label={t("bodyshop.fields.partslocation")}
key={`${index}`}
name={[field.name]}
rules={[
{
required: true,
message: t("general.validation.required"),
},
]}
>
<Input />
</Form.Item>
<DeleteFilled
className="imex-flex-row__margin"
onClick={() => {
remove(field.name);
}}
/>
<FormListMoveArrows
move={move}
index={index}
total={fields.length}
/>
</div>
</Form.Item>
))}
<Form.Item>
<Button
type="dashed"
onClick={() => {
add();
}}
style={{ width: "100%" }}
>
{t("bodyshop.actions.addpartslocation")}
</Button>
</Form.Item>
</div>
);
}}
</Form.List>
</Collapse.Panel>
<Collapse.Panel
key="speedprint"

View File

@@ -1,5 +1,5 @@
import { DeleteFilled } from "@ant-design/icons";
import { Button, Col, Form, Input, InputNumber, Row, Select } from "antd";
import { Button, Form, Input, Select } from "antd";
import React from "react";
import { useTranslation } from "react-i18next";
import { TemplateList } from "../../utils/TemplateConstants";