@argusoft/medplat-product-management 1.0.0 → 1.0.2
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-CSA3meke.js +385 -0
- package/dist/BrandsPage-CSA3meke.js.map +1 -0
- package/dist/CategoriesPage-BrspzkJL.js +340 -0
- package/dist/CategoriesPage-BrspzkJL.js.map +1 -0
- package/dist/{DashboardPage-BNKUQj46.js → DashboardPage-CqaquOs2.js} +21 -22
- package/dist/{DashboardPage-BNKUQj46.js.map → DashboardPage-CqaquOs2.js.map} +1 -1
- package/dist/{FacilityPicker-Coi8I3yE.js → FacilityPicker-Dv_H95WW.js} +13 -13
- package/dist/{FacilityPicker-Coi8I3yE.js.map → FacilityPicker-Dv_H95WW.js.map} +1 -1
- package/dist/{InventoryPage-BR6jOzg2.js → InventoryPage-CPbzfDMR.js} +12 -12
- package/dist/{InventoryPage-BR6jOzg2.js.map → InventoryPage-CPbzfDMR.js.map} +1 -1
- package/dist/{MemberProfileCard-DbHZCS5n.js → MemberProfileCard-0vjO3Gzd.js} +2 -2
- package/dist/{MemberProfileCard-DbHZCS5n.js.map → MemberProfileCard-0vjO3Gzd.js.map} +1 -1
- package/dist/{PaymentCreatePage-Ci3ERnby.js → PaymentCreatePage-BYmDZAIB.js} +9 -10
- package/dist/{PaymentCreatePage-Ci3ERnby.js.map → PaymentCreatePage-BYmDZAIB.js.map} +1 -1
- package/dist/{PaymentsPage-sdg902zX.js → PaymentsPage-BXPvKon-.js} +16 -16
- package/dist/{PaymentsPage-sdg902zX.js.map → PaymentsPage-BXPvKon-.js.map} +1 -1
- package/dist/PickupCreatePage-CMGwoAXj.js +426 -0
- package/dist/PickupCreatePage-CMGwoAXj.js.map +1 -0
- package/dist/{PickupsPage-Ci2Ll0Kn.js → PickupsPage-D66_Wta4.js} +84 -39
- package/dist/PickupsPage-D66_Wta4.js.map +1 -0
- package/dist/PmTable-B9970kPY.js +375 -0
- package/dist/PmTable-B9970kPY.js.map +1 -0
- package/dist/{ProductEditPage-DL8gy85Y.js → ProductEditPage-B8qFTCW9.js} +226 -243
- package/dist/ProductEditPage-B8qFTCW9.js.map +1 -0
- package/dist/ProductsPage-C7_r9cKn.js +254 -0
- package/dist/ProductsPage-C7_r9cKn.js.map +1 -0
- package/dist/{PurchaseCreatePage-C3KMfBxJ.js → PurchaseCreatePage-CDfNDcKG.js} +150 -149
- package/dist/PurchaseCreatePage-CDfNDcKG.js.map +1 -0
- package/dist/{PurchaseRequestDetailPage-C0GYFJDl.js → PurchaseRequestDetailPage-C7aAwEqw.js} +15 -15
- package/dist/{PurchaseRequestDetailPage-C0GYFJDl.js.map → PurchaseRequestDetailPage-C7aAwEqw.js.map} +1 -1
- package/dist/{PurchaseRequestsPage-DvFH_tWe.js → PurchaseRequestsPage-BwCkbpaX.js} +14 -14
- package/dist/{PurchaseRequestsPage-DvFH_tWe.js.map → PurchaseRequestsPage-BwCkbpaX.js.map} +1 -1
- package/dist/{PurchasesPage-BCvLvSp4.js → PurchasesPage-CvaZouVy.js} +11 -12
- package/dist/{PurchasesPage-BCvLvSp4.js.map → PurchasesPage-CvaZouVy.js.map} +1 -1
- package/dist/{SaleCreatePage-DpkQMoTq.js → SaleCreatePage-DP1Qmltu.js} +30 -31
- package/dist/{SaleCreatePage-DpkQMoTq.js.map → SaleCreatePage-DP1Qmltu.js.map} +1 -1
- package/dist/{SalesPage-DUwgkEO-.js → SalesPage-CO3cdYX5.js} +18 -19
- package/dist/{SalesPage-DUwgkEO-.js.map → SalesPage-CO3cdYX5.js.map} +1 -1
- package/dist/{SettingsPage-CusC0jqJ.js → SettingsPage-DvVRwSFw.js} +104 -103
- package/dist/SettingsPage-DvVRwSFw.js.map +1 -0
- package/dist/StorageUnitsPage-B9Hr_RkW.js +470 -0
- package/dist/StorageUnitsPage-B9Hr_RkW.js.map +1 -0
- package/dist/{TransactionsPage-DDaK4VyY.js → TransactionsPage-HKIGwEZN.js} +127 -123
- package/dist/TransactionsPage-HKIGwEZN.js.map +1 -0
- package/dist/{TransferCreatePage-BxudLfhS.js → TransferCreatePage-DMuZqQ3c.js} +9 -9
- package/dist/{TransferCreatePage-BxudLfhS.js.map → TransferCreatePage-DMuZqQ3c.js.map} +1 -1
- package/dist/{TransfersPage-zgmt7teZ.js → TransfersPage-COIyouL4.js} +16 -16
- package/dist/{TransfersPage-zgmt7teZ.js.map → TransfersPage-COIyouL4.js.map} +1 -1
- package/dist/{VialsPage-CjqPfgpV.js → VialsPage-BNPUwGCU.js} +291 -224
- package/dist/VialsPage-BNPUwGCU.js.map +1 -0
- package/dist/{constants-BrA_hfAI.js → constants-5ZCZo-Zm.js} +5 -2
- package/dist/{constants-BrA_hfAI.js.map → constants-5ZCZo-Zm.js.map} +1 -1
- package/dist/{PmGuard-CjJBisaN.js → currency-ClRLIEg2.js} +186 -9
- package/dist/currency-ClRLIEg2.js.map +1 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/BrandsPage-DCMCVvDY.js +0 -334
- package/dist/BrandsPage-DCMCVvDY.js.map +0 -1
- package/dist/CategoriesPage-BpRhwfrc.js +0 -284
- package/dist/CategoriesPage-BpRhwfrc.js.map +0 -1
- package/dist/PickupCreatePage-CieMsgWV.js +0 -310
- package/dist/PickupCreatePage-CieMsgWV.js.map +0 -1
- package/dist/PickupsPage-Ci2Ll0Kn.js.map +0 -1
- package/dist/PmGuard-CjJBisaN.js.map +0 -1
- package/dist/PmTable-BuXZQZCU.js +0 -302
- package/dist/PmTable-BuXZQZCU.js.map +0 -1
- package/dist/ProductEditPage-DL8gy85Y.js.map +0 -1
- package/dist/ProductsPage-BANTKxLb.js +0 -221
- package/dist/ProductsPage-BANTKxLb.js.map +0 -1
- package/dist/PurchaseCreatePage-C3KMfBxJ.js.map +0 -1
- package/dist/SettingsPage-CusC0jqJ.js.map +0 -1
- package/dist/StorageUnitsPage-BlC2AgrJ.js +0 -469
- package/dist/StorageUnitsPage-BlC2AgrJ.js.map +0 -1
- package/dist/TransactionsPage-DDaK4VyY.js.map +0 -1
- package/dist/VialsPage-CjqPfgpV.js.map +0 -1
- package/dist/currency-BDDCDgeE.js +0 -169
- package/dist/currency-BDDCDgeE.js.map +0 -1
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
import { S as e, a as t, d as n, f as ee, i as te, l as ne, n as re, o as ie, ot as r, r as ae } from "./currency-ClRLIEg2.js";
|
|
2
|
+
import { c as oe, n as i, s as se, t as a } from "./PmTable-B9970kPY.js";
|
|
3
|
+
import { i as o, m as s, t as c } from "./validation-Ba7puFIO.js";
|
|
4
|
+
import { t as ce } from "./useFieldErrors-hDG8ox_x.js";
|
|
5
|
+
import { useState as l } from "react";
|
|
6
|
+
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
7
|
+
import { v4 as le } from "uuid";
|
|
8
|
+
import { Alert as ue, Box as f, Button as p, Checkbox as de, Chip as m, Dialog as fe, DialogActions as h, DialogContent as pe, DialogTitle as me, FormControlLabel as g, InputAdornment as _, Skeleton as v, Stack as y, TableBody as b, TableCell as x, TableHead as he, TableRow as S, TextField as C, Typography as w } from "@mui/material";
|
|
9
|
+
import T from "@mui/icons-material/AddRounded";
|
|
10
|
+
import ge from "@mui/icons-material/RefreshRounded";
|
|
11
|
+
import E from "@mui/icons-material/SellRounded";
|
|
12
|
+
import { showToast as D } from "@/common/toaster/toaster";
|
|
13
|
+
import O from "@/views/custom-components/CustomSwitch";
|
|
14
|
+
//#region src/views/BrandsPage.jsx
|
|
15
|
+
function k(e) {
|
|
16
|
+
if (!e) return {
|
|
17
|
+
phone: "",
|
|
18
|
+
email: ""
|
|
19
|
+
};
|
|
20
|
+
try {
|
|
21
|
+
let t = JSON.parse(e);
|
|
22
|
+
return {
|
|
23
|
+
phone: typeof t?.phone == "string" ? t.phone : "",
|
|
24
|
+
email: typeof t?.email == "string" ? t.email : ""
|
|
25
|
+
};
|
|
26
|
+
} catch {
|
|
27
|
+
return {
|
|
28
|
+
phone: "",
|
|
29
|
+
email: ""
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function A({ phone: e, email: t }) {
|
|
34
|
+
let n = {};
|
|
35
|
+
return e?.trim() && (n.phone = e.trim()), t?.trim() && (n.email = t.trim()), Object.keys(n).length ? JSON.stringify(n) : null;
|
|
36
|
+
}
|
|
37
|
+
function j() {
|
|
38
|
+
let j = t().has("update.manage.productManagement.brand"), M = n(ne()?.countryCode), [N, P] = l([]), [F, I] = l(!1), [L, R] = l(""), [_e, z] = l(!1), [B, V] = l(null), [H, ve] = l(!1), [U, W] = l(K()), G = ce();
|
|
39
|
+
function K() {
|
|
40
|
+
return {
|
|
41
|
+
id: "",
|
|
42
|
+
name: "",
|
|
43
|
+
manufacturerCode: "",
|
|
44
|
+
contactPhone: "",
|
|
45
|
+
contactEmail: "",
|
|
46
|
+
isActive: !0
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
async function q() {
|
|
50
|
+
I(!0), R("");
|
|
51
|
+
try {
|
|
52
|
+
P(await e(void 0, !0));
|
|
53
|
+
} catch (e) {
|
|
54
|
+
let t = e?.response?.data?.message ?? e?.message ?? "Failed to load brands";
|
|
55
|
+
R(t), D({
|
|
56
|
+
message: t,
|
|
57
|
+
type: "error"
|
|
58
|
+
});
|
|
59
|
+
} finally {
|
|
60
|
+
I(!1);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
te("view.manage.productManagement.brand", () => {
|
|
64
|
+
q();
|
|
65
|
+
}, []);
|
|
66
|
+
function J() {
|
|
67
|
+
V(null), W({
|
|
68
|
+
...K(),
|
|
69
|
+
id: le()
|
|
70
|
+
}), G.reset(), R(""), z(!0);
|
|
71
|
+
}
|
|
72
|
+
function ye(e) {
|
|
73
|
+
let { phone: t, email: n } = k(e.contactInfo);
|
|
74
|
+
V(e), G.reset(), R(""), W({
|
|
75
|
+
id: e.id,
|
|
76
|
+
name: e.name ?? "",
|
|
77
|
+
manufacturerCode: e.manufacturerCode ?? "",
|
|
78
|
+
contactPhone: t,
|
|
79
|
+
contactEmail: n,
|
|
80
|
+
isActive: e.isActive !== !1
|
|
81
|
+
}), z(!0);
|
|
82
|
+
}
|
|
83
|
+
let Y = s(U.manufacturerCode, "Manufacturer code"), X = U.manufacturerCode.trim().toUpperCase(), be = !Y && X && N.some((e) => e.id !== U.id && (e.manufacturerCode || "").toUpperCase() === X), Z = {
|
|
84
|
+
name: s(U.name, "Name"),
|
|
85
|
+
manufacturerCode: Y || (be ? "Code is already in use — edit it manually to make it unique." : ""),
|
|
86
|
+
contactPhone: ee(U.contactPhone, M),
|
|
87
|
+
contactEmail: o(U.contactEmail)
|
|
88
|
+
}, Q = c(Z);
|
|
89
|
+
async function xe() {
|
|
90
|
+
if (!Q) {
|
|
91
|
+
G.markAllTouched(), R("Please fix the highlighted fields.");
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
try {
|
|
95
|
+
await r({
|
|
96
|
+
id: U.id,
|
|
97
|
+
name: U.name.trim(),
|
|
98
|
+
manufacturerCode: U.manufacturerCode.trim().toUpperCase(),
|
|
99
|
+
contactInfo: A({
|
|
100
|
+
phone: U.contactPhone,
|
|
101
|
+
email: U.contactEmail
|
|
102
|
+
}),
|
|
103
|
+
isActive: U.isActive
|
|
104
|
+
}), D({
|
|
105
|
+
message: "Brand saved.",
|
|
106
|
+
type: "success"
|
|
107
|
+
}), z(!1), await q();
|
|
108
|
+
} catch (e) {
|
|
109
|
+
let t = e?.response?.data?.message ?? e?.message ?? "Failed to save brand";
|
|
110
|
+
R(t), D({
|
|
111
|
+
message: t,
|
|
112
|
+
type: "error"
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
let $ = H ? N : N.filter((e) => e.isActive !== !1);
|
|
117
|
+
return /* @__PURE__ */ d(f, { children: [/* @__PURE__ */ u(ae, {}), /* @__PURE__ */ d(re, {
|
|
118
|
+
perm: "view.manage.productManagement.brand",
|
|
119
|
+
children: [/* @__PURE__ */ d(ie, {
|
|
120
|
+
title: "Brands",
|
|
121
|
+
subtitle: "The manufacturer or supplier of each product.",
|
|
122
|
+
chips: ["Catalog"],
|
|
123
|
+
actions: /* @__PURE__ */ d(y, {
|
|
124
|
+
direction: "row",
|
|
125
|
+
spacing: 1,
|
|
126
|
+
children: [/* @__PURE__ */ u(p, {
|
|
127
|
+
variant: "outlined",
|
|
128
|
+
startIcon: /* @__PURE__ */ u(ge, {}),
|
|
129
|
+
onClick: () => void q(),
|
|
130
|
+
children: "Refresh"
|
|
131
|
+
}), j ? /* @__PURE__ */ u(p, {
|
|
132
|
+
variant: "contained",
|
|
133
|
+
startIcon: /* @__PURE__ */ u(T, {}),
|
|
134
|
+
onClick: J,
|
|
135
|
+
children: "New Brand"
|
|
136
|
+
}) : null]
|
|
137
|
+
}),
|
|
138
|
+
children: [L ? /* @__PURE__ */ u(ue, {
|
|
139
|
+
severity: "error",
|
|
140
|
+
sx: { mb: 2 },
|
|
141
|
+
children: L
|
|
142
|
+
}) : null, /* @__PURE__ */ u(oe, {
|
|
143
|
+
eyebrow: "Master data",
|
|
144
|
+
title: "Brands",
|
|
145
|
+
subtitle: F ? "Loading…" : `${$.length} ${$.length === 1 ? "brand" : "brands"}`,
|
|
146
|
+
actions: /* @__PURE__ */ u(g, {
|
|
147
|
+
control: /* @__PURE__ */ u(O, {
|
|
148
|
+
checked: H,
|
|
149
|
+
onChange: (e) => ve(e.target.checked)
|
|
150
|
+
}),
|
|
151
|
+
label: /* @__PURE__ */ u(w, {
|
|
152
|
+
variant: "body2",
|
|
153
|
+
sx: { fontWeight: 600 },
|
|
154
|
+
children: "Show inactive"
|
|
155
|
+
}),
|
|
156
|
+
labelPlacement: "start",
|
|
157
|
+
sx: {
|
|
158
|
+
mr: .5,
|
|
159
|
+
ml: 0
|
|
160
|
+
}
|
|
161
|
+
}),
|
|
162
|
+
children: /* @__PURE__ */ d(se, { children: [/* @__PURE__ */ u(he, { children: /* @__PURE__ */ d(S, { children: [
|
|
163
|
+
/* @__PURE__ */ u(x, { children: "Name" }),
|
|
164
|
+
/* @__PURE__ */ u(x, { children: "Manufacturer Code" }),
|
|
165
|
+
/* @__PURE__ */ u(x, { children: "Contact" }),
|
|
166
|
+
/* @__PURE__ */ u(x, { children: "Status" }),
|
|
167
|
+
/* @__PURE__ */ u(x, {
|
|
168
|
+
align: "right",
|
|
169
|
+
children: "Action"
|
|
170
|
+
})
|
|
171
|
+
] }) }), /* @__PURE__ */ u(b, { children: F ? Array.from({ length: 4 }).map((e, t) => /* @__PURE__ */ u(S, { children: Array.from({ length: 5 }).map((e, t) => /* @__PURE__ */ u(x, { children: /* @__PURE__ */ u(v, { height: 22 }) }, t)) }, t)) : $.length === 0 ? /* @__PURE__ */ u(a, {
|
|
172
|
+
colSpan: 5,
|
|
173
|
+
icon: E,
|
|
174
|
+
title: N.length === 0 ? "No brands yet" : "No active brands",
|
|
175
|
+
hint: N.length === 0 ? "Add manufacturers so you can link them to your products." : "Turn on “Show inactive” to see deactivated brands.",
|
|
176
|
+
action: N.length === 0 && j ? /* @__PURE__ */ u(p, {
|
|
177
|
+
variant: "contained",
|
|
178
|
+
size: "small",
|
|
179
|
+
startIcon: /* @__PURE__ */ u(T, {}),
|
|
180
|
+
onClick: J,
|
|
181
|
+
children: "Create first brand"
|
|
182
|
+
}) : null
|
|
183
|
+
}) : $.map((e) => {
|
|
184
|
+
let { phone: t, email: n } = k(e.contactInfo);
|
|
185
|
+
return /* @__PURE__ */ d(S, {
|
|
186
|
+
hover: !0,
|
|
187
|
+
children: [
|
|
188
|
+
/* @__PURE__ */ u(x, {
|
|
189
|
+
sx: { maxWidth: 240 },
|
|
190
|
+
children: /* @__PURE__ */ u(w, {
|
|
191
|
+
variant: "body2",
|
|
192
|
+
sx: {
|
|
193
|
+
fontWeight: 700,
|
|
194
|
+
wordBreak: "break-word"
|
|
195
|
+
},
|
|
196
|
+
children: e.name
|
|
197
|
+
})
|
|
198
|
+
}),
|
|
199
|
+
/* @__PURE__ */ u(x, {
|
|
200
|
+
sx: { maxWidth: 160 },
|
|
201
|
+
children: /* @__PURE__ */ u(f, {
|
|
202
|
+
component: "span",
|
|
203
|
+
sx: {
|
|
204
|
+
display: "inline-block",
|
|
205
|
+
px: .85,
|
|
206
|
+
py: .25,
|
|
207
|
+
borderRadius: 1,
|
|
208
|
+
bgcolor: "grey.100",
|
|
209
|
+
fontFamily: "monospace",
|
|
210
|
+
fontSize: "0.72rem",
|
|
211
|
+
fontWeight: 800,
|
|
212
|
+
maxWidth: "100%",
|
|
213
|
+
wordBreak: "break-all"
|
|
214
|
+
},
|
|
215
|
+
children: e.manufacturerCode
|
|
216
|
+
})
|
|
217
|
+
}),
|
|
218
|
+
/* @__PURE__ */ u(x, { children: t || n ? /* @__PURE__ */ d(y, {
|
|
219
|
+
spacing: .25,
|
|
220
|
+
children: [t ? /* @__PURE__ */ u(w, {
|
|
221
|
+
variant: "caption",
|
|
222
|
+
sx: { fontWeight: 600 },
|
|
223
|
+
children: t
|
|
224
|
+
}) : null, n ? /* @__PURE__ */ u(w, {
|
|
225
|
+
variant: "caption",
|
|
226
|
+
color: "text.secondary",
|
|
227
|
+
children: n
|
|
228
|
+
}) : null]
|
|
229
|
+
}) : /* @__PURE__ */ u(w, {
|
|
230
|
+
variant: "caption",
|
|
231
|
+
color: "text.disabled",
|
|
232
|
+
children: "—"
|
|
233
|
+
}) }),
|
|
234
|
+
/* @__PURE__ */ u(x, { children: /* @__PURE__ */ u(m, {
|
|
235
|
+
size: "small",
|
|
236
|
+
label: e.isActive ? "Active" : "Inactive",
|
|
237
|
+
color: e.isActive ? "success" : "default",
|
|
238
|
+
variant: e.isActive ? "filled" : "outlined",
|
|
239
|
+
sx: {
|
|
240
|
+
fontWeight: 700,
|
|
241
|
+
borderRadius: 1.5,
|
|
242
|
+
height: 22
|
|
243
|
+
}
|
|
244
|
+
}) }),
|
|
245
|
+
/* @__PURE__ */ u(x, {
|
|
246
|
+
align: "right",
|
|
247
|
+
children: j ? /* @__PURE__ */ u(p, {
|
|
248
|
+
size: "small",
|
|
249
|
+
variant: "outlined",
|
|
250
|
+
onClick: () => ye(e),
|
|
251
|
+
children: "Edit"
|
|
252
|
+
}) : null
|
|
253
|
+
})
|
|
254
|
+
]
|
|
255
|
+
}, e.id);
|
|
256
|
+
}) })] })
|
|
257
|
+
})]
|
|
258
|
+
}), /* @__PURE__ */ d(fe, {
|
|
259
|
+
open: _e,
|
|
260
|
+
onClose: () => z(!1),
|
|
261
|
+
fullWidth: !0,
|
|
262
|
+
maxWidth: "sm",
|
|
263
|
+
children: [
|
|
264
|
+
/* @__PURE__ */ u(me, { children: B ? "Edit Brand" : "New Brand" }),
|
|
265
|
+
/* @__PURE__ */ u(pe, {
|
|
266
|
+
dividers: !0,
|
|
267
|
+
children: /* @__PURE__ */ d(y, {
|
|
268
|
+
spacing: 2,
|
|
269
|
+
sx: { pt: 1 },
|
|
270
|
+
children: [
|
|
271
|
+
/* @__PURE__ */ u(C, {
|
|
272
|
+
required: !0,
|
|
273
|
+
label: "Name",
|
|
274
|
+
size: "small",
|
|
275
|
+
fullWidth: !0,
|
|
276
|
+
value: U.name,
|
|
277
|
+
inputProps: { maxLength: 255 },
|
|
278
|
+
onChange: (e) => {
|
|
279
|
+
let t = e.target.value, n = t.split(/\s+/).filter(Boolean).map((e) => e[0]).join("").toUpperCase();
|
|
280
|
+
W((e) => ({
|
|
281
|
+
...e,
|
|
282
|
+
name: t,
|
|
283
|
+
manufacturerCode: B ? e.manufacturerCode : n
|
|
284
|
+
}));
|
|
285
|
+
},
|
|
286
|
+
onBlur: G.onBlur("name"),
|
|
287
|
+
error: G.show("name") && !!Z.name,
|
|
288
|
+
FormHelperTextProps: { component: "div" },
|
|
289
|
+
helperText: /* @__PURE__ */ u(i, {
|
|
290
|
+
message: G.show("name") ? Z.name : "",
|
|
291
|
+
value: U.name,
|
|
292
|
+
max: 255
|
|
293
|
+
})
|
|
294
|
+
}),
|
|
295
|
+
/* @__PURE__ */ u(C, {
|
|
296
|
+
required: !0,
|
|
297
|
+
label: "Manufacturer code",
|
|
298
|
+
size: "small",
|
|
299
|
+
fullWidth: !0,
|
|
300
|
+
value: U.manufacturerCode,
|
|
301
|
+
inputProps: { maxLength: 100 },
|
|
302
|
+
onChange: (e) => W({
|
|
303
|
+
...U,
|
|
304
|
+
manufacturerCode: e.target.value.toUpperCase()
|
|
305
|
+
}),
|
|
306
|
+
onBlur: G.onBlur("manufacturerCode"),
|
|
307
|
+
error: G.show("manufacturerCode") && !!Z.manufacturerCode,
|
|
308
|
+
FormHelperTextProps: { component: "div" },
|
|
309
|
+
helperText: /* @__PURE__ */ u(i, {
|
|
310
|
+
message: G.show("manufacturerCode") && Z.manufacturerCode ? Z.manufacturerCode : "Auto-generated from the name as initials. Edit if needed to make it unique.",
|
|
311
|
+
value: U.manufacturerCode,
|
|
312
|
+
max: 100
|
|
313
|
+
})
|
|
314
|
+
}),
|
|
315
|
+
/* @__PURE__ */ u(C, {
|
|
316
|
+
label: "Contact Number",
|
|
317
|
+
size: "small",
|
|
318
|
+
fullWidth: !0,
|
|
319
|
+
type: "tel",
|
|
320
|
+
placeholder: M ? M.phoneMin === M.phoneMax ? `${M.phoneMin}-digit local number` : `${M.phoneMin}–${M.phoneMax} digit local number` : "Local number",
|
|
321
|
+
value: U.contactPhone,
|
|
322
|
+
onChange: (e) => W({
|
|
323
|
+
...U,
|
|
324
|
+
contactPhone: e.target.value.replace(/[^\d\s]/g, "")
|
|
325
|
+
}),
|
|
326
|
+
onBlur: G.onBlur("contactPhone"),
|
|
327
|
+
error: G.show("contactPhone") && !!Z.contactPhone,
|
|
328
|
+
helperText: G.show("contactPhone") && Z.contactPhone ? Z.contactPhone : M ? `Format for ${M.name}: ${M.phoneCode} followed by ${M.phoneMin}${M.phoneMin === M.phoneMax ? "" : `–${M.phoneMax}`} digits.` : "Local number, digits only.",
|
|
329
|
+
InputProps: M ? { startAdornment: /* @__PURE__ */ u(_, {
|
|
330
|
+
position: "start",
|
|
331
|
+
children: /* @__PURE__ */ u(f, {
|
|
332
|
+
component: "span",
|
|
333
|
+
sx: {
|
|
334
|
+
fontWeight: 700,
|
|
335
|
+
color: "text.secondary"
|
|
336
|
+
},
|
|
337
|
+
children: M.phoneCode
|
|
338
|
+
})
|
|
339
|
+
}) } : void 0
|
|
340
|
+
}),
|
|
341
|
+
/* @__PURE__ */ u(C, {
|
|
342
|
+
label: "Email",
|
|
343
|
+
size: "small",
|
|
344
|
+
fullWidth: !0,
|
|
345
|
+
type: "email",
|
|
346
|
+
placeholder: "e.g. contact@manufacturer.example",
|
|
347
|
+
value: U.contactEmail,
|
|
348
|
+
onChange: (e) => W({
|
|
349
|
+
...U,
|
|
350
|
+
contactEmail: e.target.value
|
|
351
|
+
}),
|
|
352
|
+
onBlur: G.onBlur("contactEmail"),
|
|
353
|
+
error: G.show("contactEmail") && !!Z.contactEmail,
|
|
354
|
+
helperText: G.show("contactEmail") ? Z.contactEmail : ""
|
|
355
|
+
}),
|
|
356
|
+
/* @__PURE__ */ u(g, {
|
|
357
|
+
control: /* @__PURE__ */ u(de, {
|
|
358
|
+
checked: U.isActive,
|
|
359
|
+
onChange: (e) => W({
|
|
360
|
+
...U,
|
|
361
|
+
isActive: e.target.checked
|
|
362
|
+
})
|
|
363
|
+
}),
|
|
364
|
+
label: "Active"
|
|
365
|
+
})
|
|
366
|
+
]
|
|
367
|
+
})
|
|
368
|
+
}),
|
|
369
|
+
/* @__PURE__ */ d(h, { children: [/* @__PURE__ */ u(p, {
|
|
370
|
+
onClick: () => z(!1),
|
|
371
|
+
children: "Cancel"
|
|
372
|
+
}), /* @__PURE__ */ u(p, {
|
|
373
|
+
variant: "contained",
|
|
374
|
+
disabled: !Q,
|
|
375
|
+
onClick: () => void xe(),
|
|
376
|
+
children: "Save"
|
|
377
|
+
})] })
|
|
378
|
+
]
|
|
379
|
+
})]
|
|
380
|
+
})] });
|
|
381
|
+
}
|
|
382
|
+
//#endregion
|
|
383
|
+
export { j as default };
|
|
384
|
+
|
|
385
|
+
//# sourceMappingURL=BrandsPage-CSA3meke.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BrandsPage-CSA3meke.js","names":[],"sources":["../src/views/BrandsPage.jsx"],"sourcesContent":["import { useState } from 'react';\nimport { v4 as uuidv4 } from 'uuid';\nimport {\n Alert,\n Box,\n Button,\n Checkbox,\n Chip,\n Dialog,\n DialogActions,\n DialogContent,\n DialogTitle,\n FormControlLabel,\n InputAdornment,\n Skeleton,\n Stack,\n TableBody,\n TableCell,\n TableHead,\n TableRow,\n TextField,\n Typography,\n} from '@mui/material';\nimport AddRoundedIcon from '@mui/icons-material/AddRounded';\nimport RefreshRoundedIcon from '@mui/icons-material/RefreshRounded';\nimport SellRoundedIcon from '@mui/icons-material/SellRounded';\nimport { showToast } from '@/common/toaster/toaster';\nimport CustomSwitch from '@/views/custom-components/CustomSwitch';\nimport PmPageShell from '@pm/components/PmPageShell';\nimport PmNav from '@pm/components/PmNav';\nimport PmGuard from '@pm/components/PmGuard';\nimport { usePermissionedEffect, usePmPermissions } from '@pm/utils/permissions';\nimport { PmEmptyRow, PmFieldHelp, PmTable, PmTableCard } from '@pm/components/PmTable';\nimport { getBrands, upsertBrand } from '@pm/services/pmApi';\nimport { isClean, validateEmail, validateRequired } from '@pm/utils/validation';\nimport { findCountry, validatePhoneForCountry } from '@pm/utils/countries';\nimport { usePmSettings } from '@pm/utils/settingsStore';\nimport { useFieldErrors } from '@pm/utils/useFieldErrors';\n\n// Backend stores contact_info as a JSON-encoded string. We keep the discrete\n// fields here so the UI is form-friendly, and only ever round-trip the JSON.\nfunction parseContactInfo(raw) {\n if (!raw) return { phone: '', email: '' };\n try {\n const obj = JSON.parse(raw);\n return {\n phone: typeof obj?.phone === 'string' ? obj.phone : '',\n email: typeof obj?.email === 'string' ? obj.email : '',\n };\n } catch {\n return { phone: '', email: '' };\n }\n}\n\nfunction serializeContactInfo({ phone, email }) {\n const out = {};\n if (phone?.trim()) out.phone = phone.trim();\n if (email?.trim()) out.email = email.trim();\n return Object.keys(out).length ? JSON.stringify(out) : null;\n}\n\nexport default function BrandsPage() {\n const perms = usePmPermissions();\n const canWrite = perms.has('update.manage.productManagement.brand');\n const settings = usePmSettings();\n const country = findCountry(settings?.countryCode);\n const [items, setItems] = useState([]);\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState('');\n const [openDialog, setOpenDialog] = useState(false);\n const [editing, setEditing] = useState(null);\n // Default to active-only; the toggle above the table reveals inactive rows.\n const [showInactive, setShowInactive] = useState(false);\n const [form, setForm] = useState(emptyForm());\n const fieldErrors = useFieldErrors();\n\n function emptyForm() {\n return {\n id: '',\n name: '',\n manufacturerCode: '',\n contactPhone: '',\n contactEmail: '',\n isActive: true,\n };\n }\n\n async function load() {\n setLoading(true);\n setError('');\n try {\n const data = await getBrands(undefined, true);\n setItems(data);\n } catch (err) {\n const message = err?.response?.data?.message ?? err?.message ?? 'Failed to load brands';\n setError(message);\n showToast({ message, type: 'error' });\n } finally {\n setLoading(false);\n }\n }\n\n usePermissionedEffect('view.manage.productManagement.brand', () => {\n void load();\n }, []);\n\n function openCreate() {\n setEditing(null);\n setForm({ ...emptyForm(), id: uuidv4() });\n fieldErrors.reset();\n setError('');\n setOpenDialog(true);\n }\n\n function openEdit(item) {\n const { phone, email } = parseContactInfo(item.contactInfo);\n setEditing(item);\n fieldErrors.reset();\n setError('');\n setForm({\n id: item.id,\n name: item.name ?? '',\n manufacturerCode: item.manufacturerCode ?? '',\n contactPhone: phone,\n contactEmail: email,\n isActive: item.isActive !== false,\n });\n setOpenDialog(true);\n }\n\n const mfrCodeBase = validateRequired(form.manufacturerCode, 'Manufacturer code');\n const mfrNorm = form.manufacturerCode.trim().toUpperCase();\n const mfrClash = !mfrCodeBase\n && mfrNorm\n && items.some((b) => b.id !== form.id && (b.manufacturerCode || '').toUpperCase() === mfrNorm);\n const formErrors = {\n name: validateRequired(form.name, 'Name'),\n manufacturerCode: mfrCodeBase || (mfrClash ? 'Code is already in use — edit it manually to make it unique.' : ''),\n contactPhone: validatePhoneForCountry(form.contactPhone, country),\n contactEmail: validateEmail(form.contactEmail),\n };\n const formIsValid = isClean(formErrors);\n\n async function save() {\n if (!formIsValid) {\n fieldErrors.markAllTouched();\n setError('Please fix the highlighted fields.');\n return;\n }\n try {\n await upsertBrand({\n id: form.id,\n name: form.name.trim(),\n manufacturerCode: form.manufacturerCode.trim().toUpperCase(),\n contactInfo: serializeContactInfo({\n phone: form.contactPhone,\n email: form.contactEmail,\n }),\n isActive: form.isActive,\n });\n showToast({ message: 'Brand saved.', type: 'success' });\n setOpenDialog(false);\n await load();\n } catch (err) {\n const message = err?.response?.data?.message ?? err?.message ?? 'Failed to save brand';\n setError(message);\n showToast({ message, type: 'error' });\n }\n }\n\n const visible = showInactive ? items : items.filter((b) => b.isActive !== false);\n\n return (\n <Box>\n <PmNav />\n <PmGuard perm={'view.manage.productManagement.brand'}>\n <PmPageShell\n title=\"Brands\"\n subtitle=\"The manufacturer or supplier of each product.\"\n chips={['Catalog']}\n actions={\n <Stack direction=\"row\" spacing={1}>\n <Button variant=\"outlined\" startIcon={<RefreshRoundedIcon />} onClick={() => void load()}>Refresh</Button>\n {canWrite ? (\n <Button variant=\"contained\" startIcon={<AddRoundedIcon />} onClick={openCreate}>New Brand</Button>\n ) : null}\n </Stack>\n }\n >\n {error ? <Alert severity=\"error\" sx={{ mb: 2 }}>{error}</Alert> : null}\n\n <PmTableCard\n eyebrow=\"Master data\"\n title=\"Brands\"\n subtitle={loading ? 'Loading…' : `${visible.length} ${visible.length === 1 ? 'brand' : 'brands'}`}\n actions={\n <FormControlLabel\n control={<CustomSwitch checked={showInactive}\n onChange={(e) => setShowInactive(e.target.checked)} />}\n label={<Typography variant=\"body2\" sx={{ fontWeight: 600 }}>Show inactive</Typography>}\n labelPlacement=\"start\"\n sx={{ mr: 0.5, ml: 0 }}\n />\n }\n >\n <PmTable>\n <TableHead>\n <TableRow>\n <TableCell>Name</TableCell>\n <TableCell>Manufacturer Code</TableCell>\n <TableCell>Contact</TableCell>\n <TableCell>Status</TableCell>\n <TableCell align=\"right\">Action</TableCell>\n </TableRow>\n </TableHead>\n <TableBody>\n {loading ? (\n Array.from({ length: 4 }).map((_, i) => (\n <TableRow key={i}>\n {Array.from({ length: 5 }).map((__, j) => (\n <TableCell key={j}><Skeleton height={22} /></TableCell>\n ))}\n </TableRow>\n ))\n ) : visible.length === 0 ? (\n <PmEmptyRow\n colSpan={5}\n icon={SellRoundedIcon}\n title={items.length === 0 ? 'No brands yet' : 'No active brands'}\n hint={items.length === 0\n ? 'Add manufacturers so you can link them to your products.'\n : 'Turn on “Show inactive” to see deactivated brands.'}\n action={items.length === 0 && canWrite ? (\n <Button variant=\"contained\" size=\"small\" startIcon={<AddRoundedIcon />} onClick={openCreate}>\n Create first brand\n </Button>\n ) : null}\n />\n ) : visible.map((b) => {\n const { phone, email } = parseContactInfo(b.contactInfo);\n return (\n <TableRow key={b.id} hover>\n <TableCell sx={{ maxWidth: 240 }}>\n <Typography variant=\"body2\" sx={{ fontWeight: 700, wordBreak: 'break-word' }}>{b.name}</Typography>\n </TableCell>\n <TableCell sx={{ maxWidth: 160 }}>\n <Box component=\"span\" sx={{\n display: 'inline-block', px: 0.85, py: 0.25, borderRadius: 1,\n bgcolor: 'grey.100', fontFamily: 'monospace', fontSize: '0.72rem', fontWeight: 800,\n maxWidth: '100%', wordBreak: 'break-all',\n }}>\n {b.manufacturerCode}\n </Box>\n </TableCell>\n <TableCell>\n {phone || email ? (\n <Stack spacing={0.25}>\n {phone ? <Typography variant=\"caption\" sx={{ fontWeight: 600 }}>{phone}</Typography> : null}\n {email ? <Typography variant=\"caption\" color=\"text.secondary\">{email}</Typography> : null}\n </Stack>\n ) : <Typography variant=\"caption\" color=\"text.disabled\">—</Typography>}\n </TableCell>\n <TableCell>\n <Chip\n size=\"small\"\n label={b.isActive ? 'Active' : 'Inactive'}\n color={b.isActive ? 'success' : 'default'}\n variant={b.isActive ? 'filled' : 'outlined'}\n sx={{ fontWeight: 700, borderRadius: 1.5, height: 22 }}\n />\n </TableCell>\n <TableCell align=\"right\">\n {canWrite ? (\n <Button size=\"small\" variant=\"outlined\" onClick={() => openEdit(b)}>Edit</Button>\n ) : null}\n </TableCell>\n </TableRow>\n );\n })}\n </TableBody>\n </PmTable>\n </PmTableCard>\n </PmPageShell>\n\n <Dialog open={openDialog} onClose={() => setOpenDialog(false)} fullWidth maxWidth=\"sm\">\n <DialogTitle>{editing ? 'Edit Brand' : 'New Brand'}</DialogTitle>\n <DialogContent dividers>\n <Stack spacing={2} sx={{ pt: 1 }}>\n <TextField\n required\n label=\"Name\" size=\"small\" fullWidth\n value={form.name}\n inputProps={{ maxLength: 255 }}\n onChange={(e) => {\n const nextName = e.target.value;\n // Auto-derive manufacturer code from initials of every word — but\n // only on create (when editing an existing brand we never overwrite\n // a code the user has already curated).\n const initialsFromName = nextName\n .split(/\\s+/)\n .filter(Boolean)\n .map((w) => w[0])\n .join('')\n .toUpperCase();\n setForm((f) => ({\n ...f,\n name: nextName,\n manufacturerCode: editing ? f.manufacturerCode : initialsFromName,\n }));\n }}\n onBlur={fieldErrors.onBlur('name')}\n error={fieldErrors.show('name') && !!formErrors.name}\n FormHelperTextProps={{ component: 'div' }}\n helperText={<PmFieldHelp message={fieldErrors.show('name') ? formErrors.name : ''} value={form.name} max={255} />}\n />\n <TextField\n required\n label=\"Manufacturer code\" size=\"small\" fullWidth\n value={form.manufacturerCode}\n inputProps={{ maxLength: 100 }}\n onChange={(e) => setForm({ ...form, manufacturerCode: e.target.value.toUpperCase() })}\n onBlur={fieldErrors.onBlur('manufacturerCode')}\n error={fieldErrors.show('manufacturerCode') && !!formErrors.manufacturerCode}\n FormHelperTextProps={{ component: 'div' }}\n helperText={\n <PmFieldHelp\n message={fieldErrors.show('manufacturerCode') && formErrors.manufacturerCode\n ? formErrors.manufacturerCode\n : 'Auto-generated from the name as initials. Edit if needed to make it unique.'}\n value={form.manufacturerCode}\n max={100}\n />\n }\n />\n <TextField\n label=\"Contact Number\"\n size=\"small\"\n fullWidth\n type=\"tel\"\n placeholder={country\n ? (country.phoneMin === country.phoneMax\n ? `${country.phoneMin}-digit local number`\n : `${country.phoneMin}–${country.phoneMax} digit local number`)\n : 'Local number'}\n value={form.contactPhone}\n // Keep only digits and spaces — the dial code lives in the\n // adornment, not in the value.\n onChange={(e) => setForm({ ...form, contactPhone: e.target.value.replace(/[^\\d\\s]/g, '') })}\n onBlur={fieldErrors.onBlur('contactPhone')}\n error={fieldErrors.show('contactPhone') && !!formErrors.contactPhone}\n helperText={\n fieldErrors.show('contactPhone') && formErrors.contactPhone\n ? formErrors.contactPhone\n : country\n ? `Format for ${country.name}: ${country.phoneCode} followed by ${country.phoneMin}${country.phoneMin === country.phoneMax ? '' : `–${country.phoneMax}`} digits.`\n : 'Local number, digits only.'\n }\n InputProps={country ? {\n startAdornment: (\n <InputAdornment position=\"start\">\n <Box component=\"span\" sx={{ fontWeight: 700, color: 'text.secondary' }}>{country.phoneCode}</Box>\n </InputAdornment>\n ),\n } : undefined}\n />\n <TextField\n label=\"Email\"\n size=\"small\"\n fullWidth\n type=\"email\"\n placeholder=\"e.g. contact@manufacturer.example\"\n value={form.contactEmail}\n onChange={(e) => setForm({ ...form, contactEmail: e.target.value })}\n onBlur={fieldErrors.onBlur('contactEmail')}\n error={fieldErrors.show('contactEmail') && !!formErrors.contactEmail}\n helperText={fieldErrors.show('contactEmail') ? formErrors.contactEmail : ''}\n />\n <FormControlLabel\n control={<Checkbox checked={form.isActive}\n onChange={(e) => setForm({ ...form, isActive: e.target.checked })} />}\n label=\"Active\" />\n </Stack>\n </DialogContent>\n <DialogActions>\n <Button onClick={() => setOpenDialog(false)}>Cancel</Button>\n <Button variant=\"contained\" disabled={!formIsValid} onClick={() => void save()}>Save</Button>\n </DialogActions>\n </Dialog>\n </PmGuard>\n </Box>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAyCA,SAAS,EAAiB,GAAK;CAC7B,IA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