Added in jobs to schedule header for greater transparency. BOD-403
This commit is contained in:
@@ -484,6 +484,27 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>arrivingjobs</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>es-MX</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>fr-CA</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
<concept_node>
|
<concept_node>
|
||||||
<name>blocked</name>
|
<name>blocked</name>
|
||||||
<definition_loaded>false</definition_loaded>
|
<definition_loaded>false</definition_loaded>
|
||||||
@@ -589,6 +610,27 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>noarrivingjobs</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>es-MX</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>fr-CA</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
<concept_node>
|
<concept_node>
|
||||||
<name>nocompletingjobs</name>
|
<name>nocompletingjobs</name>
|
||||||
<definition_loaded>false</definition_loaded>
|
<definition_loaded>false</definition_loaded>
|
||||||
|
|||||||
@@ -136,8 +136,11 @@ export const client = new ApolloClient({
|
|||||||
cache,
|
cache,
|
||||||
connectToDevTools: process.env.NODE_ENV !== "production",
|
connectToDevTools: process.env.NODE_ENV !== "production",
|
||||||
defaultOptions: {
|
defaultOptions: {
|
||||||
|
query: {
|
||||||
|
fetchPolicy: "network-only",
|
||||||
|
},
|
||||||
watchQuery: {
|
watchQuery: {
|
||||||
fetchPolicy: "cache-and-network",
|
fetchPolicy: "network-only",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -13,9 +13,7 @@ const mapStateToProps = createStructuredSelector({
|
|||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
});
|
});
|
||||||
|
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = (dispatch) => ({});
|
||||||
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
|
||||||
});
|
|
||||||
|
|
||||||
export function ScheduleBlockDay({ date, children, refetch, bodyshop }) {
|
export function ScheduleBlockDay({ date, children, refetch, bodyshop }) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ export function ScheduleCalendarHeaderComponent({
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const loadData = load[date.toISOString().substr(0, 10)];
|
const loadData = load[date.toISOString().substr(0, 10)];
|
||||||
|
|
||||||
const popContent = () => (
|
const jobsOutPopup = () => (
|
||||||
<div onClick={(e) => e.stopPropagation()}>
|
<div onClick={(e) => e.stopPropagation()}>
|
||||||
<table>
|
<table>
|
||||||
<tbody>
|
<tbody>
|
||||||
@@ -71,34 +71,72 @@ export function ScheduleCalendarHeaderComponent({
|
|||||||
</div>
|
</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 ? (
|
const LoadComponent = loadData ? (
|
||||||
<Popover
|
<div className="imex-flex-row imex-flex-row__flex-space-around">
|
||||||
placement={"bottom"}
|
<Popover
|
||||||
content={popContent}
|
placement={"bottom"}
|
||||||
trigger="hover"
|
content={jobsInPopup}
|
||||||
title={t("appointments.labels.completingjobs")}
|
trigger="hover"
|
||||||
>
|
title={t("appointments.labels.arrivingjobs")}
|
||||||
<div className="imex-flex-row imex-flex-row__flex-space-around">
|
>
|
||||||
<Icon component={MdFileDownload} style={{ color: "green" }} />
|
<Icon component={MdFileDownload} style={{ color: "green" }} />
|
||||||
{(loadData.hoursIn || 0) && loadData.hoursIn.toFixed(2)}
|
{(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" }} />
|
<Icon component={MdFileUpload} style={{ color: "red" }} />
|
||||||
{(loadData.hoursOut || 0) && loadData.hoursOut.toFixed(2)}
|
{(loadData.hoursOut || 0) && loadData.hoursOut.toFixed(2)}
|
||||||
<Statistic
|
</Popover>
|
||||||
value={((loadData.expectedLoad || 0) / bodyshop.prodtargethrs) * 100}
|
<Statistic
|
||||||
suffix={"%"}
|
value={((loadData.expectedLoad || 0) / bodyshop.prodtargethrs) * 100}
|
||||||
precision={0}
|
suffix={"%"}
|
||||||
valueStyle={{
|
precision={0}
|
||||||
color:
|
valueStyle={{
|
||||||
Math.abs(
|
color:
|
||||||
100 -
|
Math.abs(
|
||||||
((loadData.expectedLoad || 0) / bodyshop.prodtargethrs) * 100
|
100 -
|
||||||
) <= 10
|
((loadData.expectedLoad || 0) / bodyshop.prodtargethrs) * 100
|
||||||
? "green"
|
) <= 10
|
||||||
: "red",
|
? "green"
|
||||||
}}
|
: "red",
|
||||||
/>
|
}}
|
||||||
</div>
|
/>
|
||||||
</Popover>
|
</div>
|
||||||
) : null;
|
) : null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ export function ScheduleCalendarWrapperComponent({
|
|||||||
search.view = view;
|
search.view = view;
|
||||||
history.push({ search: queryString.stringify(search) });
|
history.push({ search: queryString.stringify(search) });
|
||||||
}}
|
}}
|
||||||
step={30}
|
step={15}
|
||||||
timeslots={1}
|
timeslots={1}
|
||||||
showMultiDayTimes
|
showMultiDayTimes
|
||||||
localizer={localizer}
|
localizer={localizer}
|
||||||
|
|||||||
@@ -107,10 +107,14 @@ export function ScheduleEventComponent({
|
|||||||
const RegularEvent = event.isintake ? (
|
const RegularEvent = event.isintake ? (
|
||||||
<div style={{ display: "flex", flexWrap: "wrap" }}>
|
<div style={{ display: "flex", flexWrap: "wrap" }}>
|
||||||
<strong style={{ margin: ".1rem" }}>{`${
|
<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_fn) || ""
|
||||||
} ${(event.job && event.job.ownr_ln) || ""} ${
|
} ${(event.job && event.job.ownr_ln) || ""} ${
|
||||||
(event.job && event.job.ownr_co_nm) || ""
|
(event.job && event.job.ownr_co_nm) || ""
|
||||||
}`}</strong>
|
}`}</div>
|
||||||
|
|
||||||
<div style={{ margin: ".1rem" }}>
|
<div style={{ margin: ".1rem" }}>
|
||||||
{`${(event.job && event.job.v_model_yr) || ""} ${
|
{`${(event.job && event.job.v_model_yr) || ""} ${
|
||||||
(event.job && event.job.v_make_desc) || ""
|
(event.job && event.job.v_make_desc) || ""
|
||||||
@@ -118,8 +122,10 @@ export function ScheduleEventComponent({
|
|||||||
</div>
|
</div>
|
||||||
<div style={{ margin: ".1rem" }}>
|
<div style={{ margin: ".1rem" }}>
|
||||||
{`(${
|
{`(${
|
||||||
(event.job && event.job.labhrs.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) || ""})`}
|
} / ${
|
||||||
|
(event.job && event.job.larhrs.aggregate.sum.mod_lb_hrs) || "0"
|
||||||
|
})`}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
@@ -129,7 +135,11 @@ export function ScheduleEventComponent({
|
|||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Popover trigger="click" content={popoverContent}>
|
<Popover
|
||||||
|
trigger="click"
|
||||||
|
content={popoverContent}
|
||||||
|
style={{ height: "100%", width: "100%" }}
|
||||||
|
>
|
||||||
{RegularEvent}
|
{RegularEvent}
|
||||||
</Popover>
|
</Popover>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -42,6 +42,9 @@ export default function ScheduleProductionList() {
|
|||||||
<td>{`${j.v_model_yr || ""} ${j.v_make_desc || ""} ${
|
<td>{`${j.v_model_yr || ""} ${j.v_make_desc || ""} ${
|
||||||
j.v_model_desc || ""
|
j.v_model_desc || ""
|
||||||
}`}</td>
|
}`}</td>
|
||||||
|
<td>{`${j.labhrs.aggregate.sum.mod_lb_hrs || "0"} / ${
|
||||||
|
j.larhrs.aggregate.sum.mod_lb_hrs || "0"
|
||||||
|
}`}</td>
|
||||||
<td>
|
<td>
|
||||||
<DateTimeFormatter>
|
<DateTimeFormatter>
|
||||||
{j.scheduled_completion}
|
{j.scheduled_completion}
|
||||||
|
|||||||
@@ -192,6 +192,8 @@ export const QUERY_SCHEDULE_LOAD_DATA = gql`
|
|||||||
arrJobs: jobs(where: { scheduled_in: { _gte: $start, _lte: $end } }) {
|
arrJobs: jobs(where: { scheduled_in: { _gte: $start, _lte: $end } }) {
|
||||||
id
|
id
|
||||||
scheduled_in
|
scheduled_in
|
||||||
|
est_number
|
||||||
|
ro_number
|
||||||
labhrs: joblines_aggregate(where: { mod_lbr_ty: { _eq: "LAB" } }) {
|
labhrs: joblines_aggregate(where: { mod_lbr_ty: { _eq: "LAB" } }) {
|
||||||
aggregate {
|
aggregate {
|
||||||
sum {
|
sum {
|
||||||
|
|||||||
@@ -1016,6 +1016,21 @@ export const QUERY_JOBS_IN_PRODUCTION = gql`
|
|||||||
v_make_desc
|
v_make_desc
|
||||||
v_model_desc
|
v_model_desc
|
||||||
scheduled_completion
|
scheduled_completion
|
||||||
|
|
||||||
|
labhrs: joblines_aggregate(where: { mod_lbr_ty: { _eq: "LAB" } }) {
|
||||||
|
aggregate {
|
||||||
|
sum {
|
||||||
|
mod_lb_hrs
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
larhrs: joblines_aggregate(where: { mod_lbr_ty: { _eq: "LAR" } }) {
|
||||||
|
aggregate {
|
||||||
|
sum {
|
||||||
|
mod_lb_hrs
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|||||||
@@ -38,11 +38,13 @@
|
|||||||
},
|
},
|
||||||
"labels": {
|
"labels": {
|
||||||
"arrivedon": "Arrived on: ",
|
"arrivedon": "Arrived on: ",
|
||||||
|
"arrivingjobs": "Arriving Jobs",
|
||||||
"blocked": "Blocked",
|
"blocked": "Blocked",
|
||||||
"cancelledappointment": "Canceled appointment for: ",
|
"cancelledappointment": "Canceled appointment for: ",
|
||||||
"completingjobs": "Completing Jobs",
|
"completingjobs": "Completing Jobs",
|
||||||
"history": "History",
|
"history": "History",
|
||||||
"inproduction": "Jobs In Production",
|
"inproduction": "Jobs In Production",
|
||||||
|
"noarrivingjobs": "No jobs are arriving.",
|
||||||
"nocompletingjobs": "No jobs scheduled for completion.",
|
"nocompletingjobs": "No jobs scheduled for completion.",
|
||||||
"nodateselected": "No date has been selected.",
|
"nodateselected": "No date has been selected.",
|
||||||
"priorappointments": "Previous Appointments",
|
"priorappointments": "Previous Appointments",
|
||||||
|
|||||||
@@ -38,11 +38,13 @@
|
|||||||
},
|
},
|
||||||
"labels": {
|
"labels": {
|
||||||
"arrivedon": "Llegado el:",
|
"arrivedon": "Llegado el:",
|
||||||
|
"arrivingjobs": "",
|
||||||
"blocked": "",
|
"blocked": "",
|
||||||
"cancelledappointment": "Cita cancelada para:",
|
"cancelledappointment": "Cita cancelada para:",
|
||||||
"completingjobs": "",
|
"completingjobs": "",
|
||||||
"history": "",
|
"history": "",
|
||||||
"inproduction": "",
|
"inproduction": "",
|
||||||
|
"noarrivingjobs": "",
|
||||||
"nocompletingjobs": "",
|
"nocompletingjobs": "",
|
||||||
"nodateselected": "No se ha seleccionado ninguna fecha.",
|
"nodateselected": "No se ha seleccionado ninguna fecha.",
|
||||||
"priorappointments": "Nombramientos previos",
|
"priorappointments": "Nombramientos previos",
|
||||||
|
|||||||
@@ -38,11 +38,13 @@
|
|||||||
},
|
},
|
||||||
"labels": {
|
"labels": {
|
||||||
"arrivedon": "Arrivé le:",
|
"arrivedon": "Arrivé le:",
|
||||||
|
"arrivingjobs": "",
|
||||||
"blocked": "",
|
"blocked": "",
|
||||||
"cancelledappointment": "Rendez-vous annulé pour:",
|
"cancelledappointment": "Rendez-vous annulé pour:",
|
||||||
"completingjobs": "",
|
"completingjobs": "",
|
||||||
"history": "",
|
"history": "",
|
||||||
"inproduction": "",
|
"inproduction": "",
|
||||||
|
"noarrivingjobs": "",
|
||||||
"nocompletingjobs": "",
|
"nocompletingjobs": "",
|
||||||
"nodateselected": "Aucune date n'a été sélectionnée.",
|
"nodateselected": "Aucune date n'a été sélectionnée.",
|
||||||
"priorappointments": "Rendez-vous précédents",
|
"priorappointments": "Rendez-vous précédents",
|
||||||
|
|||||||
Reference in New Issue
Block a user