summaryrefslogtreecommitdiff
path: root/src/containers/WaybillForm.tsx
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2021-03-14 12:08:32 +0300
committereug-vs <eug-vs@keemail.me>2021-03-14 12:08:32 +0300
commit8e011b65f346386abe26afcce737dd59c5865988 (patch)
tree68e1159eea6ec6ea65740bf61e5ee1182883dae4 /src/containers/WaybillForm.tsx
parentdfe13c7c061b4b2fd6dfde8e1c3c284d574ad8f2 (diff)
downloadcommercel-ui-8e011b65f346386abe26afcce737dd59c5865988.tar.gz
feat: add Waybills
Diffstat (limited to 'src/containers/WaybillForm.tsx')
-rw-r--r--src/containers/WaybillForm.tsx33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/containers/WaybillForm.tsx b/src/containers/WaybillForm.tsx
new file mode 100644
index 0000000..e4d7d82
--- /dev/null
+++ b/src/containers/WaybillForm.tsx
@@ -0,0 +1,33 @@
+import React from 'react';
+import { Form, Field } from 'formik';
+import Input from '../components/Input';
+import hooks from '../hooks/useAPIClient';
+
+const WaybillForm: React.FC = () => {
+ const { data: contractors } = hooks.contractors.useList();
+ const { data: products } = hooks.products.useList();
+
+ return (
+ <Form id="form">
+ <div className="max-w-lg">
+ <Field name="operation" as="select">
+ <option value="in">Приход</option>
+ <option value="out">Расход</option>
+ </Field>
+ <Field name="contractorId" as="select">
+ {contractors?.map(contractor => (
+ <option value={contractor._id}>{contractor.name}</option>
+ ))}
+ </Field>
+ <Field name="productId" as="select">
+ {products?.map(product => (
+ <option value={product._id}>{product.name}</option>
+ ))}
+ </Field>
+ <Input name="quantity" type="number" label="Количество" />
+ </div>
+ </Form>
+ );
+};
+
+export default WaybillForm;