IO-1613 add suspended days to jobs.

This commit is contained in:
Patrick Fic
2022-01-04 12:33:20 -08:00
parent fc023367cc
commit 6457acc61e
18 changed files with 170 additions and 24 deletions

View File

@@ -89,6 +89,19 @@ export function JobsDetailHeaderActions({
});
};
const handleSuspend = (e) => {
logImEXEvent("production_toggle_alert");
//e.stopPropagation();
updateJob({
variables: {
jobId: job.id,
job: {
suspended: !job.suspended,
},
},
});
};
const statusmenu = (
<Menu key="popovermenu">
<Menu.Item
@@ -199,7 +212,11 @@ export function JobsDetailHeaderActions({
{t("jobs.actions.addtoproduction")}
</Menu.Item>
)}
<Menu.Item key="togglesuspend" onClick={handleSuspend}>
{job.suspended
? t("production.actions.unsuspend")
: t("production.actions.suspend")}
</Menu.Item>
<Menu.Item key="toggleAlert" onClick={handleAlertToggle}>
{job.production_vars && job.production_vars.alert
? t("production.labels.alertoff")

View File

@@ -1,5 +1,9 @@
import { Card, Col, Row, Space, Tag } from "antd";
import { WarningFilled, ExclamationCircleFilled } from "@ant-design/icons";
import {
WarningFilled,
ExclamationCircleFilled,
PauseCircleOutlined,
} from "@ant-design/icons";
import React, { useMemo } from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
@@ -68,6 +72,9 @@ export function JobsDetailHeader({ job, bodyshop, disabled }) {
{t("jobs.labels.inproduction")}
</Tag>
)}
{job.suspended && (
<PauseCircleOutlined style={{ color: "orangered" }} />
)}
{job.production_vars && job.production_vars.alert ? (
<ExclamationCircleFilled className="production-alert" />
) : null}

View File

@@ -1,4 +1,8 @@
import { SyncOutlined, ExclamationCircleFilled } from "@ant-design/icons";
import {
SyncOutlined,
ExclamationCircleFilled,
PauseCircleOutlined,
} from "@ant-design/icons";
import { useQuery } from "@apollo/client";
import { Button, Card, Grid, Input, Space, Table } from "antd";
import queryString from "query-string";
@@ -111,6 +115,9 @@ export function JobsList({ bodyshop }) {
{record.production_vars && record.production_vars.alert ? (
<ExclamationCircleFilled className="production-alert" />
) : null}
{record.suspended && (
<PauseCircleOutlined style={{ color: "orangered" }} />
)}
</Space>
</Link>
),

View File

@@ -1,4 +1,8 @@
import { CalendarOutlined, EyeFilled } from "@ant-design/icons";
import {
CalendarOutlined,
EyeFilled,
PauseCircleOutlined,
} from "@ant-design/icons";
import { Card, Col, Row, Space } from "antd";
import React from "react";
import { useTranslation } from "react-i18next";
@@ -40,6 +44,9 @@ export default function ProductionBoardCard(
title={
<Space>
<ProductionAlert record={card} key="alert" />
{card.suspended && (
<PauseCircleOutlined style={{ color: "orangered" }} />
)}
<span style={{ fontWeight: "bolder" }}>
{card.ro_number || t("general.labels.na")}
</span>

View File

@@ -1,3 +1,5 @@
import { PauseCircleOutlined } from "@ant-design/icons";
import { Space } from "antd";
import i18n from "i18next";
import moment from "moment";
import React from "react";
@@ -43,9 +45,19 @@ const r = ({ technician, state, activeStatuses, bodyshop }) => {
technician ? (
<Link to={`/tech/joblookup?selected=${record.id}`}>
{record.ro_number}
{record.suspended && (
<PauseCircleOutlined style={{ color: "orangered" }} />
)}
</Link>
) : (
<Link to={`/manage/jobs/${record.id}`}>{record.ro_number}</Link>
<Link to={`/manage/jobs/${record.id}`}>
<Space>
{record.ro_number}
{record.suspended && (
<PauseCircleOutlined style={{ color: "orangered" }} />
)}
</Space>
</Link>
),
},
{

View File

@@ -5,6 +5,7 @@ import { QUERY_APPOINTMENT_BY_DATE } from "../../graphql/appointments.queries";
import LoadingSkeleton from "../loading-skeleton/loading-skeleton.component";
import moment from "moment";
import { useTranslation } from "react-i18next";
export default function ScheduleDayViewContainer({ day }) {
const { loading, error, data } = useQuery(QUERY_APPOINTMENT_BY_DATE, {
variables: {

View File

@@ -188,10 +188,10 @@ export function ScheduleJobModalComponent({
/>
</Col>
<Col span={12}>
<Form.Item shouldUpdate>
<Form.Item shouldUpdate={(prev, cur) => prev.start !== cur.start}>
{() => {
console.log("render");
const values = form.getFieldsValue();
return (
<div className="schedule-job-modal">
<ScheduleDayViewContainer day={values.start} />

View File

@@ -212,7 +212,9 @@ export const QUERY_APPOINTMENTS_BY_JOBID = gql`
`;
export const QUERY_SCHEDULE_LOAD_DATA = gql`
query QUERY_SCHEDULE_LOAD_DATA($start: timestamptz!, $end: timestamptz!) {
prodJobs: jobs(where: { inproduction: { _eq: true } }) {
prodJobs: jobs(
where: { inproduction: { _eq: true }, suspended: { _eq: false } }
) {
id
labhrs: joblines_aggregate(
where: { mod_lbr_ty: { _neq: "LAR" }, removed: { _eq: false } }
@@ -235,9 +237,14 @@ export const QUERY_SCHEDULE_LOAD_DATA = gql`
}
compJobs: jobs(
where: {
_or: [
{ scheduled_completion: { _gte: $start, _lte: $end } }
{ actual_completion: { _gte: $start, _lte: $end } }
_and: [
{ suspended: { _eq: false } }
{
_or: [
{ scheduled_completion: { _gte: $start, _lte: $end } }
{ actual_completion: { _gte: $start, _lte: $end } }
]
}
]
}
) {
@@ -264,7 +271,12 @@ 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 }
suspended: { _eq: false }
}
) {
id
scheduled_in
ro_number

View File

@@ -42,6 +42,7 @@ export const QUERY_ALL_ACTIVE_JOBS = gql`
status
updated_at
ded_amt
suspended
}
}
`;
@@ -290,6 +291,7 @@ export const QUERY_JOBS_IN_PRODUCTION = gql`
employee_refinish
employee_prep
employee_csr
suspended
labhrs: joblines_aggregate(
where: {
_and: [{ mod_lbr_ty: { _neq: "LAR" } }, { removed: { _eq: false } }]
@@ -654,6 +656,7 @@ export const GET_JOB_BY_PK = gql`
voided
ca_bc_pvrt
ca_customer_gst
suspended
joblines(where: { removed: { _eq: false } }, order_by: { line_no: asc }) {
id
alt_partm
@@ -828,6 +831,7 @@ export const QUERY_JOB_CARD_DETAILS = gql`
ca_gst_registrant
owner_owing
special_coverage_policy
suspended
available_jobs {
id
}
@@ -1034,6 +1038,7 @@ export const UPDATE_JOB = gql`
ro_number
production_vars
lbr_adjustments
suspended
}
}
}

View File

@@ -1578,6 +1578,7 @@
"subletstotal": "Sublets Total",
"subtotal": "Subtotal",
"supplementnote": "The job had a supplement imported.",
"suspended": "SUSPENDED",
"suspense": "Suspense",
"total_cost": "Total Cost",
"total_cust_payable": "Total Customer Amount Payable",
@@ -2118,7 +2119,9 @@
"paintpriority-set": "Set Paint Priority",
"remove": "Remove from Production",
"removecolumn": "Remove Column",
"saveconfig": "Save Configuration"
"saveconfig": "Save Configuration",
"suspend": "Suspend",
"unsuspend": "Unsuspend"
},
"errors": {
"boardupdate": "Error encountered updating job. {{message}}",

View File

@@ -1578,6 +1578,7 @@
"subletstotal": "",
"subtotal": "",
"supplementnote": "",
"suspended": "",
"suspense": "",
"total_cost": "",
"total_cust_payable": "",
@@ -2118,7 +2119,9 @@
"paintpriority-set": "",
"remove": "",
"removecolumn": "",
"saveconfig": ""
"saveconfig": "",
"suspend": "",
"unsuspend": ""
},
"errors": {
"boardupdate": "",

View File

@@ -1578,6 +1578,7 @@
"subletstotal": "",
"subtotal": "",
"supplementnote": "",
"suspended": "",
"suspense": "",
"total_cost": "",
"total_cust_payable": "",
@@ -2118,7 +2119,9 @@
"paintpriority-set": "",
"remove": "",
"removecolumn": "",
"saveconfig": ""
"saveconfig": "",
"suspend": "",
"unsuspend": ""
},
"errors": {
"boardupdate": "",