Added parts Queue BOD-388
This commit is contained in:
@@ -12,6 +12,7 @@ import Icon, {
|
||||
TeamOutlined,
|
||||
UnorderedListOutlined,
|
||||
UserOutlined,
|
||||
ToolFilled,
|
||||
} from "@ant-design/icons";
|
||||
import { Avatar, Menu } from "antd";
|
||||
import React from "react";
|
||||
@@ -96,6 +97,11 @@ function Header({
|
||||
<FileFilled />
|
||||
<Link to="/manage/jobs">{t("menus.header.activejobs")}</Link>
|
||||
</Menu.Item>
|
||||
<Menu.Item key="parts-queue">
|
||||
<Link to="/manage/partsqueue">
|
||||
<ToolFilled /> {t("menus.header.parts-queue")}
|
||||
</Link>
|
||||
</Menu.Item>
|
||||
<Menu.Item key="availablejobs">
|
||||
<Link to="/manage/available">
|
||||
<ImportOutlined /> {t("menus.header.availablejobs")}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
import { Button, notification } from "antd";
|
||||
import React, { useState } from "react";
|
||||
import { useMutation } from "react-apollo";
|
||||
import { UPDATE_JOB } from "../../graphql/jobs.queries";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
export default function JobRemoveFromPartsQueue({ jobId, refetch }) {
|
||||
const [updateJob] = useMutation(UPDATE_JOB);
|
||||
const { t } = useTranslation();
|
||||
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
const handleClick = async (e) => {
|
||||
setLoading(true);
|
||||
const result = await updateJob({
|
||||
variables: { jobId: jobId, job: { queued_for_parts: false } },
|
||||
});
|
||||
|
||||
if (!!!result.errors) {
|
||||
notification["success"]({ message: t("jobs.successes.saved") });
|
||||
if (refetch) refetch();
|
||||
} else {
|
||||
notification["error"]({
|
||||
message: t("jobs.errors.saving", {
|
||||
error: JSON.stringify(result.errors),
|
||||
}),
|
||||
});
|
||||
}
|
||||
setLoading(false);
|
||||
};
|
||||
|
||||
return (
|
||||
<Button onClick={handleClick} loading={loading}>
|
||||
{t("general.actions.remove")}
|
||||
</Button>
|
||||
);
|
||||
}
|
||||
@@ -74,6 +74,7 @@ export function JobsAvailableContainer({
|
||||
clm_total: Dinero(newTotals.totals.total_repairs).toFormat("0.00"),
|
||||
owner_owing: Dinero(newTotals.custPayable.total).toFormat("0.00"),
|
||||
job_totals: newTotals,
|
||||
queued_for_parts: true,
|
||||
};
|
||||
|
||||
insertNewJob({
|
||||
|
||||
@@ -104,6 +104,7 @@ export function JobsAvailableSupplementContainer({
|
||||
clm_total: Dinero(newTotals.totals.total_repairs).toFormat("0.00"),
|
||||
owner_owing: Dinero(newTotals.custPayable.total).toFormat("0.00"),
|
||||
job_totals: newTotals,
|
||||
queued_for_parts: true,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
@@ -2,8 +2,6 @@ import { GET_JOB_LINES_BY_PK } from "../../graphql/jobs-lines.queries";
|
||||
import gql from "graphql-tag";
|
||||
export const GetSupplementDelta = async (client, jobId, newLines) => {
|
||||
console.log("-----Begin Supplement-----");
|
||||
console.log("Supplement delta for jobId", jobId);
|
||||
console.log("New Lines", newLines);
|
||||
|
||||
const {
|
||||
data: { joblines: existingLines },
|
||||
|
||||
@@ -153,6 +153,18 @@ export default function ShopInfoRbacComponent({ form }) {
|
||||
>
|
||||
<InputNumber />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t("bodyshop.fields.rbac.jobs.partsqueue")}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: t("general.validation.required"),
|
||||
},
|
||||
]}
|
||||
name={["md_rbac", "jobs:partsqueue"]}
|
||||
>
|
||||
<InputNumber />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t("bodyshop.fields.rbac.jobs.list-all")}
|
||||
rules={[
|
||||
|
||||
Reference in New Issue
Block a user