Added functional upload on invoice enter. BOD-75
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import { DatePicker, Form, Input, Statistic, Switch } from "antd";
|
||||
import { Button, DatePicker, Form, Input, Statistic, Switch, Upload } from "antd";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import DocumentsUploadContainer from "../documents-upload/documents-upload.container";
|
||||
import CurrencyInput from "../form-items-formatted/currency-form-item.component";
|
||||
import JobSearchSelect from "../job-search-select/job-search-select.component";
|
||||
import VendorSearchSelect from "../vendor-search-select/vendor-search-select.component";
|
||||
@@ -165,9 +164,26 @@ export default function InvoiceFormComponent({
|
||||
form={form}
|
||||
responsibilityCenters={responsibilityCenters}
|
||||
/>
|
||||
|
||||
<Form.Item name="upload" label="Upload">
|
||||
<DocumentsUploadContainer jobId={form.getFieldValue("jobid")} />
|
||||
{
|
||||
// <Form.Item name="upload" label="Upload">
|
||||
// <DocumentsUploadContainer jobId={form.getFieldValue("jobid")} />
|
||||
// </Form.Item>
|
||||
}
|
||||
<Form.Item
|
||||
name="upload"
|
||||
label="Upload"
|
||||
valuePropName="fileList"
|
||||
getValueFromEvent={(e) => {
|
||||
console.log("Upload event:", e);
|
||||
if (Array.isArray(e)) {
|
||||
return e;
|
||||
}
|
||||
return e && e.fileList;
|
||||
}}
|
||||
>
|
||||
<Upload name="logo" beforeUpload={() => false} listType="picture">
|
||||
<Button>Click to upload</Button>
|
||||
</Upload>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item shouldUpdate>
|
||||
@@ -180,7 +196,6 @@ export default function InvoiceFormComponent({
|
||||
"local_tax_rate",
|
||||
]);
|
||||
let totals;
|
||||
console.log("values", values);
|
||||
if (
|
||||
!!values.total &&
|
||||
!!values.invoicelines &&
|
||||
@@ -234,6 +249,10 @@ export default function InvoiceFormComponent({
|
||||
return null;
|
||||
}}
|
||||
</Form.Item>
|
||||
|
||||
<Button onClick={() => console.log(form.getFieldsValue())}>
|
||||
Get Values
|
||||
</Button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user