IO-3108 Adjust Initial Values/FieldValues
Signed-off-by: Allan Carr <allan.carr@thinkimex.com>
This commit is contained in:
@@ -36,6 +36,7 @@ export function JobsConvertButton({ bodyshop, job, refetch, jobRO, insertAuditTr
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const allFormValues = Form.useWatch([], form);
|
const allFormValues = Form.useWatch([], form);
|
||||||
|
console.log("allFormValues", allFormValues, "towin", job.towin);
|
||||||
|
|
||||||
const handleConvert = async ({ employee_csr, category, ...values }) => {
|
const handleConvert = async ({ employee_csr, category, ...values }) => {
|
||||||
if (parentFormIsFieldsTouched()) {
|
if (parentFormIsFieldsTouched()) {
|
||||||
@@ -92,8 +93,8 @@ export function JobsConvertButton({ bodyshop, job, refetch, jobRO, insertAuditTr
|
|||||||
ca_gst_registrant: job.ca_gst_registrant,
|
ca_gst_registrant: job.ca_gst_registrant,
|
||||||
employee_csr: job.employee_csr,
|
employee_csr: job.employee_csr,
|
||||||
category: job.category,
|
category: job.category,
|
||||||
referralsource: job.referralsource,
|
referral_source: job.referral_source,
|
||||||
referral_source_extra: job.referral_source_extra ? job.referral_source_extra : ""
|
referral_source_extra: job.referral_source_extra ?? ""
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
@@ -245,11 +246,6 @@ export function JobsConvertButton({ bodyshop, job, refetch, jobRO, insertAuditTr
|
|||||||
loading={loading}
|
loading={loading}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setOpen(true);
|
setOpen(true);
|
||||||
form.setFieldsValue({
|
|
||||||
driveable: true,
|
|
||||||
towin: false,
|
|
||||||
employee_csr: job.employee_csr
|
|
||||||
});
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{t("jobs.actions.convert")}
|
{t("jobs.actions.convert")}
|
||||||
|
|||||||
Reference in New Issue
Block a user