IO-233 Add CDK Control List.

This commit is contained in:
Patrick Fic
2021-12-01 13:37:03 -08:00
parent cdc0c8bb37
commit 1483f5f7c8
8 changed files with 123 additions and 3 deletions

View File

@@ -1,14 +1,16 @@
import { DeleteFilled } from "@ant-design/icons";
import { DeleteFilled, DownOutlined } from "@ant-design/icons";
import {
Button,
Card,
Divider,
Dropdown,
Form,
Input,
InputNumber,
Select,
Space,
Statistic,
Menu,
Typography,
} from "antd";
import Dinero from "dinero.js";
@@ -252,6 +254,42 @@ export function DmsPostForm({ bodyshop, socket, job }) {
}}
</Form.Item>
<Dropdown
overlay={
<Menu>
{bodyshop.cdk_configuration.controllist &&
bodyshop.cdk_configuration.controllist.map(
(key, idx) => (
<Menu.Item
key={idx}
onClick={() => {
form.setFieldsValue({
payers: form
.getFieldValue("payers")
.map((row, mapIndex) => {
if (index !== mapIndex) return row;
return {
...row,
controlnumber: key.controlnumber,
};
}),
});
}}
>
{key.name}
</Menu.Item>
)
)}
</Menu>
}
>
<a href=" #" onClick={(e) => e.preventDefault()}>
{t("bodyshop.labels.dms.cdk.controllist")}{" "}
<DownOutlined />
</a>
</Dropdown>
<DeleteFilled
onClick={() => {
remove(field.name);