@feedmepos/mf-inventory-portal 1.2.17-dev.1 → 1.2.18
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-CvQI16_m.js → App-C7bnTGbg.js} +1 -1
- package/dist/{ApprovalView-Bpmp0EiN.js → ApprovalView-WhdGpygb.js} +2 -2
- package/dist/{BindingsDialog-Dj3Ul3Hv.js → BindingsDialog-CHKnpitE.js} +2 -2
- package/dist/{BindingsPicker-DFaOJ9Mr.js → BindingsPicker-BXUv8H0c.js} +1 -1
- package/dist/{BindingsTable-D_gYSqc3.js → BindingsTable-4Ndm5r7H.js} +1 -1
- package/dist/{ClosingDraftView-Ds7yRxye.js → ClosingDraftView-C0XTMbHo.js} +2 -2
- package/dist/{ClosingTemplateView-BEknM3gR.js → ClosingTemplateView-C17StrHT.js} +296 -296
- package/dist/{DeliveryOrderPrintPreview-pKBREKAn.js → DeliveryOrderPrintPreview-C7t3WZV1.js} +1 -1
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-D4Fy0CRH.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DRSUXz--.js} +3 -3
- package/dist/{FmMultiselectDialog-KFA3Oe14.js → FmMultiselectDialog-BnAHRAAM.js} +1 -1
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-CHViCIO9.js → FmUnitInput.vue_vue_type_script_setup_true_lang-DbaD9qUk.js} +1 -1
- package/dist/{ImportView-BMIp5iNg.js → ImportView-BJyqR26k.js} +275 -279
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-BbR7BY5t.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-DYskeNa8.js} +1 -1
- package/dist/{IngredientGroupView-DyPWmsHp.js → IngredientGroupView-CmTrE28Q.js} +2 -2
- package/dist/{IngredientsView-BBrYRXgE.js → IngredientsView-CZSd4iI2.js} +8 -8
- package/dist/{IntegrationView-ClHFof33.js → IntegrationView-BcdRocma.js} +3 -3
- package/dist/{InventoryBindingForm-BBA5xLdJ.js → InventoryBindingForm-hsjpKGlq.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-CmPAkzJn.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-5yGfFt02.js} +3 -3
- package/dist/{InventoryBindingSummary-BjXlLwGS.js → InventoryBindingSummary-AE1tIBZX.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-mFE4CC3D.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-qhWKUytO.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-AWY6QeLj.js → PremiumBadge.vue_vue_type_script_setup_true_lang-BN07OE3j.js} +1 -1
- package/dist/{PublishView-D3xxqwhK.js → PublishView-CPWKoKv4.js} +1 -1
- package/dist/{PurchaseOrderPrintPreview-mwyZgu5h.js → PurchaseOrderPrintPreview-CkiHTmgC.js} +1 -1
- package/dist/{ReceiveRequestView-NyKfbtAl.js → ReceiveRequestView-B-Q5LDit.js} +185 -193
- package/dist/{RecipeView-Cg7_T6-B.js → RecipeView-DEd2uP8R.js} +3 -3
- package/dist/{StockView-C9K7xKpF.js → StockView-DGL_EghN.js} +7 -7
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DZhRVJwr.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-D6-lImIW.js} +1 -1
- package/dist/{SupplierView-CaEzwVVw.js → SupplierView-uY0HvMr-.js} +4 -4
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-BVSyv6NL.js → TransferDetails.vue_vue_type_script_setup_true_lang-C0LNY9CK.js} +5 -5
- package/dist/{TransferTemplateView-B4_J_O_U.js → TransferTemplateView-DjI7px12.js} +7 -7
- package/dist/{UnitView-DuiQRfl9.js → UnitView-CANjtjhH.js} +3 -3
- package/dist/{WarehouseView-Bb2VB3uH.js → WarehouseView-BzGxfJI-.js} +1 -1
- package/dist/{app-C_ybIeQL.js → app-ZxL49u29.js} +2468 -2480
- package/dist/app.js +1 -1
- package/dist/{closing-template-BjPPidb4.js → closing-template-BA7jw5Ib.js} +1 -1
- package/dist/{decimal-DIKbgzfe.js → decimal-YUVJ1ppE.js} +1 -1
- package/dist/{format-unit-display-SiJQnJk-.js → format-unit-display-B8-ONx5f.js} +3 -3
- package/dist/{import-export.helper-DdPmfMT_.js → import-export.helper-B0RkcNAy.js} +62 -67
- package/dist/{index-CowO4VHt.js → index-BOLpjtRD.js} +1 -1
- package/dist/{index-bIhW74tJ.js → index-By0SWtFG.js} +1 -1
- package/dist/{purchase-order-template-C8y1AzcV.js → purchase-order-template-CppyMHCz.js} +1 -1
- package/dist/{stock-BQVrprBx.js → stock-8M_JUjPp.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{supplier-B6kYUhIp.js → supplier-BkEYL5KY.js} +1 -1
- package/dist/{use-ingredient-select-dialog-BA8NYDBZ.js → use-ingredient-select-dialog-BNr7wDV-.js} +1 -1
- package/dist/{use-inventory-binding-dialog-DM-6mqUf.js → use-inventory-binding-dialog-C3r06vdY.js} +1 -1
- package/package.json +3 -3
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { ref as P, h as R, defineComponent as H, resolveComponent as A, openBlock as $, createElementBlock as M, createElementVNode as h, normalizeClass as G, createTextVNode as Fe, toDisplayString as S, unref as
|
|
2
|
-
import { u as ce, am as Xe, D as ee, j as U, i as Qe, f as Ve, an as Ze, ao as ne, X as Ue, ap as me, W as ue, a as de, b as et, aq as tt, ar as Ne, B as nt, C as ot, as as st, e as z, K, P as lt, at, q as rt, J as Le, A as it, au as ct, a8 as ie, E as mt, G as ut, I as dt } from "./app-
|
|
1
|
+
import { ref as P, h as R, defineComponent as H, resolveComponent as A, openBlock as $, createElementBlock as M, createElementVNode as h, normalizeClass as G, createTextVNode as Fe, toDisplayString as S, unref as d, createCommentVNode as Y, createVNode as C, withCtx as E, Fragment as O, renderList as q, computed as V, watch as Ae, createSlots as Ee, createBlock as N, isRef as Ye, normalizeStyle as Ke, Teleport as Ge, normalizeProps as We, guardReactiveProps as qe, mergeProps as Je } from "vue";
|
|
2
|
+
import { u as ce, am as Xe, D as ee, j as U, i as Qe, f as Ve, an as Ze, ao as ne, X as Ue, ap as me, W as ue, a as de, b as et, aq as tt, ar as Ne, B as nt, C as ot, as as st, e as z, K, P as lt, at, q as rt, J as Le, A as it, au as ct, a8 as ie, E as mt, G as ut, I as dt } from "./app-ZxL49u29.js";
|
|
3
3
|
import { useI18n as j, useCoreStore as pe } from "@feedmepos/mf-common";
|
|
4
4
|
import { useDialog as se, useDialogChild as pt, useSnackbar as le, FmButtonVariant as te, components as B, useProxiedModel as ft, useBreakpoints as vt } from "@feedmepos/ui-library";
|
|
5
5
|
import { defineStore as Be, storeToRefs as ze } from "pinia";
|
|
6
|
-
import { u as ae } from "./closing-template-
|
|
7
|
-
import { u as gt } from "./use-ingredient-select-dialog-
|
|
6
|
+
import { u as ae } from "./closing-template-BA7jw5Ib.js";
|
|
7
|
+
import { u as gt } from "./use-ingredient-select-dialog-BNr7wDV-.js";
|
|
8
8
|
const re = Be(
|
|
9
9
|
"closingTemplateTable",
|
|
10
10
|
function() {
|
|
11
|
-
const { t: s } = j(), l = se(), i = P({}), n = oe(), t = P({}), y = P(new Array()),
|
|
12
|
-
function
|
|
11
|
+
const { t: s } = j(), l = se(), i = P({}), n = oe(), t = P({}), y = P(new Array()), p = P(!1), r = ce(), o = ae();
|
|
12
|
+
function f(m) {
|
|
13
13
|
const v = {
|
|
14
14
|
title: m.name,
|
|
15
15
|
doc: m,
|
|
16
16
|
controller: {
|
|
17
17
|
publishAll: async () => {
|
|
18
18
|
var e;
|
|
19
|
-
const
|
|
19
|
+
const u = await o.publishSingleDoc(
|
|
20
20
|
m._id,
|
|
21
21
|
(e = m.locations) == null ? void 0 : e.map((_) => _.dbName)
|
|
22
22
|
);
|
|
23
|
-
return i.value =
|
|
23
|
+
return i.value = u.publishedRevByLocation || {}, i.value;
|
|
24
24
|
},
|
|
25
|
-
publishAtLocation: async (
|
|
26
|
-
const e = await o.publishSingleDoc(m._id, [
|
|
25
|
+
publishAtLocation: async (u) => {
|
|
26
|
+
const e = await o.publishSingleDoc(m._id, [u.dbName]);
|
|
27
27
|
return i.value = e.publishedRevByLocation || {}, i.value;
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
30
|
initialPublishedRev: i.value,
|
|
31
|
-
locations:
|
|
31
|
+
locations: r.locations,
|
|
32
32
|
enabledLocations: m.locations
|
|
33
33
|
};
|
|
34
34
|
l.open({
|
|
@@ -43,36 +43,36 @@ const re = Be(
|
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
|
-
async function
|
|
47
|
-
if (y.value = [], !!
|
|
48
|
-
|
|
46
|
+
async function a() {
|
|
47
|
+
if (y.value = [], !!r._currentLocation) {
|
|
48
|
+
p.value = !0;
|
|
49
49
|
try {
|
|
50
|
-
const [m, v,
|
|
50
|
+
const [m, v, u] = await Promise.all([
|
|
51
51
|
o.readTemplates(),
|
|
52
52
|
o.getRecentPublishingJob(),
|
|
53
53
|
o.getRecentPublishInfo()
|
|
54
54
|
]).delayed(1e3);
|
|
55
|
-
y.value = m, t.value = v, i.value =
|
|
55
|
+
y.value = m, t.value = v, i.value = u.publishedRevByLocation || {};
|
|
56
56
|
} catch (m) {
|
|
57
57
|
console.log("Something went wrong when fetching templates:", m);
|
|
58
58
|
} finally {
|
|
59
|
-
|
|
59
|
+
p.value = !1;
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
async function w(m) {
|
|
64
|
-
if (!y.value.find((v) => v._id) &&
|
|
65
|
-
|
|
64
|
+
if (!y.value.find((v) => v._id) && r._currentLocation) {
|
|
65
|
+
p.value = !0;
|
|
66
66
|
try {
|
|
67
67
|
const [v] = await Promise.all([
|
|
68
68
|
o.getTemplate(m),
|
|
69
|
-
new Promise((
|
|
69
|
+
new Promise((u) => setTimeout(u, 1e3))
|
|
70
70
|
]);
|
|
71
71
|
y.value = [v];
|
|
72
72
|
} catch (v) {
|
|
73
73
|
console.log("Something went wrong when fetching templates:", v);
|
|
74
74
|
} finally {
|
|
75
|
-
|
|
75
|
+
p.value = !1;
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
}
|
|
@@ -83,11 +83,11 @@ const re = Be(
|
|
|
83
83
|
case U.Edit:
|
|
84
84
|
return n.updateTemplate(v);
|
|
85
85
|
case U.Delete:
|
|
86
|
-
return n.deleteTemplate(v,
|
|
86
|
+
return n.deleteTemplate(v, p, a);
|
|
87
87
|
case U.Publish:
|
|
88
|
-
return
|
|
88
|
+
return f(v);
|
|
89
89
|
case U.Duplicate:
|
|
90
|
-
return n.duplicateTemplate(v,
|
|
90
|
+
return n.duplicateTemplate(v, p, a);
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
return {
|
|
@@ -123,8 +123,8 @@ const re = Be(
|
|
|
123
123
|
accessorKey: "locations.length",
|
|
124
124
|
header: () => s("inventory.closing.table.enabledOutlets"),
|
|
125
125
|
cell(m) {
|
|
126
|
-
var
|
|
127
|
-
const v = (
|
|
126
|
+
var u;
|
|
127
|
+
const v = (u = m.row.original.locations) == null ? void 0 : u.length;
|
|
128
128
|
return v ? `${v}` : "All";
|
|
129
129
|
},
|
|
130
130
|
enableSorting: !1,
|
|
@@ -145,7 +145,7 @@ const re = Be(
|
|
|
145
145
|
header: () => s("inventory.adjustment.template.table.status"),
|
|
146
146
|
enableSorting: !1,
|
|
147
147
|
cell(m) {
|
|
148
|
-
const v = m.row.original,
|
|
148
|
+
const v = m.row.original, u = v._rev, e = m.row.original.locations || r.locations, I = e.filter((T) => !!(i.value[T.dbName] || []).find((x) => x._id === v._id && x._rev === u)).length === e.length;
|
|
149
149
|
return R(
|
|
150
150
|
"div",
|
|
151
151
|
{
|
|
@@ -167,13 +167,13 @@ const re = Be(
|
|
|
167
167
|
{
|
|
168
168
|
id: "action",
|
|
169
169
|
cell(m) {
|
|
170
|
-
const v = m.row.original,
|
|
170
|
+
const v = m.row.original, u = [
|
|
171
171
|
ee[U.Edit],
|
|
172
172
|
ee[U.Duplicate],
|
|
173
173
|
ee[U.Delete],
|
|
174
174
|
ee[U.Publish]
|
|
175
175
|
];
|
|
176
|
-
return Qe(
|
|
176
|
+
return Qe(u, (e) => k(e, v));
|
|
177
177
|
},
|
|
178
178
|
enableSorting: !1,
|
|
179
179
|
size: 40,
|
|
@@ -185,8 +185,8 @@ const re = Be(
|
|
|
185
185
|
],
|
|
186
186
|
recentPublish: t,
|
|
187
187
|
templates: y,
|
|
188
|
-
loading:
|
|
189
|
-
fetchTemplates:
|
|
188
|
+
loading: p,
|
|
189
|
+
fetchTemplates: a,
|
|
190
190
|
loadTemplate: w
|
|
191
191
|
};
|
|
192
192
|
}
|
|
@@ -228,36 +228,36 @@ function je() {
|
|
|
228
228
|
];
|
|
229
229
|
}
|
|
230
230
|
function yt(c) {
|
|
231
|
-
var
|
|
232
|
-
const l = pe().currentBusiness.value, n = (
|
|
231
|
+
var p;
|
|
232
|
+
const l = pe().currentBusiness.value, n = (p = c.map((r) => {
|
|
233
233
|
var b;
|
|
234
|
-
const o =
|
|
235
|
-
["Template ID",
|
|
236
|
-
["Template name",
|
|
234
|
+
const o = r.items.flatMap(He), f = je(), a = [
|
|
235
|
+
["Template ID", r._id],
|
|
236
|
+
["Template name", r.name],
|
|
237
237
|
["Business name", l == null ? void 0 : l.name],
|
|
238
238
|
["Business ID", l == null ? void 0 : l._id],
|
|
239
239
|
["Menu version", l == null ? void 0 : l.menuVersion],
|
|
240
240
|
[
|
|
241
241
|
"Locations",
|
|
242
|
-
...(b =
|
|
242
|
+
...(b = r.locations) != null && b.length ? r.locations.map((m) => `${m.name} (${m.dbName})`) : ["All"]
|
|
243
243
|
],
|
|
244
|
-
["Reference",
|
|
244
|
+
["Reference", r.ref ?? ""],
|
|
245
245
|
[],
|
|
246
|
-
|
|
247
|
-
...o.map((m) =>
|
|
248
|
-
], w =
|
|
249
|
-
return { name:
|
|
246
|
+
f.map((m) => m.name),
|
|
247
|
+
...o.map((m) => f.map((v) => m[v.id]))
|
|
248
|
+
], w = f.map((m) => `system:${m.id}`), k = ne(a, w);
|
|
249
|
+
return { name: r.name, sheet: k };
|
|
250
250
|
}).reduce(
|
|
251
|
-
(
|
|
252
|
-
var
|
|
253
|
-
const
|
|
254
|
-
return (
|
|
251
|
+
(r, o) => {
|
|
252
|
+
var a;
|
|
253
|
+
const f = o.name.slice(0, 12);
|
|
254
|
+
return (a = r.sheetOccurence)[f] ?? (a[f] = 0), r.sheetOccurence[f] += 1, r.sheets[`${f} (${r.sheetOccurence[f]})`] = o.sheet, r;
|
|
255
255
|
},
|
|
256
256
|
{
|
|
257
257
|
sheets: {},
|
|
258
258
|
sheetOccurence: {}
|
|
259
259
|
}
|
|
260
|
-
)) == null ? void 0 :
|
|
260
|
+
)) == null ? void 0 : p.sheets, t = `${l == null ? void 0 : l.name} closing templates (${Ue(/* @__PURE__ */ new Date())}).xlsx`, y = me(n);
|
|
261
261
|
return ue(y, t), t;
|
|
262
262
|
}
|
|
263
263
|
function ht(c) {
|
|
@@ -268,27 +268,27 @@ function ht(c) {
|
|
|
268
268
|
[],
|
|
269
269
|
["#", "Code", "Name", ""],
|
|
270
270
|
// Header row with blank column for notes
|
|
271
|
-
...c.items.map((
|
|
272
|
-
|
|
271
|
+
...c.items.map((r, o) => [
|
|
272
|
+
o + 1,
|
|
273
273
|
// Index starting from 1
|
|
274
|
-
|
|
275
|
-
|
|
274
|
+
r.sku.code,
|
|
275
|
+
r.sku.name,
|
|
276
276
|
""
|
|
277
277
|
// Blank column for manual entry
|
|
278
278
|
])
|
|
279
279
|
], i = ne(l, ["#", "Code", "Name", ""]);
|
|
280
280
|
if (i["!ref"]) {
|
|
281
|
-
const
|
|
281
|
+
const r = {
|
|
282
282
|
top: { style: "thin", color: { rgb: "000000" } },
|
|
283
283
|
bottom: { style: "thin", color: { rgb: "000000" } },
|
|
284
284
|
left: { style: "thin", color: { rgb: "000000" } },
|
|
285
285
|
right: { style: "thin", color: { rgb: "000000" } }
|
|
286
|
-
},
|
|
287
|
-
for (let
|
|
288
|
-
["A", "B", "C", "D"].forEach((
|
|
289
|
-
const
|
|
290
|
-
i[
|
|
291
|
-
border:
|
|
286
|
+
}, o = 4, f = o + c.items.length;
|
|
287
|
+
for (let a = o; a <= f; a++)
|
|
288
|
+
["A", "B", "C", "D"].forEach((w) => {
|
|
289
|
+
const k = `${w}${a}`;
|
|
290
|
+
i[k] || (i[k] = { t: "s", v: "" }), i[k].s = {
|
|
291
|
+
border: r
|
|
292
292
|
};
|
|
293
293
|
});
|
|
294
294
|
}
|
|
@@ -309,8 +309,8 @@ function ht(c) {
|
|
|
309
309
|
header: 0.3,
|
|
310
310
|
footer: 0.3
|
|
311
311
|
};
|
|
312
|
-
const t = me({ [
|
|
313
|
-
return ue(
|
|
312
|
+
const t = c.name.slice(0, 31), y = me({ [t]: i }), p = `${c.name} - Closing Template (${Ue(/* @__PURE__ */ new Date())}).xlsx`;
|
|
313
|
+
return ue(y, p), p;
|
|
314
314
|
}
|
|
315
315
|
function bt() {
|
|
316
316
|
const c = pe(), s = de(), l = et(), i = He({
|
|
@@ -341,17 +341,17 @@ function bt() {
|
|
|
341
341
|
[],
|
|
342
342
|
t.map((b) => b.name),
|
|
343
343
|
t.map((b) => i[b.id])
|
|
344
|
-
],
|
|
344
|
+
], p = t.map((b) => `system:${b.id}`), r = ne(y, p), o = l.isEnabled ? l.state.setting.childItems ?? [] : [], f = o.reduce(
|
|
345
345
|
(b, m) => {
|
|
346
346
|
var I, T;
|
|
347
|
-
const v = (I = l.netSuiteItemIdToSkuId.get(m.parentNetSuiteId)) == null ? void 0 : I[0],
|
|
347
|
+
const v = (I = l.netSuiteItemIdToSkuId.get(m.parentNetSuiteId)) == null ? void 0 : I[0], u = (T = l.netSuiteMeasurementIdToMeasurementId.get(
|
|
348
348
|
m.unitOfMeasureId
|
|
349
349
|
)) == null ? void 0 : T[0];
|
|
350
350
|
if (!m.externalId)
|
|
351
351
|
return b;
|
|
352
352
|
if (!v)
|
|
353
353
|
return console.error(`Item ${m.externalId} cannot be mapped to parent FdoInventorySku.`, m), b;
|
|
354
|
-
const e = s.skuById[v], _ = e.unit.measurements.find((g) => g.id ===
|
|
354
|
+
const e = s.skuById[v], _ = e.unit.measurements.find((g) => g.id === u);
|
|
355
355
|
return _ ? (b[m.externalId] = {
|
|
356
356
|
sku: e,
|
|
357
357
|
measurement: _
|
|
@@ -361,7 +361,7 @@ function bt() {
|
|
|
361
361
|
), b);
|
|
362
362
|
},
|
|
363
363
|
{}
|
|
364
|
-
),
|
|
364
|
+
), a = ne(
|
|
365
365
|
[
|
|
366
366
|
...s.skus.flatMap((b) => [
|
|
367
367
|
[b.code, b.name, b.unit.abbrev, !0],
|
|
@@ -372,7 +372,7 @@ function bt() {
|
|
|
372
372
|
!v.abbrev.toLocaleLowerCase("en-us").includes("inactive")
|
|
373
373
|
])
|
|
374
374
|
]),
|
|
375
|
-
...Object.entries(
|
|
375
|
+
...Object.entries(f).map(([b, { sku: m, measurement: v }]) => [
|
|
376
376
|
m.code,
|
|
377
377
|
m.name,
|
|
378
378
|
v.abbrev,
|
|
@@ -388,8 +388,8 @@ function bt() {
|
|
|
388
388
|
...o.length ? ["Netsuite Parent"] : []
|
|
389
389
|
]
|
|
390
390
|
), w = me({
|
|
391
|
-
Template:
|
|
392
|
-
Ingredients:
|
|
391
|
+
Template: r,
|
|
392
|
+
Ingredients: a
|
|
393
393
|
}), k = `${n == null ? void 0 : n.name} transfer templates import.xlsx`;
|
|
394
394
|
return ue(w, k), k;
|
|
395
395
|
}
|
|
@@ -398,18 +398,18 @@ function _t(c) {
|
|
|
398
398
|
return [];
|
|
399
399
|
const s = /(.*) \(((warehouse_|restaurant_).{24,})\)/, i = ce().locationByDbName;
|
|
400
400
|
return c.map((n) => {
|
|
401
|
-
const t = new Array(), y = n.trim(),
|
|
402
|
-
if (!
|
|
401
|
+
const t = new Array(), y = n.trim(), p = s.exec(y);
|
|
402
|
+
if (!p)
|
|
403
403
|
return t.push(`Enabled location value of ${y} cannot be read.`), {
|
|
404
404
|
errors: t
|
|
405
405
|
};
|
|
406
|
-
const
|
|
407
|
-
return
|
|
408
|
-
`Location id ${o} has non-matching name. Found ${
|
|
406
|
+
const r = p[1], o = p[2], f = i[o];
|
|
407
|
+
return f ? (r !== f.name && t.push(
|
|
408
|
+
`Location id ${o} has non-matching name. Found ${r} but expected ${f.name}`
|
|
409
409
|
), {
|
|
410
410
|
errors: t,
|
|
411
|
-
location:
|
|
412
|
-
}) : (t.push(`Location (${
|
|
411
|
+
location: f
|
|
412
|
+
}) : (t.push(`Location (${r}) of id ${o} is not found.`), {
|
|
413
413
|
errors: t
|
|
414
414
|
});
|
|
415
415
|
});
|
|
@@ -422,14 +422,14 @@ function xt(c) {
|
|
|
422
422
|
n,
|
|
423
423
|
t,
|
|
424
424
|
y,
|
|
425
|
-
|
|
426
|
-
|
|
425
|
+
p,
|
|
426
|
+
r
|
|
427
427
|
] = Ne(c);
|
|
428
428
|
return {
|
|
429
429
|
id: `${l[1] ?? ""}`.trim(),
|
|
430
430
|
name: `${i[1] ?? ""}`.trim(),
|
|
431
|
-
locations:
|
|
432
|
-
reference: `${
|
|
431
|
+
locations: p.slice(1).map((o) => `${o}`.trim()).filter((o) => o),
|
|
432
|
+
reference: `${r[1] ?? ""}`.trim()
|
|
433
433
|
};
|
|
434
434
|
}
|
|
435
435
|
function wt(c) {
|
|
@@ -440,11 +440,11 @@ function wt(c) {
|
|
|
440
440
|
n,
|
|
441
441
|
t,
|
|
442
442
|
y,
|
|
443
|
-
|
|
444
|
-
|
|
443
|
+
p,
|
|
444
|
+
r,
|
|
445
445
|
o,
|
|
446
|
-
|
|
447
|
-
...
|
|
446
|
+
f,
|
|
447
|
+
...a
|
|
448
448
|
] = Ne(c);
|
|
449
449
|
if (!s || !s.length || s.some((v) => v.length && !v.startsWith("system:")))
|
|
450
450
|
throw new Error("Missing meta header. Excel file does not come from the template.");
|
|
@@ -453,14 +453,14 @@ function wt(c) {
|
|
|
453
453
|
throw new Error(
|
|
454
454
|
`Missing meta headers (${b.join()}). Excel file does not come from the template.`
|
|
455
455
|
);
|
|
456
|
-
return
|
|
456
|
+
return a.map((v, u) => {
|
|
457
457
|
const e = {};
|
|
458
458
|
for (const _ in w) {
|
|
459
459
|
const I = w[_];
|
|
460
460
|
Object.assign(e, { [I]: v[_] });
|
|
461
461
|
}
|
|
462
462
|
return {
|
|
463
|
-
index:
|
|
463
|
+
index: u,
|
|
464
464
|
data: e
|
|
465
465
|
};
|
|
466
466
|
});
|
|
@@ -481,21 +481,21 @@ function Tt(c) {
|
|
|
481
481
|
return l.push(`Cannot find ingredient of code ${s.code} ${s.name}`), { errors: l };
|
|
482
482
|
const t = {
|
|
483
483
|
sku: n
|
|
484
|
-
}, y = /* @__PURE__ */ new Set([n.unit._id, ...n.unit.measurements.map((
|
|
485
|
-
s.unit !== n.unit.abbrev && !
|
|
484
|
+
}, y = /* @__PURE__ */ new Set([n.unit._id, ...n.unit.measurements.map((r) => r.id)]), p = n.unit.measurements.find((r) => r.abbrev === s.unit);
|
|
485
|
+
s.unit !== n.unit.abbrev && !p ? l.push(
|
|
486
486
|
`Cannot find measurement unit of ${s.unit} for (${s.code}) ${s.name}.`
|
|
487
487
|
) : (s.enabled === !0 || `${s.enabled}`.toLocaleLowerCase() === "true") && y.delete(n.unit._id);
|
|
488
|
-
for (const
|
|
489
|
-
const o =
|
|
490
|
-
if (!
|
|
488
|
+
for (const r of c.children) {
|
|
489
|
+
const o = r.data, f = o.unit === n.unit.abbrev ? n.unit : void 0, a = n.unit.measurements.find((w) => w.abbrev === o.unit);
|
|
490
|
+
if (!a && !f) {
|
|
491
491
|
l.push(
|
|
492
492
|
`Cannot find measurement unit of ${o.unit} for (${s.code}) ${s.name}.`
|
|
493
493
|
);
|
|
494
494
|
continue;
|
|
495
495
|
}
|
|
496
|
-
(o.enabled === !0 || `${o.enabled}`.toLocaleLowerCase() === "true") && y.delete((
|
|
496
|
+
(o.enabled === !0 || `${o.enabled}`.toLocaleLowerCase() === "true") && y.delete((a == null ? void 0 : a.id) ?? (f == null ? void 0 : f._id) ?? "");
|
|
497
497
|
}
|
|
498
|
-
return y.has(n.unit._id) && t.sku.unit.measurements.every((
|
|
498
|
+
return y.has(n.unit._id) && t.sku.unit.measurements.every((r) => y.has(r.id)) && l.push(`Ingredient ${n.code} - ${n.name} must have at least one unit enabled.`), t.disabledMeasurements = [...y], { errors: l, templateItem: t };
|
|
499
499
|
}
|
|
500
500
|
function $t(c) {
|
|
501
501
|
const s = c.SheetNames.filter(
|
|
@@ -504,16 +504,16 @@ function $t(c) {
|
|
|
504
504
|
try {
|
|
505
505
|
return s.reduce(
|
|
506
506
|
(t, y) => {
|
|
507
|
-
const
|
|
508
|
-
|
|
509
|
-
const w = wt(
|
|
507
|
+
const p = new Array(), r = c.Sheets[y], o = xt(r), f = _t(o.locations), a = f.filter((e) => e.location).map((e) => e.location);
|
|
508
|
+
p.push(...f.flatMap((e) => e.errors));
|
|
509
|
+
const w = wt(r).filter(
|
|
510
510
|
(e) => e.data.code || e.data.unit
|
|
511
511
|
), k = kt(w);
|
|
512
|
-
|
|
512
|
+
p.push(...k.errors);
|
|
513
513
|
const b = k.result.map(
|
|
514
514
|
(e) => Tt(e)
|
|
515
515
|
);
|
|
516
|
-
|
|
516
|
+
p.push(...b.flatMap((e) => e.errors));
|
|
517
517
|
const m = b.filter((e) => e.templateItem).map((e) => e.templateItem);
|
|
518
518
|
if (o.id) {
|
|
519
519
|
const e = n[o.id];
|
|
@@ -524,12 +524,12 @@ function $t(c) {
|
|
|
524
524
|
name: o.name || `(unnamed from sheet ${y || "<unnamed sheet>"})`,
|
|
525
525
|
items: []
|
|
526
526
|
};
|
|
527
|
-
return
|
|
527
|
+
return p.push(`Template ID ${o.id} is not found.`), t.importUpdateResult.push({
|
|
528
528
|
type: "update",
|
|
529
529
|
original: I,
|
|
530
530
|
template: I,
|
|
531
531
|
excelSheetName: y,
|
|
532
|
-
errors:
|
|
532
|
+
errors: p
|
|
533
533
|
}), t;
|
|
534
534
|
}
|
|
535
535
|
const _ = {
|
|
@@ -538,27 +538,27 @@ function $t(c) {
|
|
|
538
538
|
template: {
|
|
539
539
|
...e,
|
|
540
540
|
name: o.name,
|
|
541
|
-
locations:
|
|
541
|
+
locations: a.length ? a : null,
|
|
542
542
|
ref: o.reference,
|
|
543
543
|
items: m
|
|
544
544
|
},
|
|
545
545
|
excelSheetName: y,
|
|
546
|
-
errors:
|
|
546
|
+
errors: p
|
|
547
547
|
};
|
|
548
548
|
return t.importUpdateResult.push(_), t;
|
|
549
549
|
}
|
|
550
|
-
const
|
|
550
|
+
const u = {
|
|
551
551
|
type: "create",
|
|
552
552
|
template: {
|
|
553
553
|
name: o.name,
|
|
554
|
-
locations:
|
|
554
|
+
locations: a.length ? a : null,
|
|
555
555
|
ref: o.reference,
|
|
556
556
|
items: m
|
|
557
557
|
},
|
|
558
558
|
excelSheetName: y,
|
|
559
|
-
errors:
|
|
559
|
+
errors: p
|
|
560
560
|
};
|
|
561
|
-
return t.importCreateResult.push(
|
|
561
|
+
return t.importCreateResult.push(u), t;
|
|
562
562
|
},
|
|
563
563
|
{
|
|
564
564
|
invalidExcel: !1,
|
|
@@ -590,7 +590,7 @@ const Ct = { class: "flex items-center gap-12 pl-8" }, It = { class: "flex flex-
|
|
|
590
590
|
setup(c) {
|
|
591
591
|
const { t: s } = j();
|
|
592
592
|
return (l, i) => {
|
|
593
|
-
var y,
|
|
593
|
+
var y, p, r;
|
|
594
594
|
const n = A("FmIcon"), t = A("FmTooltip");
|
|
595
595
|
return $(), M("div", Ct, [
|
|
596
596
|
i[0] || (i[0] = h("div", null, "•", -1)),
|
|
@@ -602,13 +602,13 @@ const Ct = { class: "flex items-center gap-12 pl-8" }, It = { class: "flex flex-
|
|
|
602
602
|
})
|
|
603
603
|
}, [
|
|
604
604
|
Fe(S(l.name) + " ", 1),
|
|
605
|
-
l.type === "create" ? ($(), M("span", Dt, "(" + S(
|
|
605
|
+
l.type === "create" ? ($(), M("span", Dt, "(" + S(d(s)("inventory.closing.template.import.new")) + ")", 1)) : Y("", !0)
|
|
606
606
|
], 2),
|
|
607
607
|
l.errors.length ? ($(), M("div", Mt, [
|
|
608
608
|
C(t, { "z-index": 50 }, {
|
|
609
609
|
content: E(() => [
|
|
610
610
|
h("ol", null, [
|
|
611
|
-
($(!0), M(O, null, q(l.errors, (o,
|
|
611
|
+
($(!0), M(O, null, q(l.errors, (o, f) => ($(), M("li", { key: f }, S(o), 1))), 128))
|
|
612
612
|
])
|
|
613
613
|
]),
|
|
614
614
|
default: E(() => [
|
|
@@ -630,7 +630,7 @@ const Ct = { class: "flex items-center gap-12 pl-8" }, It = { class: "flex flex-
|
|
|
630
630
|
"text-fm-color-typo-secondary": !l.errors.length
|
|
631
631
|
}
|
|
632
632
|
])
|
|
633
|
-
}, S((y = l.locations) != null && y.length ?
|
|
633
|
+
}, S((y = l.locations) != null && y.length ? d(s)("inventory.closing.template.import.nLocations", { count: (p = l.locations) == null ? void 0 : p.length }) : d(s)("inventory.closing.template.import.allLocations")) + ", " + S(d(s)("inventory.closing.template.import.nItems", { count: (r = l.items) == null ? void 0 : r.length })), 3)
|
|
634
634
|
])
|
|
635
635
|
]);
|
|
636
636
|
};
|
|
@@ -650,13 +650,13 @@ const Ct = { class: "flex items-center gap-12 pl-8" }, It = { class: "flex flex-
|
|
|
650
650
|
}, zt = { class: "fm-typo-en-body-lg-600" }, Ht = /* @__PURE__ */ H({
|
|
651
651
|
__name: "ClosingTemplateImport",
|
|
652
652
|
setup(c) {
|
|
653
|
-
const s = P(null), l = pt(), i = le(), n = P(!1), t = P(!1), y = P(new Array()),
|
|
654
|
-
() => !!y.value.length ||
|
|
655
|
-
),
|
|
656
|
-
() => !!
|
|
657
|
-
), { t:
|
|
653
|
+
const s = P(null), l = pt(), i = le(), n = P(!1), t = P(!1), y = P(new Array()), p = P([]), r = P([]), o = V(
|
|
654
|
+
() => !!y.value.length || p.value.some((k) => k.errors.length) || r.value.some((k) => k.errors.length)
|
|
655
|
+
), f = V(
|
|
656
|
+
() => !!p.value.length || !!r.value.length
|
|
657
|
+
), { t: a } = j();
|
|
658
658
|
async function w(k) {
|
|
659
|
-
y.value = [],
|
|
659
|
+
y.value = [], p.value = [], r.value = [];
|
|
660
660
|
try {
|
|
661
661
|
n.value = !0;
|
|
662
662
|
const [b] = await Promise.all([
|
|
@@ -667,30 +667,30 @@ const Ct = { class: "flex items-center gap-12 pl-8" }, It = { class: "flex flex-
|
|
|
667
667
|
if (!b.SheetNames.filter(
|
|
668
668
|
(e) => !Object.values(fe).map(String).includes(e)
|
|
669
669
|
).find((e) => e)) {
|
|
670
|
-
y.value.push(
|
|
670
|
+
y.value.push(a("inventory.ingredient.import.fileError.noSheet"));
|
|
671
671
|
return;
|
|
672
672
|
}
|
|
673
|
-
const
|
|
674
|
-
if (
|
|
673
|
+
const u = $t(b);
|
|
674
|
+
if (u.invalidExcel) {
|
|
675
675
|
y.value.push(
|
|
676
|
-
|
|
676
|
+
u.invalidExcelMessage ?? a("inventory.ingredient.import.fileError.invalidExcel")
|
|
677
677
|
);
|
|
678
678
|
return;
|
|
679
679
|
}
|
|
680
|
-
if (
|
|
681
|
-
y.value.push(
|
|
680
|
+
if (p.value = u.importCreateResult, r.value = u.importUpdateResult, !p.value.length && !r.value.length) {
|
|
681
|
+
y.value.push(a("inventory.ingredient.import.fileError.noData"));
|
|
682
682
|
return;
|
|
683
683
|
}
|
|
684
|
-
l.emitData(
|
|
684
|
+
l.emitData(u);
|
|
685
685
|
} catch (b) {
|
|
686
686
|
i.open({
|
|
687
|
-
title:
|
|
687
|
+
title: a("inventory.ingredient.import.fileError.unableToRead"),
|
|
688
688
|
message: b == null ? void 0 : b.message,
|
|
689
689
|
type: "error"
|
|
690
690
|
}), console.error("Error in reading file", b);
|
|
691
691
|
} finally {
|
|
692
692
|
y.value.length && i.open({
|
|
693
|
-
title:
|
|
693
|
+
title: a("inventory.ingredient.import.fileError.invalidExcel"),
|
|
694
694
|
type: "error"
|
|
695
695
|
}), n.value = !1;
|
|
696
696
|
}
|
|
@@ -698,9 +698,9 @@ const Ct = { class: "flex items-center gap-12 pl-8" }, It = { class: "flex flex-
|
|
|
698
698
|
return Ae(s, (k) => {
|
|
699
699
|
k && w(k);
|
|
700
700
|
}), (k, b) => {
|
|
701
|
-
const m = A("FmCircularProgress"), v = A("FmIcon"),
|
|
701
|
+
const m = A("FmCircularProgress"), v = A("FmIcon"), u = A("FmButton");
|
|
702
702
|
return $(), M("div", Pt, [
|
|
703
|
-
h("div", Rt, S(
|
|
703
|
+
h("div", Rt, S(d(a)("inventory.closing.template.import.message")), 1),
|
|
704
704
|
t.value ? ($(), M("div", Ft, [
|
|
705
705
|
h("div", null, [
|
|
706
706
|
C(m, {
|
|
@@ -708,7 +708,7 @@ const Ct = { class: "flex items-center gap-12 pl-8" }, It = { class: "flex flex-
|
|
|
708
708
|
color: "neutral-gray-200"
|
|
709
709
|
})
|
|
710
710
|
]),
|
|
711
|
-
h("div", At, S(
|
|
711
|
+
h("div", At, S(d(a)("inventory.formField.loading")), 1)
|
|
712
712
|
])) : ($(), M(O, { key: 1 }, [
|
|
713
713
|
C(nt, {
|
|
714
714
|
class: G({
|
|
@@ -717,8 +717,8 @@ const Ct = { class: "flex items-center gap-12 pl-8" }, It = { class: "flex flex-
|
|
|
717
717
|
}),
|
|
718
718
|
accept: ".xlsx",
|
|
719
719
|
onFileUpload: b[0] || (b[0] = (e) => s.value = e),
|
|
720
|
-
label:
|
|
721
|
-
"button-label":
|
|
720
|
+
label: d(a)("inventory.ingredient.import.uploadTemplate"),
|
|
721
|
+
"button-label": d(a)("inventory.ingredient.import.selectFile")
|
|
722
722
|
}, Ee({ _: 2 }, [
|
|
723
723
|
s.value ? {
|
|
724
724
|
name: "default",
|
|
@@ -756,8 +756,8 @@ const Ct = { class: "flex items-center gap-12 pl-8" }, It = { class: "flex flex-
|
|
|
756
756
|
h("div", Vt, S(s.value.name), 1)
|
|
757
757
|
], 2),
|
|
758
758
|
n.value ? Y("", !0) : ($(), M("div", Ut, [
|
|
759
|
-
C(
|
|
760
|
-
label:
|
|
759
|
+
C(u, {
|
|
760
|
+
label: d(a)("inventory.ingredient.import.replaceFile"),
|
|
761
761
|
variant: o.value ? "destructive" : "secondary",
|
|
762
762
|
"prepend-icon": o.value ? void 0 : "autorenew",
|
|
763
763
|
onClick: e
|
|
@@ -782,9 +782,9 @@ const Ct = { class: "flex items-center gap-12 pl-8" }, It = { class: "flex flex-
|
|
|
782
782
|
key: "0"
|
|
783
783
|
} : void 0
|
|
784
784
|
]), 1032, ["class", "label", "button-label"]),
|
|
785
|
-
|
|
786
|
-
h("div", zt, S(
|
|
787
|
-
($(!0), M(O, null, q(
|
|
785
|
+
f.value ? ($(), M("div", Bt, [
|
|
786
|
+
h("div", zt, S(d(a)("inventory.ingredient.import.summary")), 1),
|
|
787
|
+
($(!0), M(O, null, q(p.value, (e, _) => ($(), N(Re, {
|
|
788
788
|
key: _,
|
|
789
789
|
name: e.template.name,
|
|
790
790
|
locations: e.template.locations,
|
|
@@ -792,7 +792,7 @@ const Ct = { class: "flex items-center gap-12 pl-8" }, It = { class: "flex flex-
|
|
|
792
792
|
errors: e.errors,
|
|
793
793
|
type: "create"
|
|
794
794
|
}, null, 8, ["name", "locations", "items", "errors"]))), 128)),
|
|
795
|
-
($(!0), M(O, null, q(
|
|
795
|
+
($(!0), M(O, null, q(r.value, (e) => ($(), N(Re, {
|
|
796
796
|
key: e.template._id,
|
|
797
797
|
name: e.template.name,
|
|
798
798
|
locations: e.template.locations,
|
|
@@ -806,27 +806,27 @@ const Ct = { class: "flex items-center gap-12 pl-8" }, It = { class: "flex flex-
|
|
|
806
806
|
};
|
|
807
807
|
}
|
|
808
808
|
}), oe = Be("closingTemplateActions", () => {
|
|
809
|
-
const { t: c } = j(), s = se(), l = le(), i = ae(), n = st(), t = re(), { loading: y } = ze(t),
|
|
810
|
-
function
|
|
811
|
-
|
|
809
|
+
const { t: c } = j(), s = se(), l = le(), i = ae(), n = st(), t = re(), { loading: y } = ze(t), p = P({});
|
|
810
|
+
function r() {
|
|
811
|
+
p.value = {
|
|
812
812
|
mode: z.CREATE,
|
|
813
813
|
show: !0,
|
|
814
814
|
"onUpdate:show"(e) {
|
|
815
|
-
|
|
815
|
+
p.value.show = e;
|
|
816
816
|
}
|
|
817
817
|
};
|
|
818
818
|
}
|
|
819
819
|
function o(e) {
|
|
820
|
-
|
|
820
|
+
p.value = {
|
|
821
821
|
mode: z.UPDATE,
|
|
822
822
|
modelValue: e,
|
|
823
823
|
show: !0,
|
|
824
824
|
"onUpdate:show"(_) {
|
|
825
|
-
|
|
825
|
+
p.value.show = _;
|
|
826
826
|
}
|
|
827
827
|
};
|
|
828
828
|
}
|
|
829
|
-
function
|
|
829
|
+
function f(e, _, I) {
|
|
830
830
|
s.open({
|
|
831
831
|
title: `Confirm deleting template ${e.name}?`,
|
|
832
832
|
message: "Deleted template can no longer be retrieved",
|
|
@@ -867,7 +867,7 @@ const Ct = { class: "flex items-center gap-12 pl-8" }, It = { class: "flex flex-
|
|
|
867
867
|
}
|
|
868
868
|
});
|
|
869
869
|
}
|
|
870
|
-
function
|
|
870
|
+
function a(e, _, I) {
|
|
871
871
|
let T;
|
|
872
872
|
s.open({
|
|
873
873
|
title: `Confirm duplicating template "${e.name}"?`,
|
|
@@ -1008,10 +1008,10 @@ const Ct = { class: "flex items-center gap-12 pl-8" }, It = { class: "flex flex-
|
|
|
1008
1008
|
});
|
|
1009
1009
|
return;
|
|
1010
1010
|
}
|
|
1011
|
-
s.close(),
|
|
1011
|
+
s.close(), u(e);
|
|
1012
1012
|
}).onTertiary(bt);
|
|
1013
1013
|
}
|
|
1014
|
-
async function
|
|
1014
|
+
async function u(e) {
|
|
1015
1015
|
y.value = !0;
|
|
1016
1016
|
try {
|
|
1017
1017
|
const _ = [
|
|
@@ -1048,15 +1048,15 @@ const Ct = { class: "flex items-center gap-12 pl-8" }, It = { class: "flex flex-
|
|
|
1048
1048
|
}
|
|
1049
1049
|
}
|
|
1050
1050
|
return {
|
|
1051
|
-
createTemplate:
|
|
1051
|
+
createTemplate: r,
|
|
1052
1052
|
viewTemplate: k,
|
|
1053
1053
|
updateTemplate: o,
|
|
1054
|
-
deleteTemplate:
|
|
1055
|
-
duplicateTemplate:
|
|
1054
|
+
deleteTemplate: f,
|
|
1055
|
+
duplicateTemplate: a,
|
|
1056
1056
|
exportTemplates: b,
|
|
1057
1057
|
exportSingleTemplate: m,
|
|
1058
1058
|
importTemplates: v,
|
|
1059
|
-
templateDialogProps:
|
|
1059
|
+
templateDialogProps: p,
|
|
1060
1060
|
templateDetailsProps: w
|
|
1061
1061
|
};
|
|
1062
1062
|
});
|
|
@@ -1103,7 +1103,7 @@ function jt(c) {
|
|
|
1103
1103
|
minSize: 200,
|
|
1104
1104
|
maxSize: 400,
|
|
1105
1105
|
cell(n) {
|
|
1106
|
-
var y,
|
|
1106
|
+
var y, p, r;
|
|
1107
1107
|
const t = n.row.original;
|
|
1108
1108
|
return R("div", { class: "flex items-center gap-32" }, [
|
|
1109
1109
|
R(
|
|
@@ -1121,27 +1121,27 @@ function jt(c) {
|
|
|
1121
1121
|
[
|
|
1122
1122
|
R(B.FmCheckbox, {
|
|
1123
1123
|
value: t.sku.unit._id,
|
|
1124
|
-
modelValue: !((
|
|
1125
|
-
disabled: c.disabled || !((
|
|
1124
|
+
modelValue: !((p = t.disabledMeasurements) != null && p.includes(t.sku.unit._id)),
|
|
1125
|
+
disabled: c.disabled || !((r = t.disabledMeasurements) != null && r.includes(t.sku.unit._id)) && t.sku.unit.measurements.every(
|
|
1126
1126
|
(o) => {
|
|
1127
|
-
var
|
|
1128
|
-
return (
|
|
1127
|
+
var f;
|
|
1128
|
+
return (f = t.disabledMeasurements) == null ? void 0 : f.includes(o.id);
|
|
1129
1129
|
}
|
|
1130
1130
|
),
|
|
1131
1131
|
"onUpdate:modelValue"(o) {
|
|
1132
|
-
var
|
|
1132
|
+
var f;
|
|
1133
1133
|
if (o)
|
|
1134
1134
|
c.updateItem({
|
|
1135
1135
|
...t,
|
|
1136
|
-
disabledMeasurements: (
|
|
1137
|
-
(
|
|
1136
|
+
disabledMeasurements: (f = t.disabledMeasurements) == null ? void 0 : f.filter(
|
|
1137
|
+
(a) => a !== t.sku.unit._id
|
|
1138
1138
|
)
|
|
1139
1139
|
});
|
|
1140
1140
|
else {
|
|
1141
|
-
const
|
|
1141
|
+
const a = t.disabledMeasurements ?? [];
|
|
1142
1142
|
c.updateItem({
|
|
1143
1143
|
...t,
|
|
1144
|
-
disabledMeasurements: [...
|
|
1144
|
+
disabledMeasurements: [...a, t.sku.unit._id]
|
|
1145
1145
|
});
|
|
1146
1146
|
}
|
|
1147
1147
|
}
|
|
@@ -1165,13 +1165,13 @@ function jt(c) {
|
|
|
1165
1165
|
]
|
|
1166
1166
|
)
|
|
1167
1167
|
),
|
|
1168
|
-
...Array.from({ length: Math.max(l, 0) }).map((o,
|
|
1168
|
+
...Array.from({ length: Math.max(l, 0) }).map((o, f) => {
|
|
1169
1169
|
var k, b, m, v;
|
|
1170
|
-
const
|
|
1170
|
+
const a = n.row.original, w = a.sku.unit.measurements[f];
|
|
1171
1171
|
return w ? R(
|
|
1172
1172
|
B.FmFormGroup,
|
|
1173
1173
|
{
|
|
1174
|
-
modelValue: !((k =
|
|
1174
|
+
modelValue: !((k = a.disabledMeasurements) != null && k.includes(w.id)),
|
|
1175
1175
|
value: w.id
|
|
1176
1176
|
},
|
|
1177
1177
|
R(
|
|
@@ -1183,24 +1183,24 @@ function jt(c) {
|
|
|
1183
1183
|
[
|
|
1184
1184
|
R(B.FmCheckbox, {
|
|
1185
1185
|
value: w.id,
|
|
1186
|
-
modelValue: !((b =
|
|
1187
|
-
disabled: c.disabled || !((m =
|
|
1186
|
+
modelValue: !((b = a.disabledMeasurements) != null && b.includes(w.id)),
|
|
1187
|
+
disabled: c.disabled || !((m = a.disabledMeasurements) != null && m.includes(w.id)) && ((v = a.disabledMeasurements) == null ? void 0 : v.includes(a.sku.unit._id)) && a.sku.unit.measurements.filter((u) => u.id != w.id).every((u) => {
|
|
1188
1188
|
var e;
|
|
1189
|
-
return (e =
|
|
1189
|
+
return (e = a.disabledMeasurements) == null ? void 0 : e.includes(u.id);
|
|
1190
1190
|
}),
|
|
1191
|
-
"onUpdate:modelValue"(
|
|
1191
|
+
"onUpdate:modelValue"(u) {
|
|
1192
1192
|
var e;
|
|
1193
|
-
if (
|
|
1193
|
+
if (u)
|
|
1194
1194
|
c.updateItem({
|
|
1195
|
-
...
|
|
1196
|
-
disabledMeasurements: (e =
|
|
1195
|
+
...a,
|
|
1196
|
+
disabledMeasurements: (e = a.disabledMeasurements) == null ? void 0 : e.filter(
|
|
1197
1197
|
(_) => _ !== w.id
|
|
1198
1198
|
)
|
|
1199
1199
|
});
|
|
1200
1200
|
else {
|
|
1201
|
-
const _ =
|
|
1201
|
+
const _ = a.disabledMeasurements ?? [];
|
|
1202
1202
|
c.updateItem({
|
|
1203
|
-
...
|
|
1203
|
+
...a,
|
|
1204
1204
|
disabledMeasurements: [..._, w.id]
|
|
1205
1205
|
});
|
|
1206
1206
|
}
|
|
@@ -1273,7 +1273,7 @@ const Ot = { class: "flex flex-col gap-16 py-12" }, Yt = { class: "flex" }, Kt =
|
|
|
1273
1273
|
() => l.value.getVisibleCells().filter((n) => n.column.id !== W.Name && n.column.id !== W.Delete)
|
|
1274
1274
|
);
|
|
1275
1275
|
return (n, t) => {
|
|
1276
|
-
var y,
|
|
1276
|
+
var y, p, r, o, f;
|
|
1277
1277
|
return $(), M("div", Ot, [
|
|
1278
1278
|
h("div", Yt, [
|
|
1279
1279
|
h("div", Kt, [
|
|
@@ -1281,22 +1281,22 @@ const Ot = { class: "flex flex-col gap-16 py-12" }, Yt = { class: "flex" }, Kt =
|
|
|
1281
1281
|
h("div", Wt, S(l.value.original.sku.code), 1)
|
|
1282
1282
|
]),
|
|
1283
1283
|
h("div", null, [
|
|
1284
|
-
C(
|
|
1285
|
-
render: (
|
|
1286
|
-
props: (
|
|
1284
|
+
C(d(K), {
|
|
1285
|
+
render: (r = (p = (y = n.cellByColId[d(W).Delete]) == null ? void 0 : y.column) == null ? void 0 : p.columnDef) == null ? void 0 : r.cell,
|
|
1286
|
+
props: (f = (o = n.cellByColId[d(W).Delete]) == null ? void 0 : o.getContext) == null ? void 0 : f.call(o)
|
|
1287
1287
|
}, null, 8, ["render", "props"])
|
|
1288
1288
|
])
|
|
1289
1289
|
]),
|
|
1290
1290
|
h("div", qt, [
|
|
1291
1291
|
t[0] || (t[0] = h("div", { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, null, -1)),
|
|
1292
|
-
($(!0), M(O, null, q(i.value, (
|
|
1292
|
+
($(!0), M(O, null, q(i.value, (a) => {
|
|
1293
1293
|
var w, k, b;
|
|
1294
1294
|
return $(), M("div", {
|
|
1295
|
-
key:
|
|
1295
|
+
key: a.id
|
|
1296
1296
|
}, [
|
|
1297
|
-
C(
|
|
1298
|
-
render: (k = (w =
|
|
1299
|
-
props: (b =
|
|
1297
|
+
C(d(K), {
|
|
1298
|
+
render: (k = (w = a.column) == null ? void 0 : w.columnDef) == null ? void 0 : k.cell,
|
|
1299
|
+
props: (b = a.getContext) == null ? void 0 : b.call(a)
|
|
1300
1300
|
}, null, 8, ["render", "props"])
|
|
1301
1301
|
]);
|
|
1302
1302
|
}), 128))
|
|
@@ -1315,36 +1315,36 @@ const Ot = { class: "flex flex-col gap-16 py-12" }, Yt = { class: "flex" }, Kt =
|
|
|
1315
1315
|
se();
|
|
1316
1316
|
const {
|
|
1317
1317
|
promptSelectLocations: y,
|
|
1318
|
-
columnDefs:
|
|
1319
|
-
rowData:
|
|
1318
|
+
columnDefs: p,
|
|
1319
|
+
rowData: r
|
|
1320
1320
|
} = at({
|
|
1321
1321
|
getLocations() {
|
|
1322
1322
|
return i.locations;
|
|
1323
1323
|
},
|
|
1324
|
-
setLocations(
|
|
1325
|
-
i.locations =
|
|
1324
|
+
setLocations(u) {
|
|
1325
|
+
i.locations = u;
|
|
1326
1326
|
}
|
|
1327
|
-
}), o = P(),
|
|
1327
|
+
}), o = P(), f = P(""), a = P(!1), w = P(null);
|
|
1328
1328
|
s({
|
|
1329
1329
|
validateInputs: () => {
|
|
1330
|
-
var
|
|
1331
|
-
(e = (
|
|
1330
|
+
var u, e;
|
|
1331
|
+
(e = (u = o.value) == null ? void 0 : u.validateInputs) == null || e.call(u);
|
|
1332
1332
|
},
|
|
1333
1333
|
resetInputsValidation: () => {
|
|
1334
|
-
var
|
|
1335
|
-
(e = (
|
|
1334
|
+
var u, e;
|
|
1335
|
+
(e = (u = o.value) == null ? void 0 : u.resetInputsValidation) == null || e.call(u);
|
|
1336
1336
|
},
|
|
1337
1337
|
resetInputs: () => {
|
|
1338
|
-
var
|
|
1339
|
-
(e = (
|
|
1338
|
+
var u, e;
|
|
1339
|
+
(e = (u = o.value) == null ? void 0 : u.resetInputs) == null || e.call(u);
|
|
1340
1340
|
}
|
|
1341
1341
|
});
|
|
1342
1342
|
const k = jt({
|
|
1343
|
-
updateItem: (
|
|
1344
|
-
i.items = i.items.map((e) => e.sku._id !==
|
|
1343
|
+
updateItem: (u) => {
|
|
1344
|
+
i.items = i.items.map((e) => e.sku._id !== u.sku._id ? e : u);
|
|
1345
1345
|
},
|
|
1346
|
-
deleteItem: (
|
|
1347
|
-
i.items = i.items.filter((e) => e.sku._id !==
|
|
1346
|
+
deleteItem: (u) => {
|
|
1347
|
+
i.items = i.items.filter((e) => e.sku._id !== u.sku._id);
|
|
1348
1348
|
},
|
|
1349
1349
|
get items() {
|
|
1350
1350
|
return i.items;
|
|
@@ -1372,59 +1372,59 @@ const Ot = { class: "flex flex-col gap-16 py-12" }, Yt = { class: "flex" }, Kt =
|
|
|
1372
1372
|
);
|
|
1373
1373
|
I && (I.sort((T, g) => T.sku.code.localeCompare(g.sku.code)), i.items = I);
|
|
1374
1374
|
}
|
|
1375
|
-
return (
|
|
1375
|
+
return (u, e) => {
|
|
1376
1376
|
const _ = A("FmTextField"), I = A("FmButton"), T = A("FmTable"), g = A("FmIcon"), x = A("FmFormGroup"), F = A("FmForm");
|
|
1377
1377
|
return $(), N(F, {
|
|
1378
1378
|
ref_key: "formRef",
|
|
1379
1379
|
ref: o,
|
|
1380
1380
|
class: "flex flex-col gap-32",
|
|
1381
|
-
disabled:
|
|
1381
|
+
disabled: u.disabled
|
|
1382
1382
|
}, {
|
|
1383
1383
|
default: E(() => [
|
|
1384
1384
|
h("div", Xt, [
|
|
1385
1385
|
h("div", Qt, [
|
|
1386
1386
|
C(_, {
|
|
1387
|
-
label:
|
|
1387
|
+
label: d(n)("inventory.closing.form.name"),
|
|
1388
1388
|
"label-mark": "required",
|
|
1389
|
-
modelValue:
|
|
1390
|
-
"onUpdate:modelValue": e[0] || (e[0] = (D) =>
|
|
1391
|
-
rules: [
|
|
1389
|
+
modelValue: d(i).name,
|
|
1390
|
+
"onUpdate:modelValue": e[0] || (e[0] = (D) => d(i).name = D),
|
|
1391
|
+
rules: [d(rt)()]
|
|
1392
1392
|
}, null, 8, ["label", "modelValue", "rules"]),
|
|
1393
1393
|
C(_, {
|
|
1394
|
-
label:
|
|
1394
|
+
label: d(n)("inventory.closing.form.reference"),
|
|
1395
1395
|
"label-mark": "optional",
|
|
1396
|
-
modelValue:
|
|
1397
|
-
"onUpdate:modelValue": e[1] || (e[1] = (D) =>
|
|
1396
|
+
modelValue: d(i).ref,
|
|
1397
|
+
"onUpdate:modelValue": e[1] || (e[1] = (D) => d(i).ref = D)
|
|
1398
1398
|
}, null, 8, ["label", "modelValue"])
|
|
1399
1399
|
])
|
|
1400
1400
|
]),
|
|
1401
1401
|
h("div", Zt, [
|
|
1402
1402
|
h("div", en, [
|
|
1403
|
-
h("div", tn, S(
|
|
1403
|
+
h("div", tn, S(d(n)("inventory.closing.form.locations")), 1),
|
|
1404
1404
|
C(I, {
|
|
1405
|
-
disabled:
|
|
1406
|
-
label:
|
|
1405
|
+
disabled: u.disabled,
|
|
1406
|
+
label: d(n)("inventory.closing.form.selectLocation"),
|
|
1407
1407
|
"prepend-icon": "add",
|
|
1408
1408
|
variant: "plain",
|
|
1409
1409
|
class: "border-2 rounded-lg border-fm-color-primary",
|
|
1410
|
-
onClick:
|
|
1410
|
+
onClick: d(y)
|
|
1411
1411
|
}, null, 8, ["disabled", "label", "onClick"])
|
|
1412
1412
|
]),
|
|
1413
1413
|
C(T, {
|
|
1414
|
-
"column-defs":
|
|
1415
|
-
"row-data":
|
|
1414
|
+
"column-defs": d(p),
|
|
1415
|
+
"row-data": d(r),
|
|
1416
1416
|
"shrink-at": 9999,
|
|
1417
|
-
onRowClick:
|
|
1417
|
+
onRowClick: d(y),
|
|
1418
1418
|
"hide-footer": ""
|
|
1419
1419
|
}, null, 8, ["column-defs", "row-data", "onRowClick"])
|
|
1420
1420
|
]),
|
|
1421
1421
|
h("div", nn, [
|
|
1422
1422
|
h("div", on, [
|
|
1423
|
-
h("div", sn, S(
|
|
1423
|
+
h("div", sn, S(d(n)("inventory.closing.form.items.title")), 1),
|
|
1424
1424
|
h("div", ln, [
|
|
1425
1425
|
C(I, {
|
|
1426
|
-
disabled:
|
|
1427
|
-
label:
|
|
1426
|
+
disabled: u.disabled || a.value,
|
|
1427
|
+
label: d(n)("inventory.closing.form.items.addItem"),
|
|
1428
1428
|
"prepend-icon": "add",
|
|
1429
1429
|
variant: "plain",
|
|
1430
1430
|
class: "border-2 rounded-lg border-fm-color-primary",
|
|
@@ -1435,16 +1435,16 @@ const Ot = { class: "flex flex-col gap-16 py-12" }, Yt = { class: "flex" }, Kt =
|
|
|
1435
1435
|
]),
|
|
1436
1436
|
C(_, {
|
|
1437
1437
|
placeholder: "Filter items",
|
|
1438
|
-
modelValue:
|
|
1439
|
-
"onUpdate:modelValue": e[4] || (e[4] = (D) =>
|
|
1440
|
-
disabled:
|
|
1438
|
+
modelValue: f.value,
|
|
1439
|
+
"onUpdate:modelValue": e[4] || (e[4] = (D) => f.value = D),
|
|
1440
|
+
disabled: a.value
|
|
1441
1441
|
}, Ee({ _: 2 }, [
|
|
1442
|
-
|
|
1442
|
+
f.value ? {
|
|
1443
1443
|
name: "append",
|
|
1444
1444
|
fn: E(() => [
|
|
1445
1445
|
C(g, {
|
|
1446
1446
|
name: "close",
|
|
1447
|
-
onClick: e[3] || (e[3] = (D) =>
|
|
1447
|
+
onClick: e[3] || (e[3] = (D) => f.value = ""),
|
|
1448
1448
|
class: "cursor-pointer"
|
|
1449
1449
|
})
|
|
1450
1450
|
]),
|
|
@@ -1456,21 +1456,21 @@ const Ot = { class: "flex flex-col gap-16 py-12" }, Yt = { class: "flex" }, Kt =
|
|
|
1456
1456
|
ref: w
|
|
1457
1457
|
}, [
|
|
1458
1458
|
($(), N(T, {
|
|
1459
|
-
"search-value":
|
|
1459
|
+
"search-value": a.value ? "" : f.value,
|
|
1460
1460
|
"column-defs": b.value,
|
|
1461
|
-
"row-data":
|
|
1462
|
-
key:
|
|
1463
|
-
"hide-footer":
|
|
1464
|
-
"page-size":
|
|
1461
|
+
"row-data": d(i).items,
|
|
1462
|
+
key: d(i).items.map((D) => D.sku._id).join("."),
|
|
1463
|
+
"hide-footer": d(i).items.length <= 10,
|
|
1464
|
+
"page-size": a.value ? d(i).items.length : Math.min(10, d(i).items.length)
|
|
1465
1465
|
}, {
|
|
1466
1466
|
"list-row": E((D) => [
|
|
1467
1467
|
($(), N(Le, {
|
|
1468
1468
|
row: D,
|
|
1469
|
-
key:
|
|
1469
|
+
key: d(i).items.map((L) => L.sku._id).join(".")
|
|
1470
1470
|
}, {
|
|
1471
1471
|
default: E((L) => [
|
|
1472
1472
|
h("div", an, [
|
|
1473
|
-
|
|
1473
|
+
a.value ? ($(), N(g, {
|
|
1474
1474
|
key: 0,
|
|
1475
1475
|
name: "drag_indicator",
|
|
1476
1476
|
class: "drag-handle cursor-move text-fm-color-typo-secondary"
|
|
@@ -1490,8 +1490,8 @@ const Ot = { class: "flex flex-col gap-16 py-12" }, Yt = { class: "flex" }, Kt =
|
|
|
1490
1490
|
}, 8, ["search-value", "column-defs", "row-data", "hide-footer", "page-size"]))
|
|
1491
1491
|
], 512),
|
|
1492
1492
|
C(x, {
|
|
1493
|
-
"model-value":
|
|
1494
|
-
rules: [
|
|
1493
|
+
"model-value": d(i).items.length,
|
|
1494
|
+
rules: [d(it)(1)]
|
|
1495
1495
|
}, null, 8, ["model-value", "rules"])
|
|
1496
1496
|
])
|
|
1497
1497
|
]),
|
|
@@ -1509,20 +1509,20 @@ const Ot = { class: "flex flex-col gap-16 py-12" }, Yt = { class: "flex" }, Kt =
|
|
|
1509
1509
|
emits: ["update:show", "submitted"],
|
|
1510
1510
|
setup(c, { expose: s, emit: l }) {
|
|
1511
1511
|
var T;
|
|
1512
|
-
const i = c, n = l, t = ae(), y = oe(),
|
|
1513
|
-
function
|
|
1512
|
+
const i = c, n = l, t = ae(), y = oe(), p = le(), { t: r } = j(), o = ft(i, "show");
|
|
1513
|
+
function f() {
|
|
1514
1514
|
return {
|
|
1515
1515
|
_id: "",
|
|
1516
1516
|
name: "",
|
|
1517
1517
|
items: []
|
|
1518
1518
|
};
|
|
1519
1519
|
}
|
|
1520
|
-
const
|
|
1520
|
+
const a = P(i.modelValue ?? f()), w = P(((T = i.modelValue) == null ? void 0 : T._id) ?? `${Math.random()}`);
|
|
1521
1521
|
Ae(
|
|
1522
1522
|
() => i.show,
|
|
1523
1523
|
(g) => {
|
|
1524
1524
|
var x;
|
|
1525
|
-
g && (
|
|
1525
|
+
g && (a.value = i.modelValue ?? f(), w.value = ((x = i.modelValue) == null ? void 0 : x._id) ?? `${Math.random()}`);
|
|
1526
1526
|
}
|
|
1527
1527
|
);
|
|
1528
1528
|
const k = P(!1), b = V(() => {
|
|
@@ -1530,9 +1530,9 @@ const Ot = { class: "flex flex-col gap-16 py-12" }, Yt = { class: "flex" }, Kt =
|
|
|
1530
1530
|
case z.READ:
|
|
1531
1531
|
return "";
|
|
1532
1532
|
case z.CREATE:
|
|
1533
|
-
return
|
|
1533
|
+
return r("inventory.closing.template.create.title");
|
|
1534
1534
|
case z.UPDATE:
|
|
1535
|
-
return
|
|
1535
|
+
return r("inventory.closing.template.update.title");
|
|
1536
1536
|
}
|
|
1537
1537
|
return "";
|
|
1538
1538
|
}), m = P();
|
|
@@ -1551,19 +1551,19 @@ const Ot = { class: "flex flex-col gap-16 py-12" }, Yt = { class: "flex" }, Kt =
|
|
|
1551
1551
|
}
|
|
1552
1552
|
});
|
|
1553
1553
|
async function v() {
|
|
1554
|
-
const g =
|
|
1554
|
+
const g = a.value;
|
|
1555
1555
|
if (g) {
|
|
1556
1556
|
k.value = !0;
|
|
1557
1557
|
try {
|
|
1558
|
-
await t.createTemplate(g), await new Promise((x) => setTimeout(x, 1e3)),
|
|
1559
|
-
title:
|
|
1560
|
-
message:
|
|
1558
|
+
await t.createTemplate(g), await new Promise((x) => setTimeout(x, 1e3)), p.open({
|
|
1559
|
+
title: r("inventory.closing.template.create.success"),
|
|
1560
|
+
message: r("inventory.closing.template.create.successMessage"),
|
|
1561
1561
|
type: "success"
|
|
1562
1562
|
}), n("update:show", !1), n("submitted");
|
|
1563
1563
|
} catch (x) {
|
|
1564
|
-
|
|
1565
|
-
title:
|
|
1566
|
-
message:
|
|
1564
|
+
p.open({
|
|
1565
|
+
title: r("inventory.closing.template.create.error"),
|
|
1566
|
+
message: r("inventory.closing.template.create.errorMessage"),
|
|
1567
1567
|
type: "error"
|
|
1568
1568
|
}), console.error("Error in creating closing template", x);
|
|
1569
1569
|
} finally {
|
|
@@ -1571,23 +1571,23 @@ const Ot = { class: "flex flex-col gap-16 py-12" }, Yt = { class: "flex" }, Kt =
|
|
|
1571
1571
|
}
|
|
1572
1572
|
}
|
|
1573
1573
|
}
|
|
1574
|
-
async function
|
|
1575
|
-
const g =
|
|
1574
|
+
async function u() {
|
|
1575
|
+
const g = a.value;
|
|
1576
1576
|
if (g) {
|
|
1577
1577
|
k.value = !0;
|
|
1578
1578
|
try {
|
|
1579
1579
|
await t.updateTemplate({
|
|
1580
1580
|
...g,
|
|
1581
1581
|
_rev: g._rev ?? ""
|
|
1582
|
-
}), await new Promise((x) => setTimeout(x, 1e3)),
|
|
1583
|
-
title:
|
|
1584
|
-
message:
|
|
1582
|
+
}), await new Promise((x) => setTimeout(x, 1e3)), p.open({
|
|
1583
|
+
title: r("inventory.closing.template.update.success"),
|
|
1584
|
+
message: r("inventory.closing.template.update.successMessage"),
|
|
1585
1585
|
type: "success"
|
|
1586
1586
|
}), n("update:show", !1), n("submitted");
|
|
1587
1587
|
} catch (x) {
|
|
1588
|
-
|
|
1589
|
-
title:
|
|
1590
|
-
message:
|
|
1588
|
+
p.open({
|
|
1589
|
+
title: r("inventory.closing.template.update.error"),
|
|
1590
|
+
message: r("inventory.closing.template.update.errorMessage"),
|
|
1591
1591
|
type: "error"
|
|
1592
1592
|
}), console.error("Error in updating closing template", x);
|
|
1593
1593
|
} finally {
|
|
@@ -1600,7 +1600,7 @@ const Ot = { class: "flex flex-col gap-16 py-12" }, Yt = { class: "flex" }, Kt =
|
|
|
1600
1600
|
case z.CREATE:
|
|
1601
1601
|
return v();
|
|
1602
1602
|
case z.UPDATE:
|
|
1603
|
-
return
|
|
1603
|
+
return u();
|
|
1604
1604
|
}
|
|
1605
1605
|
}
|
|
1606
1606
|
function _() {
|
|
@@ -1608,12 +1608,12 @@ const Ot = { class: "flex flex-col gap-16 py-12" }, Yt = { class: "flex" }, Kt =
|
|
|
1608
1608
|
(x = (g = m.value) == null ? void 0 : g.validateInputs) == null || x.call(g);
|
|
1609
1609
|
}
|
|
1610
1610
|
function I() {
|
|
1611
|
-
|
|
1611
|
+
a.value && y.exportSingleTemplate(a.value);
|
|
1612
1612
|
}
|
|
1613
1613
|
return (g, x) => {
|
|
1614
1614
|
const F = A("FmButton"), D = A("FmSideSheet");
|
|
1615
1615
|
return $(), N(D, {
|
|
1616
|
-
modelValue:
|
|
1616
|
+
modelValue: d(o),
|
|
1617
1617
|
"onUpdate:modelValue": x[2] || (x[2] = (L) => Ye(o) ? o.value = L : null),
|
|
1618
1618
|
"dismiss-away": "",
|
|
1619
1619
|
"close-button": "",
|
|
@@ -1630,8 +1630,8 @@ const Ot = { class: "flex flex-col gap-16 py-12" }, Yt = { class: "flex" }, Kt =
|
|
|
1630
1630
|
ref_key: "formRef",
|
|
1631
1631
|
ref: m,
|
|
1632
1632
|
onValidationSuccess: e,
|
|
1633
|
-
"model-value":
|
|
1634
|
-
"onUpdate:modelValue": x[0] || (x[0] = (L) =>
|
|
1633
|
+
"model-value": a.value,
|
|
1634
|
+
"onUpdate:modelValue": x[0] || (x[0] = (L) => a.value = L),
|
|
1635
1635
|
disabled: k.value,
|
|
1636
1636
|
key: w.value
|
|
1637
1637
|
}, null, 8, ["model-value", "disabled"]))
|
|
@@ -1640,21 +1640,21 @@ const Ot = { class: "flex flex-col gap-16 py-12" }, Yt = { class: "flex" }, Kt =
|
|
|
1640
1640
|
h("div", dn, [
|
|
1641
1641
|
C(F, {
|
|
1642
1642
|
loading: k.value,
|
|
1643
|
-
label:
|
|
1643
|
+
label: d(r)("common.save"),
|
|
1644
1644
|
onClick: _
|
|
1645
1645
|
}, null, 8, ["loading", "label"]),
|
|
1646
|
-
g.mode ===
|
|
1646
|
+
g.mode === d(z).UPDATE ? ($(), N(F, {
|
|
1647
1647
|
key: 0,
|
|
1648
1648
|
disabled: k.value,
|
|
1649
1649
|
variant: "secondary",
|
|
1650
|
-
label:
|
|
1650
|
+
label: d(r)("inventory.common.export"),
|
|
1651
1651
|
"prepend-icon": "download",
|
|
1652
1652
|
onClick: I
|
|
1653
1653
|
}, null, 8, ["disabled", "label"])) : Y("", !0),
|
|
1654
1654
|
C(F, {
|
|
1655
1655
|
disabled: k.value,
|
|
1656
1656
|
variant: "tertiary",
|
|
1657
|
-
label:
|
|
1657
|
+
label: d(r)("common.close"),
|
|
1658
1658
|
onClick: x[1] || (x[1] = (L) => n("update:show", !1))
|
|
1659
1659
|
}, null, 8, ["disabled", "label"])
|
|
1660
1660
|
])
|
|
@@ -1680,15 +1680,15 @@ const gn = /* @__PURE__ */ ct(fn, [["render", vn]]), yn = { class: "flex flex-co
|
|
|
1680
1680
|
__name: "ClosingTemplatePublish",
|
|
1681
1681
|
emits: ["close"],
|
|
1682
1682
|
setup(c, { emit: s }) {
|
|
1683
|
-
const l = P(!1), i = le(), n = ae(), t = re(), { t: y } = j(),
|
|
1684
|
-
async function
|
|
1683
|
+
const l = P(!1), i = le(), n = ae(), t = re(), { t: y } = j(), p = s;
|
|
1684
|
+
async function r() {
|
|
1685
1685
|
l.value = !0;
|
|
1686
1686
|
try {
|
|
1687
1687
|
await n.startNewPublish().delayed(1e3), i.open({
|
|
1688
1688
|
title: "Success",
|
|
1689
1689
|
message: "You may refresh after a while to review publish status",
|
|
1690
1690
|
type: "success"
|
|
1691
|
-
}),
|
|
1691
|
+
}), a();
|
|
1692
1692
|
} catch (w) {
|
|
1693
1693
|
i.open({
|
|
1694
1694
|
title: "Something went wrong",
|
|
@@ -1699,16 +1699,16 @@ const gn = /* @__PURE__ */ ct(fn, [["render", vn]]), yn = { class: "flex flex-co
|
|
|
1699
1699
|
l.value = !1;
|
|
1700
1700
|
}
|
|
1701
1701
|
}
|
|
1702
|
-
const o = V(() => t.recentPublish.recentJob),
|
|
1702
|
+
const o = V(() => t.recentPublish.recentJob), f = V(
|
|
1703
1703
|
() => t.templates.length && (!o.value || o.value.outlets.length === o.value.completed.length)
|
|
1704
1704
|
);
|
|
1705
|
-
function
|
|
1706
|
-
|
|
1705
|
+
function a() {
|
|
1706
|
+
p("close");
|
|
1707
1707
|
}
|
|
1708
1708
|
return (w, k) => {
|
|
1709
1709
|
const b = A("FmCircularProgress"), m = A("i18n-t"), v = A("FmButton");
|
|
1710
1710
|
return $(), M("div", yn, [
|
|
1711
|
-
|
|
1711
|
+
d(t).templates.length ? l.value ? ($(), M("div", bn, [
|
|
1712
1712
|
h("div", null, [
|
|
1713
1713
|
C(b, {
|
|
1714
1714
|
size: "md",
|
|
@@ -1716,7 +1716,7 @@ const gn = /* @__PURE__ */ ct(fn, [["render", vn]]), yn = { class: "flex flex-co
|
|
|
1716
1716
|
})
|
|
1717
1717
|
]),
|
|
1718
1718
|
h("div", _n, [
|
|
1719
|
-
h("span", null, S(
|
|
1719
|
+
h("span", null, S(d(y)("inventory.closing.template.publish.publishing")), 1)
|
|
1720
1720
|
])
|
|
1721
1721
|
])) : o.value ? o.value.outlets.length === o.value.completed.length ? ($(), M("div", wn, [
|
|
1722
1722
|
C(m, {
|
|
@@ -1724,21 +1724,21 @@ const gn = /* @__PURE__ */ ct(fn, [["render", vn]]), yn = { class: "flex flex-co
|
|
|
1724
1724
|
tag: "p"
|
|
1725
1725
|
}, {
|
|
1726
1726
|
started: E(() => [
|
|
1727
|
-
h("span", kn, S(
|
|
1727
|
+
h("span", kn, S(d(ie)(new Date(o.value.createdAt))), 1)
|
|
1728
1728
|
]),
|
|
1729
1729
|
finished: E(() => [
|
|
1730
|
-
h("span", Tn, S(
|
|
1730
|
+
h("span", Tn, S(d(ie)(new Date(o.value.updatedAt))), 1)
|
|
1731
1731
|
]),
|
|
1732
1732
|
_: 1
|
|
1733
1733
|
}),
|
|
1734
|
-
h("p", null, S(
|
|
1734
|
+
h("p", null, S(d(y)("inventory.closing.template.publish.message")), 1)
|
|
1735
1735
|
])) : ($(), M("div", $n, [
|
|
1736
1736
|
C(m, {
|
|
1737
1737
|
keypath: "inventory.closing.template.publish.stillPublishing",
|
|
1738
1738
|
tag: "p"
|
|
1739
1739
|
}, {
|
|
1740
1740
|
started: E(() => [
|
|
1741
|
-
h("span", Cn, S(
|
|
1741
|
+
h("span", Cn, S(d(ie)(new Date(o.value.createdAt))), 1)
|
|
1742
1742
|
]),
|
|
1743
1743
|
progress: E(() => [
|
|
1744
1744
|
h("span", In, " (" + S(o.value.completed.length) + "/" + S(o.value.outlets.length) + " completed) ", 1)
|
|
@@ -1747,22 +1747,22 @@ const gn = /* @__PURE__ */ ct(fn, [["render", vn]]), yn = { class: "flex flex-co
|
|
|
1747
1747
|
}),
|
|
1748
1748
|
Fe(" Your recent publishing task is still pending (" + S(o.value.completed.length) + " / " + S(o.value.outlets.length) + "). Please wait until all publishing task has completed. ", 1)
|
|
1749
1749
|
])) : ($(), M("div", xn, [
|
|
1750
|
-
h("p", null, S(
|
|
1751
|
-
h("p", null, S(
|
|
1750
|
+
h("p", null, S(d(y)("inventory.closing.template.publish.noRecentActivity")), 1),
|
|
1751
|
+
h("p", null, S(d(y)("inventory.closing.template.publish.message")), 1)
|
|
1752
1752
|
])) : ($(), M("div", hn, [
|
|
1753
|
-
h("p", null, S(
|
|
1753
|
+
h("p", null, S(d(y)("inventory.closing.template.publish.nothingToPublish")), 1)
|
|
1754
1754
|
])),
|
|
1755
1755
|
h("div", Sn, [
|
|
1756
1756
|
C(v, {
|
|
1757
|
-
disabled: !
|
|
1757
|
+
disabled: !f.value,
|
|
1758
1758
|
loading: l.value,
|
|
1759
1759
|
label: "Publish to all outlets",
|
|
1760
|
-
onClick:
|
|
1760
|
+
onClick: r
|
|
1761
1761
|
}, null, 8, ["disabled", "loading"]),
|
|
1762
1762
|
C(v, {
|
|
1763
1763
|
variant: "tertiary",
|
|
1764
1764
|
label: "Close",
|
|
1765
|
-
onClick:
|
|
1765
|
+
onClick: a
|
|
1766
1766
|
})
|
|
1767
1767
|
])
|
|
1768
1768
|
]);
|
|
@@ -1771,10 +1771,10 @@ const gn = /* @__PURE__ */ ct(fn, [["render", vn]]), yn = { class: "flex flex-co
|
|
|
1771
1771
|
}), Mn = { class: "flex-1 flex flex-col gap-8" }, Pn = { class: "flex flex-col" }, Rn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Fn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, An = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, En = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, jn = /* @__PURE__ */ H({
|
|
1772
1772
|
__name: "ClosingTemplateView",
|
|
1773
1773
|
setup(c) {
|
|
1774
|
-
const { t: s } = j(), { createTemplate: l, updateTemplate: i, exportTemplates: n, importTemplates: t } = oe(), { templateDialogProps: y, templateDetailsProps:
|
|
1775
|
-
|
|
1776
|
-
const k = V(() =>
|
|
1777
|
-
function
|
|
1774
|
+
const { t: s } = j(), { createTemplate: l, updateTemplate: i, exportTemplates: n, importTemplates: t } = oe(), { templateDialogProps: y, templateDetailsProps: p } = ze(oe()), r = ce(), o = se(), f = re(), a = mt(), { breakpoints: w } = vt();
|
|
1775
|
+
r.watchLocation(f.fetchTemplates);
|
|
1776
|
+
const k = V(() => f.loading), b = P(""), m = V(() => w.value.xs || w.value.sm), v = V(() => m.value ? 10 : 20);
|
|
1777
|
+
function u(T) {
|
|
1778
1778
|
switch (T) {
|
|
1779
1779
|
case U.Add:
|
|
1780
1780
|
return l();
|
|
@@ -1785,7 +1785,7 @@ const gn = /* @__PURE__ */ ct(fn, [["render", vn]]), yn = { class: "flex flex-co
|
|
|
1785
1785
|
case "export":
|
|
1786
1786
|
return n();
|
|
1787
1787
|
case "refresh":
|
|
1788
|
-
return
|
|
1788
|
+
return f.fetchTemplates();
|
|
1789
1789
|
}
|
|
1790
1790
|
}
|
|
1791
1791
|
function e() {
|
|
@@ -1861,9 +1861,9 @@ const gn = /* @__PURE__ */ ct(fn, [["render", vn]]), yn = { class: "flex flex-co
|
|
|
1861
1861
|
const x = A("FmTable");
|
|
1862
1862
|
return $(), M(O, null, [
|
|
1863
1863
|
C(ut, {
|
|
1864
|
-
title:
|
|
1864
|
+
title: d(s)("inventory.closing.template.title"),
|
|
1865
1865
|
actions: I.value,
|
|
1866
|
-
"onClick:action":
|
|
1866
|
+
"onClick:action": u
|
|
1867
1867
|
}, {
|
|
1868
1868
|
default: E(() => [
|
|
1869
1869
|
h("div", {
|
|
@@ -1881,18 +1881,18 @@ const gn = /* @__PURE__ */ ct(fn, [["render", vn]]), yn = { class: "flex flex-co
|
|
|
1881
1881
|
"onUpdate:search": g[0] || (g[0] = (F) => b.value = F)
|
|
1882
1882
|
}, null, 8, ["search"]),
|
|
1883
1883
|
C(x, {
|
|
1884
|
-
style: Ke(
|
|
1885
|
-
"column-defs": f
|
|
1886
|
-
"row-data": f
|
|
1884
|
+
style: Ke(d(a).tableHeight),
|
|
1885
|
+
"column-defs": d(f).columnDefs,
|
|
1886
|
+
"row-data": d(f).templates,
|
|
1887
1887
|
"search-value": b.value,
|
|
1888
1888
|
loading: k.value,
|
|
1889
|
-
onRowClick: g[1] || (g[1] = (F) =>
|
|
1889
|
+
onRowClick: g[1] || (g[1] = (F) => d(i)(F.original)),
|
|
1890
1890
|
"page-size": v.value
|
|
1891
1891
|
}, {
|
|
1892
1892
|
"list-row": E((F) => [
|
|
1893
1893
|
C(Le, {
|
|
1894
1894
|
row: F,
|
|
1895
|
-
onRowClick: (D) =>
|
|
1895
|
+
onRowClick: (D) => d(i)(D)
|
|
1896
1896
|
}, {
|
|
1897
1897
|
default: E((D) => {
|
|
1898
1898
|
var L, ve, ge, J, ye, he, be, _e, X, xe, we, ke, Te, $e, Ce, Q, Ie, Se, De, Me, Z, Pe;
|
|
@@ -1900,33 +1900,33 @@ const gn = /* @__PURE__ */ ct(fn, [["render", vn]]), yn = { class: "flex flex-co
|
|
|
1900
1900
|
h("div", Mn, [
|
|
1901
1901
|
h("div", Pn, [
|
|
1902
1902
|
h("div", Rn, [
|
|
1903
|
-
C(
|
|
1903
|
+
C(d(K), {
|
|
1904
1904
|
render: (ge = (ve = (L = D._id) == null ? void 0 : L.column) == null ? void 0 : ve.columnDef) == null ? void 0 : ge.cell,
|
|
1905
1905
|
props: (ye = (J = D._id) == null ? void 0 : J.getContext) == null ? void 0 : ye.call(J)
|
|
1906
1906
|
}, null, 8, ["render", "props"])
|
|
1907
1907
|
]),
|
|
1908
1908
|
h("div", Fn, [
|
|
1909
|
-
C(
|
|
1909
|
+
C(d(K), {
|
|
1910
1910
|
render: (_e = (be = (he = D.name) == null ? void 0 : he.column) == null ? void 0 : be.columnDef) == null ? void 0 : _e.cell,
|
|
1911
1911
|
props: (xe = (X = D.name) == null ? void 0 : X.getContext) == null ? void 0 : xe.call(X)
|
|
1912
1912
|
}, null, 8, ["render", "props"])
|
|
1913
1913
|
]),
|
|
1914
|
-
h("div", null, S((we = F.original.locations) != null && we.length ?
|
|
1914
|
+
h("div", null, S((we = F.original.locations) != null && we.length ? d(s)("inventory.closing.table.enabledForN", {
|
|
1915
1915
|
count: ((ke = F.original.locations) == null ? void 0 : ke.length) ?? 0
|
|
1916
|
-
}) :
|
|
1916
|
+
}) : d(s)("inventory.closing.table.enabledForAll")), 1),
|
|
1917
1917
|
h("div", An, S([
|
|
1918
1918
|
...F.original.items.slice(0, 3).map((Oe) => Oe.sku.name),
|
|
1919
1919
|
...F.original.items.length >= 3 ? [`and ${F.original.items.length - 3} more items`] : []
|
|
1920
1920
|
].join(", ")), 1),
|
|
1921
1921
|
h("div", En, [
|
|
1922
|
-
C(
|
|
1922
|
+
C(d(K), {
|
|
1923
1923
|
render: (Ce = ($e = (Te = D.ref) == null ? void 0 : Te.column) == null ? void 0 : $e.columnDef) == null ? void 0 : Ce.cell,
|
|
1924
1924
|
props: (Ie = (Q = D.ref) == null ? void 0 : Q.getContext) == null ? void 0 : Ie.call(Q)
|
|
1925
1925
|
}, null, 8, ["render", "props"])
|
|
1926
1926
|
])
|
|
1927
1927
|
]),
|
|
1928
1928
|
h("div", null, [
|
|
1929
|
-
C(
|
|
1929
|
+
C(d(K), {
|
|
1930
1930
|
render: (Me = (De = (Se = D.status) == null ? void 0 : Se.column) == null ? void 0 : De.columnDef) == null ? void 0 : Me.cell,
|
|
1931
1931
|
props: (Pe = (Z = D.status) == null ? void 0 : Z.getContext) == null ? void 0 : Pe.call(Z)
|
|
1932
1932
|
}, null, 8, ["render", "props"])
|
|
@@ -1944,9 +1944,9 @@ const gn = /* @__PURE__ */ ct(fn, [["render", vn]]), yn = { class: "flex flex-co
|
|
|
1944
1944
|
_: 1
|
|
1945
1945
|
}, 8, ["title", "actions"]),
|
|
1946
1946
|
($(), N(Ge, { to: "body" }, [
|
|
1947
|
-
C(gn, We(qe(
|
|
1948
|
-
C(pn, Je(
|
|
1949
|
-
onSubmitted: g[2] || (g[2] = (F) => f
|
|
1947
|
+
C(gn, We(qe(d(p))), null, 16),
|
|
1948
|
+
C(pn, Je(d(y), {
|
|
1949
|
+
onSubmitted: g[2] || (g[2] = (F) => d(f).fetchTemplates())
|
|
1950
1950
|
}), null, 16)
|
|
1951
1951
|
]))
|
|
1952
1952
|
], 64);
|