From 35650cec24e71d4ca7776c0119988795db43ea2d Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Mon, 21 Sep 2020 14:40:16 -0700 Subject: [PATCH] WIP Transfer. --- .../schedule-job-modal.component.jsx | 37 ++++++++++--------- server/graphql-client/queries.js | 22 +++++++++-- server/scheduling/scheduling-job.js | 12 +++--- 3 files changed, 44 insertions(+), 27 deletions(-) diff --git a/client/src/components/schedule-job-modal/schedule-job-modal.component.jsx b/client/src/components/schedule-job-modal/schedule-job-modal.component.jsx index 7d45c1ac8..0c932662c 100644 --- a/client/src/components/schedule-job-modal/schedule-job-modal.component.jsx +++ b/client/src/components/schedule-job-modal/schedule-job-modal.component.jsx @@ -45,6 +45,23 @@ export function ScheduleJobModalComponent({ } }; + const handleDateBlur = () => { + const values = form.getFieldsValue(); + if (lbrHrsData) { + const totalHours = + lbrHrsData.jobs_by_pk.labhrs.aggregate.sum.mod_lb_hrs + + lbrHrsData.jobs_by_pk.larhrs.aggregate.sum.mod_lb_hrs; + + if (values.start && !values.scheduled_completion) + form.setFieldsValue({ + scheduled_completion: moment(values.start).businessAdd( + totalHours / bodyshop.target_touchtime, + "days" + ), + }); + } + }; + //TODO Existing appointments list only refreshes sometimes after modal close. May have to do with the container class. return ( @@ -60,24 +77,7 @@ export function ScheduleJobModalComponent({ }, ]} > - { - const values = form.getFieldsValue(); - if (lbrHrsData) { - const totalHours = - lbrHrsData.jobs_by_pk.labhrs.aggregate.sum.mod_lb_hrs + - lbrHrsData.jobs_by_pk.larhrs.aggregate.sum.mod_lb_hrs; - - if (values.start && !values.scheduled_completion) - form.setFieldsValue({ - scheduled_completion: moment(values.start).businessAdd( - totalHours / bodyshop.target_touchtime, - "days" - ), - }); - } - }} - /> +