Added in jobs to schedule header for greater transparency. BOD-403
This commit is contained in:
@@ -13,9 +13,7 @@ const mapStateToProps = createStructuredSelector({
|
||||
bodyshop: selectBodyshop,
|
||||
});
|
||||
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||
});
|
||||
const mapDispatchToProps = (dispatch) => ({});
|
||||
|
||||
export function ScheduleBlockDay({ date, children, refetch, bodyshop }) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
@@ -38,7 +38,7 @@ export function ScheduleCalendarHeaderComponent({
|
||||
const { t } = useTranslation();
|
||||
const loadData = load[date.toISOString().substr(0, 10)];
|
||||
|
||||
const popContent = () => (
|
||||
const jobsOutPopup = () => (
|
||||
<div onClick={(e) => e.stopPropagation()}>
|
||||
<table>
|
||||
<tbody>
|
||||
@@ -71,34 +71,72 @@ export function ScheduleCalendarHeaderComponent({
|
||||
</div>
|
||||
);
|
||||
|
||||
const jobsInPopup = () => (
|
||||
<div onClick={(e) => e.stopPropagation()}>
|
||||
<table>
|
||||
<tbody>
|
||||
{loadData && loadData.jobsIn ? (
|
||||
loadData.jobsIn.map((j) => (
|
||||
<tr key={j.id}>
|
||||
<td>
|
||||
<Link to={`/manage/jobs/${j.id}`}>{j.ro_number}</Link>
|
||||
</td>
|
||||
<td>
|
||||
{`(${(
|
||||
j.labhrs.aggregate.sum.mod_lb_hrs +
|
||||
j.larhrs.aggregate.sum.mod_lb_hrs
|
||||
).toFixed(1)} ${t("general.labels.hours")})`}
|
||||
</td>
|
||||
<td>
|
||||
<DateTimeFormatter>{j.scheduled_in}</DateTimeFormatter>
|
||||
</td>
|
||||
</tr>
|
||||
))
|
||||
) : (
|
||||
<tr>
|
||||
<td>{t("appointments.labels.noarrivingjobs")}</td>
|
||||
</tr>
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
);
|
||||
|
||||
const LoadComponent = loadData ? (
|
||||
<Popover
|
||||
placement={"bottom"}
|
||||
content={popContent}
|
||||
trigger="hover"
|
||||
title={t("appointments.labels.completingjobs")}
|
||||
>
|
||||
<div className="imex-flex-row imex-flex-row__flex-space-around">
|
||||
<div className="imex-flex-row imex-flex-row__flex-space-around">
|
||||
<Popover
|
||||
placement={"bottom"}
|
||||
content={jobsInPopup}
|
||||
trigger="hover"
|
||||
title={t("appointments.labels.arrivingjobs")}
|
||||
>
|
||||
<Icon component={MdFileDownload} style={{ color: "green" }} />
|
||||
{(loadData.hoursIn || 0) && loadData.hoursIn.toFixed(2)}
|
||||
</Popover>
|
||||
<Popover
|
||||
placement={"bottom"}
|
||||
content={jobsOutPopup}
|
||||
trigger="hover"
|
||||
title={t("appointments.labels.completingjobs")}
|
||||
>
|
||||
<Icon component={MdFileUpload} style={{ color: "red" }} />
|
||||
{(loadData.hoursOut || 0) && loadData.hoursOut.toFixed(2)}
|
||||
<Statistic
|
||||
value={((loadData.expectedLoad || 0) / bodyshop.prodtargethrs) * 100}
|
||||
suffix={"%"}
|
||||
precision={0}
|
||||
valueStyle={{
|
||||
color:
|
||||
Math.abs(
|
||||
100 -
|
||||
((loadData.expectedLoad || 0) / bodyshop.prodtargethrs) * 100
|
||||
) <= 10
|
||||
? "green"
|
||||
: "red",
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</Popover>
|
||||
</Popover>
|
||||
<Statistic
|
||||
value={((loadData.expectedLoad || 0) / bodyshop.prodtargethrs) * 100}
|
||||
suffix={"%"}
|
||||
precision={0}
|
||||
valueStyle={{
|
||||
color:
|
||||
Math.abs(
|
||||
100 -
|
||||
((loadData.expectedLoad || 0) / bodyshop.prodtargethrs) * 100
|
||||
) <= 10
|
||||
? "green"
|
||||
: "red",
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
) : null;
|
||||
|
||||
return (
|
||||
|
||||
@@ -62,7 +62,7 @@ export function ScheduleCalendarWrapperComponent({
|
||||
search.view = view;
|
||||
history.push({ search: queryString.stringify(search) });
|
||||
}}
|
||||
step={30}
|
||||
step={15}
|
||||
timeslots={1}
|
||||
showMultiDayTimes
|
||||
localizer={localizer}
|
||||
|
||||
@@ -107,10 +107,14 @@ export function ScheduleEventComponent({
|
||||
const RegularEvent = event.isintake ? (
|
||||
<div style={{ display: "flex", flexWrap: "wrap" }}>
|
||||
<strong style={{ margin: ".1rem" }}>{`${
|
||||
event.job.ro_number || event.job.est_number
|
||||
}`}</strong>
|
||||
<div style={{ margin: ".1rem" }}>{`${
|
||||
(event.job && event.job.ownr_fn) || ""
|
||||
} ${(event.job && event.job.ownr_ln) || ""} ${
|
||||
(event.job && event.job.ownr_co_nm) || ""
|
||||
}`}</strong>
|
||||
}`}</div>
|
||||
|
||||
<div style={{ margin: ".1rem" }}>
|
||||
{`${(event.job && event.job.v_model_yr) || ""} ${
|
||||
(event.job && event.job.v_make_desc) || ""
|
||||
@@ -118,8 +122,10 @@ export function ScheduleEventComponent({
|
||||
</div>
|
||||
<div style={{ margin: ".1rem" }}>
|
||||
{`(${
|
||||
(event.job && event.job.labhrs.aggregate.sum.mod_lb_hrs) || ""
|
||||
} / ${(event.job && event.job.larhrs.aggregate.sum.mod_lb_hrs) || ""})`}
|
||||
(event.job && event.job.labhrs.aggregate.sum.mod_lb_hrs) || "0"
|
||||
} / ${
|
||||
(event.job && event.job.larhrs.aggregate.sum.mod_lb_hrs) || "0"
|
||||
})`}
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
@@ -129,7 +135,11 @@ export function ScheduleEventComponent({
|
||||
);
|
||||
|
||||
return (
|
||||
<Popover trigger="click" content={popoverContent}>
|
||||
<Popover
|
||||
trigger="click"
|
||||
content={popoverContent}
|
||||
style={{ height: "100%", width: "100%" }}
|
||||
>
|
||||
{RegularEvent}
|
||||
</Popover>
|
||||
);
|
||||
|
||||
@@ -42,6 +42,9 @@ export default function ScheduleProductionList() {
|
||||
<td>{`${j.v_model_yr || ""} ${j.v_make_desc || ""} ${
|
||||
j.v_model_desc || ""
|
||||
}`}</td>
|
||||
<td>{`${j.labhrs.aggregate.sum.mod_lb_hrs || "0"} / ${
|
||||
j.larhrs.aggregate.sum.mod_lb_hrs || "0"
|
||||
}`}</td>
|
||||
<td>
|
||||
<DateTimeFormatter>
|
||||
{j.scheduled_completion}
|
||||
|
||||
Reference in New Issue
Block a user