@seedtactics/insight-client 16.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -0
- package/dist/cell-status/buffers.d.ts +36 -0
- package/dist/cell-status/buffers.js +127 -0
- package/dist/cell-status/current-status.d.ts +30 -0
- package/dist/cell-status/current-status.js +200 -0
- package/dist/cell-status/estimated-cycle-times.d.ts +41 -0
- package/dist/cell-status/estimated-cycle-times.js +257 -0
- package/dist/cell-status/inspections.d.ts +55 -0
- package/dist/cell-status/inspections.js +213 -0
- package/dist/cell-status/loading.d.ts +26 -0
- package/dist/cell-status/loading.js +112 -0
- package/dist/cell-status/material-details.d.ts +116 -0
- package/dist/cell-status/material-details.js +422 -0
- package/dist/cell-status/material-summary.d.ts +52 -0
- package/dist/cell-status/material-summary.js +312 -0
- package/dist/cell-status/names.d.ts +19 -0
- package/dist/cell-status/names.js +134 -0
- package/dist/cell-status/pallet-cycles.d.ts +24 -0
- package/dist/cell-status/pallet-cycles.js +78 -0
- package/dist/cell-status/rebookings.d.ts +30 -0
- package/dist/cell-status/rebookings.js +139 -0
- package/dist/cell-status/scheduled-jobs.d.ts +18 -0
- package/dist/cell-status/scheduled-jobs.js +94 -0
- package/dist/cell-status/sim-day-usage.d.ts +14 -0
- package/dist/cell-status/sim-day-usage.js +54 -0
- package/dist/cell-status/sim-production.d.ts +22 -0
- package/dist/cell-status/sim-production.js +91 -0
- package/dist/cell-status/sim-station-use.d.ts +25 -0
- package/dist/cell-status/sim-station-use.js +71 -0
- package/dist/cell-status/station-cycles.d.ts +34 -0
- package/dist/cell-status/station-cycles.js +145 -0
- package/dist/cell-status/tool-replacements.d.ts +44 -0
- package/dist/cell-status/tool-replacements.js +155 -0
- package/dist/cell-status/tool-usage.d.ts +25 -0
- package/dist/cell-status/tool-usage.js +95 -0
- package/dist/components/App.d.ts +15 -0
- package/dist/components/App.js +549 -0
- package/dist/components/AxisAndGrid.d.ts +51 -0
- package/dist/components/AxisAndGrid.js +47 -0
- package/dist/components/BarcodeScanning.d.ts +6 -0
- package/dist/components/BarcodeScanning.js +150 -0
- package/dist/components/ChartTooltip.d.ts +28 -0
- package/dist/components/ChartTooltip.js +95 -0
- package/dist/components/ChooseMode.d.ts +18 -0
- package/dist/components/ChooseMode.js +136 -0
- package/dist/components/ChooseOperator.d.ts +1 -0
- package/dist/components/ChooseOperator.js +93 -0
- package/dist/components/ErrorsAndLoading.d.ts +9 -0
- package/dist/components/ErrorsAndLoading.js +55 -0
- package/dist/components/LoadingIcon.d.ts +1 -0
- package/dist/components/LoadingIcon.js +48 -0
- package/dist/components/LogEntry.d.ts +16 -0
- package/dist/components/LogEntry.js +365 -0
- package/dist/components/ManualSerialEntry.d.ts +5 -0
- package/dist/components/ManualSerialEntry.js +91 -0
- package/dist/components/MonthSelect.d.ts +6 -0
- package/dist/components/MonthSelect.js +67 -0
- package/dist/components/Navigation.d.ts +23 -0
- package/dist/components/Navigation.js +120 -0
- package/dist/components/VerboseLogging.d.ts +1 -0
- package/dist/components/VerboseLogging.js +47 -0
- package/dist/components/analysis/AnalysisSelectToolbar.d.ts +1 -0
- package/dist/components/analysis/AnalysisSelectToolbar.js +55 -0
- package/dist/components/analysis/BufferChart.d.ts +1 -0
- package/dist/components/analysis/BufferChart.js +139 -0
- package/dist/components/analysis/CostPerPiece.d.ts +2 -0
- package/dist/components/analysis/CostPerPiece.js +175 -0
- package/dist/components/analysis/CycleChart.d.ts +42 -0
- package/dist/components/analysis/CycleChart.js +281 -0
- package/dist/components/analysis/DataTable.d.ts +83 -0
- package/dist/components/analysis/DataTable.js +215 -0
- package/dist/components/analysis/EfficiencyPage.d.ts +2 -0
- package/dist/components/analysis/EfficiencyPage.js +138 -0
- package/dist/components/analysis/HeatChart.d.ts +22 -0
- package/dist/components/analysis/HeatChart.js +161 -0
- package/dist/components/analysis/InspectionDataTable.d.ts +10 -0
- package/dist/components/analysis/InspectionDataTable.js +148 -0
- package/dist/components/analysis/InspectionSankey.d.ts +12 -0
- package/dist/components/analysis/InspectionSankey.js +140 -0
- package/dist/components/analysis/PalletCycleCards.d.ts +1 -0
- package/dist/components/analysis/PalletCycleCards.js +137 -0
- package/dist/components/analysis/PartCycleCards.d.ts +2 -0
- package/dist/components/analysis/PartCycleCards.js +331 -0
- package/dist/components/analysis/QualityPage.d.ts +1 -0
- package/dist/components/analysis/QualityPage.js +49 -0
- package/dist/components/analysis/ScheduleHistory.d.ts +3 -0
- package/dist/components/analysis/ScheduleHistory.js +108 -0
- package/dist/components/analysis/StationDataTable.d.ts +25 -0
- package/dist/components/analysis/StationDataTable.js +246 -0
- package/dist/components/analysis/ToolReplacements.d.ts +1 -0
- package/dist/components/analysis/ToolReplacements.js +370 -0
- package/dist/components/operations/AllMaterial.d.ts +5 -0
- package/dist/components/operations/AllMaterial.js +267 -0
- package/dist/components/operations/ChartRangeEdit.d.ts +4 -0
- package/dist/components/operations/ChartRangeEdit.js +148 -0
- package/dist/components/operations/CloseoutReport.d.ts +2 -0
- package/dist/components/operations/CloseoutReport.js +172 -0
- package/dist/components/operations/CompletedParts.d.ts +2 -0
- package/dist/components/operations/CompletedParts.js +286 -0
- package/dist/components/operations/CurrentWorkorders.d.ts +3 -0
- package/dist/components/operations/CurrentWorkorders.js +368 -0
- package/dist/components/operations/Dashboard.d.ts +2 -0
- package/dist/components/operations/Dashboard.js +90 -0
- package/dist/components/operations/OEEChart.d.ts +10 -0
- package/dist/components/operations/OEEChart.js +173 -0
- package/dist/components/operations/Outliers.d.ts +4 -0
- package/dist/components/operations/Outliers.js +69 -0
- package/dist/components/operations/ProgramHighlight.d.ts +1 -0
- package/dist/components/operations/ProgramHighlight.js +9 -0
- package/dist/components/operations/Programs.d.ts +5 -0
- package/dist/components/operations/Programs.js +363 -0
- package/dist/components/operations/Rebookings.d.ts +1 -0
- package/dist/components/operations/Rebookings.js +213 -0
- package/dist/components/operations/RecentCycleChart.d.ts +4 -0
- package/dist/components/operations/RecentCycleChart.js +240 -0
- package/dist/components/operations/RecentProduction.d.ts +2 -0
- package/dist/components/operations/RecentProduction.js +213 -0
- package/dist/components/operations/RecentSchedules.d.ts +12 -0
- package/dist/components/operations/RecentSchedules.js +180 -0
- package/dist/components/operations/RecentStationCycles.d.ts +4 -0
- package/dist/components/operations/RecentStationCycles.js +159 -0
- package/dist/components/operations/ShiftSettings.d.ts +6 -0
- package/dist/components/operations/ShiftSettings.js +134 -0
- package/dist/components/operations/SimDayUsage.d.ts +1 -0
- package/dist/components/operations/SimDayUsage.js +133 -0
- package/dist/components/operations/ToolReport.d.ts +3 -0
- package/dist/components/operations/ToolReport.js +233 -0
- package/dist/components/operations/WorkorderGantt.d.ts +1 -0
- package/dist/components/operations/WorkorderGantt.js +124 -0
- package/dist/components/quality/QualityMaterial.d.ts +2 -0
- package/dist/components/quality/QualityMaterial.js +169 -0
- package/dist/components/quality/QualityPaths.d.ts +1 -0
- package/dist/components/quality/QualityPaths.js +53 -0
- package/dist/components/quality/RecentFailedInspections.d.ts +1 -0
- package/dist/components/quality/RecentFailedInspections.js +123 -0
- package/dist/components/routes.d.ts +170 -0
- package/dist/components/routes.js +301 -0
- package/dist/components/station-monitor/BulkRawMaterial.d.ts +11 -0
- package/dist/components/station-monitor/BulkRawMaterial.js +251 -0
- package/dist/components/station-monitor/Closeout.d.ts +5 -0
- package/dist/components/station-monitor/Closeout.js +162 -0
- package/dist/components/station-monitor/CustomStationMonitorDialog.d.ts +1 -0
- package/dist/components/station-monitor/CustomStationMonitorDialog.js +55 -0
- package/dist/components/station-monitor/Inspection.d.ts +8 -0
- package/dist/components/station-monitor/Inspection.js +164 -0
- package/dist/components/station-monitor/InvalidateCycle.d.ts +33 -0
- package/dist/components/station-monitor/InvalidateCycle.js +262 -0
- package/dist/components/station-monitor/JobDetails.d.ts +7 -0
- package/dist/components/station-monitor/JobDetails.js +108 -0
- package/dist/components/station-monitor/LoadStation.d.ts +10 -0
- package/dist/components/station-monitor/LoadStation.js +450 -0
- package/dist/components/station-monitor/Material.d.ts +77 -0
- package/dist/components/station-monitor/Material.js +489 -0
- package/dist/components/station-monitor/MoveMaterialArrows.d.ts +11 -0
- package/dist/components/station-monitor/MoveMaterialArrows.js +118 -0
- package/dist/components/station-monitor/PrintedLabel.d.ts +29 -0
- package/dist/components/station-monitor/PrintedLabel.js +166 -0
- package/dist/components/station-monitor/QuarantineButton.d.ts +4 -0
- package/dist/components/station-monitor/QuarantineButton.js +184 -0
- package/dist/components/station-monitor/Queues.d.ts +23 -0
- package/dist/components/station-monitor/Queues.js +312 -0
- package/dist/components/station-monitor/QueuesAddMaterial.d.ts +30 -0
- package/dist/components/station-monitor/QueuesAddMaterial.js +248 -0
- package/dist/components/station-monitor/SelectInspType.d.ts +2 -0
- package/dist/components/station-monitor/SelectInspType.js +99 -0
- package/dist/components/station-monitor/SelectWorkorder.d.ts +4 -0
- package/dist/components/station-monitor/SelectWorkorder.js +100 -0
- package/dist/components/station-monitor/StationToolbar.d.ts +3 -0
- package/dist/components/station-monitor/StationToolbar.js +168 -0
- package/dist/components/station-monitor/SystemOverview.d.ts +46 -0
- package/dist/components/station-monitor/SystemOverview.js +439 -0
- package/dist/components/station-monitor/Whiteboard.d.ts +10 -0
- package/dist/components/station-monitor/Whiteboard.js +67 -0
- package/dist/data/all-material-bins.d.ts +45 -0
- package/dist/data/all-material-bins.js +224 -0
- package/dist/data/chart-times.d.ts +20 -0
- package/dist/data/chart-times.js +99 -0
- package/dist/data/cost-per-piece.d.ts +32 -0
- package/dist/data/cost-per-piece.js +183 -0
- package/dist/data/current-cycles.d.ts +13 -0
- package/dist/data/current-cycles.js +144 -0
- package/dist/data/inspection-sankey.d.ts +15 -0
- package/dist/data/inspection-sankey.js +147 -0
- package/dist/data/move-arrows.d.ts +48 -0
- package/dist/data/move-arrows.js +217 -0
- package/dist/data/operators.d.ts +2 -0
- package/dist/data/operators.js +44 -0
- package/dist/data/part-summary.d.ts +17 -0
- package/dist/data/part-summary.js +107 -0
- package/dist/data/path-lookup.d.ts +13 -0
- package/dist/data/path-lookup.js +107 -0
- package/dist/data/queue-material.d.ts +46 -0
- package/dist/data/queue-material.js +256 -0
- package/dist/data/results.bufferchart.d.ts +10 -0
- package/dist/data/results.bufferchart.js +90 -0
- package/dist/data/results.completed-parts.d.ts +26 -0
- package/dist/data/results.completed-parts.js +181 -0
- package/dist/data/results.cycles.d.ts +86 -0
- package/dist/data/results.cycles.js +454 -0
- package/dist/data/results.inspection.d.ts +36 -0
- package/dist/data/results.inspection.js +188 -0
- package/dist/data/results.oee.d.ts +40 -0
- package/dist/data/results.oee.js +330 -0
- package/dist/data/results.schedules.d.ts +23 -0
- package/dist/data/results.schedules.js +157 -0
- package/dist/data/tools-programs.d.ts +78 -0
- package/dist/data/tools-programs.js +376 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +60 -0
- package/dist/network/api.d.ts +1390 -0
- package/dist/network/api.js +4971 -0
- package/dist/network/backend-mock.d.ts +11 -0
- package/dist/network/backend-mock.js +512 -0
- package/dist/network/backend.d.ts +57 -0
- package/dist/network/backend.js +77 -0
- package/dist/network/load-specific-month.d.ts +13 -0
- package/dist/network/load-specific-month.js +77 -0
- package/dist/network/server-settings.d.ts +12 -0
- package/dist/network/server-settings.js +92 -0
- package/dist/network/websocket.d.ts +4 -0
- package/dist/network/websocket.js +165 -0
- package/dist/renderer.d.ts +8 -0
- package/dist/renderer.js +55 -0
- package/dist/seedtactics-logo.d.ts +2 -0
- package/dist/seedtactics-logo.js +4 -0
- package/dist/util/chart-colors.d.ts +1 -0
- package/dist/util/chart-colors.js +116 -0
- package/dist/util/chart-helpers.d.ts +3 -0
- package/dist/util/chart-helpers.js +51 -0
- package/dist/util/parseISODuration.d.ts +4 -0
- package/dist/util/parseISODuration.js +40 -0
- package/docs/client-efficiency.md +355 -0
- package/docs/client-engineering.md +54 -0
- package/docs/client-launch.md +55 -0
- package/docs/client-operations.md +88 -0
- package/docs/client-quality.md +74 -0
- package/docs/client-sales.md +61 -0
- package/docs/client-scanners.md +41 -0
- package/docs/client-station-monitor.md +149 -0
- package/docs/client-tools-programs.md +74 -0
- package/docs/improve-fms.md +141 -0
- package/docs/makino.md +40 -0
- package/docs/material-quarantine.md +82 -0
- package/docs/material-tracking.md +236 -0
- package/docs/mazak.md +115 -0
- package/docs/niigata.md +228 -0
- package/docs/operator-procedures.md +106 -0
- package/docs/part-instructions.md +63 -0
- package/docs/screenshots/insight-all-material.png +0 -0
- package/docs/screenshots/insight-analysis-pallets.png +0 -0
- package/docs/screenshots/insight-analysis-part-completed.png +0 -0
- package/docs/screenshots/insight-analysis-sankey.png +0 -0
- package/docs/screenshots/insight-analysis-station-oee.png +0 -0
- package/docs/screenshots/insight-buffer-occupancy.png +0 -0
- package/docs/screenshots/insight-choose-analysis-month.png +0 -0
- package/docs/screenshots/insight-closeout.png +0 -0
- package/docs/screenshots/insight-cost-percentages.png +0 -0
- package/docs/screenshots/insight-dashboard.png +0 -0
- package/docs/screenshots/insight-event-custom-view.jpg +0 -0
- package/docs/screenshots/insight-event-viewer.jpg +0 -0
- package/docs/screenshots/insight-inspection.png +0 -0
- package/docs/screenshots/insight-load-station-details.png +0 -0
- package/docs/screenshots/insight-load-station.png +0 -0
- package/docs/screenshots/insight-loadcycle-graph.png +0 -0
- package/docs/screenshots/insight-loadstation-small.jpg +0 -0
- package/docs/screenshots/insight-machinecycle-graph.png +0 -0
- package/docs/screenshots/insight-machinecycle-table.png +0 -0
- package/docs/screenshots/insight-machinecycles.png +0 -0
- package/docs/screenshots/insight-machinehours.png +0 -0
- package/docs/screenshots/insight-machineoutliers.png +0 -0
- package/docs/screenshots/insight-monthly-schedules.png +0 -0
- package/docs/screenshots/insight-operations-material.png +0 -0
- package/docs/screenshots/insight-operations-overview.png +0 -0
- package/docs/screenshots/insight-operations-reports.png +0 -0
- package/docs/screenshots/insight-part-cost.png +0 -0
- package/docs/screenshots/insight-program-report.png +0 -0
- package/docs/screenshots/insight-quality-material-details.png +0 -0
- package/docs/screenshots/insight-quality-material.png +0 -0
- package/docs/screenshots/insight-quality-quarantine.png +0 -0
- package/docs/screenshots/insight-quality-sankey.png +0 -0
- package/docs/screenshots/insight-quality-similar-paths.png +0 -0
- package/docs/screenshots/insight-queue-details.png +0 -0
- package/docs/screenshots/insight-queues-jobs-table.png +0 -0
- package/docs/screenshots/insight-queues.png +0 -0
- package/docs/screenshots/insight-sim-day-usage.png +0 -0
- package/docs/screenshots/insight-station-system-overview-buttons.png +0 -0
- package/docs/screenshots/insight-station-system-overview.png +0 -0
- package/docs/screenshots/insight-system-overview.png +0 -0
- package/docs/screenshots/insight-tool-replacements.png +0 -0
- package/docs/screenshots/insight-tool-report.png +0 -0
- package/docs/screenshots/insight-toolbar-btns.png +0 -0
- package/docs/screenshots/insight-workorder-gantt.png +0 -0
- package/docs/screenshots/insight-workorders.png +0 -0
- package/docs/security.md +131 -0
- package/docs/server-config.md +56 -0
- package/docs/server-errors.md +44 -0
- package/package.json +90 -0
- package/src/index.ts +65 -0
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
/* Copyright (c) 2020, John Lenz
|
|
3
|
+
|
|
4
|
+
All rights reserved.
|
|
5
|
+
|
|
6
|
+
Redistribution and use in source and binary forms, with or without
|
|
7
|
+
modification, are permitted provided that the following conditions are met:
|
|
8
|
+
|
|
9
|
+
* Redistributions of source code must retain the above copyright
|
|
10
|
+
notice, this list of conditions and the following disclaimer.
|
|
11
|
+
|
|
12
|
+
* Redistributions in binary form must reproduce the above
|
|
13
|
+
copyright notice, this list of conditions and the following
|
|
14
|
+
disclaimer in the documentation and/or other materials provided
|
|
15
|
+
with the distribution.
|
|
16
|
+
|
|
17
|
+
* Neither the name of John Lenz, Black Maple Software, SeedTactics,
|
|
18
|
+
nor the names of other contributors may be used to endorse or
|
|
19
|
+
promote products derived from this software without specific
|
|
20
|
+
prior written permission.
|
|
21
|
+
|
|
22
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
23
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
24
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
25
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
26
|
+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
27
|
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
28
|
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
29
|
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
30
|
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
31
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
32
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
33
|
+
*/
|
|
34
|
+
import { useRef, useCallback, useEffect, useMemo, Fragment } from "react";
|
|
35
|
+
import JsBarcode from "jsbarcode";
|
|
36
|
+
import { LazySeq } from "@seedtactics/immutable-collections";
|
|
37
|
+
import { currentStatus } from "../../cell-status/current-status.js";
|
|
38
|
+
import { useAtomValue } from "jotai";
|
|
39
|
+
import { useReactToPrint } from "react-to-print";
|
|
40
|
+
import { Button } from "@mui/material";
|
|
41
|
+
import { fmsInformation } from "../../network/server-settings.js";
|
|
42
|
+
import { inProcessMaterialInDialog, materialInDialogInfo, usePrintLabel, } from "../../cell-status/material-details.js";
|
|
43
|
+
function Barcode(props) {
|
|
44
|
+
const ref = useRef(null);
|
|
45
|
+
const setRef = useCallback((node) => {
|
|
46
|
+
if (node) {
|
|
47
|
+
JsBarcode(node, props.text, {
|
|
48
|
+
format: "CODE128",
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
ref.current = node;
|
|
52
|
+
}, [props.text]);
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
if (ref.current) {
|
|
55
|
+
JsBarcode(ref.current, props.text, {
|
|
56
|
+
format: "CODE128",
|
|
57
|
+
fontSize: 30,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}, [props.text]);
|
|
61
|
+
return _jsx("svg", { ref: setRef });
|
|
62
|
+
}
|
|
63
|
+
function SinglePage(props) {
|
|
64
|
+
return (_jsxs("div", { children: [_jsx("div", { style: { marginTop: "4em", display: "flex", justifyContent: "center" }, children: _jsx("h2", { children: "SeedTactic: FMS Insight" }) }), _jsx("div", { style: { display: "flex", justifyContent: "center" }, children: _jsx("p", { style: { fontSize: "x-large" }, children: new Date().toLocaleString(undefined, {
|
|
65
|
+
weekday: "long",
|
|
66
|
+
month: "long",
|
|
67
|
+
day: "numeric",
|
|
68
|
+
year: "numeric",
|
|
69
|
+
hour: "numeric",
|
|
70
|
+
minute: "2-digit",
|
|
71
|
+
second: "2-digit",
|
|
72
|
+
}) }) }), _jsxs("div", { style: { marginTop: "2em", display: "flex", justifyContent: "space-around" }, children: [_jsx(Barcode, { text: props.materialName ?? props.partName }), props.count >= 2 ? _jsx(Barcode, { text: props.count.toString() }) : undefined] }), props.serial1 && props.serial1 !== "" ? (_jsxs("div", { style: { marginTop: "2em", display: "flex", justifyContent: "space-around" }, children: [_jsx(Barcode, { text: props.serial1 }), props.serial2 && props.serial2 !== "" ? _jsx(Barcode, { text: props.serial2 || "" }) : undefined] })) : undefined, _jsx("div", { style: { marginTop: "2em", marginLeft: "4em", marginRight: "4em", marginBottom: "9em" }, children: props.uniq === null || props.uniq === "" ? (_jsx("p", { style: { fontSize: "x-large" }, children: "Not currently assigned to any jobs" })) : (_jsxs(_Fragment, { children: [_jsx("p", { style: { fontSize: "x-large" }, children: "Assigned To" }), _jsxs("div", { style: { marginTop: "1em", marginLeft: "2em", display: "flex", alignItems: "center" }, children: [_jsx(Barcode, { text: props.partName }), _jsxs("h3", { style: { marginLeft: "4em" }, children: ["assigned to ", props.uniq, props.jobCycles && props.jobCycles > 0
|
|
73
|
+
? " (" + props.jobCycles.toString() + " scheduled)"
|
|
74
|
+
: ""] })] })] })) }), props.note ? (_jsx("div", { style: { marginBottom: "2em" }, children: _jsx("p", { style: { fontSize: "xxx-large", textAlign: "center" }, children: props.note }) })) : undefined, _jsx("div", { style: { display: "flex", justifyContent: "center" }, children: props.operator ? _jsx("p", { style: { fontSize: "x-large" }, children: props.operator }) : undefined })] }));
|
|
75
|
+
}
|
|
76
|
+
function OneJobPerPage(props) {
|
|
77
|
+
const allJobs = useAtomValue(currentStatus).jobs;
|
|
78
|
+
const assignments = useMemo(() => LazySeq.of(props.material || [])
|
|
79
|
+
.filter((m) => m.jobUnique !== null && m.jobUnique !== undefined && m.jobUnique !== "")
|
|
80
|
+
.groupBy((m) => m.jobUnique)
|
|
81
|
+
.map(([uniq, mats]) => [
|
|
82
|
+
uniq,
|
|
83
|
+
{
|
|
84
|
+
cycles: allJobs[uniq]?.cycles ?? 0,
|
|
85
|
+
length: mats.length,
|
|
86
|
+
part: mats[0]?.partName ?? "",
|
|
87
|
+
comment: allJobs[uniq]?.comment,
|
|
88
|
+
serial1: mats[0]?.serial,
|
|
89
|
+
serial2: mats[mats.length - 1]?.serial,
|
|
90
|
+
},
|
|
91
|
+
])
|
|
92
|
+
.toSortedArray(([_, p]) => p.part), [props.material, allJobs]);
|
|
93
|
+
if (!props.material || props.material.length === 0) {
|
|
94
|
+
return _jsx("div", {});
|
|
95
|
+
}
|
|
96
|
+
else if (assignments.length === 0) {
|
|
97
|
+
return (_jsx(SinglePage, { partName: props.material[0].partName, materialName: props.materialName, count: props.material.length, uniq: null, note: null, operator: props.operator, serial1: props.material[0].serial, serial2: props.material[props.material.length - 1]?.serial }));
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
return (_jsx("div", { children: assignments.map(([uniq, a], idx) => (_jsxs(Fragment, { children: [_jsx(SinglePage, { partName: a.part, materialName: props.materialName, count: a.length, uniq: uniq, jobCycles: a.cycles, note: a.comment, operator: props.operator, serial1: a.serial1, serial2: a.serial2 }), idx < assignments.length - 1 ? _jsx("div", { style: { pageBreakAfter: "always" } }) : undefined] }, idx))) }));
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
function CombinedToOnePage(props) {
|
|
104
|
+
const assignments = useMemo(() => LazySeq.of(props.material || [])
|
|
105
|
+
.filter((m) => m.jobUnique !== null && m.jobUnique !== undefined && m.jobUnique !== "")
|
|
106
|
+
.groupBy((m) => m.jobUnique)
|
|
107
|
+
.map(([k, mats]) => [k, { length: mats.length, part: mats[0]?.partName ?? "" }])
|
|
108
|
+
.toSortedArray(([_, p]) => p.part), [props.material]);
|
|
109
|
+
const allJobs = useAtomValue(currentStatus).jobs;
|
|
110
|
+
const notes = useMemo(() => LazySeq.of(props.material || [])
|
|
111
|
+
.collect((m) => (m.jobUnique ? allJobs[m.jobUnique]?.comment : undefined))
|
|
112
|
+
.distinct()
|
|
113
|
+
.toSortedArray((n) => n), [props.material, allJobs]);
|
|
114
|
+
if (!props.material || props.material.length === 0) {
|
|
115
|
+
return _jsx("div", {});
|
|
116
|
+
}
|
|
117
|
+
return (_jsxs("div", { children: [_jsx("div", { style: { marginTop: "4em", display: "flex", justifyContent: "center" }, children: _jsx("h2", { children: "SeedTactic: FMS Insight" }) }), _jsx("div", { style: { display: "flex", justifyContent: "center" }, children: _jsx("p", { style: { fontSize: "x-large" }, children: new Date().toLocaleString(undefined, {
|
|
118
|
+
weekday: "long",
|
|
119
|
+
month: "long",
|
|
120
|
+
day: "numeric",
|
|
121
|
+
year: "numeric",
|
|
122
|
+
hour: "numeric",
|
|
123
|
+
minute: "2-digit",
|
|
124
|
+
second: "2-digit",
|
|
125
|
+
}) }) }), _jsxs("div", { style: { marginTop: "2em", display: "flex", justifyContent: "space-around" }, children: [_jsx(Barcode, { text: props.materialName ?? props.material[0].partName }), props.material.length >= 2 ? _jsx(Barcode, { text: props.material.length.toString() }) : undefined] }), props.material[0].serial && props.material[0].serial !== "" ? (_jsxs("div", { style: { marginTop: "2em", display: "flex", justifyContent: "space-around" }, children: [_jsx(Barcode, { text: props.material[0].serial }), props.material.length >= 2 &&
|
|
126
|
+
props.material[props.material.length - 1].serial &&
|
|
127
|
+
props.material[props.material.length - 1].serial !== "" ? (_jsx(Barcode, { text: props.material[props.material.length - 1].serial || "" })) : undefined] })) : undefined, _jsx("div", { style: { marginTop: "2em", marginLeft: "4em", marginRight: "4em", marginBottom: "9em" }, children: assignments.length === 0 ? (_jsx("p", { style: { fontSize: "x-large" }, children: "Not currently assigned to any jobs" })) : props.materialName ? (_jsxs(_Fragment, { children: [_jsx("p", { style: { fontSize: "x-large" }, children: "Assigned To" }), assignments.map(([uniq, part], idx) => (_jsxs("div", { style: { marginTop: "1em", marginLeft: "2em", display: "flex", alignItems: "center" }, children: [_jsx(Barcode, { text: part.part }), _jsxs("h3", { style: { marginLeft: "4em" }, children: ["x", part.length] }), _jsxs("h3", { style: { marginLeft: "4em" }, children: ["assigned to ", uniq] })] }, idx)))] })) : assignments.length === 1 ? (_jsx("div", { style: { marginTop: "1em", display: "flex", justifyContent: "space-around" }, children: _jsxs("p", { style: { fontSize: "x-large" }, children: [_jsxs("span", { children: ["Assigned to ", assignments[0][0]] }), assignments[0][1].length > 1 ? (_jsxs("span", { style: { marginLeft: "1em" }, children: ["x", assignments[0][1].length] })) : undefined] }) })) : (_jsxs(_Fragment, { children: [_jsx("p", { style: { fontSize: "x-large" }, children: "Assigned To" }), assignments.map(([uniq, part], idx) => (_jsxs("h3", { style: { marginTop: "1em", marginLeft: "2em" }, children: [_jsx("span", { children: uniq }), part.length > 1 ? _jsxs("span", { style: { marginLeft: "1em" }, children: ["x", part.length] }) : undefined] }, idx)))] })) }), notes.length > 0 ? (_jsx("div", { style: { marginBottom: "2em" }, children: notes.map((n, idx) => (_jsx("p", { style: { fontSize: "xxx-large", textAlign: "center" }, children: n }, idx))) })) : undefined, _jsx("div", { style: { display: "flex", justifyContent: "center" }, children: props.operator ? _jsx("p", { style: { fontSize: "x-large" }, children: props.operator }) : undefined })] }));
|
|
128
|
+
}
|
|
129
|
+
export function PrintedLabel(props) {
|
|
130
|
+
if (props.oneJobPerPage) {
|
|
131
|
+
return _jsx(OneJobPerPage, { ...props });
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
return _jsx(CombinedToOnePage, { ...props });
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
export function PrintOnClientButton({ mat, materialName, operator, }) {
|
|
138
|
+
const printRef = useRef(null);
|
|
139
|
+
const print = useReactToPrint({
|
|
140
|
+
contentRef: printRef,
|
|
141
|
+
ignoreGlobalStyles: true,
|
|
142
|
+
});
|
|
143
|
+
return (_jsxs(_Fragment, { children: [_jsx(Button, { color: "primary", onClick: () => print(), children: "Print Label" }), _jsx("div", { style: { display: "none" }, children: _jsx("div", { ref: printRef, children: _jsx(PrintedLabel, { materialName: materialName, material: Array.isArray(mat) ? mat : [mat], oneJobPerPage: false, operator: operator }) }) })] }));
|
|
144
|
+
}
|
|
145
|
+
export function PrintLabelButton() {
|
|
146
|
+
const fmsInfo = useAtomValue(fmsInformation);
|
|
147
|
+
const matInfo = useAtomValue(materialInDialogInfo);
|
|
148
|
+
const curMat = useAtomValue(inProcessMaterialInDialog);
|
|
149
|
+
const [printLabel, printingLabel, printed] = usePrintLabel();
|
|
150
|
+
if (!fmsInfo.usingLabelPrinterForSerials || matInfo === null || matInfo.materialID < 0)
|
|
151
|
+
return null;
|
|
152
|
+
if (fmsInfo.useClientPrinterForLabels) {
|
|
153
|
+
if (curMat === null) {
|
|
154
|
+
return null;
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
return _jsx(PrintOnClientButton, { mat: curMat });
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
return (_jsx(Button, { color: "primary", disabled: printingLabel || printed, onClick: () => printLabel({
|
|
162
|
+
materialId: matInfo.materialID,
|
|
163
|
+
proc: curMat?.process ?? 0,
|
|
164
|
+
}), children: printed ? "Printed" : "Print Label" }));
|
|
165
|
+
}
|
|
166
|
+
}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
/* Copyright (c) 2024, John Lenz
|
|
3
|
+
|
|
4
|
+
All rights reserved.
|
|
5
|
+
|
|
6
|
+
Redistribution and use in source and binary forms, with or without
|
|
7
|
+
modification, are permitted provided that the following conditions are met:
|
|
8
|
+
|
|
9
|
+
* Redistributions of source code must retain the above copyright
|
|
10
|
+
notice, this list of conditions and the following disclaimer.
|
|
11
|
+
|
|
12
|
+
* Redistributions in binary form must reproduce the above
|
|
13
|
+
copyright notice, this list of conditions and the following
|
|
14
|
+
disclaimer in the documentation and/or other materials provided
|
|
15
|
+
with the distribution.
|
|
16
|
+
|
|
17
|
+
* Neither the name of John Lenz, Black Maple Software, SeedTactics,
|
|
18
|
+
nor the names of other contributors may be used to endorse or
|
|
19
|
+
promote products derived from this software without specific
|
|
20
|
+
prior written permission.
|
|
21
|
+
|
|
22
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
23
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
24
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
25
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
26
|
+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
27
|
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
28
|
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
29
|
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
30
|
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
31
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
32
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
33
|
+
*/
|
|
34
|
+
import { useState } from "react";
|
|
35
|
+
import { Button, Dialog, DialogActions, DialogContent, DialogTitle, TextField, Tooltip } from "@mui/material";
|
|
36
|
+
import { LazySeq } from "@seedtactics/immutable-collections";
|
|
37
|
+
import { currentStatus } from "../../cell-status/current-status.js";
|
|
38
|
+
import { inProcessMaterialInDialog, materialDialogOpen, useRemoveFromQueue, useSignalForQuarantine, } from "../../cell-status/material-details.js";
|
|
39
|
+
import { currentOperator } from "../../data/operators.js";
|
|
40
|
+
import { ActionType, LocType, PalletLocationEnum, QueueRole } from "../../network/api.js";
|
|
41
|
+
import { fmsInformation } from "../../network/server-settings.js";
|
|
42
|
+
import { useAtomValue, useSetAtom } from "jotai";
|
|
43
|
+
function useQuarantineMaterial(ignoreOperator) {
|
|
44
|
+
const fmsInfo = useAtomValue(fmsInformation);
|
|
45
|
+
const [removeFromQueue, removingFromQueue] = useRemoveFromQueue();
|
|
46
|
+
const [signalQuarantine, signalingQuarantine] = useSignalForQuarantine();
|
|
47
|
+
const inProcMat = useAtomValue(inProcessMaterialInDialog);
|
|
48
|
+
const curSt = useAtomValue(currentStatus);
|
|
49
|
+
let operator = useAtomValue(currentOperator);
|
|
50
|
+
if (ignoreOperator)
|
|
51
|
+
operator = null;
|
|
52
|
+
if (inProcMat === null || inProcMat.materialID < 0)
|
|
53
|
+
return null;
|
|
54
|
+
const quarantineQueue = fmsInfo.quarantineQueue?.length ? fmsInfo.quarantineQueue : null;
|
|
55
|
+
const activeQueues = LazySeq.ofObject(curSt.jobs)
|
|
56
|
+
.flatMap(([_, job]) => job.procsAndPaths)
|
|
57
|
+
.flatMap((proc) => proc.paths)
|
|
58
|
+
.flatMap((path) => {
|
|
59
|
+
const q = [];
|
|
60
|
+
if (path.inputQueue !== undefined)
|
|
61
|
+
q.push(path.inputQueue);
|
|
62
|
+
if (path.outputQueue !== undefined)
|
|
63
|
+
q.push(path.outputQueue);
|
|
64
|
+
return q;
|
|
65
|
+
})
|
|
66
|
+
.concat(LazySeq.ofObject(curSt.queues)
|
|
67
|
+
.filter(([, info]) => info.role === QueueRole.RawMaterial || info.role === QueueRole.InProcessTransfer)
|
|
68
|
+
.map(([qname, _]) => qname))
|
|
69
|
+
.toRSet((x) => x);
|
|
70
|
+
const quarantineQueues = LazySeq.ofObject(curSt.queues)
|
|
71
|
+
.filter(([qname, _]) => !activeQueues.has(qname))
|
|
72
|
+
.toRSet(([qname, _]) => qname);
|
|
73
|
+
const palLoc = LazySeq.ofObject(curSt.pallets).toOrderedMap(([_, pal]) => [
|
|
74
|
+
pal.palletNum,
|
|
75
|
+
pal.currentPalletLocation,
|
|
76
|
+
]);
|
|
77
|
+
// If in a quarantine queue, allow removal from system
|
|
78
|
+
if (inProcMat.location.type === LocType.InQueue &&
|
|
79
|
+
inProcMat.location.currentQueue &&
|
|
80
|
+
quarantineQueues.has(inProcMat.location.currentQueue)) {
|
|
81
|
+
return {
|
|
82
|
+
type: "Remove",
|
|
83
|
+
quarantine: () => removeFromQueue(inProcMat.materialID, operator),
|
|
84
|
+
removing: removingFromQueue,
|
|
85
|
+
quarantineQueueDestination: null,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
let type = null;
|
|
89
|
+
switch (inProcMat.location.type) {
|
|
90
|
+
case LocType.OnPallet:
|
|
91
|
+
if (fmsInfo.allowQuarantineToCancelLoad) {
|
|
92
|
+
// either cancel load or signal based on material action and pallet location
|
|
93
|
+
const palAtLoad = inProcMat.location.palletNum &&
|
|
94
|
+
palLoc.get(inProcMat.location.palletNum)?.loc === PalletLocationEnum.LoadUnload;
|
|
95
|
+
if (inProcMat.action.type === ActionType.Loading || palAtLoad) {
|
|
96
|
+
type = "CancelLoad";
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
type = "SignalForScrap";
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
// must signal since it is currently on a pallet, but only if the material is not loading
|
|
104
|
+
if (inProcMat.action.type === ActionType.Loading) {
|
|
105
|
+
return null;
|
|
106
|
+
}
|
|
107
|
+
// Check that the job outputs to a queue, only then can signaling for quarantine work
|
|
108
|
+
const job = curSt.jobs[inProcMat.jobUnique];
|
|
109
|
+
if (!job)
|
|
110
|
+
return null;
|
|
111
|
+
const path = job.procsAndPaths?.[inProcMat.process - 1]?.paths?.[inProcMat.path - 1];
|
|
112
|
+
if (inProcMat.process != job.procsAndPaths.length && (!path || !path.outputQueue)) {
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
type = "SignalForScrap";
|
|
116
|
+
}
|
|
117
|
+
break;
|
|
118
|
+
case LocType.InQueue:
|
|
119
|
+
if (inProcMat.action.type === ActionType.Loading && !fmsInfo.allowQuarantineToCancelLoad) {
|
|
120
|
+
return null;
|
|
121
|
+
}
|
|
122
|
+
else if (inProcMat.action.type === ActionType.Loading) {
|
|
123
|
+
type = "CancelLoad";
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
type = "Scrap";
|
|
127
|
+
}
|
|
128
|
+
break;
|
|
129
|
+
case LocType.Free:
|
|
130
|
+
type = "Scrap";
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
133
|
+
if (type) {
|
|
134
|
+
return {
|
|
135
|
+
type,
|
|
136
|
+
quarantine: (reason) => signalQuarantine(inProcMat.materialID, operator, reason),
|
|
137
|
+
removing: signalingQuarantine,
|
|
138
|
+
quarantineQueueDestination: quarantineQueue,
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
return null;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
export function QuarantineMatButton({ onClose, ignoreOperator, }) {
|
|
146
|
+
const [open, setOpen] = useState(false);
|
|
147
|
+
const [reason, setReason] = useState("");
|
|
148
|
+
const q = useQuarantineMaterial(!!ignoreOperator);
|
|
149
|
+
const setMatToShow = useSetAtom(materialDialogOpen);
|
|
150
|
+
if (q === null)
|
|
151
|
+
return null;
|
|
152
|
+
let title;
|
|
153
|
+
let btnTxt;
|
|
154
|
+
switch (q.type) {
|
|
155
|
+
case "Remove":
|
|
156
|
+
title = "Remove from system";
|
|
157
|
+
btnTxt = "Remove";
|
|
158
|
+
break;
|
|
159
|
+
case "Scrap":
|
|
160
|
+
title = q.quarantineQueueDestination ? `Move to ${q.quarantineQueueDestination}` : "Remove from queue";
|
|
161
|
+
btnTxt = q.quarantineQueueDestination ? "Quarantine" : "Remove";
|
|
162
|
+
break;
|
|
163
|
+
case "SignalForScrap":
|
|
164
|
+
title = q.quarantineQueueDestination
|
|
165
|
+
? `After unload, move to ${q.quarantineQueueDestination}`
|
|
166
|
+
: "After unload, remove the part as scrap";
|
|
167
|
+
btnTxt = q.quarantineQueueDestination ? "Quarantine" : "Scrap";
|
|
168
|
+
break;
|
|
169
|
+
case "CancelLoad":
|
|
170
|
+
title = q.quarantineQueueDestination
|
|
171
|
+
? `Cancel load and move to ${q.quarantineQueueDestination}`
|
|
172
|
+
: "Cancel load";
|
|
173
|
+
btnTxt = "Cancel Load";
|
|
174
|
+
break;
|
|
175
|
+
}
|
|
176
|
+
function quarantine() {
|
|
177
|
+
q?.quarantine(reason);
|
|
178
|
+
setMatToShow(null);
|
|
179
|
+
setOpen(false);
|
|
180
|
+
setReason("");
|
|
181
|
+
onClose?.();
|
|
182
|
+
}
|
|
183
|
+
return (_jsxs(_Fragment, { children: [_jsx(Tooltip, { title: title, children: _jsx(Button, { color: "primary", disabled: q.removing, onClick: () => setOpen(true), children: btnTxt }) }), _jsxs(Dialog, { open: open, onClose: () => setOpen(false), children: [_jsx(DialogTitle, { children: "Quarantine Material" }), _jsxs(DialogContent, { children: [_jsx("p", { children: title }), _jsx(TextField, { label: "Reason", value: reason, onChange: (e) => setReason(e.target.value), fullWidth: true, autoFocus: true, multiline: true })] }), _jsxs(DialogActions, { children: [_jsx(Button, { color: "primary", onClick: quarantine, children: btnTxt }), _jsx(Button, { color: "secondary", onClick: () => setOpen(false), children: "Cancel" })] })] })] }));
|
|
184
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import * as api from "../../network/api.js";
|
|
3
|
+
import { JobRawMaterialData } from "../../data/queue-material.js";
|
|
4
|
+
export interface RawMaterialJobRowProps {
|
|
5
|
+
readonly job: JobRawMaterialData;
|
|
6
|
+
readonly editNote: (job: Readonly<api.IActiveJob>) => void;
|
|
7
|
+
readonly editQty: (job: JobRawMaterialData) => void;
|
|
8
|
+
}
|
|
9
|
+
interface EditNoteDialogProps {
|
|
10
|
+
readonly job: {
|
|
11
|
+
readonly unique: string;
|
|
12
|
+
readonly partName: string;
|
|
13
|
+
readonly comment?: string | null;
|
|
14
|
+
} | null;
|
|
15
|
+
readonly closeDialog: () => void;
|
|
16
|
+
}
|
|
17
|
+
export declare const EditNoteDialog: import("react").NamedExoticComponent<EditNoteDialogProps>;
|
|
18
|
+
interface QueueProps {
|
|
19
|
+
readonly queues: ReadonlyArray<string>;
|
|
20
|
+
}
|
|
21
|
+
export declare const Queues: (props: QueueProps) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export default function QueuesPage(props: QueueProps): ReactNode;
|
|
23
|
+
export {};
|