Build Seth's changes C1 to C11 (Gitea issues 1, 8, 18, 23, 24, 25, 27, 31, 32, 33, 36)
- C1 (issue 1): over target follows VISUAL ticket hours, not the timer. - C2 (issue 24): a Q.C. reject always needs a reason; accept needs an NCR number after a reject without one. - C3 (issue 25): an incomplete unit ITP blocks filing. - C4 (issue 27): prints open the print dialog on the page, no new tab. - C5 (issue 31): filing is blocked while VISUAL shows a work order open; the feed sets vclosed on VISUAL packets. - C6 (issue 8): the data book leaves out the history pages. - C7 (issue 18): the supervisor approves each received short; accept and filing wait for it. - C8 (issue 23): per-department checklists, edited by the department supervisor or Admin, frozen at START. - C9 (issue 32): Q.C. and Clerical may run the stamp check. - C10 (issue 33): the PM screen and reports are for PS-ProjectMgmt and Admin only. - C11 (issue 36): the Stall screen lists the packets assigned to the welder, at the supervisor's stall. Migration 0011. Docs: PLAN (also issue 9 confirmed, issue 4 asked), POLICY, SECURITY, SCHEMA, FEED, README, CHANGELOG. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -32,6 +32,7 @@ import { Sheet } from "../../components/Sheet";
|
||||
import { useGuard, type RunOptions } from "../../components/useGuard";
|
||||
import { useChanged } from "../../lib/changes";
|
||||
import { errorText, fmtTime } from "../../lib/format";
|
||||
import { printPdf } from "../../lib/printPdf";
|
||||
import { useLoad } from "../../lib/useLoad";
|
||||
import { fmtQcDate } from "./folders";
|
||||
import {
|
||||
@@ -324,6 +325,7 @@ export function ItpPage() {
|
||||
const [sheet, setSheet] = useState<LineSheetState>(null);
|
||||
const [showLog, setShowLog] = useState(false);
|
||||
const [msg, setMsg] = useState<string | null>(null);
|
||||
const [printing, setPrinting] = useState(false);
|
||||
useChanged(reload, { delayMs: 500, filter: (ev) => ev.kind === "itp" && Number(ev.unit_id) === uid });
|
||||
|
||||
useEffect(() => {
|
||||
@@ -428,6 +430,19 @@ export function ItpPage() {
|
||||
|
||||
const sheetItem = sheet ? sections.flatMap((s) => s.items).find((i) => i.n === sheet.key) : undefined;
|
||||
|
||||
// Change C4: the stamped copy goes straight to the browser's print dialog, on this page.
|
||||
const print = async () => {
|
||||
setMsg(null);
|
||||
setPrinting(true);
|
||||
try {
|
||||
await printPdf(itpPrintUrl(id));
|
||||
} catch {
|
||||
setMsg("The print could not be prepared. Try again, or open the ITP (PDF) and print it from there.");
|
||||
} finally {
|
||||
setPrinting(false);
|
||||
}
|
||||
};
|
||||
|
||||
const reopen = async () => {
|
||||
const reason = await guard.askReason({ title: "Reopen ITP", sub: r.no, label: "Reason", min: 8, max: 300, submitLabel: "Reopen" });
|
||||
if (reason === null) return;
|
||||
@@ -453,8 +468,8 @@ export function ItpPage() {
|
||||
<a className="btn sm ghost" href={itpPdfUrl(id, true)} download>
|
||||
Download
|
||||
</a>
|
||||
<button className="btn sm" type="button" onClick={() => window.open(itpPrintUrl(id), "_blank", "noopener")}>
|
||||
Print
|
||||
<button className="btn sm" type="button" disabled={printing} onClick={() => void print()}>
|
||||
{printing ? "Preparing print" : "Print"}
|
||||
</button>
|
||||
{r.can.sign_off ? (
|
||||
<button className="btn pri" type="button" onClick={() => void write((g) => signOff(id, g.sign, g), { sign: "Sign off the ITP", sub: r.no })}>
|
||||
|
||||
Reference in New Issue
Block a user