@feedmepos/mf-inventory-portal 0.0.22-dev.15 → 0.0.22-dev.16
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-BOP6b_Yd.js → ApprovalView-CAYVSFN0.js} +4 -4
- package/dist/{BindingsDialog-BLyRf9wO.js → BindingsDialog-vA6l3jG3.js} +1 -1
- package/dist/{BindingsPicker-CNbfKeSB.js → BindingsPicker-CtkS9du1.js} +1 -1
- package/dist/{BindingsTable-CH73rDTZ.js → BindingsTable-BsTvZ3Uc.js} +1 -1
- package/dist/{ClosingTemplateView-c572PM5W.js → ClosingTemplateView-Bjd9mypa.js} +5 -5
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CpmzTuAj.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-C-ixTs_z.js} +1 -1
- package/dist/{IngredientsView-CdE3WOqJ.js → IngredientsView-mZKGdmy8.js} +3 -3
- package/dist/{IntegrationView-B29NSwpf.js → IntegrationView-DQXcW-ln.js} +2 -2
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CZsQjzBa.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CkIFefTS.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-BwKpNPDY.js → PremiumBadge.vue_vue_type_script_setup_true_lang-DbP09mHM.js} +1 -1
- package/dist/{PurchaseOrderPrintPreview-mHevDWzN.js → PurchaseOrderPrintPreview-B8fEITH6.js} +1 -1
- package/dist/{ReceiveRequestView-Bl4SuM6j.js → ReceiveRequestView-0gHjqve_.js} +6 -6
- package/dist/RecipeView-D9Xl9ezv.js +590 -0
- package/dist/{StockView-C4z9Qi7T.js → StockView-D1Q8Y387.js} +6 -6
- package/dist/{SupplierView-CXyWhB9D.js → SupplierView-kheETesd.js} +3 -3
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-C_cTUji8.js → TransferDetails.vue_vue_type_script_setup_true_lang-Cigg5L-V.js} +4 -4
- package/dist/{TransferDialog.vue_vue_type_script_setup_true_lang-DV59BWff.js → TransferDialog.vue_vue_type_script_setup_true_lang-Ck5_VSjb.js} +5 -5
- package/dist/{TransferTemplateView-Dpxk9Zwt.js → TransferTemplateView-Cp6Qqig-.js} +8 -8
- package/dist/{UnitView-BQlwparN.js → UnitView-BAcYAfVj.js} +4 -4
- package/dist/{WarehouseView-Cu7pKilf.js → WarehouseView-CkhMv-Om.js} +2 -2
- package/dist/{app-CFkNddzq.js → app-BdUHoQTw.js} +318 -318
- package/dist/app.js +1 -1
- package/dist/{decimal-D0W3dojG.js → decimal-DEVEov-F.js} +1 -1
- package/dist/{defineDeepModel-DWffbsZh.js → defineDeepModel-BZrIgGc7.js} +1 -1
- package/dist/{format-time-from-id-BZAepMJZ.js → format-time-from-id-DkDDZc4Y.js} +1 -1
- package/dist/{id-to-date-BJEGh6zQ.js → id-to-date-CN0cWcz6.js} +1 -1
- package/dist/{purchase-order-transaction-type-CAJDFGQP.js → purchase-order-transaction-type-B80tMuy6.js} +3 -3
- package/dist/{supplier-ChSqlZUK.js → supplier-BKYn47F9.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-template-enabled-locations-2-B4M8z0b7.js → use-template-enabled-locations-2-Cg7uYAyw.js} +1 -1
- package/dist/{xlsx-BH3xrhEk.js → xlsx-BshS3GM8.js} +1 -1
- package/dist/{xlsx.util-DlY5MITI.js → xlsx.util-B_wXW9m4.js} +2 -2
- package/package.json +1 -1
- package/dist/RecipeView-BHBJlY-_.js +0 -581
|
@@ -0,0 +1,590 @@
|
|
|
1
|
+
import { defineComponent as Y, ref as x, onMounted as ie, resolveComponent as F, openBlock as E, createElementBlock as A, Fragment as re, createElementVNode as w, toDisplayString as ce, createVNode as g, createCommentVNode as K, computed as k, 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, k as ee, R as ge, U as be, _ as _e, A as we, e as te, f as Re, j as he } from "./app-BdUHoQTw.js";
|
|
3
|
+
import { useDialog as Ce, useSnackbar as se, useProxiedModel as ne, useBreakpoints as Ee } from "@feedmepos/ui-library";
|
|
4
|
+
import { i as xe, _ as Se } from "./is-linked-ingredient-error-fJ2TJb3z.js";
|
|
5
|
+
import { F as C, D as oe, R as L } from "./row-action.enum-PMKMRrZR.js";
|
|
6
|
+
import { _ as le, t as Fe, d as ke } from "./xlsx.util-B_wXW9m4.js";
|
|
7
|
+
import { defineStore as Ve, storeToRefs as De } from "pinia";
|
|
8
|
+
import { c as Ie, _ as $e, F as ae } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
|
|
9
|
+
import { useI18n as j } from "@feedmepos/mf-common";
|
|
10
|
+
import { u as Ae, _ as Pe, a as Be } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-C-ixTs_z.js";
|
|
11
|
+
const Te = {
|
|
12
|
+
key: 0,
|
|
13
|
+
class: "flex flex-col items-center w-full h-full gap-24"
|
|
14
|
+
}, Me = { key: 1 }, Ue = { key: 0 }, Ne = /* @__PURE__ */ Y({
|
|
15
|
+
__name: "DeleteDialog",
|
|
16
|
+
props: {
|
|
17
|
+
type: {},
|
|
18
|
+
data: {},
|
|
19
|
+
message: {},
|
|
20
|
+
bindedItems: {}
|
|
21
|
+
},
|
|
22
|
+
setup(R) {
|
|
23
|
+
const p = R, v = x(p.bindedItems || []), i = x(!1);
|
|
24
|
+
ie(() => {
|
|
25
|
+
l();
|
|
26
|
+
});
|
|
27
|
+
async function l() {
|
|
28
|
+
var c, r;
|
|
29
|
+
!i.value && ((c = p.data) != null && c._id) && (i.value = !0, v.value = await I().getAffectedMenu((r = p.data) == null ? void 0 : r._id), i.value = !1);
|
|
30
|
+
}
|
|
31
|
+
return (c, r) => {
|
|
32
|
+
const f = F("FmSpacer"), d = F("FmCircularProgress");
|
|
33
|
+
return E(), A(re, null, [
|
|
34
|
+
w("p", null, ce(c.message), 1),
|
|
35
|
+
i.value ? (E(), A("div", Te, [
|
|
36
|
+
g(f),
|
|
37
|
+
w("div", null, [
|
|
38
|
+
g(d, { size: "xl" })
|
|
39
|
+
]),
|
|
40
|
+
r[0] || (r[0] = w("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary pl-8" }, "Loading...", -1)),
|
|
41
|
+
g(f)
|
|
42
|
+
])) : (E(), A("div", Me, [
|
|
43
|
+
r[2] || (r[2] = w("br", null, null, -1)),
|
|
44
|
+
v.value.length > 0 ? (E(), A("div", Ue, [
|
|
45
|
+
r[1] || (r[1] = w("p", { class: "fm-typo-en-body-lg-600" }, "Affected menu items:", -1)),
|
|
46
|
+
g(le, {
|
|
47
|
+
name: "Menu",
|
|
48
|
+
bindings: v.value
|
|
49
|
+
}, null, 8, ["bindings"])
|
|
50
|
+
])) : K("", !0)
|
|
51
|
+
]))
|
|
52
|
+
], 64);
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
}), q = Ve("recipeForm", function() {
|
|
56
|
+
const p = Ce(), v = se(), i = I(), l = x(!1), c = x();
|
|
57
|
+
function r() {
|
|
58
|
+
const t = {
|
|
59
|
+
recipe: {},
|
|
60
|
+
mode: C.CREATE,
|
|
61
|
+
show: !0,
|
|
62
|
+
"onUpdate:show"(a) {
|
|
63
|
+
c.value.show = a;
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
c.value = t;
|
|
67
|
+
}
|
|
68
|
+
async function f(t) {
|
|
69
|
+
const a = {
|
|
70
|
+
recipe: G(t),
|
|
71
|
+
mode: C.UPDATE,
|
|
72
|
+
show: !0,
|
|
73
|
+
"onUpdate:show"(e) {
|
|
74
|
+
c.value.show = e;
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
c.value = a;
|
|
78
|
+
}
|
|
79
|
+
async function d(t) {
|
|
80
|
+
l.value = !0;
|
|
81
|
+
try {
|
|
82
|
+
await i.deleteRecipe(t), v.open({
|
|
83
|
+
title: "Success",
|
|
84
|
+
message: `Deleted ${t.name}`,
|
|
85
|
+
type: "success"
|
|
86
|
+
});
|
|
87
|
+
} catch (a) {
|
|
88
|
+
a instanceof ye && xe(a) ? p.open({
|
|
89
|
+
title: "Cannot delete recipe",
|
|
90
|
+
contentComponent: Se,
|
|
91
|
+
contentComponentProps: {
|
|
92
|
+
subject: (t == null ? void 0 : t.name) ?? "",
|
|
93
|
+
items: a.errorResponse.message
|
|
94
|
+
},
|
|
95
|
+
secondaryActions: {
|
|
96
|
+
text: "Close",
|
|
97
|
+
close: !0
|
|
98
|
+
}
|
|
99
|
+
}) : console.log("unable to delete recipe", a), v.open({
|
|
100
|
+
title: `Cannot delete ${t == null ? void 0 : t.name}`,
|
|
101
|
+
message: "Please try again.",
|
|
102
|
+
type: "error"
|
|
103
|
+
}), console.error("failed to delete recipe", a);
|
|
104
|
+
} finally {
|
|
105
|
+
l.value = !1;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
function u(t) {
|
|
109
|
+
p.open({
|
|
110
|
+
title: `Delete ${(t == null ? void 0 : t.name) ?? "recipe"}?`,
|
|
111
|
+
closeButton: !1,
|
|
112
|
+
primaryActions: {
|
|
113
|
+
text: "Delete",
|
|
114
|
+
close: !0,
|
|
115
|
+
variant: "destructive"
|
|
116
|
+
},
|
|
117
|
+
secondaryActions: {
|
|
118
|
+
text: "Cancel",
|
|
119
|
+
close: !0
|
|
120
|
+
},
|
|
121
|
+
contentComponent: Ne,
|
|
122
|
+
contentComponentProps: {
|
|
123
|
+
type: "menu",
|
|
124
|
+
data: t,
|
|
125
|
+
message: "You may not be able to delete this recipe if it is linked in any of the inventory modules."
|
|
126
|
+
}
|
|
127
|
+
}).onPrimary(() => d(t));
|
|
128
|
+
}
|
|
129
|
+
return {
|
|
130
|
+
createRecipe: r,
|
|
131
|
+
updateRecipe: f,
|
|
132
|
+
deleteRecipe: u,
|
|
133
|
+
recipeDialogProps: c,
|
|
134
|
+
recipeViewLoading: l
|
|
135
|
+
};
|
|
136
|
+
});
|
|
137
|
+
function Le() {
|
|
138
|
+
const { updateRecipe: R, deleteRecipe: p } = q(), v = I(), { t: i } = j();
|
|
139
|
+
async function l(d, u) {
|
|
140
|
+
const t = G(u);
|
|
141
|
+
if (d === L.Edit) {
|
|
142
|
+
await R(t);
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
if (d === L.Delete) {
|
|
146
|
+
await p(t);
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
function c(d, u) {
|
|
151
|
+
const t = d.filter((e) => e.type === ee.enum.SKU), a = d.filter((e) => e.type === ee.enum.RECIPE);
|
|
152
|
+
return [
|
|
153
|
+
...t.map((e) => ({ ...e, recipeIds: [...u] })),
|
|
154
|
+
...a.filter((e) => v.recipeById[e.id] && !u.has(e.id)).flatMap(
|
|
155
|
+
(e) => c(v.recipeById[e.id].contains, /* @__PURE__ */ new Set([...u, e.id]))
|
|
156
|
+
)
|
|
157
|
+
];
|
|
158
|
+
}
|
|
159
|
+
const r = [
|
|
160
|
+
{
|
|
161
|
+
accessorKey: "recipe",
|
|
162
|
+
header: () => i("inventory.recipe.name"),
|
|
163
|
+
size: 400
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
accessorKey: "ingredients",
|
|
167
|
+
header: () => i("inventory.recipe.ingredients"),
|
|
168
|
+
size: "auto"
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
id: "action",
|
|
172
|
+
header: "",
|
|
173
|
+
cell(d) {
|
|
174
|
+
return Ie(
|
|
175
|
+
[oe[L.Edit], oe[L.Delete]],
|
|
176
|
+
(u) => {
|
|
177
|
+
l(u, d.row.original.original);
|
|
178
|
+
}
|
|
179
|
+
);
|
|
180
|
+
},
|
|
181
|
+
enableSorting: !1,
|
|
182
|
+
size: 40,
|
|
183
|
+
meta: {
|
|
184
|
+
cellClass: "",
|
|
185
|
+
headerClass: ""
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
];
|
|
189
|
+
function f(d) {
|
|
190
|
+
const u = I();
|
|
191
|
+
return d.map((t) => ({
|
|
192
|
+
recipe: t.name,
|
|
193
|
+
ingredients: c(t.contains, /* @__PURE__ */ new Set([t._id])).map((a) => {
|
|
194
|
+
var b, _, s, m, h;
|
|
195
|
+
const e = u.skuById[a.id];
|
|
196
|
+
return e ? a.recipeIds.length ? `(linked recipe ${(b = u.recipeById[a.recipeIds.at(-1) ?? ""]) == null ? void 0 : b.name}) ${e.name} (${z(a.amount)}${((_ = a.measurement) == null ? void 0 : _.abbrev) ?? ((s = e == null ? void 0 : e.unit) == null ? void 0 : s.abbrev)})` : `${e.name} (${z(a.amount)}${((m = a.measurement) == null ? void 0 : m.abbrev) ?? ((h = e == null ? void 0 : e.unit) == null ? void 0 : h.abbrev)})` : null;
|
|
197
|
+
}).filter((a) => a).join(", "),
|
|
198
|
+
original: t
|
|
199
|
+
}));
|
|
200
|
+
}
|
|
201
|
+
return { columnDefs: r, formatRowData: f };
|
|
202
|
+
}
|
|
203
|
+
const ze = { class: "flex flex-col gap-40" }, Ye = {
|
|
204
|
+
key: 0,
|
|
205
|
+
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"
|
|
206
|
+
}, je = {
|
|
207
|
+
key: 0,
|
|
208
|
+
class: "flex flex-col items-center w-full h-full gap-24"
|
|
209
|
+
}, He = { key: 1 }, Ke = /* @__PURE__ */ Y({
|
|
210
|
+
__name: "RecipeForm",
|
|
211
|
+
props: {
|
|
212
|
+
mode: {},
|
|
213
|
+
modelValue: {},
|
|
214
|
+
disabled: { type: Boolean }
|
|
215
|
+
},
|
|
216
|
+
emits: ["update:modelValue", "click:submit"],
|
|
217
|
+
setup(R, { expose: p, emit: v }) {
|
|
218
|
+
var h;
|
|
219
|
+
const i = R, l = v, { t: c } = j(), r = k({
|
|
220
|
+
get() {
|
|
221
|
+
var n;
|
|
222
|
+
return ((n = i.modelValue) == null ? void 0 : n.name) ?? "";
|
|
223
|
+
},
|
|
224
|
+
set(n) {
|
|
225
|
+
const o = i.modelValue ?? {};
|
|
226
|
+
o.name = n, l("update:modelValue", o);
|
|
227
|
+
}
|
|
228
|
+
}), f = k({
|
|
229
|
+
get() {
|
|
230
|
+
var n;
|
|
231
|
+
return ((n = i.modelValue) == null ? void 0 : n.contains) ?? [];
|
|
232
|
+
},
|
|
233
|
+
set(n) {
|
|
234
|
+
const o = i.modelValue ?? {};
|
|
235
|
+
o.contains = n, l("update:modelValue", o);
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
function d() {
|
|
239
|
+
l("click:submit");
|
|
240
|
+
}
|
|
241
|
+
const u = x();
|
|
242
|
+
p({
|
|
243
|
+
validateInputs: () => {
|
|
244
|
+
var n, o;
|
|
245
|
+
(o = (n = u.value) == null ? void 0 : n.validateInputs) == null || o.call(n);
|
|
246
|
+
},
|
|
247
|
+
resetInputsValidation: () => {
|
|
248
|
+
var n, o;
|
|
249
|
+
(o = (n = u.value) == null ? void 0 : n.resetInputsValidation) == null || o.call(n);
|
|
250
|
+
},
|
|
251
|
+
resetInputs: () => {
|
|
252
|
+
var n, o;
|
|
253
|
+
(o = (n = u.value) == null ? void 0 : n.resetInputs) == null || o.call(n);
|
|
254
|
+
}
|
|
255
|
+
});
|
|
256
|
+
const t = I(), a = x([]), e = x(!1), b = x(!1);
|
|
257
|
+
ue(e, async (n) => {
|
|
258
|
+
_(n);
|
|
259
|
+
});
|
|
260
|
+
async function _(n) {
|
|
261
|
+
var o, V;
|
|
262
|
+
n && !b.value && ((o = i.modelValue) != null && o._id) && (b.value = !0, a.value = await t.getAffectedMenu((V = i.modelValue) == null ? void 0 : V._id), b.value = !1);
|
|
263
|
+
}
|
|
264
|
+
const s = k(
|
|
265
|
+
() => t.recipes.map((n) => ({ label: n.name, value: n.name }))
|
|
266
|
+
), m = x((h = i.modelValue) == null ? void 0 : h.name);
|
|
267
|
+
return (n, o) => {
|
|
268
|
+
const V = F("FmTextField"), H = F("FmCard"), $ = F("FmSwitch"), D = F("FmSpacer"), M = F("FmCircularProgress"), U = F("FmForm");
|
|
269
|
+
return E(), T(U, {
|
|
270
|
+
ref_key: "formRef",
|
|
271
|
+
ref: u,
|
|
272
|
+
onValidationSuccess: d
|
|
273
|
+
}, {
|
|
274
|
+
default: P(() => [
|
|
275
|
+
w("div", ze, [
|
|
276
|
+
g(V, {
|
|
277
|
+
disabled: n.disabled,
|
|
278
|
+
label: y(c)("inventory.recipe.name"),
|
|
279
|
+
"model-value": r.value,
|
|
280
|
+
"onUpdate:modelValue": o[0] || (o[0] = (S) => r.value = S),
|
|
281
|
+
rules: [
|
|
282
|
+
y(ge)(),
|
|
283
|
+
y(be)(s.value, m.value, (S) => `[${S.value}] already exists`)
|
|
284
|
+
],
|
|
285
|
+
"label-mark": "required"
|
|
286
|
+
}, null, 8, ["disabled", "label", "model-value", "rules"]),
|
|
287
|
+
g(H, {
|
|
288
|
+
variant: "outlined",
|
|
289
|
+
class: "p-16"
|
|
290
|
+
}, {
|
|
291
|
+
default: P(() => {
|
|
292
|
+
var S;
|
|
293
|
+
return [
|
|
294
|
+
g(_e, {
|
|
295
|
+
id: (S = n.modelValue) == null ? void 0 : S._id,
|
|
296
|
+
disabled: n.disabled,
|
|
297
|
+
"model-value": f.value,
|
|
298
|
+
"onUpdate:modelValue": o[1] || (o[1] = (B) => f.value = B),
|
|
299
|
+
rules: [y(we)(1)]
|
|
300
|
+
}, null, 8, ["id", "disabled", "model-value", "rules"])
|
|
301
|
+
];
|
|
302
|
+
}),
|
|
303
|
+
_: 1
|
|
304
|
+
})
|
|
305
|
+
]),
|
|
306
|
+
n.mode !== y(C).CREATE ? (E(), A("div", Ye, [
|
|
307
|
+
w("div", null, [
|
|
308
|
+
g($, {
|
|
309
|
+
label: "Show binded items",
|
|
310
|
+
modelValue: e.value,
|
|
311
|
+
"onUpdate:modelValue": o[2] || (o[2] = (S) => e.value = S),
|
|
312
|
+
"label-placement": "right",
|
|
313
|
+
disabled: b.value
|
|
314
|
+
}, null, 8, ["modelValue", "disabled"])
|
|
315
|
+
]),
|
|
316
|
+
b.value ? (E(), A("div", je, [
|
|
317
|
+
g(D),
|
|
318
|
+
w("div", null, [
|
|
319
|
+
g(M, { size: "xl" })
|
|
320
|
+
]),
|
|
321
|
+
o[3] || (o[3] = w("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary pl-8" }, "Loading...", -1)),
|
|
322
|
+
g(D)
|
|
323
|
+
])) : (E(), A("div", He, [
|
|
324
|
+
e.value && a.value.length ? (E(), T(le, {
|
|
325
|
+
key: 0,
|
|
326
|
+
name: "Menu",
|
|
327
|
+
bindings: a.value
|
|
328
|
+
}, null, 8, ["bindings"])) : K("", !0)
|
|
329
|
+
]))
|
|
330
|
+
])) : K("", !0)
|
|
331
|
+
]),
|
|
332
|
+
_: 1
|
|
333
|
+
}, 512);
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
}), qe = { class: "flex gap-4" }, Ge = /* @__PURE__ */ Y({
|
|
337
|
+
__name: "RecipeDialog",
|
|
338
|
+
props: {
|
|
339
|
+
show: { type: Boolean },
|
|
340
|
+
recipe: {},
|
|
341
|
+
mode: { default: C.READ }
|
|
342
|
+
},
|
|
343
|
+
emits: ["update:show"],
|
|
344
|
+
setup(R) {
|
|
345
|
+
const p = R, v = I(), i = se(), { t: l } = j(), c = ne(p, "show"), r = ne(p, "recipe"), f = k(() => {
|
|
346
|
+
switch (p.mode) {
|
|
347
|
+
case C.READ:
|
|
348
|
+
return "";
|
|
349
|
+
case C.UPDATE:
|
|
350
|
+
return l("inventory.recipe.update.title");
|
|
351
|
+
case C.CREATE:
|
|
352
|
+
return l("inventory.recipe.create.title");
|
|
353
|
+
}
|
|
354
|
+
return "";
|
|
355
|
+
}), d = k(() => {
|
|
356
|
+
switch (p.mode) {
|
|
357
|
+
case C.READ:
|
|
358
|
+
return "";
|
|
359
|
+
case C.UPDATE:
|
|
360
|
+
return l("common.save");
|
|
361
|
+
case C.CREATE:
|
|
362
|
+
return l("common.add");
|
|
363
|
+
}
|
|
364
|
+
return "";
|
|
365
|
+
}), u = x(), t = x(!1);
|
|
366
|
+
async function a() {
|
|
367
|
+
t.value = !0;
|
|
368
|
+
try {
|
|
369
|
+
const s = G(r.value);
|
|
370
|
+
s.precision ?? (s.precision = 0), s.measurements ?? (s.measurements = []), await v.createRecipe(s), c.value = !1, i.open({
|
|
371
|
+
title: l("common.success"),
|
|
372
|
+
message: l("inventory.recipe.create.success", { name: r.value.name }),
|
|
373
|
+
type: "success"
|
|
374
|
+
});
|
|
375
|
+
} catch (s) {
|
|
376
|
+
s instanceof te || i.open({
|
|
377
|
+
title: l("inventory.recipe.create.error.title"),
|
|
378
|
+
message: l("inventory.recipe.create.error.message"),
|
|
379
|
+
type: "error"
|
|
380
|
+
});
|
|
381
|
+
} finally {
|
|
382
|
+
t.value = !1;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
async function e() {
|
|
386
|
+
t.value = !0;
|
|
387
|
+
try {
|
|
388
|
+
await v.updateRecipe(r.value), c.value = !1, i.open({
|
|
389
|
+
title: l("common.success"),
|
|
390
|
+
message: l("inventory.recipe.update.success", { name: r.value.name }),
|
|
391
|
+
type: "success"
|
|
392
|
+
});
|
|
393
|
+
} catch (s) {
|
|
394
|
+
s instanceof te || i.open({
|
|
395
|
+
title: l("inventory.recipe.update.error.title"),
|
|
396
|
+
message: l("inventory.recipe.update.error.message"),
|
|
397
|
+
type: "error"
|
|
398
|
+
});
|
|
399
|
+
} finally {
|
|
400
|
+
t.value = !1;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
function b() {
|
|
404
|
+
var s, m;
|
|
405
|
+
(m = (s = u.value) == null ? void 0 : s.validateInputs) == null || m.call(s);
|
|
406
|
+
}
|
|
407
|
+
function _() {
|
|
408
|
+
switch (p.mode) {
|
|
409
|
+
case C.READ:
|
|
410
|
+
return;
|
|
411
|
+
case C.UPDATE:
|
|
412
|
+
return e();
|
|
413
|
+
case C.CREATE:
|
|
414
|
+
return a();
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
return (s, m) => {
|
|
418
|
+
const h = F("FmButton"), n = F("FmSideSheet");
|
|
419
|
+
return E(), T(n, {
|
|
420
|
+
"model-value": y(c),
|
|
421
|
+
"onUpdate:modelValue": m[3] || (m[3] = (o) => Z(c) ? c.value = o : null),
|
|
422
|
+
header: f.value,
|
|
423
|
+
"close-button": "",
|
|
424
|
+
"dismiss-away": "",
|
|
425
|
+
"max-width": 500
|
|
426
|
+
}, {
|
|
427
|
+
"side-sheet-footer": P(() => [
|
|
428
|
+
w("div", qe, [
|
|
429
|
+
g(h, {
|
|
430
|
+
loading: t.value,
|
|
431
|
+
label: d.value,
|
|
432
|
+
onClick: b
|
|
433
|
+
}, null, 8, ["loading", "label"]),
|
|
434
|
+
g(h, {
|
|
435
|
+
disabled: t.value,
|
|
436
|
+
label: y(l)("common.close"),
|
|
437
|
+
variant: "tertiary",
|
|
438
|
+
onClick: m[2] || (m[2] = (o) => c.value = !1)
|
|
439
|
+
}, null, 8, ["disabled", "label"])
|
|
440
|
+
])
|
|
441
|
+
]),
|
|
442
|
+
default: P(() => [
|
|
443
|
+
g(Ke, {
|
|
444
|
+
class: "w-full",
|
|
445
|
+
ref_key: "hasValidationExpose",
|
|
446
|
+
ref: u,
|
|
447
|
+
modelValue: y(r),
|
|
448
|
+
"onUpdate:modelValue": m[0] || (m[0] = (o) => Z(r) ? r.value = o : null),
|
|
449
|
+
mode: s.mode,
|
|
450
|
+
disabled: t.value,
|
|
451
|
+
"onClick:submit": m[1] || (m[1] = (o) => _())
|
|
452
|
+
}, null, 8, ["modelValue", "mode", "disabled"])
|
|
453
|
+
]),
|
|
454
|
+
_: 1
|
|
455
|
+
}, 8, ["model-value", "header"]);
|
|
456
|
+
};
|
|
457
|
+
}
|
|
458
|
+
});
|
|
459
|
+
function Oe() {
|
|
460
|
+
const R = I(), p = R.recipes, v = R.recipeById, i = R.skuById, l = p.flatMap((f, d) => {
|
|
461
|
+
var u;
|
|
462
|
+
if ((u = f.contains) != null && u.length) {
|
|
463
|
+
const t = f.contains.filter((e) => e.type === "RECIPE"), a = f.contains.filter((e) => e.type === "SKU");
|
|
464
|
+
return [
|
|
465
|
+
...d === 0 ? [] : [["", "", "", "", "", ""]],
|
|
466
|
+
...t.map(
|
|
467
|
+
(e, b) => {
|
|
468
|
+
var _;
|
|
469
|
+
return [
|
|
470
|
+
b === 0 ? f.name : "",
|
|
471
|
+
"RECIPE",
|
|
472
|
+
"",
|
|
473
|
+
(_ = v[e.id]) == null ? void 0 : _.name,
|
|
474
|
+
z(e.amount),
|
|
475
|
+
"UNIT"
|
|
476
|
+
];
|
|
477
|
+
}
|
|
478
|
+
),
|
|
479
|
+
...a.map(
|
|
480
|
+
(e, b) => {
|
|
481
|
+
var _, s, m, h;
|
|
482
|
+
return [
|
|
483
|
+
!t.length && b === 0 ? f.name : "",
|
|
484
|
+
"INGREDIENT",
|
|
485
|
+
(_ = i[e.id]) == null ? void 0 : _.code,
|
|
486
|
+
(s = i[e.id]) == null ? void 0 : s.name,
|
|
487
|
+
z(e.amount),
|
|
488
|
+
e.measurement ? e.measurement.abbrev : (h = (m = i[e.id]) == null ? void 0 : m.unit) == null ? void 0 : h.abbrev
|
|
489
|
+
];
|
|
490
|
+
}
|
|
491
|
+
)
|
|
492
|
+
];
|
|
493
|
+
}
|
|
494
|
+
return [
|
|
495
|
+
...d === 0 ? [] : [["", "", "", "", "", ""]],
|
|
496
|
+
[f.name, "No bindings", "", "", "", ""]
|
|
497
|
+
];
|
|
498
|
+
}), r = Fe(l, ["Name", "Type", "Code", "Item", "Amount", "Unit"]);
|
|
499
|
+
ke(r, `RECIPE_${Re(/* @__PURE__ */ new Date(), "-", "-")}.xlsx`);
|
|
500
|
+
}
|
|
501
|
+
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" }, rt = /* @__PURE__ */ Y({
|
|
502
|
+
__name: "RecipeView",
|
|
503
|
+
setup(R) {
|
|
504
|
+
const p = I(), v = k(() => p.recipes), i = he(), { createRecipe: l, updateRecipe: c } = q(), { recipeDialogProps: r, recipeViewLoading: f } = De(q()), { columnDefs: d, formatRowData: u } = Le(), t = k(() => u(v.value));
|
|
505
|
+
function a(o) {
|
|
506
|
+
o === "add" && l();
|
|
507
|
+
}
|
|
508
|
+
const e = x(""), b = k(() => f.value), { breakpoints: _ } = Ee(), s = k(() => _.value.xs || _.value.sm), m = k(() => s.value ? 10 : 20), h = Ae(), { t: n } = j();
|
|
509
|
+
return (o, V) => {
|
|
510
|
+
const H = F("FmTable");
|
|
511
|
+
return E(), T(Pe, {
|
|
512
|
+
title: y(n)("inventory.recipe.title"),
|
|
513
|
+
actions: [
|
|
514
|
+
{
|
|
515
|
+
label: y(n)("inventory.recipe.create.title"),
|
|
516
|
+
value: "add",
|
|
517
|
+
isPrimary: !0,
|
|
518
|
+
prependIcon: "add"
|
|
519
|
+
}
|
|
520
|
+
],
|
|
521
|
+
"onClick:action": a
|
|
522
|
+
}, {
|
|
523
|
+
default: P(() => [
|
|
524
|
+
w("div", {
|
|
525
|
+
class: de([
|
|
526
|
+
"flex flex-col gap-8 max-h-full",
|
|
527
|
+
{
|
|
528
|
+
"p-0": s.value,
|
|
529
|
+
"px-24 ": !s.value
|
|
530
|
+
}
|
|
531
|
+
])
|
|
532
|
+
}, [
|
|
533
|
+
g(Be, {
|
|
534
|
+
searchable: "",
|
|
535
|
+
search: e.value,
|
|
536
|
+
"onUpdate:search": V[0] || (V[0] = ($) => e.value = $),
|
|
537
|
+
actions: [{ icon: "ios_share", onClick: y(Oe) }]
|
|
538
|
+
}, null, 8, ["search", "actions"]),
|
|
539
|
+
(E(), T(H, {
|
|
540
|
+
style: me(y(h).tableHeight),
|
|
541
|
+
"column-defs": y(d),
|
|
542
|
+
"row-data": t.value,
|
|
543
|
+
"search-value": e.value,
|
|
544
|
+
loading: !y(i)._currentLocation || b.value,
|
|
545
|
+
onRowClick: V[1] || (V[1] = ($) => y(c)($.original.original)),
|
|
546
|
+
key: v.value.length,
|
|
547
|
+
"page-size": m.value
|
|
548
|
+
}, {
|
|
549
|
+
"list-row": P(($) => [
|
|
550
|
+
g($e, {
|
|
551
|
+
row: $,
|
|
552
|
+
onRowClick: (D) => y(c)(D.original)
|
|
553
|
+
}, {
|
|
554
|
+
default: P((D) => {
|
|
555
|
+
var M, U, S, B, O, J, Q, W, N, X;
|
|
556
|
+
return [
|
|
557
|
+
w("div", Je, [
|
|
558
|
+
w("div", Qe, [
|
|
559
|
+
g(y(ae), {
|
|
560
|
+
render: (S = (U = (M = D.recipe) == null ? void 0 : M.column) == null ? void 0 : U.columnDef) == null ? void 0 : S.cell,
|
|
561
|
+
props: (O = (B = D.recipe) == null ? void 0 : B.getContext) == null ? void 0 : O.call(B)
|
|
562
|
+
}, null, 8, ["render", "props"])
|
|
563
|
+
]),
|
|
564
|
+
w("div", We, [
|
|
565
|
+
g(y(ae), {
|
|
566
|
+
render: (W = (Q = (J = D.ingredients) == null ? void 0 : J.column) == null ? void 0 : Q.columnDef) == null ? void 0 : W.cell,
|
|
567
|
+
props: (X = (N = D.ingredients) == null ? void 0 : N.getContext) == null ? void 0 : X.call(N)
|
|
568
|
+
}, null, 8, ["render", "props"])
|
|
569
|
+
])
|
|
570
|
+
])
|
|
571
|
+
];
|
|
572
|
+
}),
|
|
573
|
+
_: 2
|
|
574
|
+
}, 1032, ["row", "onRowClick"])
|
|
575
|
+
]),
|
|
576
|
+
_: 1
|
|
577
|
+
}, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]))
|
|
578
|
+
], 2),
|
|
579
|
+
(E(), T(pe, { to: "body" }, [
|
|
580
|
+
g(Ge, fe(ve(y(r))), null, 16)
|
|
581
|
+
]))
|
|
582
|
+
]),
|
|
583
|
+
_: 1
|
|
584
|
+
}, 8, ["title", "actions"]);
|
|
585
|
+
};
|
|
586
|
+
}
|
|
587
|
+
});
|
|
588
|
+
export {
|
|
589
|
+
rt as default
|
|
590
|
+
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { ref as H, defineComponent as re, computed as U, resolveComponent as M, openBlock as B, createBlock as O, withCtx as D, createElementVNode as n, normalizeClass as he, toDisplayString as x, createVNode as S, createElementBlock as L, Fragment as ne, renderList as ae, unref as v, h as ye, watch as ge, isRef as Pe, createCommentVNode as te, reactive as it, onMounted as Je, normalizeStyle as Qe, createTextVNode as ve, Teleport as ut, normalizeProps as Be, mergeProps as Fe } from "vue";
|
|
2
|
-
import { i as ct, u as dt, _ as mt, a as pt } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-
|
|
3
|
-
import {
|
|
2
|
+
import { i as ct, u as dt, _ as mt, a as pt } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-C-ixTs_z.js";
|
|
3
|
+
import { o as Xe, j as ue, u as $e, p as vt, q as ft, c as Te, r as yt, k as Oe, s as Me, a as ie, l as _t, t as be, n as je, A as kt, M as ht, m as fe, v as gt, w as ee, x as bt, y as ze, R as xt, z as St, B as $t, D as Ze, E as W, G as wt, f as et, H as Ie, J as Bt, d as Ye, b as Ft, K as At, L as Vt, C as Ae, N as Ct, O as Dt, P as Mt, Q as jt } from "./app-BdUHoQTw.js";
|
|
4
4
|
import { useCoreStore as tt, useI18n as le } from "@feedmepos/mf-common";
|
|
5
5
|
import { useSnackbar as de, useDialog as nt, useProxiedModel as Re, useBreakpoints as It } from "@feedmepos/ui-library";
|
|
6
6
|
import { c as Ut, _ as Pt, F as Ke } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
|
|
7
|
-
import { g as xe } from "./decimal-
|
|
8
|
-
import { e as Tt, i as ot } from "./id-to-date-
|
|
7
|
+
import { g as xe } from "./decimal-DEVEov-F.js";
|
|
8
|
+
import { e as Tt, i as ot } from "./id-to-date-CN0cWcz6.js";
|
|
9
9
|
import { _ as Ue, S as Ve, g as st } from "./StockForecast.vue_vue_type_style_index_0_lang-KLXSWvo5.js";
|
|
10
10
|
import { _ as Rt } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
|
|
11
|
-
import { u as at, _ as Ge } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-
|
|
11
|
+
import { u as at, _ as Ge } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-DbP09mHM.js";
|
|
12
12
|
import { defineStore as Ht } from "pinia";
|
|
13
|
-
import { _ as Et } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-
|
|
13
|
+
import { _ as Et } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CkIFefTS.js";
|
|
14
14
|
import { E as Lt } from "./empty-placeholder-wf6-BWE8.js";
|
|
15
15
|
const we = Xe((d, u) => {
|
|
16
16
|
const r = ue(), s = tt(), k = de();
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { defineComponent as W, mergeModels as xe, computed as b, useModel as ke, resolveComponent as P, openBlock as D, createElementBlock as B, createElementVNode as r, createVNode as m, withCtx as N, toDisplayString as T, unref as l, Fragment as Ce, renderList as Ie, ref as L, createBlock as z, createCommentVNode as Z, isRef as ve, watch as Me, onMounted as $e, normalizeClass as Ae, normalizeStyle as De, Teleport as Fe } from "vue";
|
|
2
|
-
import { u as ge } from "./supplier-
|
|
2
|
+
import { u as ge } from "./supplier-BKYn47F9.js";
|
|
3
3
|
import { D as fe, R as J, F as A } from "./row-action.enum-PMKMRrZR.js";
|
|
4
4
|
import { c as Ue, _ as Re, F as Q } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
|
|
5
|
-
import { c as ee, u as Ve, a5 as Pe, d as ye, g as Ne, z as Ee, C as X, h as Te, R as U, b as _e, j as he } from "./app-
|
|
5
|
+
import { c as ee, u as Ve, a5 as Pe, d as ye, g as Ne, z as Ee, C as X, h as Te, R as U, b as _e, j as he } from "./app-BdUHoQTw.js";
|
|
6
6
|
import { useI18n as q, useCoreStore as Be } from "@feedmepos/mf-common";
|
|
7
7
|
import { useDialog as Se, useSnackbar as we, useProxiedModel as be, useBreakpoints as Le } from "@feedmepos/ui-library";
|
|
8
|
-
import { u as ze, _ as qe, a as Ye } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-
|
|
8
|
+
import { u as ze, _ as qe, a as Ye } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-C-ixTs_z.js";
|
|
9
9
|
import { _ as He } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
|
|
10
10
|
function Ke(R, C) {
|
|
11
11
|
const { t: h } = q();
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { f as ae } from "./format-time-from-id-
|
|
1
|
+
import { f as ae } from "./format-time-from-id-DkDDZc4Y.js";
|
|
2
2
|
import { computed as re, h as le, defineComponent as Te, ref as Z, resolveComponent as L, openBlock as d, createBlock as N, unref as s, isRef as Fe, withCtx as ee, createElementVNode as e, createVNode as U, createElementBlock as y, Fragment as W, toDisplayString as n, normalizeClass as te, createCommentVNode as p, renderList as ie } from "vue";
|
|
3
3
|
import { c as De } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
|
|
4
4
|
import { D as h, R as v } from "./row-action.enum-PMKMRrZR.js";
|
|
5
|
-
import { D as Ae,
|
|
6
|
-
import { F as Be } from "./decimal-
|
|
7
|
-
import { f as me, P as se, d as Ge, e as He } from "./purchase-order-transaction-type-
|
|
5
|
+
import { D as Ae, m as ce, a as ue, al as de, am as g, c as je, j as Ie, ag as q, J as Ue, H as Me, G as $e, aj as Ke, b as Le, x as Ve } from "./app-BdUHoQTw.js";
|
|
6
|
+
import { F as Be } from "./decimal-DEVEov-F.js";
|
|
7
|
+
import { f as me, P as se, d as Ge, e as He } from "./purchase-order-transaction-type-B80tMuy6.js";
|
|
8
8
|
import { components as ze, useDialog as Qe, useSnackbar as Ye, useProxiedModel as Je } from "@feedmepos/ui-library";
|
|
9
9
|
import { useI18n as Ce } from "@feedmepos/mf-common";
|
|
10
10
|
import { E as We } from "./empty-placeholder-wf6-BWE8.js";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { reactive as Ge, onMounted as Ee, computed as P, h as M, defineComponent as re, openBlock as F, createElementBlock as I, Fragment as ae, renderList as Pe, createElementVNode as r, toDisplayString as V, unref as e, resolveComponent as T, createVNode as k, withCtx as O, createCommentVNode as H, ref as N, createBlock as z, watch as Le, normalizeClass as Y, normalizeStyle as et, isRef as ce } from "vue";
|
|
2
2
|
import { useBreakpoints as qe, components as de, FmButtonVariant as tt, useSnackbar as $e, useDialog as st, useProxiedModel as ot } from "@feedmepos/ui-library";
|
|
3
3
|
import { F as be } from "./row-action.enum-PMKMRrZR.js";
|
|
4
|
-
import { P as A, d as Ne, c as nt } from "./purchase-order-transaction-type-
|
|
5
|
-
import { a as Z, t as lt, ab as Te, E as at, b as He, R as Ie, a5 as rt, a7 as it, s as ut, a8 as Be, a6 as dt, H as ze,
|
|
6
|
-
import { _ as We, u as ht } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-
|
|
4
|
+
import { P as A, d as Ne, c as nt } from "./purchase-order-transaction-type-B80tMuy6.js";
|
|
5
|
+
import { a as Z, t as lt, ab as Te, E as at, b as He, R as Ie, a5 as rt, a7 as it, s as ut, a8 as Be, a6 as dt, H as ze, m as ct, A as Se, M as pt, ac as je, P as Ae, Q as Qe, ad as mt, j as Ve, ae as ft, u as De, af as yt, ag as vt, ah as bt, G as _t, ai as gt, aj as kt, z as Ct } from "./app-BdUHoQTw.js";
|
|
6
|
+
import { _ as We, u as ht } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-DbP09mHM.js";
|
|
7
7
|
import { useI18n as me } from "@feedmepos/mf-common";
|
|
8
8
|
import "vue-router";
|
|
9
|
-
import { u as xe } from "./supplier-
|
|
10
|
-
import { d as wt } from "./defineDeepModel-
|
|
9
|
+
import { u as xe } from "./supplier-BKYn47F9.js";
|
|
10
|
+
import { d as wt } from "./defineDeepModel-BZrIgGc7.js";
|
|
11
11
|
import { F as pe, _ as St } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
|
|
12
12
|
import { _ as xt } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
|
|
13
13
|
function le(o, v, u, i) {
|