@argusoft/medplat-core 1.0.29 → 1.0.31
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/dist/AccessRights-DUgY6ewy.js +1031 -0
- package/dist/AccessRights-DUgY6ewy.js.map +1 -0
- package/dist/AddEditQueryBuilder-D-iQiVIe.js +365 -0
- package/dist/AddEditQueryBuilder-D-iQiVIe.js.map +1 -0
- package/dist/{AddFeatures-v3TmGQee.js → AddFeatures-D1sU8RjY.js} +2 -2
- package/dist/{AddFeatures-v3TmGQee.js.map → AddFeatures-D1sU8RjY.js.map} +1 -1
- package/dist/AddLabelModal-Bq-wRqv9.js +631 -0
- package/dist/AddLabelModal-Bq-wRqv9.js.map +1 -0
- package/dist/AddMenuConfiguration-c6ZKiN0i.js +8898 -0
- package/dist/AddMenuConfiguration-c6ZKiN0i.js.map +1 -0
- package/dist/AppModal-CCtrQ5Tr.js +394 -0
- package/dist/AppModal-CCtrQ5Tr.js.map +1 -0
- package/dist/BrandsPage-DMw2vT0u-BVhvhc6J.js +387 -0
- package/dist/BrandsPage-DMw2vT0u-BVhvhc6J.js.map +1 -0
- package/dist/CategoriesPage-D3ihx9Gi-CT58g0ry.js +398 -0
- package/dist/CategoriesPage-D3ihx9Gi-CT58g0ry.js.map +1 -0
- package/dist/{ChangePasswordModalCore-DutQAZOx.js → ChangePasswordModalCore-lQ9GamH1.js} +1605 -1610
- package/dist/ChangePasswordModalCore-lQ9GamH1.js.map +1 -0
- package/dist/ConditionConfig-BQBmBHaM.js +408 -0
- package/dist/ConditionConfig-BQBmBHaM.js.map +1 -0
- package/dist/DashboardPage-asr2XDRu-uOOlX9Vq.js +435 -0
- package/dist/DashboardPage-asr2XDRu-uOOlX9Vq.js.map +1 -0
- package/dist/EventConfig-BY2cgGyx.js +27 -0
- package/dist/EventConfig-BY2cgGyx.js.map +1 -0
- package/dist/EventConfigurations-CUPEN5BV.js +544 -0
- package/dist/EventConfigurations-CUPEN5BV.js.map +1 -0
- package/dist/EventConfigurations.css +1 -1
- package/dist/EventsExceptionModal-BX-ArkBE.js +188 -0
- package/dist/EventsExceptionModal-BX-ArkBE.js.map +1 -0
- package/dist/EventsUi-D6O9S7BK.js +258 -0
- package/dist/EventsUi-D6O9S7BK.js.map +1 -0
- package/dist/FacilityPicker-DYl_PDyt-Cbwo2tAY.js +79 -0
- package/dist/FacilityPicker-DYl_PDyt-Cbwo2tAY.js.map +1 -0
- package/dist/FeatureMenu-CHsBbw3W.js +525 -0
- package/dist/FeatureMenu-CHsBbw3W.js.map +1 -0
- package/dist/{FhirServerList-Dkq7Kbes.js → FhirServerList-iXBPkRVF.js} +22 -22
- package/dist/{FhirServerList-Dkq7Kbes.js.map → FhirServerList-iXBPkRVF.js.map} +1 -1
- package/dist/{FhirServerWizard-Db6Hm4bQ.js → FhirServerWizard-DZI8Olku.js} +15 -15
- package/dist/{FhirServerWizard-Db6Hm4bQ.js.map → FhirServerWizard-DZI8Olku.js.map} +1 -1
- package/dist/FlywayQuery-CQygj51V.js +179 -0
- package/dist/FlywayQuery-CQygj51V.js.map +1 -0
- package/dist/GrantPermissionModal-D7iNZd0M.js +239 -0
- package/dist/GrantPermissionModal-D7iNZd0M.js.map +1 -0
- package/dist/ImmunizationConfigurationBase-aUtx0JEe.js +8019 -0
- package/dist/ImmunizationConfigurationBase-aUtx0JEe.js.map +1 -0
- package/dist/ImmunizationConfigurationBase.css +1 -1
- package/dist/ImmunizationConfigurationsList-TZcLDEci.js +369 -0
- package/dist/ImmunizationConfigurationsList-TZcLDEci.js.map +1 -0
- package/dist/InventoryPage-DOotGZrj-CoPjOJEI.js +665 -0
- package/dist/InventoryPage-DOotGZrj-CoPjOJEI.js.map +1 -0
- package/dist/LanguagesModal-B3NTebYT.js +352 -0
- package/dist/LanguagesModal-B3NTebYT.js.map +1 -0
- package/dist/ManageDynamicFeature-BU0I45dd.js +4475 -0
- package/dist/ManageDynamicFeature-BU0I45dd.js.map +1 -0
- package/dist/ManageEventConfiguration-DqW3krT6.js +1216 -0
- package/dist/ManageEventConfiguration-DqW3krT6.js.map +1 -0
- package/dist/ManageEventConfiguration.css +1 -1
- package/dist/{ManageNotification-CfhHlfxA.js → ManageNotification-C5MhV77Q.js} +2 -2
- package/dist/{ManageNotification-CfhHlfxA.js.map → ManageNotification-C5MhV77Q.js.map} +1 -1
- package/dist/{ManageRole-4Y2PP4dQ.js → ManageRole-CNZBRKGU.js} +2 -2
- package/dist/{ManageRole-4Y2PP4dQ.js.map → ManageRole-CNZBRKGU.js.map} +1 -1
- package/dist/ManageTranslation-vRiptUAP.js +833 -0
- package/dist/ManageTranslation-vRiptUAP.js.map +1 -0
- package/dist/ManageTranslation.css +1 -1
- package/dist/{ManageUser-DDzyd9jm.js → ManageUser-DZltBina.js} +224 -224
- package/dist/{ManageUser-DDzyd9jm.js.map → ManageUser-DZltBina.js.map} +1 -1
- package/dist/MemberProfileCard-D5CgkTdJ-D2NgDJl3.js +272 -0
- package/dist/MemberProfileCard-D5CgkTdJ-D2NgDJl3.js.map +1 -0
- package/dist/MobileAnalytics-BLOionG_.js +17301 -0
- package/dist/MobileAnalytics-BLOionG_.js.map +1 -0
- package/dist/MobileMenuManagement-68Wijb0X.js +220 -0
- package/dist/MobileMenuManagement-68Wijb0X.js.map +1 -0
- package/dist/MobileTypeEventConfigModal-CMcj7Ozp.js +752 -0
- package/dist/MobileTypeEventConfigModal-CMcj7Ozp.js.map +1 -0
- package/dist/NotificationFlywayQuery-BAHVjf6N.js +247 -0
- package/dist/NotificationFlywayQuery-BAHVjf6N.js.map +1 -0
- package/dist/{NotificationList-BMFpNUJG.js → NotificationList-DEyRZEuM.js} +2 -2
- package/dist/{NotificationList-BMFpNUJG.js.map → NotificationList-DEyRZEuM.js.map} +1 -1
- package/dist/OtherTypeEventConfigModal-stNmuSv_.js +1812 -0
- package/dist/OtherTypeEventConfigModal-stNmuSv_.js.map +1 -0
- package/dist/PaymentCreatePage-DfvSZ-kB-CckogYoe.js +482 -0
- package/dist/PaymentCreatePage-DfvSZ-kB-CckogYoe.js.map +1 -0
- package/dist/PaymentsPage-DMNjYWAJ-ChO9IXmk.js +157 -0
- package/dist/PaymentsPage-DMNjYWAJ-ChO9IXmk.js.map +1 -0
- package/dist/PermissionsModal-CCYkcKlC.js +151 -0
- package/dist/PermissionsModal-CCYkcKlC.js.map +1 -0
- package/dist/PickupBatchLinesEditor-CE2RuyJT-BPceiJr8.js +119 -0
- package/dist/PickupBatchLinesEditor-CE2RuyJT-BPceiJr8.js.map +1 -0
- package/dist/PickupCreatePage-B4O_-vE5-DoOo9nJO.js +783 -0
- package/dist/PickupCreatePage-B4O_-vE5-DoOo9nJO.js.map +1 -0
- package/dist/PickupsPage-D7zyioJB-bHKnARYw.js +818 -0
- package/dist/PickupsPage-D7zyioJB-bHKnARYw.js.map +1 -0
- package/dist/PmGuard-BZE-y4In-D_pUm5MP.js +599 -0
- package/dist/PmGuard-BZE-y4In-D_pUm5MP.js.map +1 -0
- package/dist/ProductEditPage-BVlVUCtD-BR-tJ5Wb.js +1305 -0
- package/dist/ProductEditPage-BVlVUCtD-BR-tJ5Wb.js.map +1 -0
- package/dist/ProductsPage-DvNHIeZt-BoOOJJtk.js +253 -0
- package/dist/ProductsPage-DvNHIeZt-BoOOJJtk.js.map +1 -0
- package/dist/PurchaseCreatePage-Cq_i9snz-DRtHHFWw.js +675 -0
- package/dist/PurchaseCreatePage-Cq_i9snz-DRtHHFWw.js.map +1 -0
- package/dist/PurchaseRequestDetailPage-CA9KFOfE-CtjG4Gx6.js +1577 -0
- package/dist/PurchaseRequestDetailPage-CA9KFOfE-CtjG4Gx6.js.map +1 -0
- package/dist/PurchaseRequestsPage-DS9i4o0--TpoxA5Kd.js +279 -0
- package/dist/PurchaseRequestsPage-DS9i4o0--TpoxA5Kd.js.map +1 -0
- package/dist/PurchasesPage-DgL5T6BY-DePUuE9l.js +293 -0
- package/dist/PurchasesPage-DgL5T6BY-DePUuE9l.js.map +1 -0
- package/dist/QueryBuilder-CXaBe6sr.js +478 -0
- package/dist/QueryBuilder-CXaBe6sr.js.map +1 -0
- package/dist/{RoleManagement-DEiBNfT8.js → RoleManagement-s8iNx2Mu.js} +145 -155
- package/dist/RoleManagement-s8iNx2Mu.js.map +1 -0
- package/dist/Roles-BIyiic67.js +14 -0
- package/dist/Roles-BIyiic67.js.map +1 -0
- package/dist/SaleCreatePage-CZnIOydv-DKBw-qp7.js +544 -0
- package/dist/SaleCreatePage-CZnIOydv-DKBw-qp7.js.map +1 -0
- package/dist/SalesPage-DPIRrC_O-M8rqnK7z.js +315 -0
- package/dist/SalesPage-DPIRrC_O-M8rqnK7z.js.map +1 -0
- package/dist/SettingsPage-BC_R6Z-Q-CKNt9zRu.js +676 -0
- package/dist/SettingsPage-BC_R6Z-Q-CKNt9zRu.js.map +1 -0
- package/dist/ShowFlywayQuery-D10Olk5Z.js +154 -0
- package/dist/ShowFlywayQuery-D10Olk5Z.js.map +1 -0
- package/dist/{ShowFlywayQuery-DVRCd384.js → ShowFlywayQuery-DIOUdYfG.js} +170 -123
- package/dist/ShowFlywayQuery-DIOUdYfG.js.map +1 -0
- package/dist/ShowQueryHistory-DRBKYDKk.js +313 -0
- package/dist/ShowQueryHistory-DRBKYDKk.js.map +1 -0
- package/dist/StorageUnitsPage-BDRkdCjW-UF64rf7q.js +728 -0
- package/dist/StorageUnitsPage-BDRkdCjW-UF64rf7q.js.map +1 -0
- package/dist/SubMenu-BdMTYtC1.js +319 -0
- package/dist/SubMenu-BdMTYtC1.js.map +1 -0
- package/dist/TransactionsPage-CqWTMNU8-Df6eGFDW.js +746 -0
- package/dist/TransactionsPage-CqWTMNU8-Df6eGFDW.js.map +1 -0
- package/dist/TransferCreatePage-DF7FZaTJ-CL79V3aR.js +315 -0
- package/dist/TransferCreatePage-DF7FZaTJ-CL79V3aR.js.map +1 -0
- package/dist/TransfersPage-CGrRFaBF-cTwBUv0o.js +476 -0
- package/dist/TransfersPage-CGrRFaBF-cTwBUv0o.js.map +1 -0
- package/dist/TypeConfiguration-JbRCN6GR.js +114 -0
- package/dist/TypeConfiguration-JbRCN6GR.js.map +1 -0
- package/dist/{UserList-Bc8gYxRL.js → UserList-L41Xw0Q6.js} +253 -236
- package/dist/{UserList-Bc8gYxRL.js.map → UserList-L41Xw0Q6.js.map} +1 -1
- package/dist/Users-CsJ08Kjm.js.map +1 -1
- package/dist/VialsPage-rvvXjgZG-Oqo1v6kQ.js +321 -0
- package/dist/VialsPage-rvvXjgZG-Oqo1v6kQ.js.map +1 -0
- package/dist/constants-DpXnLsAB-D6lN5cjK.js +445 -0
- package/dist/constants-DpXnLsAB-D6lN5cjK.js.map +1 -0
- package/dist/{dashboardLayoutUtils-D1xCAxp3.js → dashboardLayoutUtils-CJivzaU1.js} +95 -92
- package/dist/dashboardLayoutUtils-CJivzaU1.js.map +1 -0
- package/dist/format-UOyOu75i-D0GyylyQ.js +63 -0
- package/dist/format-UOyOu75i-D0GyylyQ.js.map +1 -0
- package/dist/index.css +1 -1
- package/dist/index.js +1 -1
- package/dist/index.lib-ETRQOzvE.js +894 -0
- package/dist/index.lib-ETRQOzvE.js.map +1 -0
- package/dist/listValueStore-BFQtDYIR-Bj0yX145.js +36 -0
- package/dist/listValueStore-BFQtDYIR-Bj0yX145.js.map +1 -0
- package/dist/useFieldErrors-hDG8ox_x-DbSAzrGo.js +28 -0
- package/dist/useFieldErrors-hDG8ox_x-DbSAzrGo.js.map +1 -0
- package/dist/validation-BzlHnL-r-CCJm2utQ.js +125 -0
- package/dist/validation-BzlHnL-r-CCJm2utQ.js.map +1 -0
- package/package.json +4 -3
- package/dist/AccessRights-Zm8Obm4N.js +0 -1284
- package/dist/AccessRights-Zm8Obm4N.js.map +0 -1
- package/dist/AddEditQueryBuilder-Brdnm6rQ.js +0 -313
- package/dist/AddEditQueryBuilder-Brdnm6rQ.js.map +0 -1
- package/dist/AddLabelModal-DFllBVcd.js +0 -734
- package/dist/AddLabelModal-DFllBVcd.js.map +0 -1
- package/dist/AddMenuConfiguration-Ce91MhnU.js +0 -8547
- package/dist/AddMenuConfiguration-Ce91MhnU.js.map +0 -1
- package/dist/AppModal-CtG2GjD_.js +0 -428
- package/dist/AppModal-CtG2GjD_.js.map +0 -1
- package/dist/ChangePasswordModalCore-DutQAZOx.js.map +0 -1
- package/dist/ConditionConfig-B4Ffpgj3.js +0 -395
- package/dist/ConditionConfig-B4Ffpgj3.js.map +0 -1
- package/dist/ConditionConfig.css +0 -1
- package/dist/EventConfigurations-BJcURufo.js +0 -449
- package/dist/EventConfigurations-BJcURufo.js.map +0 -1
- package/dist/EventsExceptionModal-BlZtBQoR.js +0 -200
- package/dist/EventsExceptionModal-BlZtBQoR.js.map +0 -1
- package/dist/EventsSkeleton-DK6JDKAK.js +0 -83
- package/dist/EventsSkeleton-DK6JDKAK.js.map +0 -1
- package/dist/FeatureMenu-C3503UIX.js +0 -265
- package/dist/FeatureMenu-C3503UIX.js.map +0 -1
- package/dist/FlywayQuery-Cx2sly6g.js +0 -169
- package/dist/FlywayQuery-Cx2sly6g.js.map +0 -1
- package/dist/ImmunizationConfigurationBase-DLQVSNnt.js +0 -5895
- package/dist/ImmunizationConfigurationBase-DLQVSNnt.js.map +0 -1
- package/dist/ImmunizationConfigurationsList-DdSZicTP.js +0 -344
- package/dist/ImmunizationConfigurationsList-DdSZicTP.js.map +0 -1
- package/dist/LanguagesModal-D6VfaGrl.js +0 -394
- package/dist/LanguagesModal-D6VfaGrl.js.map +0 -1
- package/dist/ManageDynamicFeature-dt096fyj.js +0 -4189
- package/dist/ManageDynamicFeature-dt096fyj.js.map +0 -1
- package/dist/ManageEventConfiguration-BpSJszSX.js +0 -1017
- package/dist/ManageEventConfiguration-BpSJszSX.js.map +0 -1
- package/dist/ManageTranslation-B4C9-lWD.js +0 -625
- package/dist/ManageTranslation-B4C9-lWD.js.map +0 -1
- package/dist/MobileMenuManagement-Cf8IZlla.js +0 -108
- package/dist/MobileMenuManagement-Cf8IZlla.js.map +0 -1
- package/dist/MobileTypeEventConfigModal-DUkUYACe.js +0 -783
- package/dist/MobileTypeEventConfigModal-DUkUYACe.js.map +0 -1
- package/dist/NotificationFlywayQuery-BY8Zzml_.js +0 -244
- package/dist/NotificationFlywayQuery-BY8Zzml_.js.map +0 -1
- package/dist/OtherTypeEventConfigModal-CYBfr2XE.js +0 -2046
- package/dist/OtherTypeEventConfigModal-CYBfr2XE.js.map +0 -1
- package/dist/QueryBuilder-z7eqfd7D.js +0 -383
- package/dist/QueryBuilder-z7eqfd7D.js.map +0 -1
- package/dist/RoleManagement-DEiBNfT8.js.map +0 -1
- package/dist/ShowFlywayQuery-DVRCd384.js.map +0 -1
- package/dist/ShowFlywayQuery-tj42YQAS.js +0 -130
- package/dist/ShowFlywayQuery-tj42YQAS.js.map +0 -1
- package/dist/ShowQueryHistory-BDN0tzHg.js +0 -190
- package/dist/ShowQueryHistory-BDN0tzHg.js.map +0 -1
- package/dist/SubMenu-B072oEGb.js +0 -191
- package/dist/SubMenu-B072oEGb.js.map +0 -1
- package/dist/TypeConfiguration-C3xoP2Nb.js +0 -117
- package/dist/TypeConfiguration-C3xoP2Nb.js.map +0 -1
- package/dist/dashboardLayoutUtils-D1xCAxp3.js.map +0 -1
- package/dist/index.lib-C3fwoM3y.js +0 -820
- package/dist/index.lib-C3fwoM3y.js.map +0 -1
|
@@ -0,0 +1,728 @@
|
|
|
1
|
+
import { B as Ve, z as Ye, V as je, G as ge, g as Ge, x as Qe, k as R, _ as Ze, v as _e, b as He } from "./ImmunizationConfigurationBase-aUtx0JEe.js";
|
|
2
|
+
import { k as Ce } from "./constants-DpXnLsAB-D6lN5cjK.js";
|
|
3
|
+
import { t as Xe } from "./format-UOyOu75i-D0GyylyQ.js";
|
|
4
|
+
import { v as Je, i as Ke, r as L, C as ei, g as ii, _ as ti } from "./validation-BzlHnL-r-CCJm2utQ.js";
|
|
5
|
+
import { n as fe } from "./useFieldErrors-hDG8ox_x-DbSAzrGo.js";
|
|
6
|
+
import { X as ni, Y as ri, Z as ai, Q as li, q as oi } from "./PmGuard-BZE-y4In-D_pUm5MP.js";
|
|
7
|
+
import { m as si } from "./listValueStore-BFQtDYIR-Bj0yX145.js";
|
|
8
|
+
import { d as ui } from "./FacilityPicker-DYl_PDyt-Cbwo2tAY.js";
|
|
9
|
+
import { useState as p } from "react";
|
|
10
|
+
import { jsxs as n, jsx as i, Fragment as j } from "react/jsx-runtime";
|
|
11
|
+
import { Box as Te, Alert as A, TableHead as ye, TableRow as B, TableCell as a, TableBody as we, Skeleton as di, Button as g, Typography as w, Chip as ve, Stack as v, FormControlLabel as xe, Dialog as be, DialogTitle as Me, DialogContent as ke, Divider as ci, TextField as y, Checkbox as pi, DialogActions as Ie, Table as mi } from "@mui/material";
|
|
12
|
+
import { v4 as Ne } from "uuid";
|
|
13
|
+
import $e from "@mui/icons-material/AddRounded";
|
|
14
|
+
import hi from "@mui/icons-material/RefreshRounded";
|
|
15
|
+
import gi from "@/views/custom-components/CustomSwitch";
|
|
16
|
+
import Ci from "@mui/icons-material/WarehouseRounded";
|
|
17
|
+
import fi from "@mui/icons-material/CheckCircleRounded";
|
|
18
|
+
import Ti from "@mui/icons-material/DeviceThermostatRounded";
|
|
19
|
+
import Ae from "@mui/icons-material/WarningAmberRounded";
|
|
20
|
+
var yi = [{
|
|
21
|
+
value: "FACILITY",
|
|
22
|
+
label: "Facility"
|
|
23
|
+
}];
|
|
24
|
+
function Di() {
|
|
25
|
+
var ce, pe, me, he;
|
|
26
|
+
let W = ni().has("update.manage.productManagement.storageUnit"), { storageUnitTypes: q } = si(), Be = (e) => {
|
|
27
|
+
var s;
|
|
28
|
+
return e ? ((s = q.find((r) => r.value === e)) == null ? void 0 : s.label) ?? Ce(e) : "";
|
|
29
|
+
}, [x, We] = p([]), [qe, D] = p({}), [G, Q] = p(!1), [Z, b] = p(""), [Fe, k] = p(!1), [F, _] = p(null), [t, m] = p(X()), [H, Se] = p(!1), l = fe(), E = fe();
|
|
30
|
+
function X() {
|
|
31
|
+
return {
|
|
32
|
+
id: "",
|
|
33
|
+
ownerType: "FACILITY",
|
|
34
|
+
ownerId: "",
|
|
35
|
+
unitName: "",
|
|
36
|
+
unitCode: "",
|
|
37
|
+
unitType: "",
|
|
38
|
+
make: "",
|
|
39
|
+
model: "",
|
|
40
|
+
comments: "",
|
|
41
|
+
operatingTempMinCelsius: "",
|
|
42
|
+
operatingTempMaxCelsius: "",
|
|
43
|
+
isActive: !0
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
async function S() {
|
|
47
|
+
var e, s;
|
|
48
|
+
Q(!0), b("");
|
|
49
|
+
try {
|
|
50
|
+
let r = await Ge({ activeOnly: !1 });
|
|
51
|
+
We(r);
|
|
52
|
+
let u = Array.from(new Set(r.map((T) => T.ownerId).filter(Boolean)));
|
|
53
|
+
if (u.length === 0) D({});
|
|
54
|
+
else try {
|
|
55
|
+
let T = await Qe(u), h = {};
|
|
56
|
+
T.forEach((c) => {
|
|
57
|
+
h[c.id] = c.name;
|
|
58
|
+
}), D(h);
|
|
59
|
+
} catch {
|
|
60
|
+
D({});
|
|
61
|
+
}
|
|
62
|
+
} catch (r) {
|
|
63
|
+
let u = ((s = (e = r == null ? void 0 : r.response) == null ? void 0 : e.data) == null ? void 0 : s.message) ?? (r == null ? void 0 : r.message) ?? "Failed to load storage units";
|
|
64
|
+
b(u), R({
|
|
65
|
+
message: u,
|
|
66
|
+
type: "error"
|
|
67
|
+
});
|
|
68
|
+
} finally {
|
|
69
|
+
Q(!1);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
ri("view.manage.productManagement.storageUnit", () => {
|
|
73
|
+
S();
|
|
74
|
+
}, []);
|
|
75
|
+
function ze(e) {
|
|
76
|
+
return qe[e] ?? e;
|
|
77
|
+
}
|
|
78
|
+
function J() {
|
|
79
|
+
_(null), m({
|
|
80
|
+
...X(),
|
|
81
|
+
id: Ne()
|
|
82
|
+
}), l.reset(), b(""), k(!0);
|
|
83
|
+
}
|
|
84
|
+
function Ue(e) {
|
|
85
|
+
_(e), l.reset(), b(""), m({
|
|
86
|
+
id: e.id,
|
|
87
|
+
ownerType: e.ownerType ?? "FACILITY",
|
|
88
|
+
ownerId: e.ownerId ?? "",
|
|
89
|
+
unitName: e.unitName ?? "",
|
|
90
|
+
unitCode: e.unitCode ?? "",
|
|
91
|
+
unitType: e.unitType ?? "",
|
|
92
|
+
make: e.make ?? "",
|
|
93
|
+
model: e.model ?? "",
|
|
94
|
+
comments: e.comments ?? "",
|
|
95
|
+
operatingTempMinCelsius: e.operatingTempMinCelsius ?? "",
|
|
96
|
+
operatingTempMaxCelsius: e.operatingTempMaxCelsius ?? "",
|
|
97
|
+
isActive: e.isActive !== !1
|
|
98
|
+
}), k(!0);
|
|
99
|
+
}
|
|
100
|
+
let K = Je(t.operatingTempMinCelsius, t.operatingTempMaxCelsius), ee = Ke(t.unitCode, { required: !0 }), ie = (t.unitCode || "").trim().toUpperCase(), Re = !ee && ie && t.ownerId && x.some((e) => e.id !== t.id && e.ownerId === t.ownerId && (e.unitCode || "").toUpperCase() === ie), Le = t.unitType && !q.some((e) => e.value === t.unitType) ? [...q, {
|
|
101
|
+
value: t.unitType,
|
|
102
|
+
label: Ce(t.unitType)
|
|
103
|
+
}] : q, o = {
|
|
104
|
+
ownerType: L(t.ownerType, "Owner type"),
|
|
105
|
+
ownerId: L(t.ownerId, "Facility"),
|
|
106
|
+
unitName: L(t.unitName, "Name"),
|
|
107
|
+
unitCode: ee || (Re ? "Code is already in use for this facility." : ""),
|
|
108
|
+
unitType: L(t.unitType, "Type"),
|
|
109
|
+
operatingTempMinCelsius: K.min,
|
|
110
|
+
operatingTempMaxCelsius: K.max
|
|
111
|
+
}, te = ei(o);
|
|
112
|
+
async function De() {
|
|
113
|
+
var e, s, r, u, T;
|
|
114
|
+
if (!te) {
|
|
115
|
+
l.markAllTouched(), b("Please fix the highlighted fields.");
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
try {
|
|
119
|
+
await Ze({
|
|
120
|
+
id: t.id,
|
|
121
|
+
ownerId: t.ownerId,
|
|
122
|
+
unitName: t.unitName.trim(),
|
|
123
|
+
unitCode: t.unitCode.trim().toUpperCase(),
|
|
124
|
+
unitType: t.unitType,
|
|
125
|
+
make: ((e = t.make) == null ? void 0 : e.trim()) || null,
|
|
126
|
+
model: ((s = t.model) == null ? void 0 : s.trim()) || null,
|
|
127
|
+
comments: ((r = t.comments) == null ? void 0 : r.trim()) || null,
|
|
128
|
+
operatingTempMinCelsius: t.operatingTempMinCelsius === "" ? null : Number(t.operatingTempMinCelsius),
|
|
129
|
+
operatingTempMaxCelsius: t.operatingTempMaxCelsius === "" ? null : Number(t.operatingTempMaxCelsius),
|
|
130
|
+
isActive: t.isActive
|
|
131
|
+
}), R({
|
|
132
|
+
message: "Storage unit saved.",
|
|
133
|
+
type: "success"
|
|
134
|
+
}), k(!1), await S();
|
|
135
|
+
} catch (h) {
|
|
136
|
+
let c = ((T = (u = h == null ? void 0 : h.response) == null ? void 0 : u.data) == null ? void 0 : T.message) ?? (h == null ? void 0 : h.message) ?? "Failed to save storage unit";
|
|
137
|
+
b(c), R({
|
|
138
|
+
message: c,
|
|
139
|
+
type: "error"
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
let [d, O] = p({
|
|
144
|
+
open: !1,
|
|
145
|
+
unit: null
|
|
146
|
+
}), [M, P] = p({
|
|
147
|
+
temperatureCelsius: "",
|
|
148
|
+
notes: ""
|
|
149
|
+
}), [ne, V] = p("input"), [C, re] = p(null), [f, z] = p(!1), [ae, I] = p("");
|
|
150
|
+
function Ee(e) {
|
|
151
|
+
O({
|
|
152
|
+
open: !0,
|
|
153
|
+
unit: e
|
|
154
|
+
}), P({
|
|
155
|
+
temperatureCelsius: "",
|
|
156
|
+
notes: ""
|
|
157
|
+
}), V("input"), re(null), I(""), E.reset();
|
|
158
|
+
}
|
|
159
|
+
function le() {
|
|
160
|
+
f || O({
|
|
161
|
+
open: !1,
|
|
162
|
+
unit: null
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
let N = M.temperatureCelsius, Y = ii(N, { required: !0 }), oe = ti(N, (ce = d.unit) == null ? void 0 : ce.operatingTempMinCelsius, (pe = d.unit) == null ? void 0 : pe.operatingTempMaxCelsius), se = !Y, ue = !!Y && (N !== "" || E.show("temperatureCelsius")), Oe = ((me = d.unit) == null ? void 0 : me.operatingTempMinCelsius) != null && ((he = d.unit) == null ? void 0 : he.operatingTempMaxCelsius) != null ? ` This unit operates between ${d.unit.operatingTempMinCelsius}°C and ${d.unit.operatingTempMaxCelsius}°C.` : "";
|
|
166
|
+
async function Pe() {
|
|
167
|
+
var e, s;
|
|
168
|
+
if (!(!d.unit || !se)) {
|
|
169
|
+
z(!0), I("");
|
|
170
|
+
try {
|
|
171
|
+
re(await _e(d.unit.id, Number(N))), V("result");
|
|
172
|
+
} catch (r) {
|
|
173
|
+
I(((s = (e = r == null ? void 0 : r.response) == null ? void 0 : e.data) == null ? void 0 : s.message) ?? (r == null ? void 0 : r.message) ?? "Failed to evaluate temperature");
|
|
174
|
+
} finally {
|
|
175
|
+
z(!1);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
async function de(e) {
|
|
180
|
+
var s, r, u, T, h;
|
|
181
|
+
if (d.unit) {
|
|
182
|
+
z(!0), I("");
|
|
183
|
+
try {
|
|
184
|
+
let c = ((u = (r = await He(d.unit.id, {
|
|
185
|
+
id: Ne(),
|
|
186
|
+
temperatureCelsius: Number(N),
|
|
187
|
+
wasteOutOfRange: e,
|
|
188
|
+
notes: ((s = M.notes) == null ? void 0 : s.trim()) || null
|
|
189
|
+
})) == null ? void 0 : r.affectedBatches) == null ? void 0 : u.length) ?? 0;
|
|
190
|
+
R({
|
|
191
|
+
message: e && c > 0 ? `Reading logged. ${c} ${c === 1 ? "batch" : "batches"} marked as wastage.` : "Temperature reading logged.",
|
|
192
|
+
type: "success"
|
|
193
|
+
}), O({
|
|
194
|
+
open: !1,
|
|
195
|
+
unit: null
|
|
196
|
+
}), await S();
|
|
197
|
+
} catch (c) {
|
|
198
|
+
I(((h = (T = c == null ? void 0 : c.response) == null ? void 0 : T.data) == null ? void 0 : h.message) ?? (c == null ? void 0 : c.message) ?? "Failed to log temperature");
|
|
199
|
+
} finally {
|
|
200
|
+
z(!1);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
let $ = (C == null ? void 0 : C.affectedBatches) ?? [], U = H ? x : x.filter((e) => e.isActive !== !1);
|
|
205
|
+
return /* @__PURE__ */ n(Te, { children: [/* @__PURE__ */ i(ai, {}), /* @__PURE__ */ n(li, {
|
|
206
|
+
perm: "view.manage.productManagement.storageUnit",
|
|
207
|
+
children: [
|
|
208
|
+
/* @__PURE__ */ n(oi, {
|
|
209
|
+
title: "Storage Units",
|
|
210
|
+
subtitle: "Cold-chain equipment for storing vaccine and product batches. Currently managed per facility.",
|
|
211
|
+
chips: ["Catalog", "Facility-owned"],
|
|
212
|
+
actions: /* @__PURE__ */ n(v, {
|
|
213
|
+
direction: "row",
|
|
214
|
+
spacing: 1,
|
|
215
|
+
children: [/* @__PURE__ */ i(g, {
|
|
216
|
+
variant: "outlined",
|
|
217
|
+
startIcon: /* @__PURE__ */ i(hi, {}),
|
|
218
|
+
onClick: () => void S(),
|
|
219
|
+
children: "Refresh"
|
|
220
|
+
}), W ? /* @__PURE__ */ i(g, {
|
|
221
|
+
variant: "contained",
|
|
222
|
+
startIcon: /* @__PURE__ */ i($e, {}),
|
|
223
|
+
onClick: J,
|
|
224
|
+
children: "New Storage Unit"
|
|
225
|
+
}) : null]
|
|
226
|
+
}),
|
|
227
|
+
children: [Z ? /* @__PURE__ */ i(A, {
|
|
228
|
+
severity: "error",
|
|
229
|
+
sx: { mb: 2 },
|
|
230
|
+
children: Z
|
|
231
|
+
}) : null, /* @__PURE__ */ i(Ve, {
|
|
232
|
+
eyebrow: "Cold-chain network",
|
|
233
|
+
title: "Storage units",
|
|
234
|
+
subtitle: G ? "Loading…" : `${U.length} ${U.length === 1 ? "unit" : "units"}`,
|
|
235
|
+
actions: /* @__PURE__ */ i(xe, {
|
|
236
|
+
control: /* @__PURE__ */ i(gi, {
|
|
237
|
+
checked: H,
|
|
238
|
+
onChange: (e) => Se(e.target.checked)
|
|
239
|
+
}),
|
|
240
|
+
label: /* @__PURE__ */ i(w, {
|
|
241
|
+
variant: "body2",
|
|
242
|
+
sx: { fontWeight: 600 },
|
|
243
|
+
children: "Show inactive"
|
|
244
|
+
}),
|
|
245
|
+
labelPlacement: "start",
|
|
246
|
+
sx: {
|
|
247
|
+
mr: 0.5,
|
|
248
|
+
ml: 0
|
|
249
|
+
}
|
|
250
|
+
}),
|
|
251
|
+
children: /* @__PURE__ */ n(Ye, { children: [/* @__PURE__ */ i(ye, { children: /* @__PURE__ */ n(B, { children: [
|
|
252
|
+
/* @__PURE__ */ i(a, { children: "Code" }),
|
|
253
|
+
/* @__PURE__ */ i(a, { children: "Name" }),
|
|
254
|
+
/* @__PURE__ */ i(a, { children: "Facility" }),
|
|
255
|
+
/* @__PURE__ */ i(a, { children: "Type" }),
|
|
256
|
+
/* @__PURE__ */ i(a, { children: "Operating range" }),
|
|
257
|
+
/* @__PURE__ */ i(a, { children: "Status" }),
|
|
258
|
+
/* @__PURE__ */ i(a, {
|
|
259
|
+
align: "right",
|
|
260
|
+
children: "Action"
|
|
261
|
+
})
|
|
262
|
+
] }) }), /* @__PURE__ */ i(we, { children: G ? Array.from({ length: 4 }).map((e, s) => /* @__PURE__ */ i(B, { children: Array.from({ length: 7 }).map((r, u) => /* @__PURE__ */ i(a, { children: /* @__PURE__ */ i(di, { height: 22 }) }, u)) }, s)) : U.length === 0 ? /* @__PURE__ */ i(je, {
|
|
263
|
+
colSpan: 7,
|
|
264
|
+
icon: Ci,
|
|
265
|
+
title: x.length === 0 ? "No storage units yet" : "No active storage units",
|
|
266
|
+
hint: x.length === 0 ? "You need storage equipment to keep vaccine batches safe." : "Turn on “Show inactive” to see deactivated storage units.",
|
|
267
|
+
action: x.length === 0 && W ? /* @__PURE__ */ i(g, {
|
|
268
|
+
variant: "contained",
|
|
269
|
+
size: "small",
|
|
270
|
+
startIcon: /* @__PURE__ */ i($e, {}),
|
|
271
|
+
onClick: J,
|
|
272
|
+
children: "Create first unit"
|
|
273
|
+
}) : null
|
|
274
|
+
}) : U.map((e) => /* @__PURE__ */ n(B, {
|
|
275
|
+
hover: !0,
|
|
276
|
+
children: [
|
|
277
|
+
/* @__PURE__ */ i(a, { children: /* @__PURE__ */ i(Te, {
|
|
278
|
+
component: "span",
|
|
279
|
+
sx: {
|
|
280
|
+
display: "inline-flex",
|
|
281
|
+
px: 0.85,
|
|
282
|
+
py: 0.25,
|
|
283
|
+
borderRadius: 1,
|
|
284
|
+
bgcolor: "grey.100",
|
|
285
|
+
fontFamily: "monospace",
|
|
286
|
+
fontSize: "0.72rem",
|
|
287
|
+
fontWeight: 800
|
|
288
|
+
},
|
|
289
|
+
children: e.unitCode
|
|
290
|
+
}) }),
|
|
291
|
+
/* @__PURE__ */ i(a, { children: /* @__PURE__ */ i(w, {
|
|
292
|
+
variant: "body2",
|
|
293
|
+
sx: { fontWeight: 700 },
|
|
294
|
+
children: e.unitName
|
|
295
|
+
}) }),
|
|
296
|
+
/* @__PURE__ */ i(a, { children: /* @__PURE__ */ i(w, {
|
|
297
|
+
variant: "caption",
|
|
298
|
+
color: "text.secondary",
|
|
299
|
+
children: ze(e.ownerId)
|
|
300
|
+
}) }),
|
|
301
|
+
/* @__PURE__ */ i(a, { children: /* @__PURE__ */ i(ve, {
|
|
302
|
+
size: "small",
|
|
303
|
+
label: Be(e.unitType),
|
|
304
|
+
variant: "outlined",
|
|
305
|
+
sx: {
|
|
306
|
+
fontWeight: 700,
|
|
307
|
+
borderRadius: 1.5,
|
|
308
|
+
height: 22
|
|
309
|
+
}
|
|
310
|
+
}) }),
|
|
311
|
+
/* @__PURE__ */ i(a, { children: e.operatingTempMinCelsius != null && e.operatingTempMaxCelsius != null ? /* @__PURE__ */ n(w, {
|
|
312
|
+
variant: "caption",
|
|
313
|
+
sx: {
|
|
314
|
+
fontWeight: 700,
|
|
315
|
+
fontVariantNumeric: "tabular-nums"
|
|
316
|
+
},
|
|
317
|
+
children: [
|
|
318
|
+
e.operatingTempMinCelsius,
|
|
319
|
+
"°C → ",
|
|
320
|
+
e.operatingTempMaxCelsius,
|
|
321
|
+
"°C"
|
|
322
|
+
]
|
|
323
|
+
}) : /* @__PURE__ */ i(w, {
|
|
324
|
+
variant: "caption",
|
|
325
|
+
color: "text.disabled",
|
|
326
|
+
children: "—"
|
|
327
|
+
}) }),
|
|
328
|
+
/* @__PURE__ */ i(a, { children: /* @__PURE__ */ i(ve, {
|
|
329
|
+
size: "small",
|
|
330
|
+
label: e.isActive ? "Active" : "Inactive",
|
|
331
|
+
color: e.isActive ? "success" : "default",
|
|
332
|
+
variant: e.isActive ? "filled" : "outlined",
|
|
333
|
+
sx: {
|
|
334
|
+
fontWeight: 700,
|
|
335
|
+
borderRadius: 1.5,
|
|
336
|
+
height: 22
|
|
337
|
+
}
|
|
338
|
+
}) }),
|
|
339
|
+
/* @__PURE__ */ i(a, {
|
|
340
|
+
align: "right",
|
|
341
|
+
children: /* @__PURE__ */ n(v, {
|
|
342
|
+
direction: "row",
|
|
343
|
+
spacing: 1,
|
|
344
|
+
justifyContent: "flex-end",
|
|
345
|
+
children: [W ? /* @__PURE__ */ i(g, {
|
|
346
|
+
size: "small",
|
|
347
|
+
variant: "outlined",
|
|
348
|
+
color: "info",
|
|
349
|
+
startIcon: /* @__PURE__ */ i(Ti, {}),
|
|
350
|
+
onClick: () => Ee(e),
|
|
351
|
+
children: "Log temp"
|
|
352
|
+
}) : null, W ? /* @__PURE__ */ i(g, {
|
|
353
|
+
size: "small",
|
|
354
|
+
variant: "outlined",
|
|
355
|
+
onClick: () => Ue(e),
|
|
356
|
+
children: "Edit"
|
|
357
|
+
}) : null]
|
|
358
|
+
})
|
|
359
|
+
})
|
|
360
|
+
]
|
|
361
|
+
}, e.id)) })] })
|
|
362
|
+
})]
|
|
363
|
+
}),
|
|
364
|
+
/* @__PURE__ */ n(be, {
|
|
365
|
+
open: Fe,
|
|
366
|
+
onClose: () => k(!1),
|
|
367
|
+
fullWidth: !0,
|
|
368
|
+
maxWidth: "sm",
|
|
369
|
+
children: [
|
|
370
|
+
/* @__PURE__ */ i(Me, { children: F ? "Edit Storage Unit" : "New Storage Unit" }),
|
|
371
|
+
/* @__PURE__ */ i(ke, {
|
|
372
|
+
dividers: !0,
|
|
373
|
+
children: /* @__PURE__ */ n(v, {
|
|
374
|
+
spacing: 2,
|
|
375
|
+
sx: { pt: 1 },
|
|
376
|
+
children: [
|
|
377
|
+
/* @__PURE__ */ i(ge, {
|
|
378
|
+
label: "Owner Type",
|
|
379
|
+
required: !0,
|
|
380
|
+
disabled: !!F,
|
|
381
|
+
value: t.ownerType,
|
|
382
|
+
onChange: (e) => m({
|
|
383
|
+
...t,
|
|
384
|
+
ownerType: e,
|
|
385
|
+
ownerId: ""
|
|
386
|
+
}),
|
|
387
|
+
onBlur: l.onBlur("ownerType"),
|
|
388
|
+
error: l.show("ownerType") && !!o.ownerType,
|
|
389
|
+
helperText: l.show("ownerType") && o.ownerType ? o.ownerType : "Only Facility is available currently.",
|
|
390
|
+
options: yi
|
|
391
|
+
}),
|
|
392
|
+
/* @__PURE__ */ i(ui, {
|
|
393
|
+
required: !0,
|
|
394
|
+
disabled: !!F || t.ownerType !== "FACILITY",
|
|
395
|
+
value: t.ownerId,
|
|
396
|
+
onChange: (e) => m({
|
|
397
|
+
...t,
|
|
398
|
+
ownerId: e
|
|
399
|
+
}),
|
|
400
|
+
onBlur: l.onBlur("ownerId"),
|
|
401
|
+
error: l.show("ownerId") && !!o.ownerId,
|
|
402
|
+
helperText: l.show("ownerId") && o.ownerId ? o.ownerId : "Search by name. The owner cannot be changed once created."
|
|
403
|
+
}),
|
|
404
|
+
/* @__PURE__ */ i(ci, {}),
|
|
405
|
+
/* @__PURE__ */ i(y, {
|
|
406
|
+
required: !0,
|
|
407
|
+
label: "Unit name",
|
|
408
|
+
size: "small",
|
|
409
|
+
fullWidth: !0,
|
|
410
|
+
value: t.unitName,
|
|
411
|
+
onChange: (e) => {
|
|
412
|
+
let s = e.target.value, r = s.split(/\s+/).filter(Boolean).map((u) => u[0]).join("").toUpperCase().replace(/[^A-Z0-9_]/g, "");
|
|
413
|
+
m((u) => ({
|
|
414
|
+
...u,
|
|
415
|
+
unitName: s,
|
|
416
|
+
unitCode: F ? u.unitCode : r
|
|
417
|
+
}));
|
|
418
|
+
},
|
|
419
|
+
onBlur: l.onBlur("unitName"),
|
|
420
|
+
error: l.show("unitName") && !!o.unitName,
|
|
421
|
+
helperText: l.show("unitName") ? o.unitName : ""
|
|
422
|
+
}),
|
|
423
|
+
/* @__PURE__ */ i(y, {
|
|
424
|
+
required: !0,
|
|
425
|
+
label: "Unit code (unique within facility)",
|
|
426
|
+
size: "small",
|
|
427
|
+
fullWidth: !0,
|
|
428
|
+
value: t.unitCode,
|
|
429
|
+
onChange: (e) => m({
|
|
430
|
+
...t,
|
|
431
|
+
unitCode: e.target.value.toUpperCase()
|
|
432
|
+
}),
|
|
433
|
+
onBlur: l.onBlur("unitCode"),
|
|
434
|
+
error: l.show("unitCode") && !!o.unitCode,
|
|
435
|
+
helperText: l.show("unitCode") && o.unitCode ? o.unitCode : "Auto-generated from the name. Edit if needed to make it unique within this facility."
|
|
436
|
+
}),
|
|
437
|
+
/* @__PURE__ */ i(ge, {
|
|
438
|
+
label: "Type",
|
|
439
|
+
required: !0,
|
|
440
|
+
value: t.unitType,
|
|
441
|
+
onChange: (e) => m({
|
|
442
|
+
...t,
|
|
443
|
+
unitType: e
|
|
444
|
+
}),
|
|
445
|
+
onBlur: l.onBlur("unitType"),
|
|
446
|
+
error: l.show("unitType") && !!o.unitType,
|
|
447
|
+
options: Le
|
|
448
|
+
}),
|
|
449
|
+
/* @__PURE__ */ n(v, {
|
|
450
|
+
direction: "row",
|
|
451
|
+
spacing: 2,
|
|
452
|
+
children: [/* @__PURE__ */ i(y, {
|
|
453
|
+
label: "Make",
|
|
454
|
+
size: "small",
|
|
455
|
+
fullWidth: !0,
|
|
456
|
+
value: t.make,
|
|
457
|
+
onChange: (e) => m({
|
|
458
|
+
...t,
|
|
459
|
+
make: e.target.value
|
|
460
|
+
}),
|
|
461
|
+
helperText: "Example: Godrej, Vestfrost"
|
|
462
|
+
}), /* @__PURE__ */ i(y, {
|
|
463
|
+
label: "Model",
|
|
464
|
+
size: "small",
|
|
465
|
+
fullWidth: !0,
|
|
466
|
+
value: t.model,
|
|
467
|
+
onChange: (e) => m({
|
|
468
|
+
...t,
|
|
469
|
+
model: e.target.value
|
|
470
|
+
}),
|
|
471
|
+
helperText: "Example: GVR-100"
|
|
472
|
+
})]
|
|
473
|
+
}),
|
|
474
|
+
/* @__PURE__ */ n(v, {
|
|
475
|
+
direction: "row",
|
|
476
|
+
spacing: 2,
|
|
477
|
+
children: [/* @__PURE__ */ i(y, {
|
|
478
|
+
label: "Min °C",
|
|
479
|
+
size: "small",
|
|
480
|
+
type: "number",
|
|
481
|
+
fullWidth: !0,
|
|
482
|
+
inputProps: {
|
|
483
|
+
step: "0.1",
|
|
484
|
+
min: -90,
|
|
485
|
+
max: 30
|
|
486
|
+
},
|
|
487
|
+
value: t.operatingTempMinCelsius,
|
|
488
|
+
onChange: (e) => m({
|
|
489
|
+
...t,
|
|
490
|
+
operatingTempMinCelsius: e.target.value
|
|
491
|
+
}),
|
|
492
|
+
onBlur: l.onBlur("operatingTempMinCelsius"),
|
|
493
|
+
error: l.show("operatingTempMinCelsius") && !!o.operatingTempMinCelsius,
|
|
494
|
+
helperText: l.show("operatingTempMinCelsius") && o.operatingTempMinCelsius ? o.operatingTempMinCelsius : "Allowed range: −90°C to +30°C"
|
|
495
|
+
}), /* @__PURE__ */ i(y, {
|
|
496
|
+
label: "Max °C",
|
|
497
|
+
size: "small",
|
|
498
|
+
type: "number",
|
|
499
|
+
fullWidth: !0,
|
|
500
|
+
inputProps: {
|
|
501
|
+
step: "0.1",
|
|
502
|
+
min: -90,
|
|
503
|
+
max: 30
|
|
504
|
+
},
|
|
505
|
+
value: t.operatingTempMaxCelsius,
|
|
506
|
+
onChange: (e) => m({
|
|
507
|
+
...t,
|
|
508
|
+
operatingTempMaxCelsius: e.target.value
|
|
509
|
+
}),
|
|
510
|
+
onBlur: l.onBlur("operatingTempMaxCelsius"),
|
|
511
|
+
error: l.show("operatingTempMaxCelsius") && !!o.operatingTempMaxCelsius,
|
|
512
|
+
helperText: l.show("operatingTempMaxCelsius") && o.operatingTempMaxCelsius ? o.operatingTempMaxCelsius : "Allowed range: −90°C to +30°C"
|
|
513
|
+
})]
|
|
514
|
+
}),
|
|
515
|
+
/* @__PURE__ */ i(y, {
|
|
516
|
+
label: "Comments",
|
|
517
|
+
size: "small",
|
|
518
|
+
multiline: !0,
|
|
519
|
+
minRows: 2,
|
|
520
|
+
fullWidth: !0,
|
|
521
|
+
value: t.comments,
|
|
522
|
+
onChange: (e) => m({
|
|
523
|
+
...t,
|
|
524
|
+
comments: e.target.value
|
|
525
|
+
}),
|
|
526
|
+
helperText: "Notes about placement, maintenance schedule, or other details."
|
|
527
|
+
}),
|
|
528
|
+
/* @__PURE__ */ i(xe, {
|
|
529
|
+
control: /* @__PURE__ */ i(pi, {
|
|
530
|
+
checked: t.isActive,
|
|
531
|
+
onChange: (e) => m({
|
|
532
|
+
...t,
|
|
533
|
+
isActive: e.target.checked
|
|
534
|
+
})
|
|
535
|
+
}),
|
|
536
|
+
label: "Active"
|
|
537
|
+
})
|
|
538
|
+
]
|
|
539
|
+
})
|
|
540
|
+
}),
|
|
541
|
+
/* @__PURE__ */ n(Ie, { children: [/* @__PURE__ */ i(g, {
|
|
542
|
+
onClick: () => k(!1),
|
|
543
|
+
children: "Cancel"
|
|
544
|
+
}), /* @__PURE__ */ i(g, {
|
|
545
|
+
variant: "contained",
|
|
546
|
+
disabled: !te,
|
|
547
|
+
onClick: () => void De(),
|
|
548
|
+
children: "Save"
|
|
549
|
+
})] })
|
|
550
|
+
]
|
|
551
|
+
}),
|
|
552
|
+
/* @__PURE__ */ n(be, {
|
|
553
|
+
open: d.open,
|
|
554
|
+
onClose: le,
|
|
555
|
+
fullWidth: !0,
|
|
556
|
+
maxWidth: "sm",
|
|
557
|
+
children: [
|
|
558
|
+
/* @__PURE__ */ n(Me, { children: ["Log Temperature", d.unit ? /* @__PURE__ */ n(w, {
|
|
559
|
+
variant: "caption",
|
|
560
|
+
color: "text.secondary",
|
|
561
|
+
sx: {
|
|
562
|
+
display: "block",
|
|
563
|
+
fontWeight: 600
|
|
564
|
+
},
|
|
565
|
+
children: [d.unit.unitName, d.unit.operatingTempMinCelsius != null && d.unit.operatingTempMaxCelsius != null ? ` · operates ${d.unit.operatingTempMinCelsius}°C → ${d.unit.operatingTempMaxCelsius}°C` : ""]
|
|
566
|
+
}) : null] }),
|
|
567
|
+
/* @__PURE__ */ n(ke, {
|
|
568
|
+
dividers: !0,
|
|
569
|
+
children: [ae ? /* @__PURE__ */ i(A, {
|
|
570
|
+
severity: "error",
|
|
571
|
+
sx: { mb: 2 },
|
|
572
|
+
children: ae
|
|
573
|
+
}) : null, ne === "input" ? /* @__PURE__ */ n(v, {
|
|
574
|
+
spacing: 2,
|
|
575
|
+
sx: { pt: 1 },
|
|
576
|
+
children: [
|
|
577
|
+
/* @__PURE__ */ i(w, {
|
|
578
|
+
variant: "body2",
|
|
579
|
+
color: "text.secondary",
|
|
580
|
+
children: "Record the current temperature reading for this storage unit. We will check whether any stored product batch falls outside its required range."
|
|
581
|
+
}),
|
|
582
|
+
/* @__PURE__ */ i(y, {
|
|
583
|
+
required: !0,
|
|
584
|
+
autoFocus: !0,
|
|
585
|
+
label: "Temperature (°C)",
|
|
586
|
+
size: "small",
|
|
587
|
+
type: "number",
|
|
588
|
+
fullWidth: !0,
|
|
589
|
+
inputProps: {
|
|
590
|
+
step: "0.1",
|
|
591
|
+
min: -90,
|
|
592
|
+
max: 30
|
|
593
|
+
},
|
|
594
|
+
value: M.temperatureCelsius,
|
|
595
|
+
onChange: (e) => P({
|
|
596
|
+
...M,
|
|
597
|
+
temperatureCelsius: e.target.value
|
|
598
|
+
}),
|
|
599
|
+
onBlur: E.onBlur("temperatureCelsius"),
|
|
600
|
+
error: ue,
|
|
601
|
+
helperText: ue ? Y : `Enter the reading in degrees Celsius.${Oe}`
|
|
602
|
+
}),
|
|
603
|
+
oe ? /* @__PURE__ */ i(A, {
|
|
604
|
+
severity: "warning",
|
|
605
|
+
icon: /* @__PURE__ */ i(Ae, {}),
|
|
606
|
+
children: oe
|
|
607
|
+
}) : null,
|
|
608
|
+
/* @__PURE__ */ i(y, {
|
|
609
|
+
label: "Notes (optional)",
|
|
610
|
+
size: "small",
|
|
611
|
+
multiline: !0,
|
|
612
|
+
minRows: 2,
|
|
613
|
+
fullWidth: !0,
|
|
614
|
+
value: M.notes,
|
|
615
|
+
onChange: (e) => P({
|
|
616
|
+
...M,
|
|
617
|
+
notes: e.target.value
|
|
618
|
+
}),
|
|
619
|
+
helperText: "Anything worth recording about this reading."
|
|
620
|
+
})
|
|
621
|
+
]
|
|
622
|
+
}) : /* @__PURE__ */ n(v, {
|
|
623
|
+
spacing: 2,
|
|
624
|
+
sx: { pt: 1 },
|
|
625
|
+
children: [/* @__PURE__ */ n(w, {
|
|
626
|
+
variant: "body2",
|
|
627
|
+
sx: { fontWeight: 700 },
|
|
628
|
+
children: [
|
|
629
|
+
"Reading: ",
|
|
630
|
+
C == null ? void 0 : C.temperatureCelsius,
|
|
631
|
+
"°C"
|
|
632
|
+
]
|
|
633
|
+
}), $.length === 0 ? /* @__PURE__ */ i(A, {
|
|
634
|
+
severity: "success",
|
|
635
|
+
icon: /* @__PURE__ */ i(fi, {}),
|
|
636
|
+
children: "Every stored product tolerates this temperature. Nothing will be wasted — you can still log the reading for the record."
|
|
637
|
+
}) : /* @__PURE__ */ n(j, { children: [/* @__PURE__ */ n(A, {
|
|
638
|
+
severity: "warning",
|
|
639
|
+
icon: /* @__PURE__ */ i(Ae, {}),
|
|
640
|
+
children: [
|
|
641
|
+
"At ",
|
|
642
|
+
C == null ? void 0 : C.temperatureCelsius,
|
|
643
|
+
"°C the following ",
|
|
644
|
+
$.length === 1 ? "batch is" : "batches are",
|
|
645
|
+
" out of range. Confirming will mark ",
|
|
646
|
+
$.length === 1 ? "it" : "them",
|
|
647
|
+
" — and any open vials — as wastage. This cannot be undone."
|
|
648
|
+
]
|
|
649
|
+
}), /* @__PURE__ */ n(mi, {
|
|
650
|
+
size: "small",
|
|
651
|
+
children: [/* @__PURE__ */ i(ye, { children: /* @__PURE__ */ n(B, { children: [
|
|
652
|
+
/* @__PURE__ */ i(a, { children: "Product" }),
|
|
653
|
+
/* @__PURE__ */ i(a, { children: "Lot" }),
|
|
654
|
+
/* @__PURE__ */ i(a, { children: "Expiry" }),
|
|
655
|
+
/* @__PURE__ */ i(a, {
|
|
656
|
+
align: "right",
|
|
657
|
+
children: "Qty"
|
|
658
|
+
}),
|
|
659
|
+
/* @__PURE__ */ i(a, {
|
|
660
|
+
align: "right",
|
|
661
|
+
children: "Open vials"
|
|
662
|
+
}),
|
|
663
|
+
/* @__PURE__ */ i(a, { children: "Required" })
|
|
664
|
+
] }) }), /* @__PURE__ */ i(we, { children: $.map((e) => /* @__PURE__ */ n(B, { children: [
|
|
665
|
+
/* @__PURE__ */ i(a, {
|
|
666
|
+
sx: { fontWeight: 700 },
|
|
667
|
+
children: e.productName
|
|
668
|
+
}),
|
|
669
|
+
/* @__PURE__ */ i(a, {
|
|
670
|
+
sx: {
|
|
671
|
+
fontFamily: "monospace",
|
|
672
|
+
fontSize: "0.78rem"
|
|
673
|
+
},
|
|
674
|
+
children: e.lotNumber || "—"
|
|
675
|
+
}),
|
|
676
|
+
/* @__PURE__ */ i(a, { children: e.expiryDate ? Xe(e.expiryDate) : "—" }),
|
|
677
|
+
/* @__PURE__ */ i(a, {
|
|
678
|
+
align: "right",
|
|
679
|
+
sx: { fontVariantNumeric: "tabular-nums" },
|
|
680
|
+
children: e.qtyRemaining ?? 0
|
|
681
|
+
}),
|
|
682
|
+
/* @__PURE__ */ i(a, {
|
|
683
|
+
align: "right",
|
|
684
|
+
sx: { fontVariantNumeric: "tabular-nums" },
|
|
685
|
+
children: e.openVialCount ?? 0
|
|
686
|
+
}),
|
|
687
|
+
/* @__PURE__ */ i(a, {
|
|
688
|
+
sx: { whiteSpace: "nowrap" },
|
|
689
|
+
children: e.requiredMinCelsius != null && e.requiredMaxCelsius != null ? `${e.requiredMinCelsius}°C → ${e.requiredMaxCelsius}°C` : "—"
|
|
690
|
+
})
|
|
691
|
+
] }, e.batchId)) })]
|
|
692
|
+
})] })]
|
|
693
|
+
})]
|
|
694
|
+
}),
|
|
695
|
+
/* @__PURE__ */ i(Ie, { children: ne === "input" ? /* @__PURE__ */ n(j, { children: [/* @__PURE__ */ i(g, {
|
|
696
|
+
onClick: le,
|
|
697
|
+
disabled: f,
|
|
698
|
+
children: "Cancel"
|
|
699
|
+
}), /* @__PURE__ */ i(g, {
|
|
700
|
+
variant: "contained",
|
|
701
|
+
disabled: !se || f,
|
|
702
|
+
onClick: () => void Pe(),
|
|
703
|
+
children: f ? "Checking…" : "Check"
|
|
704
|
+
})] }) : /* @__PURE__ */ n(j, { children: [/* @__PURE__ */ i(g, {
|
|
705
|
+
onClick: () => V("input"),
|
|
706
|
+
disabled: f,
|
|
707
|
+
children: "Back"
|
|
708
|
+
}), $.length === 0 ? /* @__PURE__ */ i(g, {
|
|
709
|
+
variant: "contained",
|
|
710
|
+
disabled: f,
|
|
711
|
+
onClick: () => void de(!1),
|
|
712
|
+
children: f ? "Logging…" : "Log reading"
|
|
713
|
+
}) : /* @__PURE__ */ i(g, {
|
|
714
|
+
variant: "contained",
|
|
715
|
+
color: "error",
|
|
716
|
+
disabled: f,
|
|
717
|
+
onClick: () => void de(!0),
|
|
718
|
+
children: f ? "Processing…" : "Confirm & mark wastage"
|
|
719
|
+
})] }) })
|
|
720
|
+
]
|
|
721
|
+
})
|
|
722
|
+
]
|
|
723
|
+
})] });
|
|
724
|
+
}
|
|
725
|
+
export {
|
|
726
|
+
Di as default
|
|
727
|
+
};
|
|
728
|
+
//# sourceMappingURL=StorageUnitsPage-BDRkdCjW-UF64rf7q.js.map
|