@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,17 +1,17 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { u as
|
|
3
|
-
import { useDialog as
|
|
4
|
-
import { i as
|
|
5
|
-
import { F as
|
|
6
|
-
import { _ as
|
|
7
|
-
import { defineStore as
|
|
8
|
-
import { c as
|
|
9
|
-
import { useI18n as
|
|
10
|
-
import { u as
|
|
11
|
-
const
|
|
1
|
+
import { defineComponent as N, ref as x, onMounted as le, resolveComponent as F, openBlock as h, createElementBlock as $, Fragment as re, createElementVNode as b, toDisplayString as ie, createVNode as y, createCommentVNode as H, computed as V, watch as ce, createBlock as M, withCtx as I, unref as v, isRef as Z, normalizeClass as ue, normalizeStyle as de, Teleport as me, normalizeProps as pe, guardReactiveProps as fe } from "vue";
|
|
2
|
+
import { u as P, c as G, S as ve, a as q, R as ye, U as ge, _ as be, A as _e, e as ee, f as we, j as Re } from "./app-S6iG6Hux.js";
|
|
3
|
+
import { useDialog as he, useSnackbar as ae, useProxiedModel as te, useBreakpoints as Ce } from "@feedmepos/ui-library";
|
|
4
|
+
import { i as xe, _ as Ee } from "./is-linked-ingredient-error-fJ2TJb3z.js";
|
|
5
|
+
import { F as R, D as ne, R as z } from "./row-action.enum-PMKMRrZR.js";
|
|
6
|
+
import { _ as se, t as Fe, d as ke } from "./xlsx.util-CODYzgF8.js";
|
|
7
|
+
import { defineStore as Ve, storeToRefs as Se } from "pinia";
|
|
8
|
+
import { c as De, _ as Ae, F as oe } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
|
|
9
|
+
import { useI18n as Y } from "@feedmepos/mf-common";
|
|
10
|
+
import { u as $e, _ as Ie, a as Pe } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CpN5Kn8b.js";
|
|
11
|
+
const Te = {
|
|
12
12
|
key: 0,
|
|
13
13
|
class: "flex flex-col items-center w-full h-full gap-24"
|
|
14
|
-
},
|
|
14
|
+
}, Me = { key: 1 }, Ue = { key: 0 }, Be = /* @__PURE__ */ N({
|
|
15
15
|
__name: "DeleteDialog",
|
|
16
16
|
props: {
|
|
17
17
|
type: {},
|
|
@@ -19,31 +19,31 @@ const Ie = {
|
|
|
19
19
|
message: {},
|
|
20
20
|
bindedItems: {}
|
|
21
21
|
},
|
|
22
|
-
setup(
|
|
23
|
-
const d =
|
|
24
|
-
|
|
22
|
+
setup(_) {
|
|
23
|
+
const d = _, p = x(d.bindedItems || []), l = x(!1);
|
|
24
|
+
le(() => {
|
|
25
25
|
a();
|
|
26
26
|
});
|
|
27
27
|
async function a() {
|
|
28
|
-
var
|
|
29
|
-
!l.value && ((
|
|
28
|
+
var i, o;
|
|
29
|
+
!l.value && ((i = d.data) != null && i._id) && (l.value = !0, p.value = await P().getAffectedMenu((o = d.data) == null ? void 0 : o._id), l.value = !1);
|
|
30
30
|
}
|
|
31
|
-
return (
|
|
32
|
-
const c =
|
|
33
|
-
return
|
|
34
|
-
|
|
35
|
-
l.value ? (
|
|
31
|
+
return (i, o) => {
|
|
32
|
+
const c = F("FmSpacer"), f = F("FmCircularProgress");
|
|
33
|
+
return h(), $(re, null, [
|
|
34
|
+
b("p", null, ie(i.message), 1),
|
|
35
|
+
l.value ? (h(), $("div", Te, [
|
|
36
36
|
y(c),
|
|
37
|
-
|
|
37
|
+
b("div", null, [
|
|
38
38
|
y(f, { size: "xl" })
|
|
39
39
|
]),
|
|
40
|
-
o[0] || (o[0] =
|
|
40
|
+
o[0] || (o[0] = b("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary pl-8" }, "Loading...", -1)),
|
|
41
41
|
y(c)
|
|
42
|
-
])) : (
|
|
43
|
-
o[2] || (o[2] =
|
|
44
|
-
p.value.length > 0 ? (
|
|
45
|
-
o[1] || (o[1] =
|
|
46
|
-
y(
|
|
42
|
+
])) : (h(), $("div", Me, [
|
|
43
|
+
o[2] || (o[2] = b("br", null, null, -1)),
|
|
44
|
+
p.value.length > 0 ? (h(), $("div", Ue, [
|
|
45
|
+
o[1] || (o[1] = b("p", { class: "fm-typo-en-body-lg-600" }, "Affected menu items:", -1)),
|
|
46
|
+
y(se, {
|
|
47
47
|
name: "Menu",
|
|
48
48
|
bindings: p.value
|
|
49
49
|
}, null, 8, ["bindings"])
|
|
@@ -52,29 +52,29 @@ const Ie = {
|
|
|
52
52
|
], 64);
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
|
-
}), K =
|
|
56
|
-
const d =
|
|
55
|
+
}), K = Ve("recipeForm", function() {
|
|
56
|
+
const d = he(), p = ae(), l = P(), a = x(!1), i = x();
|
|
57
57
|
function o() {
|
|
58
58
|
const t = {
|
|
59
59
|
recipe: {},
|
|
60
|
-
mode:
|
|
60
|
+
mode: R.CREATE,
|
|
61
61
|
show: !0,
|
|
62
62
|
"onUpdate:show"(u) {
|
|
63
|
-
|
|
63
|
+
i.value.show = u;
|
|
64
64
|
}
|
|
65
65
|
};
|
|
66
|
-
|
|
66
|
+
i.value = t;
|
|
67
67
|
}
|
|
68
68
|
async function c(t) {
|
|
69
69
|
const u = {
|
|
70
70
|
recipe: G(t),
|
|
71
|
-
mode:
|
|
71
|
+
mode: R.UPDATE,
|
|
72
72
|
show: !0,
|
|
73
73
|
"onUpdate:show"(s) {
|
|
74
|
-
|
|
74
|
+
i.value.show = s;
|
|
75
75
|
}
|
|
76
76
|
};
|
|
77
|
-
|
|
77
|
+
i.value = u;
|
|
78
78
|
}
|
|
79
79
|
async function f(t) {
|
|
80
80
|
a.value = !0;
|
|
@@ -85,9 +85,9 @@ const Ie = {
|
|
|
85
85
|
type: "success"
|
|
86
86
|
});
|
|
87
87
|
} catch (u) {
|
|
88
|
-
u instanceof
|
|
88
|
+
u instanceof ve && xe(u) ? d.open({
|
|
89
89
|
title: "Cannot delete recipe",
|
|
90
|
-
contentComponent:
|
|
90
|
+
contentComponent: Ee,
|
|
91
91
|
contentComponentProps: {
|
|
92
92
|
subject: (t == null ? void 0 : t.name) ?? "",
|
|
93
93
|
items: u.errorResponse.message
|
|
@@ -118,7 +118,7 @@ const Ie = {
|
|
|
118
118
|
text: "Cancel",
|
|
119
119
|
close: !0
|
|
120
120
|
},
|
|
121
|
-
contentComponent:
|
|
121
|
+
contentComponent: Be,
|
|
122
122
|
contentComponentProps: {
|
|
123
123
|
type: "menu",
|
|
124
124
|
data: t,
|
|
@@ -130,19 +130,19 @@ const Ie = {
|
|
|
130
130
|
createRecipe: o,
|
|
131
131
|
updateRecipe: c,
|
|
132
132
|
deleteRecipe: m,
|
|
133
|
-
recipeDialogProps:
|
|
133
|
+
recipeDialogProps: i,
|
|
134
134
|
recipeViewLoading: a
|
|
135
135
|
};
|
|
136
136
|
});
|
|
137
|
-
function
|
|
138
|
-
const { updateRecipe:
|
|
137
|
+
function Le() {
|
|
138
|
+
const { updateRecipe: _, deleteRecipe: d } = K(), { t: p } = Y();
|
|
139
139
|
async function l(o, c) {
|
|
140
140
|
const f = G(c);
|
|
141
|
-
if (o ===
|
|
142
|
-
await
|
|
141
|
+
if (o === z.Edit) {
|
|
142
|
+
await _(f);
|
|
143
143
|
return;
|
|
144
144
|
}
|
|
145
|
-
if (o ===
|
|
145
|
+
if (o === z.Delete) {
|
|
146
146
|
await d(f);
|
|
147
147
|
return;
|
|
148
148
|
}
|
|
@@ -162,8 +162,8 @@ function Ue() {
|
|
|
162
162
|
id: "action",
|
|
163
163
|
header: "",
|
|
164
164
|
cell(o) {
|
|
165
|
-
return
|
|
166
|
-
[
|
|
165
|
+
return De(
|
|
166
|
+
[ne[z.Edit], ne[z.Delete]],
|
|
167
167
|
(c) => {
|
|
168
168
|
l(c, o.row.original.original);
|
|
169
169
|
}
|
|
@@ -177,8 +177,8 @@ function Ue() {
|
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
179
|
];
|
|
180
|
-
function
|
|
181
|
-
const c =
|
|
180
|
+
function i(o) {
|
|
181
|
+
const c = P();
|
|
182
182
|
return o.map((f) => ({
|
|
183
183
|
recipe: f.name,
|
|
184
184
|
ingredients: f.contains.map((m) => {
|
|
@@ -189,15 +189,15 @@ function Ue() {
|
|
|
189
189
|
original: f
|
|
190
190
|
}));
|
|
191
191
|
}
|
|
192
|
-
return { columnDefs: a, formatRowData:
|
|
192
|
+
return { columnDefs: a, formatRowData: i };
|
|
193
193
|
}
|
|
194
|
-
const
|
|
194
|
+
const ze = { class: "flex flex-col gap-40" }, Ne = {
|
|
195
195
|
key: 0,
|
|
196
196
|
class: "col-span-2 mt-16 border-1 border-fm-color-neutral-gray-200 fm-corner-radius-lg flex flex-col p-16 gap-16"
|
|
197
|
-
},
|
|
197
|
+
}, Ye = {
|
|
198
198
|
key: 0,
|
|
199
199
|
class: "flex flex-col items-center w-full h-full gap-24"
|
|
200
|
-
},
|
|
200
|
+
}, je = { key: 1 }, He = /* @__PURE__ */ N({
|
|
201
201
|
__name: "RecipeForm",
|
|
202
202
|
props: {
|
|
203
203
|
mode: {},
|
|
@@ -205,9 +205,9 @@ const Be = { class: "flex flex-col gap-40" }, Le = {
|
|
|
205
205
|
disabled: { type: Boolean }
|
|
206
206
|
},
|
|
207
207
|
emits: ["update:modelValue", "click:submit"],
|
|
208
|
-
setup(
|
|
209
|
-
var
|
|
210
|
-
const l =
|
|
208
|
+
setup(_, { expose: d, emit: p }) {
|
|
209
|
+
var k;
|
|
210
|
+
const l = _, a = p, { t: i } = Y(), o = V({
|
|
211
211
|
get() {
|
|
212
212
|
var e;
|
|
213
213
|
return ((e = l.modelValue) == null ? void 0 : e.name) ?? "";
|
|
@@ -229,7 +229,7 @@ const Be = { class: "flex flex-col gap-40" }, Le = {
|
|
|
229
229
|
function f() {
|
|
230
230
|
a("click:submit");
|
|
231
231
|
}
|
|
232
|
-
const m =
|
|
232
|
+
const m = x();
|
|
233
233
|
d({
|
|
234
234
|
validateInputs: () => {
|
|
235
235
|
var e, n;
|
|
@@ -244,75 +244,75 @@ const Be = { class: "flex flex-col gap-40" }, Le = {
|
|
|
244
244
|
(n = (e = m.value) == null ? void 0 : e.resetInputs) == null || n.call(e);
|
|
245
245
|
}
|
|
246
246
|
});
|
|
247
|
-
const t =
|
|
248
|
-
|
|
247
|
+
const t = P(), u = x([]), s = x(!1), w = x(!1);
|
|
248
|
+
ce(s, async (e) => {
|
|
249
249
|
C(e);
|
|
250
250
|
});
|
|
251
251
|
async function C(e) {
|
|
252
|
-
var n,
|
|
253
|
-
e && !w.value && ((n = l.modelValue) != null && n._id) && (w.value = !0, u.value = await t.getAffectedMenu((
|
|
252
|
+
var n, S;
|
|
253
|
+
e && !w.value && ((n = l.modelValue) != null && n._id) && (w.value = !0, u.value = await t.getAffectedMenu((S = l.modelValue) == null ? void 0 : S._id), w.value = !1);
|
|
254
254
|
}
|
|
255
|
-
const
|
|
255
|
+
const r = V(
|
|
256
256
|
() => t.recipes.map((e) => ({ label: e.name, value: e.name }))
|
|
257
|
-
), g =
|
|
257
|
+
), g = x((k = l.modelValue) == null ? void 0 : k.name);
|
|
258
258
|
return (e, n) => {
|
|
259
|
-
const
|
|
260
|
-
return
|
|
259
|
+
const S = F("FmTextField"), j = F("FmCard"), A = F("FmSwitch"), D = F("FmSpacer"), U = F("FmCircularProgress"), B = F("FmForm");
|
|
260
|
+
return h(), M(B, {
|
|
261
261
|
ref_key: "formRef",
|
|
262
262
|
ref: m,
|
|
263
263
|
onValidationSuccess: f
|
|
264
264
|
}, {
|
|
265
|
-
default:
|
|
266
|
-
|
|
267
|
-
y(
|
|
265
|
+
default: I(() => [
|
|
266
|
+
b("div", ze, [
|
|
267
|
+
y(S, {
|
|
268
268
|
disabled: e.disabled,
|
|
269
|
-
label: v(
|
|
269
|
+
label: v(i)("inventory.recipe.name"),
|
|
270
270
|
"model-value": o.value,
|
|
271
|
-
"onUpdate:modelValue": n[0] || (n[0] = (
|
|
271
|
+
"onUpdate:modelValue": n[0] || (n[0] = (E) => o.value = E),
|
|
272
272
|
rules: [
|
|
273
|
-
v(
|
|
274
|
-
v(
|
|
273
|
+
v(ye)(),
|
|
274
|
+
v(ge)(r.value, g.value, (E) => `[${E.value}] already exists`)
|
|
275
275
|
],
|
|
276
276
|
"label-mark": "required"
|
|
277
277
|
}, null, 8, ["disabled", "label", "model-value", "rules"]),
|
|
278
|
-
y(
|
|
278
|
+
y(j, {
|
|
279
279
|
variant: "outlined",
|
|
280
280
|
class: "p-16"
|
|
281
281
|
}, {
|
|
282
|
-
default:
|
|
283
|
-
var
|
|
282
|
+
default: I(() => {
|
|
283
|
+
var E;
|
|
284
284
|
return [
|
|
285
|
-
y(
|
|
286
|
-
id: (
|
|
285
|
+
y(be, {
|
|
286
|
+
id: (E = e.modelValue) == null ? void 0 : E._id,
|
|
287
287
|
disabled: e.disabled,
|
|
288
288
|
"model-value": c.value,
|
|
289
|
-
"onUpdate:modelValue": n[1] || (n[1] = (
|
|
290
|
-
rules: [v(
|
|
289
|
+
"onUpdate:modelValue": n[1] || (n[1] = (T) => c.value = T),
|
|
290
|
+
rules: [v(_e)(1)]
|
|
291
291
|
}, null, 8, ["id", "disabled", "model-value", "rules"])
|
|
292
292
|
];
|
|
293
293
|
}),
|
|
294
294
|
_: 1
|
|
295
295
|
})
|
|
296
296
|
]),
|
|
297
|
-
e.mode !== v(
|
|
298
|
-
|
|
299
|
-
y(
|
|
297
|
+
e.mode !== v(R).CREATE ? (h(), $("div", Ne, [
|
|
298
|
+
b("div", null, [
|
|
299
|
+
y(A, {
|
|
300
300
|
label: "Show binded items",
|
|
301
301
|
modelValue: s.value,
|
|
302
|
-
"onUpdate:modelValue": n[2] || (n[2] = (
|
|
302
|
+
"onUpdate:modelValue": n[2] || (n[2] = (E) => s.value = E),
|
|
303
303
|
"label-placement": "right",
|
|
304
304
|
disabled: w.value
|
|
305
305
|
}, null, 8, ["modelValue", "disabled"])
|
|
306
306
|
]),
|
|
307
|
-
w.value ? (
|
|
308
|
-
y(
|
|
309
|
-
|
|
307
|
+
w.value ? (h(), $("div", Ye, [
|
|
308
|
+
y(D),
|
|
309
|
+
b("div", null, [
|
|
310
310
|
y(U, { size: "xl" })
|
|
311
311
|
]),
|
|
312
|
-
n[3] || (n[3] =
|
|
313
|
-
y(
|
|
314
|
-
])) : (
|
|
315
|
-
s.value && u.value.length ? (
|
|
312
|
+
n[3] || (n[3] = b("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary pl-8" }, "Loading...", -1)),
|
|
313
|
+
y(D)
|
|
314
|
+
])) : (h(), $("div", je, [
|
|
315
|
+
s.value && u.value.length ? (h(), M(se, {
|
|
316
316
|
key: 0,
|
|
317
317
|
name: "Menu",
|
|
318
318
|
bindings: u.value
|
|
@@ -324,47 +324,47 @@ const Be = { class: "flex flex-col gap-40" }, Le = {
|
|
|
324
324
|
}, 512);
|
|
325
325
|
};
|
|
326
326
|
}
|
|
327
|
-
}),
|
|
327
|
+
}), qe = { class: "flex gap-4" }, Ke = /* @__PURE__ */ N({
|
|
328
328
|
__name: "RecipeDialog",
|
|
329
329
|
props: {
|
|
330
330
|
show: { type: Boolean },
|
|
331
331
|
recipe: {},
|
|
332
|
-
mode: { default:
|
|
332
|
+
mode: { default: R.READ }
|
|
333
333
|
},
|
|
334
334
|
emits: ["update:show"],
|
|
335
|
-
setup(
|
|
336
|
-
const d =
|
|
335
|
+
setup(_) {
|
|
336
|
+
const d = _, p = P(), l = ae(), { t: a } = Y(), i = te(d, "show"), o = te(d, "recipe"), c = V(() => {
|
|
337
337
|
switch (d.mode) {
|
|
338
|
-
case
|
|
338
|
+
case R.READ:
|
|
339
339
|
return "";
|
|
340
|
-
case
|
|
340
|
+
case R.UPDATE:
|
|
341
341
|
return a("inventory.recipe.update.title");
|
|
342
|
-
case
|
|
342
|
+
case R.CREATE:
|
|
343
343
|
return a("inventory.recipe.create.title");
|
|
344
344
|
}
|
|
345
345
|
return "";
|
|
346
346
|
}), f = V(() => {
|
|
347
347
|
switch (d.mode) {
|
|
348
|
-
case
|
|
348
|
+
case R.READ:
|
|
349
349
|
return "";
|
|
350
|
-
case
|
|
350
|
+
case R.UPDATE:
|
|
351
351
|
return a("common.save");
|
|
352
|
-
case
|
|
352
|
+
case R.CREATE:
|
|
353
353
|
return a("common.add");
|
|
354
354
|
}
|
|
355
355
|
return "";
|
|
356
|
-
}), m =
|
|
356
|
+
}), m = x(), t = x(!1);
|
|
357
357
|
async function u() {
|
|
358
358
|
t.value = !0;
|
|
359
359
|
try {
|
|
360
|
-
const
|
|
361
|
-
|
|
360
|
+
const r = G(o.value);
|
|
361
|
+
r.precision ?? (r.precision = 0), r.measurements ?? (r.measurements = []), await p.createRecipe(r), i.value = !1, l.open({
|
|
362
362
|
title: a("common.success"),
|
|
363
363
|
message: a("inventory.recipe.create.success", { name: o.value.name }),
|
|
364
364
|
type: "success"
|
|
365
365
|
});
|
|
366
|
-
} catch (
|
|
367
|
-
|
|
366
|
+
} catch (r) {
|
|
367
|
+
r instanceof ee || l.open({
|
|
368
368
|
title: a("inventory.recipe.create.error.title"),
|
|
369
369
|
message: a("inventory.recipe.create.error.message"),
|
|
370
370
|
type: "error"
|
|
@@ -376,13 +376,13 @@ const Be = { class: "flex flex-col gap-40" }, Le = {
|
|
|
376
376
|
async function s() {
|
|
377
377
|
t.value = !0;
|
|
378
378
|
try {
|
|
379
|
-
await p.updateRecipe(o.value),
|
|
379
|
+
await p.updateRecipe(o.value), i.value = !1, l.open({
|
|
380
380
|
title: a("common.success"),
|
|
381
381
|
message: a("inventory.recipe.update.success", { name: o.value.name }),
|
|
382
382
|
type: "success"
|
|
383
383
|
});
|
|
384
|
-
} catch (
|
|
385
|
-
|
|
384
|
+
} catch (r) {
|
|
385
|
+
r instanceof ee || l.open({
|
|
386
386
|
title: a("inventory.recipe.update.error.title"),
|
|
387
387
|
message: a("inventory.recipe.update.error.message"),
|
|
388
388
|
type: "error"
|
|
@@ -392,52 +392,52 @@ const Be = { class: "flex flex-col gap-40" }, Le = {
|
|
|
392
392
|
}
|
|
393
393
|
}
|
|
394
394
|
function w() {
|
|
395
|
-
var
|
|
396
|
-
(g = (
|
|
395
|
+
var r, g;
|
|
396
|
+
(g = (r = m.value) == null ? void 0 : r.validateInputs) == null || g.call(r);
|
|
397
397
|
}
|
|
398
398
|
function C() {
|
|
399
399
|
switch (d.mode) {
|
|
400
|
-
case
|
|
400
|
+
case R.READ:
|
|
401
401
|
return;
|
|
402
|
-
case
|
|
402
|
+
case R.UPDATE:
|
|
403
403
|
return s();
|
|
404
|
-
case
|
|
404
|
+
case R.CREATE:
|
|
405
405
|
return u();
|
|
406
406
|
}
|
|
407
407
|
}
|
|
408
|
-
return (
|
|
409
|
-
const
|
|
410
|
-
return
|
|
411
|
-
"model-value": v(
|
|
412
|
-
"onUpdate:modelValue": g[3] || (g[3] = (n) =>
|
|
408
|
+
return (r, g) => {
|
|
409
|
+
const k = F("FmButton"), e = F("FmSideSheet");
|
|
410
|
+
return h(), M(e, {
|
|
411
|
+
"model-value": v(i),
|
|
412
|
+
"onUpdate:modelValue": g[3] || (g[3] = (n) => Z(i) ? i.value = n : null),
|
|
413
413
|
header: c.value,
|
|
414
414
|
"close-button": "",
|
|
415
415
|
"dismiss-away": "",
|
|
416
416
|
"max-width": 500
|
|
417
417
|
}, {
|
|
418
|
-
"side-sheet-footer":
|
|
419
|
-
|
|
420
|
-
y(
|
|
418
|
+
"side-sheet-footer": I(() => [
|
|
419
|
+
b("div", qe, [
|
|
420
|
+
y(k, {
|
|
421
421
|
loading: t.value,
|
|
422
422
|
label: f.value,
|
|
423
423
|
onClick: w
|
|
424
424
|
}, null, 8, ["loading", "label"]),
|
|
425
|
-
y(
|
|
425
|
+
y(k, {
|
|
426
426
|
disabled: t.value,
|
|
427
427
|
label: v(a)("common.close"),
|
|
428
428
|
variant: "tertiary",
|
|
429
|
-
onClick: g[2] || (g[2] = (n) =>
|
|
429
|
+
onClick: g[2] || (g[2] = (n) => i.value = !1)
|
|
430
430
|
}, null, 8, ["disabled", "label"])
|
|
431
431
|
])
|
|
432
432
|
]),
|
|
433
|
-
default:
|
|
434
|
-
y(
|
|
433
|
+
default: I(() => [
|
|
434
|
+
y(He, {
|
|
435
435
|
class: "w-full",
|
|
436
436
|
ref_key: "hasValidationExpose",
|
|
437
437
|
ref: m,
|
|
438
438
|
modelValue: v(o),
|
|
439
|
-
"onUpdate:modelValue": g[0] || (g[0] = (n) =>
|
|
440
|
-
mode:
|
|
439
|
+
"onUpdate:modelValue": g[0] || (g[0] = (n) => Z(o) ? o.value = n : null),
|
|
440
|
+
mode: r.mode,
|
|
441
441
|
disabled: t.value,
|
|
442
442
|
"onClick:submit": g[1] || (g[1] = (n) => C())
|
|
443
443
|
}, null, 8, ["modelValue", "mode", "disabled"])
|
|
@@ -447,8 +447,8 @@ const Be = { class: "flex flex-col gap-40" }, Le = {
|
|
|
447
447
|
};
|
|
448
448
|
}
|
|
449
449
|
});
|
|
450
|
-
function
|
|
451
|
-
const
|
|
450
|
+
function Ge() {
|
|
451
|
+
const _ = P(), d = _.recipes, p = _.recipeById, l = _.skuById, a = d.flatMap((c, f) => {
|
|
452
452
|
var m;
|
|
453
453
|
if ((m = c.contains) != null && m.length) {
|
|
454
454
|
const t = c.contains.filter((s) => s.type === "RECIPE"), u = c.contains.filter((s) => s.type === "SKU");
|
|
@@ -469,14 +469,14 @@ function qe() {
|
|
|
469
469
|
),
|
|
470
470
|
...u.map(
|
|
471
471
|
(s, w) => {
|
|
472
|
-
var C,
|
|
472
|
+
var C, r, g, k;
|
|
473
473
|
return [
|
|
474
474
|
!t.length && w === 0 ? c.name : "",
|
|
475
475
|
"INGREDIENT",
|
|
476
476
|
(C = l[s.id]) == null ? void 0 : C.code,
|
|
477
|
-
(
|
|
477
|
+
(r = l[s.id]) == null ? void 0 : r.name,
|
|
478
478
|
q(s.amount),
|
|
479
|
-
s.measurement ? s.measurement.abbrev : (
|
|
479
|
+
s.measurement ? s.measurement.abbrev : (k = (g = l[s.id]) == null ? void 0 : g.unit) == null ? void 0 : k.abbrev
|
|
480
480
|
];
|
|
481
481
|
}
|
|
482
482
|
)
|
|
@@ -486,24 +486,24 @@ function qe() {
|
|
|
486
486
|
...f === 0 ? [] : [["", "", "", "", "", ""]],
|
|
487
487
|
[c.name, "No bindings", "", "", "", ""]
|
|
488
488
|
];
|
|
489
|
-
}), o =
|
|
490
|
-
|
|
489
|
+
}), o = Fe(a, ["Name", "Type", "Code", "Item", "Amount", "Unit"]);
|
|
490
|
+
ke(o, `RECIPE_${we(/* @__PURE__ */ new Date(), "-", "-")}.xlsx`);
|
|
491
491
|
}
|
|
492
|
-
const
|
|
492
|
+
const Je = { class: "flex flex-col py-8" }, Oe = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Qe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, rt = /* @__PURE__ */ N({
|
|
493
493
|
__name: "RecipeView",
|
|
494
|
-
setup(
|
|
495
|
-
const d =
|
|
496
|
-
function u(
|
|
497
|
-
|
|
494
|
+
setup(_) {
|
|
495
|
+
const d = P(), p = V(() => d.recipes), l = Re(), { createRecipe: a, updateRecipe: i } = K(), { recipeDialogProps: o, recipeViewLoading: c } = Se(K()), { columnDefs: f, formatRowData: m } = Le(), t = V(() => m(p.value));
|
|
496
|
+
function u(n) {
|
|
497
|
+
n === "add" && a();
|
|
498
498
|
}
|
|
499
|
-
const s =
|
|
500
|
-
return (
|
|
501
|
-
const
|
|
502
|
-
return
|
|
503
|
-
title: v(
|
|
499
|
+
const s = x(""), w = V(() => c.value), { breakpoints: C } = Ce(), r = V(() => C.value.xs || C.value.sm), g = V(() => r.value ? 10 : 20), k = $e(), { t: e } = Y();
|
|
500
|
+
return (n, S) => {
|
|
501
|
+
const j = F("FmTable");
|
|
502
|
+
return h(), M(Ie, {
|
|
503
|
+
title: v(e)("inventory.recipe.title"),
|
|
504
504
|
actions: [
|
|
505
505
|
{
|
|
506
|
-
label: v(
|
|
506
|
+
label: v(e)("inventory.recipe.create.title"),
|
|
507
507
|
value: "add",
|
|
508
508
|
isPrimary: !0,
|
|
509
509
|
prependIcon: "add"
|
|
@@ -511,43 +511,51 @@ const Ke = { class: "px-24 xs:p-0 sm:p-0 flex flex-col gap-8 max-h-full" }, Ge =
|
|
|
511
511
|
],
|
|
512
512
|
"onClick:action": u
|
|
513
513
|
}, {
|
|
514
|
-
default:
|
|
515
|
-
|
|
516
|
-
|
|
514
|
+
default: I(() => [
|
|
515
|
+
b("div", {
|
|
516
|
+
class: ue([
|
|
517
|
+
"flex flex-col gap-8 max-h-full",
|
|
518
|
+
{
|
|
519
|
+
"p-0": r.value,
|
|
520
|
+
"px-24 ": !r.value
|
|
521
|
+
}
|
|
522
|
+
])
|
|
523
|
+
}, [
|
|
524
|
+
y(Pe, {
|
|
517
525
|
searchable: "",
|
|
518
526
|
search: s.value,
|
|
519
|
-
"onUpdate:search":
|
|
520
|
-
actions: [{ icon: "ios_share", onClick: v(
|
|
527
|
+
"onUpdate:search": S[0] || (S[0] = (A) => s.value = A),
|
|
528
|
+
actions: [{ icon: "ios_share", onClick: v(Ge) }]
|
|
521
529
|
}, null, 8, ["search", "actions"]),
|
|
522
|
-
(
|
|
523
|
-
style:
|
|
530
|
+
(h(), M(j, {
|
|
531
|
+
style: de(v(k).tableHeight),
|
|
524
532
|
"column-defs": v(f),
|
|
525
533
|
"row-data": t.value,
|
|
526
534
|
"search-value": s.value,
|
|
527
535
|
loading: !v(l)._currentLocation || w.value,
|
|
528
|
-
onRowClick:
|
|
536
|
+
onRowClick: S[1] || (S[1] = (A) => v(i)(A.original.original)),
|
|
529
537
|
key: p.value.length,
|
|
530
|
-
"page-size":
|
|
538
|
+
"page-size": g.value
|
|
531
539
|
}, {
|
|
532
|
-
"list-row":
|
|
533
|
-
y(
|
|
534
|
-
row:
|
|
535
|
-
onRowClick: (
|
|
540
|
+
"list-row": I((A) => [
|
|
541
|
+
y(Ae, {
|
|
542
|
+
row: A,
|
|
543
|
+
onRowClick: (D) => v(i)(D.original)
|
|
536
544
|
}, {
|
|
537
|
-
default:
|
|
538
|
-
var
|
|
545
|
+
default: I((D) => {
|
|
546
|
+
var U, B, E, T, J, O, Q, W, L, X;
|
|
539
547
|
return [
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
y(v(
|
|
543
|
-
render: (
|
|
544
|
-
props: (
|
|
548
|
+
b("div", Je, [
|
|
549
|
+
b("div", Oe, [
|
|
550
|
+
y(v(oe), {
|
|
551
|
+
render: (E = (B = (U = D.recipe) == null ? void 0 : U.column) == null ? void 0 : B.columnDef) == null ? void 0 : E.cell,
|
|
552
|
+
props: (J = (T = D.recipe) == null ? void 0 : T.getContext) == null ? void 0 : J.call(T)
|
|
545
553
|
}, null, 8, ["render", "props"])
|
|
546
554
|
]),
|
|
547
|
-
|
|
548
|
-
y(v(
|
|
549
|
-
render: (
|
|
550
|
-
props: (
|
|
555
|
+
b("div", Qe, [
|
|
556
|
+
y(v(oe), {
|
|
557
|
+
render: (W = (Q = (O = D.ingredients) == null ? void 0 : O.column) == null ? void 0 : Q.columnDef) == null ? void 0 : W.cell,
|
|
558
|
+
props: (X = (L = D.ingredients) == null ? void 0 : L.getContext) == null ? void 0 : X.call(L)
|
|
551
559
|
}, null, 8, ["render", "props"])
|
|
552
560
|
])
|
|
553
561
|
])
|
|
@@ -558,9 +566,9 @@ const Ke = { class: "px-24 xs:p-0 sm:p-0 flex flex-col gap-8 max-h-full" }, Ge =
|
|
|
558
566
|
]),
|
|
559
567
|
_: 1
|
|
560
568
|
}, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]))
|
|
561
|
-
]),
|
|
562
|
-
(
|
|
563
|
-
y(
|
|
569
|
+
], 2),
|
|
570
|
+
(h(), M(me, { to: "body" }, [
|
|
571
|
+
y(Ke, pe(fe(v(o))), null, 16)
|
|
564
572
|
]))
|
|
565
573
|
]),
|
|
566
574
|
_: 1
|
|
@@ -569,5 +577,5 @@ const Ke = { class: "px-24 xs:p-0 sm:p-0 flex flex-col gap-8 max-h-full" }, Ge =
|
|
|
569
577
|
}
|
|
570
578
|
});
|
|
571
579
|
export {
|
|
572
|
-
|
|
580
|
+
rt as default
|
|
573
581
|
};
|