@feedmepos/mf-inventory-portal 0.0.22-dev.43 → 0.0.22-dev.44
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-DJhk8ORX.js +140 -0
- package/dist/{BindingsDialog-CKjAs5mJ.js → BindingsDialog-CNY83IzG.js} +1 -1
- package/dist/{BindingsPicker-BAVZ-3dF.js → BindingsPicker-BCeGBlTl.js} +1 -1
- package/dist/{BindingsTable-qq8M9fzG.js → BindingsTable-DwN0rUr_.js} +1 -1
- package/dist/{ClosingTemplateView-DOLuHmy8.js → ClosingTemplateView-BE1JMBGd.js} +342 -349
- package/dist/{FmDroppableField-BBpVEZs4.js → FmDroppableField-DeZRIGOb.js} +13 -13
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-ChRPq-Ok.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CptHxbFO.js} +3 -3
- package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BGYVXLcj.js +435 -0
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-DrL5a2Pn.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-C0liaZ9Y.js} +1 -1
- package/dist/{IngredientsView-m5K8MlM2.js → IngredientsView-B6BPG_MN.js} +414 -417
- package/dist/{IntegrationView-BE5P68EJ.js → IntegrationView-CXurxj5t.js} +2 -2
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-B8cCv--C.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-C4np_znK.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-CcM04Veu.js → PremiumBadge.vue_vue_type_script_setup_true_lang-CvSRvT_i.js} +2 -2
- package/dist/{PurchaseOrderPrintPreview-D40E9qZt.js → PurchaseOrderPrintPreview-BYSkl_zL.js} +3 -3
- package/dist/{ReceiveRequestView-Ci7FgSjU.js → ReceiveRequestView-DWKEL17S.js} +31 -27
- package/dist/{RecipeView-Bp7iBiy7.js → RecipeView-DEZblbQT.js} +91 -88
- package/dist/{StockView-BzowFcFA.js → StockView-hijQ7wQL.js} +533 -525
- package/dist/{SupplierView-CbRnAb8G.js → SupplierView-B2xKGKCF.js} +776 -802
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-BMikyrhA.js → TransferDetails.vue_vue_type_script_setup_true_lang-CBwT8yGC.js} +5 -5
- package/dist/TransferTemplateView--2vvQWBW.js +1258 -0
- package/dist/{UnitView-B-058oRk.js → UnitView-B30FwZGg.js} +4 -4
- package/dist/{WarehouseView-RtU3sWKx.js → WarehouseView-BwbqpKwn.js} +14 -14
- package/dist/{app-By3PLx0q.js → app-DXZpbt33.js} +7334 -7251
- package/dist/app.js +1 -1
- package/dist/{decimal-CtriZ1S6.js → decimal-BVO6jH4l.js} +1 -1
- package/dist/{defineDeepModel-ClK3S9xx.js → defineDeepModel-DlkycC_t.js} +1 -1
- package/dist/{format-time-from-id-CGLKzJJO.js → format-time-from-id-Dhgv47T9.js} +1 -1
- package/dist/{format-unit-display-COeZSqdS.js → format-unit-display-D4D1b9F7.js} +15 -15
- package/dist/{supplier-BxBMThPQ.js → supplier-Beauc4QC.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-template-enabled-locations-2-BIgPnzRW.js → use-template-enabled-locations-2-DbnvkOM9.js} +1 -1
- package/dist/views/stock/components/dialog/AdjustedItemForm.vue.d.ts +30 -0
- package/dist/{xlsx-X_0qJPDg.js → xlsx-DXqCVrb5.js} +1 -1
- package/dist/{xlsx.util-BOPzVbUa.js → xlsx.util-7VhQushh.js} +1 -1
- package/package.json +1 -1
- package/dist/ApprovalView-1ZKaZJ2Z.js +0 -128
- package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BSxhRfE4.js +0 -359
- package/dist/TransferTemplateView-BwamiSyk.js +0 -1302
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { defineComponent as Y, ref as
|
|
2
|
-
import { u as I, c as G, S as ye, a as z, j as ee, R as ge, U as be, _ as _e, A as we, e as te, f as Re, i as he } from "./app-
|
|
3
|
-
import { useDialog as
|
|
4
|
-
import { i as
|
|
5
|
-
import { F as
|
|
6
|
-
import { _ as le } from "./IngredientBindedItem.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import { defineComponent as Y, ref as E, onMounted as re, resolveComponent as F, openBlock as C, createElementBlock as A, Fragment as ie, createElementVNode as w, toDisplayString as ce, createVNode as g, createCommentVNode as K, computed as V, watch as ue, createBlock as T, withCtx as P, unref as y, isRef as Z, normalizeClass as de, normalizeStyle as me, Teleport as pe, normalizeProps as fe, guardReactiveProps as ve } from "vue";
|
|
2
|
+
import { u as I, c as G, S as ye, a as z, j as ee, R as ge, U as be, _ as _e, A as we, e as te, f as Re, i as he } from "./app-DXZpbt33.js";
|
|
3
|
+
import { useDialog as xe, useSnackbar as se, useProxiedModel as ne, useBreakpoints as Ce } from "@feedmepos/ui-library";
|
|
4
|
+
import { i as Ee, _ as Se } from "./is-linked-ingredient-error-fJ2TJb3z.js";
|
|
5
|
+
import { F as x, D as oe, R as L } from "./row-action.enum-PMKMRrZR.js";
|
|
6
|
+
import { _ as le } from "./IngredientBindedItem.vue_vue_type_script_setup_true_lang-C0liaZ9Y.js";
|
|
7
7
|
import { defineStore as Fe, storeToRefs as Ve } from "pinia";
|
|
8
8
|
import { c as ke, _ as De, F as ae } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
|
|
9
9
|
import { useI18n as j } from "@feedmepos/mf-common";
|
|
10
|
-
import { u as Ie, _ as $e, a as Ae } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-
|
|
11
|
-
import { t as Pe, d as Be } from "./xlsx.util-
|
|
10
|
+
import { u as Ie, _ as $e, a as Ae } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BGYVXLcj.js";
|
|
11
|
+
import { t as Pe, d as Be } from "./xlsx.util-7VhQushh.js";
|
|
12
12
|
const Te = {
|
|
13
13
|
key: 0,
|
|
14
14
|
class: "flex flex-col items-center w-full h-full gap-24"
|
|
@@ -21,29 +21,29 @@ const Te = {
|
|
|
21
21
|
bindedItems: {}
|
|
22
22
|
},
|
|
23
23
|
setup(R) {
|
|
24
|
-
const p = R, v =
|
|
25
|
-
|
|
24
|
+
const p = R, v = E(p.bindedItems || []), r = E(!1);
|
|
25
|
+
re(() => {
|
|
26
26
|
l();
|
|
27
27
|
});
|
|
28
28
|
async function l() {
|
|
29
|
-
var c,
|
|
30
|
-
!
|
|
29
|
+
var c, i;
|
|
30
|
+
!r.value && ((c = p.data) != null && c._id) && (r.value = !0, v.value = await I().getAffectedMenu((i = p.data) == null ? void 0 : i._id), r.value = !1);
|
|
31
31
|
}
|
|
32
|
-
return (c,
|
|
32
|
+
return (c, i) => {
|
|
33
33
|
const f = F("FmSpacer"), d = F("FmCircularProgress");
|
|
34
|
-
return
|
|
34
|
+
return C(), A(ie, null, [
|
|
35
35
|
w("p", null, ce(c.message), 1),
|
|
36
|
-
|
|
36
|
+
r.value ? (C(), A("div", Te, [
|
|
37
37
|
g(f),
|
|
38
38
|
w("div", null, [
|
|
39
39
|
g(d, { size: "xl" })
|
|
40
40
|
]),
|
|
41
|
-
|
|
41
|
+
i[0] || (i[0] = w("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary pl-8" }, "Loading...", -1)),
|
|
42
42
|
g(f)
|
|
43
|
-
])) : (
|
|
44
|
-
|
|
45
|
-
v.value.length > 0 ? (
|
|
46
|
-
|
|
43
|
+
])) : (C(), A("div", Me, [
|
|
44
|
+
i[2] || (i[2] = w("br", null, null, -1)),
|
|
45
|
+
v.value.length > 0 ? (C(), A("div", Ue, [
|
|
46
|
+
i[1] || (i[1] = w("p", { class: "fm-typo-en-body-lg-600" }, "Affected menu items:", -1)),
|
|
47
47
|
g(le, {
|
|
48
48
|
name: "Menu",
|
|
49
49
|
bindings: v.value
|
|
@@ -54,11 +54,11 @@ const Te = {
|
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
56
|
}), q = Fe("recipeForm", function() {
|
|
57
|
-
const p =
|
|
58
|
-
function
|
|
57
|
+
const p = xe(), v = se(), r = I(), l = E(!1), c = E();
|
|
58
|
+
function i() {
|
|
59
59
|
const t = {
|
|
60
60
|
recipe: {},
|
|
61
|
-
mode:
|
|
61
|
+
mode: x.CREATE,
|
|
62
62
|
show: !0,
|
|
63
63
|
"onUpdate:show"(a) {
|
|
64
64
|
c.value.show = a;
|
|
@@ -69,7 +69,7 @@ const Te = {
|
|
|
69
69
|
async function f(t) {
|
|
70
70
|
const a = {
|
|
71
71
|
recipe: G(t),
|
|
72
|
-
mode:
|
|
72
|
+
mode: x.UPDATE,
|
|
73
73
|
show: !0,
|
|
74
74
|
"onUpdate:show"(e) {
|
|
75
75
|
c.value.show = e;
|
|
@@ -80,13 +80,13 @@ const Te = {
|
|
|
80
80
|
async function d(t) {
|
|
81
81
|
l.value = !0;
|
|
82
82
|
try {
|
|
83
|
-
await
|
|
83
|
+
await r.deleteRecipe(t), v.open({
|
|
84
84
|
title: "Success",
|
|
85
85
|
message: `Deleted ${t.name}`,
|
|
86
86
|
type: "success"
|
|
87
87
|
});
|
|
88
88
|
} catch (a) {
|
|
89
|
-
a instanceof ye &&
|
|
89
|
+
a instanceof ye && Ee(a) ? p.open({
|
|
90
90
|
title: "Cannot delete recipe",
|
|
91
91
|
contentComponent: Se,
|
|
92
92
|
contentComponentProps: {
|
|
@@ -128,7 +128,7 @@ const Te = {
|
|
|
128
128
|
}).onPrimary(() => d(t));
|
|
129
129
|
}
|
|
130
130
|
return {
|
|
131
|
-
createRecipe:
|
|
131
|
+
createRecipe: i,
|
|
132
132
|
updateRecipe: f,
|
|
133
133
|
deleteRecipe: u,
|
|
134
134
|
recipeDialogProps: c,
|
|
@@ -136,7 +136,7 @@ const Te = {
|
|
|
136
136
|
};
|
|
137
137
|
});
|
|
138
138
|
function Le() {
|
|
139
|
-
const { updateRecipe: R, deleteRecipe: p } = q(), v = I(), { t:
|
|
139
|
+
const { updateRecipe: R, deleteRecipe: p } = q(), v = I(), { t: r } = j();
|
|
140
140
|
async function l(d, u) {
|
|
141
141
|
const t = G(u);
|
|
142
142
|
if (d === L.Edit) {
|
|
@@ -157,15 +157,15 @@ function Le() {
|
|
|
157
157
|
)
|
|
158
158
|
];
|
|
159
159
|
}
|
|
160
|
-
const
|
|
160
|
+
const i = [
|
|
161
161
|
{
|
|
162
162
|
accessorKey: "recipe",
|
|
163
|
-
header: () =>
|
|
163
|
+
header: () => r("inventory.recipe.name"),
|
|
164
164
|
size: 400
|
|
165
165
|
},
|
|
166
166
|
{
|
|
167
167
|
accessorKey: "ingredients",
|
|
168
|
-
header: () =>
|
|
168
|
+
header: () => r("inventory.recipe.ingredients"),
|
|
169
169
|
size: "auto"
|
|
170
170
|
},
|
|
171
171
|
{
|
|
@@ -199,7 +199,7 @@ function Le() {
|
|
|
199
199
|
original: t
|
|
200
200
|
}));
|
|
201
201
|
}
|
|
202
|
-
return { columnDefs:
|
|
202
|
+
return { columnDefs: i, formatRowData: f };
|
|
203
203
|
}
|
|
204
204
|
const ze = { class: "flex flex-col gap-40" }, Ye = {
|
|
205
205
|
key: 0,
|
|
@@ -217,29 +217,29 @@ const ze = { class: "flex flex-col gap-40" }, Ye = {
|
|
|
217
217
|
emits: ["update:modelValue", "click:submit"],
|
|
218
218
|
setup(R, { expose: p, emit: v }) {
|
|
219
219
|
var h;
|
|
220
|
-
const
|
|
220
|
+
const r = R, l = v, { t: c } = j(), i = V({
|
|
221
221
|
get() {
|
|
222
222
|
var n;
|
|
223
|
-
return ((n =
|
|
223
|
+
return ((n = r.modelValue) == null ? void 0 : n.name) ?? "";
|
|
224
224
|
},
|
|
225
225
|
set(n) {
|
|
226
|
-
const o =
|
|
226
|
+
const o = r.modelValue ?? {};
|
|
227
227
|
o.name = n, l("update:modelValue", o);
|
|
228
228
|
}
|
|
229
229
|
}), f = V({
|
|
230
230
|
get() {
|
|
231
231
|
var n;
|
|
232
|
-
return ((n =
|
|
232
|
+
return ((n = r.modelValue) == null ? void 0 : n.contains) ?? [];
|
|
233
233
|
},
|
|
234
234
|
set(n) {
|
|
235
|
-
const o =
|
|
235
|
+
const o = r.modelValue ?? {};
|
|
236
236
|
o.contains = n, l("update:modelValue", o);
|
|
237
237
|
}
|
|
238
238
|
});
|
|
239
239
|
function d() {
|
|
240
240
|
l("click:submit");
|
|
241
241
|
}
|
|
242
|
-
const u =
|
|
242
|
+
const u = E();
|
|
243
243
|
p({
|
|
244
244
|
validateInputs: () => {
|
|
245
245
|
var n, o;
|
|
@@ -254,20 +254,20 @@ const ze = { class: "flex flex-col gap-40" }, Ye = {
|
|
|
254
254
|
(o = (n = u.value) == null ? void 0 : n.resetInputs) == null || o.call(n);
|
|
255
255
|
}
|
|
256
256
|
});
|
|
257
|
-
const t = I(), a =
|
|
257
|
+
const t = I(), a = E([]), e = E(!1), b = E(!1);
|
|
258
258
|
ue(e, async (n) => {
|
|
259
259
|
_(n);
|
|
260
260
|
});
|
|
261
261
|
async function _(n) {
|
|
262
262
|
var o, k;
|
|
263
|
-
n && !b.value && ((o =
|
|
263
|
+
n && !b.value && ((o = r.modelValue) != null && o._id) && (b.value = !0, a.value = await t.getAffectedMenu((k = r.modelValue) == null ? void 0 : k._id), b.value = !1);
|
|
264
264
|
}
|
|
265
265
|
const s = V(
|
|
266
266
|
() => t.recipes.map((n) => ({ label: n.name, value: n.name }))
|
|
267
|
-
), m =
|
|
267
|
+
), m = E((h = r.modelValue) == null ? void 0 : h.name);
|
|
268
268
|
return (n, o) => {
|
|
269
269
|
const k = F("FmTextField"), H = F("FmCard"), $ = F("FmSwitch"), D = F("FmSpacer"), M = F("FmCircularProgress"), U = F("FmForm");
|
|
270
|
-
return
|
|
270
|
+
return C(), T(U, {
|
|
271
271
|
ref_key: "formRef",
|
|
272
272
|
ref: u,
|
|
273
273
|
onValidationSuccess: d
|
|
@@ -277,8 +277,8 @@ const ze = { class: "flex flex-col gap-40" }, Ye = {
|
|
|
277
277
|
g(k, {
|
|
278
278
|
disabled: n.disabled,
|
|
279
279
|
label: y(c)("inventory.recipe.name"),
|
|
280
|
-
"model-value":
|
|
281
|
-
"onUpdate:modelValue": o[0] || (o[0] = (S) =>
|
|
280
|
+
"model-value": i.value,
|
|
281
|
+
"onUpdate:modelValue": o[0] || (o[0] = (S) => i.value = S),
|
|
282
282
|
rules: [
|
|
283
283
|
y(ge)(),
|
|
284
284
|
y(be)(s.value, m.value, (S) => `[${S.value}] already exists`)
|
|
@@ -304,7 +304,7 @@ const ze = { class: "flex flex-col gap-40" }, Ye = {
|
|
|
304
304
|
_: 1
|
|
305
305
|
})
|
|
306
306
|
]),
|
|
307
|
-
n.mode !== y(
|
|
307
|
+
n.mode !== y(x).CREATE ? (C(), A("div", Ye, [
|
|
308
308
|
w("div", null, [
|
|
309
309
|
g($, {
|
|
310
310
|
label: "Show binded items",
|
|
@@ -314,15 +314,15 @@ const ze = { class: "flex flex-col gap-40" }, Ye = {
|
|
|
314
314
|
disabled: b.value
|
|
315
315
|
}, null, 8, ["modelValue", "disabled"])
|
|
316
316
|
]),
|
|
317
|
-
b.value ? (
|
|
317
|
+
b.value ? (C(), A("div", je, [
|
|
318
318
|
g(D),
|
|
319
319
|
w("div", null, [
|
|
320
320
|
g(M, { size: "xl" })
|
|
321
321
|
]),
|
|
322
322
|
o[3] || (o[3] = w("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary pl-8" }, "Loading...", -1)),
|
|
323
323
|
g(D)
|
|
324
|
-
])) : (
|
|
325
|
-
e.value && a.value.length ? (
|
|
324
|
+
])) : (C(), A("div", He, [
|
|
325
|
+
e.value && a.value.length ? (C(), T(le, {
|
|
326
326
|
key: 0,
|
|
327
327
|
name: "Menu",
|
|
328
328
|
bindings: a.value
|
|
@@ -339,42 +339,42 @@ const ze = { class: "flex flex-col gap-40" }, Ye = {
|
|
|
339
339
|
props: {
|
|
340
340
|
show: { type: Boolean },
|
|
341
341
|
recipe: {},
|
|
342
|
-
mode: { default:
|
|
342
|
+
mode: { default: x.READ }
|
|
343
343
|
},
|
|
344
344
|
emits: ["update:show"],
|
|
345
345
|
setup(R) {
|
|
346
|
-
const p = R, v = I(),
|
|
346
|
+
const p = R, v = I(), r = se(), { t: l } = j(), c = ne(p, "show"), i = ne(p, "recipe"), f = V(() => {
|
|
347
347
|
switch (p.mode) {
|
|
348
|
-
case
|
|
348
|
+
case x.READ:
|
|
349
349
|
return "";
|
|
350
|
-
case
|
|
350
|
+
case x.UPDATE:
|
|
351
351
|
return l("inventory.recipe.update.title");
|
|
352
|
-
case
|
|
352
|
+
case x.CREATE:
|
|
353
353
|
return l("inventory.recipe.create.title");
|
|
354
354
|
}
|
|
355
355
|
return "";
|
|
356
356
|
}), d = V(() => {
|
|
357
357
|
switch (p.mode) {
|
|
358
|
-
case
|
|
358
|
+
case x.READ:
|
|
359
359
|
return "";
|
|
360
|
-
case
|
|
360
|
+
case x.UPDATE:
|
|
361
361
|
return l("common.save");
|
|
362
|
-
case
|
|
362
|
+
case x.CREATE:
|
|
363
363
|
return l("common.add");
|
|
364
364
|
}
|
|
365
365
|
return "";
|
|
366
|
-
}), u =
|
|
366
|
+
}), u = E(), t = E(!1);
|
|
367
367
|
async function a() {
|
|
368
368
|
t.value = !0;
|
|
369
369
|
try {
|
|
370
|
-
const s = G(
|
|
371
|
-
s.precision ?? (s.precision = 0), s.measurements ?? (s.measurements = []), await v.createRecipe(s), c.value = !1,
|
|
370
|
+
const s = G(i.value);
|
|
371
|
+
s.precision ?? (s.precision = 0), s.measurements ?? (s.measurements = []), await v.createRecipe(s), c.value = !1, r.open({
|
|
372
372
|
title: l("inventory.common.success"),
|
|
373
|
-
message: l("inventory.recipe.create.success", { name:
|
|
373
|
+
message: l("inventory.recipe.create.success", { name: i.value.name }),
|
|
374
374
|
type: "success"
|
|
375
375
|
});
|
|
376
376
|
} catch (s) {
|
|
377
|
-
s instanceof te ||
|
|
377
|
+
s instanceof te || r.open({
|
|
378
378
|
title: l("inventory.recipe.create.error.title"),
|
|
379
379
|
message: l("inventory.recipe.create.error.message"),
|
|
380
380
|
type: "error"
|
|
@@ -386,13 +386,13 @@ const ze = { class: "flex flex-col gap-40" }, Ye = {
|
|
|
386
386
|
async function e() {
|
|
387
387
|
t.value = !0;
|
|
388
388
|
try {
|
|
389
|
-
await v.updateRecipe(
|
|
389
|
+
await v.updateRecipe(i.value), c.value = !1, r.open({
|
|
390
390
|
title: l("inventory.common.success"),
|
|
391
|
-
message: l("inventory.recipe.update.success", { name:
|
|
391
|
+
message: l("inventory.recipe.update.success", { name: i.value.name }),
|
|
392
392
|
type: "success"
|
|
393
393
|
});
|
|
394
394
|
} catch (s) {
|
|
395
|
-
s instanceof te ||
|
|
395
|
+
s instanceof te || r.open({
|
|
396
396
|
title: l("inventory.recipe.update.error.title"),
|
|
397
397
|
message: l("inventory.recipe.update.error.message"),
|
|
398
398
|
type: "error"
|
|
@@ -407,17 +407,17 @@ const ze = { class: "flex flex-col gap-40" }, Ye = {
|
|
|
407
407
|
}
|
|
408
408
|
function _() {
|
|
409
409
|
switch (p.mode) {
|
|
410
|
-
case
|
|
410
|
+
case x.READ:
|
|
411
411
|
return;
|
|
412
|
-
case
|
|
412
|
+
case x.UPDATE:
|
|
413
413
|
return e();
|
|
414
|
-
case
|
|
414
|
+
case x.CREATE:
|
|
415
415
|
return a();
|
|
416
416
|
}
|
|
417
417
|
}
|
|
418
418
|
return (s, m) => {
|
|
419
419
|
const h = F("FmButton"), n = F("FmSideSheet");
|
|
420
|
-
return
|
|
420
|
+
return C(), T(n, {
|
|
421
421
|
"model-value": y(c),
|
|
422
422
|
"onUpdate:modelValue": m[3] || (m[3] = (o) => Z(c) ? c.value = o : null),
|
|
423
423
|
header: f.value,
|
|
@@ -445,8 +445,8 @@ const ze = { class: "flex flex-col gap-40" }, Ye = {
|
|
|
445
445
|
class: "w-full",
|
|
446
446
|
ref_key: "hasValidationExpose",
|
|
447
447
|
ref: u,
|
|
448
|
-
modelValue: y(
|
|
449
|
-
"onUpdate:modelValue": m[0] || (m[0] = (o) => Z(
|
|
448
|
+
modelValue: y(i),
|
|
449
|
+
"onUpdate:modelValue": m[0] || (m[0] = (o) => Z(i) ? i.value = o : null),
|
|
450
450
|
mode: s.mode,
|
|
451
451
|
disabled: t.value,
|
|
452
452
|
"onClick:submit": m[1] || (m[1] = (o) => _())
|
|
@@ -458,7 +458,7 @@ const ze = { class: "flex flex-col gap-40" }, Ye = {
|
|
|
458
458
|
}
|
|
459
459
|
});
|
|
460
460
|
function Oe() {
|
|
461
|
-
const R = I(), p = R.recipes, v = R.recipeById,
|
|
461
|
+
const R = I(), p = R.recipes, v = R.recipeById, r = R.skuById, l = p.flatMap((f, d) => {
|
|
462
462
|
var u;
|
|
463
463
|
if ((u = f.contains) != null && u.length) {
|
|
464
464
|
const t = f.contains.filter((e) => e.type === "RECIPE"), a = f.contains.filter((e) => e.type === "SKU");
|
|
@@ -483,10 +483,10 @@ function Oe() {
|
|
|
483
483
|
return [
|
|
484
484
|
!t.length && b === 0 ? f.name : "",
|
|
485
485
|
"INGREDIENT",
|
|
486
|
-
(_ =
|
|
487
|
-
(s =
|
|
486
|
+
(_ = r[e.id]) == null ? void 0 : _.code,
|
|
487
|
+
(s = r[e.id]) == null ? void 0 : s.name,
|
|
488
488
|
z(e.amount),
|
|
489
|
-
e.measurement ? e.measurement.abbrev : (h = (m =
|
|
489
|
+
e.measurement ? e.measurement.abbrev : (h = (m = r[e.id]) == null ? void 0 : m.unit) == null ? void 0 : h.abbrev
|
|
490
490
|
];
|
|
491
491
|
}
|
|
492
492
|
)
|
|
@@ -496,20 +496,23 @@ function Oe() {
|
|
|
496
496
|
...d === 0 ? [] : [["", "", "", "", "", ""]],
|
|
497
497
|
[f.name, "No bindings", "", "", "", ""]
|
|
498
498
|
];
|
|
499
|
-
}),
|
|
500
|
-
Be(
|
|
499
|
+
}), i = Pe(l, ["Name", "Type", "Code", "Item", "Amount", "Unit"]);
|
|
500
|
+
Be(i, `RECIPE_${Re(/* @__PURE__ */ new Date(), "-", "-")}.xlsx`);
|
|
501
501
|
}
|
|
502
502
|
const Je = { class: "flex flex-col py-8" }, Qe = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, We = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ct = /* @__PURE__ */ Y({
|
|
503
503
|
__name: "RecipeView",
|
|
504
504
|
setup(R) {
|
|
505
|
-
const p = I(), v = V(() => p.recipes),
|
|
505
|
+
const p = I(), v = V(() => p.recipes), r = he(), { createRecipe: l, updateRecipe: c } = q(), { recipeDialogProps: i, recipeViewLoading: f } = Ve(q()), { columnDefs: d, formatRowData: u } = Le(), t = V(() => u(v.value));
|
|
506
506
|
function a(o) {
|
|
507
|
-
o === "add"
|
|
507
|
+
if (o === "add")
|
|
508
|
+
return l();
|
|
509
|
+
if (o === "export")
|
|
510
|
+
return Oe();
|
|
508
511
|
}
|
|
509
|
-
const e =
|
|
512
|
+
const e = E(""), b = V(() => f.value), { breakpoints: _ } = Ce(), s = V(() => _.value.xs || _.value.sm), m = V(() => s.value ? 10 : 20), h = Ie(), { t: n } = j();
|
|
510
513
|
return (o, k) => {
|
|
511
514
|
const H = F("FmTable");
|
|
512
|
-
return
|
|
515
|
+
return C(), T($e, {
|
|
513
516
|
title: y(n)("inventory.recipe.title"),
|
|
514
517
|
actions: [
|
|
515
518
|
{
|
|
@@ -517,7 +520,8 @@ const Je = { class: "flex flex-col py-8" }, Qe = { class: "fm-typo-en-body-lg-60
|
|
|
517
520
|
value: "add",
|
|
518
521
|
isPrimary: !0,
|
|
519
522
|
prependIcon: "add"
|
|
520
|
-
}
|
|
523
|
+
},
|
|
524
|
+
{ label: y(n)("common.export"), value: "export", isPrimary: !1 }
|
|
521
525
|
],
|
|
522
526
|
"onClick:action": a
|
|
523
527
|
}, {
|
|
@@ -534,15 +538,14 @@ const Je = { class: "flex flex-col py-8" }, Qe = { class: "fm-typo-en-body-lg-60
|
|
|
534
538
|
g(Ae, {
|
|
535
539
|
searchable: "",
|
|
536
540
|
search: e.value,
|
|
537
|
-
"onUpdate:search": k[0] || (k[0] = ($) => e.value = $)
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
(E(), T(H, {
|
|
541
|
+
"onUpdate:search": k[0] || (k[0] = ($) => e.value = $)
|
|
542
|
+
}, null, 8, ["search"]),
|
|
543
|
+
(C(), T(H, {
|
|
541
544
|
style: me(y(h).tableHeight),
|
|
542
545
|
"column-defs": y(d),
|
|
543
546
|
"row-data": t.value,
|
|
544
547
|
"search-value": e.value,
|
|
545
|
-
loading: !y(
|
|
548
|
+
loading: !y(r)._currentLocation || b.value,
|
|
546
549
|
onRowClick: k[1] || (k[1] = ($) => y(c)($.original.original)),
|
|
547
550
|
key: v.value.length,
|
|
548
551
|
"page-size": m.value
|
|
@@ -577,8 +580,8 @@ const Je = { class: "flex flex-col py-8" }, Qe = { class: "fm-typo-en-body-lg-60
|
|
|
577
580
|
_: 1
|
|
578
581
|
}, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]))
|
|
579
582
|
], 2),
|
|
580
|
-
(
|
|
581
|
-
g(Ge, fe(ve(y(
|
|
583
|
+
(C(), T(pe, { to: "body" }, [
|
|
584
|
+
g(Ge, fe(ve(y(i))), null, 16)
|
|
582
585
|
]))
|
|
583
586
|
]),
|
|
584
587
|
_: 1
|