@feedmepos/mf-inventory-portal 0.0.21-dev.4 → 0.0.21-dev.5
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/ApprovalView-BHoJzHuo.js +129 -0
- package/dist/{BindingsDialog-BFLeun5L.js → BindingsDialog-sUZjZtSl.js} +1 -1
- package/dist/{BindingsPicker-CnjJZH9t.js → BindingsPicker-CqzSUVc_.js} +1 -1
- package/dist/{BindingsTable-C3VTa0YL.js → BindingsTable-C1o5EgLy.js} +1 -1
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DYBTXD_J.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CpN5Kn8b.js} +1 -1
- package/dist/{IngredientsView-CQYJfAze.js → IngredientsView-CrXPIQme.js} +99 -91
- package/dist/IntegrationView-BJT-KMVp.js +1141 -0
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Wv8RvXJL.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DH0CcGmX.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-DsOGlAb7.js → PremiumBadge.vue_vue_type_script_setup_true_lang-kJKVCH40.js} +1 -1
- package/dist/{PurchaseOrderPrintPreview-B0hDduXB.js → PurchaseOrderPrintPreview-k26o__vy.js} +1 -1
- package/dist/ReceiveRequestView-ysOzzBTW.js +216 -0
- package/dist/{RecipeView-DYKhSgtw.js → RecipeView-DAH8YIzY.js} +182 -174
- package/dist/{StockView-BIGGG87A.js → StockView-BlCpuSLe.js} +547 -539
- package/dist/{SupplierView-DQzopnzt.js → SupplierView-Bwknjcke.js} +263 -255
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-D8-sMRGm.js → TransferDetails.vue_vue_type_script_setup_true_lang-LCNiBfi7.js} +3 -3
- package/dist/{TransferDialog.vue_vue_type_script_setup_true_lang-CSUnXAyq.js → TransferDialog.vue_vue_type_script_setup_true_lang-BDvtif2q.js} +4 -4
- package/dist/{TransferTemplateView-DWF54okN.js → TransferTemplateView-DcMdNiH6.js} +372 -364
- package/dist/{UnitView-Cdw8xxzV.js → UnitView-BVMr4KlR.js} +186 -178
- package/dist/{WarehouseView-DOelxuIh.js → WarehouseView-Dd-e-IlG.js} +388 -380
- package/dist/{app-SBnQEeEV.js → app-S6iG6Hux.js} +4 -4
- package/dist/app.js +1 -1
- package/dist/{decimal-BlEB2PrM.js → decimal-nOOdFIFP.js} +1 -1
- package/dist/{id-to-date-Y6berpHs.js → id-to-date-CKQ0n3Qi.js} +1 -1
- package/dist/{purchase-order-transaction-type-Dp0wsGal.js → purchase-order-transaction-type-CQ-RpJ0h.js} +2 -2
- package/dist/{supplier-I_rYvljH.js → supplier-DQsAfn3q.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{xlsx-DGwG2ekM.js → xlsx-Dgjf-KvE.js} +1 -1
- package/dist/{xlsx.util-Dsf-EgrG.js → xlsx.util-CODYzgF8.js} +2 -2
- package/package.json +3 -3
- package/dist/ApprovalView-BS4jzhAR.js +0 -121
- package/dist/IntegrationView-9V2OcyP_.js +0 -1172
- package/dist/ReceiveRequestView-3boFHkOO.js +0 -208
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { u as
|
|
3
|
-
import { useDialog as
|
|
4
|
-
import { i as
|
|
5
|
-
import { F as
|
|
6
|
-
import { defineStore as
|
|
7
|
-
import { c as
|
|
8
|
-
import { useI18n as
|
|
9
|
-
import { u as
|
|
10
|
-
import { F as
|
|
11
|
-
import { _ as
|
|
12
|
-
const
|
|
1
|
+
import { defineComponent as K, computed as _, openBlock as v, createElementBlock as w, createElementVNode as l, Fragment as q, renderList as H, toDisplayString as V, createCommentVNode as Y, ref as M, resolveComponent as I, createBlock as T, withCtx as R, createVNode as y, unref as a, isRef as Z, normalizeClass as ae, normalizeStyle as re, Teleport as ie, normalizeProps as ue, guardReactiveProps as de } from "vue";
|
|
2
|
+
import { u as G, S as me, c as oe, R as j, A as ce, a as J, l as pe, m as fe, e as ee, j as ve } from "./app-S6iG6Hux.js";
|
|
3
|
+
import { useDialog as ye, useSnackbar as le, useProxiedModel as te, useBreakpoints as be } from "@feedmepos/ui-library";
|
|
4
|
+
import { i as ge, _ as xe } from "./is-linked-ingredient-error-fJ2TJb3z.js";
|
|
5
|
+
import { F as U, D as ne, R as N } from "./row-action.enum-PMKMRrZR.js";
|
|
6
|
+
import { defineStore as _e, storeToRefs as he } from "pinia";
|
|
7
|
+
import { c as Ve, _ as Ue, F as we } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
|
|
8
|
+
import { useI18n as O } from "@feedmepos/mf-common";
|
|
9
|
+
import { u as Ce, _ as ke, a as Fe } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CpN5Kn8b.js";
|
|
10
|
+
import { F as Se } from "./decimal-nOOdFIFP.js";
|
|
11
|
+
import { _ as $e } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DH0CcGmX.js";
|
|
12
|
+
const Ee = { class: "flex flex-col gap-8" }, Ie = {
|
|
13
13
|
key: 0,
|
|
14
14
|
class: "flex flex-col"
|
|
15
|
-
},
|
|
15
|
+
}, De = { class: "flex-1 py-8 px-16" }, Ae = {
|
|
16
16
|
class: "flex-0 py-8 px-16",
|
|
17
17
|
style: { "flex-basis": "240px" }
|
|
18
|
-
},
|
|
18
|
+
}, Re = {
|
|
19
19
|
key: 1,
|
|
20
20
|
class: "flex flex-col"
|
|
21
|
-
},
|
|
21
|
+
}, Me = { class: "flex-1 py-8 px-16" }, Pe = {
|
|
22
22
|
class: "flex-0 py-8 px-16",
|
|
23
23
|
style: { "flex-basis": "240px" }
|
|
24
|
-
},
|
|
24
|
+
}, Te = {
|
|
25
25
|
key: 2,
|
|
26
26
|
class: "flex flex-col"
|
|
27
|
-
},
|
|
27
|
+
}, Be = { class: "flex-1 py-8 px-16" }, ze = {
|
|
28
28
|
class: "flex-0 py-8 px-16",
|
|
29
29
|
style: { "flex-basis": "240px" }
|
|
30
|
-
},
|
|
30
|
+
}, Le = /* @__PURE__ */ K({
|
|
31
31
|
__name: "UnitUsedBy",
|
|
32
32
|
props: {
|
|
33
33
|
unit: {}
|
|
34
34
|
},
|
|
35
|
-
setup(
|
|
36
|
-
const f =
|
|
37
|
-
return (c, p) => (v(),
|
|
35
|
+
setup(k) {
|
|
36
|
+
const f = k, b = G(), i = _(() => b.validateUnitUsage(f.unit)), r = _(() => i.value.filter((c) => c.from === "INGREDIENT")), o = _(() => i.value.filter((c) => c.from === "RECIPE")), m = _(() => i.value.filter((c) => c.from === "MENU"));
|
|
37
|
+
return (c, p) => (v(), w("div", Ee, [
|
|
38
38
|
p[3] || (p[3] = l("div", { class: "fm-typo-en-body-md-400" }, "Sorry, this unit is used in the following modules:", -1)),
|
|
39
|
-
r.value.length ? (v(),
|
|
39
|
+
r.value.length ? (v(), w("div", Ie, [
|
|
40
40
|
p[0] || (p[0] = l("div", { class: "flex flex-row fm-typo-en-body-md-600 bg-fm-color-neutral-gray-100 text-fm-color-typo-secondary h-48 items-center" }, [
|
|
41
41
|
l("div", { class: "flex-1 py-8 px-16" }, "Ingredient"),
|
|
42
42
|
l("div", {
|
|
@@ -44,18 +44,18 @@ const Se = { class: "flex flex-col gap-8" }, $e = {
|
|
|
44
44
|
style: { "flex-basis": "240px" }
|
|
45
45
|
}, "Used in")
|
|
46
46
|
], -1)),
|
|
47
|
-
(v(!0),
|
|
47
|
+
(v(!0), w(q, null, H(r.value, (s) => {
|
|
48
48
|
var n;
|
|
49
|
-
return v(),
|
|
49
|
+
return v(), w("div", {
|
|
50
50
|
key: s.code,
|
|
51
51
|
class: "flex flex-row fm-typo-en-body-md-400 h-48 items-center border-b border-b-fm-color-neutral-gray-100"
|
|
52
52
|
}, [
|
|
53
|
-
l("div",
|
|
54
|
-
l("div",
|
|
53
|
+
l("div", De, V(s.code) + " " + V(s.name), 1),
|
|
54
|
+
l("div", Ae, V((n = s.bindedIngredient) != null && n.length ? "Convert binding" : "Item unit"), 1)
|
|
55
55
|
]);
|
|
56
56
|
}), 128))
|
|
57
|
-
])) :
|
|
58
|
-
o.value.length ? (v(),
|
|
57
|
+
])) : Y("", !0),
|
|
58
|
+
o.value.length ? (v(), w("div", Re, [
|
|
59
59
|
p[1] || (p[1] = l("div", { class: "flex flex-row fm-typo-en-body-md-600 bg-fm-color-neutral-gray-100 text-fm-color-typo-secondary h-48 items-center" }, [
|
|
60
60
|
l("div", { class: "flex-1 py-8 px-16" }, "Recipe"),
|
|
61
61
|
l("div", {
|
|
@@ -63,18 +63,18 @@ const Se = { class: "flex flex-col gap-8" }, $e = {
|
|
|
63
63
|
style: { "flex-basis": "240px" }
|
|
64
64
|
}, "Used in")
|
|
65
65
|
], -1)),
|
|
66
|
-
(v(!0),
|
|
66
|
+
(v(!0), w(q, null, H(o.value, (s) => {
|
|
67
67
|
var n, u, g;
|
|
68
|
-
return v(),
|
|
68
|
+
return v(), w("div", {
|
|
69
69
|
key: s.code,
|
|
70
70
|
class: "flex flex-row fm-typo-en-body-md-400 h-48 items-center border-b border-b-fm-color-neutral-gray-100"
|
|
71
71
|
}, [
|
|
72
|
-
l("div",
|
|
73
|
-
l("div",
|
|
72
|
+
l("div", Me, V(s.code) + " " + V(s.name), 1),
|
|
73
|
+
l("div", Pe, V((n = s.bindedIngredient) == null ? void 0 : n.slice(0, 3).map((x) => x.code).join(", ")) + " " + V(s.bindedIngredient && ((u = s.bindedIngredient) == null ? void 0 : u.length) > 3 ? `and ${((g = s.bindedIngredient) == null ? void 0 : g.length) - 3} more` : ""), 1)
|
|
74
74
|
]);
|
|
75
75
|
}), 128))
|
|
76
|
-
])) :
|
|
77
|
-
m.value.length ? (v(),
|
|
76
|
+
])) : Y("", !0),
|
|
77
|
+
m.value.length ? (v(), w("div", Te, [
|
|
78
78
|
p[2] || (p[2] = l("div", { class: "flex flex-row fm-typo-en-body-md-600 bg-fm-color-neutral-gray-100 text-fm-color-typo-secondary h-48 items-center" }, [
|
|
79
79
|
l("div", { class: "flex-1 py-8 px-16" }, "Menu"),
|
|
80
80
|
l("div", {
|
|
@@ -82,25 +82,25 @@ const Se = { class: "flex flex-col gap-8" }, $e = {
|
|
|
82
82
|
style: { "flex-basis": "240px" }
|
|
83
83
|
}, "Used in")
|
|
84
84
|
], -1)),
|
|
85
|
-
(v(!0),
|
|
85
|
+
(v(!0), w(q, null, H(m.value, (s) => {
|
|
86
86
|
var n, u, g;
|
|
87
|
-
return v(),
|
|
87
|
+
return v(), w("div", {
|
|
88
88
|
key: s.code,
|
|
89
89
|
class: "flex flex-row fm-typo-en-body-md-400 h-48 items-center border-b border-b-fm-color-neutral-gray-100"
|
|
90
90
|
}, [
|
|
91
|
-
l("div",
|
|
92
|
-
l("div",
|
|
91
|
+
l("div", Be, V(s.code) + " " + V(s.name), 1),
|
|
92
|
+
l("div", ze, V((n = s.bindedIngredient) == null ? void 0 : n.slice(0, 3).map((x) => x.code).join(", ")) + " " + V(s.bindedIngredient && ((u = s.bindedIngredient) == null ? void 0 : u.length) > 3 ? `and ${((g = s.bindedIngredient) == null ? void 0 : g.length) - 3} more` : ""), 1)
|
|
93
93
|
]);
|
|
94
94
|
}), 128))
|
|
95
|
-
])) :
|
|
95
|
+
])) : Y("", !0)
|
|
96
96
|
]));
|
|
97
97
|
}
|
|
98
|
-
}),
|
|
99
|
-
const f =
|
|
98
|
+
}), Q = _e("unitForm", function() {
|
|
99
|
+
const f = ye(), b = le(), i = G(), r = M(!1), o = M();
|
|
100
100
|
function m() {
|
|
101
101
|
const n = {
|
|
102
102
|
unit: {},
|
|
103
|
-
mode:
|
|
103
|
+
mode: U.CREATE,
|
|
104
104
|
show: !0,
|
|
105
105
|
"onUpdate:show"(u) {
|
|
106
106
|
o.value.show = u;
|
|
@@ -111,7 +111,7 @@ const Se = { class: "flex flex-col gap-8" }, $e = {
|
|
|
111
111
|
async function c(n) {
|
|
112
112
|
const u = {
|
|
113
113
|
unit: n,
|
|
114
|
-
mode:
|
|
114
|
+
mode: U.UPDATE,
|
|
115
115
|
show: !0,
|
|
116
116
|
"onUpdate:show"(g) {
|
|
117
117
|
o.value.show = g;
|
|
@@ -128,9 +128,9 @@ const Se = { class: "flex flex-col gap-8" }, $e = {
|
|
|
128
128
|
type: "success"
|
|
129
129
|
});
|
|
130
130
|
} catch (u) {
|
|
131
|
-
u instanceof
|
|
131
|
+
u instanceof me && ge(u) ? f.open({
|
|
132
132
|
title: "Cannot delete unit",
|
|
133
|
-
contentComponent:
|
|
133
|
+
contentComponent: xe,
|
|
134
134
|
contentComponentProps: {
|
|
135
135
|
subject: (n == null ? void 0 : n.name) ?? "",
|
|
136
136
|
items: u.errorResponse.message
|
|
@@ -155,7 +155,7 @@ const Se = { class: "flex flex-col gap-8" }, $e = {
|
|
|
155
155
|
overlay: !0,
|
|
156
156
|
dismissAway: !0,
|
|
157
157
|
closeButton: !0,
|
|
158
|
-
contentComponent:
|
|
158
|
+
contentComponent: Le,
|
|
159
159
|
contentComponentProps: {
|
|
160
160
|
unit: n
|
|
161
161
|
},
|
|
@@ -189,15 +189,15 @@ const Se = { class: "flex flex-col gap-8" }, $e = {
|
|
|
189
189
|
unitViewLoading: r
|
|
190
190
|
};
|
|
191
191
|
});
|
|
192
|
-
function
|
|
193
|
-
const { updateUnit:
|
|
192
|
+
function je() {
|
|
193
|
+
const { updateUnit: k, deleteUnit: f } = Q(), { t: b } = O();
|
|
194
194
|
async function i(o, m) {
|
|
195
|
-
const c =
|
|
196
|
-
if (o ===
|
|
197
|
-
await
|
|
195
|
+
const c = oe(m);
|
|
196
|
+
if (o === N.Edit) {
|
|
197
|
+
await k(c);
|
|
198
198
|
return;
|
|
199
199
|
}
|
|
200
|
-
if (o ===
|
|
200
|
+
if (o === N.Delete) {
|
|
201
201
|
await f(c);
|
|
202
202
|
return;
|
|
203
203
|
}
|
|
@@ -219,8 +219,8 @@ function Le() {
|
|
|
219
219
|
id: "action",
|
|
220
220
|
header: "",
|
|
221
221
|
cell(o) {
|
|
222
|
-
return
|
|
223
|
-
[
|
|
222
|
+
return Ve(
|
|
223
|
+
[ne[N.Edit], ne[N.Delete]],
|
|
224
224
|
(m) => {
|
|
225
225
|
i(m, o.row.original);
|
|
226
226
|
}
|
|
@@ -235,7 +235,7 @@ function Le() {
|
|
|
235
235
|
}
|
|
236
236
|
] };
|
|
237
237
|
}
|
|
238
|
-
const
|
|
238
|
+
const Ne = { class: "flex flex-col gap-24" }, qe = { class: "flex gap-24" }, He = { class: "flex-1" }, Ke = { class: "flex-1" }, Ge = { class: "flex" }, Oe = { class: "flex items-center" }, Ye = { class: "fm-typo-en-body-lg-600 flex-grow" }, Je = { class: "flex flex-col gap-24" }, Qe = { class: "flex gap-24" }, We = { class: "flex-1" }, Xe = { class: "flex-1" }, Ze = /* @__PURE__ */ K({
|
|
239
239
|
__name: "UnitForm",
|
|
240
240
|
props: {
|
|
241
241
|
mode: {},
|
|
@@ -243,12 +243,12 @@ const ze = { class: "flex flex-col gap-24" }, je = { class: "flex gap-24" }, Ne
|
|
|
243
243
|
disabled: { type: Boolean }
|
|
244
244
|
},
|
|
245
245
|
emits: ["update:modelValue", "click:submit"],
|
|
246
|
-
setup(
|
|
247
|
-
const i =
|
|
246
|
+
setup(k, { expose: f, emit: b }) {
|
|
247
|
+
const i = k, r = b, { t: o } = O();
|
|
248
248
|
function m() {
|
|
249
249
|
r("click:submit");
|
|
250
250
|
}
|
|
251
|
-
const c =
|
|
251
|
+
const c = _({
|
|
252
252
|
get() {
|
|
253
253
|
var e;
|
|
254
254
|
return ((e = i.modelValue) == null ? void 0 : e.name) ?? "";
|
|
@@ -257,7 +257,7 @@ const ze = { class: "flex flex-col gap-24" }, je = { class: "flex gap-24" }, Ne
|
|
|
257
257
|
const t = i.modelValue ?? {};
|
|
258
258
|
t.name = e, r("update:modelValue", t);
|
|
259
259
|
}
|
|
260
|
-
}), p =
|
|
260
|
+
}), p = _({
|
|
261
261
|
get() {
|
|
262
262
|
var e;
|
|
263
263
|
return ((e = i.modelValue) == null ? void 0 : e.abbrev) ?? "";
|
|
@@ -266,7 +266,7 @@ const ze = { class: "flex flex-col gap-24" }, je = { class: "flex gap-24" }, Ne
|
|
|
266
266
|
const t = i.modelValue ?? {};
|
|
267
267
|
t.abbrev = e, r("update:modelValue", t);
|
|
268
268
|
}
|
|
269
|
-
}), s =
|
|
269
|
+
}), s = _({
|
|
270
270
|
get() {
|
|
271
271
|
var e;
|
|
272
272
|
return ((e = i.modelValue) == null ? void 0 : e.precision) ?? 0;
|
|
@@ -275,7 +275,7 @@ const ze = { class: "flex flex-col gap-24" }, je = { class: "flex gap-24" }, Ne
|
|
|
275
275
|
const t = i.modelValue ?? {};
|
|
276
276
|
t.precision = e, r("update:modelValue", t);
|
|
277
277
|
}
|
|
278
|
-
}), n =
|
|
278
|
+
}), n = _({
|
|
279
279
|
get() {
|
|
280
280
|
var e;
|
|
281
281
|
return ((e = i.modelValue) == null ? void 0 : e.measurements) ?? [];
|
|
@@ -304,67 +304,67 @@ const ze = { class: "flex flex-col gap-24" }, je = { class: "flex gap-24" }, Ne
|
|
|
304
304
|
const t = i.modelValue ?? {}, d = t.measurements ?? [];
|
|
305
305
|
d.splice(e, 1), t.measurements = d, r("update:modelValue", t);
|
|
306
306
|
}
|
|
307
|
-
const
|
|
307
|
+
const x = M();
|
|
308
308
|
return f({
|
|
309
309
|
validateInputs: () => {
|
|
310
310
|
var e, t;
|
|
311
|
-
(t = (e =
|
|
311
|
+
(t = (e = x.value) == null ? void 0 : e.validateInputs) == null || t.call(e);
|
|
312
312
|
},
|
|
313
313
|
resetInputsValidation: () => {
|
|
314
314
|
var e, t;
|
|
315
|
-
(t = (e =
|
|
315
|
+
(t = (e = x.value) == null ? void 0 : e.resetInputsValidation) == null || t.call(e);
|
|
316
316
|
},
|
|
317
317
|
resetInputs: () => {
|
|
318
318
|
var e, t;
|
|
319
|
-
(t = (e =
|
|
319
|
+
(t = (e = x.value) == null ? void 0 : e.resetInputs) == null || t.call(e);
|
|
320
320
|
}
|
|
321
321
|
}), (e, t) => {
|
|
322
|
-
const d =
|
|
323
|
-
return v(), T(
|
|
322
|
+
const d = I("FmTextField"), D = I("FmStepperField"), F = I("FmButton"), S = I("FmCard"), E = I("FmForm");
|
|
323
|
+
return v(), T(E, {
|
|
324
324
|
ref_key: "formRef",
|
|
325
|
-
ref:
|
|
325
|
+
ref: x,
|
|
326
326
|
class: "flex flex-col gap-40",
|
|
327
327
|
onValidationSuccess: m
|
|
328
328
|
}, {
|
|
329
|
-
default:
|
|
330
|
-
var
|
|
329
|
+
default: R(() => {
|
|
330
|
+
var P;
|
|
331
331
|
return [
|
|
332
|
-
l("div",
|
|
333
|
-
l("div",
|
|
334
|
-
l("div",
|
|
332
|
+
l("div", Ne, [
|
|
333
|
+
l("div", qe, [
|
|
334
|
+
l("div", He, [
|
|
335
335
|
y(d, {
|
|
336
336
|
disabled: e.disabled,
|
|
337
337
|
label: a(o)("inventory.unit.name"),
|
|
338
338
|
modelValue: c.value,
|
|
339
|
-
"onUpdate:modelValue": t[0] || (t[0] = (
|
|
340
|
-
rules: [a(
|
|
339
|
+
"onUpdate:modelValue": t[0] || (t[0] = (C) => c.value = C),
|
|
340
|
+
rules: [a(j)()],
|
|
341
341
|
"label-mark": "required"
|
|
342
342
|
}, null, 8, ["disabled", "label", "modelValue", "rules"])
|
|
343
343
|
]),
|
|
344
|
-
l("div",
|
|
344
|
+
l("div", Ke, [
|
|
345
345
|
y(d, {
|
|
346
346
|
disabled: e.disabled,
|
|
347
347
|
label: a(o)("inventory.unit.symbol"),
|
|
348
348
|
modelValue: p.value,
|
|
349
|
-
"onUpdate:modelValue": t[1] || (t[1] = (
|
|
350
|
-
rules: [a(
|
|
349
|
+
"onUpdate:modelValue": t[1] || (t[1] = (C) => p.value = C),
|
|
350
|
+
rules: [a(j)()],
|
|
351
351
|
"label-mark": "required"
|
|
352
352
|
}, null, 8, ["disabled", "label", "modelValue", "rules"])
|
|
353
353
|
])
|
|
354
354
|
]),
|
|
355
355
|
l("div", null, [
|
|
356
|
-
y(
|
|
356
|
+
y(D, {
|
|
357
357
|
disabled: e.disabled,
|
|
358
358
|
class: "col-span-3",
|
|
359
359
|
label: a(o)("inventory.unit.precision"),
|
|
360
360
|
modelValue: s.value,
|
|
361
|
-
"onUpdate:modelValue": t[2] || (t[2] = (
|
|
362
|
-
rules: [a(
|
|
361
|
+
"onUpdate:modelValue": t[2] || (t[2] = (C) => s.value = C),
|
|
362
|
+
rules: [a(ce)(0)]
|
|
363
363
|
}, null, 8, ["disabled", "label", "modelValue", "rules"])
|
|
364
364
|
])
|
|
365
365
|
]),
|
|
366
|
-
l("div",
|
|
367
|
-
y(
|
|
366
|
+
l("div", Ge, [
|
|
367
|
+
y(F, {
|
|
368
368
|
disabled: e.disabled,
|
|
369
369
|
type: "button",
|
|
370
370
|
"prepend-icon": "add",
|
|
@@ -373,64 +373,64 @@ const ze = { class: "flex flex-col gap-24" }, je = { class: "flex gap-24" }, Ne
|
|
|
373
373
|
onClick: u
|
|
374
374
|
}, null, 8, ["disabled", "label"])
|
|
375
375
|
]),
|
|
376
|
-
(v(!0),
|
|
376
|
+
(v(!0), w(q, null, H((P = e.modelValue) == null ? void 0 : P.measurements, (C, h) => (v(), T(S, {
|
|
377
377
|
class: "flex flex-col gap-16 p-16",
|
|
378
378
|
variant: "outlined",
|
|
379
|
-
key:
|
|
379
|
+
key: C.id
|
|
380
380
|
}, {
|
|
381
|
-
default:
|
|
382
|
-
l("div",
|
|
383
|
-
l("div",
|
|
384
|
-
y(
|
|
381
|
+
default: R(() => [
|
|
382
|
+
l("div", Oe, [
|
|
383
|
+
l("div", Ye, V(a(o)("inventory.unit.measurement.measurementDefault", [h + 1])), 1),
|
|
384
|
+
y(F, {
|
|
385
385
|
disabled: e.disabled,
|
|
386
386
|
variant: "tertiary",
|
|
387
387
|
"prepend-icon": "delete",
|
|
388
|
-
onClick: (
|
|
388
|
+
onClick: ($) => g(h)
|
|
389
389
|
}, null, 8, ["disabled", "onClick"])
|
|
390
390
|
]),
|
|
391
|
-
l("div",
|
|
392
|
-
l("div",
|
|
393
|
-
l("div",
|
|
391
|
+
l("div", Je, [
|
|
392
|
+
l("div", Qe, [
|
|
393
|
+
l("div", We, [
|
|
394
394
|
y(d, {
|
|
395
395
|
disabled: e.disabled,
|
|
396
396
|
class: "col-span-2",
|
|
397
397
|
label: a(o)("inventory.unit.measurement.name"),
|
|
398
|
-
modelValue: e.modelValue.measurements[
|
|
399
|
-
"onUpdate:modelValue": (
|
|
400
|
-
rules: [a(
|
|
398
|
+
modelValue: e.modelValue.measurements[h].name,
|
|
399
|
+
"onUpdate:modelValue": ($) => e.modelValue.measurements[h].name = $,
|
|
400
|
+
rules: [a(j)()],
|
|
401
401
|
"label-mark": "required"
|
|
402
402
|
}, null, 8, ["disabled", "label", "modelValue", "onUpdate:modelValue", "rules"])
|
|
403
403
|
]),
|
|
404
|
-
l("div",
|
|
404
|
+
l("div", Xe, [
|
|
405
405
|
y(d, {
|
|
406
406
|
disabled: e.disabled,
|
|
407
407
|
label: a(o)("inventory.unit.measurement.symbol"),
|
|
408
|
-
modelValue: e.modelValue.measurements[
|
|
409
|
-
"onUpdate:modelValue": (
|
|
410
|
-
rules: [a(
|
|
408
|
+
modelValue: e.modelValue.measurements[h].abbrev,
|
|
409
|
+
"onUpdate:modelValue": ($) => e.modelValue.measurements[h].abbrev = $,
|
|
410
|
+
rules: [a(j)()],
|
|
411
411
|
"label-mark": "required"
|
|
412
412
|
}, null, 8, ["disabled", "label", "modelValue", "onUpdate:modelValue", "rules"])
|
|
413
413
|
])
|
|
414
414
|
]),
|
|
415
|
-
y(
|
|
415
|
+
y($e, {
|
|
416
416
|
disabled: e.disabled,
|
|
417
417
|
class: "col-span-3",
|
|
418
418
|
label: a(o)("inventory.unit.measurement.conversion"),
|
|
419
|
-
"model-value": +a(
|
|
420
|
-
"onUpdate:modelValue": (
|
|
421
|
-
(
|
|
422
|
-
...
|
|
423
|
-
conversion: a(
|
|
424
|
-
a(
|
|
419
|
+
"model-value": +a(J)(e.modelValue.measurements[h].conversion),
|
|
420
|
+
"onUpdate:modelValue": ($) => n.value = n.value.map(
|
|
421
|
+
(A, B) => B === h ? {
|
|
422
|
+
...A,
|
|
423
|
+
conversion: a(Se).toPrecision(
|
|
424
|
+
a(pe)($),
|
|
425
425
|
s.value
|
|
426
426
|
)
|
|
427
|
-
} :
|
|
427
|
+
} : A
|
|
428
428
|
),
|
|
429
|
-
rules: [a(
|
|
430
|
-
step: +a(
|
|
429
|
+
rules: [a(fe)(0)],
|
|
430
|
+
step: +a(J)({ amount: 1, precision: s.value }),
|
|
431
431
|
"helper-text": a(o)("inventory.unit.measurement.conversionHelper", {
|
|
432
|
-
measurementSymbol: e.modelValue.measurements[
|
|
433
|
-
conversion: +a(
|
|
432
|
+
measurementSymbol: e.modelValue.measurements[h].name || " measurement unit",
|
|
433
|
+
conversion: +a(J)(e.modelValue.measurements[h].conversion),
|
|
434
434
|
unitSymbol: p.value || "base unit"
|
|
435
435
|
})
|
|
436
436
|
}, null, 8, ["disabled", "label", "model-value", "onUpdate:modelValue", "rules", "step", "helper-text"])
|
|
@@ -444,47 +444,47 @@ const ze = { class: "flex flex-col gap-24" }, je = { class: "flex gap-24" }, Ne
|
|
|
444
444
|
}, 512);
|
|
445
445
|
};
|
|
446
446
|
}
|
|
447
|
-
}),
|
|
447
|
+
}), et = { class: "flex gap-4" }, tt = /* @__PURE__ */ K({
|
|
448
448
|
__name: "UnitDialog",
|
|
449
449
|
props: {
|
|
450
450
|
show: { type: Boolean },
|
|
451
451
|
unit: {},
|
|
452
|
-
mode: { default:
|
|
452
|
+
mode: { default: U.READ }
|
|
453
453
|
},
|
|
454
454
|
emits: ["update:show"],
|
|
455
|
-
setup(
|
|
456
|
-
const f =
|
|
455
|
+
setup(k) {
|
|
456
|
+
const f = k, b = G(), i = le(), { t: r } = O(), o = te(f, "show"), m = te(f, "unit"), c = _(() => {
|
|
457
457
|
switch (f.mode) {
|
|
458
|
-
case
|
|
458
|
+
case U.READ:
|
|
459
459
|
return "";
|
|
460
|
-
case
|
|
460
|
+
case U.UPDATE:
|
|
461
461
|
return r("inventory.unit.update.title");
|
|
462
|
-
case
|
|
462
|
+
case U.CREATE:
|
|
463
463
|
return r("inventory.unit.create.title");
|
|
464
464
|
}
|
|
465
465
|
return "";
|
|
466
|
-
}), p =
|
|
466
|
+
}), p = _(() => {
|
|
467
467
|
switch (f.mode) {
|
|
468
|
-
case
|
|
468
|
+
case U.READ:
|
|
469
469
|
return "";
|
|
470
|
-
case
|
|
470
|
+
case U.UPDATE:
|
|
471
471
|
return r("common.save");
|
|
472
|
-
case
|
|
472
|
+
case U.CREATE:
|
|
473
473
|
return r("common.add");
|
|
474
474
|
}
|
|
475
475
|
return "";
|
|
476
|
-
}), s =
|
|
476
|
+
}), s = M(), n = M(!1);
|
|
477
477
|
async function u() {
|
|
478
478
|
n.value = !0;
|
|
479
479
|
try {
|
|
480
|
-
const t =
|
|
480
|
+
const t = oe(m.value);
|
|
481
481
|
t.precision ?? (t.precision = 0), t.measurements ?? (t.measurements = []), await b.createUnit(t), o.value = !1, i.open({
|
|
482
482
|
title: r("common.success"),
|
|
483
483
|
message: r("inventory.unit.create.success", { name: m.value.name }),
|
|
484
484
|
type: "success"
|
|
485
485
|
});
|
|
486
486
|
} catch (t) {
|
|
487
|
-
t instanceof
|
|
487
|
+
t instanceof ee || i.open({
|
|
488
488
|
title: r("inventory.unit.create.error.title"),
|
|
489
489
|
message: r("inventory.unit.create.error.message"),
|
|
490
490
|
type: "error"
|
|
@@ -502,7 +502,7 @@ const ze = { class: "flex flex-col gap-24" }, je = { class: "flex gap-24" }, Ne
|
|
|
502
502
|
type: "success"
|
|
503
503
|
});
|
|
504
504
|
} catch (t) {
|
|
505
|
-
t instanceof
|
|
505
|
+
t instanceof ee || i.open({
|
|
506
506
|
title: r("inventory.unit.update.error.title"),
|
|
507
507
|
message: r("inventory.unit.update.error.message"),
|
|
508
508
|
type: "error"
|
|
@@ -511,110 +511,118 @@ const ze = { class: "flex flex-col gap-24" }, je = { class: "flex gap-24" }, Ne
|
|
|
511
511
|
n.value = !1;
|
|
512
512
|
}
|
|
513
513
|
}
|
|
514
|
-
function
|
|
514
|
+
function x() {
|
|
515
515
|
var t, d;
|
|
516
516
|
(d = (t = s.value) == null ? void 0 : t.validateInputs) == null || d.call(t);
|
|
517
517
|
}
|
|
518
518
|
function e() {
|
|
519
519
|
switch (f.mode) {
|
|
520
|
-
case
|
|
520
|
+
case U.READ:
|
|
521
521
|
return;
|
|
522
|
-
case
|
|
522
|
+
case U.UPDATE:
|
|
523
523
|
return g();
|
|
524
|
-
case
|
|
524
|
+
case U.CREATE:
|
|
525
525
|
return u();
|
|
526
526
|
}
|
|
527
527
|
}
|
|
528
528
|
return (t, d) => {
|
|
529
|
-
const
|
|
530
|
-
return v(), T(
|
|
529
|
+
const D = I("FmButton"), F = I("FmSideSheet");
|
|
530
|
+
return v(), T(F, {
|
|
531
531
|
"model-value": a(o),
|
|
532
|
-
"onUpdate:modelValue": d[3] || (d[3] = (
|
|
532
|
+
"onUpdate:modelValue": d[3] || (d[3] = (S) => Z(o) ? o.value = S : null),
|
|
533
533
|
header: c.value,
|
|
534
534
|
"close-button": "",
|
|
535
535
|
"dismiss-away": "",
|
|
536
536
|
"max-width": 500
|
|
537
537
|
}, {
|
|
538
|
-
"side-sheet-footer":
|
|
539
|
-
l("div",
|
|
540
|
-
y(
|
|
538
|
+
"side-sheet-footer": R(() => [
|
|
539
|
+
l("div", et, [
|
|
540
|
+
y(D, {
|
|
541
541
|
loading: n.value,
|
|
542
542
|
label: p.value,
|
|
543
|
-
onClick:
|
|
543
|
+
onClick: x
|
|
544
544
|
}, null, 8, ["loading", "label"]),
|
|
545
|
-
y(
|
|
545
|
+
y(D, {
|
|
546
546
|
disabled: n.value,
|
|
547
547
|
label: a(r)("common.close"),
|
|
548
548
|
variant: "tertiary",
|
|
549
|
-
onClick: d[2] || (d[2] = (
|
|
549
|
+
onClick: d[2] || (d[2] = (S) => o.value = !1)
|
|
550
550
|
}, null, 8, ["disabled", "label"])
|
|
551
551
|
])
|
|
552
552
|
]),
|
|
553
|
-
default:
|
|
554
|
-
y(
|
|
553
|
+
default: R(() => [
|
|
554
|
+
y(Ze, {
|
|
555
555
|
class: "w-full",
|
|
556
556
|
ref_key: "hasValidationExpose",
|
|
557
557
|
ref: s,
|
|
558
558
|
modelValue: a(m),
|
|
559
|
-
"onUpdate:modelValue": d[0] || (d[0] = (
|
|
559
|
+
"onUpdate:modelValue": d[0] || (d[0] = (S) => Z(m) ? m.value = S : null),
|
|
560
560
|
mode: t.mode,
|
|
561
561
|
disabled: n.value,
|
|
562
|
-
"onClick:submit": d[1] || (d[1] = (
|
|
562
|
+
"onClick:submit": d[1] || (d[1] = (S) => e())
|
|
563
563
|
}, null, 8, ["modelValue", "mode", "disabled"])
|
|
564
564
|
]),
|
|
565
565
|
_: 1
|
|
566
566
|
}, 8, ["model-value", "header"]);
|
|
567
567
|
};
|
|
568
568
|
}
|
|
569
|
-
}),
|
|
569
|
+
}), nt = { class: "flex flex-col py-8" }, ot = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, lt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, yt = /* @__PURE__ */ K({
|
|
570
570
|
__name: "UnitView",
|
|
571
|
-
setup(
|
|
572
|
-
const f =
|
|
573
|
-
function s(
|
|
574
|
-
|
|
571
|
+
setup(k) {
|
|
572
|
+
const f = G(), b = ve(), i = _(() => f.units), { createUnit: r, updateUnit: o } = Q(), { unitDialogProps: m, unitViewLoading: c } = he(Q()), { columnDefs: p } = je();
|
|
573
|
+
function s(D) {
|
|
574
|
+
D === "add" && r();
|
|
575
575
|
}
|
|
576
|
-
const n =
|
|
577
|
-
return (
|
|
578
|
-
const
|
|
579
|
-
return v(), T(
|
|
580
|
-
title: a(
|
|
576
|
+
const n = M(""), u = _(() => c.value), { breakpoints: g } = be(), x = _(() => g.value.xs || g.value.sm), e = _(() => x.value ? 10 : 20), t = Ce(), { t: d } = O();
|
|
577
|
+
return (D, F) => {
|
|
578
|
+
const S = I("FmTable");
|
|
579
|
+
return v(), T(ke, {
|
|
580
|
+
title: a(d)("inventory.unit.title"),
|
|
581
581
|
actions: [
|
|
582
|
-
{ label: a(
|
|
582
|
+
{ label: a(d)("inventory.unit.create.title"), value: "add", isPrimary: !0, prependIcon: "add" }
|
|
583
583
|
],
|
|
584
584
|
"onClick:action": s
|
|
585
585
|
}, {
|
|
586
|
-
default:
|
|
587
|
-
l("div",
|
|
588
|
-
|
|
586
|
+
default: R(() => [
|
|
587
|
+
l("div", {
|
|
588
|
+
class: ae([
|
|
589
|
+
"flex flex-col gap-8 max-h-full",
|
|
590
|
+
{
|
|
591
|
+
"p-0": x.value,
|
|
592
|
+
"px-24 ": !x.value
|
|
593
|
+
}
|
|
594
|
+
])
|
|
595
|
+
}, [
|
|
596
|
+
y(Fe, {
|
|
589
597
|
searchable: "",
|
|
590
598
|
search: n.value,
|
|
591
|
-
"onUpdate:search":
|
|
599
|
+
"onUpdate:search": F[0] || (F[0] = (E) => n.value = E)
|
|
592
600
|
}, null, 8, ["search"]),
|
|
593
|
-
y(
|
|
594
|
-
style:
|
|
601
|
+
y(S, {
|
|
602
|
+
style: re(a(t).tableHeight),
|
|
595
603
|
"column-defs": a(p),
|
|
596
604
|
"row-data": i.value,
|
|
597
605
|
"search-value": n.value,
|
|
598
606
|
loading: !a(b)._currentLocation || u.value,
|
|
599
|
-
onRowClick:
|
|
600
|
-
"page-size":
|
|
607
|
+
onRowClick: F[1] || (F[1] = (E) => a(o)(E.original)),
|
|
608
|
+
"page-size": e.value
|
|
601
609
|
}, {
|
|
602
|
-
"list-row":
|
|
603
|
-
y(
|
|
604
|
-
row:
|
|
610
|
+
"list-row": R((E) => [
|
|
611
|
+
y(Ue, {
|
|
612
|
+
row: E,
|
|
605
613
|
onRowClick: a(o)
|
|
606
614
|
}, {
|
|
607
|
-
default:
|
|
608
|
-
var
|
|
615
|
+
default: R((P) => {
|
|
616
|
+
var C, h, $, A, B, z, W, L, X;
|
|
609
617
|
return [
|
|
610
|
-
l("div",
|
|
611
|
-
l("div",
|
|
612
|
-
y(a(
|
|
613
|
-
render: (
|
|
614
|
-
props: (
|
|
618
|
+
l("div", nt, [
|
|
619
|
+
l("div", ot, [
|
|
620
|
+
y(a(we), {
|
|
621
|
+
render: ($ = (h = (C = P.name) == null ? void 0 : C.column) == null ? void 0 : h.columnDef) == null ? void 0 : $.cell,
|
|
622
|
+
props: (B = (A = P.name) == null ? void 0 : A.getContext) == null ? void 0 : B.call(A)
|
|
615
623
|
}, null, 8, ["render", "props"])
|
|
616
624
|
]),
|
|
617
|
-
l("div",
|
|
625
|
+
l("div", lt, V((X = (L = (W = (z = E.original.measurements) == null ? void 0 : z.map) == null ? void 0 : W.call(z, (se) => se.name)) == null ? void 0 : L.join) == null ? void 0 : X.call(L, ", ")), 1)
|
|
618
626
|
])
|
|
619
627
|
];
|
|
620
628
|
}),
|
|
@@ -623,9 +631,9 @@ const ze = { class: "flex flex-col gap-24" }, je = { class: "flex gap-24" }, Ne
|
|
|
623
631
|
]),
|
|
624
632
|
_: 1
|
|
625
633
|
}, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"])
|
|
626
|
-
]),
|
|
627
|
-
(v(), T(
|
|
628
|
-
y(
|
|
634
|
+
], 2),
|
|
635
|
+
(v(), T(ie, { to: "body" }, [
|
|
636
|
+
y(tt, ue(de(a(m))), null, 16)
|
|
629
637
|
]))
|
|
630
638
|
]),
|
|
631
639
|
_: 1
|
|
@@ -634,5 +642,5 @@ const ze = { class: "flex flex-col gap-24" }, je = { class: "flex gap-24" }, Ne
|
|
|
634
642
|
}
|
|
635
643
|
});
|
|
636
644
|
export {
|
|
637
|
-
|
|
645
|
+
yt as default
|
|
638
646
|
};
|