Added ins co to 3rd party payer & expanded md_ins_co IO-546

This commit is contained in:
Patrick Fic
2021-02-22 14:34:46 -08:00
parent 02a274b8c9
commit b9ee0cca4f
7 changed files with 314 additions and 41 deletions

View File

@@ -569,6 +569,124 @@ export default function ShopInfoComponent({ form, saveLoading }) {
);
}}
</Form.List>
<Form.List name={["md_ins_cos"]}>
{(fields, { add, remove, move }) => {
return (
<div>
{fields.map((field, index) => (
<Form.Item
key={field.key}
style={{ padding: 0, margin: 2 }}
>
<div style={{ display: "flex" }}>
<Form.Item
style={{ padding: 0, margin: 2 }}
label={t("bodyshop.fields.md_ins_co.name")}
key={`${index}name`}
name={[field.name, "name"]}
rules={[
{
required: true,
message: t("general.validation.required"),
},
]}
>
<Input />
</Form.Item>
<Form.Item
style={{ padding: 0, margin: 2 }}
label={t("bodyshop.fields.md_ins_co.street1")}
key={`${index}street1`}
name={[field.name, "street1"]}
rules={[
{
required: true,
message: t("general.validation.required"),
},
]}
>
<Input />
</Form.Item>
<Form.Item
style={{ padding: 0, margin: 2 }}
label={t("bodyshop.fields.md_ins_co.street2")}
key={`${index}street2`}
name={[field.name, "street2"]}
>
<Input />
</Form.Item>
<Form.Item
style={{ padding: 0, margin: 2 }}
label={t("bodyshop.fields.md_ins_co.city")}
key={`${index}city`}
name={[field.name, "city"]}
rules={[
{
required: true,
message: t("general.validation.required"),
},
]}
>
<Input />
</Form.Item>
<Form.Item
style={{ padding: 0, margin: 2 }}
label={t("bodyshop.fields.md_ins_co.state")}
key={`${index}state`}
name={[field.name, "state"]}
rules={[
{
required: true,
message: t("general.validation.required"),
},
]}
>
<Input />
</Form.Item>
<Form.Item
style={{ padding: 0, margin: 2 }}
label={t("bodyshop.fields.md_ins_co.zip")}
key={`${index}zip`}
name={[field.name, "zip"]}
rules={[
{
required: true,
message: t("general.validation.required"),
},
]}
>
<Input />
</Form.Item>
<DeleteFilled
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("general.actions.add")}
</Button>
</Form.Item>
</div>
);
}}
</Form.List>
<LayoutFormRow>
<Form.Item
name={["md_payment_types"]}
@@ -609,19 +727,7 @@ export default function ShopInfoComponent({ form, saveLoading }) {
>
<Select mode="tags" />
</Form.Item>
<Form.Item
name={["md_ins_cos"]}
label={t("bodyshop.fields.md_ins_cos")}
rules={[
{
required: true,
message: t("general.validation.required"),
type: "array",
},
]}
>
<Select mode="tags" />
</Form.Item>
<Form.Item
name={["enforce_class"]}
label={t("bodyshop.fields.enforce_class")}