@feedmepos/mf-inventory-portal 1.6.0-dev.6 → 1.6.0
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-Di8cQoKT.js → App-EFQddl2W.js} +4 -4
- package/dist/{ApprovalView-qM9i8hVq.js → ApprovalView-DQG8Ti9p.js} +7 -7
- package/dist/{BindingsDialog-BZAGYZXv.js → BindingsDialog-D2IwJvme.js} +2 -2
- package/dist/{BindingsPicker-Dxv8-E41.js → BindingsPicker-ZGbgh9Vk.js} +2 -2
- package/dist/{BindingsTable-Av0a-FDQ.js → BindingsTable-Dgs2Od1_.js} +3 -3
- package/dist/{ClosingDraftView-BFJ4IBqb.js → ClosingDraftView-DGz2x5Lp.js} +1589 -1587
- package/dist/{ClosingHistoryView-BT-VDKmv.js → ClosingHistoryView-SvbQFffP.js} +5 -5
- package/dist/{ClosingTemplateView-DdE94MR4.js → ClosingTemplateView-LIyUAZ7a.js} +649 -633
- package/dist/{DefaultView-BgoUI3tD.js → DefaultView-B96qddHF.js} +2 -2
- package/dist/{DeliveryOrderPrintPreview-BdTL2m9C.js → DeliveryOrderPrintPreview-DWQ6hyoL.js} +2 -2
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DYB-uCRa.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BfRdyxp5.js} +2 -2
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DcM6xetz.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang--A4q92Mt.js} +2 -2
- package/dist/{FmMultiselectDialog-Ejv58jEW.js → FmMultiselectDialog-B1O653NS.js} +2 -2
- package/dist/{FmMultiselectDialog-BND4jAye.js → FmMultiselectDialog-SDMUzTex.js} +1 -1
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-DHy5OLee.js → FmUnitInput.vue_vue_type_script_setup_true_lang-D8u2M7r1.js} +5 -5
- package/dist/{ImportView-B53g06tS.js → ImportView-BSlnGvlm.js} +6 -6
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-D1RFIkGm.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-DaihxdpF.js} +1 -1
- package/dist/{IngredientGroupView-DlVQL7q9.js → IngredientGroupView-Dy1fLXHf.js} +5 -5
- package/dist/{IngredientsView-CnlcPJOS.js → IngredientsView-Dno8kdrq.js} +15 -15
- package/dist/{IntegrationExplorerView-isFlGe0Z.js → IntegrationExplorerView-C_5XKtMn.js} +352 -352
- package/dist/{IntegrationView-jLnGwPAe.js → IntegrationView-D2_2A1ve.js} +13 -13
- package/dist/{InventoryBindingForm-Bz1iNKVE.js → InventoryBindingForm-YQFbS1hV.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-usQ8ZPbn.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-CMXe46hm.js} +5 -5
- package/dist/{InventoryBindingSummary-DZyoeLau.js → InventoryBindingSummary-DQEoKMWr.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-NkzVPQq_.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CcJ7YBY5.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-DAXEWYd4.js → PremiumBadge.vue_vue_type_script_setup_true_lang-DdTdixxy.js} +1 -1
- package/dist/{PublishView-DDK-PSH_.js → PublishView-Cv8penOo.js} +3 -3
- package/dist/{PurchaseOrderPrintPreview-CUby20Ms.js → PurchaseOrderPrintPreview-BvbaFNpc.js} +2 -2
- package/dist/{ReceiveRequestView-830tKUWt.js → ReceiveRequestView-BP7KFzO6.js} +36 -34
- package/dist/{RecipeView-CMKwkmte.js → RecipeView-DU0QKiC9.js} +17 -17
- package/dist/{SettingsView-DttG-rgv.js → SettingsView-DYNFioZF.js} +4 -4
- package/dist/{StockView-BSLKtOO-.js → StockView-CzdVLGZy.js} +19 -19
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Cn967MK-.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DyDTSy_F.js} +1 -1
- package/dist/{SupplierView-C0ZwULLi.js → SupplierView-BxbGPyPv.js} +12 -12
- package/dist/{SurchargeView-LWasGLSm.js → SurchargeView-DIxfUVfT.js} +6 -6
- package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-BrK8u3nO.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-g0AfgEFk.js} +2 -2
- package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-DvVDeHjR.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-DsLOwuNG.js} +1 -1
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-DcllUuxg.js → TransferDetails.vue_vue_type_script_setup_true_lang-CxVlssDF.js} +155 -155
- package/dist/{TransferTemplateView-CCVrzVkT.js → TransferTemplateView-DRqghp1v.js} +20 -20
- package/dist/{UnitCostHistoryView-DFJJ2u8P.js → UnitCostHistoryView-BCQDTDOB.js} +4 -4
- package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-DdzpfKGK.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-BikZCEmA.js} +5 -5
- package/dist/{UnitView-BcYQKL84.js → UnitView-BXoXHqYc.js} +7 -7
- package/dist/{WarehouseView-kNgPHyAP.js → WarehouseView-DtnB7VJj.js} +5 -5
- package/dist/{WastageTemplateView-e0F6dinm.js → WastageTemplateView-SNpTF3AP.js} +14 -14
- package/dist/{app-DK2wDdRG.js → app-DTBAhC9s.js} +127 -118
- package/dist/app.js +1 -1
- package/dist/{closing-template-C1Ag3g2s.js → closing-template-DBDqx2IR.js} +1 -1
- package/dist/{date2-DdWkOefy.js → date2-BD3_Vr8I.js} +1 -1
- package/dist/{dayjs.min-DKWqZGj8.js → dayjs.min-CGyhCaEH.js} +1 -1
- package/dist/{decimal-jEQmohI0.js → decimal-CnReZARa.js} +2 -2
- package/dist/{defineDeepModel-DEeVL0NT.js → defineDeepModel-BCBQ-V52.js} +1 -1
- package/dist/{duplicate-template-B0a9h4uA.js → duplicate-template-Dpb2sb-q.js} +1 -1
- package/dist/{feature-DujhKQag.js → feature-BACkglr0.js} +2 -2
- package/dist/{format-time-from-id-BpRp_X3u.js → format-time-from-id-CxJLjrBT.js} +1 -1
- package/dist/{format-unit-display-Da8nKxPz.js → format-unit-display-BUfzwU3m.js} +12 -12
- package/dist/{import-export.helper-CYJq22cJ.js → import-export.helper-DttYDeho.js} +6 -6
- package/dist/{index-Bs2DT0wF.js → index-BY8NVCx7.js} +1 -1
- package/dist/{index-B31v4NEs.js → index-DGxWBGVv.js} +1 -1
- package/dist/{index-D15BT7xz.js → index-tFtJuoxA.js} +3 -3
- package/dist/{inventory-core-dart.default-D4osjzlQ.js → inventory-core-dart.default-DIKTKc_1.js} +784 -667
- package/dist/{lz-string-BT82cfCK.js → lz-string-CwPU-SlY.js} +1 -1
- package/dist/{netsuite-ZHiikF8a.js → netsuite-B9XrL1RC.js} +2 -2
- package/dist/{number-C6NSIT1m.js → number-DKjrPhev.js} +3 -3
- package/dist/{predefined-templates-DT6cIOQR.js → predefined-templates-CQvQIvR-.js} +1 -1
- package/dist/{purchase-order-template-D50dAJ8R.js → purchase-order-template-NA3Qn9lf.js} +1 -1
- package/dist/{recalculationUtils-7X6ayoRM.js → recalculationUtils-Ll9Jy0C-.js} +1 -1
- package/dist/{rules-Z9cYF33Y.js → rules-DtBEn-Rn.js} +2 -2
- package/dist/{stock-DW2d568F.js → stock-PIkXqbIP.js} +1 -1
- package/dist/{supplier-suSJz_Tj.js → supplier-B5LWMrcL.js} +2 -2
- package/dist/{surcharge-CmFdExzO.js → surcharge-C8PXRjfJ.js} +1 -1
- package/dist/{uom-rules-C_FGDepb.js → uom-rules-DddX9wN4.js} +1 -1
- package/dist/{use-ingredient-select-dialog-DDPAb2_X.js → use-ingredient-select-dialog-DWQxhfQD.js} +2 -2
- package/dist/{use-inventory-binding-dialog-BNwhsOA9.js → use-inventory-binding-dialog-BWSMrzp1.js} +2 -2
- package/dist/{use-template-enabled-locations-Dm14AOSo.js → use-template-enabled-locations-3DN8aZBs.js} +2 -2
- package/dist/{use-transfer-locations-BzLayMl_.js → use-transfer-locations-DnybeRXF.js} +2 -2
- package/dist/{useHrmPermission-DG3KUc2c.js → useHrmPermission-ymQe-N7i.js} +1 -1
- package/dist/{useNavigationMenu-Dp-MvtBY.js → useNavigationMenu-D88-0QxA.js} +2 -2
- package/dist/{useSseClient-IEGNBVKr.js → useSseClient-CWNMcLEX.js} +3 -3
- package/dist/{vue-i18n-DsC8R5FR.js → vue-i18n-D7c0eqQP.js} +390 -390
- package/dist/{xlsx-QxeFuAXt.js → xlsx-DXHnJflt.js} +1 -1
- package/dist/{xlsx.util-CarycIPW.js → xlsx.util-PhY8wVQG.js} +3 -3
- package/package.json +4 -4
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { ref as N, h as $e, defineComponent as
|
|
2
|
-
import { u as
|
|
3
|
-
import { useI18n as
|
|
4
|
-
import { useDialog as _e, useDialogChild as
|
|
1
|
+
import { ref as N, h as $e, defineComponent as Q, resolveComponent as E, openBlock as k, createElementBlock as D, createElementVNode as i, normalizeClass as oe, createTextVNode as X, toDisplayString as A, unref as x, createCommentVNode as G, createVNode as R, withCtx as z, Fragment as O, renderList as J, computed as U, watch as Fe, createSlots as je, createBlock as K, createStaticVNode as Ye, normalizeStyle as Te, withModifiers as pe, isRef as Ke, Teleport as We, normalizeProps as qe, guardReactiveProps as Je, mergeProps as Xe } from "vue";
|
|
2
|
+
import { u as Qe, _ as Ze } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DGlWE5I8.js";
|
|
3
|
+
import { useI18n as ne, useCoreStore as Ce } from "@feedmepos/mf-common";
|
|
4
|
+
import { useDialog as _e, useDialogChild as et, useSnackbar as xe, FmButtonVariant as fe, components as tt, useProxiedModel as ot, useBreakpoints as nt } from "@feedmepos/ui-library";
|
|
5
5
|
import { defineStore as Be, storeToRefs as Ne } from "pinia";
|
|
6
|
-
import { F as
|
|
7
|
-
import { a as we } from "./closing-template-
|
|
8
|
-
import { u as Ie, c as Ue, a as De, l as
|
|
9
|
-
import { t as be, a as Se, d as Ae, s as Le, r as
|
|
10
|
-
import { F as
|
|
11
|
-
import { f as Ve, a as ge } from "./date2-
|
|
6
|
+
import { F as te } from "./form-mode.enum-BKiNVH6A.js";
|
|
7
|
+
import { a as we } from "./closing-template-DBDqx2IR.js";
|
|
8
|
+
import { u as Ie, c as Ue, a as De, l as st } from "./app-DTBAhC9s.js";
|
|
9
|
+
import { t as be, a as Se, d as Ae, s as Le, r as at } from "./xlsx.util-PhY8wVQG.js";
|
|
10
|
+
import { F as lt } from "./FmDroppableField-J0xUsOTV.js";
|
|
11
|
+
import { f as Ve, a as ge } from "./date2-BD3_Vr8I.js";
|
|
12
12
|
import { D as ye, R as Y } from "./row-action.enum-DQ9bJ_uv.js";
|
|
13
|
-
import { c as
|
|
14
|
-
import { f as
|
|
15
|
-
import { _ as
|
|
16
|
-
import { u as
|
|
17
|
-
import { u as
|
|
18
|
-
import { _ as
|
|
19
|
-
import { R as
|
|
20
|
-
import { u as ze } from "./use-ingredient-select-dialog-
|
|
21
|
-
import { d as
|
|
22
|
-
import { u as
|
|
23
|
-
import { _ as
|
|
24
|
-
import { _ as
|
|
25
|
-
import { _ as
|
|
13
|
+
import { c as rt } from "./component-kqxARxvM.js";
|
|
14
|
+
import { f as it } from "./format-time-from-id-CxJLjrBT.js";
|
|
15
|
+
import { _ as ct } from "./TemplatePublishDialog.vue_vue_type_script_setup_true_lang-DsLOwuNG.js";
|
|
16
|
+
import { u as mt } from "./netsuite-B9XrL1RC.js";
|
|
17
|
+
import { u as dt } from "./duplicate-template-Dpb2sb-q.js";
|
|
18
|
+
import { _ as ut } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang--A4q92Mt.js";
|
|
19
|
+
import { R as pt, A as ft } from "./rules-DtBEn-Rn.js";
|
|
20
|
+
import { u as ze } from "./use-ingredient-select-dialog-DWQxhfQD.js";
|
|
21
|
+
import { d as yt } from "./defineDeepModel-BCBQ-V52.js";
|
|
22
|
+
import { u as vt } from "./use-template-enabled-locations-3DN8aZBs.js";
|
|
23
|
+
import { _ as gt } from "./SystemTrailDialog.vue_vue_type_script_setup_true_lang-g0AfgEFk.js";
|
|
24
|
+
import { _ as bt, F as ve } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-Ca_eYa8-.js";
|
|
25
|
+
import { _ as ht } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
26
26
|
const ke = Be(
|
|
27
27
|
"closingTemplateTable",
|
|
28
28
|
function() {
|
|
29
|
-
const { t: o } =
|
|
29
|
+
const { t: o } = ne(), t = _e(), g = N({}), r = he(), f = N({}), b = N(new Array()), u = N(!1), a = Ie(), s = we();
|
|
30
30
|
function w(l) {
|
|
31
31
|
const n = {
|
|
32
32
|
title: l.name,
|
|
@@ -35,35 +35,35 @@ const ke = Be(
|
|
|
35
35
|
publishAll: async (y) => {
|
|
36
36
|
const e = y || l.locations, _ = await s.publishSingleDoc(
|
|
37
37
|
l._id,
|
|
38
|
-
e == null ? void 0 : e.map((
|
|
38
|
+
e == null ? void 0 : e.map((F) => F.dbName)
|
|
39
39
|
);
|
|
40
|
-
return
|
|
40
|
+
return g.value = _.publishedRevByLocation || {}, g.value;
|
|
41
41
|
},
|
|
42
42
|
publishAtLocation: async (y) => {
|
|
43
43
|
const e = await s.publishSingleDoc(l._id, [y.dbName]);
|
|
44
|
-
return
|
|
44
|
+
return g.value = e.publishedRevByLocation || {}, g.value;
|
|
45
45
|
},
|
|
46
46
|
unpublishAll: async (y) => {
|
|
47
47
|
const e = y || l.locations, _ = await s.unpublishSingleDoc(
|
|
48
48
|
l._id,
|
|
49
|
-
e == null ? void 0 : e.map((
|
|
49
|
+
e == null ? void 0 : e.map((F) => F.dbName)
|
|
50
50
|
);
|
|
51
|
-
return
|
|
51
|
+
return g.value = _.publishedRevByLocation || {}, g.value;
|
|
52
52
|
},
|
|
53
53
|
unpublishAtLocation: async (y) => {
|
|
54
54
|
const e = await s.unpublishSingleDoc(l._id, [
|
|
55
55
|
y.dbName
|
|
56
56
|
]);
|
|
57
|
-
return
|
|
57
|
+
return g.value = e.publishedRevByLocation || {}, g.value;
|
|
58
58
|
}
|
|
59
59
|
},
|
|
60
|
-
initialPublishedRev:
|
|
60
|
+
initialPublishedRev: g.value,
|
|
61
61
|
locations: a.locations,
|
|
62
62
|
enabledLocations: l.locations
|
|
63
63
|
};
|
|
64
64
|
t.open({
|
|
65
65
|
title: "Publish template",
|
|
66
|
-
contentComponent:
|
|
66
|
+
contentComponent: ct,
|
|
67
67
|
contentComponentProps: n,
|
|
68
68
|
closeButton: !0,
|
|
69
69
|
minWidth: 700,
|
|
@@ -77,50 +77,50 @@ const ke = Be(
|
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
79
|
async function p() {
|
|
80
|
-
if (
|
|
81
|
-
|
|
80
|
+
if (b.value = [], !!a._currentLocation) {
|
|
81
|
+
u.value = !0;
|
|
82
82
|
try {
|
|
83
83
|
const [l, n, y] = await Promise.all([
|
|
84
84
|
s.readTemplates(),
|
|
85
85
|
s.getRecentPublishingJob(),
|
|
86
86
|
s.getRecentPublishInfo()
|
|
87
87
|
]).delayed(1e3);
|
|
88
|
-
|
|
88
|
+
b.value = l, f.value = n, g.value = y.publishedRevByLocation || {};
|
|
89
89
|
} catch (l) {
|
|
90
90
|
console.log("Something went wrong when fetching templates:", l);
|
|
91
91
|
} finally {
|
|
92
|
-
|
|
92
|
+
u.value = !1;
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
async function I(l) {
|
|
97
|
-
if (!
|
|
98
|
-
|
|
97
|
+
if (!b.value.find((n) => n._id) && a._currentLocation) {
|
|
98
|
+
u.value = !0;
|
|
99
99
|
try {
|
|
100
100
|
const [n] = await Promise.all([
|
|
101
101
|
s.getTemplate(l),
|
|
102
102
|
new Promise((y) => setTimeout(y, 1e3))
|
|
103
103
|
]);
|
|
104
|
-
|
|
104
|
+
b.value = [n];
|
|
105
105
|
} catch (n) {
|
|
106
106
|
console.log("Something went wrong when fetching templates:", n);
|
|
107
107
|
} finally {
|
|
108
|
-
|
|
108
|
+
u.value = !1;
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
|
-
function
|
|
112
|
+
function T(l, n) {
|
|
113
113
|
switch (n = Ue(n), l) {
|
|
114
114
|
case Y.Details:
|
|
115
115
|
return r.viewTemplate(n);
|
|
116
116
|
case Y.Edit:
|
|
117
117
|
return r.updateTemplate(n);
|
|
118
118
|
case Y.Delete:
|
|
119
|
-
return r.deleteTemplate(n,
|
|
119
|
+
return r.deleteTemplate(n, u, p);
|
|
120
120
|
case Y.Publish:
|
|
121
121
|
return w(n);
|
|
122
122
|
case Y.Duplicate:
|
|
123
|
-
return r.duplicateTemplate(n,
|
|
123
|
+
return r.duplicateTemplate(n, u, p);
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
126
|
return {
|
|
@@ -130,7 +130,7 @@ const ke = Be(
|
|
|
130
130
|
accessorKey: "_id",
|
|
131
131
|
header: () => o("inventory.closing.table.createdAt"),
|
|
132
132
|
cell(l) {
|
|
133
|
-
return
|
|
133
|
+
return it(`${l.getValue()}`);
|
|
134
134
|
},
|
|
135
135
|
enableSorting: !0
|
|
136
136
|
},
|
|
@@ -178,9 +178,9 @@ const ke = Be(
|
|
|
178
178
|
header: () => o("inventory.adjustment.template.table.status"),
|
|
179
179
|
enableSorting: !1,
|
|
180
180
|
cell(l) {
|
|
181
|
-
const n = l.row.original, e = (l.row.original.locations || a.locations).filter((S) => !!a.locationByDbName[S.dbName]), _ = e.filter((S) => !!(
|
|
181
|
+
const n = l.row.original, e = (l.row.original.locations || a.locations).filter((S) => !!a.locationByDbName[S.dbName]), _ = e.filter((S) => !!(g.value[S.dbName] || []).find(
|
|
182
182
|
($) => $._id === n._id && ($.updatedAt ? $.updatedAt === n.updatedAt : $._rev === n._rev)
|
|
183
|
-
)).length,
|
|
183
|
+
)).length, F = e.length > 0 && _ === e.length;
|
|
184
184
|
return $e(
|
|
185
185
|
"div",
|
|
186
186
|
{
|
|
@@ -191,10 +191,10 @@ const ke = Be(
|
|
|
191
191
|
{
|
|
192
192
|
class: [
|
|
193
193
|
"fm-status-badge",
|
|
194
|
-
|
|
194
|
+
F ? "fm-status-badge-success-secondary" : "fm-status-badge-info-secondary"
|
|
195
195
|
]
|
|
196
196
|
},
|
|
197
|
-
|
|
197
|
+
F ? "Published" : "Unpublished"
|
|
198
198
|
)
|
|
199
199
|
);
|
|
200
200
|
}
|
|
@@ -208,7 +208,7 @@ const ke = Be(
|
|
|
208
208
|
ye[Y.Delete],
|
|
209
209
|
ye[Y.Publish]
|
|
210
210
|
];
|
|
211
|
-
return
|
|
211
|
+
return rt(y, (e) => T(e, n));
|
|
212
212
|
},
|
|
213
213
|
enableSorting: !1,
|
|
214
214
|
size: 40,
|
|
@@ -219,8 +219,8 @@ const ke = Be(
|
|
|
219
219
|
}
|
|
220
220
|
],
|
|
221
221
|
recentPublish: f,
|
|
222
|
-
templates:
|
|
223
|
-
loading:
|
|
222
|
+
templates: b,
|
|
223
|
+
loading: u,
|
|
224
224
|
fetchTemplates: p,
|
|
225
225
|
loadTemplate: I
|
|
226
226
|
};
|
|
@@ -242,7 +242,7 @@ function Ge(c) {
|
|
|
242
242
|
}))
|
|
243
243
|
];
|
|
244
244
|
}
|
|
245
|
-
function
|
|
245
|
+
function Oe() {
|
|
246
246
|
return [
|
|
247
247
|
{
|
|
248
248
|
id: "code",
|
|
@@ -262,11 +262,11 @@ function He() {
|
|
|
262
262
|
}
|
|
263
263
|
];
|
|
264
264
|
}
|
|
265
|
-
function
|
|
266
|
-
var
|
|
267
|
-
const t = Ce().currentBusiness.value, r = (
|
|
268
|
-
var
|
|
269
|
-
const s = a.items.flatMap(Ge), w =
|
|
265
|
+
function _t(c) {
|
|
266
|
+
var u;
|
|
267
|
+
const t = Ce().currentBusiness.value, r = (u = c.map((a) => {
|
|
268
|
+
var d;
|
|
269
|
+
const s = a.items.flatMap(Ge), w = Oe(), p = [
|
|
270
270
|
["Template ID", a._id],
|
|
271
271
|
["Template name", a.name],
|
|
272
272
|
["Business name", t == null ? void 0 : t.name],
|
|
@@ -274,14 +274,14 @@ function ht(c) {
|
|
|
274
274
|
["Menu version", t == null ? void 0 : t.menuVersion],
|
|
275
275
|
[
|
|
276
276
|
"Locations",
|
|
277
|
-
...(
|
|
277
|
+
...(d = a.locations) != null && d.length ? a.locations.map((l) => `${l.name} (${l.dbName})`) : ["All"]
|
|
278
278
|
],
|
|
279
279
|
["Reference", a.ref ?? ""],
|
|
280
280
|
[],
|
|
281
281
|
w.map((l) => l.name),
|
|
282
282
|
...s.map((l) => w.map((n) => l[n.id]))
|
|
283
|
-
], I = w.map((l) => `system:${l.id}`),
|
|
284
|
-
return { name: a.name, sheet:
|
|
283
|
+
], I = w.map((l) => `system:${l.id}`), T = be(p, I);
|
|
284
|
+
return { name: a.name, sheet: T };
|
|
285
285
|
}).reduce(
|
|
286
286
|
(a, s) => {
|
|
287
287
|
var p;
|
|
@@ -292,17 +292,17 @@ function ht(c) {
|
|
|
292
292
|
sheets: {},
|
|
293
293
|
sheetOccurence: {}
|
|
294
294
|
}
|
|
295
|
-
)) == null ? void 0 :
|
|
296
|
-
return Ae(
|
|
295
|
+
)) == null ? void 0 : u.sheets, f = `${t == null ? void 0 : t.name} closing templates (${Ve(/* @__PURE__ */ new Date())}).xlsx`, b = Se(r);
|
|
296
|
+
return Ae(b, f), f;
|
|
297
297
|
}
|
|
298
|
-
function
|
|
298
|
+
function xt(c) {
|
|
299
299
|
Ce().currentBusiness.value;
|
|
300
|
-
const t = 3,
|
|
301
|
-
const I = [],
|
|
302
|
-
|
|
303
|
-
for (const l of
|
|
300
|
+
const t = 3, g = (p) => {
|
|
301
|
+
const I = [], T = p.sku, d = new Set(p.disabledMeasurements || []);
|
|
302
|
+
d.has(T.unit._id) || I.push(T.unit.abbrev);
|
|
303
|
+
for (const l of T.unit.measurements) {
|
|
304
304
|
if (I.length >= t) break;
|
|
305
|
-
|
|
305
|
+
d.has(l.id) || I.push(l.abbrev);
|
|
306
306
|
}
|
|
307
307
|
return I;
|
|
308
308
|
}, r = ["#", "Code", "Name", "UOM"], f = [
|
|
@@ -311,7 +311,7 @@ function _t(c) {
|
|
|
311
311
|
[],
|
|
312
312
|
r,
|
|
313
313
|
...c.items.map((p, I) => {
|
|
314
|
-
const
|
|
314
|
+
const T = g(p);
|
|
315
315
|
return [
|
|
316
316
|
I + 1,
|
|
317
317
|
// Index starting from 1
|
|
@@ -319,27 +319,27 @@ function _t(c) {
|
|
|
319
319
|
p.sku.name,
|
|
320
320
|
// Add UOM columns (up to MAX_UOM_COLUMNS)
|
|
321
321
|
...Array(t).fill("").map(
|
|
322
|
-
(
|
|
322
|
+
(d, l) => T[l] ? `_____ ${T[l]}` : ""
|
|
323
323
|
)
|
|
324
324
|
];
|
|
325
325
|
})
|
|
326
|
-
],
|
|
327
|
-
if (
|
|
326
|
+
], b = be(f, r);
|
|
327
|
+
if (b["!ref"]) {
|
|
328
328
|
const p = {
|
|
329
329
|
top: { style: "thin", color: { rgb: "000000" } },
|
|
330
330
|
bottom: { style: "thin", color: { rgb: "000000" } },
|
|
331
331
|
left: { style: "thin", color: { rgb: "000000" } },
|
|
332
332
|
right: { style: "thin", color: { rgb: "000000" } }
|
|
333
|
-
}, I = 4,
|
|
334
|
-
for (let l = I; l <=
|
|
335
|
-
|
|
333
|
+
}, I = 4, T = I + c.items.length, d = r.map((l, n) => String.fromCharCode(65 + n));
|
|
334
|
+
for (let l = I; l <= T; l++)
|
|
335
|
+
d.forEach((n) => {
|
|
336
336
|
const y = `${n}${l}`;
|
|
337
|
-
|
|
337
|
+
b[y] || (b[y] = { t: "s", v: "" }), b[y].s = {
|
|
338
338
|
border: p
|
|
339
339
|
};
|
|
340
340
|
});
|
|
341
341
|
}
|
|
342
|
-
|
|
342
|
+
b["!cols"] = [
|
|
343
343
|
{ wch: 5 },
|
|
344
344
|
// Index column - narrow
|
|
345
345
|
{ wch: 15 },
|
|
@@ -348,7 +348,7 @@ function _t(c) {
|
|
|
348
348
|
// Name column - adjusted for more columns
|
|
349
349
|
...Array.from({ length: t }, () => ({ wch: 15 }))
|
|
350
350
|
// UOM columns
|
|
351
|
-
],
|
|
351
|
+
], b["!margins"] = {
|
|
352
352
|
left: 0.7,
|
|
353
353
|
right: 0.7,
|
|
354
354
|
top: 0.75,
|
|
@@ -356,11 +356,11 @@ function _t(c) {
|
|
|
356
356
|
header: 0.3,
|
|
357
357
|
footer: 0.3
|
|
358
358
|
};
|
|
359
|
-
const a = c.name.slice(0, 31), s = Se({ [a]:
|
|
359
|
+
const a = c.name.slice(0, 31), s = Se({ [a]: b }), w = `${c.name} - Closing Template (${Ve(/* @__PURE__ */ new Date())}).xlsx`;
|
|
360
360
|
return Ae(s, w), w;
|
|
361
361
|
}
|
|
362
|
-
function
|
|
363
|
-
const c = Ce(), o = De(), t =
|
|
362
|
+
function wt() {
|
|
363
|
+
const c = Ce(), o = De(), t = mt(), g = Ge({
|
|
364
364
|
sku: {
|
|
365
365
|
unit: {
|
|
366
366
|
_id: "",
|
|
@@ -373,7 +373,7 @@ function xt() {
|
|
|
373
373
|
_id: "",
|
|
374
374
|
name: "Sugar"
|
|
375
375
|
}
|
|
376
|
-
})[0], r = c.currentBusiness.value, f =
|
|
376
|
+
})[0], r = c.currentBusiness.value, f = Oe(), b = [
|
|
377
377
|
["Template ID (leave empty to create new)", ""],
|
|
378
378
|
["Template Name", "New template"],
|
|
379
379
|
["Business name", r == null ? void 0 : r.name],
|
|
@@ -386,45 +386,45 @@ function xt() {
|
|
|
386
386
|
],
|
|
387
387
|
["Reference:"],
|
|
388
388
|
[],
|
|
389
|
-
f.map((
|
|
390
|
-
f.map((
|
|
391
|
-
],
|
|
392
|
-
(
|
|
393
|
-
var
|
|
394
|
-
const n = (
|
|
389
|
+
f.map((d) => d.name),
|
|
390
|
+
f.map((d) => g[d.id])
|
|
391
|
+
], u = f.map((d) => `system:${d.id}`), a = be(b, u), s = t.isEnabled ? t.state.setting.childItems ?? [] : [], w = s.reduce(
|
|
392
|
+
(d, l) => {
|
|
393
|
+
var F, S;
|
|
394
|
+
const n = (F = t.netSuiteItemIdToSkuId.get(l.parentNetSuiteId)) == null ? void 0 : F[0], y = (S = t.netSuiteMeasurementIdToMeasurementId.get(
|
|
395
395
|
l.unitOfMeasureId
|
|
396
396
|
)) == null ? void 0 : S[0];
|
|
397
397
|
if (!l.externalId)
|
|
398
|
-
return
|
|
398
|
+
return d;
|
|
399
399
|
if (!n)
|
|
400
|
-
return console.error(`Item ${l.externalId} cannot be mapped to parent FdoInventorySku.`, l),
|
|
400
|
+
return console.error(`Item ${l.externalId} cannot be mapped to parent FdoInventorySku.`, l), d;
|
|
401
401
|
const e = o.skuById[n], _ = e.unit.measurements.find((h) => h.id === y);
|
|
402
|
-
return _ ? (
|
|
402
|
+
return _ ? (d[l.externalId] = {
|
|
403
403
|
sku: e,
|
|
404
404
|
measurement: _
|
|
405
|
-
},
|
|
405
|
+
}, d) : (console.error(
|
|
406
406
|
`Item ${l.externalId} found parent FdoInventorySku of ${e.code} ${e.name} but the measurement of netsuite id ${l.unitOfMeasureId} cannot be found.`,
|
|
407
407
|
l
|
|
408
|
-
),
|
|
408
|
+
), d);
|
|
409
409
|
},
|
|
410
410
|
{}
|
|
411
411
|
), p = be(
|
|
412
412
|
[
|
|
413
|
-
...o.skus.flatMap((
|
|
414
|
-
[
|
|
415
|
-
...
|
|
413
|
+
...o.skus.flatMap((d) => [
|
|
414
|
+
[d.code, d.name, d.unit.abbrev, !0],
|
|
415
|
+
...d.unit.measurements.map((n) => [
|
|
416
416
|
"",
|
|
417
417
|
"",
|
|
418
418
|
n.abbrev,
|
|
419
419
|
!n.abbrev.toLocaleLowerCase("en-us").includes("inactive")
|
|
420
420
|
])
|
|
421
421
|
]),
|
|
422
|
-
...Object.entries(w).map(([
|
|
422
|
+
...Object.entries(w).map(([d, { sku: l, measurement: n }]) => [
|
|
423
423
|
l.code,
|
|
424
424
|
l.name,
|
|
425
425
|
n.abbrev,
|
|
426
426
|
!n.abbrev.toLocaleLowerCase("en-us").includes("inactive"),
|
|
427
|
-
|
|
427
|
+
d
|
|
428
428
|
])
|
|
429
429
|
],
|
|
430
430
|
[
|
|
@@ -437,20 +437,20 @@ function xt() {
|
|
|
437
437
|
), I = Se({
|
|
438
438
|
Template: a,
|
|
439
439
|
Ingredients: p
|
|
440
|
-
}),
|
|
441
|
-
return Ae(I,
|
|
440
|
+
}), T = `${r == null ? void 0 : r.name} transfer templates import.xlsx`;
|
|
441
|
+
return Ae(I, T), T;
|
|
442
442
|
}
|
|
443
|
-
function
|
|
443
|
+
function kt(c) {
|
|
444
444
|
if (!c.length || `${c[0]}`.toLocaleLowerCase() === "all")
|
|
445
445
|
return [];
|
|
446
|
-
const o = /(.*) \(((warehouse_|restaurant_).{24,})\)/,
|
|
446
|
+
const o = /(.*) \(((warehouse_|restaurant_).{24,})\)/, g = Ie().locationByDbName;
|
|
447
447
|
return c.map((r) => {
|
|
448
|
-
const f = new Array(),
|
|
449
|
-
if (!
|
|
450
|
-
return f.push(`Enabled location value of ${
|
|
448
|
+
const f = new Array(), b = r.trim(), u = o.exec(b);
|
|
449
|
+
if (!u)
|
|
450
|
+
return f.push(`Enabled location value of ${b} cannot be read.`), {
|
|
451
451
|
errors: f
|
|
452
452
|
};
|
|
453
|
-
const a =
|
|
453
|
+
const a = u[1], s = u[2], w = g[s];
|
|
454
454
|
return w ? (a !== w.name && f.push(
|
|
455
455
|
`Location id ${s} has non-matching name. Found ${a} but expected ${w.name}`
|
|
456
456
|
), {
|
|
@@ -461,33 +461,33 @@ function wt(c) {
|
|
|
461
461
|
});
|
|
462
462
|
});
|
|
463
463
|
}
|
|
464
|
-
function
|
|
464
|
+
function $t(c) {
|
|
465
465
|
const [
|
|
466
466
|
o,
|
|
467
467
|
t,
|
|
468
|
-
|
|
468
|
+
g,
|
|
469
469
|
r,
|
|
470
470
|
f,
|
|
471
|
-
|
|
472
|
-
|
|
471
|
+
b,
|
|
472
|
+
u,
|
|
473
473
|
a
|
|
474
474
|
] = Le(c);
|
|
475
475
|
return {
|
|
476
476
|
id: `${t[1] ?? ""}`.trim(),
|
|
477
|
-
name: `${
|
|
478
|
-
locations:
|
|
477
|
+
name: `${g[1] ?? ""}`.trim(),
|
|
478
|
+
locations: u.slice(1).map((s) => `${s}`.trim()).filter((s) => s),
|
|
479
479
|
reference: `${a[1] ?? ""}`.trim()
|
|
480
480
|
};
|
|
481
481
|
}
|
|
482
|
-
function
|
|
482
|
+
function Tt(c) {
|
|
483
483
|
const [
|
|
484
484
|
o,
|
|
485
485
|
t,
|
|
486
|
-
|
|
486
|
+
g,
|
|
487
487
|
r,
|
|
488
488
|
f,
|
|
489
|
-
|
|
490
|
-
|
|
489
|
+
b,
|
|
490
|
+
u,
|
|
491
491
|
a,
|
|
492
492
|
s,
|
|
493
493
|
w,
|
|
@@ -495,16 +495,16 @@ function $t(c) {
|
|
|
495
495
|
] = Le(c);
|
|
496
496
|
if (!o || !o.length || o.some((n) => n.length && !n.startsWith("system:")))
|
|
497
497
|
throw new Error("Missing meta header. Excel file does not come from the template.");
|
|
498
|
-
const I = o.map((n) => n.split(":")[1]),
|
|
499
|
-
if (
|
|
498
|
+
const I = o.map((n) => n.split(":")[1]), d = ["code", "name", "unit", "enabled"].filter((n) => !I.includes(n));
|
|
499
|
+
if (d.length)
|
|
500
500
|
throw new Error(
|
|
501
|
-
`Missing meta headers (${
|
|
501
|
+
`Missing meta headers (${d.join()}). Excel file does not come from the template.`
|
|
502
502
|
);
|
|
503
503
|
return p.map((n, y) => {
|
|
504
504
|
const e = {};
|
|
505
505
|
for (const _ in I) {
|
|
506
|
-
const
|
|
507
|
-
Object.assign(e, { [
|
|
506
|
+
const F = I[_];
|
|
507
|
+
Object.assign(e, { [F]: n[_] });
|
|
508
508
|
}
|
|
509
509
|
return {
|
|
510
510
|
index: y,
|
|
@@ -512,26 +512,26 @@ function $t(c) {
|
|
|
512
512
|
};
|
|
513
513
|
});
|
|
514
514
|
}
|
|
515
|
-
function
|
|
515
|
+
function Ft(c) {
|
|
516
516
|
return c.reduce(
|
|
517
517
|
(o, t) => {
|
|
518
518
|
var f;
|
|
519
|
-
const
|
|
520
|
-
return
|
|
519
|
+
const g = t.data, r = t.index;
|
|
520
|
+
return g.unit && (g.code ? o.result.push({ parent: t, children: [] }) : o.result.length ? (f = o.result.at(-1)) == null || f.children.push(t) : o.errors.push(`Cannot find parent for row ${r + 9}`)), o;
|
|
521
521
|
},
|
|
522
522
|
{ result: new Array(), errors: new Array() }
|
|
523
523
|
);
|
|
524
524
|
}
|
|
525
|
-
function
|
|
525
|
+
function Ct(c) {
|
|
526
526
|
const o = c.parent.data, t = new Array(), r = De().skuByCode[o.code ?? ""];
|
|
527
527
|
if (!r)
|
|
528
528
|
return t.push(`Cannot find ingredient of code ${o.code} ${o.name}`), { errors: t };
|
|
529
529
|
const f = {
|
|
530
530
|
sku: r
|
|
531
|
-
},
|
|
532
|
-
o.unit !== r.unit.abbrev && !
|
|
531
|
+
}, b = /* @__PURE__ */ new Set([r.unit._id, ...r.unit.measurements.map((a) => a.id)]), u = r.unit.measurements.find((a) => a.abbrev === o.unit);
|
|
532
|
+
o.unit !== r.unit.abbrev && !u ? t.push(
|
|
533
533
|
`Cannot find measurement unit of ${o.unit} for (${o.code}) ${o.name}.`
|
|
534
|
-
) : (o.enabled === !0 || `${o.enabled}`.toLocaleLowerCase() === "true") &&
|
|
534
|
+
) : (o.enabled === !0 || `${o.enabled}`.toLocaleLowerCase() === "true") && b.delete(r.unit._id);
|
|
535
535
|
for (const a of c.children) {
|
|
536
536
|
const s = a.data, w = s.unit === r.unit.abbrev ? r.unit : void 0, p = r.unit.measurements.find((I) => I.abbrev === s.unit);
|
|
537
537
|
if (!p && !w) {
|
|
@@ -540,43 +540,43 @@ function Ft(c) {
|
|
|
540
540
|
);
|
|
541
541
|
continue;
|
|
542
542
|
}
|
|
543
|
-
(s.enabled === !0 || `${s.enabled}`.toLocaleLowerCase() === "true") &&
|
|
543
|
+
(s.enabled === !0 || `${s.enabled}`.toLocaleLowerCase() === "true") && b.delete((p == null ? void 0 : p.id) ?? (w == null ? void 0 : w._id) ?? "");
|
|
544
544
|
}
|
|
545
|
-
return
|
|
545
|
+
return b.has(r.unit._id) && f.sku.unit.measurements.every((a) => b.has(a.id)) && t.push(`Ingredient ${r.code} - ${r.name} must have at least one unit enabled.`), f.disabledMeasurements = [...b], { errors: t, templateItem: f };
|
|
546
546
|
}
|
|
547
|
-
function
|
|
547
|
+
function It(c) {
|
|
548
548
|
const o = c.SheetNames.filter(
|
|
549
549
|
(f) => !Object.values(Re).map(String).includes(f)
|
|
550
|
-
),
|
|
550
|
+
), g = ke().templates, r = st(g, "_id");
|
|
551
551
|
try {
|
|
552
552
|
return o.reduce(
|
|
553
|
-
(f,
|
|
554
|
-
const
|
|
555
|
-
|
|
556
|
-
const I =
|
|
553
|
+
(f, b) => {
|
|
554
|
+
const u = new Array(), a = c.Sheets[b], s = $t(a), w = kt(s.locations), p = w.filter((e) => e.location).map((e) => e.location);
|
|
555
|
+
u.push(...w.flatMap((e) => e.errors));
|
|
556
|
+
const I = Tt(a).filter(
|
|
557
557
|
(e) => e.data.code || e.data.unit
|
|
558
|
-
),
|
|
559
|
-
|
|
560
|
-
const
|
|
561
|
-
(e) =>
|
|
558
|
+
), T = Ft(I);
|
|
559
|
+
u.push(...T.errors);
|
|
560
|
+
const d = T.result.map(
|
|
561
|
+
(e) => Ct(e)
|
|
562
562
|
);
|
|
563
|
-
|
|
564
|
-
const l =
|
|
563
|
+
u.push(...d.flatMap((e) => e.errors));
|
|
564
|
+
const l = d.filter((e) => e.templateItem).map((e) => e.templateItem);
|
|
565
565
|
if (s.id) {
|
|
566
566
|
const e = r[s.id];
|
|
567
567
|
if (!e) {
|
|
568
|
-
const
|
|
568
|
+
const F = {
|
|
569
569
|
_id: s.id,
|
|
570
570
|
_rev: "",
|
|
571
|
-
name: s.name || `(unnamed from sheet ${
|
|
571
|
+
name: s.name || `(unnamed from sheet ${b || "<unnamed sheet>"})`,
|
|
572
572
|
items: []
|
|
573
573
|
};
|
|
574
|
-
return
|
|
574
|
+
return u.push(`Template ID ${s.id} is not found.`), f.importUpdateResult.push({
|
|
575
575
|
type: "update",
|
|
576
|
-
original:
|
|
577
|
-
template:
|
|
578
|
-
excelSheetName:
|
|
579
|
-
errors:
|
|
576
|
+
original: F,
|
|
577
|
+
template: F,
|
|
578
|
+
excelSheetName: b,
|
|
579
|
+
errors: u
|
|
580
580
|
}), f;
|
|
581
581
|
}
|
|
582
582
|
const _ = {
|
|
@@ -589,8 +589,8 @@ function Ct(c) {
|
|
|
589
589
|
ref: s.reference,
|
|
590
590
|
items: l
|
|
591
591
|
},
|
|
592
|
-
excelSheetName:
|
|
593
|
-
errors:
|
|
592
|
+
excelSheetName: b,
|
|
593
|
+
errors: u
|
|
594
594
|
};
|
|
595
595
|
return f.importUpdateResult.push(_), f;
|
|
596
596
|
}
|
|
@@ -602,8 +602,8 @@ function Ct(c) {
|
|
|
602
602
|
ref: s.reference,
|
|
603
603
|
items: l
|
|
604
604
|
},
|
|
605
|
-
excelSheetName:
|
|
606
|
-
errors:
|
|
605
|
+
excelSheetName: b,
|
|
606
|
+
errors: u
|
|
607
607
|
};
|
|
608
608
|
return f.importCreateResult.push(y), f;
|
|
609
609
|
},
|
|
@@ -622,10 +622,10 @@ function Ct(c) {
|
|
|
622
622
|
};
|
|
623
623
|
}
|
|
624
624
|
}
|
|
625
|
-
const
|
|
625
|
+
const Dt = { class: "flex items-center gap-12 pl-8" }, St = { class: "flex flex-col" }, At = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary flex items-center gap-4" }, Rt = {
|
|
626
626
|
key: 0,
|
|
627
627
|
class: "text-fm-color-typo-secondary fm-typo-en-body-sm-400"
|
|
628
|
-
},
|
|
628
|
+
}, Pt = { key: 0 }, Ee = /* @__PURE__ */ Q({
|
|
629
629
|
__name: "ClosingTemplateImportItem",
|
|
630
630
|
props: {
|
|
631
631
|
type: {},
|
|
@@ -635,27 +635,27 @@ const It = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-
|
|
|
635
635
|
errors: {}
|
|
636
636
|
},
|
|
637
637
|
setup(c) {
|
|
638
|
-
const { t: o } =
|
|
639
|
-
return (t,
|
|
640
|
-
var
|
|
641
|
-
const r =
|
|
642
|
-
return k(), D("div",
|
|
643
|
-
|
|
644
|
-
i("div",
|
|
645
|
-
i("div",
|
|
638
|
+
const { t: o } = ne();
|
|
639
|
+
return (t, g) => {
|
|
640
|
+
var b, u, a;
|
|
641
|
+
const r = E("FmIcon"), f = E("FmTooltip");
|
|
642
|
+
return k(), D("div", Dt, [
|
|
643
|
+
g[0] || (g[0] = i("div", null, "•", -1)),
|
|
644
|
+
i("div", St, [
|
|
645
|
+
i("div", At, [
|
|
646
646
|
i("div", {
|
|
647
|
-
class:
|
|
647
|
+
class: oe({
|
|
648
648
|
"text-fm-color-system-error-300": t.errors.length
|
|
649
649
|
})
|
|
650
650
|
}, [
|
|
651
|
-
|
|
652
|
-
t.type === "create" ? (k(), D("span",
|
|
651
|
+
X(A(t.name) + " ", 1),
|
|
652
|
+
t.type === "create" ? (k(), D("span", Rt, "(" + A(x(o)("inventory.closing.template.import.new")) + ")", 1)) : G("", !0)
|
|
653
653
|
], 2),
|
|
654
|
-
t.errors.length ? (k(), D("div",
|
|
654
|
+
t.errors.length ? (k(), D("div", Pt, [
|
|
655
655
|
R(f, { "z-index": 50 }, {
|
|
656
656
|
content: z(() => [
|
|
657
657
|
i("ol", null, [
|
|
658
|
-
(k(!0), D(
|
|
658
|
+
(k(!0), D(O, null, J(t.errors, (s, w) => (k(), D("li", { key: w }, A(s), 1))), 128))
|
|
659
659
|
])
|
|
660
660
|
]),
|
|
661
661
|
default: z(() => [
|
|
@@ -667,112 +667,112 @@ const It = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-
|
|
|
667
667
|
]),
|
|
668
668
|
_: 1
|
|
669
669
|
})
|
|
670
|
-
])) :
|
|
670
|
+
])) : G("", !0)
|
|
671
671
|
]),
|
|
672
672
|
i("div", {
|
|
673
|
-
class:
|
|
673
|
+
class: oe([
|
|
674
674
|
"fm-typo-en-body-sm-400",
|
|
675
675
|
{
|
|
676
676
|
"text-fm-color-system-error-200": t.errors.length,
|
|
677
677
|
"text-fm-color-typo-secondary": !t.errors.length
|
|
678
678
|
}
|
|
679
679
|
])
|
|
680
|
-
}, A((
|
|
680
|
+
}, A((b = t.locations) != null && b.length ? x(o)("inventory.closing.template.import.nLocations", { count: (u = t.locations) == null ? void 0 : u.length }) : x(o)("inventory.closing.template.import.allLocations")) + ", " + A(x(o)("inventory.closing.template.import.nItems", { count: (a = t.items) == null ? void 0 : a.length })), 3)
|
|
681
681
|
])
|
|
682
682
|
]);
|
|
683
683
|
};
|
|
684
684
|
}
|
|
685
|
-
}),
|
|
685
|
+
}), Mt = { class: "flex flex-col gap-24" }, Et = { class: "fm-typo-en-body-md-400" }, Bt = {
|
|
686
686
|
key: 0,
|
|
687
687
|
class: "flex items-center gap-8"
|
|
688
|
-
},
|
|
688
|
+
}, Nt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ut = { class: "flex flex-col gap-8" }, Lt = { class: "line-clamp-2 text-ellipsis break-all" }, Vt = {
|
|
689
689
|
key: 2,
|
|
690
690
|
class: "shrink-0"
|
|
691
|
-
},
|
|
691
|
+
}, zt = {
|
|
692
692
|
key: 0,
|
|
693
693
|
class: "flex flex-col"
|
|
694
|
-
},
|
|
694
|
+
}, Gt = { class: "text-fm-color-system-error-300 fm-typo-en-body-sm-400" }, Ot = {
|
|
695
695
|
key: 0,
|
|
696
696
|
class: "max-h-[200px] overflow-y-auto flex flex-col gap-8"
|
|
697
|
-
}, Ht = { class: "fm-typo-en-body-lg-600" },
|
|
697
|
+
}, Ht = { class: "fm-typo-en-body-lg-600" }, jt = /* @__PURE__ */ Q({
|
|
698
698
|
__name: "ClosingTemplateImport",
|
|
699
699
|
setup(c) {
|
|
700
|
-
const o = N(null), t =
|
|
701
|
-
() => !!
|
|
700
|
+
const o = N(null), t = et(), g = xe(), r = N(!1), f = N(!1), b = N(new Array()), u = N([]), a = N([]), s = U(
|
|
701
|
+
() => !!b.value.length || u.value.some((T) => T.errors.length) || a.value.some((T) => T.errors.length)
|
|
702
702
|
), w = U(
|
|
703
|
-
() => !!
|
|
704
|
-
), { t: p } =
|
|
705
|
-
async function I(
|
|
706
|
-
|
|
703
|
+
() => !!u.value.length || !!a.value.length
|
|
704
|
+
), { t: p } = ne();
|
|
705
|
+
async function I(T) {
|
|
706
|
+
b.value = [], u.value = [], a.value = [];
|
|
707
707
|
try {
|
|
708
708
|
r.value = !0;
|
|
709
|
-
const [
|
|
710
|
-
|
|
709
|
+
const [d] = await Promise.all([
|
|
710
|
+
at(T),
|
|
711
711
|
// fake buffer
|
|
712
712
|
new Promise((e) => setTimeout(e, 1e3))
|
|
713
713
|
]);
|
|
714
|
-
if (!
|
|
714
|
+
if (!d.SheetNames.filter(
|
|
715
715
|
(e) => !Object.values(Re).map(String).includes(e)
|
|
716
716
|
).find((e) => e)) {
|
|
717
|
-
|
|
717
|
+
b.value.push(p("inventory.ingredient.import.fileError.noSheet"));
|
|
718
718
|
return;
|
|
719
719
|
}
|
|
720
|
-
const y =
|
|
720
|
+
const y = It(d);
|
|
721
721
|
if (y.invalidExcel) {
|
|
722
|
-
|
|
722
|
+
b.value.push(
|
|
723
723
|
y.invalidExcelMessage ?? p("inventory.ingredient.import.fileError.invalidExcel")
|
|
724
724
|
);
|
|
725
725
|
return;
|
|
726
726
|
}
|
|
727
|
-
if (
|
|
728
|
-
|
|
727
|
+
if (u.value = y.importCreateResult, a.value = y.importUpdateResult, !u.value.length && !a.value.length) {
|
|
728
|
+
b.value.push(p("inventory.ingredient.import.fileError.noData"));
|
|
729
729
|
return;
|
|
730
730
|
}
|
|
731
731
|
t.emitData(y);
|
|
732
|
-
} catch (
|
|
733
|
-
|
|
732
|
+
} catch (d) {
|
|
733
|
+
g.open({
|
|
734
734
|
title: p("inventory.ingredient.import.fileError.unableToRead"),
|
|
735
|
-
message:
|
|
735
|
+
message: d == null ? void 0 : d.message,
|
|
736
736
|
type: "error"
|
|
737
|
-
}), console.error("Error in reading file",
|
|
737
|
+
}), console.error("Error in reading file", d);
|
|
738
738
|
} finally {
|
|
739
|
-
|
|
739
|
+
b.value.length && g.open({
|
|
740
740
|
title: p("inventory.ingredient.import.fileError.invalidExcel"),
|
|
741
741
|
type: "error"
|
|
742
742
|
}), r.value = !1;
|
|
743
743
|
}
|
|
744
744
|
}
|
|
745
|
-
return Fe(o, (
|
|
746
|
-
|
|
747
|
-
}), (
|
|
748
|
-
const l =
|
|
749
|
-
return k(), D("div",
|
|
750
|
-
i("div",
|
|
751
|
-
f.value ? (k(), D("div",
|
|
745
|
+
return Fe(o, (T) => {
|
|
746
|
+
T && I(T);
|
|
747
|
+
}), (T, d) => {
|
|
748
|
+
const l = E("FmCircularProgress"), n = E("FmIcon"), y = E("FmButton");
|
|
749
|
+
return k(), D("div", Mt, [
|
|
750
|
+
i("div", Et, A(x(p)("inventory.closing.template.import.message")), 1),
|
|
751
|
+
f.value ? (k(), D("div", Bt, [
|
|
752
752
|
i("div", null, [
|
|
753
753
|
R(l, {
|
|
754
754
|
size: "md",
|
|
755
755
|
color: "neutral-gray-200"
|
|
756
756
|
})
|
|
757
757
|
]),
|
|
758
|
-
i("div",
|
|
759
|
-
])) : (k(), D(
|
|
760
|
-
R(
|
|
761
|
-
class:
|
|
758
|
+
i("div", Nt, A(x(p)("inventory.formField.loading")), 1)
|
|
759
|
+
])) : (k(), D(O, { key: 1 }, [
|
|
760
|
+
R(lt, {
|
|
761
|
+
class: oe({
|
|
762
762
|
"w-full": !0,
|
|
763
763
|
"h-[200px]": !o.value
|
|
764
764
|
}),
|
|
765
765
|
accept: ".xlsx",
|
|
766
|
-
onFileUpload:
|
|
766
|
+
onFileUpload: d[0] || (d[0] = (e) => o.value = e),
|
|
767
767
|
label: x(p)("inventory.ingredient.import.uploadTemplate"),
|
|
768
768
|
"button-label": x(p)("inventory.ingredient.import.selectFile")
|
|
769
769
|
}, je({ _: 2 }, [
|
|
770
770
|
o.value ? {
|
|
771
771
|
name: "default",
|
|
772
772
|
fn: z(({ openFileDialog: e }) => [
|
|
773
|
-
i("div",
|
|
773
|
+
i("div", Ut, [
|
|
774
774
|
i("div", {
|
|
775
|
-
class:
|
|
775
|
+
class: oe([
|
|
776
776
|
"fm-corner-radius-md p-16 flex items-center gap-16",
|
|
777
777
|
{
|
|
778
778
|
"border border-fm-color-neutral-gray-100": r.value,
|
|
@@ -792,7 +792,7 @@ const It = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-
|
|
|
792
792
|
color: s.value ? "system-error-300" : void 0
|
|
793
793
|
}, null, 8, ["name", "color"])),
|
|
794
794
|
i("div", {
|
|
795
|
-
class:
|
|
795
|
+
class: oe([
|
|
796
796
|
"fm-typo-en-body-md-400 flex-1 h-[36px] flex items-center",
|
|
797
797
|
{
|
|
798
798
|
"text-fm-color-typo-disabled": r.value,
|
|
@@ -800,9 +800,9 @@ const It = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-
|
|
|
800
800
|
}
|
|
801
801
|
])
|
|
802
802
|
}, [
|
|
803
|
-
i("div",
|
|
803
|
+
i("div", Lt, A(o.value.name), 1)
|
|
804
804
|
], 2),
|
|
805
|
-
r.value ?
|
|
805
|
+
r.value ? G("", !0) : (k(), D("div", Vt, [
|
|
806
806
|
R(y, {
|
|
807
807
|
label: x(p)("inventory.ingredient.import.replaceFile"),
|
|
808
808
|
variant: s.value ? "destructive" : "secondary",
|
|
@@ -811,9 +811,9 @@ const It = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-
|
|
|
811
811
|
}, null, 8, ["label", "variant", "prepend-icon", "onClick"])
|
|
812
812
|
]))
|
|
813
813
|
], 2),
|
|
814
|
-
|
|
815
|
-
(k(!0), D(
|
|
816
|
-
key:
|
|
814
|
+
b.value.length ? (k(), D("div", zt, [
|
|
815
|
+
(k(!0), D(O, null, J(b.value, (_, F) => (k(), D("div", {
|
|
816
|
+
key: F,
|
|
817
817
|
class: "flex gap-8 items-center"
|
|
818
818
|
}, [
|
|
819
819
|
R(n, {
|
|
@@ -821,17 +821,17 @@ const It = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-
|
|
|
821
821
|
size: "sm",
|
|
822
822
|
color: "system-error-300"
|
|
823
823
|
}),
|
|
824
|
-
i("div",
|
|
824
|
+
i("div", Gt, A(_), 1)
|
|
825
825
|
]))), 128))
|
|
826
|
-
])) :
|
|
826
|
+
])) : G("", !0)
|
|
827
827
|
])
|
|
828
828
|
]),
|
|
829
829
|
key: "0"
|
|
830
830
|
} : void 0
|
|
831
831
|
]), 1032, ["class", "label", "button-label"]),
|
|
832
|
-
w.value ? (k(), D("div",
|
|
832
|
+
w.value ? (k(), D("div", Ot, [
|
|
833
833
|
i("div", Ht, A(x(p)("inventory.ingredient.import.summary")), 1),
|
|
834
|
-
(k(!0), D(
|
|
834
|
+
(k(!0), D(O, null, J(u.value, (e, _) => (k(), K(Ee, {
|
|
835
835
|
key: _,
|
|
836
836
|
name: e.template.name,
|
|
837
837
|
locations: e.template.locations,
|
|
@@ -839,7 +839,7 @@ const It = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-
|
|
|
839
839
|
errors: e.errors,
|
|
840
840
|
type: "create"
|
|
841
841
|
}, null, 8, ["name", "locations", "items", "errors"]))), 128)),
|
|
842
|
-
(k(!0), D(
|
|
842
|
+
(k(!0), D(O, null, J(a.value, (e) => (k(), K(Ee, {
|
|
843
843
|
key: e.template._id,
|
|
844
844
|
name: e.template.name,
|
|
845
845
|
locations: e.template.locations,
|
|
@@ -847,33 +847,33 @@ const It = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-
|
|
|
847
847
|
errors: e.errors,
|
|
848
848
|
type: "update"
|
|
849
849
|
}, null, 8, ["name", "locations", "items", "errors"]))), 128))
|
|
850
|
-
])) :
|
|
850
|
+
])) : G("", !0)
|
|
851
851
|
], 64))
|
|
852
852
|
]);
|
|
853
853
|
};
|
|
854
854
|
}
|
|
855
855
|
}), he = Be("closingTemplateActions", () => {
|
|
856
|
-
const { t: c } =
|
|
856
|
+
const { t: c } = ne(), o = _e(), t = xe(), g = we(), r = dt(), f = ke(), { loading: b } = Ne(f), u = N({});
|
|
857
857
|
function a() {
|
|
858
|
-
|
|
859
|
-
mode:
|
|
858
|
+
u.value = {
|
|
859
|
+
mode: te.CREATE,
|
|
860
860
|
show: !0,
|
|
861
861
|
"onUpdate:show"(e) {
|
|
862
|
-
|
|
862
|
+
u.value.show = e;
|
|
863
863
|
}
|
|
864
864
|
};
|
|
865
865
|
}
|
|
866
866
|
function s(e) {
|
|
867
|
-
|
|
868
|
-
mode:
|
|
867
|
+
u.value = {
|
|
868
|
+
mode: te.UPDATE,
|
|
869
869
|
modelValue: e,
|
|
870
870
|
show: !0,
|
|
871
871
|
"onUpdate:show"(_) {
|
|
872
|
-
|
|
872
|
+
u.value.show = _;
|
|
873
873
|
}
|
|
874
874
|
};
|
|
875
875
|
}
|
|
876
|
-
function w(e, _,
|
|
876
|
+
function w(e, _, F) {
|
|
877
877
|
o.open({
|
|
878
878
|
title: `Confirm deleting template ${e.name}?`,
|
|
879
879
|
message: "Deleted template can no longer be retrieved",
|
|
@@ -895,7 +895,7 @@ const It = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-
|
|
|
895
895
|
try {
|
|
896
896
|
_.value = !0;
|
|
897
897
|
const [S] = await Promise.allSettled([
|
|
898
|
-
|
|
898
|
+
g.deleteTemplate(e),
|
|
899
899
|
new Promise((h) => setTimeout(h, 1e3))
|
|
900
900
|
]);
|
|
901
901
|
if (S.status === "rejected") throw S.reason;
|
|
@@ -910,11 +910,11 @@ const It = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-
|
|
|
910
910
|
type: "error"
|
|
911
911
|
});
|
|
912
912
|
} finally {
|
|
913
|
-
_.value = !1,
|
|
913
|
+
_.value = !1, F();
|
|
914
914
|
}
|
|
915
915
|
});
|
|
916
916
|
}
|
|
917
|
-
function p(e, _,
|
|
917
|
+
function p(e, _, F) {
|
|
918
918
|
let S;
|
|
919
919
|
o.open({
|
|
920
920
|
title: `Confirm duplicating template "${e.name}"?`,
|
|
@@ -929,11 +929,11 @@ const It = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-
|
|
|
929
929
|
variant: fe.Plain,
|
|
930
930
|
close: !0
|
|
931
931
|
},
|
|
932
|
-
contentComponent:
|
|
932
|
+
contentComponent: Q({
|
|
933
933
|
props: ["modelValue"],
|
|
934
934
|
emits: ["update:modelValue"],
|
|
935
935
|
setup(h) {
|
|
936
|
-
return () => $e(
|
|
936
|
+
return () => $e(tt.FmTextField, {
|
|
937
937
|
modelValue: h.modelValue,
|
|
938
938
|
"onUpdate:modelValue": ($) => S = $,
|
|
939
939
|
label: "New Template Name",
|
|
@@ -965,12 +965,12 @@ const It = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-
|
|
|
965
965
|
type: "error"
|
|
966
966
|
}), console.error("error on duplicating closing template", h);
|
|
967
967
|
} finally {
|
|
968
|
-
_.value = !1,
|
|
968
|
+
_.value = !1, F();
|
|
969
969
|
}
|
|
970
970
|
});
|
|
971
971
|
}
|
|
972
972
|
const I = N({});
|
|
973
|
-
function
|
|
973
|
+
function T(e) {
|
|
974
974
|
I.value = {
|
|
975
975
|
template: e,
|
|
976
976
|
show: !0,
|
|
@@ -982,7 +982,7 @@ const It = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-
|
|
|
982
982
|
}
|
|
983
983
|
};
|
|
984
984
|
}
|
|
985
|
-
function
|
|
985
|
+
function d() {
|
|
986
986
|
if (!f.templates.length) {
|
|
987
987
|
t.open({
|
|
988
988
|
title: "No data to export",
|
|
@@ -990,7 +990,7 @@ const It = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-
|
|
|
990
990
|
});
|
|
991
991
|
return;
|
|
992
992
|
}
|
|
993
|
-
const e =
|
|
993
|
+
const e = _t(f.templates);
|
|
994
994
|
t.open({
|
|
995
995
|
title: c("inventory.ingredient.export.success"),
|
|
996
996
|
message: c("inventory.ingredient.export.filename", [e]),
|
|
@@ -1005,7 +1005,7 @@ const It = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-
|
|
|
1005
1005
|
});
|
|
1006
1006
|
return;
|
|
1007
1007
|
}
|
|
1008
|
-
const _ =
|
|
1008
|
+
const _ = xt(e);
|
|
1009
1009
|
t.open({
|
|
1010
1010
|
title: c("inventory.ingredient.export.success"),
|
|
1011
1011
|
message: c("inventory.ingredient.export.filename", [_]),
|
|
@@ -1015,7 +1015,7 @@ const It = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-
|
|
|
1015
1015
|
function n() {
|
|
1016
1016
|
f.loading || o.open({
|
|
1017
1017
|
title: c("inventory.ingredient.import.title"),
|
|
1018
|
-
contentComponent:
|
|
1018
|
+
contentComponent: jt,
|
|
1019
1019
|
overlay: !0,
|
|
1020
1020
|
closeButton: !0,
|
|
1021
1021
|
primaryActions: {
|
|
@@ -1056,10 +1056,10 @@ const It = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-
|
|
|
1056
1056
|
return;
|
|
1057
1057
|
}
|
|
1058
1058
|
o.close(), y(e);
|
|
1059
|
-
}).onTertiary(
|
|
1059
|
+
}).onTertiary(wt);
|
|
1060
1060
|
}
|
|
1061
1061
|
async function y(e) {
|
|
1062
|
-
|
|
1062
|
+
b.value = !0;
|
|
1063
1063
|
try {
|
|
1064
1064
|
const _ = [
|
|
1065
1065
|
...e.importCreateResult.map(
|
|
@@ -1068,10 +1068,10 @@ const It = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-
|
|
|
1068
1068
|
...e.importUpdateResult.map(
|
|
1069
1069
|
($) => $.template
|
|
1070
1070
|
)
|
|
1071
|
-
],
|
|
1071
|
+
], F = 100;
|
|
1072
1072
|
let S = 0;
|
|
1073
1073
|
const h = () => {
|
|
1074
|
-
S +=
|
|
1074
|
+
S += F, t.open({
|
|
1075
1075
|
title: c("inventory.ingredient.import.progress", [
|
|
1076
1076
|
Math.min(S, _.length),
|
|
1077
1077
|
_.length
|
|
@@ -1079,7 +1079,7 @@ const It = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-
|
|
|
1079
1079
|
});
|
|
1080
1080
|
};
|
|
1081
1081
|
for (const $ of _.chunk(100))
|
|
1082
|
-
h(), await
|
|
1082
|
+
h(), await g.importTemplates($);
|
|
1083
1083
|
t.open({
|
|
1084
1084
|
title: c("inventory.ingredient.import.success"),
|
|
1085
1085
|
type: "success"
|
|
@@ -1091,23 +1091,23 @@ const It = { class: "flex items-center gap-12 pl-8" }, Dt = { class: "flex flex-
|
|
|
1091
1091
|
type: "error"
|
|
1092
1092
|
}), console.error("Error in importing skus", e, _);
|
|
1093
1093
|
} finally {
|
|
1094
|
-
|
|
1094
|
+
b.value = !1, f.fetchTemplates();
|
|
1095
1095
|
}
|
|
1096
1096
|
}
|
|
1097
1097
|
return {
|
|
1098
1098
|
createTemplate: a,
|
|
1099
|
-
viewTemplate:
|
|
1099
|
+
viewTemplate: T,
|
|
1100
1100
|
updateTemplate: s,
|
|
1101
1101
|
deleteTemplate: w,
|
|
1102
1102
|
duplicateTemplate: p,
|
|
1103
|
-
exportTemplates:
|
|
1103
|
+
exportTemplates: d,
|
|
1104
1104
|
exportSingleTemplate: l,
|
|
1105
1105
|
importTemplates: n,
|
|
1106
|
-
templateDialogProps:
|
|
1106
|
+
templateDialogProps: u,
|
|
1107
1107
|
templateDetailsProps: I
|
|
1108
1108
|
};
|
|
1109
1109
|
});
|
|
1110
|
-
function
|
|
1110
|
+
function Yt(c) {
|
|
1111
1111
|
return c ? Number(c.amount) / Math.pow(10, Number(c.precision) || 0) : 0;
|
|
1112
1112
|
}
|
|
1113
1113
|
function Pe(c) {
|
|
@@ -1120,55 +1120,55 @@ function Pe(c) {
|
|
|
1120
1120
|
enabled: !o.has(c.sku.unit._id)
|
|
1121
1121
|
}
|
|
1122
1122
|
];
|
|
1123
|
-
for (const
|
|
1123
|
+
for (const g of c.sku.unit.measurements)
|
|
1124
1124
|
t.push({
|
|
1125
|
-
id:
|
|
1126
|
-
label:
|
|
1125
|
+
id: g.id,
|
|
1126
|
+
label: g.abbrev,
|
|
1127
1127
|
isBase: !1,
|
|
1128
|
-
factor:
|
|
1129
|
-
enabled: !o.has(
|
|
1128
|
+
factor: Yt(g.conversion),
|
|
1129
|
+
enabled: !o.has(g.id)
|
|
1130
1130
|
});
|
|
1131
1131
|
return t;
|
|
1132
1132
|
}
|
|
1133
|
-
function
|
|
1133
|
+
function Kt(c) {
|
|
1134
1134
|
return Pe(c).filter((o) => o.enabled).length;
|
|
1135
1135
|
}
|
|
1136
|
-
function
|
|
1136
|
+
function Wt(c) {
|
|
1137
1137
|
return Pe(c).filter((o) => o.enabled).map((o) => !o.isBase && o.factor ? `${o.label} ×${o.factor}` : o.label);
|
|
1138
1138
|
}
|
|
1139
|
-
function
|
|
1139
|
+
function qt(c, o) {
|
|
1140
1140
|
const t = new Set(c.disabledMeasurements ?? []);
|
|
1141
1141
|
if (o.enabled) {
|
|
1142
|
-
if (
|
|
1142
|
+
if (Kt(c) <= 1) return null;
|
|
1143
1143
|
t.add(o.id);
|
|
1144
1144
|
} else
|
|
1145
1145
|
t.delete(o.id);
|
|
1146
1146
|
return { ...c, disabledMeasurements: [...t] };
|
|
1147
1147
|
}
|
|
1148
|
-
const
|
|
1148
|
+
const Jt = { class: "flex items-center gap-12 py-12" }, Xt = {
|
|
1149
1149
|
class: "flex items-center justify-center shrink-0 rounded-md border border-fm-color-neutral-gray-300 fm-typo-en-body-sm-600 text-fm-color-typo-secondary",
|
|
1150
1150
|
style: { width: "28px", height: "28px" }
|
|
1151
|
-
},
|
|
1151
|
+
}, Qt = {
|
|
1152
1152
|
class: "flex flex-col gap-2 shrink-0",
|
|
1153
1153
|
style: { width: "280px" }
|
|
1154
|
-
},
|
|
1154
|
+
}, Zt = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary bg-fm-color-neutral-gray-100 border border-fm-color-neutral-gray-200 rounded px-8 py-1 self-start" }, eo = {
|
|
1155
1155
|
class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary",
|
|
1156
1156
|
style: { "word-break": "break-word", "line-height": "1.2" }
|
|
1157
|
-
},
|
|
1157
|
+
}, to = {
|
|
1158
1158
|
class: "flex-1 flex flex-wrap items-center",
|
|
1159
1159
|
style: { gap: "6px" }
|
|
1160
|
-
},
|
|
1160
|
+
}, oo = {
|
|
1161
1161
|
key: 0,
|
|
1162
1162
|
class: "fm-typo-en-body-sm-600 text-fm-color-typo-secondary bg-fm-color-neutral-gray-200 rounded",
|
|
1163
1163
|
style: { padding: "0 6px" }
|
|
1164
|
-
},
|
|
1164
|
+
}, no = {
|
|
1165
1165
|
key: 1,
|
|
1166
1166
|
class: "fm-typo-en-body-sm-400 text-fm-color-primary",
|
|
1167
1167
|
style: { opacity: "0.7" }
|
|
1168
|
-
},
|
|
1168
|
+
}, so = {
|
|
1169
1169
|
class: "shrink-0 flex items-center justify-end gap-4",
|
|
1170
1170
|
style: { width: "200px" }
|
|
1171
|
-
},
|
|
1171
|
+
}, ao = /* @__PURE__ */ Q({
|
|
1172
1172
|
__name: "ClosingTemplateItem",
|
|
1173
1173
|
props: {
|
|
1174
1174
|
item: {},
|
|
@@ -1177,58 +1177,58 @@ const qt = { class: "flex items-center gap-12 py-12" }, Jt = {
|
|
|
1177
1177
|
},
|
|
1178
1178
|
emits: ["update", "delete"],
|
|
1179
1179
|
setup(c, { emit: o }) {
|
|
1180
|
-
const t = c,
|
|
1181
|
-
function
|
|
1180
|
+
const t = c, g = o, r = U(() => Pe(t.item)), f = U(() => r.value.filter((s) => s.enabled)), b = U(() => f.value.length);
|
|
1181
|
+
function u(s) {
|
|
1182
1182
|
if (t.disabled) return;
|
|
1183
|
-
const w =
|
|
1184
|
-
w &&
|
|
1183
|
+
const w = qt(t.item, s);
|
|
1184
|
+
w && g("update", w);
|
|
1185
1185
|
}
|
|
1186
1186
|
function a(s) {
|
|
1187
1187
|
return s.isBase ? "Base unit" : s.factor ? `1 ${s.label} = ${s.factor} ${t.item.sku.unit.abbrev}` : "";
|
|
1188
1188
|
}
|
|
1189
1189
|
return (s, w) => {
|
|
1190
|
-
const p =
|
|
1191
|
-
return k(), D("div",
|
|
1192
|
-
i("span",
|
|
1193
|
-
i("div",
|
|
1194
|
-
i("span",
|
|
1195
|
-
i("div",
|
|
1190
|
+
const p = E("FmButton"), I = E("FmMenuItem"), T = E("FmMenu");
|
|
1191
|
+
return k(), D("div", Jt, [
|
|
1192
|
+
i("span", Xt, A(s.index + 1), 1),
|
|
1193
|
+
i("div", Qt, [
|
|
1194
|
+
i("span", Zt, A(s.item.sku.code), 1),
|
|
1195
|
+
i("div", eo, A(s.item.sku.name), 1)
|
|
1196
1196
|
]),
|
|
1197
|
-
i("div",
|
|
1198
|
-
(k(!0), D(
|
|
1199
|
-
key:
|
|
1200
|
-
class:
|
|
1197
|
+
i("div", to, [
|
|
1198
|
+
(k(!0), D(O, null, J(f.value, (d) => (k(), D("span", {
|
|
1199
|
+
key: d.id,
|
|
1200
|
+
class: oe([
|
|
1201
1201
|
"flex items-center rounded-full border",
|
|
1202
|
-
|
|
1202
|
+
d.isBase ? "border-fm-color-neutral-gray-300 bg-fm-color-neutral-gray-100" : "border-fm-color-primary bg-fm-color-system-warning-100"
|
|
1203
1203
|
]),
|
|
1204
1204
|
style: { gap: "6px", padding: "4px 12px" }
|
|
1205
1205
|
}, [
|
|
1206
1206
|
i("span", {
|
|
1207
|
-
class:
|
|
1208
|
-
}, A(
|
|
1209
|
-
|
|
1207
|
+
class: oe(["fm-typo-en-body-sm-600 whitespace-nowrap", d.isBase ? "text-fm-color-typo-primary" : "text-fm-color-primary"])
|
|
1208
|
+
}, A(d.label), 3),
|
|
1209
|
+
d.isBase ? (k(), D("span", oo, " BASE ")) : d.factor ? (k(), D("span", no, " ×" + A(d.factor), 1)) : G("", !0)
|
|
1210
1210
|
], 2))), 128))
|
|
1211
1211
|
]),
|
|
1212
|
-
i("div",
|
|
1213
|
-
R(
|
|
1212
|
+
i("div", so, [
|
|
1213
|
+
R(T, { "close-on-click": !1 }, {
|
|
1214
1214
|
"menu-button": z(() => [
|
|
1215
1215
|
R(p, {
|
|
1216
1216
|
variant: "secondary",
|
|
1217
1217
|
"prepend-icon": "tune",
|
|
1218
1218
|
size: "md",
|
|
1219
1219
|
disabled: s.disabled,
|
|
1220
|
-
label: `Units ${
|
|
1220
|
+
label: `Units ${b.value}/${r.value.length}`
|
|
1221
1221
|
}, null, 8, ["disabled", "label"])
|
|
1222
1222
|
]),
|
|
1223
1223
|
default: z(() => [
|
|
1224
|
-
(k(!0), D(
|
|
1225
|
-
key:
|
|
1226
|
-
"model-value":
|
|
1224
|
+
(k(!0), D(O, null, J(r.value, (d) => (k(), K(I, {
|
|
1225
|
+
key: d.id,
|
|
1226
|
+
"model-value": d.enabled,
|
|
1227
1227
|
"has-checkbox": "",
|
|
1228
|
-
label:
|
|
1229
|
-
sublabel: a(
|
|
1230
|
-
disabled: s.disabled ||
|
|
1231
|
-
onClick: (l) => d
|
|
1228
|
+
label: d.label,
|
|
1229
|
+
sublabel: a(d),
|
|
1230
|
+
disabled: s.disabled || d.enabled && b.value === 1,
|
|
1231
|
+
onClick: (l) => u(d)
|
|
1232
1232
|
}, null, 8, ["model-value", "label", "sublabel", "disabled", "onClick"]))), 128))
|
|
1233
1233
|
]),
|
|
1234
1234
|
_: 1
|
|
@@ -1238,45 +1238,48 @@ const qt = { class: "flex items-center gap-12 py-12" }, Jt = {
|
|
|
1238
1238
|
icon: "delete",
|
|
1239
1239
|
variant: "tertiary",
|
|
1240
1240
|
size: "md",
|
|
1241
|
-
onClick: w[0] || (w[0] = (
|
|
1241
|
+
onClick: w[0] || (w[0] = (d) => g("delete"))
|
|
1242
1242
|
}, null, 8, ["disabled"])
|
|
1243
1243
|
])
|
|
1244
1244
|
]);
|
|
1245
1245
|
};
|
|
1246
1246
|
}
|
|
1247
|
-
}),
|
|
1247
|
+
}), lo = { class: "flex flex-col gap-12" }, ro = { class: "flex items-start justify-between gap-8" }, io = { class: "flex flex-col" }, co = { class: "flex items-center gap-8" }, mo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, uo = { class: "flex gap-8 shrink-0" }, po = { class: "flex flex-wrap items-center gap-8" }, fo = ["onClick"], yo = { class: "fm-typo-en-body-md-600 whitespace-nowrap" }, vo = ["disabled"], go = { class: "rounded-lg border border-fm-color-neutral-gray-200 overflow-hidden" }, bo = { class: "flex items-center gap-12 px-16 py-12 border-b border-fm-color-neutral-gray-200 bg-fm-color-neutral-gray-50" }, ho = {
|
|
1248
1248
|
key: 0,
|
|
1249
1249
|
class: "flex-1 flex items-baseline gap-8 min-w-0"
|
|
1250
|
-
},
|
|
1250
|
+
}, _o = {
|
|
1251
1251
|
key: 1,
|
|
1252
1252
|
class: "flex-1 min-w-0"
|
|
1253
|
-
},
|
|
1253
|
+
}, xo = {
|
|
1254
1254
|
class: "fm-typo-en-body-sm-600 text-fm-color-typo-secondary bg-fm-color-neutral-gray-100 rounded-full shrink-0",
|
|
1255
1255
|
style: { padding: "4px 10px" }
|
|
1256
|
-
},
|
|
1256
|
+
}, wo = {
|
|
1257
1257
|
key: 0,
|
|
1258
|
+
class: "flex items-center gap-4 px-16 py-8 border-b border-fm-color-neutral-gray-200 bg-fm-color-neutral-gray-50 fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
|
|
1259
|
+
}, ko = {
|
|
1260
|
+
key: 1,
|
|
1258
1261
|
class: "flex flex-col"
|
|
1259
|
-
},
|
|
1262
|
+
}, $o = ["onDragstart", "onDrop"], To = {
|
|
1260
1263
|
key: 0,
|
|
1261
1264
|
class: "m-16 rounded-lg border border-dashed border-fm-color-neutral-gray-300 text-center fm-typo-en-body-sm-400 text-fm-color-typo-secondary",
|
|
1262
1265
|
style: { padding: "24px" }
|
|
1263
|
-
},
|
|
1264
|
-
key:
|
|
1266
|
+
}, Fo = {
|
|
1267
|
+
key: 2,
|
|
1265
1268
|
class: "flex flex-col"
|
|
1266
|
-
},
|
|
1269
|
+
}, Co = {
|
|
1267
1270
|
key: 0,
|
|
1268
1271
|
class: "m-16 rounded-lg border border-dashed border-fm-color-neutral-gray-300 text-center fm-typo-en-body-sm-400 text-fm-color-typo-secondary",
|
|
1269
1272
|
style: { padding: "24px" }
|
|
1270
|
-
},
|
|
1273
|
+
}, Io = ["onDragstart", "onDrop"], Do = {
|
|
1271
1274
|
class: "flex items-center justify-center shrink-0 rounded-md border border-fm-color-neutral-gray-300 fm-typo-en-body-sm-600 text-fm-color-typo-secondary",
|
|
1272
1275
|
style: { width: "28px", height: "28px" }
|
|
1273
|
-
},
|
|
1276
|
+
}, So = { class: "flex-1 min-w-0" }, Ao = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Ro = {
|
|
1274
1277
|
class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary",
|
|
1275
1278
|
style: { "line-height": "1.2" }
|
|
1276
|
-
},
|
|
1279
|
+
}, Po = {
|
|
1277
1280
|
class: "flex flex-wrap gap-4 justify-end",
|
|
1278
1281
|
style: { "max-width": "320px" }
|
|
1279
|
-
},
|
|
1282
|
+
}, Mo = /* @__PURE__ */ Q({
|
|
1280
1283
|
__name: "ClosingTemplateGroupsEditor",
|
|
1281
1284
|
props: {
|
|
1282
1285
|
items: {},
|
|
@@ -1288,160 +1291,163 @@ const qt = { class: "flex items-center gap-12 py-12" }, Jt = {
|
|
|
1288
1291
|
},
|
|
1289
1292
|
emits: ["reorderDefault", "addItems"],
|
|
1290
1293
|
setup(c, { emit: o }) {
|
|
1291
|
-
const { promptSelectIngredients: t } = ze(),
|
|
1292
|
-
function s(
|
|
1293
|
-
r.updateGroups(
|
|
1294
|
+
const { promptSelectIngredients: t } = ze(), g = _e(), r = c, f = o, b = ["#EAB308", "#22C55E", "#3B82F6", "#A855F7", "#F97316", "#EC4899", "#14B8A6"], u = N("default"), a = U(() => r.groups ?? []);
|
|
1295
|
+
function s(m) {
|
|
1296
|
+
r.updateGroups(m);
|
|
1294
1297
|
}
|
|
1295
1298
|
function w() {
|
|
1296
1299
|
return `tmplGroup_${Date.now()}_${Math.floor(Math.random() * 1e4)}`;
|
|
1297
1300
|
}
|
|
1298
1301
|
const p = N(null), I = N(null);
|
|
1299
|
-
function
|
|
1302
|
+
function T(m, v, C) {
|
|
1300
1303
|
var P;
|
|
1301
|
-
I.value =
|
|
1304
|
+
I.value = m, p.value = v, (P = C.dataTransfer) == null || P.setData("text/plain", String(v)), C.dataTransfer && (C.dataTransfer.effectAllowed = "move");
|
|
1302
1305
|
}
|
|
1303
|
-
function m
|
|
1304
|
-
const P = [...
|
|
1305
|
-
return P.splice(
|
|
1306
|
+
function d(m, v, C) {
|
|
1307
|
+
const P = [...m], [M] = P.splice(v, 1);
|
|
1308
|
+
return P.splice(C, 0, M), P;
|
|
1306
1309
|
}
|
|
1307
|
-
function l(
|
|
1308
|
-
const
|
|
1309
|
-
if (p.value = null, I.value = null, !(
|
|
1310
|
-
if (
|
|
1310
|
+
function l(m, v) {
|
|
1311
|
+
const C = p.value, P = I.value;
|
|
1312
|
+
if (p.value = null, I.value = null, !(C === null || P !== m || C === v))
|
|
1313
|
+
if (m === "default")
|
|
1311
1314
|
f(
|
|
1312
1315
|
"reorderDefault",
|
|
1313
|
-
|
|
1316
|
+
d(
|
|
1314
1317
|
r.items.map((M) => M.sku._id),
|
|
1315
|
-
|
|
1316
|
-
|
|
1318
|
+
C,
|
|
1319
|
+
v
|
|
1317
1320
|
)
|
|
1318
1321
|
);
|
|
1319
1322
|
else {
|
|
1320
|
-
const M = V(
|
|
1321
|
-
M &&
|
|
1323
|
+
const M = V(m);
|
|
1324
|
+
M && ee(m, d(M.items.map((q) => q.skuId), C, v));
|
|
1322
1325
|
}
|
|
1323
1326
|
}
|
|
1324
1327
|
const n = U(
|
|
1325
|
-
() => Object.fromEntries(r.items.map((
|
|
1328
|
+
() => Object.fromEntries(r.items.map((m) => [m.sku._id, m]))
|
|
1326
1329
|
);
|
|
1327
1330
|
Fe(
|
|
1328
|
-
() => r.items.map((
|
|
1329
|
-
(
|
|
1330
|
-
const
|
|
1331
|
-
let
|
|
1331
|
+
() => r.items.map((m) => m.sku._id),
|
|
1332
|
+
(m) => {
|
|
1333
|
+
const v = new Set(m);
|
|
1334
|
+
let C = !1;
|
|
1332
1335
|
const P = a.value.map((M) => {
|
|
1333
|
-
const
|
|
1334
|
-
return
|
|
1336
|
+
const q = M.items.filter((B) => v.has(B.skuId));
|
|
1337
|
+
return q.length !== M.items.length ? (C = !0, { ...M, items: q }) : M;
|
|
1335
1338
|
});
|
|
1336
|
-
|
|
1339
|
+
C && s(P);
|
|
1337
1340
|
}
|
|
1338
1341
|
);
|
|
1339
1342
|
const y = U(() => {
|
|
1340
|
-
const
|
|
1341
|
-
for (const
|
|
1342
|
-
for (const P of
|
|
1343
|
-
let
|
|
1344
|
-
return
|
|
1345
|
-
|
|
1346
|
-
}),
|
|
1343
|
+
const m = /* @__PURE__ */ new Map();
|
|
1344
|
+
for (const C of a.value)
|
|
1345
|
+
for (const P of C.items) m.set(P.skuId, (m.get(P.skuId) ?? 0) + 1);
|
|
1346
|
+
let v = 0;
|
|
1347
|
+
return m.forEach((C) => {
|
|
1348
|
+
C > 1 && v++;
|
|
1349
|
+
}), v;
|
|
1347
1350
|
}), e = U(() => {
|
|
1348
|
-
const
|
|
1349
|
-
return `${r.items.length} items in Default · ${y.value} shared across named groups · ${
|
|
1351
|
+
const m = a.value.length;
|
|
1352
|
+
return `${r.items.length} items in Default · ${y.value} shared across named groups · ${m + 1} total groups (${m} named + Default)`;
|
|
1350
1353
|
}), _ = U(() => [
|
|
1351
1354
|
{ id: "default", isDefault: !0, name: "Default", color: null, itemCount: r.items.length },
|
|
1352
|
-
...a.value.map((
|
|
1353
|
-
id:
|
|
1355
|
+
...a.value.map((m, v) => ({
|
|
1356
|
+
id: m.id,
|
|
1354
1357
|
isDefault: !1,
|
|
1355
|
-
name:
|
|
1356
|
-
color:
|
|
1357
|
-
itemCount:
|
|
1358
|
+
name: m.name,
|
|
1359
|
+
color: b[v % b.length],
|
|
1360
|
+
itemCount: m.items.length
|
|
1358
1361
|
}))
|
|
1359
|
-
]),
|
|
1360
|
-
() => _.value.find((
|
|
1361
|
-
), S = U(() =>
|
|
1362
|
-
() => S.value ? [] :
|
|
1362
|
+
]), F = U(
|
|
1363
|
+
() => _.value.find((m) => m.id === u.value) ?? _.value[0]
|
|
1364
|
+
), S = U(() => F.value.isDefault), h = U(
|
|
1365
|
+
() => S.value ? [] : de(u.value)
|
|
1363
1366
|
);
|
|
1364
|
-
function $(
|
|
1365
|
-
return
|
|
1367
|
+
function $(m) {
|
|
1368
|
+
return u.value === m;
|
|
1366
1369
|
}
|
|
1367
1370
|
function L() {
|
|
1368
|
-
const
|
|
1369
|
-
s([...a.value, { id:
|
|
1371
|
+
const m = w();
|
|
1372
|
+
s([...a.value, { id: m, name: `Group ${a.value.length + 1}`, items: [] }]), u.value = m;
|
|
1370
1373
|
}
|
|
1371
|
-
function V(
|
|
1372
|
-
return a.value.find((
|
|
1374
|
+
function V(m) {
|
|
1375
|
+
return a.value.find((v) => v.id === m) ?? null;
|
|
1373
1376
|
}
|
|
1374
|
-
function
|
|
1375
|
-
s(a.value.filter((
|
|
1377
|
+
function Z(m) {
|
|
1378
|
+
s(a.value.filter((v) => v.id !== m)), u.value === m && (u.value = "default");
|
|
1376
1379
|
}
|
|
1377
|
-
function
|
|
1378
|
-
|
|
1379
|
-
title: `Delete group "${
|
|
1380
|
+
function se(m, v) {
|
|
1381
|
+
g.open({
|
|
1382
|
+
title: `Delete group "${v || "Untitled"}"?`,
|
|
1380
1383
|
closeButton: !1,
|
|
1381
1384
|
message: "This removes the group and its item selection. The items stay in Default and other groups.",
|
|
1382
1385
|
primaryActions: { text: "Delete", close: !0, variant: "destructive" },
|
|
1383
1386
|
secondaryActions: { text: "Cancel", close: !0 }
|
|
1384
|
-
}).onPrimary(() =>
|
|
1387
|
+
}).onPrimary(() => Z(m));
|
|
1385
1388
|
}
|
|
1386
|
-
function
|
|
1387
|
-
s(a.value.map((
|
|
1389
|
+
function H(m, v) {
|
|
1390
|
+
s(a.value.map((C) => C.id === m ? { ...C, name: v } : C));
|
|
1388
1391
|
}
|
|
1389
|
-
function
|
|
1392
|
+
function ee(m, v) {
|
|
1390
1393
|
s(
|
|
1391
1394
|
a.value.map(
|
|
1392
|
-
(
|
|
1395
|
+
(C) => C.id === m ? { ...C, items: v.map((P, M) => ({ skuId: P, position: M })) } : C
|
|
1393
1396
|
)
|
|
1394
1397
|
);
|
|
1395
1398
|
}
|
|
1396
|
-
async function
|
|
1399
|
+
async function ie(m) {
|
|
1397
1400
|
if (r.disabled) return;
|
|
1398
|
-
const
|
|
1399
|
-
if (!
|
|
1400
|
-
const
|
|
1401
|
-
|
|
1401
|
+
const v = V(m);
|
|
1402
|
+
if (!v) return;
|
|
1403
|
+
const C = await t(
|
|
1404
|
+
v.items.map((P) => P.skuId),
|
|
1402
1405
|
(P) => P,
|
|
1403
1406
|
r.items.map((P) => P.sku)
|
|
1404
1407
|
);
|
|
1405
|
-
|
|
1408
|
+
C && ee(m, C);
|
|
1406
1409
|
}
|
|
1407
|
-
function
|
|
1408
|
-
S.value ? f("addItems") :
|
|
1410
|
+
function ce() {
|
|
1411
|
+
S.value ? f("addItems") : ie(u.value);
|
|
1409
1412
|
}
|
|
1410
|
-
function
|
|
1411
|
-
const
|
|
1412
|
-
if (!
|
|
1413
|
-
const P =
|
|
1414
|
-
|
|
1413
|
+
function me(m, v) {
|
|
1414
|
+
const C = V(m);
|
|
1415
|
+
if (!C) return;
|
|
1416
|
+
const P = C.items.some((M) => M.skuId === v) ? C.items.filter((M) => M.skuId !== v).map((M) => M.skuId) : [...C.items.map((M) => M.skuId), v];
|
|
1417
|
+
ee(m, P);
|
|
1415
1418
|
}
|
|
1416
|
-
function
|
|
1417
|
-
const
|
|
1418
|
-
return
|
|
1419
|
+
function de(m) {
|
|
1420
|
+
const v = V(m);
|
|
1421
|
+
return v ? v.items.map((C) => n.value[C.skuId]).filter(Boolean) : [];
|
|
1419
1422
|
}
|
|
1420
|
-
function
|
|
1421
|
-
const
|
|
1422
|
-
if (
|
|
1423
|
-
return
|
|
1424
|
-
const
|
|
1425
|
-
return
|
|
1423
|
+
function ae(m) {
|
|
1424
|
+
const v = $(m.id);
|
|
1425
|
+
if (m.isDefault)
|
|
1426
|
+
return v ? { background: "#1F2937", color: "#FFFFFF", border: "1px solid #1F2937" } : { background: "#FFFFFF", color: "#374151", border: "1px solid #E5E7EB" };
|
|
1427
|
+
const C = m.color || "#999999";
|
|
1428
|
+
return v ? { background: C, color: re(C), border: `1px solid ${C}` } : { background: `${C}1A`, color: "#374151", border: `1px solid ${C}` };
|
|
1426
1429
|
}
|
|
1427
|
-
function
|
|
1428
|
-
const
|
|
1429
|
-
return (0.299 *
|
|
1430
|
+
function re(m) {
|
|
1431
|
+
const v = m.replace("#", ""), C = parseInt(v.slice(0, 2), 16), P = parseInt(v.slice(2, 4), 16), M = parseInt(v.slice(4, 6), 16);
|
|
1432
|
+
return (0.299 * C + 0.587 * P + 0.114 * M) / 255 > 0.6 ? "#1F2937" : "#FFFFFF";
|
|
1430
1433
|
}
|
|
1431
|
-
function ue(
|
|
1432
|
-
return $(
|
|
1434
|
+
function ue(m) {
|
|
1435
|
+
return $(m.id) ? (m.isDefault ? "#FFFFFF" : re(m.color || "#999999")) === "#FFFFFF" ? { background: "rgba(255,255,255,0.25)", color: "#FFFFFF" } : { background: "rgba(0,0,0,0.12)", color: "#1F2937" } : { background: "rgba(0,0,0,0.06)", color: "inherit" };
|
|
1433
1436
|
}
|
|
1434
|
-
return (
|
|
1435
|
-
const
|
|
1436
|
-
return k(), D("div",
|
|
1437
|
-
i("div",
|
|
1438
|
-
i("div",
|
|
1439
|
-
|
|
1440
|
-
|
|
1437
|
+
return (m, v) => {
|
|
1438
|
+
const C = E("FmPill"), P = E("FmButton"), M = E("FmIcon"), q = E("FmTextField");
|
|
1439
|
+
return k(), D("div", lo, [
|
|
1440
|
+
i("div", ro, [
|
|
1441
|
+
i("div", io, [
|
|
1442
|
+
i("div", co, [
|
|
1443
|
+
v[4] || (v[4] = i("div", { class: "fm-typo-en-title-sm-600 text-fm-color-typo-primary" }, "Groups & items", -1)),
|
|
1444
|
+
R(C, { variant: "beta" })
|
|
1445
|
+
]),
|
|
1446
|
+
i("div", mo, A(e.value), 1)
|
|
1441
1447
|
]),
|
|
1442
|
-
i("div",
|
|
1443
|
-
R(
|
|
1444
|
-
disabled:
|
|
1448
|
+
i("div", uo, [
|
|
1449
|
+
R(P, {
|
|
1450
|
+
disabled: m.disabled,
|
|
1445
1451
|
label: "New Group",
|
|
1446
1452
|
"prepend-icon": "add",
|
|
1447
1453
|
variant: "primary",
|
|
@@ -1451,155 +1457,165 @@ const qt = { class: "flex items-center gap-12 py-12" }, Jt = {
|
|
|
1451
1457
|
}, null, 8, ["disabled"])
|
|
1452
1458
|
])
|
|
1453
1459
|
]),
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1460
|
+
v[10] || (v[10] = Ye('<div class="flex items-start gap-8 p-12 fm-corner-radius-md border-1 border-yellow-500 bg-yellow-50 text-yellow-700"><div class="flex flex-col gap-2"><div class="fm-typo-en-body-md-600 text-fm-color-typo-primary">📦 Closing Groups</div><div class="fm-typo-en-body-sm-400"> Split a closing template into named groups (e.g. by section, fridge, or station) so several staff can stock take in parallel and you manage them in one place. Group stock take is currently only available in the Inventory mobile app — it's not yet available in POS. You can keep using the <span class="fm-typo-en-body-sm-600 text-fm-color-typo-primary">Default (master list)</span> group as usual. </div></div></div>', 1)),
|
|
1461
|
+
i("div", po, [
|
|
1462
|
+
(k(!0), D(O, null, J(_.value, (B) => (k(), D("button", {
|
|
1463
|
+
key: B.id,
|
|
1457
1464
|
type: "button",
|
|
1458
1465
|
class: "flex items-center rounded-full",
|
|
1459
|
-
style: Te([{ gap: "8px", padding: "6px 14px" },
|
|
1460
|
-
onClick: (
|
|
1466
|
+
style: Te([{ gap: "8px", padding: "6px 14px" }, ae(B)]),
|
|
1467
|
+
onClick: (W) => u.value = B.id
|
|
1461
1468
|
}, [
|
|
1462
|
-
i("span",
|
|
1469
|
+
i("span", yo, A(B.name), 1),
|
|
1463
1470
|
i("span", {
|
|
1464
1471
|
class: "fm-typo-en-body-sm-600 rounded-full",
|
|
1465
|
-
style: Te([{ padding: "0 8px" }, ue(
|
|
1466
|
-
}, A(
|
|
1467
|
-
], 12,
|
|
1472
|
+
style: Te([{ padding: "0 8px" }, ue(B)])
|
|
1473
|
+
}, A(B.itemCount), 5)
|
|
1474
|
+
], 12, fo))), 128)),
|
|
1468
1475
|
i("button", {
|
|
1469
1476
|
type: "button",
|
|
1470
|
-
disabled:
|
|
1477
|
+
disabled: m.disabled,
|
|
1471
1478
|
class: "flex items-center rounded-full border border-dashed border-fm-color-neutral-gray-400 text-fm-color-typo-secondary",
|
|
1472
1479
|
style: { gap: "6px", padding: "6px 14px" },
|
|
1473
1480
|
onClick: L
|
|
1474
1481
|
}, [
|
|
1475
|
-
R(
|
|
1482
|
+
R(M, {
|
|
1476
1483
|
name: "add",
|
|
1477
1484
|
size: "sm"
|
|
1478
1485
|
}),
|
|
1479
|
-
|
|
1480
|
-
], 8,
|
|
1486
|
+
v[5] || (v[5] = i("span", { class: "fm-typo-en-body-md-400 whitespace-nowrap" }, "New group", -1))
|
|
1487
|
+
], 8, vo)
|
|
1481
1488
|
]),
|
|
1482
|
-
i("div",
|
|
1483
|
-
i("div",
|
|
1484
|
-
S.value ? (k(), D("div",
|
|
1489
|
+
i("div", go, [
|
|
1490
|
+
i("div", bo, [
|
|
1491
|
+
S.value ? (k(), D("div", ho, v[6] || (v[6] = [
|
|
1485
1492
|
i("span", { class: "fm-typo-en-body-lg-600 italic text-fm-color-typo-primary" }, "Default", -1),
|
|
1486
1493
|
i("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary truncate" }, " master list · sets the item pool & units ", -1)
|
|
1487
|
-
]))) : (k(), D("div",
|
|
1488
|
-
R(
|
|
1489
|
-
"model-value":
|
|
1490
|
-
disabled:
|
|
1494
|
+
]))) : (k(), D("div", _o, [
|
|
1495
|
+
R(q, {
|
|
1496
|
+
"model-value": F.value.name,
|
|
1497
|
+
disabled: m.disabled,
|
|
1491
1498
|
placeholder: "Group name",
|
|
1492
|
-
"onUpdate:modelValue":
|
|
1499
|
+
"onUpdate:modelValue": v[0] || (v[0] = (B) => H(u.value, B))
|
|
1493
1500
|
}, null, 8, ["model-value", "disabled"])
|
|
1494
1501
|
])),
|
|
1495
|
-
i("span",
|
|
1496
|
-
S.value ?
|
|
1502
|
+
i("span", xo, A(F.value.itemCount) + " items ", 1),
|
|
1503
|
+
S.value ? G("", !0) : (k(), K(P, {
|
|
1497
1504
|
key: 2,
|
|
1498
|
-
disabled:
|
|
1505
|
+
disabled: m.disabled,
|
|
1499
1506
|
label: "Delete group",
|
|
1500
1507
|
"prepend-icon": "delete",
|
|
1501
1508
|
variant: "secondary",
|
|
1502
1509
|
size: "md",
|
|
1503
1510
|
class: "rounded-lg shrink-0",
|
|
1504
|
-
onClick:
|
|
1511
|
+
onClick: v[1] || (v[1] = (B) => se(u.value, F.value.name))
|
|
1505
1512
|
}, null, 8, ["disabled"])),
|
|
1506
|
-
R(
|
|
1507
|
-
disabled:
|
|
1513
|
+
R(P, {
|
|
1514
|
+
disabled: m.disabled,
|
|
1508
1515
|
label: "Add items",
|
|
1509
1516
|
"prepend-icon": "add",
|
|
1510
1517
|
variant: "primary",
|
|
1511
1518
|
size: "md",
|
|
1512
1519
|
class: "rounded-lg shrink-0",
|
|
1513
|
-
onClick:
|
|
1520
|
+
onClick: ce
|
|
1514
1521
|
}, null, 8, ["disabled"])
|
|
1515
1522
|
]),
|
|
1516
|
-
|
|
1517
|
-
(
|
|
1518
|
-
|
|
1523
|
+
F.value.itemCount > 1 ? (k(), D("div", wo, [
|
|
1524
|
+
R(M, {
|
|
1525
|
+
name: "drag_indicator",
|
|
1526
|
+
size: "sm",
|
|
1527
|
+
color: "neutral-gray-400",
|
|
1528
|
+
class: "shrink-0"
|
|
1529
|
+
}),
|
|
1530
|
+
v[7] || (v[7] = X(" Drag a row to reorder items. "))
|
|
1531
|
+
])) : G("", !0),
|
|
1532
|
+
S.value ? (k(), D("div", ko, [
|
|
1533
|
+
(k(!0), D(O, null, J(m.items, (B, W) => (k(), D("div", {
|
|
1534
|
+
key: B.sku._id,
|
|
1519
1535
|
draggable: "true",
|
|
1520
|
-
onDragstart: (j) =>
|
|
1521
|
-
onDragover:
|
|
1536
|
+
onDragstart: (j) => T("default", W, j),
|
|
1537
|
+
onDragover: v[2] || (v[2] = pe(() => {
|
|
1522
1538
|
}, ["prevent"])),
|
|
1523
|
-
onDrop: pe((j) => l("default",
|
|
1539
|
+
onDrop: pe((j) => l("default", W), ["prevent"]),
|
|
1524
1540
|
class: "flex items-center gap-4 px-16 border-b border-fm-color-neutral-gray-200 hover:bg-fm-color-neutral-gray-100 cursor-grab"
|
|
1525
1541
|
}, [
|
|
1526
|
-
R(
|
|
1542
|
+
R(M, {
|
|
1527
1543
|
name: "drag_indicator",
|
|
1528
1544
|
size: "sm",
|
|
1529
1545
|
color: "neutral-gray-400",
|
|
1530
1546
|
class: "shrink-0"
|
|
1531
1547
|
}),
|
|
1532
|
-
R(
|
|
1548
|
+
R(ao, {
|
|
1533
1549
|
class: "flex-1 min-w-0",
|
|
1534
|
-
item:
|
|
1535
|
-
index:
|
|
1536
|
-
disabled:
|
|
1537
|
-
onUpdate:
|
|
1538
|
-
onDelete: (j) =>
|
|
1550
|
+
item: B,
|
|
1551
|
+
index: W,
|
|
1552
|
+
disabled: m.disabled,
|
|
1553
|
+
onUpdate: m.updateItem,
|
|
1554
|
+
onDelete: (j) => m.deleteItem(B)
|
|
1539
1555
|
}, null, 8, ["item", "index", "disabled", "onUpdate", "onDelete"])
|
|
1540
|
-
], 40,
|
|
1541
|
-
|
|
1542
|
-
|
|
1556
|
+
], 40, $o))), 128)),
|
|
1557
|
+
m.items.length ? G("", !0) : (k(), D("div", To, v[8] || (v[8] = [
|
|
1558
|
+
X(" No items yet — click "),
|
|
1543
1559
|
i("span", { class: "fm-typo-en-body-sm-600 text-fm-color-typo-primary" }, "+ Add items", -1),
|
|
1544
|
-
|
|
1560
|
+
X(" to add from your catalog. ")
|
|
1545
1561
|
])))
|
|
1546
|
-
])) : (k(), D("div",
|
|
1547
|
-
h.value.length ?
|
|
1548
|
-
|
|
1562
|
+
])) : (k(), D("div", Fo, [
|
|
1563
|
+
h.value.length ? G("", !0) : (k(), D("div", Co, v[9] || (v[9] = [
|
|
1564
|
+
X(" No items yet — click "),
|
|
1549
1565
|
i("span", { class: "fm-typo-en-body-sm-600 text-fm-color-typo-primary" }, "+ Add items", -1),
|
|
1550
|
-
|
|
1566
|
+
X(" on this group to assign items. ")
|
|
1551
1567
|
]))),
|
|
1552
|
-
(k(!0), D(
|
|
1553
|
-
key:
|
|
1568
|
+
(k(!0), D(O, null, J(h.value, (B, W) => (k(), D("div", {
|
|
1569
|
+
key: B.sku._id,
|
|
1554
1570
|
draggable: "true",
|
|
1555
|
-
onDragstart: (j) =>
|
|
1556
|
-
onDragover:
|
|
1571
|
+
onDragstart: (j) => T(u.value, W, j),
|
|
1572
|
+
onDragover: v[3] || (v[3] = pe(() => {
|
|
1557
1573
|
}, ["prevent"])),
|
|
1558
|
-
onDrop: pe((j) => l(
|
|
1574
|
+
onDrop: pe((j) => l(u.value, W), ["prevent"]),
|
|
1559
1575
|
class: "flex items-center gap-12 px-16 py-12 border-b border-fm-color-neutral-gray-200 hover:bg-fm-color-neutral-gray-100 cursor-grab"
|
|
1560
1576
|
}, [
|
|
1561
|
-
R(
|
|
1577
|
+
R(M, {
|
|
1562
1578
|
name: "drag_indicator",
|
|
1563
1579
|
size: "sm",
|
|
1564
1580
|
color: "neutral-gray-400",
|
|
1565
1581
|
class: "shrink-0"
|
|
1566
1582
|
}),
|
|
1567
|
-
i("span",
|
|
1568
|
-
i("div", Co, [
|
|
1569
|
-
i("div", Io, A(E.sku.code), 1),
|
|
1570
|
-
i("div", Do, A(E.sku.name), 1)
|
|
1571
|
-
]),
|
|
1583
|
+
i("span", Do, A(W + 1), 1),
|
|
1572
1584
|
i("div", So, [
|
|
1573
|
-
(
|
|
1574
|
-
|
|
1585
|
+
i("div", Ao, A(B.sku.code), 1),
|
|
1586
|
+
i("div", Ro, A(B.sku.name), 1)
|
|
1587
|
+
]),
|
|
1588
|
+
i("div", Po, [
|
|
1589
|
+
(k(!0), D(O, null, J(x(Wt)(B), (j, le) => (k(), D("span", {
|
|
1590
|
+
key: le,
|
|
1575
1591
|
class: "px-8 py-2 rounded-full border border-fm-color-neutral-gray-200 fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
|
|
1576
1592
|
}, A(j), 1))), 128))
|
|
1577
1593
|
]),
|
|
1578
|
-
R(
|
|
1579
|
-
disabled:
|
|
1594
|
+
R(P, {
|
|
1595
|
+
disabled: m.disabled,
|
|
1580
1596
|
icon: "delete",
|
|
1581
1597
|
variant: "tertiary",
|
|
1582
1598
|
size: "md",
|
|
1583
|
-
onClick: (j) =>
|
|
1599
|
+
onClick: (j) => me(u.value, B.sku._id)
|
|
1584
1600
|
}, null, 8, ["disabled", "onClick"])
|
|
1585
|
-
], 40,
|
|
1601
|
+
], 40, Io))), 128))
|
|
1586
1602
|
]))
|
|
1587
1603
|
])
|
|
1588
1604
|
]);
|
|
1589
1605
|
};
|
|
1590
1606
|
}
|
|
1591
|
-
}),
|
|
1607
|
+
}), Eo = { class: "flex flex-col gap-16" }, Bo = { class: "flex flex-col gap-24" }, No = { class: "flex flex-col gap-16" }, Uo = { class: "flex items-center" }, Lo = { class: "flex-1 fm-typo-en-title-sm-600" }, Vo = { class: "flex flex-col gap-16" }, zo = { class: "flex items-center" }, Go = { class: "flex-1 gap-8 fm-typo-en-title-sm-600" }, Oo = /* @__PURE__ */ Q({
|
|
1592
1608
|
__name: "ClosingTemplateForm",
|
|
1593
1609
|
props: {
|
|
1594
1610
|
modelValue: {},
|
|
1595
1611
|
disabled: { type: Boolean }
|
|
1596
1612
|
},
|
|
1597
1613
|
setup(c, { expose: o }) {
|
|
1598
|
-
const t =
|
|
1614
|
+
const t = yt(), { t: g } = ne(), r = De(), {
|
|
1599
1615
|
promptSelectLocations: f,
|
|
1600
|
-
columnDefs:
|
|
1601
|
-
rowData:
|
|
1602
|
-
} =
|
|
1616
|
+
columnDefs: b,
|
|
1617
|
+
rowData: u
|
|
1618
|
+
} = vt({
|
|
1603
1619
|
getLocations() {
|
|
1604
1620
|
return t.locations;
|
|
1605
1621
|
},
|
|
@@ -1612,9 +1628,9 @@ const qt = { class: "flex items-center gap-12 py-12" }, Jt = {
|
|
|
1612
1628
|
}).map(({ item: n }) => n));
|
|
1613
1629
|
function w(n) {
|
|
1614
1630
|
const y = new Map(t.items.map((_) => [_.sku._id, _])), e = [];
|
|
1615
|
-
n.forEach((_,
|
|
1631
|
+
n.forEach((_, F) => {
|
|
1616
1632
|
const S = y.get(_);
|
|
1617
|
-
S && e.push({ ...S, position:
|
|
1633
|
+
S && e.push({ ...S, position: F });
|
|
1618
1634
|
}), t.items = e;
|
|
1619
1635
|
}
|
|
1620
1636
|
o({
|
|
@@ -1637,31 +1653,31 @@ const qt = { class: "flex items-center gap-12 py-12" }, Jt = {
|
|
|
1637
1653
|
function I(n) {
|
|
1638
1654
|
t.items = t.items.filter((y) => y.sku._id !== n.sku._id);
|
|
1639
1655
|
}
|
|
1640
|
-
function
|
|
1656
|
+
function T(n) {
|
|
1641
1657
|
t.groups = n;
|
|
1642
1658
|
}
|
|
1643
|
-
const { promptSelectIngredients:
|
|
1659
|
+
const { promptSelectIngredients: d } = ze();
|
|
1644
1660
|
async function l() {
|
|
1645
|
-
const y = r.skus.map((
|
|
1646
|
-
label:
|
|
1647
|
-
sublabel:
|
|
1648
|
-
value:
|
|
1649
|
-
})).filter((
|
|
1661
|
+
const y = r.skus.map((F) => ({
|
|
1662
|
+
label: F.name,
|
|
1663
|
+
sublabel: F.code,
|
|
1664
|
+
value: F
|
|
1665
|
+
})).filter((F) => {
|
|
1650
1666
|
var S;
|
|
1651
|
-
return (S = t.items) == null ? void 0 : S.find((h) => h.sku._id ===
|
|
1652
|
-
}).map((
|
|
1653
|
-
y.map((
|
|
1654
|
-
(
|
|
1655
|
-
const S = r.skuById[
|
|
1667
|
+
return (S = t.items) == null ? void 0 : S.find((h) => h.sku._id === F.value._id);
|
|
1668
|
+
}).map((F) => F.value), e = t.items ?? [], _ = await d(
|
|
1669
|
+
y.map((F) => F._id),
|
|
1670
|
+
(F) => {
|
|
1671
|
+
const S = r.skuById[F], h = e.find((L) => L.sku._id === S._id);
|
|
1656
1672
|
return h || {
|
|
1657
1673
|
sku: S
|
|
1658
1674
|
};
|
|
1659
1675
|
}
|
|
1660
1676
|
);
|
|
1661
|
-
_ && (_.sort((
|
|
1677
|
+
_ && (_.sort((F, S) => F.sku.code.localeCompare(S.sku.code)), t.items = _);
|
|
1662
1678
|
}
|
|
1663
1679
|
return (n, y) => {
|
|
1664
|
-
const e =
|
|
1680
|
+
const e = E("FmTextField"), _ = E("FmButton"), F = E("FmTable"), S = E("FmFormGroup"), h = E("FmForm");
|
|
1665
1681
|
return k(), K(h, {
|
|
1666
1682
|
ref_key: "formRef",
|
|
1667
1683
|
ref: a,
|
|
@@ -1669,60 +1685,60 @@ const qt = { class: "flex items-center gap-12 py-12" }, Jt = {
|
|
|
1669
1685
|
disabled: n.disabled
|
|
1670
1686
|
}, {
|
|
1671
1687
|
default: z(() => [
|
|
1672
|
-
i("div",
|
|
1673
|
-
i("div",
|
|
1688
|
+
i("div", Eo, [
|
|
1689
|
+
i("div", Bo, [
|
|
1674
1690
|
R(e, {
|
|
1675
|
-
label: x(
|
|
1691
|
+
label: x(g)("inventory.closing.form.name"),
|
|
1676
1692
|
"label-mark": "required",
|
|
1677
1693
|
modelValue: x(t).name,
|
|
1678
1694
|
"onUpdate:modelValue": y[0] || (y[0] = ($) => x(t).name = $),
|
|
1679
|
-
rules: [x(
|
|
1695
|
+
rules: [x(pt)()]
|
|
1680
1696
|
}, null, 8, ["label", "modelValue", "rules"]),
|
|
1681
1697
|
R(e, {
|
|
1682
|
-
label: x(
|
|
1698
|
+
label: x(g)("inventory.closing.form.reference"),
|
|
1683
1699
|
"label-mark": "optional",
|
|
1684
1700
|
modelValue: x(t).ref,
|
|
1685
1701
|
"onUpdate:modelValue": y[1] || (y[1] = ($) => x(t).ref = $)
|
|
1686
1702
|
}, null, 8, ["label", "modelValue"])
|
|
1687
1703
|
])
|
|
1688
1704
|
]),
|
|
1689
|
-
i("div",
|
|
1690
|
-
i("div",
|
|
1691
|
-
i("div",
|
|
1705
|
+
i("div", No, [
|
|
1706
|
+
i("div", Uo, [
|
|
1707
|
+
i("div", Lo, A(x(g)("inventory.closing.form.locations")), 1),
|
|
1692
1708
|
R(_, {
|
|
1693
1709
|
disabled: n.disabled,
|
|
1694
|
-
label: x(
|
|
1710
|
+
label: x(g)("inventory.closing.form.selectLocation"),
|
|
1695
1711
|
"prepend-icon": "add",
|
|
1696
1712
|
variant: "plain",
|
|
1697
1713
|
class: "border-2 rounded-lg border-fm-color-primary",
|
|
1698
1714
|
onClick: x(f)
|
|
1699
1715
|
}, null, 8, ["disabled", "label", "onClick"])
|
|
1700
1716
|
]),
|
|
1701
|
-
R(
|
|
1702
|
-
"column-defs": x(
|
|
1703
|
-
"row-data": x(
|
|
1717
|
+
R(F, {
|
|
1718
|
+
"column-defs": x(b),
|
|
1719
|
+
"row-data": x(u),
|
|
1704
1720
|
"shrink-at": 9999,
|
|
1705
1721
|
onRowClick: x(f),
|
|
1706
1722
|
"hide-footer": ""
|
|
1707
1723
|
}, null, 8, ["column-defs", "row-data", "onRowClick"])
|
|
1708
1724
|
]),
|
|
1709
|
-
i("div",
|
|
1710
|
-
i("div",
|
|
1711
|
-
i("div",
|
|
1725
|
+
i("div", Vo, [
|
|
1726
|
+
i("div", zo, [
|
|
1727
|
+
i("div", Go, A(x(g)("inventory.closing.form.items.title")), 1)
|
|
1712
1728
|
]),
|
|
1713
|
-
R(
|
|
1729
|
+
R(Mo, {
|
|
1714
1730
|
items: s.value,
|
|
1715
1731
|
groups: x(t).groups,
|
|
1716
1732
|
"update-item": p,
|
|
1717
1733
|
"delete-item": I,
|
|
1718
|
-
"update-groups":
|
|
1734
|
+
"update-groups": T,
|
|
1719
1735
|
disabled: n.disabled,
|
|
1720
1736
|
onReorderDefault: w,
|
|
1721
1737
|
onAddItems: l
|
|
1722
1738
|
}, null, 8, ["items", "groups", "disabled"]),
|
|
1723
1739
|
R(S, {
|
|
1724
1740
|
"model-value": x(t).items.length,
|
|
1725
|
-
rules: [x(
|
|
1741
|
+
rules: [x(ft)(1)]
|
|
1726
1742
|
}, null, 8, ["model-value", "rules"])
|
|
1727
1743
|
])
|
|
1728
1744
|
]),
|
|
@@ -1730,7 +1746,7 @@ const qt = { class: "flex items-center gap-12 py-12" }, Jt = {
|
|
|
1730
1746
|
}, 8, ["disabled"]);
|
|
1731
1747
|
};
|
|
1732
1748
|
}
|
|
1733
|
-
}),
|
|
1749
|
+
}), Ho = { class: "flex items-center" }, jo = { class: "fm-typo-en-title-md-600" }, Yo = { class: "flex justify-between" }, Ko = { class: "fm-typo-en-body-lg-600" }, Wo = { class: "flex flex-col gap-8" }, qo = { class: "flex flex-col gap-4" }, Jo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Xo = { class: "flex items-center gap-8" }, Qo = { class: "fm-typo-en-body-lg-600" }, Zo = { class: "flex gap-4" }, en = /* @__PURE__ */ Q({
|
|
1734
1750
|
__name: "ClosingTemplateDialog",
|
|
1735
1751
|
props: {
|
|
1736
1752
|
mode: {},
|
|
@@ -1740,7 +1756,7 @@ const qt = { class: "flex items-center gap-12 py-12" }, Jt = {
|
|
|
1740
1756
|
emits: ["update:show", "submitted"],
|
|
1741
1757
|
setup(c, { expose: o, emit: t }) {
|
|
1742
1758
|
var S;
|
|
1743
|
-
const
|
|
1759
|
+
const g = c, r = t, f = we(), b = he(), u = xe(), { t: a } = ne(), s = ot(g, "show");
|
|
1744
1760
|
function w() {
|
|
1745
1761
|
return {
|
|
1746
1762
|
_id: "",
|
|
@@ -1748,21 +1764,21 @@ const qt = { class: "flex items-center gap-12 py-12" }, Jt = {
|
|
|
1748
1764
|
items: []
|
|
1749
1765
|
};
|
|
1750
1766
|
}
|
|
1751
|
-
const p = N(
|
|
1767
|
+
const p = N(g.modelValue ?? w()), I = N(((S = g.modelValue) == null ? void 0 : S._id) ?? `${Math.random()}`);
|
|
1752
1768
|
Fe(
|
|
1753
|
-
() =>
|
|
1769
|
+
() => g.show,
|
|
1754
1770
|
(h) => {
|
|
1755
1771
|
var $;
|
|
1756
|
-
h && (p.value =
|
|
1772
|
+
h && (p.value = g.modelValue ?? w(), I.value = (($ = g.modelValue) == null ? void 0 : $._id) ?? `${Math.random()}`);
|
|
1757
1773
|
}
|
|
1758
1774
|
);
|
|
1759
|
-
const
|
|
1760
|
-
switch (
|
|
1761
|
-
case
|
|
1775
|
+
const T = N(!1), d = U(() => {
|
|
1776
|
+
switch (g.mode) {
|
|
1777
|
+
case te.READ:
|
|
1762
1778
|
return "";
|
|
1763
|
-
case
|
|
1779
|
+
case te.CREATE:
|
|
1764
1780
|
return a("inventory.closing.template.create.title");
|
|
1765
|
-
case
|
|
1781
|
+
case te.UPDATE:
|
|
1766
1782
|
return a("inventory.closing.template.update.title");
|
|
1767
1783
|
}
|
|
1768
1784
|
return "";
|
|
@@ -1784,53 +1800,53 @@ const qt = { class: "flex items-center gap-12 py-12" }, Jt = {
|
|
|
1784
1800
|
async function n() {
|
|
1785
1801
|
const h = p.value;
|
|
1786
1802
|
if (h) {
|
|
1787
|
-
|
|
1803
|
+
T.value = !0;
|
|
1788
1804
|
try {
|
|
1789
|
-
await f.createTemplate(h), await new Promise(($) => setTimeout($, 1e3)),
|
|
1805
|
+
await f.createTemplate(h), await new Promise(($) => setTimeout($, 1e3)), u.open({
|
|
1790
1806
|
title: a("inventory.closing.template.create.success"),
|
|
1791
1807
|
message: a("inventory.closing.template.create.successMessage"),
|
|
1792
1808
|
type: "success"
|
|
1793
1809
|
}), r("update:show", !1), r("submitted");
|
|
1794
1810
|
} catch ($) {
|
|
1795
|
-
|
|
1811
|
+
u.open({
|
|
1796
1812
|
title: a("inventory.closing.template.create.error"),
|
|
1797
1813
|
message: a("inventory.closing.template.create.errorMessage"),
|
|
1798
1814
|
type: "error"
|
|
1799
1815
|
}), console.error("Error in creating closing template", $);
|
|
1800
1816
|
} finally {
|
|
1801
|
-
|
|
1817
|
+
T.value = !1;
|
|
1802
1818
|
}
|
|
1803
1819
|
}
|
|
1804
1820
|
}
|
|
1805
1821
|
async function y() {
|
|
1806
1822
|
const h = p.value;
|
|
1807
1823
|
if (h) {
|
|
1808
|
-
|
|
1824
|
+
T.value = !0, delete h.updatedAt;
|
|
1809
1825
|
try {
|
|
1810
1826
|
await f.updateTemplate({
|
|
1811
1827
|
...h,
|
|
1812
1828
|
_rev: h._rev ?? ""
|
|
1813
|
-
}), await new Promise(($) => setTimeout($, 1e3)),
|
|
1829
|
+
}), await new Promise(($) => setTimeout($, 1e3)), u.open({
|
|
1814
1830
|
title: a("inventory.closing.template.update.success"),
|
|
1815
1831
|
message: a("inventory.closing.template.update.successMessage"),
|
|
1816
1832
|
type: "success"
|
|
1817
1833
|
}), r("update:show", !1), r("submitted");
|
|
1818
1834
|
} catch ($) {
|
|
1819
|
-
|
|
1835
|
+
u.open({
|
|
1820
1836
|
title: a("inventory.closing.template.update.error"),
|
|
1821
1837
|
message: a("inventory.closing.template.update.errorMessage"),
|
|
1822
1838
|
type: "error"
|
|
1823
1839
|
}), console.error("Error in updating closing template", $);
|
|
1824
1840
|
} finally {
|
|
1825
|
-
|
|
1841
|
+
T.value = !1;
|
|
1826
1842
|
}
|
|
1827
1843
|
}
|
|
1828
1844
|
}
|
|
1829
1845
|
function e() {
|
|
1830
|
-
switch (
|
|
1831
|
-
case
|
|
1846
|
+
switch (g.mode) {
|
|
1847
|
+
case te.CREATE:
|
|
1832
1848
|
return n();
|
|
1833
|
-
case
|
|
1849
|
+
case te.UPDATE:
|
|
1834
1850
|
return y();
|
|
1835
1851
|
}
|
|
1836
1852
|
}
|
|
@@ -1838,21 +1854,21 @@ const qt = { class: "flex items-center gap-12 py-12" }, Jt = {
|
|
|
1838
1854
|
var h, $;
|
|
1839
1855
|
($ = (h = l.value) == null ? void 0 : h.validateInputs) == null || $.call(h);
|
|
1840
1856
|
}
|
|
1841
|
-
function
|
|
1842
|
-
p.value &&
|
|
1857
|
+
function F() {
|
|
1858
|
+
p.value && b.exportSingleTemplate(p.value);
|
|
1843
1859
|
}
|
|
1844
1860
|
return (h, $) => {
|
|
1845
|
-
const L =
|
|
1846
|
-
return k(), K(
|
|
1861
|
+
const L = E("FmMenuDivider"), V = E("FmCard"), Z = E("FmButton"), se = E("FmSideSheet");
|
|
1862
|
+
return k(), K(se, {
|
|
1847
1863
|
modelValue: x(s),
|
|
1848
|
-
"onUpdate:modelValue": $[2] || ($[2] = (
|
|
1864
|
+
"onUpdate:modelValue": $[2] || ($[2] = (H) => Ke(s) ? s.value = H : null),
|
|
1849
1865
|
"dismiss-away": "",
|
|
1850
1866
|
"close-button": "",
|
|
1851
1867
|
"max-width": 9999
|
|
1852
1868
|
}, {
|
|
1853
1869
|
"side-sheet-header": z(() => [
|
|
1854
|
-
i("div",
|
|
1855
|
-
i("div",
|
|
1870
|
+
i("div", Ho, [
|
|
1871
|
+
i("div", jo, A(d.value), 1)
|
|
1856
1872
|
])
|
|
1857
1873
|
]),
|
|
1858
1874
|
default: z(() => [
|
|
@@ -1862,23 +1878,23 @@ const qt = { class: "flex items-center gap-12 py-12" }, Jt = {
|
|
|
1862
1878
|
class: "flex flex-col gap-8 px-12 py-16 mb-16"
|
|
1863
1879
|
}, {
|
|
1864
1880
|
default: z(() => {
|
|
1865
|
-
var
|
|
1881
|
+
var H;
|
|
1866
1882
|
return [
|
|
1867
|
-
i("div",
|
|
1868
|
-
i("div",
|
|
1883
|
+
i("div", Yo, [
|
|
1884
|
+
i("div", Ko, A(x(a)("inventory.transfer.template.details.templateSummary")), 1)
|
|
1869
1885
|
]),
|
|
1870
1886
|
R(L),
|
|
1871
|
-
i("div",
|
|
1872
|
-
i("div",
|
|
1873
|
-
i("div",
|
|
1874
|
-
i("div",
|
|
1875
|
-
i("div",
|
|
1876
|
-
|
|
1877
|
-
(
|
|
1878
|
-
|
|
1879
|
-
], 64)) :
|
|
1887
|
+
i("div", Wo, [
|
|
1888
|
+
i("div", qo, [
|
|
1889
|
+
i("div", Jo, A(x(a)("inventory.transfer.receiveRequest.details.updatedAt")), 1),
|
|
1890
|
+
i("div", Xo, [
|
|
1891
|
+
i("div", Qo, [
|
|
1892
|
+
X(A(x(ge)(p.value.updatedAt)) + " ", 1),
|
|
1893
|
+
(H = p.value.updatedBy) != null && H.name ? (k(), D(O, { key: 0 }, [
|
|
1894
|
+
X(" (" + A(p.value.updatedBy.name) + ") ", 1)
|
|
1895
|
+
], 64)) : G("", !0)
|
|
1880
1896
|
]),
|
|
1881
|
-
R(
|
|
1897
|
+
R(gt, {
|
|
1882
1898
|
"closing-id": p.value._id
|
|
1883
1899
|
}, null, 8, ["closing-id"])
|
|
1884
1900
|
])
|
|
@@ -1887,38 +1903,38 @@ const qt = { class: "flex items-center gap-12 py-12" }, Jt = {
|
|
|
1887
1903
|
];
|
|
1888
1904
|
}),
|
|
1889
1905
|
_: 1
|
|
1890
|
-
})) :
|
|
1891
|
-
(k(), K(
|
|
1906
|
+
})) : G("", !0),
|
|
1907
|
+
(k(), K(Oo, {
|
|
1892
1908
|
class: "w-full",
|
|
1893
1909
|
ref_key: "formRef",
|
|
1894
1910
|
ref: l,
|
|
1895
1911
|
onValidationSuccess: e,
|
|
1896
1912
|
"model-value": p.value,
|
|
1897
|
-
"onUpdate:modelValue": $[0] || ($[0] = (
|
|
1898
|
-
disabled:
|
|
1913
|
+
"onUpdate:modelValue": $[0] || ($[0] = (H) => p.value = H),
|
|
1914
|
+
disabled: T.value,
|
|
1899
1915
|
key: I.value
|
|
1900
1916
|
}, null, 8, ["model-value", "disabled"]))
|
|
1901
1917
|
]),
|
|
1902
1918
|
"side-sheet-footer": z(() => [
|
|
1903
|
-
i("div",
|
|
1904
|
-
R(
|
|
1905
|
-
loading:
|
|
1919
|
+
i("div", Zo, [
|
|
1920
|
+
R(Z, {
|
|
1921
|
+
loading: T.value,
|
|
1906
1922
|
label: x(a)("common.save"),
|
|
1907
1923
|
onClick: _
|
|
1908
1924
|
}, null, 8, ["loading", "label"]),
|
|
1909
|
-
h.mode === x(
|
|
1925
|
+
h.mode === x(te).UPDATE ? (k(), K(Z, {
|
|
1910
1926
|
key: 0,
|
|
1911
|
-
disabled:
|
|
1927
|
+
disabled: T.value,
|
|
1912
1928
|
variant: "secondary",
|
|
1913
1929
|
label: x(a)("inventory.common.export"),
|
|
1914
1930
|
"prepend-icon": "download",
|
|
1915
|
-
onClick:
|
|
1916
|
-
}, null, 8, ["disabled", "label"])) :
|
|
1917
|
-
R(
|
|
1918
|
-
disabled:
|
|
1931
|
+
onClick: F
|
|
1932
|
+
}, null, 8, ["disabled", "label"])) : G("", !0),
|
|
1933
|
+
R(Z, {
|
|
1934
|
+
disabled: T.value,
|
|
1919
1935
|
variant: "tertiary",
|
|
1920
1936
|
label: x(a)("common.close"),
|
|
1921
|
-
onClick: $[1] || ($[1] = (
|
|
1937
|
+
onClick: $[1] || ($[1] = (H) => r("update:show", !1))
|
|
1922
1938
|
}, null, 8, ["disabled", "label"])
|
|
1923
1939
|
])
|
|
1924
1940
|
]),
|
|
@@ -1926,34 +1942,34 @@ const qt = { class: "flex items-center gap-12 py-12" }, Jt = {
|
|
|
1926
1942
|
}, 8, ["modelValue"]);
|
|
1927
1943
|
};
|
|
1928
1944
|
}
|
|
1929
|
-
}),
|
|
1930
|
-
function
|
|
1945
|
+
}), tn = {};
|
|
1946
|
+
function on(c, o) {
|
|
1931
1947
|
return k(), D("div");
|
|
1932
1948
|
}
|
|
1933
|
-
const
|
|
1949
|
+
const nn = /* @__PURE__ */ ht(tn, [["render", on]]), sn = { class: "flex flex-col gap-40" }, an = { key: 0 }, ln = {
|
|
1934
1950
|
key: 1,
|
|
1935
1951
|
class: "flex gap-8 items-center"
|
|
1936
|
-
},
|
|
1952
|
+
}, rn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary" }, cn = {
|
|
1937
1953
|
key: 2,
|
|
1938
1954
|
class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary"
|
|
1939
|
-
},
|
|
1955
|
+
}, mn = {
|
|
1940
1956
|
key: 3,
|
|
1941
1957
|
class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary flex flex-col gap-12"
|
|
1942
|
-
},
|
|
1958
|
+
}, dn = { class: "fm-typo-en-body-md-600" }, un = { class: "fm-typo-en-body-md-600" }, pn = { key: 4 }, fn = { class: "fm-typo-en-body-md-600" }, yn = { class: "fm-typo-en-body-md-600" }, vn = { class: "flex sm:flex-col xs:flex-col justify-end gap-8 w-full mb-16" }, gn = /* @__PURE__ */ Q({
|
|
1943
1959
|
__name: "ClosingTemplatePublish",
|
|
1944
1960
|
emits: ["close"],
|
|
1945
1961
|
setup(c, { emit: o }) {
|
|
1946
|
-
const t = N(!1),
|
|
1962
|
+
const t = N(!1), g = xe(), r = we(), f = ke(), { t: b } = ne(), u = o;
|
|
1947
1963
|
async function a() {
|
|
1948
1964
|
t.value = !0;
|
|
1949
1965
|
try {
|
|
1950
|
-
await r.startNewPublish().delayed(1e3),
|
|
1966
|
+
await r.startNewPublish().delayed(1e3), g.open({
|
|
1951
1967
|
title: "Success",
|
|
1952
1968
|
message: "You may refresh after a while to review publish status",
|
|
1953
1969
|
type: "success"
|
|
1954
1970
|
}), p();
|
|
1955
1971
|
} catch (I) {
|
|
1956
|
-
|
|
1972
|
+
g.open({
|
|
1957
1973
|
title: "Something went wrong",
|
|
1958
1974
|
message: "Please try again",
|
|
1959
1975
|
type: "error"
|
|
@@ -1966,56 +1982,56 @@ const en = /* @__PURE__ */ bt(Qo, [["render", Zo]]), tn = { class: "flex flex-co
|
|
|
1966
1982
|
() => f.templates.length && (!s.value || s.value.outlets.length === s.value.completed.length)
|
|
1967
1983
|
);
|
|
1968
1984
|
function p() {
|
|
1969
|
-
|
|
1985
|
+
u("close");
|
|
1970
1986
|
}
|
|
1971
|
-
return (I,
|
|
1972
|
-
const
|
|
1973
|
-
return k(), D("div",
|
|
1974
|
-
x(f).templates.length ? t.value ? (k(), D("div",
|
|
1987
|
+
return (I, T) => {
|
|
1988
|
+
const d = E("FmCircularProgress"), l = E("i18n-t"), n = E("FmButton");
|
|
1989
|
+
return k(), D("div", sn, [
|
|
1990
|
+
x(f).templates.length ? t.value ? (k(), D("div", ln, [
|
|
1975
1991
|
i("div", null, [
|
|
1976
|
-
R(
|
|
1992
|
+
R(d, {
|
|
1977
1993
|
size: "md",
|
|
1978
1994
|
color: "neutral-gray-300"
|
|
1979
1995
|
})
|
|
1980
1996
|
]),
|
|
1981
|
-
i("div",
|
|
1982
|
-
i("span", null, A(x(
|
|
1997
|
+
i("div", rn, [
|
|
1998
|
+
i("span", null, A(x(b)("inventory.closing.template.publish.publishing")), 1)
|
|
1983
1999
|
])
|
|
1984
|
-
])) : s.value ? s.value.outlets.length === s.value.completed.length ? (k(), D("div",
|
|
2000
|
+
])) : s.value ? s.value.outlets.length === s.value.completed.length ? (k(), D("div", mn, [
|
|
1985
2001
|
R(l, {
|
|
1986
2002
|
keypath: "inventory.closing.template.publish.recentlyPublishedAt",
|
|
1987
2003
|
tag: "p"
|
|
1988
2004
|
}, {
|
|
1989
2005
|
started: z(() => [
|
|
1990
|
-
i("span",
|
|
2006
|
+
i("span", dn, A(x(ge)(new Date(s.value.createdAt))), 1)
|
|
1991
2007
|
]),
|
|
1992
2008
|
finished: z(() => [
|
|
1993
|
-
i("span",
|
|
2009
|
+
i("span", un, A(x(ge)(new Date(s.value.updatedAt))), 1)
|
|
1994
2010
|
]),
|
|
1995
2011
|
_: 1
|
|
1996
2012
|
}),
|
|
1997
|
-
i("p", null, A(x(
|
|
1998
|
-
])) : (k(), D("div",
|
|
2013
|
+
i("p", null, A(x(b)("inventory.closing.template.publish.message")), 1)
|
|
2014
|
+
])) : (k(), D("div", pn, [
|
|
1999
2015
|
R(l, {
|
|
2000
2016
|
keypath: "inventory.closing.template.publish.stillPublishing",
|
|
2001
2017
|
tag: "p"
|
|
2002
2018
|
}, {
|
|
2003
2019
|
started: z(() => [
|
|
2004
|
-
i("span",
|
|
2020
|
+
i("span", fn, A(x(ge)(new Date(s.value.createdAt))), 1)
|
|
2005
2021
|
]),
|
|
2006
2022
|
progress: z(() => [
|
|
2007
|
-
i("span",
|
|
2023
|
+
i("span", yn, " (" + A(s.value.completed.length) + "/" + A(s.value.outlets.length) + " completed) ", 1)
|
|
2008
2024
|
]),
|
|
2009
2025
|
_: 1
|
|
2010
2026
|
}),
|
|
2011
|
-
|
|
2027
|
+
X(" Your recent publishing task is still pending (" + A(s.value.completed.length) + " / " + A(s.value.outlets.length) + "). Please wait until all publishing task has completed. ", 1)
|
|
2028
|
+
])) : (k(), D("div", cn, [
|
|
2029
|
+
i("p", null, A(x(b)("inventory.closing.template.publish.noRecentActivity")), 1),
|
|
2030
|
+
i("p", null, A(x(b)("inventory.closing.template.publish.message")), 1)
|
|
2012
2031
|
])) : (k(), D("div", an, [
|
|
2013
|
-
i("p", null, A(x(
|
|
2014
|
-
i("p", null, A(x(g)("inventory.closing.template.publish.message")), 1)
|
|
2015
|
-
])) : (k(), D("div", on, [
|
|
2016
|
-
i("p", null, A(x(g)("inventory.closing.template.publish.nothingToPublish")), 1)
|
|
2032
|
+
i("p", null, A(x(b)("inventory.closing.template.publish.nothingToPublish")), 1)
|
|
2017
2033
|
])),
|
|
2018
|
-
i("div",
|
|
2034
|
+
i("div", vn, [
|
|
2019
2035
|
R(n, {
|
|
2020
2036
|
disabled: !w.value,
|
|
2021
2037
|
loading: t.value,
|
|
@@ -2031,12 +2047,12 @@ const en = /* @__PURE__ */ bt(Qo, [["render", Zo]]), tn = { class: "flex flex-co
|
|
|
2031
2047
|
]);
|
|
2032
2048
|
};
|
|
2033
2049
|
}
|
|
2034
|
-
}),
|
|
2050
|
+
}), bn = { class: "flex-1 flex flex-col gap-8" }, hn = { class: "flex flex-col" }, _n = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, xn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, wn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, kn = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, qn = /* @__PURE__ */ Q({
|
|
2035
2051
|
__name: "ClosingTemplateView",
|
|
2036
2052
|
setup(c) {
|
|
2037
|
-
const { t: o } =
|
|
2053
|
+
const { t: o } = ne(), { createTemplate: t, updateTemplate: g, exportTemplates: r, importTemplates: f } = he(), { templateDialogProps: b, templateDetailsProps: u } = Ne(he()), a = Ie(), s = _e(), w = ke(), p = Qe(), { breakpoints: I } = nt();
|
|
2038
2054
|
a.watchLocation(w.fetchTemplates);
|
|
2039
|
-
const
|
|
2055
|
+
const T = U(() => w.loading), d = N(""), l = U(() => I.value.xs || I.value.sm), n = U(() => l.value ? 10 : 20);
|
|
2040
2056
|
function y(S) {
|
|
2041
2057
|
switch (S) {
|
|
2042
2058
|
case Y.Add:
|
|
@@ -2054,7 +2070,7 @@ const en = /* @__PURE__ */ bt(Qo, [["render", Zo]]), tn = { class: "flex flex-co
|
|
|
2054
2070
|
function e() {
|
|
2055
2071
|
s.open({
|
|
2056
2072
|
title: "Publish closing templates",
|
|
2057
|
-
contentComponent:
|
|
2073
|
+
contentComponent: gn,
|
|
2058
2074
|
contentComponentProps: {
|
|
2059
2075
|
onClose() {
|
|
2060
2076
|
s.close();
|
|
@@ -2065,7 +2081,7 @@ const en = /* @__PURE__ */ bt(Qo, [["render", Zo]]), tn = { class: "flex flex-co
|
|
|
2065
2081
|
function _(S) {
|
|
2066
2082
|
return S;
|
|
2067
2083
|
}
|
|
2068
|
-
const
|
|
2084
|
+
const F = U(() => l.value ? [
|
|
2069
2085
|
{
|
|
2070
2086
|
label: o("inventory.closing.template.create.title"),
|
|
2071
2087
|
value: Y.Add,
|
|
@@ -2121,16 +2137,16 @@ const en = /* @__PURE__ */ bt(Qo, [["render", Zo]]), tn = { class: "flex flex-co
|
|
|
2121
2137
|
}
|
|
2122
2138
|
]);
|
|
2123
2139
|
return (S, h) => {
|
|
2124
|
-
const $ =
|
|
2125
|
-
return k(), D(
|
|
2126
|
-
R(
|
|
2140
|
+
const $ = E("FmTable");
|
|
2141
|
+
return k(), D(O, null, [
|
|
2142
|
+
R(Ze, {
|
|
2127
2143
|
title: x(o)("inventory.closing.template.title"),
|
|
2128
|
-
actions:
|
|
2144
|
+
actions: F.value,
|
|
2129
2145
|
"onClick:action": y
|
|
2130
2146
|
}, {
|
|
2131
2147
|
default: z(() => [
|
|
2132
2148
|
i("div", {
|
|
2133
|
-
class:
|
|
2149
|
+
class: oe([
|
|
2134
2150
|
"flex flex-col gap-8 max-h-full",
|
|
2135
2151
|
{
|
|
2136
2152
|
"p-0": l.value,
|
|
@@ -2138,60 +2154,60 @@ const en = /* @__PURE__ */ bt(Qo, [["render", Zo]]), tn = { class: "flex flex-co
|
|
|
2138
2154
|
}
|
|
2139
2155
|
])
|
|
2140
2156
|
}, [
|
|
2141
|
-
R(
|
|
2157
|
+
R(ut, {
|
|
2142
2158
|
searchable: "",
|
|
2143
|
-
search:
|
|
2144
|
-
"onUpdate:search": h[0] || (h[0] = (L) =>
|
|
2159
|
+
search: d.value,
|
|
2160
|
+
"onUpdate:search": h[0] || (h[0] = (L) => d.value = L)
|
|
2145
2161
|
}, null, 8, ["search"]),
|
|
2146
2162
|
R($, {
|
|
2147
2163
|
style: Te(x(p).tableHeight),
|
|
2148
2164
|
"column-defs": x(w).columnDefs,
|
|
2149
2165
|
"row-data": x(w).templates,
|
|
2150
|
-
"search-value":
|
|
2151
|
-
loading:
|
|
2152
|
-
onRowClick: h[1] || (h[1] = (L) => x(
|
|
2166
|
+
"search-value": d.value,
|
|
2167
|
+
loading: T.value,
|
|
2168
|
+
onRowClick: h[1] || (h[1] = (L) => x(g)(L.original)),
|
|
2153
2169
|
"page-size": n.value
|
|
2154
2170
|
}, {
|
|
2155
2171
|
"list-row": z((L) => [
|
|
2156
|
-
R(
|
|
2172
|
+
R(bt, {
|
|
2157
2173
|
row: L,
|
|
2158
|
-
onRowClick: (V) => x(
|
|
2174
|
+
onRowClick: (V) => x(g)(V)
|
|
2159
2175
|
}, {
|
|
2160
2176
|
default: z((V) => {
|
|
2161
|
-
var
|
|
2177
|
+
var Z, se, H, ee, ie, ce, me, de, ae, re, ue, m, v, C, P, M, q, B, W, j, le, Me;
|
|
2162
2178
|
return [
|
|
2163
|
-
i("div",
|
|
2164
|
-
i("div",
|
|
2165
|
-
i("div",
|
|
2179
|
+
i("div", bn, [
|
|
2180
|
+
i("div", hn, [
|
|
2181
|
+
i("div", _n, [
|
|
2166
2182
|
R(x(ve), {
|
|
2167
|
-
render: (
|
|
2168
|
-
props: (
|
|
2183
|
+
render: (H = (se = (Z = V._id) == null ? void 0 : Z.column) == null ? void 0 : se.columnDef) == null ? void 0 : H.cell,
|
|
2184
|
+
props: (ie = (ee = V._id) == null ? void 0 : ee.getContext) == null ? void 0 : ie.call(ee)
|
|
2169
2185
|
}, null, 8, ["render", "props"])
|
|
2170
2186
|
]),
|
|
2171
|
-
i("div",
|
|
2187
|
+
i("div", xn, [
|
|
2172
2188
|
R(x(ve), {
|
|
2173
|
-
render: (
|
|
2174
|
-
props: (
|
|
2189
|
+
render: (de = (me = (ce = V.name) == null ? void 0 : ce.column) == null ? void 0 : me.columnDef) == null ? void 0 : de.cell,
|
|
2190
|
+
props: (re = (ae = V.name) == null ? void 0 : ae.getContext) == null ? void 0 : re.call(ae)
|
|
2175
2191
|
}, null, 8, ["render", "props"])
|
|
2176
2192
|
]),
|
|
2177
2193
|
i("div", null, A((ue = L.original.locations) != null && ue.length ? x(o)("inventory.closing.table.enabledForN", {
|
|
2178
|
-
count: ((
|
|
2194
|
+
count: ((m = L.original.locations) == null ? void 0 : m.length) ?? 0
|
|
2179
2195
|
}) : x(o)("inventory.closing.table.enabledForAll")), 1),
|
|
2180
|
-
i("div",
|
|
2181
|
-
...L.original.items.slice(0, 3).map((
|
|
2196
|
+
i("div", wn, A([
|
|
2197
|
+
...L.original.items.slice(0, 3).map((He) => He.sku.name),
|
|
2182
2198
|
...L.original.items.length >= 3 ? [`and ${L.original.items.length - 3} more items`] : []
|
|
2183
2199
|
].join(", ")), 1),
|
|
2184
|
-
i("div",
|
|
2200
|
+
i("div", kn, [
|
|
2185
2201
|
R(x(ve), {
|
|
2186
|
-
render: (P = (
|
|
2187
|
-
props: (
|
|
2202
|
+
render: (P = (C = (v = V.ref) == null ? void 0 : v.column) == null ? void 0 : C.columnDef) == null ? void 0 : P.cell,
|
|
2203
|
+
props: (q = (M = V.ref) == null ? void 0 : M.getContext) == null ? void 0 : q.call(M)
|
|
2188
2204
|
}, null, 8, ["render", "props"])
|
|
2189
2205
|
])
|
|
2190
2206
|
]),
|
|
2191
2207
|
i("div", null, [
|
|
2192
2208
|
R(x(ve), {
|
|
2193
|
-
render: (
|
|
2194
|
-
props: (Me = (
|
|
2209
|
+
render: (j = (W = (B = V.status) == null ? void 0 : B.column) == null ? void 0 : W.columnDef) == null ? void 0 : j.cell,
|
|
2210
|
+
props: (Me = (le = V.status) == null ? void 0 : le.getContext) == null ? void 0 : Me.call(le)
|
|
2195
2211
|
}, null, 8, ["render", "props"])
|
|
2196
2212
|
])
|
|
2197
2213
|
])
|
|
@@ -2206,9 +2222,9 @@ const en = /* @__PURE__ */ bt(Qo, [["render", Zo]]), tn = { class: "flex flex-co
|
|
|
2206
2222
|
]),
|
|
2207
2223
|
_: 1
|
|
2208
2224
|
}, 8, ["title", "actions"]),
|
|
2209
|
-
(k(), K(
|
|
2210
|
-
R(
|
|
2211
|
-
R(
|
|
2225
|
+
(k(), K(We, { to: "body" }, [
|
|
2226
|
+
R(nn, qe(Je(x(u))), null, 16),
|
|
2227
|
+
R(en, Xe(x(b), {
|
|
2212
2228
|
onSubmitted: h[2] || (h[2] = (L) => x(w).fetchTemplates())
|
|
2213
2229
|
}), null, 16)
|
|
2214
2230
|
]))
|
|
@@ -2217,5 +2233,5 @@ const en = /* @__PURE__ */ bt(Qo, [["render", Zo]]), tn = { class: "flex flex-co
|
|
|
2217
2233
|
}
|
|
2218
2234
|
});
|
|
2219
2235
|
export {
|
|
2220
|
-
|
|
2236
|
+
qn as default
|
|
2221
2237
|
};
|