@feedmepos/mf-inventory-portal 0.0.23-dev.38 → 0.0.23-dev.40
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/{App-DQgtWkQj.js → App-D8DXxTIq.js} +2 -2
- package/dist/{ApprovalView-CvSK9fGA.js → ApprovalView-BWGXkHV6.js} +2 -2
- package/dist/{BindingsDialog-BAC0_xCP.js → BindingsDialog-D7WypDot.js} +2 -2
- package/dist/{BindingsPicker-ecWMwsNp.js → BindingsPicker-DUlGwkwM.js} +1 -1
- package/dist/{BindingsTable-D5kQydOU.js → BindingsTable-BjeZYCaJ.js} +1 -1
- package/dist/{ClosingDraftView-CnHQ59rX.js → ClosingDraftView-o2LEUfo8.js} +2 -2
- package/dist/{ClosingTemplateView-vRTsVZ0c.js → ClosingTemplateView-Dt983Cg4.js} +1 -1
- package/dist/FmCustomAttribute.vue_vue_type_script_setup_true_lang-Dc_7IyBG.js +142 -0
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CpIzIvkU.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-wocPyZls.js} +3 -3
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-CNzEHF-R.js → FmUnitInput.vue_vue_type_script_setup_true_lang-DzoEp-Pg.js} +1 -1
- package/dist/{IngredientGroupView-BLsABZ3h.js → IngredientGroupView-CIPpIpv1.js} +1 -1
- package/dist/IngredientsView-CFV3kX7Q.js +1707 -0
- package/dist/{IntegrationView-BqAqngtM.js → IntegrationView-DkW32m-t.js} +1 -1
- package/dist/{InventoryBindingForm-D54V_qZQ.js → InventoryBindingForm-B4CBet9W.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-KIW9J7Xn.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-DpdDVf6O.js} +3 -3
- package/dist/{InventoryBindingSummary-htT7GNto.js → InventoryBindingSummary-75ImZtqK.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BlEgALMj.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DfpG3Fy8.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-DHbxXDGy.js → PremiumBadge.vue_vue_type_script_setup_true_lang-B4d0c3nk.js} +1 -1
- package/dist/{PurchaseOrderPrintPreview-hmzxKuIa.js → PurchaseOrderPrintPreview-BYO0JcQW.js} +1 -1
- package/dist/{ReceiveRequestView-_YioyWqU.js → ReceiveRequestView-cFLNExw9.js} +182 -182
- package/dist/RecipeView-CjfpaHaT.js +609 -0
- package/dist/{StockView-R4cnEbHQ.js → StockView-HMtD9qar.js} +8 -8
- package/dist/{SupplierView-CevGG507.js → SupplierView-Cidfe-Xm.js} +4 -4
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-CeWP9msS.js → TransferDetails.vue_vue_type_script_setup_true_lang-CdU3HPBC.js} +4 -4
- package/dist/{TransferTemplateView-QDniAq8o.js → TransferTemplateView-Doxr1fXP.js} +6 -6
- package/dist/{UnitView-SjwJ3lZ0.js → UnitView-C1af71aM.js} +228 -223
- package/dist/{WarehouseView-55LiPQXG.js → WarehouseView-CviOLXfX.js} +1 -1
- package/dist/{app-UTiudUUR.js → app-BE8SgDqI.js} +92 -93
- package/dist/app.js +1 -1
- package/dist/{decimal-tyBgHJ47.js → decimal-xj3kVOP6.js} +1 -1
- package/dist/{feature-z7inw9y6.js → feature-CWpNYcWJ.js} +1 -1
- package/dist/{format-unit-display-DN0KtCh2.js → format-unit-display-CZ835oaL.js} +2 -2
- package/dist/{index-Dj2Ccgp1.js → index-B8IWDKYv.js} +3 -3
- package/dist/{index-DlhdTaa8.js → index-C6SzYqK7.js} +1 -1
- package/dist/{stock-CxRxidDu.js → stock-C2xyYnS7.js} +1 -1
- package/dist/{supplier-BhyiTwSJ.js → supplier-B-7o9hg1.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-inventory-binding-dialog-DwSvUvRl.js → use-inventory-binding-dialog-Dm8Ky1MH.js} +1 -1
- package/package.json +3 -3
- package/dist/IngredientBindedItem.vue_vue_type_script_setup_true_lang-DBhBaRrd.js +0 -51
- package/dist/IngredientsView-Cs4TIf6V.js +0 -1794
- package/dist/RecipeView-88KJ0nvU.js +0 -591
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { a as
|
|
3
|
-
import { useDialog as
|
|
4
|
-
import { i as
|
|
5
|
-
import { defineStore as
|
|
6
|
-
import { useI18n as
|
|
7
|
-
import { F as
|
|
8
|
-
import { _ as
|
|
9
|
-
const
|
|
1
|
+
import { defineComponent as H, computed as g, openBlock as v, createElementBlock as C, createElementVNode as l, Fragment as j, renderList as q, toDisplayString as V, createCommentVNode as Y, ref as M, resolveComponent as $, createBlock as T, withCtx as A, createVNode as y, unref as o, isRef as ee, normalizeClass as re, normalizeStyle as ie, Teleport as ue, normalizeProps as de, guardReactiveProps as me } from "vue";
|
|
2
|
+
import { a as G, d as w, S as ce, f as pe, D as te, h as L, e as le, l as N, A as fe, i as J, L as ve, N as ye, o as ne, u as be, b as ge, y as xe, z as _e, B as he, E as Ve, G as Ue } from "./app-BE8SgDqI.js";
|
|
3
|
+
import { useDialog as we, useSnackbar as se, useProxiedModel as oe, useBreakpoints as Ce } from "@feedmepos/ui-library";
|
|
4
|
+
import { i as Se, _ as ke } from "./is-linked-ingredient-error-fJ2TJb3z.js";
|
|
5
|
+
import { defineStore as Ee, storeToRefs as Fe } from "pinia";
|
|
6
|
+
import { useI18n as K } from "@feedmepos/mf-common";
|
|
7
|
+
import { F as $e } from "./decimal-xj3kVOP6.js";
|
|
8
|
+
import { _ as Ie } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DfpG3Fy8.js";
|
|
9
|
+
const De = { class: "flex flex-col gap-8" }, Ae = {
|
|
10
10
|
key: 0,
|
|
11
11
|
class: "flex flex-col"
|
|
12
|
-
},
|
|
12
|
+
}, Re = { class: "flex-1 py-8 px-16" }, Me = {
|
|
13
13
|
class: "flex-0 py-8 px-16",
|
|
14
14
|
style: { "flex-basis": "240px" }
|
|
15
|
-
},
|
|
15
|
+
}, Pe = {
|
|
16
16
|
key: 1,
|
|
17
17
|
class: "flex flex-col"
|
|
18
|
-
},
|
|
18
|
+
}, Te = { class: "flex-1 py-8 px-16" }, Be = {
|
|
19
19
|
class: "flex-0 py-8 px-16",
|
|
20
20
|
style: { "flex-basis": "240px" }
|
|
21
|
-
},
|
|
21
|
+
}, ze = {
|
|
22
22
|
key: 2,
|
|
23
23
|
class: "flex flex-col"
|
|
24
|
-
},
|
|
24
|
+
}, Le = { class: "flex-1 py-8 px-16" }, Ne = {
|
|
25
25
|
class: "flex-0 py-8 px-16",
|
|
26
26
|
style: { "flex-basis": "240px" }
|
|
27
|
-
},
|
|
27
|
+
}, je = /* @__PURE__ */ H({
|
|
28
28
|
__name: "UnitUsedBy",
|
|
29
29
|
props: {
|
|
30
30
|
unit: {}
|
|
31
31
|
},
|
|
32
32
|
setup(k) {
|
|
33
|
-
const f = k, b =
|
|
34
|
-
return (c, p) => (v(),
|
|
33
|
+
const f = k, b = G(), i = g(() => b.validateUnitUsage(f.unit)), r = g(() => i.value.filter((c) => c.from === "INGREDIENT")), s = g(() => i.value.filter((c) => c.from === "RECIPE")), d = g(() => i.value.filter((c) => c.from === "MENU"));
|
|
34
|
+
return (c, p) => (v(), C("div", De, [
|
|
35
35
|
p[3] || (p[3] = l("div", { class: "fm-typo-en-body-md-400" }, "Sorry, this unit is used in the following modules:", -1)),
|
|
36
|
-
r.value.length ? (v(),
|
|
36
|
+
r.value.length ? (v(), C("div", Ae, [
|
|
37
37
|
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" }, [
|
|
38
38
|
l("div", { class: "flex-1 py-8 px-16" }, "Ingredient"),
|
|
39
39
|
l("div", {
|
|
@@ -41,18 +41,18 @@ const Ee = { class: "flex flex-col gap-8" }, Ie = {
|
|
|
41
41
|
style: { "flex-basis": "240px" }
|
|
42
42
|
}, "Used in")
|
|
43
43
|
], -1)),
|
|
44
|
-
(v(!0),
|
|
44
|
+
(v(!0), C(j, null, q(r.value, (a) => {
|
|
45
45
|
var n;
|
|
46
|
-
return v(),
|
|
47
|
-
key:
|
|
46
|
+
return v(), C("div", {
|
|
47
|
+
key: a.code,
|
|
48
48
|
class: "flex flex-row fm-typo-en-body-md-400 h-48 items-center border-b border-b-fm-color-neutral-gray-100"
|
|
49
49
|
}, [
|
|
50
|
-
l("div",
|
|
51
|
-
l("div",
|
|
50
|
+
l("div", Re, V(a.code) + " " + V(a.name), 1),
|
|
51
|
+
l("div", Me, V((n = a.bindedIngredient) != null && n.length ? "Convert binding" : "Item unit"), 1)
|
|
52
52
|
]);
|
|
53
53
|
}), 128))
|
|
54
54
|
])) : Y("", !0),
|
|
55
|
-
|
|
55
|
+
s.value.length ? (v(), C("div", Pe, [
|
|
56
56
|
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" }, [
|
|
57
57
|
l("div", { class: "flex-1 py-8 px-16" }, "Recipe"),
|
|
58
58
|
l("div", {
|
|
@@ -60,18 +60,18 @@ const Ee = { class: "flex flex-col gap-8" }, Ie = {
|
|
|
60
60
|
style: { "flex-basis": "240px" }
|
|
61
61
|
}, "Used in")
|
|
62
62
|
], -1)),
|
|
63
|
-
(v(!0),
|
|
64
|
-
var n, u,
|
|
65
|
-
return v(),
|
|
66
|
-
key:
|
|
63
|
+
(v(!0), C(j, null, q(s.value, (a) => {
|
|
64
|
+
var n, u, x;
|
|
65
|
+
return v(), C("div", {
|
|
66
|
+
key: a.code,
|
|
67
67
|
class: "flex flex-row fm-typo-en-body-md-400 h-48 items-center border-b border-b-fm-color-neutral-gray-100"
|
|
68
68
|
}, [
|
|
69
|
-
l("div",
|
|
70
|
-
l("div",
|
|
69
|
+
l("div", Te, V(a.code) + " " + V(a.name), 1),
|
|
70
|
+
l("div", Be, V((n = a.bindedIngredient) == null ? void 0 : n.slice(0, 3).map((_) => _.code).join(", ")) + " " + V(a.bindedIngredient && ((u = a.bindedIngredient) == null ? void 0 : u.length) > 3 ? `and ${((x = a.bindedIngredient) == null ? void 0 : x.length) - 3} more` : ""), 1)
|
|
71
71
|
]);
|
|
72
72
|
}), 128))
|
|
73
73
|
])) : Y("", !0),
|
|
74
|
-
|
|
74
|
+
d.value.length ? (v(), C("div", ze, [
|
|
75
75
|
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" }, [
|
|
76
76
|
l("div", { class: "flex-1 py-8 px-16" }, "Menu"),
|
|
77
77
|
l("div", {
|
|
@@ -79,42 +79,42 @@ const Ee = { class: "flex flex-col gap-8" }, Ie = {
|
|
|
79
79
|
style: { "flex-basis": "240px" }
|
|
80
80
|
}, "Used in")
|
|
81
81
|
], -1)),
|
|
82
|
-
(v(!0),
|
|
83
|
-
var n, u,
|
|
84
|
-
return v(),
|
|
85
|
-
key:
|
|
82
|
+
(v(!0), C(j, null, q(d.value, (a) => {
|
|
83
|
+
var n, u, x;
|
|
84
|
+
return v(), C("div", {
|
|
85
|
+
key: a.code,
|
|
86
86
|
class: "flex flex-row fm-typo-en-body-md-400 h-48 items-center border-b border-b-fm-color-neutral-gray-100"
|
|
87
87
|
}, [
|
|
88
|
-
l("div",
|
|
89
|
-
l("div",
|
|
88
|
+
l("div", Le, V(a.code) + " " + V(a.name), 1),
|
|
89
|
+
l("div", Ne, V((n = a.bindedIngredient) == null ? void 0 : n.slice(0, 3).map((_) => _.code).join(", ")) + " " + V(a.bindedIngredient && ((u = a.bindedIngredient) == null ? void 0 : u.length) > 3 ? `and ${((x = a.bindedIngredient) == null ? void 0 : x.length) - 3} more` : ""), 1)
|
|
90
90
|
]);
|
|
91
91
|
}), 128))
|
|
92
92
|
])) : Y("", !0)
|
|
93
93
|
]));
|
|
94
94
|
}
|
|
95
|
-
}), Q =
|
|
96
|
-
const f =
|
|
97
|
-
function
|
|
95
|
+
}), Q = Ee("unitForm", function() {
|
|
96
|
+
const f = we(), b = se(), i = G(), r = M(!1), s = M();
|
|
97
|
+
function d() {
|
|
98
98
|
const n = {
|
|
99
99
|
unit: {},
|
|
100
|
-
mode:
|
|
100
|
+
mode: w.CREATE,
|
|
101
101
|
show: !0,
|
|
102
102
|
"onUpdate:show"(u) {
|
|
103
|
-
|
|
103
|
+
s.value.show = u;
|
|
104
104
|
}
|
|
105
105
|
};
|
|
106
|
-
|
|
106
|
+
s.value = n;
|
|
107
107
|
}
|
|
108
108
|
async function c(n) {
|
|
109
109
|
const u = {
|
|
110
110
|
unit: n,
|
|
111
|
-
mode:
|
|
111
|
+
mode: w.UPDATE,
|
|
112
112
|
show: !0,
|
|
113
|
-
"onUpdate:show"(
|
|
114
|
-
|
|
113
|
+
"onUpdate:show"(x) {
|
|
114
|
+
s.value.show = x;
|
|
115
115
|
}
|
|
116
116
|
};
|
|
117
|
-
|
|
117
|
+
s.value = u;
|
|
118
118
|
}
|
|
119
119
|
async function p(n) {
|
|
120
120
|
r.value = !0;
|
|
@@ -125,9 +125,9 @@ const Ee = { class: "flex flex-col gap-8" }, Ie = {
|
|
|
125
125
|
type: "success"
|
|
126
126
|
});
|
|
127
127
|
} catch (u) {
|
|
128
|
-
u instanceof
|
|
128
|
+
u instanceof ce && Se(u) ? f.open({
|
|
129
129
|
title: "Cannot delete unit",
|
|
130
|
-
contentComponent:
|
|
130
|
+
contentComponent: ke,
|
|
131
131
|
contentComponentProps: {
|
|
132
132
|
subject: (n == null ? void 0 : n.name) ?? "",
|
|
133
133
|
items: u.errorResponse.message
|
|
@@ -145,14 +145,14 @@ const Ee = { class: "flex flex-col gap-8" }, Ie = {
|
|
|
145
145
|
r.value = !1;
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
|
-
function
|
|
148
|
+
function a(n) {
|
|
149
149
|
if (i.validateUnitUsage(n).length) {
|
|
150
150
|
f.open({
|
|
151
151
|
title: `Cannot delete ${(n == null ? void 0 : n.name) ?? "unit"}`,
|
|
152
152
|
overlay: !0,
|
|
153
153
|
dismissAway: !0,
|
|
154
154
|
closeButton: !0,
|
|
155
|
-
contentComponent:
|
|
155
|
+
contentComponent: je,
|
|
156
156
|
contentComponentProps: {
|
|
157
157
|
unit: n
|
|
158
158
|
},
|
|
@@ -179,22 +179,22 @@ const Ee = { class: "flex flex-col gap-8" }, Ie = {
|
|
|
179
179
|
}).onPrimary(() => p(n));
|
|
180
180
|
}
|
|
181
181
|
return {
|
|
182
|
-
createUnit:
|
|
182
|
+
createUnit: d,
|
|
183
183
|
updateUnit: c,
|
|
184
|
-
deleteUnit:
|
|
185
|
-
unitDialogProps:
|
|
184
|
+
deleteUnit: a,
|
|
185
|
+
unitDialogProps: s,
|
|
186
186
|
unitViewLoading: r
|
|
187
187
|
};
|
|
188
188
|
});
|
|
189
|
-
function
|
|
190
|
-
const { updateUnit: k, deleteUnit: f } = Q(), { t: b } =
|
|
191
|
-
async function i(
|
|
192
|
-
const c =
|
|
193
|
-
if (
|
|
189
|
+
function qe() {
|
|
190
|
+
const { updateUnit: k, deleteUnit: f } = Q(), { t: b } = K();
|
|
191
|
+
async function i(s, d) {
|
|
192
|
+
const c = le(d);
|
|
193
|
+
if (s === L.Edit) {
|
|
194
194
|
await k(c);
|
|
195
195
|
return;
|
|
196
196
|
}
|
|
197
|
-
if (
|
|
197
|
+
if (s === L.Delete) {
|
|
198
198
|
await f(c);
|
|
199
199
|
return;
|
|
200
200
|
}
|
|
@@ -215,11 +215,11 @@ function Ne() {
|
|
|
215
215
|
{
|
|
216
216
|
id: "action",
|
|
217
217
|
header: "",
|
|
218
|
-
cell(
|
|
219
|
-
return
|
|
220
|
-
[
|
|
221
|
-
(
|
|
222
|
-
i(
|
|
218
|
+
cell(s) {
|
|
219
|
+
return pe(
|
|
220
|
+
[te[L.Edit], te[L.Delete]],
|
|
221
|
+
(d) => {
|
|
222
|
+
i(d, s.row.original);
|
|
223
223
|
}
|
|
224
224
|
);
|
|
225
225
|
},
|
|
@@ -232,7 +232,7 @@ function Ne() {
|
|
|
232
232
|
}
|
|
233
233
|
] };
|
|
234
234
|
}
|
|
235
|
-
const
|
|
235
|
+
const He = { class: "flex flex-col gap-24" }, Ge = { class: "flex gap-24" }, Ke = { class: "flex-1" }, Oe = { class: "flex-1" }, Ye = { class: "flex" }, Je = { class: "flex items-center" }, Qe = { class: "fm-typo-en-body-lg-600 flex-grow" }, We = { class: "flex flex-col gap-24" }, Xe = { class: "flex gap-24" }, Ze = { class: "flex-1" }, et = { class: "flex-1" }, tt = /* @__PURE__ */ H({
|
|
236
236
|
__name: "UnitForm",
|
|
237
237
|
props: {
|
|
238
238
|
mode: {},
|
|
@@ -241,11 +241,11 @@ const je = { class: "flex flex-col gap-24" }, qe = { class: "flex gap-24" }, He
|
|
|
241
241
|
},
|
|
242
242
|
emits: ["update:modelValue", "click:submit"],
|
|
243
243
|
setup(k, { expose: f, emit: b }) {
|
|
244
|
-
const i = k, r = b, { t:
|
|
245
|
-
function
|
|
244
|
+
const i = k, r = b, { t: s } = K();
|
|
245
|
+
function d() {
|
|
246
246
|
r("click:submit");
|
|
247
247
|
}
|
|
248
|
-
const c =
|
|
248
|
+
const c = g({
|
|
249
249
|
get() {
|
|
250
250
|
var e;
|
|
251
251
|
return ((e = i.modelValue) == null ? void 0 : e.name) ?? "";
|
|
@@ -254,7 +254,7 @@ const je = { class: "flex flex-col gap-24" }, qe = { class: "flex gap-24" }, He
|
|
|
254
254
|
const t = i.modelValue ?? {};
|
|
255
255
|
t.name = e, r("update:modelValue", t);
|
|
256
256
|
}
|
|
257
|
-
}), p =
|
|
257
|
+
}), p = g({
|
|
258
258
|
get() {
|
|
259
259
|
var e;
|
|
260
260
|
return ((e = i.modelValue) == null ? void 0 : e.abbrev) ?? "";
|
|
@@ -263,7 +263,7 @@ const je = { class: "flex flex-col gap-24" }, qe = { class: "flex gap-24" }, He
|
|
|
263
263
|
const t = i.modelValue ?? {};
|
|
264
264
|
t.abbrev = e, r("update:modelValue", t);
|
|
265
265
|
}
|
|
266
|
-
}),
|
|
266
|
+
}), a = g({
|
|
267
267
|
get() {
|
|
268
268
|
var e;
|
|
269
269
|
return ((e = i.modelValue) == null ? void 0 : e.precision) ?? 0;
|
|
@@ -272,7 +272,7 @@ const je = { class: "flex flex-col gap-24" }, qe = { class: "flex gap-24" }, He
|
|
|
272
272
|
const t = i.modelValue ?? {};
|
|
273
273
|
t.precision = e, r("update:modelValue", t);
|
|
274
274
|
}
|
|
275
|
-
}), n =
|
|
275
|
+
}), n = g({
|
|
276
276
|
get() {
|
|
277
277
|
var e;
|
|
278
278
|
return ((e = i.modelValue) == null ? void 0 : e.measurements) ?? [];
|
|
@@ -297,137 +297,137 @@ const je = { class: "flex flex-col gap-24" }, qe = { class: "flex gap-24" }, He
|
|
|
297
297
|
}
|
|
298
298
|
], r("update:modelValue", e);
|
|
299
299
|
}
|
|
300
|
-
function
|
|
301
|
-
const t = i.modelValue ?? {},
|
|
302
|
-
|
|
300
|
+
function x(e) {
|
|
301
|
+
const t = i.modelValue ?? {}, m = t.measurements ?? [];
|
|
302
|
+
m.splice(e, 1), t.measurements = m, r("update:modelValue", t);
|
|
303
303
|
}
|
|
304
|
-
const
|
|
304
|
+
const _ = M();
|
|
305
305
|
return f({
|
|
306
306
|
validateInputs: () => {
|
|
307
307
|
var e, t;
|
|
308
|
-
(t = (e =
|
|
308
|
+
(t = (e = _.value) == null ? void 0 : e.validateInputs) == null || t.call(e);
|
|
309
309
|
},
|
|
310
310
|
resetInputsValidation: () => {
|
|
311
311
|
var e, t;
|
|
312
|
-
(t = (e =
|
|
312
|
+
(t = (e = _.value) == null ? void 0 : e.resetInputsValidation) == null || t.call(e);
|
|
313
313
|
},
|
|
314
314
|
resetInputs: () => {
|
|
315
315
|
var e, t;
|
|
316
|
-
(t = (e =
|
|
316
|
+
(t = (e = _.value) == null ? void 0 : e.resetInputs) == null || t.call(e);
|
|
317
317
|
}
|
|
318
318
|
}), (e, t) => {
|
|
319
|
-
const
|
|
320
|
-
return v(), T(
|
|
319
|
+
const m = $("FmTextField"), I = $("FmStepperField"), D = $("FmButton"), U = $("FmCard"), O = $("FmForm");
|
|
320
|
+
return v(), T(O, {
|
|
321
321
|
ref_key: "formRef",
|
|
322
|
-
ref:
|
|
322
|
+
ref: _,
|
|
323
323
|
class: "flex flex-col gap-40",
|
|
324
|
-
onValidationSuccess:
|
|
324
|
+
onValidationSuccess: d
|
|
325
325
|
}, {
|
|
326
|
-
default:
|
|
327
|
-
var
|
|
326
|
+
default: A(() => {
|
|
327
|
+
var E;
|
|
328
328
|
return [
|
|
329
|
-
l("div",
|
|
330
|
-
l("div",
|
|
331
|
-
l("div",
|
|
332
|
-
y(
|
|
329
|
+
l("div", He, [
|
|
330
|
+
l("div", Ge, [
|
|
331
|
+
l("div", Ke, [
|
|
332
|
+
y(m, {
|
|
333
333
|
disabled: e.disabled,
|
|
334
|
-
label:
|
|
334
|
+
label: o(s)("inventory.unit.name"),
|
|
335
335
|
modelValue: c.value,
|
|
336
|
-
"onUpdate:modelValue": t[0] || (t[0] = (
|
|
337
|
-
rules: [
|
|
336
|
+
"onUpdate:modelValue": t[0] || (t[0] = (S) => c.value = S),
|
|
337
|
+
rules: [o(N)()],
|
|
338
338
|
"label-mark": "required"
|
|
339
339
|
}, null, 8, ["disabled", "label", "modelValue", "rules"])
|
|
340
340
|
]),
|
|
341
|
-
l("div",
|
|
342
|
-
y(
|
|
341
|
+
l("div", Oe, [
|
|
342
|
+
y(m, {
|
|
343
343
|
disabled: e.disabled,
|
|
344
|
-
label:
|
|
344
|
+
label: o(s)("inventory.unit.symbol"),
|
|
345
345
|
modelValue: p.value,
|
|
346
|
-
"onUpdate:modelValue": t[1] || (t[1] = (
|
|
347
|
-
rules: [
|
|
346
|
+
"onUpdate:modelValue": t[1] || (t[1] = (S) => p.value = S),
|
|
347
|
+
rules: [o(N)()],
|
|
348
348
|
"label-mark": "required"
|
|
349
349
|
}, null, 8, ["disabled", "label", "modelValue", "rules"])
|
|
350
350
|
])
|
|
351
351
|
]),
|
|
352
352
|
l("div", null, [
|
|
353
|
-
y(
|
|
353
|
+
y(I, {
|
|
354
354
|
disabled: e.disabled,
|
|
355
355
|
class: "col-span-3",
|
|
356
|
-
label:
|
|
357
|
-
modelValue:
|
|
358
|
-
"onUpdate:modelValue": t[2] || (t[2] = (
|
|
359
|
-
rules: [
|
|
356
|
+
label: o(s)("inventory.unit.precision"),
|
|
357
|
+
modelValue: a.value,
|
|
358
|
+
"onUpdate:modelValue": t[2] || (t[2] = (S) => a.value = S),
|
|
359
|
+
rules: [o(fe)(0)]
|
|
360
360
|
}, null, 8, ["disabled", "label", "modelValue", "rules"])
|
|
361
361
|
])
|
|
362
362
|
]),
|
|
363
|
-
l("div",
|
|
364
|
-
y(
|
|
363
|
+
l("div", Ye, [
|
|
364
|
+
y(D, {
|
|
365
365
|
disabled: e.disabled,
|
|
366
366
|
type: "button",
|
|
367
367
|
"prepend-icon": "add",
|
|
368
|
-
label:
|
|
368
|
+
label: o(s)("inventory.unit.measurement.addMeasurement"),
|
|
369
369
|
variant: "plain",
|
|
370
370
|
onClick: u
|
|
371
371
|
}, null, 8, ["disabled", "label"])
|
|
372
372
|
]),
|
|
373
|
-
(v(!0),
|
|
373
|
+
(v(!0), C(j, null, q((E = e.modelValue) == null ? void 0 : E.measurements, (S, h) => (v(), T(U, {
|
|
374
374
|
class: "flex flex-col gap-16 p-16",
|
|
375
375
|
variant: "outlined",
|
|
376
|
-
key:
|
|
376
|
+
key: S.id
|
|
377
377
|
}, {
|
|
378
|
-
default:
|
|
379
|
-
l("div",
|
|
380
|
-
l("div",
|
|
381
|
-
y(
|
|
378
|
+
default: A(() => [
|
|
379
|
+
l("div", Je, [
|
|
380
|
+
l("div", Qe, V(o(s)("inventory.unit.measurement.measurementDefault", [h + 1])), 1),
|
|
381
|
+
y(D, {
|
|
382
382
|
disabled: e.disabled,
|
|
383
383
|
variant: "tertiary",
|
|
384
384
|
"prepend-icon": "delete",
|
|
385
|
-
onClick: (
|
|
385
|
+
onClick: (F) => x(h)
|
|
386
386
|
}, null, 8, ["disabled", "onClick"])
|
|
387
387
|
]),
|
|
388
|
-
l("div",
|
|
389
|
-
l("div",
|
|
390
|
-
l("div",
|
|
391
|
-
y(
|
|
388
|
+
l("div", We, [
|
|
389
|
+
l("div", Xe, [
|
|
390
|
+
l("div", Ze, [
|
|
391
|
+
y(m, {
|
|
392
392
|
disabled: e.disabled,
|
|
393
393
|
class: "col-span-2",
|
|
394
|
-
label:
|
|
394
|
+
label: o(s)("inventory.unit.measurement.name"),
|
|
395
395
|
modelValue: e.modelValue.measurements[h].name,
|
|
396
|
-
"onUpdate:modelValue": (
|
|
397
|
-
rules: [
|
|
396
|
+
"onUpdate:modelValue": (F) => e.modelValue.measurements[h].name = F,
|
|
397
|
+
rules: [o(N)()],
|
|
398
398
|
"label-mark": "required"
|
|
399
399
|
}, null, 8, ["disabled", "label", "modelValue", "onUpdate:modelValue", "rules"])
|
|
400
400
|
]),
|
|
401
|
-
l("div",
|
|
402
|
-
y(
|
|
401
|
+
l("div", et, [
|
|
402
|
+
y(m, {
|
|
403
403
|
disabled: e.disabled,
|
|
404
|
-
label:
|
|
404
|
+
label: o(s)("inventory.unit.measurement.symbol"),
|
|
405
405
|
modelValue: e.modelValue.measurements[h].abbrev,
|
|
406
|
-
"onUpdate:modelValue": (
|
|
407
|
-
rules: [
|
|
406
|
+
"onUpdate:modelValue": (F) => e.modelValue.measurements[h].abbrev = F,
|
|
407
|
+
rules: [o(N)()],
|
|
408
408
|
"label-mark": "required"
|
|
409
409
|
}, null, 8, ["disabled", "label", "modelValue", "onUpdate:modelValue", "rules"])
|
|
410
410
|
])
|
|
411
411
|
]),
|
|
412
|
-
y(
|
|
412
|
+
y(Ie, {
|
|
413
413
|
disabled: e.disabled,
|
|
414
414
|
class: "col-span-3",
|
|
415
|
-
label:
|
|
416
|
-
"model-value": +
|
|
417
|
-
"onUpdate:modelValue": (
|
|
418
|
-
(
|
|
419
|
-
...
|
|
420
|
-
conversion:
|
|
421
|
-
|
|
422
|
-
|
|
415
|
+
label: o(s)("inventory.unit.measurement.conversion"),
|
|
416
|
+
"model-value": +o(J)(e.modelValue.measurements[h].conversion),
|
|
417
|
+
"onUpdate:modelValue": (F) => n.value = n.value.map(
|
|
418
|
+
(P, R) => R === h ? {
|
|
419
|
+
...P,
|
|
420
|
+
conversion: o($e).toPrecision(
|
|
421
|
+
o(ve)(F),
|
|
422
|
+
a.value
|
|
423
423
|
)
|
|
424
|
-
} :
|
|
424
|
+
} : P
|
|
425
425
|
),
|
|
426
|
-
rules: [
|
|
427
|
-
step: +
|
|
428
|
-
"helper-text":
|
|
426
|
+
rules: [o(ye)(0)],
|
|
427
|
+
step: +o(J)({ amount: 1, precision: a.value }),
|
|
428
|
+
"helper-text": o(s)("inventory.unit.measurement.conversionHelper", {
|
|
429
429
|
measurementSymbol: e.modelValue.measurements[h].name || " measurement unit",
|
|
430
|
-
conversion: +
|
|
430
|
+
conversion: +o(J)(e.modelValue.measurements[h].conversion),
|
|
431
431
|
unitSymbol: p.value || "base unit"
|
|
432
432
|
})
|
|
433
433
|
}, null, 8, ["disabled", "label", "model-value", "onUpdate:modelValue", "rules", "step", "helper-text"])
|
|
@@ -441,47 +441,47 @@ const je = { class: "flex flex-col gap-24" }, qe = { class: "flex gap-24" }, He
|
|
|
441
441
|
}, 512);
|
|
442
442
|
};
|
|
443
443
|
}
|
|
444
|
-
}),
|
|
444
|
+
}), nt = { class: "flex gap-4" }, ot = /* @__PURE__ */ H({
|
|
445
445
|
__name: "UnitDialog",
|
|
446
446
|
props: {
|
|
447
447
|
show: { type: Boolean },
|
|
448
448
|
unit: {},
|
|
449
|
-
mode: { default:
|
|
449
|
+
mode: { default: w.READ }
|
|
450
450
|
},
|
|
451
451
|
emits: ["update:show"],
|
|
452
452
|
setup(k) {
|
|
453
|
-
const f = k, b =
|
|
453
|
+
const f = k, b = G(), i = se(), { t: r } = K(), s = oe(f, "show"), d = oe(f, "unit"), c = g(() => {
|
|
454
454
|
switch (f.mode) {
|
|
455
|
-
case
|
|
455
|
+
case w.READ:
|
|
456
456
|
return "";
|
|
457
|
-
case
|
|
457
|
+
case w.UPDATE:
|
|
458
458
|
return r("inventory.unit.update.title");
|
|
459
|
-
case
|
|
459
|
+
case w.CREATE:
|
|
460
460
|
return r("inventory.unit.create.title");
|
|
461
461
|
}
|
|
462
462
|
return "";
|
|
463
|
-
}), p =
|
|
463
|
+
}), p = g(() => {
|
|
464
464
|
switch (f.mode) {
|
|
465
|
-
case
|
|
465
|
+
case w.READ:
|
|
466
466
|
return "";
|
|
467
|
-
case
|
|
467
|
+
case w.UPDATE:
|
|
468
468
|
return r("common.save");
|
|
469
|
-
case
|
|
469
|
+
case w.CREATE:
|
|
470
470
|
return r("common.add");
|
|
471
471
|
}
|
|
472
472
|
return "";
|
|
473
|
-
}),
|
|
473
|
+
}), a = M(), n = M(!1);
|
|
474
474
|
async function u() {
|
|
475
475
|
n.value = !0;
|
|
476
476
|
try {
|
|
477
|
-
const t =
|
|
478
|
-
t.precision ?? (t.precision = 0), t.measurements ?? (t.measurements = []), await b.createUnit(t),
|
|
477
|
+
const t = le(d.value);
|
|
478
|
+
t.precision ?? (t.precision = 0), t.measurements ?? (t.measurements = []), await b.createUnit(t), s.value = !1, i.open({
|
|
479
479
|
title: r("inventory.common.success"),
|
|
480
|
-
message: r("inventory.unit.create.success", { name:
|
|
480
|
+
message: r("inventory.unit.create.success", { name: d.value.name }),
|
|
481
481
|
type: "success"
|
|
482
482
|
});
|
|
483
483
|
} catch (t) {
|
|
484
|
-
t instanceof
|
|
484
|
+
t instanceof ne || i.open({
|
|
485
485
|
title: r("inventory.unit.create.error.title"),
|
|
486
486
|
message: r("inventory.unit.create.error.message"),
|
|
487
487
|
type: "error"
|
|
@@ -490,16 +490,16 @@ const je = { class: "flex flex-col gap-24" }, qe = { class: "flex gap-24" }, He
|
|
|
490
490
|
n.value = !1;
|
|
491
491
|
}
|
|
492
492
|
}
|
|
493
|
-
async function
|
|
493
|
+
async function x() {
|
|
494
494
|
n.value = !0;
|
|
495
495
|
try {
|
|
496
|
-
await b.updateUnit(
|
|
496
|
+
await b.updateUnit(d.value), s.value = !1, i.open({
|
|
497
497
|
title: r("inventory.common.success"),
|
|
498
|
-
message: r("inventory.unit.update.success", { name:
|
|
498
|
+
message: r("inventory.unit.update.success", { name: d.value.name }),
|
|
499
499
|
type: "success"
|
|
500
500
|
});
|
|
501
501
|
} catch (t) {
|
|
502
|
-
t instanceof
|
|
502
|
+
t instanceof ne || i.open({
|
|
503
503
|
title: r("inventory.unit.update.error.title"),
|
|
504
504
|
message: r("inventory.unit.update.error.message"),
|
|
505
505
|
type: "error"
|
|
@@ -508,118 +508,123 @@ const je = { class: "flex flex-col gap-24" }, qe = { class: "flex gap-24" }, He
|
|
|
508
508
|
n.value = !1;
|
|
509
509
|
}
|
|
510
510
|
}
|
|
511
|
-
function
|
|
512
|
-
var t,
|
|
513
|
-
(
|
|
511
|
+
function _() {
|
|
512
|
+
var t, m;
|
|
513
|
+
(m = (t = a.value) == null ? void 0 : t.validateInputs) == null || m.call(t);
|
|
514
514
|
}
|
|
515
515
|
function e() {
|
|
516
516
|
switch (f.mode) {
|
|
517
|
-
case
|
|
517
|
+
case w.READ:
|
|
518
518
|
return;
|
|
519
|
-
case
|
|
520
|
-
return
|
|
521
|
-
case
|
|
519
|
+
case w.UPDATE:
|
|
520
|
+
return x();
|
|
521
|
+
case w.CREATE:
|
|
522
522
|
return u();
|
|
523
523
|
}
|
|
524
524
|
}
|
|
525
|
-
return (t,
|
|
526
|
-
const
|
|
527
|
-
return v(), T(
|
|
528
|
-
"model-value":
|
|
529
|
-
"onUpdate:modelValue":
|
|
525
|
+
return (t, m) => {
|
|
526
|
+
const I = $("FmButton"), D = $("FmSideSheet");
|
|
527
|
+
return v(), T(D, {
|
|
528
|
+
"model-value": o(s),
|
|
529
|
+
"onUpdate:modelValue": m[3] || (m[3] = (U) => ee(s) ? s.value = U : null),
|
|
530
530
|
header: c.value,
|
|
531
531
|
"close-button": "",
|
|
532
532
|
"dismiss-away": "",
|
|
533
533
|
"max-width": 500
|
|
534
534
|
}, {
|
|
535
|
-
"side-sheet-footer":
|
|
536
|
-
l("div",
|
|
537
|
-
y(
|
|
535
|
+
"side-sheet-footer": A(() => [
|
|
536
|
+
l("div", nt, [
|
|
537
|
+
y(I, {
|
|
538
538
|
loading: n.value,
|
|
539
539
|
label: p.value,
|
|
540
|
-
onClick:
|
|
540
|
+
onClick: _
|
|
541
541
|
}, null, 8, ["loading", "label"]),
|
|
542
|
-
y(
|
|
542
|
+
y(I, {
|
|
543
543
|
disabled: n.value,
|
|
544
|
-
label:
|
|
544
|
+
label: o(r)("common.close"),
|
|
545
545
|
variant: "tertiary",
|
|
546
|
-
onClick:
|
|
546
|
+
onClick: m[2] || (m[2] = (U) => s.value = !1)
|
|
547
547
|
}, null, 8, ["disabled", "label"])
|
|
548
548
|
])
|
|
549
549
|
]),
|
|
550
|
-
default:
|
|
551
|
-
y(
|
|
550
|
+
default: A(() => [
|
|
551
|
+
y(tt, {
|
|
552
552
|
class: "w-full",
|
|
553
553
|
ref_key: "hasValidationExpose",
|
|
554
|
-
ref:
|
|
555
|
-
modelValue:
|
|
556
|
-
"onUpdate:modelValue":
|
|
554
|
+
ref: a,
|
|
555
|
+
modelValue: o(d),
|
|
556
|
+
"onUpdate:modelValue": m[0] || (m[0] = (U) => ee(d) ? d.value = U : null),
|
|
557
557
|
mode: t.mode,
|
|
558
558
|
disabled: n.value,
|
|
559
|
-
"onClick:submit":
|
|
559
|
+
"onClick:submit": m[1] || (m[1] = (U) => e())
|
|
560
560
|
}, null, 8, ["modelValue", "mode", "disabled"])
|
|
561
561
|
]),
|
|
562
562
|
_: 1
|
|
563
563
|
}, 8, ["model-value", "header"]);
|
|
564
564
|
};
|
|
565
565
|
}
|
|
566
|
-
}),
|
|
566
|
+
}), lt = { class: "flex flex-col py-8" }, st = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, vt = /* @__PURE__ */ H({
|
|
567
567
|
__name: "UnitView",
|
|
568
568
|
setup(k) {
|
|
569
|
-
const f =
|
|
570
|
-
function
|
|
571
|
-
D === "add" &&
|
|
569
|
+
const f = G(), b = be(), i = ge(), r = g(() => f.units), { createUnit: s, updateUnit: d } = Q(), { unitDialogProps: c, unitViewLoading: p } = Fe(Q()), { columnDefs: a } = qe();
|
|
570
|
+
function n(D) {
|
|
571
|
+
D === "add" && s();
|
|
572
572
|
}
|
|
573
|
-
const
|
|
574
|
-
return (D,
|
|
575
|
-
const
|
|
576
|
-
return v(), T(
|
|
577
|
-
title:
|
|
578
|
-
actions: [
|
|
579
|
-
{
|
|
573
|
+
const u = M(""), x = g(() => p.value), { breakpoints: _ } = Ce(), e = g(() => _.value.xs || _.value.sm), t = g(() => e.value ? 10 : 20), m = xe(), { t: I } = K();
|
|
574
|
+
return (D, U) => {
|
|
575
|
+
const O = $("FmTable");
|
|
576
|
+
return v(), T(_e, {
|
|
577
|
+
title: o(I)("inventory.unit.title"),
|
|
578
|
+
actions: o(i).isEnabled ? [] : [
|
|
579
|
+
{
|
|
580
|
+
label: o(I)("inventory.unit.create.title"),
|
|
581
|
+
value: "add",
|
|
582
|
+
isPrimary: !0,
|
|
583
|
+
prependIcon: "add"
|
|
584
|
+
}
|
|
580
585
|
],
|
|
581
|
-
"onClick:action":
|
|
586
|
+
"onClick:action": n
|
|
582
587
|
}, {
|
|
583
|
-
default:
|
|
588
|
+
default: A(() => [
|
|
584
589
|
l("div", {
|
|
585
|
-
class:
|
|
590
|
+
class: re([
|
|
586
591
|
"flex flex-col gap-8 max-h-full",
|
|
587
592
|
{
|
|
588
|
-
"p-0":
|
|
589
|
-
"px-24 ": !
|
|
593
|
+
"p-0": e.value,
|
|
594
|
+
"px-24 ": !e.value
|
|
590
595
|
}
|
|
591
596
|
])
|
|
592
597
|
}, [
|
|
593
|
-
y(
|
|
598
|
+
y(he, {
|
|
594
599
|
searchable: "",
|
|
595
|
-
search:
|
|
596
|
-
"onUpdate:search":
|
|
600
|
+
search: u.value,
|
|
601
|
+
"onUpdate:search": U[0] || (U[0] = (E) => u.value = E)
|
|
597
602
|
}, null, 8, ["search"]),
|
|
598
|
-
y(
|
|
599
|
-
style:
|
|
600
|
-
"column-defs": a
|
|
601
|
-
"row-data":
|
|
602
|
-
"search-value":
|
|
603
|
-
loading: !
|
|
604
|
-
onRowClick:
|
|
605
|
-
"page-size":
|
|
603
|
+
y(O, {
|
|
604
|
+
style: ie(o(m).tableHeight),
|
|
605
|
+
"column-defs": o(a),
|
|
606
|
+
"row-data": r.value,
|
|
607
|
+
"search-value": u.value,
|
|
608
|
+
loading: !o(b)._currentLocation || x.value,
|
|
609
|
+
onRowClick: U[1] || (U[1] = (E) => o(d)(E.original)),
|
|
610
|
+
"page-size": t.value
|
|
606
611
|
}, {
|
|
607
|
-
"list-row":
|
|
608
|
-
y(
|
|
612
|
+
"list-row": A((E) => [
|
|
613
|
+
y(Ve, {
|
|
609
614
|
row: E,
|
|
610
|
-
onRowClick:
|
|
615
|
+
onRowClick: o(d)
|
|
611
616
|
}, {
|
|
612
|
-
default:
|
|
613
|
-
var
|
|
617
|
+
default: A((S) => {
|
|
618
|
+
var h, F, P, R, W, B, X, z, Z;
|
|
614
619
|
return [
|
|
615
|
-
l("div",
|
|
616
|
-
l("div",
|
|
617
|
-
y(
|
|
618
|
-
render: (
|
|
619
|
-
props: (
|
|
620
|
+
l("div", lt, [
|
|
621
|
+
l("div", st, [
|
|
622
|
+
y(o(Ue), {
|
|
623
|
+
render: (P = (F = (h = S.name) == null ? void 0 : h.column) == null ? void 0 : F.columnDef) == null ? void 0 : P.cell,
|
|
624
|
+
props: (W = (R = S.name) == null ? void 0 : R.getContext) == null ? void 0 : W.call(R)
|
|
620
625
|
}, null, 8, ["render", "props"])
|
|
621
626
|
]),
|
|
622
|
-
l("div",
|
|
627
|
+
l("div", at, V((Z = (z = (X = (B = E.original.measurements) == null ? void 0 : B.map) == null ? void 0 : X.call(B, (ae) => ae.name)) == null ? void 0 : z.join) == null ? void 0 : Z.call(z, ", ")), 1)
|
|
623
628
|
])
|
|
624
629
|
];
|
|
625
630
|
}),
|
|
@@ -629,8 +634,8 @@ const je = { class: "flex flex-col gap-24" }, qe = { class: "flex gap-24" }, He
|
|
|
629
634
|
_: 1
|
|
630
635
|
}, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"])
|
|
631
636
|
], 2),
|
|
632
|
-
(v(), T(
|
|
633
|
-
y(
|
|
637
|
+
(v(), T(ue, { to: "body" }, [
|
|
638
|
+
y(ot, de(me(o(c))), null, 16)
|
|
634
639
|
]))
|
|
635
640
|
]),
|
|
636
641
|
_: 1
|
|
@@ -639,5 +644,5 @@ const je = { class: "flex flex-col gap-24" }, qe = { class: "flex gap-24" }, He
|
|
|
639
644
|
}
|
|
640
645
|
});
|
|
641
646
|
export {
|
|
642
|
-
|
|
647
|
+
vt as default
|
|
643
648
|
};
|