@feedmepos/mf-inventory-portal 0.0.24-dev.3 → 0.0.24-dev.49
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-C8gm6x7Q.js → App-BANIE_vi.js} +1 -1
- package/dist/ApprovalView-JQXB-wD3.js +140 -0
- package/dist/{BindingsDialog-II1cNZ8y.js → BindingsDialog-DPkylv4n.js} +8 -8
- package/dist/{BindingsPicker-7hWtLm42.js → BindingsPicker-DRq1pyB3.js} +1 -1
- package/dist/BindingsTable-CgcUJaar.js +120 -0
- package/dist/ClosingDraftView-MxkQABme.js +1348 -0
- package/dist/{ClosingTemplateView-cmdRLrA3.js → ClosingTemplateView-DK-REWKF.js} +478 -493
- package/dist/{FmCustomAttribute.vue_vue_type_script_setup_true_lang-Dk618cmq.js → FmCustomAttribute.vue_vue_type_script_setup_true_lang-CJYQN_nb.js} +1 -1
- package/dist/FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CH1wbfBF.js +211 -0
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-BcQSDPWo.js → FmUnitInput.vue_vue_type_script_setup_true_lang-BCQAMGnj.js} +1 -1
- package/dist/{IngredientGroupView-YGl-cE0p.js → IngredientGroupView-BbdFsju3.js} +1 -1
- package/dist/IngredientsView-CymDx24X.js +1742 -0
- package/dist/{IntegrationView-Bq-m4-Wh.js → IntegrationView-CpqWQjyz.js} +679 -642
- package/dist/{InventoryBindingForm-DFWSf75X.js → InventoryBindingForm-D3LbsYBi.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-RQ6XxdxU.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-k8k3iqCg.js} +96 -96
- package/dist/{InventoryBindingSummary-DU6GO2TJ.js → InventoryBindingSummary-DQ64AcL6.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-ChpZ0NwL.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Co-zYf0x.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-Ba2Uq1H-.js → PremiumBadge.vue_vue_type_script_setup_true_lang-Bzy_5Iha.js} +1 -1
- package/dist/PublishView-DQrsouy_.js +222 -0
- package/dist/{PurchaseOrderPrintPreview-cp_DzuxM.js → PurchaseOrderPrintPreview-BQA3Sbns.js} +5 -5
- package/dist/ReceiveRequestView-E4FtIHQm.js +2584 -0
- package/dist/{RecipeView-voWc35VV.js → RecipeView-B5fp0clS.js} +3 -3
- package/dist/{StockView-CoigRqM-.js → StockView-WN-Uf6Nc.js} +7 -7
- package/dist/{SupplierView-BDpCPZE7.js → SupplierView-CaOqPzEY.js} +295 -300
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-db47qL0f.js +1539 -0
- package/dist/TransferTemplateView-Dg7e2TeB.js +1422 -0
- package/dist/{UnitView-BBPJ0vhB.js → UnitView-Brnwh4tw.js} +3 -3
- package/dist/{WarehouseView-Ck6hBrGf.js → WarehouseView-DlUXVVHp.js} +1 -1
- package/dist/api/closing-draft.d.ts +1 -0
- package/dist/api/inventory.d.ts +2 -0
- package/dist/api/netsuite.d.ts +21 -4
- package/dist/api/purchase-order.d.ts +6 -1
- package/dist/api/stock.d.ts +1 -0
- package/dist/{app-ojZQI-KQ.js → app-CrAS505q.js} +25174 -24344
- package/dist/app.d.ts +0 -6
- package/dist/app.js +1 -1
- package/dist/components/FmCustomAttribute2.vue.d.ts +18 -0
- package/dist/components/FmLockableField.vue.d.ts +3 -0
- package/dist/components/FmMultiselectDialog.d.ts +23 -0
- package/dist/components/FmMultiselectDialog.vue.d.ts +20 -3
- package/dist/components/FmMultiselectDialogProps.d.ts +2 -0
- package/dist/{decimal-xq82Pirk.js → decimal-B3VbEmUT.js} +1 -1
- package/dist/{format-unit-display-ByfsyWBU.js → format-unit-display-Becux8VN.js} +256 -253
- package/dist/helper/fuzzy.d.ts +10 -0
- package/dist/{index-Bi6FnWGy.js → index-B8LjoNQa.js} +3 -3
- package/dist/{index-CKEbjSig.js → index-BojrVfgC.js} +1 -1
- package/dist/layout/SingleColumnLayout.vue.d.ts +1 -1
- package/dist/{stock-CC4RqQaB.js → stock-D3jX6RXK.js} +29 -25
- package/dist/stores/feature.d.ts +4 -2
- package/dist/stores/integration/netsuite.d.ts +26 -4
- package/dist/stores/inventory.d.ts +127 -0
- package/dist/stores/location.d.ts +91 -0
- package/dist/style.css +1 -1
- package/dist/{supplier-DLXOOcIm.js → supplier-BPzrg-JT.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/use-ingredient-select-dialog-CeL6kOMh.js +52 -0
- package/dist/{use-inventory-binding-dialog-B1zBTsW9.js → use-inventory-binding-dialog-SBHeD85N.js} +1 -1
- package/dist/views/closing-draft/composables/use-closing-draft-actions.d.ts +4 -1
- package/dist/views/closing-draft/helpers/export-draft.helper.d.ts +1 -1
- package/dist/views/ingredients/composables/use-ingredient-select-dialog.d.ts +16 -0
- package/dist/views/receive-request/components/netsuite/NetSuiteProps.d.ts +2 -0
- package/dist/views/receive-request/components/transfer-details/TransferDetailsProps.d.ts +2 -0
- package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +386 -0
- package/dist/views/receive-request/components/transfer-form/components/ForecastStock.vue.d.ts +4 -0
- package/dist/views/receive-request/components/transfer-form/components/TransferItemTable.vue.d.ts +382 -2
- package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +3 -0
- package/dist/views/receive-request/composables/use-receive-request-form.d.ts +783 -5
- package/dist/views/receive-request/composables/use-receive-request-table.d.ts +595 -6
- package/dist/views/receive-request/import/XilnexImportDialog.vue.d.ts +22 -0
- package/dist/views/receive-request/import/XilnexImportForm.vue.d.ts +17 -0
- package/dist/views/receive-request/import/XilnexResult.vue.d.ts +17 -0
- package/dist/views/receive-request/import/export.d.ts +14 -0
- package/dist/views/receive-request/import/props.d.ts +7 -0
- package/dist/views/stock/components/dialog/AdjustedItemForm.vue.d.ts +2 -0
- package/dist/views/transfer-template/components/transfer-template-form/components/TransferTemplateItemTable.vue.d.ts +220 -0
- package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.d.ts +5 -1
- package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +24 -0
- package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +24 -0
- package/dist/views/transfer-template/composables/useTransferTemplateHelper.d.ts +305 -0
- package/dist/{vue-i18n-AeCKtYb7.js → vue-i18n-DSQQNX5F.js} +270 -270
- package/package.json +4 -4
- package/dist/ApprovalView-xtUG5yeg.js +0 -138
- package/dist/BindingsTable-Bub-L-pM.js +0 -145
- package/dist/ClosingDraftView-C9VKku7E.js +0 -1225
- package/dist/FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BSB7T16f.js +0 -286
- package/dist/IngredientsView-XxrOFv-u.js +0 -1706
- package/dist/PublishView-CBIvo-Qj.js +0 -192
- package/dist/ReceiveRequestView-UIaPylF0.js +0 -1876
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-CyovzdZg.js +0 -1327
- package/dist/TransferTemplateView-C2XMghN_.js +0 -1284
|
@@ -1,60 +1,61 @@
|
|
|
1
|
-
import { ref as D, h as F, defineComponent as O, resolveComponent as R, openBlock as
|
|
2
|
-
import { X as qe, u as le, a9 as Xe, D as Se, i as N, h as Qe, f as
|
|
1
|
+
import { ref as D, h as F, defineComponent as O, resolveComponent as R, openBlock as T, createElementBlock as I, createElementVNode as _, normalizeClass as Y, createTextVNode as Fe, toDisplayString as C, unref as v, createCommentVNode as K, createVNode as $, withCtx as P, Fragment as H, renderList as J, computed as A, watch as Re, createSlots as Pe, createBlock as V, isRef as je, normalizeStyle as Ye, Teleport as Ge, normalizeProps as Ke, guardReactiveProps as Je, mergeProps as We } from "vue";
|
|
2
|
+
import { X as qe, u as le, a9 as Xe, D as Se, i as N, h as Qe, f as Ee, aa as oe, r as Ze, ab as Ae, s as Ue, a as ae, b as et, v as tt, w as Ve, x as nt, y as ot, e as z, G as j, H as st, ac as lt, m as at, E as Ne, A as rt, ad as it, ae as ne, z as ct, _ as mt, B as ut } from "./app-CrAS505q.js";
|
|
3
3
|
import { useCoreStore as re, useI18n as B } from "@feedmepos/mf-common";
|
|
4
|
-
import { useDialogChild as
|
|
4
|
+
import { useDialogChild as dt, useSnackbar as Z, useDialog as ie, FmButtonVariant as De, components as L, useProxiedModel as pt, useBreakpoints as ft } from "@feedmepos/ui-library";
|
|
5
5
|
import { defineStore as Be, storeToRefs as Le } from "pinia";
|
|
6
|
-
|
|
6
|
+
import { u as vt } from "./use-ingredient-select-dialog-CeL6kOMh.js";
|
|
7
|
+
const ee = qe((i, s) => {
|
|
7
8
|
function o() {
|
|
8
9
|
var t;
|
|
9
10
|
return `business_${((t = re().currentBusiness.value) == null ? void 0 : t._id) ?? ""}`;
|
|
10
11
|
}
|
|
11
12
|
return {
|
|
12
13
|
async getRecentPublishingJob() {
|
|
13
|
-
const l = o(), e = `${
|
|
14
|
+
const l = o(), e = `${i.inventoryBackendUrl}/${l}/closing-template/publish/recent`;
|
|
14
15
|
return s.get(e);
|
|
15
16
|
},
|
|
16
17
|
async startNewPublish() {
|
|
17
|
-
const l = o(), e = `${
|
|
18
|
+
const l = o(), e = `${i.inventoryBackendUrl}/${l}/closing-template/publish`;
|
|
18
19
|
return s.post(e);
|
|
19
20
|
},
|
|
20
21
|
async getTemplate(l) {
|
|
21
|
-
const e = o(), t = `${
|
|
22
|
+
const e = o(), t = `${i.inventoryBackendUrl}/${e}/closing-template/${l}`;
|
|
22
23
|
return s.get(t);
|
|
23
24
|
},
|
|
24
25
|
async readTemplates() {
|
|
25
|
-
const l = o(), e = `${
|
|
26
|
+
const l = o(), e = `${i.inventoryBackendUrl}/${l}/closing-template`;
|
|
26
27
|
return s.get(e);
|
|
27
28
|
},
|
|
28
29
|
async createTemplate(l) {
|
|
29
|
-
const e = o(), t = `${
|
|
30
|
+
const e = o(), t = `${i.inventoryBackendUrl}/${e}/closing-template`;
|
|
30
31
|
return s.post(t, l);
|
|
31
32
|
},
|
|
32
33
|
async updateTemplate(l) {
|
|
33
|
-
const e = o(), t = `${
|
|
34
|
+
const e = o(), t = `${i.inventoryBackendUrl}/${e}/closing-template`;
|
|
34
35
|
return s.put(t, l);
|
|
35
36
|
},
|
|
36
37
|
async deleteTemplate(l) {
|
|
37
|
-
const e = o(), t = `${
|
|
38
|
+
const e = o(), t = `${i.inventoryBackendUrl}/${e}/closing-template`;
|
|
38
39
|
return s.delete(t, { _id: l._id, _rev: l._rev });
|
|
39
40
|
},
|
|
40
41
|
async importTemplates(l) {
|
|
41
|
-
const e = o(), t = `${
|
|
42
|
+
const e = o(), t = `${i.inventoryBackendUrl}/${e}/closing-template/import`;
|
|
42
43
|
return s.post(t, l);
|
|
43
44
|
}
|
|
44
45
|
};
|
|
45
46
|
}), te = Be(
|
|
46
47
|
"closingTemplateTable",
|
|
47
48
|
function() {
|
|
48
|
-
const { t: s } = B(), o = se(), l = D({}), e = D(new Array()), t = D(!1),
|
|
49
|
+
const { t: s } = B(), o = se(), l = D({}), e = D(new Array()), t = D(!1), f = le(), g = ee();
|
|
49
50
|
async function p() {
|
|
50
|
-
if (e.value = [], !!
|
|
51
|
+
if (e.value = [], !!f._currentLocation) {
|
|
51
52
|
t.value = !0;
|
|
52
53
|
try {
|
|
53
|
-
const [y,
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
const [y, b] = await Promise.all([
|
|
55
|
+
g.readTemplates(),
|
|
56
|
+
g.getRecentPublishingJob()
|
|
56
57
|
]).delayed(1e3);
|
|
57
|
-
e.value = y, l.value =
|
|
58
|
+
e.value = y, l.value = b;
|
|
58
59
|
} catch (y) {
|
|
59
60
|
console.log("Something went wrong when fetching templates:", y);
|
|
60
61
|
} finally {
|
|
@@ -62,30 +63,30 @@ const ee = qe((r, s) => {
|
|
|
62
63
|
}
|
|
63
64
|
}
|
|
64
65
|
}
|
|
65
|
-
async function
|
|
66
|
-
if (!e.value.find((
|
|
66
|
+
async function r(y) {
|
|
67
|
+
if (!e.value.find((b) => b._id) && f._currentLocation) {
|
|
67
68
|
t.value = !0;
|
|
68
69
|
try {
|
|
69
|
-
const [
|
|
70
|
-
|
|
70
|
+
const [b] = await Promise.all([
|
|
71
|
+
g.getTemplate(y),
|
|
71
72
|
new Promise((u) => setTimeout(u, 1e3))
|
|
72
73
|
]);
|
|
73
|
-
e.value = [
|
|
74
|
-
} catch (
|
|
75
|
-
console.log("Something went wrong when fetching templates:",
|
|
74
|
+
e.value = [b];
|
|
75
|
+
} catch (b) {
|
|
76
|
+
console.log("Something went wrong when fetching templates:", b);
|
|
76
77
|
} finally {
|
|
77
78
|
t.value = !1;
|
|
78
79
|
}
|
|
79
80
|
}
|
|
80
81
|
}
|
|
81
|
-
function
|
|
82
|
-
switch (
|
|
82
|
+
function m(y, b) {
|
|
83
|
+
switch (b = Ee(b), y) {
|
|
83
84
|
case N.Details:
|
|
84
|
-
return o.viewTemplate(
|
|
85
|
+
return o.viewTemplate(b);
|
|
85
86
|
case N.Edit:
|
|
86
|
-
return o.updateTemplate(
|
|
87
|
+
return o.updateTemplate(b);
|
|
87
88
|
case N.Delete:
|
|
88
|
-
return o.deleteTemplate(
|
|
89
|
+
return o.deleteTemplate(b, t, p);
|
|
89
90
|
}
|
|
90
91
|
}
|
|
91
92
|
return {
|
|
@@ -122,8 +123,8 @@ const ee = qe((r, s) => {
|
|
|
122
123
|
header: () => s("inventory.closing.table.enabledOutlets"),
|
|
123
124
|
cell(y) {
|
|
124
125
|
var u;
|
|
125
|
-
const
|
|
126
|
-
return
|
|
126
|
+
const b = (u = y.row.original.locations) == null ? void 0 : u.length;
|
|
127
|
+
return b ? `${b}` : "All";
|
|
127
128
|
},
|
|
128
129
|
enableSorting: !1,
|
|
129
130
|
meta: {
|
|
@@ -143,8 +144,8 @@ const ee = qe((r, s) => {
|
|
|
143
144
|
header: () => s("inventory.closing.table.status"),
|
|
144
145
|
enableSorting: !1,
|
|
145
146
|
cell(y) {
|
|
146
|
-
var
|
|
147
|
-
const
|
|
147
|
+
var k;
|
|
148
|
+
const b = y.row.original, u = b._rev, n = (k = l.value.publishedRevs) == null ? void 0 : k[b._id], a = u === n;
|
|
148
149
|
return F(
|
|
149
150
|
"div",
|
|
150
151
|
{
|
|
@@ -166,11 +167,11 @@ const ee = qe((r, s) => {
|
|
|
166
167
|
{
|
|
167
168
|
id: "action",
|
|
168
169
|
cell(y) {
|
|
169
|
-
const
|
|
170
|
+
const b = y.row.original, u = [
|
|
170
171
|
Se[N.Edit],
|
|
171
172
|
Se[N.Delete]
|
|
172
173
|
];
|
|
173
|
-
return Qe(u, (n) =>
|
|
174
|
+
return Qe(u, (n) => m(n, b));
|
|
174
175
|
},
|
|
175
176
|
enableSorting: !1,
|
|
176
177
|
size: 40,
|
|
@@ -184,13 +185,13 @@ const ee = qe((r, s) => {
|
|
|
184
185
|
templates: e,
|
|
185
186
|
loading: t,
|
|
186
187
|
fetchTemplates: p,
|
|
187
|
-
loadTemplate:
|
|
188
|
+
loadTemplate: r
|
|
188
189
|
};
|
|
189
190
|
}
|
|
190
191
|
);
|
|
191
|
-
var ce = /* @__PURE__ */ ((
|
|
192
|
-
function ze(
|
|
193
|
-
const s =
|
|
192
|
+
var ce = /* @__PURE__ */ ((i) => (i.Ingredients = "Ingredients", i))(ce || {});
|
|
193
|
+
function ze(i) {
|
|
194
|
+
const s = i.sku, o = new Set(i.disabledMeasurements);
|
|
194
195
|
return [
|
|
195
196
|
{
|
|
196
197
|
code: s.code,
|
|
@@ -224,11 +225,11 @@ function He() {
|
|
|
224
225
|
}
|
|
225
226
|
];
|
|
226
227
|
}
|
|
227
|
-
function gt(
|
|
228
|
-
var
|
|
229
|
-
const o = re().currentBusiness.value, e = (
|
|
228
|
+
function gt(i) {
|
|
229
|
+
var g;
|
|
230
|
+
const o = re().currentBusiness.value, e = (g = i.map((p) => {
|
|
230
231
|
var u;
|
|
231
|
-
const
|
|
232
|
+
const r = p.items.flatMap(ze), m = He(), d = [
|
|
232
233
|
["Template ID", p._id],
|
|
233
234
|
["Template name", p.name],
|
|
234
235
|
["Business name", o == null ? void 0 : o.name],
|
|
@@ -236,29 +237,29 @@ function gt(r) {
|
|
|
236
237
|
["Menu version", o == null ? void 0 : o.menuVersion],
|
|
237
238
|
[
|
|
238
239
|
"Locations",
|
|
239
|
-
...(u = p.locations) != null && u.length ?
|
|
240
|
+
...(u = p.locations) != null && u.length ? p.locations.map((n) => `${n.name} (${n.dbName})`) : ["All"]
|
|
240
241
|
],
|
|
241
242
|
["Reference", p.ref ?? ""],
|
|
242
243
|
[],
|
|
243
|
-
|
|
244
|
-
...
|
|
245
|
-
], y =
|
|
246
|
-
return { name: p.name, sheet:
|
|
244
|
+
m.map((n) => n.name),
|
|
245
|
+
...r.map((n) => m.map((a) => n[a.id]))
|
|
246
|
+
], y = m.map((n) => `system:${n.id}`), b = oe(d, y);
|
|
247
|
+
return { name: p.name, sheet: b };
|
|
247
248
|
}).reduce(
|
|
248
|
-
(p,
|
|
249
|
-
var
|
|
250
|
-
const
|
|
251
|
-
return (
|
|
249
|
+
(p, r) => {
|
|
250
|
+
var d;
|
|
251
|
+
const m = r.name.slice(0, 12);
|
|
252
|
+
return (d = p.sheetOccurence)[m] ?? (d[m] = 0), p.sheetOccurence[m] += 1, p.sheets[`${m} (${p.sheetOccurence[m]})`] = r.sheet, p;
|
|
252
253
|
},
|
|
253
254
|
{
|
|
254
255
|
sheets: {},
|
|
255
256
|
sheetOccurence: {}
|
|
256
257
|
}
|
|
257
|
-
)) == null ? void 0 :
|
|
258
|
-
return Ue(
|
|
258
|
+
)) == null ? void 0 : g.sheets, t = `${o == null ? void 0 : o.name} closing templates (${Ze(/* @__PURE__ */ new Date())}).xlsx`, f = Ae(e);
|
|
259
|
+
return Ue(f, t), t;
|
|
259
260
|
}
|
|
260
261
|
function yt() {
|
|
261
|
-
const
|
|
262
|
+
const i = re(), s = ae(), o = et(), l = ze({
|
|
262
263
|
sku: {
|
|
263
264
|
unit: {
|
|
264
265
|
_id: "",
|
|
@@ -271,7 +272,7 @@ function yt() {
|
|
|
271
272
|
_id: "",
|
|
272
273
|
name: "Sugar"
|
|
273
274
|
}
|
|
274
|
-
})[0], e =
|
|
275
|
+
})[0], e = i.currentBusiness.value, t = He(), f = [
|
|
275
276
|
["Template ID (leave empty to create new)", ""],
|
|
276
277
|
["Template Name", "New template"],
|
|
277
278
|
["Business name", e == null ? void 0 : e.name],
|
|
@@ -286,27 +287,27 @@ function yt() {
|
|
|
286
287
|
[],
|
|
287
288
|
t.map((u) => u.name),
|
|
288
289
|
t.map((u) => l[u.id])
|
|
289
|
-
],
|
|
290
|
+
], g = t.map((u) => `system:${u.id}`), p = oe(f, g), r = o.isEnabled ? o.state.setting.childItems ?? [] : [], m = r.reduce(
|
|
290
291
|
(u, n) => {
|
|
291
|
-
var
|
|
292
|
-
const a = (
|
|
292
|
+
var h, x;
|
|
293
|
+
const a = (h = o.netSuiteItemIdToSkuId.get(n.parentNetSuiteId)) == null ? void 0 : h[0], k = (x = o.netSuiteMeasurementIdToMeasurementId.get(
|
|
293
294
|
n.unitOfMeasureId
|
|
294
|
-
)) == null ? void 0 :
|
|
295
|
+
)) == null ? void 0 : x[0];
|
|
295
296
|
if (!n.externalId)
|
|
296
297
|
return u;
|
|
297
298
|
if (!a)
|
|
298
299
|
return console.error(`Item ${n.externalId} cannot be mapped to parent FdoInventorySku.`, n), u;
|
|
299
|
-
const c = s.skuById[a],
|
|
300
|
-
return
|
|
300
|
+
const c = s.skuById[a], w = c.unit.measurements.find((E) => E.id === k);
|
|
301
|
+
return w ? (u[n.externalId] = {
|
|
301
302
|
sku: c,
|
|
302
|
-
measurement:
|
|
303
|
+
measurement: w
|
|
303
304
|
}, u) : (console.error(
|
|
304
305
|
`Item ${n.externalId} found parent FdoInventorySku of ${c.code} ${c.name} but the measurement of netsuite id ${n.unitOfMeasureId} cannot be found.`,
|
|
305
306
|
n
|
|
306
307
|
), u);
|
|
307
308
|
},
|
|
308
309
|
{}
|
|
309
|
-
),
|
|
310
|
+
), d = oe(
|
|
310
311
|
[
|
|
311
312
|
...s.skus.flatMap((u) => [
|
|
312
313
|
[u.code, u.name, u.unit.abbrev, !0],
|
|
@@ -317,7 +318,7 @@ function yt() {
|
|
|
317
318
|
!a.abbrev.toLocaleLowerCase("en-us").includes("inactive")
|
|
318
319
|
])
|
|
319
320
|
]),
|
|
320
|
-
...Object.entries(
|
|
321
|
+
...Object.entries(m).map(([u, { sku: n, measurement: a }]) => [
|
|
321
322
|
n.code,
|
|
322
323
|
n.name,
|
|
323
324
|
a.abbrev,
|
|
@@ -330,67 +331,67 @@ function yt() {
|
|
|
330
331
|
"Name",
|
|
331
332
|
"Units",
|
|
332
333
|
"Enabled (true/false)",
|
|
333
|
-
...
|
|
334
|
+
...r.length ? ["Netsuite Parent"] : []
|
|
334
335
|
]
|
|
335
|
-
), y =
|
|
336
|
+
), y = Ae({
|
|
336
337
|
Template: p,
|
|
337
|
-
Ingredients:
|
|
338
|
-
}),
|
|
339
|
-
return Ue(y,
|
|
338
|
+
Ingredients: d
|
|
339
|
+
}), b = `${e == null ? void 0 : e.name} transfer templates import.xlsx`;
|
|
340
|
+
return Ue(y, b), b;
|
|
340
341
|
}
|
|
341
|
-
function ht(
|
|
342
|
-
if (!
|
|
342
|
+
function ht(i) {
|
|
343
|
+
if (!i.length || `${i[0]}`.toLocaleLowerCase() === "all")
|
|
343
344
|
return [];
|
|
344
345
|
const s = /(.*) \(((warehouse_|restaurant_).{24,})\)/, l = le().locationByDbName;
|
|
345
|
-
return
|
|
346
|
-
const t = new Array(),
|
|
347
|
-
if (!
|
|
348
|
-
return t.push(`Enabled location value of ${
|
|
346
|
+
return i.map((e) => {
|
|
347
|
+
const t = new Array(), f = e.trim(), g = s.exec(f);
|
|
348
|
+
if (!g)
|
|
349
|
+
return t.push(`Enabled location value of ${f} cannot be read.`), {
|
|
349
350
|
errors: t
|
|
350
351
|
};
|
|
351
|
-
const p =
|
|
352
|
-
return
|
|
353
|
-
`Location id ${
|
|
352
|
+
const p = g[1], r = g[2], m = l[r];
|
|
353
|
+
return m ? (p !== m.name && t.push(
|
|
354
|
+
`Location id ${r} has non-matching name. Found ${p} but expected ${m.name}`
|
|
354
355
|
), {
|
|
355
356
|
errors: t,
|
|
356
|
-
location:
|
|
357
|
-
}) : (t.push(`Location (${p}) of id ${
|
|
357
|
+
location: m
|
|
358
|
+
}) : (t.push(`Location (${p}) of id ${r} is not found.`), {
|
|
358
359
|
errors: t
|
|
359
360
|
});
|
|
360
361
|
});
|
|
361
362
|
}
|
|
362
|
-
function bt(
|
|
363
|
+
function bt(i) {
|
|
363
364
|
const [
|
|
364
365
|
s,
|
|
365
366
|
o,
|
|
366
367
|
l,
|
|
367
368
|
e,
|
|
368
369
|
t,
|
|
369
|
-
g,
|
|
370
370
|
f,
|
|
371
|
+
g,
|
|
371
372
|
p
|
|
372
|
-
] = Ve(
|
|
373
|
+
] = Ve(i);
|
|
373
374
|
return {
|
|
374
375
|
id: `${o[1] ?? ""}`.trim(),
|
|
375
376
|
name: `${l[1] ?? ""}`.trim(),
|
|
376
|
-
locations:
|
|
377
|
+
locations: g.slice(1).map((r) => `${r}`.trim()).filter((r) => r),
|
|
377
378
|
reference: `${p[1] ?? ""}`.trim()
|
|
378
379
|
};
|
|
379
380
|
}
|
|
380
|
-
function _t(
|
|
381
|
+
function _t(i) {
|
|
381
382
|
const [
|
|
382
383
|
s,
|
|
383
384
|
o,
|
|
384
385
|
l,
|
|
385
386
|
e,
|
|
386
387
|
t,
|
|
387
|
-
g,
|
|
388
388
|
f,
|
|
389
|
+
g,
|
|
389
390
|
p,
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
...
|
|
393
|
-
] = Ve(
|
|
391
|
+
r,
|
|
392
|
+
m,
|
|
393
|
+
...d
|
|
394
|
+
] = Ve(i);
|
|
394
395
|
if (!s || !s.length || s.some((a) => a.length && !a.startsWith("system:")))
|
|
395
396
|
throw new Error("Missing meta header. Excel file does not come from the template.");
|
|
396
397
|
const y = s.map((a) => a.split(":")[1]), u = ["code", "name", "unit", "enabled"].filter((a) => !y.includes(a));
|
|
@@ -398,20 +399,20 @@ function _t(r) {
|
|
|
398
399
|
throw new Error(
|
|
399
400
|
`Missing meta headers (${u.join()}). Excel file does not come from the template.`
|
|
400
401
|
);
|
|
401
|
-
return
|
|
402
|
+
return d.map((a, k) => {
|
|
402
403
|
const c = {};
|
|
403
|
-
for (const
|
|
404
|
-
const
|
|
405
|
-
Object.assign(c, { [
|
|
404
|
+
for (const w in y) {
|
|
405
|
+
const h = y[w];
|
|
406
|
+
Object.assign(c, { [h]: a[w] });
|
|
406
407
|
}
|
|
407
408
|
return {
|
|
408
|
-
index:
|
|
409
|
+
index: k,
|
|
409
410
|
data: c
|
|
410
411
|
};
|
|
411
412
|
});
|
|
412
413
|
}
|
|
413
|
-
function xt(
|
|
414
|
-
return
|
|
414
|
+
function xt(i) {
|
|
415
|
+
return i.reduce(
|
|
415
416
|
(s, o) => {
|
|
416
417
|
var t;
|
|
417
418
|
const l = o.data, e = o.index;
|
|
@@ -420,90 +421,90 @@ function xt(r) {
|
|
|
420
421
|
{ result: new Array(), errors: new Array() }
|
|
421
422
|
);
|
|
422
423
|
}
|
|
423
|
-
function wt(
|
|
424
|
-
const s =
|
|
424
|
+
function wt(i) {
|
|
425
|
+
const s = i.parent.data, o = new Array(), e = ae().skuByCode[s.code ?? ""];
|
|
425
426
|
if (!e)
|
|
426
427
|
return o.push(`Cannot find ingredient of code ${s.code} ${s.name}`), { errors: o };
|
|
427
428
|
const t = {
|
|
428
429
|
sku: e
|
|
429
|
-
},
|
|
430
|
-
s.unit !== e.unit.abbrev && !
|
|
430
|
+
}, f = /* @__PURE__ */ new Set([e.unit._id, ...e.unit.measurements.map((p) => p.id)]), g = e.unit.measurements.find((p) => p.abbrev === s.unit);
|
|
431
|
+
s.unit !== e.unit.abbrev && !g ? o.push(
|
|
431
432
|
`Cannot find measurement unit of ${s.unit} for (${s.code}) ${s.name}.`
|
|
432
|
-
) : (s.enabled === !0 || `${s.enabled}`.toLocaleLowerCase() === "true") &&
|
|
433
|
-
for (const p of
|
|
434
|
-
const
|
|
435
|
-
if (!
|
|
433
|
+
) : (s.enabled === !0 || `${s.enabled}`.toLocaleLowerCase() === "true") && f.delete(e.unit._id);
|
|
434
|
+
for (const p of i.children) {
|
|
435
|
+
const r = p.data, m = r.unit === e.unit.abbrev ? e.unit : void 0, d = e.unit.measurements.find((y) => y.abbrev === r.unit);
|
|
436
|
+
if (!d && !m) {
|
|
436
437
|
o.push(
|
|
437
|
-
`Cannot find measurement unit of ${
|
|
438
|
+
`Cannot find measurement unit of ${r.unit} for (${s.code}) ${s.name}.`
|
|
438
439
|
);
|
|
439
440
|
continue;
|
|
440
441
|
}
|
|
441
|
-
(
|
|
442
|
+
(r.enabled === !0 || `${r.enabled}`.toLocaleLowerCase() === "true") && f.delete((d == null ? void 0 : d.id) ?? (m == null ? void 0 : m._id) ?? "");
|
|
442
443
|
}
|
|
443
|
-
return
|
|
444
|
+
return f.has(e.unit._id) && t.sku.unit.measurements.every((p) => f.has(p.id)) && o.push(`Ingredient ${e.code} - ${e.name} must have at least one unit enabled.`), t.disabledMeasurements = [...f], { errors: o, templateItem: t };
|
|
444
445
|
}
|
|
445
|
-
function kt(
|
|
446
|
-
const s =
|
|
446
|
+
function kt(i) {
|
|
447
|
+
const s = i.SheetNames.filter(
|
|
447
448
|
(t) => !Object.values(ce).map(String).includes(t)
|
|
448
449
|
), l = te().templates, e = tt(l, "_id");
|
|
449
450
|
try {
|
|
450
451
|
return s.reduce(
|
|
451
|
-
(t,
|
|
452
|
-
const
|
|
453
|
-
|
|
452
|
+
(t, f) => {
|
|
453
|
+
const g = new Array(), p = i.Sheets[f], r = bt(p), m = ht(r.locations), d = m.filter((c) => c.location).map((c) => c.location);
|
|
454
|
+
g.push(...m.flatMap((c) => c.errors));
|
|
454
455
|
const y = _t(p).filter(
|
|
455
456
|
(c) => c.data.code || c.data.unit
|
|
456
|
-
),
|
|
457
|
-
|
|
458
|
-
const u =
|
|
457
|
+
), b = xt(y);
|
|
458
|
+
g.push(...b.errors);
|
|
459
|
+
const u = b.result.map(
|
|
459
460
|
(c) => wt(c)
|
|
460
461
|
);
|
|
461
|
-
|
|
462
|
+
g.push(...u.flatMap((c) => c.errors));
|
|
462
463
|
const n = u.filter((c) => c.templateItem).map((c) => c.templateItem);
|
|
463
|
-
if (
|
|
464
|
-
const c = e[
|
|
464
|
+
if (r.id) {
|
|
465
|
+
const c = e[r.id];
|
|
465
466
|
if (!c) {
|
|
466
|
-
const
|
|
467
|
-
_id:
|
|
467
|
+
const h = {
|
|
468
|
+
_id: r.id,
|
|
468
469
|
_rev: "",
|
|
469
|
-
name:
|
|
470
|
+
name: r.name || `(unnamed from sheet ${f || "<unnamed sheet>"})`,
|
|
470
471
|
items: []
|
|
471
472
|
};
|
|
472
|
-
return
|
|
473
|
+
return g.push(`Template ID ${r.id} is not found.`), t.importUpdateResult.push({
|
|
473
474
|
type: "update",
|
|
474
|
-
original:
|
|
475
|
-
template:
|
|
476
|
-
excelSheetName:
|
|
477
|
-
errors:
|
|
475
|
+
original: h,
|
|
476
|
+
template: h,
|
|
477
|
+
excelSheetName: f,
|
|
478
|
+
errors: g
|
|
478
479
|
}), t;
|
|
479
480
|
}
|
|
480
|
-
const
|
|
481
|
+
const w = {
|
|
481
482
|
type: "update",
|
|
482
483
|
original: c,
|
|
483
484
|
template: {
|
|
484
485
|
...c,
|
|
485
|
-
name:
|
|
486
|
-
locations:
|
|
487
|
-
ref:
|
|
486
|
+
name: r.name,
|
|
487
|
+
locations: d.length ? d : null,
|
|
488
|
+
ref: r.reference,
|
|
488
489
|
items: n
|
|
489
490
|
},
|
|
490
|
-
excelSheetName:
|
|
491
|
-
errors:
|
|
491
|
+
excelSheetName: f,
|
|
492
|
+
errors: g
|
|
492
493
|
};
|
|
493
|
-
return t.importUpdateResult.push(
|
|
494
|
+
return t.importUpdateResult.push(w), t;
|
|
494
495
|
}
|
|
495
|
-
const
|
|
496
|
+
const k = {
|
|
496
497
|
type: "create",
|
|
497
498
|
template: {
|
|
498
|
-
name:
|
|
499
|
-
locations:
|
|
500
|
-
ref:
|
|
499
|
+
name: r.name,
|
|
500
|
+
locations: d.length ? d : null,
|
|
501
|
+
ref: r.reference,
|
|
501
502
|
items: n
|
|
502
503
|
},
|
|
503
|
-
excelSheetName:
|
|
504
|
-
errors:
|
|
504
|
+
excelSheetName: f,
|
|
505
|
+
errors: g
|
|
505
506
|
};
|
|
506
|
-
return t.importCreateResult.push(
|
|
507
|
+
return t.importCreateResult.push(k), t;
|
|
507
508
|
},
|
|
508
509
|
{
|
|
509
510
|
invalidExcel: !1,
|
|
@@ -532,12 +533,12 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
|
|
|
532
533
|
items: {},
|
|
533
534
|
errors: {}
|
|
534
535
|
},
|
|
535
|
-
setup(
|
|
536
|
+
setup(i) {
|
|
536
537
|
const { t: s } = B();
|
|
537
538
|
return (o, l) => {
|
|
538
|
-
var
|
|
539
|
+
var f, g, p;
|
|
539
540
|
const e = R("FmIcon"), t = R("FmTooltip");
|
|
540
|
-
return
|
|
541
|
+
return T(), I("div", Tt, [
|
|
541
542
|
l[0] || (l[0] = _("div", null, "•", -1)),
|
|
542
543
|
_("div", $t, [
|
|
543
544
|
_("div", Ct, [
|
|
@@ -547,17 +548,17 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
|
|
|
547
548
|
})
|
|
548
549
|
}, [
|
|
549
550
|
Fe(C(o.name) + " ", 1),
|
|
550
|
-
o.type === "create" ? (
|
|
551
|
+
o.type === "create" ? (T(), I("span", It, "(" + C(v(s)("inventory.closing.template.import.new")) + ")", 1)) : K("", !0)
|
|
551
552
|
], 2),
|
|
552
|
-
o.errors.length ? (
|
|
553
|
-
|
|
553
|
+
o.errors.length ? (T(), I("div", St, [
|
|
554
|
+
$(t, { "z-index": 50 }, {
|
|
554
555
|
content: P(() => [
|
|
555
556
|
_("ol", null, [
|
|
556
|
-
(
|
|
557
|
+
(T(!0), I(H, null, J(o.errors, (r, m) => (T(), I("li", { key: m }, C(r), 1))), 128))
|
|
557
558
|
])
|
|
558
559
|
]),
|
|
559
560
|
default: P(() => [
|
|
560
|
-
|
|
561
|
+
$(e, {
|
|
561
562
|
name: "error",
|
|
562
563
|
size: "sm",
|
|
563
564
|
color: "system-error-300"
|
|
@@ -575,7 +576,7 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
|
|
|
575
576
|
"text-fm-color-typo-secondary": !o.errors.length
|
|
576
577
|
}
|
|
577
578
|
])
|
|
578
|
-
}, C((
|
|
579
|
+
}, C((f = o.locations) != null && f.length ? v(s)("inventory.closing.template.import.nLocations", { count: (g = o.locations) == null ? void 0 : g.length }) : v(s)("inventory.closing.template.import.allLocations")) + ", " + C(v(s)("inventory.closing.template.import.nItems", { count: (p = o.items) == null ? void 0 : p.length })), 3)
|
|
579
580
|
])
|
|
580
581
|
]);
|
|
581
582
|
};
|
|
@@ -583,7 +584,7 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
|
|
|
583
584
|
}), Dt = { class: "flex flex-col gap-24" }, Mt = { class: "fm-typo-en-body-md-400" }, Ft = {
|
|
584
585
|
key: 0,
|
|
585
586
|
class: "flex items-center gap-8"
|
|
586
|
-
}, Rt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Pt = { class: "flex flex-col gap-8" },
|
|
587
|
+
}, Rt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Pt = { class: "flex flex-col gap-8" }, Et = { class: "line-clamp-2 text-ellipsis break-all" }, At = {
|
|
587
588
|
key: 2,
|
|
588
589
|
class: "shrink-0"
|
|
589
590
|
}, Ut = {
|
|
@@ -594,76 +595,76 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
|
|
|
594
595
|
class: "max-h-[200px] overflow-y-auto flex flex-col gap-8"
|
|
595
596
|
}, Bt = { class: "fm-typo-en-body-lg-600" }, Lt = /* @__PURE__ */ O({
|
|
596
597
|
__name: "ClosingTemplateImport",
|
|
597
|
-
setup(
|
|
598
|
-
const s = D(null), o =
|
|
599
|
-
() => !!
|
|
600
|
-
),
|
|
601
|
-
() => !!
|
|
602
|
-
), { t:
|
|
603
|
-
async function y(
|
|
604
|
-
|
|
598
|
+
setup(i) {
|
|
599
|
+
const s = D(null), o = dt(), l = Z(), e = D(!1), t = D(!1), f = D(new Array()), g = D([]), p = D([]), r = A(
|
|
600
|
+
() => !!f.value.length || g.value.some((b) => b.errors.length) || p.value.some((b) => b.errors.length)
|
|
601
|
+
), m = A(
|
|
602
|
+
() => !!g.value.length || !!p.value.length
|
|
603
|
+
), { t: d } = B();
|
|
604
|
+
async function y(b) {
|
|
605
|
+
f.value = [], g.value = [], p.value = [];
|
|
605
606
|
try {
|
|
606
607
|
e.value = !0;
|
|
607
608
|
const [u] = await Promise.all([
|
|
608
|
-
ot(
|
|
609
|
+
ot(b),
|
|
609
610
|
// fake buffer
|
|
610
611
|
new Promise((c) => setTimeout(c, 1e3))
|
|
611
612
|
]);
|
|
612
613
|
if (!u.SheetNames.filter(
|
|
613
614
|
(c) => !Object.values(ce).map(String).includes(c)
|
|
614
615
|
).find((c) => c)) {
|
|
615
|
-
|
|
616
|
+
f.value.push(d("inventory.ingredient.import.fileError.noSheet"));
|
|
616
617
|
return;
|
|
617
618
|
}
|
|
618
|
-
const
|
|
619
|
-
if (
|
|
620
|
-
|
|
621
|
-
|
|
619
|
+
const k = kt(u);
|
|
620
|
+
if (k.invalidExcel) {
|
|
621
|
+
f.value.push(
|
|
622
|
+
k.invalidExcelMessage ?? d("inventory.ingredient.import.fileError.invalidExcel")
|
|
622
623
|
);
|
|
623
624
|
return;
|
|
624
625
|
}
|
|
625
|
-
if (
|
|
626
|
-
|
|
626
|
+
if (g.value = k.importCreateResult, p.value = k.importUpdateResult, !g.value.length && !p.value.length) {
|
|
627
|
+
f.value.push(d("inventory.ingredient.import.fileError.noData"));
|
|
627
628
|
return;
|
|
628
629
|
}
|
|
629
|
-
o.emitData(
|
|
630
|
+
o.emitData(k);
|
|
630
631
|
} catch (u) {
|
|
631
632
|
l.open({
|
|
632
|
-
title:
|
|
633
|
+
title: d("inventory.ingredient.import.fileError.unableToRead"),
|
|
633
634
|
message: u == null ? void 0 : u.message,
|
|
634
635
|
type: "error"
|
|
635
636
|
}), console.error("Error in reading file", u);
|
|
636
637
|
} finally {
|
|
637
|
-
|
|
638
|
-
title:
|
|
638
|
+
f.value.length && l.open({
|
|
639
|
+
title: d("inventory.ingredient.import.fileError.invalidExcel"),
|
|
639
640
|
type: "error"
|
|
640
641
|
}), e.value = !1;
|
|
641
642
|
}
|
|
642
643
|
}
|
|
643
|
-
return Re(s, (
|
|
644
|
-
|
|
645
|
-
}), (
|
|
646
|
-
const n = R("FmCircularProgress"), a = R("FmIcon"),
|
|
647
|
-
return
|
|
648
|
-
_("div", Mt, C(v(
|
|
649
|
-
t.value ? (
|
|
644
|
+
return Re(s, (b) => {
|
|
645
|
+
b && y(b);
|
|
646
|
+
}), (b, u) => {
|
|
647
|
+
const n = R("FmCircularProgress"), a = R("FmIcon"), k = R("FmButton");
|
|
648
|
+
return T(), I("div", Dt, [
|
|
649
|
+
_("div", Mt, C(v(d)("inventory.closing.template.import.message")), 1),
|
|
650
|
+
t.value ? (T(), I("div", Ft, [
|
|
650
651
|
_("div", null, [
|
|
651
|
-
|
|
652
|
+
$(n, {
|
|
652
653
|
size: "md",
|
|
653
654
|
color: "neutral-gray-200"
|
|
654
655
|
})
|
|
655
656
|
]),
|
|
656
|
-
_("div", Rt, C(v(
|
|
657
|
-
])) : (
|
|
658
|
-
|
|
657
|
+
_("div", Rt, C(v(d)("inventory.formField.loading")), 1)
|
|
658
|
+
])) : (T(), I(H, { key: 1 }, [
|
|
659
|
+
$(nt, {
|
|
659
660
|
class: Y({
|
|
660
661
|
"w-full": !0,
|
|
661
662
|
"h-[200px]": !s.value
|
|
662
663
|
}),
|
|
663
664
|
accept: ".xlsx",
|
|
664
665
|
onFileUpload: u[0] || (u[0] = (c) => s.value = c),
|
|
665
|
-
label: v(
|
|
666
|
-
"button-label": v(
|
|
666
|
+
label: v(d)("inventory.ingredient.import.uploadTemplate"),
|
|
667
|
+
"button-label": v(d)("inventory.ingredient.import.selectFile")
|
|
667
668
|
}, Pe({ _: 2 }, [
|
|
668
669
|
s.value ? {
|
|
669
670
|
name: "default",
|
|
@@ -674,20 +675,20 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
|
|
|
674
675
|
"fm-corner-radius-md p-16 flex items-center gap-16",
|
|
675
676
|
{
|
|
676
677
|
"border border-fm-color-neutral-gray-100": e.value,
|
|
677
|
-
"border border-fm-color-neutral-gray-200": !e.value && !
|
|
678
|
-
"border border-fm-color-system-error-200":
|
|
678
|
+
"border border-fm-color-neutral-gray-200": !e.value && !r.value,
|
|
679
|
+
"border border-fm-color-system-error-200": r.value
|
|
679
680
|
}
|
|
680
681
|
])
|
|
681
682
|
}, [
|
|
682
|
-
e.value ? (
|
|
683
|
+
e.value ? (T(), V(n, {
|
|
683
684
|
key: 0,
|
|
684
685
|
size: "md",
|
|
685
686
|
color: "neutral-gray-200"
|
|
686
|
-
})) : (
|
|
687
|
+
})) : (T(), V(a, {
|
|
687
688
|
key: 1,
|
|
688
|
-
name:
|
|
689
|
+
name: r.value ? "error" : "attach_file",
|
|
689
690
|
outline: "",
|
|
690
|
-
color:
|
|
691
|
+
color: r.value ? "system-error-300" : void 0
|
|
691
692
|
}, null, 8, ["name", "color"])),
|
|
692
693
|
_("div", {
|
|
693
694
|
class: Y([
|
|
@@ -698,28 +699,28 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
|
|
|
698
699
|
}
|
|
699
700
|
])
|
|
700
701
|
}, [
|
|
701
|
-
_("div",
|
|
702
|
+
_("div", Et, C(s.value.name), 1)
|
|
702
703
|
], 2),
|
|
703
|
-
e.value ? K("", !0) : (
|
|
704
|
-
|
|
705
|
-
label: v(
|
|
706
|
-
variant:
|
|
707
|
-
"prepend-icon":
|
|
704
|
+
e.value ? K("", !0) : (T(), I("div", At, [
|
|
705
|
+
$(k, {
|
|
706
|
+
label: v(d)("inventory.ingredient.import.replaceFile"),
|
|
707
|
+
variant: r.value ? "destructive" : "secondary",
|
|
708
|
+
"prepend-icon": r.value ? void 0 : "autorenew",
|
|
708
709
|
onClick: c
|
|
709
710
|
}, null, 8, ["label", "variant", "prepend-icon", "onClick"])
|
|
710
711
|
]))
|
|
711
712
|
], 2),
|
|
712
|
-
|
|
713
|
-
(
|
|
714
|
-
key:
|
|
713
|
+
f.value.length ? (T(), I("div", Ut, [
|
|
714
|
+
(T(!0), I(H, null, J(f.value, (w, h) => (T(), I("div", {
|
|
715
|
+
key: h,
|
|
715
716
|
class: "flex gap-8 items-center"
|
|
716
717
|
}, [
|
|
717
|
-
|
|
718
|
+
$(a, {
|
|
718
719
|
name: "error",
|
|
719
720
|
size: "sm",
|
|
720
721
|
color: "system-error-300"
|
|
721
722
|
}),
|
|
722
|
-
_("div", Vt, C(
|
|
723
|
+
_("div", Vt, C(w), 1)
|
|
723
724
|
]))), 128))
|
|
724
725
|
])) : K("", !0)
|
|
725
726
|
])
|
|
@@ -727,17 +728,17 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
|
|
|
727
728
|
key: "0"
|
|
728
729
|
} : void 0
|
|
729
730
|
]), 1032, ["class", "label", "button-label"]),
|
|
730
|
-
|
|
731
|
-
_("div", Bt, C(v(
|
|
732
|
-
(
|
|
733
|
-
key:
|
|
731
|
+
m.value ? (T(), I("div", Nt, [
|
|
732
|
+
_("div", Bt, C(v(d)("inventory.ingredient.import.summary")), 1),
|
|
733
|
+
(T(!0), I(H, null, J(g.value, (c, w) => (T(), V(Me, {
|
|
734
|
+
key: w,
|
|
734
735
|
name: c.template.name,
|
|
735
736
|
locations: c.template.locations,
|
|
736
737
|
items: c.template.items,
|
|
737
738
|
errors: c.errors,
|
|
738
739
|
type: "create"
|
|
739
740
|
}, null, 8, ["name", "locations", "items", "errors"]))), 128)),
|
|
740
|
-
(
|
|
741
|
+
(T(!0), I(H, null, J(p.value, (c) => (T(), V(Me, {
|
|
741
742
|
key: c.template._id,
|
|
742
743
|
name: c.template.name,
|
|
743
744
|
locations: c.template.locations,
|
|
@@ -751,27 +752,27 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
|
|
|
751
752
|
};
|
|
752
753
|
}
|
|
753
754
|
}), se = Be("closingTemplateActions", () => {
|
|
754
|
-
const { t:
|
|
755
|
-
function
|
|
756
|
-
|
|
755
|
+
const { t: i } = B(), s = ie(), o = Z(), l = ee(), e = te(), { loading: t } = Le(e), f = D({});
|
|
756
|
+
function g() {
|
|
757
|
+
f.value = {
|
|
757
758
|
mode: z.CREATE,
|
|
758
759
|
show: !0,
|
|
759
760
|
"onUpdate:show"(n) {
|
|
760
|
-
|
|
761
|
+
f.value.show = n;
|
|
761
762
|
}
|
|
762
763
|
};
|
|
763
764
|
}
|
|
764
765
|
function p(n) {
|
|
765
|
-
|
|
766
|
+
f.value = {
|
|
766
767
|
mode: z.UPDATE,
|
|
767
768
|
modelValue: n,
|
|
768
769
|
show: !0,
|
|
769
770
|
"onUpdate:show"(a) {
|
|
770
|
-
|
|
771
|
+
f.value.show = a;
|
|
771
772
|
}
|
|
772
773
|
};
|
|
773
774
|
}
|
|
774
|
-
function
|
|
775
|
+
function r(n, a, k) {
|
|
775
776
|
s.open({
|
|
776
777
|
title: `Confirm deleting template ${n.name}?`,
|
|
777
778
|
message: "Deleted template can no longer be retrieved",
|
|
@@ -794,7 +795,7 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
|
|
|
794
795
|
a.value = !0;
|
|
795
796
|
const [c] = await Promise.allSettled([
|
|
796
797
|
l.deleteTemplate(n),
|
|
797
|
-
new Promise((
|
|
798
|
+
new Promise((w) => setTimeout(w, 1e3))
|
|
798
799
|
]);
|
|
799
800
|
if (c.status === "rejected") throw c.reason;
|
|
800
801
|
o.open({
|
|
@@ -808,20 +809,20 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
|
|
|
808
809
|
type: "error"
|
|
809
810
|
}), console.error("error on deleting closing template", c);
|
|
810
811
|
} finally {
|
|
811
|
-
a.value = !1,
|
|
812
|
+
a.value = !1, k();
|
|
812
813
|
}
|
|
813
814
|
});
|
|
814
815
|
}
|
|
815
|
-
const
|
|
816
|
-
function
|
|
817
|
-
|
|
816
|
+
const m = D({});
|
|
817
|
+
function d(n) {
|
|
818
|
+
m.value = {
|
|
818
819
|
template: n,
|
|
819
820
|
show: !0,
|
|
820
821
|
"onUpdate:show"(a) {
|
|
821
|
-
|
|
822
|
+
m.value.show = a;
|
|
822
823
|
},
|
|
823
824
|
"onAction:edit"() {
|
|
824
|
-
|
|
825
|
+
m.value.show = !1, p(Ee(n));
|
|
825
826
|
}
|
|
826
827
|
};
|
|
827
828
|
}
|
|
@@ -835,50 +836,50 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
|
|
|
835
836
|
}
|
|
836
837
|
const n = gt(e.templates);
|
|
837
838
|
o.open({
|
|
838
|
-
title:
|
|
839
|
-
message:
|
|
839
|
+
title: i("inventory.ingredient.export.success"),
|
|
840
|
+
message: i("inventory.ingredient.export.filename", [n]),
|
|
840
841
|
type: "success"
|
|
841
842
|
});
|
|
842
843
|
}
|
|
843
|
-
function
|
|
844
|
+
function b() {
|
|
844
845
|
e.loading || s.open({
|
|
845
|
-
title:
|
|
846
|
+
title: i("inventory.ingredient.import.title"),
|
|
846
847
|
contentComponent: Lt,
|
|
847
848
|
overlay: !0,
|
|
848
849
|
closeButton: !0,
|
|
849
850
|
primaryActions: {
|
|
850
|
-
text:
|
|
851
|
+
text: i("common.import"),
|
|
851
852
|
close: !1
|
|
852
853
|
},
|
|
853
854
|
secondaryActions: {
|
|
854
|
-
text:
|
|
855
|
+
text: i("common.close"),
|
|
855
856
|
close: !0
|
|
856
857
|
},
|
|
857
858
|
tertiaryActions: {
|
|
858
|
-
text:
|
|
859
|
+
text: i("inventory.ingredient.import.actions.downloadTemplate"),
|
|
859
860
|
close: !1,
|
|
860
861
|
variant: "plain"
|
|
861
862
|
}
|
|
862
863
|
}).onPrimary((n) => {
|
|
863
864
|
if (!n) {
|
|
864
865
|
o.open({
|
|
865
|
-
title:
|
|
866
|
+
title: i("inventory.ingredient.import.error.noData"),
|
|
866
867
|
type: "error"
|
|
867
868
|
});
|
|
868
869
|
return;
|
|
869
870
|
}
|
|
870
871
|
if (!n.importCreateResult.length && !n.importUpdateResult.length) {
|
|
871
872
|
o.open({
|
|
872
|
-
title:
|
|
873
|
-
message:
|
|
873
|
+
title: i("inventory.ingredient.import.error.invalidContent"),
|
|
874
|
+
message: i("inventory.ingredient.import.error.noImportData"),
|
|
874
875
|
type: "error"
|
|
875
876
|
});
|
|
876
877
|
return;
|
|
877
878
|
}
|
|
878
879
|
if (n.importCreateResult.some((a) => a.errors.length) || n.importUpdateResult.some((a) => a.errors.length)) {
|
|
879
880
|
o.open({
|
|
880
|
-
title:
|
|
881
|
-
message:
|
|
881
|
+
title: i("inventory.ingredient.import.error.invalidContent"),
|
|
882
|
+
message: i("inventory.ingredient.import.error.hasErrors"),
|
|
882
883
|
type: "error"
|
|
883
884
|
});
|
|
884
885
|
return;
|
|
@@ -891,31 +892,31 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
|
|
|
891
892
|
try {
|
|
892
893
|
const a = [
|
|
893
894
|
...n.importCreateResult.map(
|
|
894
|
-
(
|
|
895
|
+
(h) => h.template
|
|
895
896
|
),
|
|
896
897
|
...n.importUpdateResult.map(
|
|
897
|
-
(
|
|
898
|
+
(h) => h.template
|
|
898
899
|
)
|
|
899
|
-
],
|
|
900
|
+
], k = 100;
|
|
900
901
|
let c = 0;
|
|
901
|
-
const
|
|
902
|
-
c +=
|
|
903
|
-
title:
|
|
902
|
+
const w = () => {
|
|
903
|
+
c += k, o.open({
|
|
904
|
+
title: i("inventory.ingredient.import.progress", [
|
|
904
905
|
Math.min(c, a.length),
|
|
905
906
|
a.length
|
|
906
907
|
])
|
|
907
908
|
});
|
|
908
909
|
};
|
|
909
|
-
for (const
|
|
910
|
-
|
|
910
|
+
for (const h of a.chunk(100))
|
|
911
|
+
w(), await l.importTemplates(h);
|
|
911
912
|
o.open({
|
|
912
|
-
title:
|
|
913
|
+
title: i("inventory.ingredient.import.success"),
|
|
913
914
|
type: "success"
|
|
914
915
|
});
|
|
915
916
|
} catch (a) {
|
|
916
917
|
o.open({
|
|
917
|
-
title:
|
|
918
|
-
message:
|
|
918
|
+
title: i("inventory.ingredient.import.error.failed"),
|
|
919
|
+
message: i("inventory.ingredient.import.error.systemMessage", [a == null ? void 0 : a.message]),
|
|
919
920
|
type: "error"
|
|
920
921
|
}), console.error("Error in importing skus", n, a);
|
|
921
922
|
} finally {
|
|
@@ -923,21 +924,21 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
|
|
|
923
924
|
}
|
|
924
925
|
}
|
|
925
926
|
return {
|
|
926
|
-
createTemplate:
|
|
927
|
-
viewTemplate:
|
|
927
|
+
createTemplate: g,
|
|
928
|
+
viewTemplate: d,
|
|
928
929
|
updateTemplate: p,
|
|
929
|
-
deleteTemplate:
|
|
930
|
+
deleteTemplate: r,
|
|
930
931
|
exportTemplates: y,
|
|
931
|
-
importTemplates:
|
|
932
|
-
templateDialogProps:
|
|
933
|
-
templateDetailsProps:
|
|
932
|
+
importTemplates: b,
|
|
933
|
+
templateDialogProps: f,
|
|
934
|
+
templateDetailsProps: m
|
|
934
935
|
};
|
|
935
936
|
});
|
|
936
|
-
var G = /* @__PURE__ */ ((
|
|
937
|
-
function zt(
|
|
937
|
+
var G = /* @__PURE__ */ ((i) => (i.Name = "Name", i.Unit = "Unit", i.Delete = "Delete", i))(G || {});
|
|
938
|
+
function zt(i) {
|
|
938
939
|
return {
|
|
939
|
-
columnDefs:
|
|
940
|
-
const o =
|
|
940
|
+
columnDefs: A(() => {
|
|
941
|
+
const o = i.items.map((e) => e.sku.unit.measurements.length).reduce((e, t) => Math.max(e, t), 0);
|
|
941
942
|
return [
|
|
942
943
|
{
|
|
943
944
|
id: "Name",
|
|
@@ -976,14 +977,14 @@ function zt(r) {
|
|
|
976
977
|
minSize: 200,
|
|
977
978
|
maxSize: 400,
|
|
978
979
|
cell(e) {
|
|
979
|
-
var
|
|
980
|
+
var f, g, p;
|
|
980
981
|
const t = e.row.original;
|
|
981
982
|
return F("div", { class: "flex items-center gap-32" }, [
|
|
982
983
|
F(
|
|
983
984
|
L.FmFormGroup,
|
|
984
985
|
{
|
|
985
986
|
value: t.sku.unit._id,
|
|
986
|
-
modelValue: !((
|
|
987
|
+
modelValue: !((f = t.disabledMeasurements) != null && f.includes(t.sku.unit._id))
|
|
987
988
|
},
|
|
988
989
|
F(
|
|
989
990
|
"div",
|
|
@@ -994,27 +995,27 @@ function zt(r) {
|
|
|
994
995
|
[
|
|
995
996
|
F(L.FmCheckbox, {
|
|
996
997
|
value: t.sku.unit._id,
|
|
997
|
-
modelValue: !((
|
|
998
|
-
disabled:
|
|
999
|
-
(
|
|
1000
|
-
var
|
|
1001
|
-
return (
|
|
998
|
+
modelValue: !((g = t.disabledMeasurements) != null && g.includes(t.sku.unit._id)),
|
|
999
|
+
disabled: i.disabled || !((p = t.disabledMeasurements) != null && p.includes(t.sku.unit._id)) && t.sku.unit.measurements.every(
|
|
1000
|
+
(r) => {
|
|
1001
|
+
var m;
|
|
1002
|
+
return (m = t.disabledMeasurements) == null ? void 0 : m.includes(r.id);
|
|
1002
1003
|
}
|
|
1003
1004
|
),
|
|
1004
|
-
"onUpdate:modelValue"(
|
|
1005
|
-
var
|
|
1006
|
-
if (
|
|
1007
|
-
|
|
1005
|
+
"onUpdate:modelValue"(r) {
|
|
1006
|
+
var m;
|
|
1007
|
+
if (r)
|
|
1008
|
+
i.updateItem({
|
|
1008
1009
|
...t,
|
|
1009
|
-
disabledMeasurements: (
|
|
1010
|
-
(
|
|
1010
|
+
disabledMeasurements: (m = t.disabledMeasurements) == null ? void 0 : m.filter(
|
|
1011
|
+
(d) => d !== t.sku.unit._id
|
|
1011
1012
|
)
|
|
1012
1013
|
});
|
|
1013
1014
|
else {
|
|
1014
|
-
const
|
|
1015
|
-
|
|
1015
|
+
const d = t.disabledMeasurements ?? [];
|
|
1016
|
+
i.updateItem({
|
|
1016
1017
|
...t,
|
|
1017
|
-
disabledMeasurements: [...
|
|
1018
|
+
disabledMeasurements: [...d, t.sku.unit._id]
|
|
1018
1019
|
});
|
|
1019
1020
|
}
|
|
1020
1021
|
}
|
|
@@ -1038,13 +1039,13 @@ function zt(r) {
|
|
|
1038
1039
|
]
|
|
1039
1040
|
)
|
|
1040
1041
|
),
|
|
1041
|
-
...Array.from({ length: Math.max(o, 0) }).map((
|
|
1042
|
-
var
|
|
1043
|
-
const
|
|
1042
|
+
...Array.from({ length: Math.max(o, 0) }).map((r, m) => {
|
|
1043
|
+
var b, u, n, a;
|
|
1044
|
+
const d = e.row.original, y = d.sku.unit.measurements[m];
|
|
1044
1045
|
return y ? F(
|
|
1045
1046
|
L.FmFormGroup,
|
|
1046
1047
|
{
|
|
1047
|
-
modelValue: !((
|
|
1048
|
+
modelValue: !((b = d.disabledMeasurements) != null && b.includes(y.id)),
|
|
1048
1049
|
value: y.id
|
|
1049
1050
|
},
|
|
1050
1051
|
F(
|
|
@@ -1056,25 +1057,25 @@ function zt(r) {
|
|
|
1056
1057
|
[
|
|
1057
1058
|
F(L.FmCheckbox, {
|
|
1058
1059
|
value: y.id,
|
|
1059
|
-
modelValue: !((u =
|
|
1060
|
-
disabled:
|
|
1060
|
+
modelValue: !((u = d.disabledMeasurements) != null && u.includes(y.id)),
|
|
1061
|
+
disabled: i.disabled || !((n = d.disabledMeasurements) != null && n.includes(y.id)) && ((a = d.disabledMeasurements) == null ? void 0 : a.includes(d.sku.unit._id)) && d.sku.unit.measurements.filter((k) => k.id != y.id).every((k) => {
|
|
1061
1062
|
var c;
|
|
1062
|
-
return (c =
|
|
1063
|
+
return (c = d.disabledMeasurements) == null ? void 0 : c.includes(k.id);
|
|
1063
1064
|
}),
|
|
1064
|
-
"onUpdate:modelValue"(
|
|
1065
|
+
"onUpdate:modelValue"(k) {
|
|
1065
1066
|
var c;
|
|
1066
|
-
if (
|
|
1067
|
-
|
|
1068
|
-
...
|
|
1069
|
-
disabledMeasurements: (c =
|
|
1070
|
-
(
|
|
1067
|
+
if (k)
|
|
1068
|
+
i.updateItem({
|
|
1069
|
+
...d,
|
|
1070
|
+
disabledMeasurements: (c = d.disabledMeasurements) == null ? void 0 : c.filter(
|
|
1071
|
+
(w) => w !== y.id
|
|
1071
1072
|
)
|
|
1072
1073
|
});
|
|
1073
1074
|
else {
|
|
1074
|
-
const
|
|
1075
|
-
|
|
1076
|
-
...
|
|
1077
|
-
disabledMeasurements: [
|
|
1075
|
+
const w = d.disabledMeasurements ?? [];
|
|
1076
|
+
i.updateItem({
|
|
1077
|
+
...d,
|
|
1078
|
+
disabledMeasurements: [...w, y.id]
|
|
1078
1079
|
});
|
|
1079
1080
|
}
|
|
1080
1081
|
}
|
|
@@ -1117,9 +1118,9 @@ function zt(r) {
|
|
|
1117
1118
|
icon: "delete",
|
|
1118
1119
|
variant: "tertiary",
|
|
1119
1120
|
size: "md",
|
|
1120
|
-
disabled:
|
|
1121
|
+
disabled: i.disabled,
|
|
1121
1122
|
onClick: () => {
|
|
1122
|
-
|
|
1123
|
+
i.deleteItem(t);
|
|
1123
1124
|
}
|
|
1124
1125
|
})
|
|
1125
1126
|
);
|
|
@@ -1141,35 +1142,35 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
|
|
|
1141
1142
|
cellByColId: {},
|
|
1142
1143
|
row: {}
|
|
1143
1144
|
},
|
|
1144
|
-
setup(
|
|
1145
|
-
const s =
|
|
1145
|
+
setup(i) {
|
|
1146
|
+
const s = i, o = A(() => s.row), l = A(
|
|
1146
1147
|
() => o.value.getVisibleCells().filter((e) => e.column.id !== G.Name && e.column.id !== G.Delete)
|
|
1147
1148
|
);
|
|
1148
1149
|
return (e, t) => {
|
|
1149
|
-
var
|
|
1150
|
-
return
|
|
1150
|
+
var f, g, p, r, m;
|
|
1151
|
+
return T(), I("div", Ht, [
|
|
1151
1152
|
_("div", Ot, [
|
|
1152
1153
|
_("div", jt, [
|
|
1153
1154
|
_("div", Yt, C(o.value.original.sku.name), 1),
|
|
1154
1155
|
_("div", Gt, C(o.value.original.sku.code), 1)
|
|
1155
1156
|
]),
|
|
1156
1157
|
_("div", null, [
|
|
1157
|
-
|
|
1158
|
-
render: (p = (
|
|
1159
|
-
props: (
|
|
1158
|
+
$(v(j), {
|
|
1159
|
+
render: (p = (g = (f = e.cellByColId[v(G).Delete]) == null ? void 0 : f.column) == null ? void 0 : g.columnDef) == null ? void 0 : p.cell,
|
|
1160
|
+
props: (m = (r = e.cellByColId[v(G).Delete]) == null ? void 0 : r.getContext) == null ? void 0 : m.call(r)
|
|
1160
1161
|
}, null, 8, ["render", "props"])
|
|
1161
1162
|
])
|
|
1162
1163
|
]),
|
|
1163
1164
|
_("div", Kt, [
|
|
1164
1165
|
t[0] || (t[0] = _("div", { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, null, -1)),
|
|
1165
|
-
(
|
|
1166
|
-
var y,
|
|
1167
|
-
return
|
|
1168
|
-
key:
|
|
1166
|
+
(T(!0), I(H, null, J(l.value, (d) => {
|
|
1167
|
+
var y, b, u;
|
|
1168
|
+
return T(), I("div", {
|
|
1169
|
+
key: d.id
|
|
1169
1170
|
}, [
|
|
1170
|
-
|
|
1171
|
-
render: (
|
|
1172
|
-
props: (u =
|
|
1171
|
+
$(v(j), {
|
|
1172
|
+
render: (b = (y = d.column) == null ? void 0 : y.columnDef) == null ? void 0 : b.cell,
|
|
1173
|
+
props: (u = d.getContext) == null ? void 0 : u.call(d)
|
|
1173
1174
|
}, null, 8, ["render", "props"])
|
|
1174
1175
|
]);
|
|
1175
1176
|
}), 128))
|
|
@@ -1183,11 +1184,13 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
|
|
|
1183
1184
|
modelValue: {},
|
|
1184
1185
|
disabled: { type: Boolean }
|
|
1185
1186
|
},
|
|
1186
|
-
setup(
|
|
1187
|
-
const o =
|
|
1187
|
+
setup(i, { expose: s }) {
|
|
1188
|
+
const o = i, l = st(), { t: e } = B(), t = ae();
|
|
1189
|
+
ie();
|
|
1190
|
+
const {
|
|
1188
1191
|
promptSelectLocations: f,
|
|
1189
|
-
columnDefs:
|
|
1190
|
-
rowData:
|
|
1192
|
+
columnDefs: g,
|
|
1193
|
+
rowData: p
|
|
1191
1194
|
} = lt({
|
|
1192
1195
|
getLocations() {
|
|
1193
1196
|
return l.locations;
|
|
@@ -1195,22 +1198,22 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
|
|
|
1195
1198
|
setLocations(n) {
|
|
1196
1199
|
l.locations = n;
|
|
1197
1200
|
}
|
|
1198
|
-
}),
|
|
1201
|
+
}), r = D(), m = D("");
|
|
1199
1202
|
s({
|
|
1200
1203
|
validateInputs: () => {
|
|
1201
1204
|
var n, a;
|
|
1202
|
-
(a = (n =
|
|
1205
|
+
(a = (n = r.value) == null ? void 0 : n.validateInputs) == null || a.call(n);
|
|
1203
1206
|
},
|
|
1204
1207
|
resetInputsValidation: () => {
|
|
1205
1208
|
var n, a;
|
|
1206
|
-
(a = (n =
|
|
1209
|
+
(a = (n = r.value) == null ? void 0 : n.resetInputsValidation) == null || a.call(n);
|
|
1207
1210
|
},
|
|
1208
1211
|
resetInputs: () => {
|
|
1209
1212
|
var n, a;
|
|
1210
|
-
(a = (n =
|
|
1213
|
+
(a = (n = r.value) == null ? void 0 : n.resetInputs) == null || a.call(n);
|
|
1211
1214
|
}
|
|
1212
1215
|
});
|
|
1213
|
-
const
|
|
1216
|
+
const d = zt({
|
|
1214
1217
|
updateItem: (n) => {
|
|
1215
1218
|
l.items = l.items.map((a) => a.sku._id !== n.sku._id ? a : n);
|
|
1216
1219
|
},
|
|
@@ -1223,63 +1226,45 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
|
|
|
1223
1226
|
get disabled() {
|
|
1224
1227
|
return o.disabled;
|
|
1225
1228
|
}
|
|
1226
|
-
}),
|
|
1227
|
-
function u() {
|
|
1228
|
-
const
|
|
1229
|
-
label:
|
|
1230
|
-
sublabel:
|
|
1231
|
-
value:
|
|
1232
|
-
}))
|
|
1233
|
-
var
|
|
1234
|
-
return (
|
|
1235
|
-
}).map((
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
modelValue: a,
|
|
1242
|
-
items: n,
|
|
1243
|
-
virtualScroll: !0
|
|
1244
|
-
},
|
|
1245
|
-
primaryActions: {
|
|
1246
|
-
text: e("common.confirm"),
|
|
1247
|
-
close: !0
|
|
1248
|
-
},
|
|
1249
|
-
secondaryActions: {
|
|
1250
|
-
text: e("common.close"),
|
|
1251
|
-
close: !0,
|
|
1252
|
-
variant: "tertiary"
|
|
1253
|
-
}
|
|
1254
|
-
}).onPrimary((x) => {
|
|
1255
|
-
const c = l.items ?? [], $ = x.map((b) => {
|
|
1256
|
-
const w = c.find((M) => M.sku._id === b._id);
|
|
1257
|
-
return w || {
|
|
1258
|
-
sku: b
|
|
1229
|
+
}), y = A(() => d.columnDefs.value), { promptSelectIngredients: b } = vt();
|
|
1230
|
+
async function u() {
|
|
1231
|
+
const a = t.skus.map((w) => ({
|
|
1232
|
+
label: w.name,
|
|
1233
|
+
sublabel: w.code,
|
|
1234
|
+
value: w
|
|
1235
|
+
})).filter((w) => {
|
|
1236
|
+
var h;
|
|
1237
|
+
return (h = l.items) == null ? void 0 : h.find((x) => x.sku._id === w.value._id);
|
|
1238
|
+
}).map((w) => w.value), k = l.items ?? [], c = await b(
|
|
1239
|
+
a.map((w) => w._id),
|
|
1240
|
+
(w) => {
|
|
1241
|
+
const h = t.skuById[w], x = k.find((M) => M.sku._id === h._id);
|
|
1242
|
+
return x || {
|
|
1243
|
+
sku: h
|
|
1259
1244
|
};
|
|
1260
|
-
}
|
|
1261
|
-
|
|
1262
|
-
|
|
1245
|
+
}
|
|
1246
|
+
);
|
|
1247
|
+
c && (c.sort((w, h) => w.sku.code.localeCompare(h.sku.code)), l.items = c);
|
|
1263
1248
|
}
|
|
1264
1249
|
return (n, a) => {
|
|
1265
|
-
const
|
|
1266
|
-
return
|
|
1250
|
+
const k = R("FmTextField"), c = R("FmButton"), w = R("FmTable"), h = R("FmIcon"), x = R("FmFormGroup"), E = R("FmForm");
|
|
1251
|
+
return T(), V(E, {
|
|
1267
1252
|
ref_key: "formRef",
|
|
1268
|
-
ref:
|
|
1253
|
+
ref: r,
|
|
1269
1254
|
class: "flex flex-col gap-32",
|
|
1270
1255
|
disabled: n.disabled
|
|
1271
1256
|
}, {
|
|
1272
1257
|
default: P(() => [
|
|
1273
1258
|
_("div", Wt, [
|
|
1274
1259
|
_("div", qt, [
|
|
1275
|
-
|
|
1260
|
+
$(k, {
|
|
1276
1261
|
label: v(e)("inventory.closing.form.name"),
|
|
1277
1262
|
"label-mark": "required",
|
|
1278
1263
|
modelValue: v(l).name,
|
|
1279
1264
|
"onUpdate:modelValue": a[0] || (a[0] = (M) => v(l).name = M),
|
|
1280
1265
|
rules: [v(at)()]
|
|
1281
1266
|
}, null, 8, ["label", "modelValue", "rules"]),
|
|
1282
|
-
|
|
1267
|
+
$(k, {
|
|
1283
1268
|
label: v(e)("inventory.closing.form.reference"),
|
|
1284
1269
|
"label-mark": "optional",
|
|
1285
1270
|
modelValue: v(l).ref,
|
|
@@ -1290,7 +1275,7 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
|
|
|
1290
1275
|
_("div", Xt, [
|
|
1291
1276
|
_("div", Qt, [
|
|
1292
1277
|
_("div", Zt, C(v(e)("inventory.closing.form.locations")), 1),
|
|
1293
|
-
|
|
1278
|
+
$(c, {
|
|
1294
1279
|
disabled: n.disabled,
|
|
1295
1280
|
label: v(e)("inventory.closing.form.selectLocation"),
|
|
1296
1281
|
"prepend-icon": "add",
|
|
@@ -1299,9 +1284,9 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
|
|
|
1299
1284
|
onClick: v(f)
|
|
1300
1285
|
}, null, 8, ["disabled", "label", "onClick"])
|
|
1301
1286
|
]),
|
|
1302
|
-
|
|
1303
|
-
"column-defs": v(
|
|
1304
|
-
"row-data": v(
|
|
1287
|
+
$(w, {
|
|
1288
|
+
"column-defs": v(g),
|
|
1289
|
+
"row-data": v(p),
|
|
1305
1290
|
"shrink-at": 9999,
|
|
1306
1291
|
onRowClick: v(f),
|
|
1307
1292
|
"hide-footer": ""
|
|
@@ -1310,7 +1295,7 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
|
|
|
1310
1295
|
_("div", en, [
|
|
1311
1296
|
_("div", tn, [
|
|
1312
1297
|
_("div", nn, C(v(e)("inventory.closing.form.items.title")), 1),
|
|
1313
|
-
|
|
1298
|
+
$(c, {
|
|
1314
1299
|
disabled: n.disabled,
|
|
1315
1300
|
label: v(e)("inventory.closing.form.items.addItem"),
|
|
1316
1301
|
"prepend-icon": "add",
|
|
@@ -1320,7 +1305,7 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
|
|
|
1320
1305
|
size: "md"
|
|
1321
1306
|
}, null, 8, ["disabled", "label"])
|
|
1322
1307
|
]),
|
|
1323
|
-
|
|
1308
|
+
$(k, {
|
|
1324
1309
|
placeholder: "Filter items",
|
|
1325
1310
|
modelValue: m.value,
|
|
1326
1311
|
"onUpdate:modelValue": a[4] || (a[4] = (M) => m.value = M)
|
|
@@ -1328,7 +1313,7 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
|
|
|
1328
1313
|
m.value ? {
|
|
1329
1314
|
name: "append",
|
|
1330
1315
|
fn: P(() => [
|
|
1331
|
-
|
|
1316
|
+
$(h, {
|
|
1332
1317
|
name: "close",
|
|
1333
1318
|
onClick: a[3] || (a[3] = (M) => m.value = ""),
|
|
1334
1319
|
class: "cursor-pointer"
|
|
@@ -1337,21 +1322,21 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
|
|
|
1337
1322
|
key: "0"
|
|
1338
1323
|
} : void 0
|
|
1339
1324
|
]), 1032, ["modelValue"]),
|
|
1340
|
-
(
|
|
1325
|
+
(T(), V(w, {
|
|
1341
1326
|
"search-value": m.value,
|
|
1342
|
-
"column-defs":
|
|
1327
|
+
"column-defs": y.value,
|
|
1343
1328
|
"row-data": v(l).items,
|
|
1344
1329
|
key: v(l).items.map((M) => M.sku._id).join("."),
|
|
1345
1330
|
"hide-footer": v(l).items.length <= 10,
|
|
1346
1331
|
"page-size": Math.min(10, v(l).items.length)
|
|
1347
1332
|
}, {
|
|
1348
1333
|
"list-row": P((M) => [
|
|
1349
|
-
(
|
|
1334
|
+
(T(), V(Ne, {
|
|
1350
1335
|
row: M,
|
|
1351
1336
|
key: v(l).items.map((S) => S.sku._id).join(".")
|
|
1352
1337
|
}, {
|
|
1353
1338
|
default: P((S) => [
|
|
1354
|
-
|
|
1339
|
+
$(Jt, {
|
|
1355
1340
|
row: M,
|
|
1356
1341
|
"cell-by-col-id": S
|
|
1357
1342
|
}, null, 8, ["row", "cell-by-col-id"])
|
|
@@ -1361,7 +1346,7 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
|
|
|
1361
1346
|
]),
|
|
1362
1347
|
_: 1
|
|
1363
1348
|
}, 8, ["search-value", "column-defs", "row-data", "hide-footer", "page-size"])),
|
|
1364
|
-
|
|
1349
|
+
$(x, {
|
|
1365
1350
|
"model-value": v(l).items.length,
|
|
1366
1351
|
rules: [v(rt)(1)]
|
|
1367
1352
|
}, null, 8, ["model-value", "rules"])
|
|
@@ -1379,95 +1364,95 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
|
|
|
1379
1364
|
show: { type: Boolean }
|
|
1380
1365
|
},
|
|
1381
1366
|
emits: ["update:show", "submitted"],
|
|
1382
|
-
setup(
|
|
1383
|
-
var
|
|
1384
|
-
const l =
|
|
1385
|
-
function
|
|
1367
|
+
setup(i, { expose: s, emit: o }) {
|
|
1368
|
+
var w;
|
|
1369
|
+
const l = i, e = o, t = ee(), f = Z(), { t: g } = B(), p = pt(l, "show");
|
|
1370
|
+
function r() {
|
|
1386
1371
|
return {
|
|
1387
1372
|
_id: "",
|
|
1388
1373
|
name: "",
|
|
1389
1374
|
items: []
|
|
1390
1375
|
};
|
|
1391
1376
|
}
|
|
1392
|
-
const
|
|
1377
|
+
const m = D(l.modelValue ?? r()), d = D(((w = l.modelValue) == null ? void 0 : w._id) ?? `${Math.random()}`);
|
|
1393
1378
|
Re(
|
|
1394
1379
|
() => l.show,
|
|
1395
|
-
(
|
|
1396
|
-
var
|
|
1397
|
-
|
|
1380
|
+
(h) => {
|
|
1381
|
+
var x;
|
|
1382
|
+
h && (m.value = l.modelValue ?? r(), d.value = ((x = l.modelValue) == null ? void 0 : x._id) ?? `${Math.random()}`);
|
|
1398
1383
|
}
|
|
1399
1384
|
);
|
|
1400
|
-
const y = D(!1),
|
|
1385
|
+
const y = D(!1), b = A(() => {
|
|
1401
1386
|
switch (l.mode) {
|
|
1402
1387
|
case z.READ:
|
|
1403
1388
|
return "";
|
|
1404
1389
|
case z.CREATE:
|
|
1405
|
-
return
|
|
1390
|
+
return g("inventory.closing.template.create.title");
|
|
1406
1391
|
case z.UPDATE:
|
|
1407
|
-
return
|
|
1392
|
+
return g("inventory.closing.template.update.title");
|
|
1408
1393
|
}
|
|
1409
1394
|
return "";
|
|
1410
1395
|
}), u = D();
|
|
1411
1396
|
s({
|
|
1412
1397
|
validateInputs: () => {
|
|
1413
|
-
var
|
|
1414
|
-
(
|
|
1398
|
+
var h, x;
|
|
1399
|
+
(x = (h = u.value) == null ? void 0 : h.validateInputs) == null || x.call(h);
|
|
1415
1400
|
},
|
|
1416
1401
|
resetInputsValidation: () => {
|
|
1417
|
-
var
|
|
1418
|
-
(
|
|
1402
|
+
var h, x;
|
|
1403
|
+
(x = (h = u.value) == null ? void 0 : h.resetInputsValidation) == null || x.call(h);
|
|
1419
1404
|
},
|
|
1420
1405
|
resetInputs: () => {
|
|
1421
|
-
var
|
|
1422
|
-
(
|
|
1406
|
+
var h, x;
|
|
1407
|
+
(x = (h = u.value) == null ? void 0 : h.resetInputs) == null || x.call(h);
|
|
1423
1408
|
}
|
|
1424
1409
|
});
|
|
1425
1410
|
async function n() {
|
|
1426
|
-
const
|
|
1427
|
-
if (
|
|
1411
|
+
const h = m.value;
|
|
1412
|
+
if (h) {
|
|
1428
1413
|
y.value = !0;
|
|
1429
1414
|
try {
|
|
1430
|
-
await t.createTemplate(
|
|
1431
|
-
title:
|
|
1432
|
-
message:
|
|
1415
|
+
await t.createTemplate(h), await new Promise((x) => setTimeout(x, 1e3)), f.open({
|
|
1416
|
+
title: g("inventory.closing.template.create.success"),
|
|
1417
|
+
message: g("inventory.closing.template.create.successMessage"),
|
|
1433
1418
|
type: "success"
|
|
1434
1419
|
}), e("update:show", !1), e("submitted");
|
|
1435
|
-
} catch (
|
|
1436
|
-
|
|
1437
|
-
title:
|
|
1438
|
-
message:
|
|
1420
|
+
} catch (x) {
|
|
1421
|
+
f.open({
|
|
1422
|
+
title: g("inventory.closing.template.create.error"),
|
|
1423
|
+
message: g("inventory.closing.template.create.errorMessage"),
|
|
1439
1424
|
type: "error"
|
|
1440
|
-
}), console.error("Error in creating closing template",
|
|
1425
|
+
}), console.error("Error in creating closing template", x);
|
|
1441
1426
|
} finally {
|
|
1442
1427
|
y.value = !1;
|
|
1443
1428
|
}
|
|
1444
1429
|
}
|
|
1445
1430
|
}
|
|
1446
1431
|
async function a() {
|
|
1447
|
-
const
|
|
1448
|
-
if (
|
|
1432
|
+
const h = m.value;
|
|
1433
|
+
if (h) {
|
|
1449
1434
|
y.value = !0;
|
|
1450
1435
|
try {
|
|
1451
1436
|
await t.updateTemplate({
|
|
1452
|
-
...
|
|
1453
|
-
_rev:
|
|
1454
|
-
}), await new Promise((
|
|
1455
|
-
title:
|
|
1456
|
-
message:
|
|
1437
|
+
...h,
|
|
1438
|
+
_rev: h._rev ?? ""
|
|
1439
|
+
}), await new Promise((x) => setTimeout(x, 1e3)), f.open({
|
|
1440
|
+
title: g("inventory.closing.template.update.success"),
|
|
1441
|
+
message: g("inventory.closing.template.update.successMessage"),
|
|
1457
1442
|
type: "success"
|
|
1458
1443
|
}), e("update:show", !1), e("submitted");
|
|
1459
|
-
} catch (
|
|
1460
|
-
|
|
1461
|
-
title:
|
|
1462
|
-
message:
|
|
1444
|
+
} catch (x) {
|
|
1445
|
+
f.open({
|
|
1446
|
+
title: g("inventory.closing.template.update.error"),
|
|
1447
|
+
message: g("inventory.closing.template.update.errorMessage"),
|
|
1463
1448
|
type: "error"
|
|
1464
|
-
}), console.error("Error in updating closing template",
|
|
1449
|
+
}), console.error("Error in updating closing template", x);
|
|
1465
1450
|
} finally {
|
|
1466
1451
|
y.value = !1;
|
|
1467
1452
|
}
|
|
1468
1453
|
}
|
|
1469
1454
|
}
|
|
1470
|
-
function
|
|
1455
|
+
function k() {
|
|
1471
1456
|
switch (l.mode) {
|
|
1472
1457
|
case z.CREATE:
|
|
1473
1458
|
return n();
|
|
@@ -1476,47 +1461,47 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
|
|
|
1476
1461
|
}
|
|
1477
1462
|
}
|
|
1478
1463
|
function c() {
|
|
1479
|
-
var
|
|
1480
|
-
(
|
|
1464
|
+
var h, x;
|
|
1465
|
+
(x = (h = u.value) == null ? void 0 : h.validateInputs) == null || x.call(h);
|
|
1481
1466
|
}
|
|
1482
|
-
return (
|
|
1483
|
-
const
|
|
1484
|
-
return
|
|
1467
|
+
return (h, x) => {
|
|
1468
|
+
const E = R("FmButton"), M = R("FmSideSheet");
|
|
1469
|
+
return T(), V(M, {
|
|
1485
1470
|
modelValue: v(p),
|
|
1486
|
-
"onUpdate:modelValue":
|
|
1471
|
+
"onUpdate:modelValue": x[2] || (x[2] = (S) => je(p) ? p.value = S : null),
|
|
1487
1472
|
"dismiss-away": "",
|
|
1488
1473
|
"close-button": "",
|
|
1489
1474
|
"max-width": 800
|
|
1490
1475
|
}, {
|
|
1491
1476
|
"side-sheet-header": P(() => [
|
|
1492
1477
|
_("div", sn, [
|
|
1493
|
-
_("div", ln, C(
|
|
1478
|
+
_("div", ln, C(b.value), 1)
|
|
1494
1479
|
])
|
|
1495
1480
|
]),
|
|
1496
1481
|
default: P(() => [
|
|
1497
|
-
(
|
|
1482
|
+
(T(), V(on, {
|
|
1498
1483
|
class: "w-full",
|
|
1499
1484
|
ref_key: "formRef",
|
|
1500
1485
|
ref: u,
|
|
1501
|
-
onValidationSuccess:
|
|
1502
|
-
"model-value":
|
|
1503
|
-
"onUpdate:modelValue":
|
|
1486
|
+
onValidationSuccess: k,
|
|
1487
|
+
"model-value": m.value,
|
|
1488
|
+
"onUpdate:modelValue": x[0] || (x[0] = (S) => m.value = S),
|
|
1504
1489
|
disabled: y.value,
|
|
1505
|
-
key:
|
|
1490
|
+
key: d.value
|
|
1506
1491
|
}, null, 8, ["model-value", "disabled"]))
|
|
1507
1492
|
]),
|
|
1508
1493
|
"side-sheet-footer": P(() => [
|
|
1509
1494
|
_("div", an, [
|
|
1510
|
-
|
|
1495
|
+
$(E, {
|
|
1511
1496
|
loading: y.value,
|
|
1512
|
-
label: v(
|
|
1497
|
+
label: v(g)("common.save"),
|
|
1513
1498
|
onClick: c
|
|
1514
1499
|
}, null, 8, ["loading", "label"]),
|
|
1515
|
-
|
|
1500
|
+
$(E, {
|
|
1516
1501
|
disabled: y.value,
|
|
1517
1502
|
variant: "tertiary",
|
|
1518
|
-
label: v(
|
|
1519
|
-
onClick:
|
|
1503
|
+
label: v(g)("common.close"),
|
|
1504
|
+
onClick: x[1] || (x[1] = (S) => e("update:show", !1))
|
|
1520
1505
|
}, null, 8, ["disabled", "label"])
|
|
1521
1506
|
])
|
|
1522
1507
|
]),
|
|
@@ -1525,10 +1510,10 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
|
|
|
1525
1510
|
};
|
|
1526
1511
|
}
|
|
1527
1512
|
}), cn = {};
|
|
1528
|
-
function mn(
|
|
1529
|
-
return
|
|
1513
|
+
function mn(i, s) {
|
|
1514
|
+
return T(), I("div");
|
|
1530
1515
|
}
|
|
1531
|
-
const un = /* @__PURE__ */
|
|
1516
|
+
const un = /* @__PURE__ */ it(cn, [["render", mn]]), dn = { class: "flex flex-col gap-40" }, pn = { key: 0 }, fn = {
|
|
1532
1517
|
key: 1,
|
|
1533
1518
|
class: "flex gap-8 items-center"
|
|
1534
1519
|
}, vn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary" }, gn = {
|
|
@@ -1540,8 +1525,8 @@ const un = /* @__PURE__ */ ct(cn, [["render", mn]]), dn = { class: "flex flex-co
|
|
|
1540
1525
|
}, hn = { class: "fm-typo-en-body-md-600" }, bn = { class: "fm-typo-en-body-md-600" }, _n = { key: 4 }, xn = { class: "fm-typo-en-body-md-600" }, wn = { class: "fm-typo-en-body-md-600" }, kn = { class: "flex sm:flex-col xs:flex-col justify-end gap-8 w-full mb-16" }, Tn = /* @__PURE__ */ O({
|
|
1541
1526
|
__name: "ClosingTemplatePublish",
|
|
1542
1527
|
emits: ["close"],
|
|
1543
|
-
setup(
|
|
1544
|
-
const o = D(!1), l = Z(), e = ee(), t = te(), { t:
|
|
1528
|
+
setup(i, { emit: s }) {
|
|
1529
|
+
const o = D(!1), l = Z(), e = ee(), t = te(), { t: f } = B(), g = s;
|
|
1545
1530
|
async function p() {
|
|
1546
1531
|
o.value = !0;
|
|
1547
1532
|
try {
|
|
@@ -1549,7 +1534,7 @@ const un = /* @__PURE__ */ ct(cn, [["render", mn]]), dn = { class: "flex flex-co
|
|
|
1549
1534
|
title: "Success",
|
|
1550
1535
|
message: "You may refresh after a while to review publish status",
|
|
1551
1536
|
type: "success"
|
|
1552
|
-
}),
|
|
1537
|
+
}), d();
|
|
1553
1538
|
} catch (y) {
|
|
1554
1539
|
l.open({
|
|
1555
1540
|
title: "Something went wrong",
|
|
@@ -1560,83 +1545,83 @@ const un = /* @__PURE__ */ ct(cn, [["render", mn]]), dn = { class: "flex flex-co
|
|
|
1560
1545
|
o.value = !1;
|
|
1561
1546
|
}
|
|
1562
1547
|
}
|
|
1563
|
-
const
|
|
1564
|
-
() => t.templates.length && (!
|
|
1548
|
+
const r = A(() => t.recentPublish.recentJob), m = A(
|
|
1549
|
+
() => t.templates.length && (!r.value || r.value.outlets.length === r.value.completed.length)
|
|
1565
1550
|
);
|
|
1566
|
-
function
|
|
1567
|
-
|
|
1551
|
+
function d() {
|
|
1552
|
+
g("close");
|
|
1568
1553
|
}
|
|
1569
|
-
return (y,
|
|
1554
|
+
return (y, b) => {
|
|
1570
1555
|
const u = R("FmCircularProgress"), n = R("i18n-t"), a = R("FmButton");
|
|
1571
|
-
return
|
|
1572
|
-
v(t).templates.length ? o.value ? (
|
|
1556
|
+
return T(), I("div", dn, [
|
|
1557
|
+
v(t).templates.length ? o.value ? (T(), I("div", fn, [
|
|
1573
1558
|
_("div", null, [
|
|
1574
|
-
|
|
1559
|
+
$(u, {
|
|
1575
1560
|
size: "md",
|
|
1576
1561
|
color: "neutral-gray-300"
|
|
1577
1562
|
})
|
|
1578
1563
|
]),
|
|
1579
1564
|
_("div", vn, [
|
|
1580
|
-
_("span", null, C(v(
|
|
1565
|
+
_("span", null, C(v(f)("inventory.closing.template.publish.publishing")), 1)
|
|
1581
1566
|
])
|
|
1582
|
-
])) :
|
|
1583
|
-
|
|
1567
|
+
])) : r.value ? r.value.outlets.length === r.value.completed.length ? (T(), I("div", yn, [
|
|
1568
|
+
$(n, {
|
|
1584
1569
|
keypath: "inventory.closing.template.publish.recentlyPublishedAt",
|
|
1585
1570
|
tag: "p"
|
|
1586
1571
|
}, {
|
|
1587
1572
|
started: P(() => [
|
|
1588
|
-
_("span", hn, C(v(ne)(new Date(
|
|
1573
|
+
_("span", hn, C(v(ne)(new Date(r.value.createdAt))), 1)
|
|
1589
1574
|
]),
|
|
1590
1575
|
finished: P(() => [
|
|
1591
|
-
_("span", bn, C(v(ne)(new Date(
|
|
1576
|
+
_("span", bn, C(v(ne)(new Date(r.value.updatedAt))), 1)
|
|
1592
1577
|
]),
|
|
1593
1578
|
_: 1
|
|
1594
1579
|
}),
|
|
1595
|
-
_("p", null, C(v(
|
|
1596
|
-
])) : (
|
|
1597
|
-
|
|
1580
|
+
_("p", null, C(v(f)("inventory.closing.template.publish.message")), 1)
|
|
1581
|
+
])) : (T(), I("div", _n, [
|
|
1582
|
+
$(n, {
|
|
1598
1583
|
keypath: "inventory.closing.template.publish.stillPublishing",
|
|
1599
1584
|
tag: "p"
|
|
1600
1585
|
}, {
|
|
1601
1586
|
started: P(() => [
|
|
1602
|
-
_("span", xn, C(v(ne)(new Date(
|
|
1587
|
+
_("span", xn, C(v(ne)(new Date(r.value.createdAt))), 1)
|
|
1603
1588
|
]),
|
|
1604
1589
|
progress: P(() => [
|
|
1605
|
-
_("span", wn, " (" + C(
|
|
1590
|
+
_("span", wn, " (" + C(r.value.completed.length) + "/" + C(r.value.outlets.length) + " completed) ", 1)
|
|
1606
1591
|
]),
|
|
1607
1592
|
_: 1
|
|
1608
1593
|
}),
|
|
1609
|
-
Fe(" Your recent publishing task is still pending (" + C(
|
|
1610
|
-
])) : (
|
|
1611
|
-
_("p", null, C(v(
|
|
1612
|
-
_("p", null, C(v(
|
|
1613
|
-
])) : (
|
|
1614
|
-
_("p", null, C(v(
|
|
1594
|
+
Fe(" Your recent publishing task is still pending (" + C(r.value.completed.length) + " / " + C(r.value.outlets.length) + "). Please wait until all publishing task has completed. ", 1)
|
|
1595
|
+
])) : (T(), I("div", gn, [
|
|
1596
|
+
_("p", null, C(v(f)("inventory.closing.template.publish.noRecentActivity")), 1),
|
|
1597
|
+
_("p", null, C(v(f)("inventory.closing.template.publish.message")), 1)
|
|
1598
|
+
])) : (T(), I("div", pn, [
|
|
1599
|
+
_("p", null, C(v(f)("inventory.closing.template.publish.nothingToPublish")), 1)
|
|
1615
1600
|
])),
|
|
1616
1601
|
_("div", kn, [
|
|
1617
|
-
|
|
1618
|
-
disabled: !
|
|
1602
|
+
$(a, {
|
|
1603
|
+
disabled: !m.value,
|
|
1619
1604
|
loading: o.value,
|
|
1620
1605
|
label: "Publish to all outlets",
|
|
1621
1606
|
onClick: p
|
|
1622
1607
|
}, null, 8, ["disabled", "loading"]),
|
|
1623
|
-
|
|
1608
|
+
$(a, {
|
|
1624
1609
|
variant: "tertiary",
|
|
1625
1610
|
label: "Close",
|
|
1626
|
-
onClick:
|
|
1611
|
+
onClick: d
|
|
1627
1612
|
})
|
|
1628
1613
|
])
|
|
1629
1614
|
]);
|
|
1630
1615
|
};
|
|
1631
1616
|
}
|
|
1632
|
-
}), $n = { class: "flex-1 flex flex-col gap-8" }, Cn = { class: "flex flex-col" }, In = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Sn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Dn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, Mn = { class: "fm-typo-en-body-lg-400 line-clamp-2" },
|
|
1617
|
+
}), $n = { class: "flex-1 flex flex-col gap-8" }, Cn = { class: "flex flex-col" }, In = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Sn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Dn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, Mn = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, Vn = /* @__PURE__ */ O({
|
|
1633
1618
|
__name: "ClosingTemplateView",
|
|
1634
|
-
setup(
|
|
1635
|
-
const { t: s } = B(), { createTemplate: o, updateTemplate: l, exportTemplates: e, importTemplates: t } = se(), { templateDialogProps:
|
|
1636
|
-
p.watchLocation(
|
|
1637
|
-
const
|
|
1638
|
-
function x
|
|
1639
|
-
switch (
|
|
1619
|
+
setup(i) {
|
|
1620
|
+
const { t: s } = B(), { createTemplate: o, updateTemplate: l, exportTemplates: e, importTemplates: t } = se(), { templateDialogProps: f, templateDetailsProps: g } = Le(se()), p = le(), r = ie(), m = te(), d = ct(), { breakpoints: y } = ft();
|
|
1621
|
+
p.watchLocation(m.fetchTemplates);
|
|
1622
|
+
const b = A(() => m.loading), u = D(""), n = A(() => y.value.xs || y.value.sm), a = A(() => n.value ? 10 : 20);
|
|
1623
|
+
function k(x) {
|
|
1624
|
+
switch (x) {
|
|
1640
1625
|
case N.Add:
|
|
1641
1626
|
return o();
|
|
1642
1627
|
case "publish":
|
|
@@ -1646,24 +1631,24 @@ const un = /* @__PURE__ */ ct(cn, [["render", mn]]), dn = { class: "flex flex-co
|
|
|
1646
1631
|
case "export":
|
|
1647
1632
|
return e();
|
|
1648
1633
|
case "refresh":
|
|
1649
|
-
return
|
|
1634
|
+
return m.fetchTemplates();
|
|
1650
1635
|
}
|
|
1651
1636
|
}
|
|
1652
1637
|
function c() {
|
|
1653
|
-
|
|
1638
|
+
r.open({
|
|
1654
1639
|
title: "Publish closing templates",
|
|
1655
1640
|
contentComponent: Tn,
|
|
1656
1641
|
contentComponentProps: {
|
|
1657
1642
|
onClose() {
|
|
1658
|
-
|
|
1643
|
+
r.close();
|
|
1659
1644
|
}
|
|
1660
1645
|
}
|
|
1661
1646
|
});
|
|
1662
1647
|
}
|
|
1663
|
-
function
|
|
1664
|
-
return
|
|
1648
|
+
function w(x) {
|
|
1649
|
+
return x;
|
|
1665
1650
|
}
|
|
1666
|
-
const
|
|
1651
|
+
const h = A(() => n.value ? [
|
|
1667
1652
|
{
|
|
1668
1653
|
label: s("inventory.closing.template.create.title"),
|
|
1669
1654
|
value: N.Add,
|
|
@@ -1718,13 +1703,13 @@ const un = /* @__PURE__ */ ct(cn, [["render", mn]]), dn = { class: "flex flex-co
|
|
|
1718
1703
|
isPrimary: !1
|
|
1719
1704
|
}
|
|
1720
1705
|
]);
|
|
1721
|
-
return (
|
|
1706
|
+
return (x, E) => {
|
|
1722
1707
|
const M = R("FmTable");
|
|
1723
|
-
return
|
|
1724
|
-
|
|
1708
|
+
return T(), I(H, null, [
|
|
1709
|
+
$(mt, {
|
|
1725
1710
|
title: v(s)("inventory.closing.template.title"),
|
|
1726
|
-
actions:
|
|
1727
|
-
"onClick:action":
|
|
1711
|
+
actions: h.value,
|
|
1712
|
+
"onClick:action": k
|
|
1728
1713
|
}, {
|
|
1729
1714
|
default: P(() => [
|
|
1730
1715
|
_("div", {
|
|
@@ -1736,22 +1721,22 @@ const un = /* @__PURE__ */ ct(cn, [["render", mn]]), dn = { class: "flex flex-co
|
|
|
1736
1721
|
}
|
|
1737
1722
|
])
|
|
1738
1723
|
}, [
|
|
1739
|
-
|
|
1724
|
+
$(ut, {
|
|
1740
1725
|
searchable: "",
|
|
1741
1726
|
search: u.value,
|
|
1742
|
-
"onUpdate:search":
|
|
1727
|
+
"onUpdate:search": E[0] || (E[0] = (S) => u.value = S)
|
|
1743
1728
|
}, null, 8, ["search"]),
|
|
1744
|
-
|
|
1745
|
-
style: Ye(v(
|
|
1746
|
-
"column-defs": v(
|
|
1747
|
-
"row-data": v(
|
|
1729
|
+
$(M, {
|
|
1730
|
+
style: Ye(v(d).tableHeight),
|
|
1731
|
+
"column-defs": v(m).columnDefs,
|
|
1732
|
+
"row-data": v(m).templates,
|
|
1748
1733
|
"search-value": u.value,
|
|
1749
|
-
loading:
|
|
1750
|
-
onRowClick:
|
|
1734
|
+
loading: b.value,
|
|
1735
|
+
onRowClick: E[1] || (E[1] = (S) => v(l)(S.original)),
|
|
1751
1736
|
"page-size": a.value
|
|
1752
1737
|
}, {
|
|
1753
1738
|
"list-row": P((S) => [
|
|
1754
|
-
|
|
1739
|
+
$(Ne, {
|
|
1755
1740
|
row: S,
|
|
1756
1741
|
onRowClick: (U) => v(l)(U)
|
|
1757
1742
|
}, {
|
|
@@ -1761,13 +1746,13 @@ const un = /* @__PURE__ */ ct(cn, [["render", mn]]), dn = { class: "flex flex-co
|
|
|
1761
1746
|
_("div", $n, [
|
|
1762
1747
|
_("div", Cn, [
|
|
1763
1748
|
_("div", In, [
|
|
1764
|
-
|
|
1749
|
+
$(v(j), {
|
|
1765
1750
|
render: (de = (ue = (me = U._id) == null ? void 0 : me.column) == null ? void 0 : ue.columnDef) == null ? void 0 : de.cell,
|
|
1766
1751
|
props: (pe = (W = U._id) == null ? void 0 : W.getContext) == null ? void 0 : pe.call(W)
|
|
1767
1752
|
}, null, 8, ["render", "props"])
|
|
1768
1753
|
]),
|
|
1769
1754
|
_("div", Sn, [
|
|
1770
|
-
|
|
1755
|
+
$(v(j), {
|
|
1771
1756
|
render: (ge = (ve = (fe = U.name) == null ? void 0 : fe.column) == null ? void 0 : ve.columnDef) == null ? void 0 : ge.cell,
|
|
1772
1757
|
props: (ye = (q = U.name) == null ? void 0 : q.getContext) == null ? void 0 : ye.call(q)
|
|
1773
1758
|
}, null, 8, ["render", "props"])
|
|
@@ -1780,14 +1765,14 @@ const un = /* @__PURE__ */ ct(cn, [["render", mn]]), dn = { class: "flex flex-co
|
|
|
1780
1765
|
...S.original.items.length >= 3 ? [`and ${S.original.items.length - 3} more items`] : []
|
|
1781
1766
|
].join(", ")), 1),
|
|
1782
1767
|
_("div", Mn, [
|
|
1783
|
-
|
|
1768
|
+
$(v(j), {
|
|
1784
1769
|
render: (we = (xe = (_e = U.ref) == null ? void 0 : _e.column) == null ? void 0 : xe.columnDef) == null ? void 0 : we.cell,
|
|
1785
1770
|
props: (ke = (X = U.ref) == null ? void 0 : X.getContext) == null ? void 0 : ke.call(X)
|
|
1786
1771
|
}, null, 8, ["render", "props"])
|
|
1787
1772
|
])
|
|
1788
1773
|
]),
|
|
1789
1774
|
_("div", null, [
|
|
1790
|
-
|
|
1775
|
+
$(v(j), {
|
|
1791
1776
|
render: (Ce = ($e = (Te = U.status) == null ? void 0 : Te.column) == null ? void 0 : $e.columnDef) == null ? void 0 : Ce.cell,
|
|
1792
1777
|
props: (Ie = (Q = U.status) == null ? void 0 : Q.getContext) == null ? void 0 : Ie.call(Q)
|
|
1793
1778
|
}, null, 8, ["render", "props"])
|
|
@@ -1804,10 +1789,10 @@ const un = /* @__PURE__ */ ct(cn, [["render", mn]]), dn = { class: "flex flex-co
|
|
|
1804
1789
|
]),
|
|
1805
1790
|
_: 1
|
|
1806
1791
|
}, 8, ["title", "actions"]),
|
|
1807
|
-
(
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
onSubmitted:
|
|
1792
|
+
(T(), V(Ge, { to: "body" }, [
|
|
1793
|
+
$(un, Ke(Je(v(g))), null, 16),
|
|
1794
|
+
$(rn, We(v(f), {
|
|
1795
|
+
onSubmitted: E[2] || (E[2] = (S) => v(m).fetchTemplates())
|
|
1811
1796
|
}), null, 16)
|
|
1812
1797
|
]))
|
|
1813
1798
|
], 64);
|
|
@@ -1815,5 +1800,5 @@ const un = /* @__PURE__ */ ct(cn, [["render", mn]]), dn = { class: "flex flex-co
|
|
|
1815
1800
|
}
|
|
1816
1801
|
});
|
|
1817
1802
|
export {
|
|
1818
|
-
|
|
1803
|
+
Vn as default
|
|
1819
1804
|
};
|