@argusoft/medplat-product-management 1.0.6 → 1.0.7
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/{BrandsPage-DM5ZRz8L.js → BrandsPage-CdqGFmGf.js} +57 -58
- package/dist/BrandsPage-CdqGFmGf.js.map +1 -0
- package/dist/CategoriesPage-DJM0Nalw.js +392 -0
- package/dist/CategoriesPage-DJM0Nalw.js.map +1 -0
- package/dist/{DashboardPage-CW77OzUg.js → DashboardPage-BASkXr00.js} +14 -14
- package/dist/{DashboardPage-CW77OzUg.js.map → DashboardPage-BASkXr00.js.map} +1 -1
- package/dist/{FacilityPicker-C2drWyqo.js → FacilityPicker-jV-qXp1k.js} +8 -6
- package/dist/{FacilityPicker-C2drWyqo.js.map → FacilityPicker-jV-qXp1k.js.map} +1 -1
- package/dist/InventoryPage-CTdq6txa.js +658 -0
- package/dist/InventoryPage-CTdq6txa.js.map +1 -0
- package/dist/{MemberProfileCard-D9jepThR.js → MemberProfileCard-DwWda-tS.js} +3 -3
- package/dist/{MemberProfileCard-D9jepThR.js.map → MemberProfileCard-DwWda-tS.js.map} +1 -1
- package/dist/{PaymentCreatePage-DAUWv5RO.js → PaymentCreatePage-B3bP-K01.js} +137 -138
- package/dist/PaymentCreatePage-B3bP-K01.js.map +1 -0
- package/dist/{PaymentsPage-B6Fs2xey.js → PaymentsPage-Dh8bqXVE.js} +42 -43
- package/dist/PaymentsPage-Dh8bqXVE.js.map +1 -0
- package/dist/PickupBatchLinesEditor-B2fLx1lU.js +116 -0
- package/dist/PickupBatchLinesEditor-B2fLx1lU.js.map +1 -0
- package/dist/{PickupCreatePage-4ffB1_yq.js → PickupCreatePage-BeYhR45k.js} +301 -257
- package/dist/PickupCreatePage-BeYhR45k.js.map +1 -0
- package/dist/PickupsPage-C6lBtAoQ.js +814 -0
- package/dist/PickupsPage-C6lBtAoQ.js.map +1 -0
- package/dist/{PmGuard-DrbbysnW.js → PmGuard-DrIl1sHL.js} +2 -2
- package/dist/{PmGuard-DrbbysnW.js.map → PmGuard-DrIl1sHL.js.map} +1 -1
- package/dist/PmTable-BSV_bMJZ.js +545 -0
- package/dist/PmTable-BSV_bMJZ.js.map +1 -0
- package/dist/ProductEditPage-DZTUH95T.js +1295 -0
- package/dist/ProductEditPage-DZTUH95T.js.map +1 -0
- package/dist/{ProductsPage-DFgK9-13.js → ProductsPage-CqOsah4_.js} +61 -64
- package/dist/ProductsPage-CqOsah4_.js.map +1 -0
- package/dist/{PurchaseCreatePage-B1eV15aS.js → PurchaseCreatePage-D6os7srp.js} +210 -153
- package/dist/PurchaseCreatePage-D6os7srp.js.map +1 -0
- package/dist/PurchaseRequestDetailPage-DErqGKiq.js +1544 -0
- package/dist/PurchaseRequestDetailPage-DErqGKiq.js.map +1 -0
- package/dist/PurchaseRequestsPage-CHBoRzzH.js +280 -0
- package/dist/PurchaseRequestsPage-CHBoRzzH.js.map +1 -0
- package/dist/{PurchasesPage-Bsrqxvb1.js → PurchasesPage-C-2K7wH6.js} +40 -41
- package/dist/PurchasesPage-C-2K7wH6.js.map +1 -0
- package/dist/{SaleCreatePage-CPyVj3Dh.js → SaleCreatePage-DB3_UEgy.js} +117 -118
- package/dist/SaleCreatePage-DB3_UEgy.js.map +1 -0
- package/dist/{SalesPage-BWpgPKz_.js → SalesPage-BhBGG426.js} +89 -90
- package/dist/SalesPage-BhBGG426.js.map +1 -0
- package/dist/SettingsPage-CBUu9DZK.js +746 -0
- package/dist/SettingsPage-CBUu9DZK.js.map +1 -0
- package/dist/StorageUnitsPage-oe0lXLd1.js +719 -0
- package/dist/StorageUnitsPage-oe0lXLd1.js.map +1 -0
- package/dist/{TransactionsPage-DQBjCHoN.js → TransactionsPage-7dRZpZOD.js} +108 -83
- package/dist/TransactionsPage-7dRZpZOD.js.map +1 -0
- package/dist/{TransferCreatePage-DdVExUif.js → TransferCreatePage-DtkAlP9l.js} +73 -74
- package/dist/TransferCreatePage-DtkAlP9l.js.map +1 -0
- package/dist/{TransfersPage-C1qS9kNL.js → TransfersPage-BaEjbvnj.js} +67 -68
- package/dist/TransfersPage-BaEjbvnj.js.map +1 -0
- package/dist/{VialsPage-rTAYlXGZ.js → VialsPage-vo9Of9oC.js} +83 -84
- package/dist/VialsPage-vo9Of9oC.js.map +1 -0
- package/dist/constants-ClZJY2x1.js +405 -0
- package/dist/constants-ClZJY2x1.js.map +1 -0
- package/dist/index.js +582 -391
- package/dist/index.js.map +1 -1
- package/dist/{settingsStore-GLCtI-tv.js → settingsStore-BlA2GIhl.js} +89 -58
- package/dist/settingsStore-BlA2GIhl.js.map +1 -0
- package/dist/{validation-BkUPqrdA.js → validation-B6Kl5Xf9.js} +23 -22
- package/dist/validation-B6Kl5Xf9.js.map +1 -0
- package/package.json +1 -1
- package/dist/BrandsPage-DM5ZRz8L.js.map +0 -1
- package/dist/CategoriesPage-v7vz_i2N.js +0 -342
- package/dist/CategoriesPage-v7vz_i2N.js.map +0 -1
- package/dist/InventoryPage-_VWlqD2e.js +0 -686
- package/dist/InventoryPage-_VWlqD2e.js.map +0 -1
- package/dist/PaymentCreatePage-DAUWv5RO.js.map +0 -1
- package/dist/PaymentsPage-B6Fs2xey.js.map +0 -1
- package/dist/PickupCreatePage-4ffB1_yq.js.map +0 -1
- package/dist/PickupsPage-C-21LwTf.js +0 -604
- package/dist/PickupsPage-C-21LwTf.js.map +0 -1
- package/dist/PmTable-BMFiuHdG.js +0 -375
- package/dist/PmTable-BMFiuHdG.js.map +0 -1
- package/dist/ProductEditPage-BinNxjlB.js +0 -708
- package/dist/ProductEditPage-BinNxjlB.js.map +0 -1
- package/dist/ProductsPage-DFgK9-13.js.map +0 -1
- package/dist/PurchaseCreatePage-B1eV15aS.js.map +0 -1
- package/dist/PurchaseRequestDetailPage-52S6Nf7a.js +0 -588
- package/dist/PurchaseRequestDetailPage-52S6Nf7a.js.map +0 -1
- package/dist/PurchaseRequestsPage-DNNUnXy4.js +0 -266
- package/dist/PurchaseRequestsPage-DNNUnXy4.js.map +0 -1
- package/dist/PurchasesPage-Bsrqxvb1.js.map +0 -1
- package/dist/SaleCreatePage-CPyVj3Dh.js.map +0 -1
- package/dist/SalesPage-BWpgPKz_.js.map +0 -1
- package/dist/SettingsPage-Ch-37E5R.js +0 -663
- package/dist/SettingsPage-Ch-37E5R.js.map +0 -1
- package/dist/StorageUnitsPage-DF0MC356.js +0 -471
- package/dist/StorageUnitsPage-DF0MC356.js.map +0 -1
- package/dist/TransactionsPage-DQBjCHoN.js.map +0 -1
- package/dist/TransferCreatePage-DdVExUif.js.map +0 -1
- package/dist/TransfersPage-C1qS9kNL.js.map +0 -1
- package/dist/VialsPage-rTAYlXGZ.js.map +0 -1
- package/dist/constants-CdzV0PxZ.js +0 -270
- package/dist/constants-CdzV0PxZ.js.map +0 -1
- package/dist/settingsStore-GLCtI-tv.js.map +0 -1
- package/dist/validation-BkUPqrdA.js.map +0 -1
|
@@ -1,27 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { t as
|
|
4
|
-
import {
|
|
5
|
-
import { useMemo as
|
|
6
|
-
import { jsx as
|
|
7
|
-
import { Alert as
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import { useNavigate as
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import {
|
|
1
|
+
import { A as e, F as t, P as n, Q as r, j as i, r as a } from "./settingsStore-BlA2GIhl.js";
|
|
2
|
+
import { l as o, r as s } from "./PmTable-BSV_bMJZ.js";
|
|
3
|
+
import { a as c, n as l, r as u, t as d } from "./PmGuard-DrIl1sHL.js";
|
|
4
|
+
import { i as f, n as p, r as m, t as h } from "./PickupBatchLinesEditor-B2fLx1lU.js";
|
|
5
|
+
import { useEffect as g, useMemo as _, useState as v } from "react";
|
|
6
|
+
import { jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
7
|
+
import { Alert as x, Autocomplete as S, Box as C, Button as w, Card as T, CardContent as E, Divider as D, Grid as O, Stack as ee, TextField as k, ToggleButton as te, ToggleButtonGroup as ne, Typography as re } from "@mui/material";
|
|
8
|
+
import { v4 as A } from "uuid";
|
|
9
|
+
import ie from "@mui/icons-material/AddRounded";
|
|
10
|
+
import { useNavigate as ae } from "react-router-dom";
|
|
11
|
+
import oe from "@mui/icons-material/SaveRounded";
|
|
12
|
+
import se from "@mui/icons-material/GroupsRounded";
|
|
13
|
+
import { DateTimePicker as ce, LocalizationProvider as le } from "@mui/x-date-pickers";
|
|
14
|
+
import { AdapterDayjs as j } from "@mui/x-date-pickers/AdapterDayjs";
|
|
15
|
+
import ue from "@mui/icons-material/PersonRounded";
|
|
14
16
|
//#region \0rolldown/runtime.js
|
|
15
|
-
var
|
|
16
|
-
if (t && typeof t == "object" || typeof t == "function") for (var i = P(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !
|
|
17
|
+
var M = Object.create, N = Object.defineProperty, de = Object.getOwnPropertyDescriptor, P = Object.getOwnPropertyNames, fe = Object.getPrototypeOf, F = Object.prototype.hasOwnProperty, I = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), L = (e, t, n, r) => {
|
|
18
|
+
if (t && typeof t == "object" || typeof t == "function") for (var i = P(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !F.call(e, s) && s !== n && N(e, s, {
|
|
17
19
|
get: ((e) => t[e]).bind(null, s),
|
|
18
|
-
enumerable: !(r =
|
|
20
|
+
enumerable: !(r = de(t, s)) || r.enumerable
|
|
19
21
|
});
|
|
20
22
|
return e;
|
|
21
|
-
},
|
|
23
|
+
}, R = /* @__PURE__ */ ((e, t, n) => (n = e == null ? {} : M(fe(e)), L(t || !e || !e.__esModule || !F.call(e, "default") ? N(n, "default", {
|
|
22
24
|
value: e,
|
|
23
25
|
enumerable: !0
|
|
24
|
-
}) : n, e)))((/* @__PURE__ */
|
|
26
|
+
}) : n, e)))((/* @__PURE__ */ I(((e, t) => {
|
|
25
27
|
(function(n, r) {
|
|
26
28
|
typeof e == "object" && t !== void 0 ? t.exports = r() : typeof define == "function" && define.amd ? define(r) : (n = typeof globalThis < "u" ? globalThis : n || self).dayjs = r();
|
|
27
29
|
})(e, (function() {
|
|
@@ -316,130 +318,166 @@ var j = Object.create, M = Object.defineProperty, N = Object.getOwnPropertyDescr
|
|
|
316
318
|
}, w.en = b[y], w.Ls = b, w.p = {}, w;
|
|
317
319
|
}));
|
|
318
320
|
})))(), 1);
|
|
319
|
-
function
|
|
320
|
-
return
|
|
321
|
+
function z() {
|
|
322
|
+
return p(A);
|
|
321
323
|
}
|
|
322
|
-
function
|
|
323
|
-
let
|
|
324
|
-
id:
|
|
325
|
-
|
|
324
|
+
function B() {
|
|
325
|
+
let p = ae(), M = a()?.allowGroupSessions === !0, [N, de] = v([]), [P, fe] = v([]), [F, I] = v([]), [L, B] = v([]), [pe, me] = v(!0), [V, H] = v(!1), [U, W] = v(""), [G, K] = v({
|
|
326
|
+
id: A(),
|
|
327
|
+
sessionType: "INDIVIDUAL",
|
|
326
328
|
facilityId: "",
|
|
327
|
-
|
|
328
|
-
|
|
329
|
+
memberUserIds: [],
|
|
330
|
+
lines: [z()],
|
|
329
331
|
notes: "",
|
|
330
332
|
sessionName: "",
|
|
331
333
|
sessionDescription: "",
|
|
332
|
-
sessionStartTime: (0,
|
|
334
|
+
sessionStartTime: (0, R.default)(),
|
|
333
335
|
sessionExpectedEndTime: null,
|
|
334
336
|
sessionSite: ""
|
|
335
337
|
});
|
|
336
|
-
|
|
337
|
-
async function
|
|
338
|
+
u("update.manage.productManagement.pickup", () => {
|
|
339
|
+
async function e() {
|
|
338
340
|
try {
|
|
339
|
-
let [
|
|
341
|
+
let [e, r, a] = await Promise.all([
|
|
340
342
|
n(),
|
|
341
|
-
|
|
342
|
-
|
|
343
|
+
i(),
|
|
344
|
+
t().catch(() => [])
|
|
343
345
|
]);
|
|
344
|
-
|
|
346
|
+
de(e), fe(r), B(a);
|
|
345
347
|
} catch (e) {
|
|
346
|
-
|
|
348
|
+
W(e?.response?.data?.message ?? e?.message ?? "Failed to load reference data");
|
|
347
349
|
} finally {
|
|
348
|
-
|
|
350
|
+
me(!1);
|
|
349
351
|
}
|
|
350
352
|
}
|
|
351
|
-
|
|
352
|
-
}, [])
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
353
|
+
e();
|
|
354
|
+
}, []), g(() => {
|
|
355
|
+
let t = !0;
|
|
356
|
+
if (!G.facilityId) {
|
|
357
|
+
I([]);
|
|
358
|
+
return;
|
|
359
|
+
}
|
|
360
|
+
return e(G.facilityId).then((e) => {
|
|
361
|
+
t && I(e);
|
|
362
|
+
}).catch(() => {
|
|
363
|
+
t && I([]);
|
|
364
|
+
}), () => {
|
|
365
|
+
t = !1;
|
|
366
|
+
};
|
|
367
|
+
}, [G.facilityId]);
|
|
368
|
+
let he = L.length > 0, q = M && G.sessionType === "GROUP", ge = _(() => G.facilityId ? P.filter(m).filter((e) => e.ownerId === G.facilityId) : [], [P, G.facilityId]);
|
|
369
|
+
function J(e, t) {
|
|
370
|
+
K((n) => ({
|
|
356
371
|
...n,
|
|
357
372
|
[e]: t
|
|
358
373
|
}));
|
|
359
374
|
}
|
|
360
|
-
function
|
|
361
|
-
|
|
375
|
+
function _e(e) {
|
|
376
|
+
K((t) => ({
|
|
362
377
|
...t,
|
|
363
378
|
facilityId: e,
|
|
364
|
-
|
|
379
|
+
memberUserIds: [],
|
|
380
|
+
lines: [z()]
|
|
381
|
+
}));
|
|
382
|
+
}
|
|
383
|
+
function ve(e, t, n) {
|
|
384
|
+
K((r) => {
|
|
385
|
+
let i = r.lines.slice();
|
|
386
|
+
return i[e] = {
|
|
387
|
+
...i[e],
|
|
388
|
+
[t]: n
|
|
389
|
+
}, {
|
|
390
|
+
...r,
|
|
391
|
+
lines: i
|
|
392
|
+
};
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
function ye() {
|
|
396
|
+
K((e) => ({
|
|
397
|
+
...e,
|
|
398
|
+
lines: [...e.lines, z()]
|
|
365
399
|
}));
|
|
366
400
|
}
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
401
|
+
function be(e) {
|
|
402
|
+
K((t) => ({
|
|
403
|
+
...t,
|
|
404
|
+
lines: t.lines.filter((t, n) => n !== e)
|
|
405
|
+
}));
|
|
406
|
+
}
|
|
407
|
+
let xe = f(G.lines, ge), Se = G.lines.length > 0 && xe.every((e) => Object.keys(e).length === 0), Y = G.sessionName.trim() ? "" : "Session name is required.", X = G.sessionStartTime && R.default.isDayjs(G.sessionStartTime) && G.sessionStartTime.isValid(), Z = X ? G.sessionStartTime.valueOf() < Date.now() - 3e5 ? "Start time cannot be in the past." : "" : "Start time is required.", Ce = G.sessionExpectedEndTime && R.default.isDayjs(G.sessionExpectedEndTime) && G.sessionExpectedEndTime.isValid(), Q = Ce ? X && !G.sessionExpectedEndTime.isAfter(G.sessionStartTime) ? "Expected end must be after the start time." : "" : "Expected end time is required.", $ = q && G.memberUserIds.length === 0 ? "Pick at least one member for a group session." : "", we = !!G.facilityId && Se && !he && !Y && !Z && !Q && !$;
|
|
408
|
+
async function Te() {
|
|
409
|
+
if (we) {
|
|
410
|
+
H(!0), W("");
|
|
371
411
|
try {
|
|
372
|
-
await
|
|
373
|
-
id:
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
412
|
+
await r({
|
|
413
|
+
id: G.id,
|
|
414
|
+
sessionType: q ? "GROUP" : "INDIVIDUAL",
|
|
415
|
+
memberUserIds: q ? G.memberUserIds : null,
|
|
416
|
+
lines: G.lines.map((e) => ({
|
|
417
|
+
sourceBatchId: e.sourceBatchId,
|
|
418
|
+
personalBatchId: e.personalBatchId,
|
|
419
|
+
pickedQty: Number(e.pickedQty)
|
|
420
|
+
})),
|
|
421
|
+
notes: G.notes || null,
|
|
422
|
+
sessionName: G.sessionName.trim(),
|
|
423
|
+
sessionDescription: G.sessionDescription.trim() || null,
|
|
424
|
+
sessionStartTime: X ? G.sessionStartTime.toISOString() : null,
|
|
425
|
+
sessionExpectedEndTime: Ce ? G.sessionExpectedEndTime.toISOString() : null,
|
|
426
|
+
sessionSite: G.sessionSite.trim() || null
|
|
427
|
+
}), o({
|
|
428
|
+
message: "Session started successfully",
|
|
385
429
|
type: "success"
|
|
386
|
-
}),
|
|
430
|
+
}), p("/ui/medplat/manage/pm/pickups");
|
|
387
431
|
} catch (e) {
|
|
388
|
-
|
|
432
|
+
W(e?.response?.data?.message ?? e?.message ?? "Failed to start session");
|
|
389
433
|
} finally {
|
|
390
|
-
|
|
434
|
+
H(!1);
|
|
391
435
|
}
|
|
392
436
|
}
|
|
393
437
|
}
|
|
394
|
-
return /* @__PURE__ */
|
|
438
|
+
return /* @__PURE__ */ b(C, { children: [/* @__PURE__ */ y(l, {}), /* @__PURE__ */ y(d, {
|
|
395
439
|
perm: "update.manage.productManagement.pickup",
|
|
396
440
|
title: "You don’t have permission to record pickups",
|
|
397
|
-
children: /* @__PURE__ */
|
|
398
|
-
title: "
|
|
399
|
-
subtitle: "Check out stock from a facility for
|
|
400
|
-
actions: /* @__PURE__ */
|
|
441
|
+
children: /* @__PURE__ */ b(c, {
|
|
442
|
+
title: "Start Session",
|
|
443
|
+
subtitle: "Check out stock from a facility for field work. It can be your own session or a shared group session. Record returns and wastage when stock comes back.",
|
|
444
|
+
actions: /* @__PURE__ */ b(ee, {
|
|
401
445
|
direction: "row",
|
|
402
446
|
spacing: 1,
|
|
403
|
-
children: [/* @__PURE__ */
|
|
447
|
+
children: [/* @__PURE__ */ y(w, {
|
|
404
448
|
variant: "outlined",
|
|
405
|
-
onClick: () =>
|
|
449
|
+
onClick: () => p("/ui/medplat/manage/pm/pickups"),
|
|
406
450
|
children: "Cancel"
|
|
407
|
-
}), /* @__PURE__ */
|
|
451
|
+
}), /* @__PURE__ */ y(w, {
|
|
408
452
|
variant: "contained",
|
|
409
|
-
startIcon: /* @__PURE__ */
|
|
410
|
-
disabled: !
|
|
411
|
-
onClick: () => void
|
|
412
|
-
children:
|
|
453
|
+
startIcon: /* @__PURE__ */ y(oe, {}),
|
|
454
|
+
disabled: !we || V,
|
|
455
|
+
onClick: () => void Te(),
|
|
456
|
+
children: V ? "Starting…" : "Start Session"
|
|
413
457
|
})]
|
|
414
458
|
}),
|
|
415
459
|
children: [
|
|
416
|
-
|
|
460
|
+
U ? /* @__PURE__ */ y(x, {
|
|
417
461
|
severity: "error",
|
|
418
462
|
sx: { mb: 2 },
|
|
419
|
-
children:
|
|
463
|
+
children: U
|
|
420
464
|
}) : null,
|
|
421
|
-
|
|
465
|
+
he ? /* @__PURE__ */ b(x, {
|
|
422
466
|
severity: "warning",
|
|
423
467
|
sx: { mb: 2 },
|
|
424
|
-
action: /* @__PURE__ */
|
|
468
|
+
action: /* @__PURE__ */ y(w, {
|
|
425
469
|
color: "inherit",
|
|
426
470
|
size: "small",
|
|
427
|
-
onClick: () =>
|
|
471
|
+
onClick: () => p("/ui/medplat/manage/pm/pickups"),
|
|
428
472
|
children: "Go to Pickups"
|
|
429
473
|
}),
|
|
430
474
|
children: [
|
|
431
|
-
"You already
|
|
432
|
-
/* @__PURE__ */
|
|
433
|
-
"
|
|
434
|
-
I.length === 1 ? "" : "s",
|
|
435
|
-
". End the active session",
|
|
436
|
-
I.length === 1 ? "" : "s",
|
|
437
|
-
" before starting a new pickup, or use ",
|
|
438
|
-
/* @__PURE__ */ p("strong", { children: "Top Up" }),
|
|
439
|
-
" on the Pickups page to add more stock to an active session."
|
|
475
|
+
"You are already part of an open session. End it before starting a new one, or use ",
|
|
476
|
+
/* @__PURE__ */ y("strong", { children: "Top Up" }),
|
|
477
|
+
" on the Pickups page to add more stock to it."
|
|
440
478
|
]
|
|
441
479
|
}) : null,
|
|
442
|
-
/* @__PURE__ */
|
|
480
|
+
/* @__PURE__ */ y(T, {
|
|
443
481
|
sx: {
|
|
444
482
|
borderRadius: 1.5,
|
|
445
483
|
mb: 2,
|
|
@@ -447,57 +485,88 @@ function ie() {
|
|
|
447
485
|
borderColor: "divider",
|
|
448
486
|
boxShadow: "0 12px 32px rgba(15, 23, 42, 0.045)"
|
|
449
487
|
},
|
|
450
|
-
children: /* @__PURE__ */
|
|
488
|
+
children: /* @__PURE__ */ b(E, {
|
|
451
489
|
sx: { p: 2.5 },
|
|
452
|
-
children: [
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
value:
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
490
|
+
children: [
|
|
491
|
+
/* @__PURE__ */ y(s, {
|
|
492
|
+
eyebrow: "Step 1",
|
|
493
|
+
title: M ? "Session type & source" : "Session source",
|
|
494
|
+
hint: M ? "Run the session yourself or share it with colleagues from the same facility." : "Pick the facility whose stock you are checking out for this outreach session.",
|
|
495
|
+
sx: { mb: 2 }
|
|
496
|
+
}),
|
|
497
|
+
M ? /* @__PURE__ */ b(ne, {
|
|
498
|
+
exclusive: !0,
|
|
499
|
+
size: "small",
|
|
500
|
+
color: "primary",
|
|
501
|
+
value: G.sessionType,
|
|
502
|
+
onChange: (e, t) => {
|
|
503
|
+
t && J("sessionType", t);
|
|
504
|
+
},
|
|
505
|
+
sx: { mb: 2 },
|
|
506
|
+
children: [/* @__PURE__ */ b(te, {
|
|
507
|
+
value: "INDIVIDUAL",
|
|
508
|
+
children: [/* @__PURE__ */ y(ue, {
|
|
509
|
+
fontSize: "small",
|
|
510
|
+
sx: { mr: .75 }
|
|
511
|
+
}), "Individual"]
|
|
512
|
+
}), /* @__PURE__ */ b(te, {
|
|
513
|
+
value: "GROUP",
|
|
514
|
+
children: [/* @__PURE__ */ y(se, {
|
|
515
|
+
fontSize: "small",
|
|
516
|
+
sx: { mr: .75 }
|
|
517
|
+
}), "Group"]
|
|
518
|
+
})]
|
|
519
|
+
}) : null,
|
|
520
|
+
/* @__PURE__ */ b(O, {
|
|
521
|
+
container: !0,
|
|
522
|
+
spacing: 2,
|
|
523
|
+
children: [/* @__PURE__ */ y(O, {
|
|
524
|
+
item: !0,
|
|
525
|
+
xs: 12,
|
|
526
|
+
md: q ? 5 : 12,
|
|
527
|
+
children: /* @__PURE__ */ y(S, {
|
|
528
|
+
size: "small",
|
|
529
|
+
options: N,
|
|
530
|
+
getOptionLabel: (e) => e?.name ?? "",
|
|
531
|
+
isOptionEqualToValue: (e, t) => e?.id === t?.id,
|
|
532
|
+
value: N.find((e) => e.id === G.facilityId) ?? null,
|
|
533
|
+
onChange: (e, t) => _e(t?.id ?? ""),
|
|
534
|
+
loading: pe,
|
|
535
|
+
renderInput: (e) => /* @__PURE__ */ y(k, {
|
|
536
|
+
...e,
|
|
537
|
+
required: !0,
|
|
538
|
+
label: "Source Facility",
|
|
539
|
+
placeholder: "Pick a facility you're assigned to"
|
|
540
|
+
})
|
|
477
541
|
})
|
|
478
|
-
})
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
542
|
+
}), q ? /* @__PURE__ */ y(O, {
|
|
543
|
+
item: !0,
|
|
544
|
+
xs: 12,
|
|
545
|
+
md: 7,
|
|
546
|
+
children: /* @__PURE__ */ y(S, {
|
|
547
|
+
multiple: !0,
|
|
548
|
+
size: "small",
|
|
549
|
+
disabled: !G.facilityId,
|
|
550
|
+
options: F,
|
|
551
|
+
getOptionLabel: (e) => e?.name ?? String(e?.id ?? ""),
|
|
552
|
+
isOptionEqualToValue: (e, t) => e?.id === t?.id,
|
|
553
|
+
value: F.filter((e) => G.memberUserIds.includes(e.id)),
|
|
554
|
+
onChange: (e, t) => J("memberUserIds", t.map((e) => e.id)),
|
|
555
|
+
renderInput: (e) => /* @__PURE__ */ y(k, {
|
|
556
|
+
...e,
|
|
557
|
+
required: !0,
|
|
558
|
+
label: "Members",
|
|
559
|
+
placeholder: G.facilityId ? "Add colleagues" : "Pick a facility first",
|
|
560
|
+
error: !!$,
|
|
561
|
+
helperText: $ || "Anyone here can administer from the shared stock. You alone can end or top up the session."
|
|
562
|
+
})
|
|
563
|
+
})
|
|
564
|
+
}) : null]
|
|
565
|
+
})
|
|
566
|
+
]
|
|
498
567
|
})
|
|
499
568
|
}),
|
|
500
|
-
/* @__PURE__ */
|
|
569
|
+
/* @__PURE__ */ y(T, {
|
|
501
570
|
sx: {
|
|
502
571
|
borderRadius: 1.5,
|
|
503
572
|
mb: 2,
|
|
@@ -505,202 +574,177 @@ function ie() {
|
|
|
505
574
|
borderColor: "divider",
|
|
506
575
|
boxShadow: "0 12px 32px rgba(15, 23, 42, 0.045)"
|
|
507
576
|
},
|
|
508
|
-
children: /* @__PURE__ */
|
|
577
|
+
children: /* @__PURE__ */ b(E, {
|
|
509
578
|
sx: { p: 2.5 },
|
|
510
|
-
children: [
|
|
579
|
+
children: [
|
|
580
|
+
/* @__PURE__ */ b(ee, {
|
|
581
|
+
direction: "row",
|
|
582
|
+
justifyContent: "space-between",
|
|
583
|
+
alignItems: "flex-start",
|
|
584
|
+
sx: { mb: 2 },
|
|
585
|
+
children: [/* @__PURE__ */ y(s, {
|
|
586
|
+
eyebrow: "Step 2",
|
|
587
|
+
title: "Batches",
|
|
588
|
+
hint: "Add one or more batches to take on this session. They can be the same vaccine (different lots) or different vaccines."
|
|
589
|
+
}), /* @__PURE__ */ y(w, {
|
|
590
|
+
variant: "outlined",
|
|
591
|
+
startIcon: /* @__PURE__ */ y(ie, {}),
|
|
592
|
+
disabled: !G.facilityId,
|
|
593
|
+
onClick: ye,
|
|
594
|
+
children: "Add Batch"
|
|
595
|
+
})]
|
|
596
|
+
}),
|
|
597
|
+
/* @__PURE__ */ y(D, { sx: { mb: 2 } }),
|
|
598
|
+
G.facilityId ? /* @__PURE__ */ y(h, {
|
|
599
|
+
lines: G.lines,
|
|
600
|
+
batches: ge,
|
|
601
|
+
errors: xe,
|
|
602
|
+
onPatch: ve,
|
|
603
|
+
onRemove: be
|
|
604
|
+
}) : /* @__PURE__ */ y(re, {
|
|
605
|
+
variant: "body2",
|
|
606
|
+
color: "text.secondary",
|
|
607
|
+
children: "Pick a facility first to choose batches."
|
|
608
|
+
})
|
|
609
|
+
]
|
|
610
|
+
})
|
|
611
|
+
}),
|
|
612
|
+
/* @__PURE__ */ y(T, {
|
|
613
|
+
sx: {
|
|
614
|
+
borderRadius: 1.5,
|
|
615
|
+
mb: 2,
|
|
616
|
+
border: "1px solid",
|
|
617
|
+
borderColor: "divider",
|
|
618
|
+
boxShadow: "0 12px 32px rgba(15, 23, 42, 0.045)"
|
|
619
|
+
},
|
|
620
|
+
children: /* @__PURE__ */ b(E, {
|
|
621
|
+
sx: { p: 2.5 },
|
|
622
|
+
children: [/* @__PURE__ */ y(s, {
|
|
511
623
|
eyebrow: "Session",
|
|
512
624
|
title: "Outreach session details",
|
|
513
|
-
hint: "Records the purpose, timing and location of this
|
|
625
|
+
hint: "Records the purpose, timing and location of this session. Shown when administering from this stock.",
|
|
514
626
|
sx: { mb: 2 }
|
|
515
|
-
}), /* @__PURE__ */
|
|
627
|
+
}), /* @__PURE__ */ b(O, {
|
|
516
628
|
container: !0,
|
|
517
629
|
spacing: 2,
|
|
518
630
|
children: [
|
|
519
|
-
/* @__PURE__ */
|
|
631
|
+
/* @__PURE__ */ y(O, {
|
|
520
632
|
item: !0,
|
|
521
633
|
xs: 12,
|
|
522
634
|
md: 6,
|
|
523
|
-
children: /* @__PURE__ */
|
|
635
|
+
children: /* @__PURE__ */ y(k, {
|
|
524
636
|
required: !0,
|
|
525
637
|
fullWidth: !0,
|
|
526
638
|
size: "small",
|
|
527
639
|
label: "Session name",
|
|
528
640
|
inputProps: { maxLength: 150 },
|
|
529
|
-
value:
|
|
530
|
-
onChange: (e) =>
|
|
531
|
-
error: !!Y &&
|
|
532
|
-
helperText:
|
|
641
|
+
value: G.sessionName,
|
|
642
|
+
onChange: (e) => J("sessionName", e.target.value),
|
|
643
|
+
error: !!Y && G.sessionName !== "",
|
|
644
|
+
helperText: G.sessionName === "" ? "e.g. Anganwadi camp – Ward 4" : Y
|
|
533
645
|
})
|
|
534
646
|
}),
|
|
535
|
-
/* @__PURE__ */
|
|
647
|
+
/* @__PURE__ */ y(O, {
|
|
536
648
|
item: !0,
|
|
537
649
|
xs: 12,
|
|
538
650
|
md: 6,
|
|
539
|
-
children: /* @__PURE__ */
|
|
651
|
+
children: /* @__PURE__ */ y(k, {
|
|
540
652
|
fullWidth: !0,
|
|
541
653
|
size: "small",
|
|
542
654
|
label: "Session site (optional)",
|
|
543
655
|
placeholder: "Location / site reference",
|
|
544
656
|
inputProps: { maxLength: 200 },
|
|
545
|
-
value:
|
|
546
|
-
onChange: (e) =>
|
|
657
|
+
value: G.sessionSite,
|
|
658
|
+
onChange: (e) => J("sessionSite", e.target.value)
|
|
547
659
|
})
|
|
548
660
|
}),
|
|
549
|
-
/* @__PURE__ */
|
|
661
|
+
/* @__PURE__ */ y(O, {
|
|
550
662
|
item: !0,
|
|
551
663
|
xs: 12,
|
|
552
664
|
md: 6,
|
|
553
|
-
children: /* @__PURE__ */
|
|
554
|
-
dateAdapter:
|
|
665
|
+
children: /* @__PURE__ */ y(le, {
|
|
666
|
+
dateAdapter: j,
|
|
555
667
|
adapterLocale: "en",
|
|
556
|
-
children: /* @__PURE__ */
|
|
668
|
+
children: /* @__PURE__ */ y(ce, {
|
|
557
669
|
label: "Start time",
|
|
558
|
-
value:
|
|
559
|
-
onChange: (e) =>
|
|
670
|
+
value: G.sessionStartTime,
|
|
671
|
+
onChange: (e) => J("sessionStartTime", e),
|
|
560
672
|
ampm: !1,
|
|
561
|
-
minDateTime: (0,
|
|
673
|
+
minDateTime: (0, R.default)().subtract(5, "minute"),
|
|
562
674
|
slotProps: {
|
|
563
675
|
actionBar: { actions: ["clear"] },
|
|
564
676
|
textField: {
|
|
565
677
|
size: "small",
|
|
566
678
|
fullWidth: !0,
|
|
567
679
|
required: !0,
|
|
568
|
-
error: !!Z &&
|
|
569
|
-
helperText:
|
|
680
|
+
error: !!Z && G.sessionStartTime !== null,
|
|
681
|
+
helperText: G.sessionStartTime !== null && Z || "Cannot be in the past. (5 minutes buffer allowed)"
|
|
570
682
|
}
|
|
571
683
|
}
|
|
572
684
|
})
|
|
573
685
|
})
|
|
574
686
|
}),
|
|
575
|
-
/* @__PURE__ */
|
|
687
|
+
/* @__PURE__ */ y(O, {
|
|
576
688
|
item: !0,
|
|
577
689
|
xs: 12,
|
|
578
690
|
md: 6,
|
|
579
|
-
children: /* @__PURE__ */
|
|
580
|
-
dateAdapter:
|
|
691
|
+
children: /* @__PURE__ */ y(le, {
|
|
692
|
+
dateAdapter: j,
|
|
581
693
|
adapterLocale: "en",
|
|
582
|
-
children: /* @__PURE__ */
|
|
694
|
+
children: /* @__PURE__ */ y(ce, {
|
|
583
695
|
label: "Expected End Time",
|
|
584
|
-
value:
|
|
585
|
-
onChange: (e) =>
|
|
696
|
+
value: G.sessionExpectedEndTime,
|
|
697
|
+
onChange: (e) => J("sessionExpectedEndTime", e),
|
|
586
698
|
ampm: !1,
|
|
587
|
-
minDateTime: X ?
|
|
699
|
+
minDateTime: X ? G.sessionStartTime : void 0,
|
|
588
700
|
slotProps: {
|
|
589
701
|
actionBar: { actions: ["clear"] },
|
|
590
702
|
textField: {
|
|
591
703
|
size: "small",
|
|
592
704
|
fullWidth: !0,
|
|
593
705
|
required: !0,
|
|
594
|
-
error:
|
|
595
|
-
helperText:
|
|
706
|
+
error: !!Q && G.sessionExpectedEndTime !== null,
|
|
707
|
+
helperText: G.sessionExpectedEndTime !== null && Q || "When the session is expected to end."
|
|
596
708
|
}
|
|
597
709
|
}
|
|
598
710
|
})
|
|
599
711
|
})
|
|
600
712
|
}),
|
|
601
|
-
/* @__PURE__ */
|
|
713
|
+
/* @__PURE__ */ y(O, {
|
|
714
|
+
item: !0,
|
|
715
|
+
xs: 12,
|
|
716
|
+
md: 6,
|
|
717
|
+
children: /* @__PURE__ */ y(k, {
|
|
718
|
+
fullWidth: !0,
|
|
719
|
+
size: "small",
|
|
720
|
+
label: "Notes (optional)",
|
|
721
|
+
placeholder: "Anything worth recording about this session",
|
|
722
|
+
value: G.notes,
|
|
723
|
+
onChange: (e) => J("notes", e.target.value)
|
|
724
|
+
})
|
|
725
|
+
}),
|
|
726
|
+
/* @__PURE__ */ y(O, {
|
|
602
727
|
item: !0,
|
|
603
728
|
xs: 12,
|
|
604
|
-
children: /* @__PURE__ */
|
|
729
|
+
children: /* @__PURE__ */ y(k, {
|
|
605
730
|
fullWidth: !0,
|
|
606
731
|
size: "small",
|
|
607
732
|
multiline: !0,
|
|
608
733
|
minRows: 2,
|
|
609
734
|
label: "Purpose / description (optional)",
|
|
610
|
-
value:
|
|
611
|
-
onChange: (e) =>
|
|
735
|
+
value: G.sessionDescription,
|
|
736
|
+
onChange: (e) => J("sessionDescription", e.target.value)
|
|
612
737
|
})
|
|
613
738
|
})
|
|
614
739
|
]
|
|
615
740
|
})]
|
|
616
741
|
})
|
|
617
|
-
})
|
|
618
|
-
W ? /* @__PURE__ */ p(y, {
|
|
619
|
-
sx: {
|
|
620
|
-
borderRadius: 1.5,
|
|
621
|
-
mb: 2,
|
|
622
|
-
border: "1px solid",
|
|
623
|
-
borderColor: "divider",
|
|
624
|
-
boxShadow: "0 12px 32px rgba(15, 23, 42, 0.045)"
|
|
625
|
-
},
|
|
626
|
-
children: /* @__PURE__ */ m(b, {
|
|
627
|
-
sx: { p: 2.5 },
|
|
628
|
-
children: [
|
|
629
|
-
/* @__PURE__ */ p(a, {
|
|
630
|
-
eyebrow: "Step 2",
|
|
631
|
-
title: "Quantity",
|
|
632
|
-
hint: `Available: ${q}. You can pick up to this amount.`,
|
|
633
|
-
sx: { mb: 2 }
|
|
634
|
-
}),
|
|
635
|
-
/* @__PURE__ */ m(S, {
|
|
636
|
-
container: !0,
|
|
637
|
-
spacing: 2,
|
|
638
|
-
children: [/* @__PURE__ */ p(S, {
|
|
639
|
-
item: !0,
|
|
640
|
-
xs: 12,
|
|
641
|
-
md: 4,
|
|
642
|
-
children: /* @__PURE__ */ p(w, {
|
|
643
|
-
required: !0,
|
|
644
|
-
fullWidth: !0,
|
|
645
|
-
size: "small",
|
|
646
|
-
type: "number",
|
|
647
|
-
label: "Pick Quantity",
|
|
648
|
-
inputProps: {
|
|
649
|
-
min: 1,
|
|
650
|
-
max: q
|
|
651
|
-
},
|
|
652
|
-
value: B.pickedQty,
|
|
653
|
-
onChange: (e) => G("pickedQty", e.target.value),
|
|
654
|
-
error: !!J,
|
|
655
|
-
helperText: J || `Out of ${q} available`
|
|
656
|
-
})
|
|
657
|
-
}), /* @__PURE__ */ p(S, {
|
|
658
|
-
item: !0,
|
|
659
|
-
xs: 12,
|
|
660
|
-
md: 8,
|
|
661
|
-
children: /* @__PURE__ */ p(w, {
|
|
662
|
-
fullWidth: !0,
|
|
663
|
-
size: "small",
|
|
664
|
-
label: "Notes (optional)",
|
|
665
|
-
placeholder: "Anything worth recording about this pickup",
|
|
666
|
-
value: B.notes,
|
|
667
|
-
onChange: (e) => G("notes", e.target.value)
|
|
668
|
-
})
|
|
669
|
-
})]
|
|
670
|
-
}),
|
|
671
|
-
/* @__PURE__ */ m(C, {
|
|
672
|
-
direction: "row",
|
|
673
|
-
spacing: 1,
|
|
674
|
-
sx: { mt: 2 },
|
|
675
|
-
flexWrap: "wrap",
|
|
676
|
-
useFlexGap: !0,
|
|
677
|
-
children: [
|
|
678
|
-
/* @__PURE__ */ p(x, {
|
|
679
|
-
size: "small",
|
|
680
|
-
label: `Product · ${W.productName}`
|
|
681
|
-
}),
|
|
682
|
-
W.lotNumber ? /* @__PURE__ */ p(x, {
|
|
683
|
-
size: "small",
|
|
684
|
-
label: `Lot · ${W.lotNumber}`
|
|
685
|
-
}) : null,
|
|
686
|
-
W.expiryDate ? /* @__PURE__ */ p(x, {
|
|
687
|
-
size: "small",
|
|
688
|
-
label: `Expiry · ${o(W.expiryDate)}`
|
|
689
|
-
}) : null,
|
|
690
|
-
W.storageUnitName ? /* @__PURE__ */ p(x, {
|
|
691
|
-
size: "small",
|
|
692
|
-
label: `From · ${W.storageUnitName}`
|
|
693
|
-
}) : null
|
|
694
|
-
]
|
|
695
|
-
})
|
|
696
|
-
]
|
|
697
|
-
})
|
|
698
|
-
}) : null
|
|
742
|
+
})
|
|
699
743
|
]
|
|
700
744
|
})
|
|
701
745
|
})] });
|
|
702
746
|
}
|
|
703
747
|
//#endregion
|
|
704
|
-
export {
|
|
748
|
+
export { B as default };
|
|
705
749
|
|
|
706
|
-
//# sourceMappingURL=PickupCreatePage-
|
|
750
|
+
//# sourceMappingURL=PickupCreatePage-BeYhR45k.js.map
|