@feedmepos/mf-inventory-portal 0.0.22-dev.29 → 0.0.22-dev.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ApprovalView-Ba-tUg0r.js → ApprovalView-BowcCo8d.js} +4 -4
- package/dist/{BindingsDialog-BzE7RozX.js → BindingsDialog-CmmLVQTN.js} +1 -1
- package/dist/{BindingsPicker-21frBXLS.js → BindingsPicker-BErHbcxb.js} +1 -1
- package/dist/{BindingsTable-b5C-I-cP.js → BindingsTable-hrfbN6tX.js} +1 -1
- package/dist/{ClosingTemplateView-DMBAODHP.js → ClosingTemplateView-BVefCGpC.js} +374 -370
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DeX65Yyd.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CXHh_Bti.js} +1 -1
- package/dist/IngredientsView-BqnUckSv.js +1817 -0
- package/dist/{IntegrationView-BMrUQaFT.js → IntegrationView-BEdAKS1I.js} +120 -120
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-D0Yw7F_u.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-pr7Sb7Om.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-IS1pDkV9.js → PremiumBadge.vue_vue_type_script_setup_true_lang-DsYwNO5N.js} +1 -1
- package/dist/{PurchaseOrderPrintPreview-CdOwEm2W.js → PurchaseOrderPrintPreview-DzaS_c8R.js} +1 -1
- package/dist/{ReceiveRequestView-B86diRXc.js → ReceiveRequestView-CU-bhIjl.js} +6 -6
- package/dist/{RecipeView-7zB4lKdK.js → RecipeView-CmETsz5e.js} +3 -3
- package/dist/{StockView-zoWR3C4k.js → StockView-BgmjwPbh.js} +6 -6
- package/dist/{SupplierView-C-1jW5ON.js → SupplierView-CDm5q1th.js} +3 -3
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-BWItuAd0.js → TransferDetails.vue_vue_type_script_setup_true_lang-BZJyhJu4.js} +4 -4
- package/dist/TransferDialog.vue_vue_type_script_setup_true_lang-lybenWiw.js +1678 -0
- package/dist/TransferTemplateView-CSQ2XxFU.js +1232 -0
- package/dist/{UnitView-yFNEgTl_.js → UnitView-D7bcDkOX.js} +4 -4
- package/dist/{WarehouseView-CregM24b.js → WarehouseView-BJAKVdRs.js} +2 -2
- package/dist/api/inventory.d.ts +71 -82
- package/dist/{app-BsDFpmXX.js → app-A8ykBdGf.js} +12514 -12256
- package/dist/app.js +1 -1
- package/dist/components/FmFilterableMenuOptions.vue.d.ts +54 -0
- package/dist/{decimal-B4_Y3KEm.js → decimal-BC4EGBAX.js} +1 -1
- package/dist/{defineDeepModel-BYWYdjn7.js → defineDeepModel-Ckfkwau_.js} +3 -3
- package/dist/{format-time-from-id-xHkyagtQ.js → format-time-from-id-o1plVFRH.js} +3 -3
- package/dist/{id-to-date-BZG9rZhi.js → id-to-date-DyPIToei.js} +1 -1
- package/dist/{purchase-order-transaction-type-B2Vf-MS0.js → purchase-order-transaction-type-skN4AmEj.js} +3 -3
- package/dist/stores/inventory.d.ts +15 -0
- package/dist/stores/location.d.ts +420 -486
- package/dist/stores/netsuite.d.ts +1 -1
- package/dist/{supplier-B9WHfMl-.js → supplier-DV3Tg4TT.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-template-enabled-locations-2-DMyd7rbX.js → use-template-enabled-locations-2-u_kejm-N.js} +1 -1
- package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +852 -984
- package/dist/views/closing-template/composables/use-closing-template-table.d.ts +852 -984
- package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +996 -58
- package/dist/views/receive-request/composables/use-receive-request-form.d.ts +1511 -104
- package/dist/views/receive-request/composables/use-receive-request-table.d.ts +1417 -10
- package/dist/views/transfer-template/components/transfer-template-form/composables/use-template-enabled-locations.d.ts +71 -82
- package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +1272 -2652
- package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +399 -859
- package/dist/views/transfer-template/helpers/remove-deleted-skus.helper.d.ts +108 -223
- package/dist/{xlsx-BFdyFL_3.js → xlsx-CrHTSBmd.js} +1 -1
- package/dist/{xlsx.util-UUCw3Kgc.js → xlsx.util-hjzkZFnf.js} +2 -2
- package/package.json +1 -1
- package/dist/IngredientsView-C6Lxkg-R.js +0 -1758
- package/dist/TransferDialog.vue_vue_type_script_setup_true_lang-5u4NM7G5.js +0 -1522
- package/dist/TransferTemplateView-DnKSCXki.js +0 -1210
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { u as Ue, _ as Ee, a as ze } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-
|
|
3
|
-
import { useCoreStore as Ne, useI18n as
|
|
4
|
-
import { useDialog as Q, useSnackbar as W, FmButtonVariant as be, components as
|
|
1
|
+
import { ref as F, h as x, computed as P, defineComponent as Y, openBlock as k, createElementBlock as S, createElementVNode as f, toDisplayString as I, createVNode as _, unref as c, Fragment as _e, renderList as Ce, resolveComponent as V, createBlock as B, withCtx as R, watch as Me, isRef as Pe, createTextVNode as ve, normalizeClass as Fe, normalizeStyle as Se, Teleport as Ae, normalizeProps as Ve, guardReactiveProps as Ie, mergeProps as Re } from "vue";
|
|
2
|
+
import { u as Ue, _ as Ee, a as ze } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CXHh_Bti.js";
|
|
3
|
+
import { useCoreStore as Ne, useI18n as J } from "@feedmepos/mf-common";
|
|
4
|
+
import { useDialog as Q, useSnackbar as W, FmButtonVariant as be, components as U, useProxiedModel as Be, useBreakpoints as Le } from "@feedmepos/ui-library";
|
|
5
5
|
import { defineStore as we, storeToRefs as Ye } from "pinia";
|
|
6
|
-
import { F as
|
|
7
|
-
import { o as je, c as xe, j as ke, u as Ke, R as He, z as Je, i as qe, T as he } from "./app-
|
|
8
|
-
import { c as
|
|
9
|
-
import { f as
|
|
6
|
+
import { F as E, D as ye, R as z } from "./row-action.enum-PMKMRrZR.js";
|
|
7
|
+
import { o as je, c as xe, j as ke, u as Ke, R as Ge, A as He, z as Je, i as qe, T as he } from "./app-A8ykBdGf.js";
|
|
8
|
+
import { c as Oe, F as N, _ as Te } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
|
|
9
|
+
import { f as Qe } from "./format-time-from-id-o1plVFRH.js";
|
|
10
10
|
import "vue-router";
|
|
11
|
-
import { d as
|
|
12
|
-
import { u as
|
|
13
|
-
const
|
|
11
|
+
import { d as We } from "./defineDeepModel-Ckfkwau_.js";
|
|
12
|
+
import { u as Xe } from "./use-template-enabled-locations-2-u_kejm-N.js";
|
|
13
|
+
const q = je((m, g) => {
|
|
14
14
|
function v() {
|
|
15
|
-
var
|
|
16
|
-
return `business_${((
|
|
15
|
+
var s;
|
|
16
|
+
return `business_${((s = Ne().currentBusiness.value) == null ? void 0 : s._id) ?? ""}`;
|
|
17
17
|
}
|
|
18
18
|
return {
|
|
19
19
|
async getRecentPublishingJob() {
|
|
20
|
-
const
|
|
21
|
-
return g.get(
|
|
20
|
+
const t = v(), o = `${m.inventoryBackendUrl}/${t}/closing-template/publish/recent`;
|
|
21
|
+
return g.get(o);
|
|
22
22
|
},
|
|
23
23
|
async startNewPublish() {
|
|
24
|
-
const
|
|
25
|
-
return g.post(
|
|
24
|
+
const t = v(), o = `${m.inventoryBackendUrl}/${t}/closing-template/publish`;
|
|
25
|
+
return g.post(o);
|
|
26
26
|
},
|
|
27
|
-
async getTemplate(
|
|
28
|
-
const
|
|
29
|
-
return g.get(
|
|
27
|
+
async getTemplate(t) {
|
|
28
|
+
const o = v(), s = `${m.inventoryBackendUrl}/${o}/closing-template/${t}`;
|
|
29
|
+
return g.get(s);
|
|
30
30
|
},
|
|
31
31
|
async readTemplates() {
|
|
32
|
-
const
|
|
33
|
-
return g.get(
|
|
32
|
+
const t = v(), o = `${m.inventoryBackendUrl}/${t}/closing-template`;
|
|
33
|
+
return g.get(o);
|
|
34
34
|
},
|
|
35
|
-
async createTemplate(
|
|
36
|
-
const
|
|
37
|
-
return g.post(
|
|
35
|
+
async createTemplate(t) {
|
|
36
|
+
const o = v(), s = `${m.inventoryBackendUrl}/${o}/closing-template`;
|
|
37
|
+
return g.post(s, t);
|
|
38
38
|
},
|
|
39
|
-
async updateTemplate(
|
|
40
|
-
const
|
|
41
|
-
return g.put(
|
|
39
|
+
async updateTemplate(t) {
|
|
40
|
+
const o = v(), s = `${m.inventoryBackendUrl}/${o}/closing-template`;
|
|
41
|
+
return g.put(s, t);
|
|
42
42
|
},
|
|
43
|
-
async deleteTemplate(
|
|
44
|
-
const
|
|
45
|
-
return g.delete(
|
|
43
|
+
async deleteTemplate(t) {
|
|
44
|
+
const o = v(), s = `${m.inventoryBackendUrl}/${o}/closing-template`;
|
|
45
|
+
return g.delete(s, { _id: t._id, _rev: t._rev });
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
48
|
}), O = we("closingTemplateActions", () => {
|
|
49
|
-
const m = Q(), g = W(), v =
|
|
50
|
-
function
|
|
51
|
-
|
|
52
|
-
mode:
|
|
49
|
+
const m = Q(), g = W(), v = q(), t = F({});
|
|
50
|
+
function o() {
|
|
51
|
+
t.value = {
|
|
52
|
+
mode: E.CREATE,
|
|
53
53
|
show: !0,
|
|
54
54
|
"onUpdate:show"(d) {
|
|
55
|
-
|
|
55
|
+
t.value.show = d;
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
|
-
function
|
|
60
|
-
|
|
61
|
-
mode:
|
|
59
|
+
function s(d) {
|
|
60
|
+
t.value = {
|
|
61
|
+
mode: E.UPDATE,
|
|
62
62
|
modelValue: d,
|
|
63
63
|
show: !0,
|
|
64
64
|
"onUpdate:show"(u) {
|
|
65
|
-
|
|
65
|
+
t.value.show = u;
|
|
66
66
|
}
|
|
67
67
|
};
|
|
68
68
|
}
|
|
@@ -89,7 +89,7 @@ const G = je((m, g) => {
|
|
|
89
89
|
u.value = !0;
|
|
90
90
|
const [p] = await Promise.allSettled([
|
|
91
91
|
v.deleteTemplate(d),
|
|
92
|
-
new Promise((
|
|
92
|
+
new Promise((w) => setTimeout(w, 1e3))
|
|
93
93
|
]);
|
|
94
94
|
if (p.status === "rejected") throw p.reason;
|
|
95
95
|
g.open({
|
|
@@ -107,71 +107,71 @@ const G = je((m, g) => {
|
|
|
107
107
|
}
|
|
108
108
|
});
|
|
109
109
|
}
|
|
110
|
-
const
|
|
111
|
-
function
|
|
112
|
-
|
|
110
|
+
const n = F({});
|
|
111
|
+
function r(d) {
|
|
112
|
+
n.value = {
|
|
113
113
|
template: d,
|
|
114
114
|
show: !0,
|
|
115
115
|
"onUpdate:show"(u) {
|
|
116
|
-
|
|
116
|
+
n.value.show = u;
|
|
117
117
|
},
|
|
118
118
|
"onAction:edit"() {
|
|
119
|
-
|
|
119
|
+
n.value.show = !1, s(xe(d));
|
|
120
120
|
}
|
|
121
121
|
};
|
|
122
122
|
}
|
|
123
123
|
return {
|
|
124
|
-
createTemplate:
|
|
125
|
-
viewTemplate:
|
|
126
|
-
updateTemplate:
|
|
124
|
+
createTemplate: o,
|
|
125
|
+
viewTemplate: r,
|
|
126
|
+
updateTemplate: s,
|
|
127
127
|
deleteTemplate: b,
|
|
128
|
-
templateDialogProps:
|
|
129
|
-
templateDetailsProps:
|
|
128
|
+
templateDialogProps: t,
|
|
129
|
+
templateDetailsProps: n
|
|
130
130
|
};
|
|
131
131
|
}), De = we(
|
|
132
132
|
"closingTable",
|
|
133
133
|
function() {
|
|
134
|
-
const { t: g } =
|
|
134
|
+
const { t: g } = J(), { viewTemplate: v, updateTemplate: t, deleteTemplate: o } = O(), s = F({}), b = F(new Array()), n = F(!1), r = ke(), d = q();
|
|
135
135
|
async function u() {
|
|
136
|
-
if (b.value = [], !!
|
|
137
|
-
|
|
136
|
+
if (b.value = [], !!r._currentLocation) {
|
|
137
|
+
n.value = !0;
|
|
138
138
|
try {
|
|
139
|
-
const [e,
|
|
139
|
+
const [e, l] = await Promise.all([
|
|
140
140
|
d.readTemplates(),
|
|
141
141
|
d.getRecentPublishingJob()
|
|
142
142
|
]).delayed(1e3);
|
|
143
|
-
b.value = e,
|
|
143
|
+
b.value = e, s.value = l;
|
|
144
144
|
} catch (e) {
|
|
145
145
|
console.log("Something went wrong when fetching templates:", e);
|
|
146
146
|
} finally {
|
|
147
|
-
|
|
147
|
+
n.value = !1;
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
151
|
async function y(e) {
|
|
152
|
-
if (!b.value.find((
|
|
153
|
-
|
|
152
|
+
if (!b.value.find((l) => l._id) && r._currentLocation) {
|
|
153
|
+
n.value = !0;
|
|
154
154
|
try {
|
|
155
|
-
const [
|
|
155
|
+
const [l] = await Promise.all([
|
|
156
156
|
d.getTemplate(e),
|
|
157
157
|
new Promise((h) => setTimeout(h, 1e3))
|
|
158
158
|
]);
|
|
159
|
-
b.value = [
|
|
160
|
-
} catch (
|
|
161
|
-
console.log("Something went wrong when fetching templates:",
|
|
159
|
+
b.value = [l];
|
|
160
|
+
} catch (l) {
|
|
161
|
+
console.log("Something went wrong when fetching templates:", l);
|
|
162
162
|
} finally {
|
|
163
|
-
|
|
163
|
+
n.value = !1;
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
|
-
function p(e,
|
|
168
|
-
switch (
|
|
169
|
-
case
|
|
170
|
-
return v(
|
|
171
|
-
case
|
|
172
|
-
return
|
|
173
|
-
case
|
|
174
|
-
return
|
|
167
|
+
function p(e, l) {
|
|
168
|
+
switch (l = xe(l), e) {
|
|
169
|
+
case z.Details:
|
|
170
|
+
return v(l);
|
|
171
|
+
case z.Edit:
|
|
172
|
+
return t(l);
|
|
173
|
+
case z.Delete:
|
|
174
|
+
return o(l, n, u);
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
177
|
return {
|
|
@@ -181,7 +181,7 @@ const G = je((m, g) => {
|
|
|
181
181
|
accessorKey: "_id",
|
|
182
182
|
header: () => g("inventory.closing.table.createdAt"),
|
|
183
183
|
cell(e) {
|
|
184
|
-
return
|
|
184
|
+
return Qe(`${e.getValue()}`);
|
|
185
185
|
},
|
|
186
186
|
enableSorting: !0
|
|
187
187
|
},
|
|
@@ -208,8 +208,8 @@ const G = je((m, g) => {
|
|
|
208
208
|
header: () => "Enabled outlets",
|
|
209
209
|
cell(e) {
|
|
210
210
|
var h;
|
|
211
|
-
const
|
|
212
|
-
return
|
|
211
|
+
const l = (h = e.row.original.locations) == null ? void 0 : h.length;
|
|
212
|
+
return l ? `${l}` : "All";
|
|
213
213
|
},
|
|
214
214
|
enableSorting: !1,
|
|
215
215
|
meta: {
|
|
@@ -230,7 +230,7 @@ const G = je((m, g) => {
|
|
|
230
230
|
enableSorting: !1,
|
|
231
231
|
cell(e) {
|
|
232
232
|
var C;
|
|
233
|
-
const
|
|
233
|
+
const l = e.row.original, h = l._rev, D = (C = s.value.publishedRevs) == null ? void 0 : C[l._id], $ = h === D;
|
|
234
234
|
return x(
|
|
235
235
|
"div",
|
|
236
236
|
{
|
|
@@ -252,11 +252,11 @@ const G = je((m, g) => {
|
|
|
252
252
|
{
|
|
253
253
|
id: "action",
|
|
254
254
|
cell(e) {
|
|
255
|
-
const
|
|
256
|
-
ye[
|
|
257
|
-
ye[
|
|
255
|
+
const l = e.row.original, h = [
|
|
256
|
+
ye[z.Edit],
|
|
257
|
+
ye[z.Delete]
|
|
258
258
|
];
|
|
259
|
-
return
|
|
259
|
+
return Oe(h, (D) => p(D, l));
|
|
260
260
|
},
|
|
261
261
|
enableSorting: !1,
|
|
262
262
|
size: 40,
|
|
@@ -266,27 +266,27 @@ const G = je((m, g) => {
|
|
|
266
266
|
}
|
|
267
267
|
}
|
|
268
268
|
],
|
|
269
|
-
recentPublish:
|
|
269
|
+
recentPublish: s,
|
|
270
270
|
templates: b,
|
|
271
|
-
loading:
|
|
271
|
+
loading: n,
|
|
272
272
|
fetchTemplates: u,
|
|
273
273
|
loadTemplate: y
|
|
274
274
|
};
|
|
275
275
|
}
|
|
276
276
|
);
|
|
277
277
|
var L = /* @__PURE__ */ ((m) => (m.Name = "Name", m.Unit = "Unit", m.Delete = "Delete", m))(L || {});
|
|
278
|
-
function
|
|
278
|
+
function Ze(m) {
|
|
279
279
|
return {
|
|
280
280
|
columnDefs: P(() => {
|
|
281
|
-
const v = m.items.map((
|
|
281
|
+
const v = m.items.map((o) => o.sku.unit.measurements.length).reduce((o, s) => Math.max(o, s), 0);
|
|
282
282
|
return [
|
|
283
283
|
{
|
|
284
284
|
id: "Name",
|
|
285
285
|
header: () => "Name",
|
|
286
286
|
enableSorting: !1,
|
|
287
287
|
size: 400,
|
|
288
|
-
cell(
|
|
289
|
-
const
|
|
288
|
+
cell(o) {
|
|
289
|
+
const s = o.row.original;
|
|
290
290
|
return x(
|
|
291
291
|
"div",
|
|
292
292
|
{
|
|
@@ -296,12 +296,12 @@ function Xe(m) {
|
|
|
296
296
|
x(
|
|
297
297
|
"span",
|
|
298
298
|
{ class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary line-clamp-1" },
|
|
299
|
-
|
|
299
|
+
s.sku.name
|
|
300
300
|
),
|
|
301
301
|
x(
|
|
302
302
|
"span",
|
|
303
303
|
{ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary line-clamp-1" },
|
|
304
|
-
|
|
304
|
+
s.sku.code
|
|
305
305
|
)
|
|
306
306
|
]
|
|
307
307
|
);
|
|
@@ -312,14 +312,14 @@ function Xe(m) {
|
|
|
312
312
|
header: () => "Enable unit",
|
|
313
313
|
enableSorting: !1,
|
|
314
314
|
size: "auto",
|
|
315
|
-
cell(
|
|
316
|
-
var b,
|
|
317
|
-
const
|
|
315
|
+
cell(o) {
|
|
316
|
+
var b, n, r;
|
|
317
|
+
const s = o.row.original;
|
|
318
318
|
return x(
|
|
319
|
-
|
|
319
|
+
U.FmFormGroup,
|
|
320
320
|
{
|
|
321
|
-
value:
|
|
322
|
-
modelValue: !((b =
|
|
321
|
+
value: s.sku.unit._id,
|
|
322
|
+
modelValue: !((b = s.disabledMeasurements) != null && b.includes(s.sku.unit._id))
|
|
323
323
|
},
|
|
324
324
|
x(
|
|
325
325
|
"div",
|
|
@@ -327,45 +327,45 @@ function Xe(m) {
|
|
|
327
327
|
class: "flex items-center gap-4"
|
|
328
328
|
},
|
|
329
329
|
[
|
|
330
|
-
x(
|
|
331
|
-
value:
|
|
332
|
-
modelValue: !((
|
|
333
|
-
disabled: m.disabled || !((
|
|
330
|
+
x(U.FmCheckbox, {
|
|
331
|
+
value: s.sku.unit._id,
|
|
332
|
+
modelValue: !((n = s.disabledMeasurements) != null && n.includes(s.sku.unit._id)),
|
|
333
|
+
disabled: m.disabled || !((r = s.disabledMeasurements) != null && r.includes(s.sku.unit._id)) && s.sku.unit.measurements.every(
|
|
334
334
|
(d) => {
|
|
335
335
|
var u;
|
|
336
|
-
return (u =
|
|
336
|
+
return (u = s.disabledMeasurements) == null ? void 0 : u.includes(d.id);
|
|
337
337
|
}
|
|
338
338
|
),
|
|
339
339
|
"onUpdate:modelValue"(d) {
|
|
340
340
|
var u;
|
|
341
341
|
if (d)
|
|
342
342
|
m.updateItem({
|
|
343
|
-
...
|
|
344
|
-
disabledMeasurements: (u =
|
|
345
|
-
(y) => y !==
|
|
343
|
+
...s,
|
|
344
|
+
disabledMeasurements: (u = s.disabledMeasurements) == null ? void 0 : u.filter(
|
|
345
|
+
(y) => y !== s.sku.unit._id
|
|
346
346
|
)
|
|
347
347
|
});
|
|
348
348
|
else {
|
|
349
|
-
const y =
|
|
349
|
+
const y = s.disabledMeasurements ?? [];
|
|
350
350
|
m.updateItem({
|
|
351
|
-
...
|
|
352
|
-
disabledMeasurements: [...y,
|
|
351
|
+
...s,
|
|
352
|
+
disabledMeasurements: [...y, s.sku.unit._id]
|
|
353
353
|
});
|
|
354
354
|
}
|
|
355
355
|
}
|
|
356
356
|
}),
|
|
357
357
|
x(
|
|
358
|
-
|
|
358
|
+
U.FmTooltip,
|
|
359
359
|
{ zIndex: 51 },
|
|
360
360
|
{
|
|
361
361
|
content() {
|
|
362
|
-
return
|
|
362
|
+
return s.sku.unit.abbrev;
|
|
363
363
|
},
|
|
364
364
|
default() {
|
|
365
365
|
return x(
|
|
366
366
|
"div",
|
|
367
367
|
{ class: "line-clamp-2 fm-typo-en-body-lg-400" },
|
|
368
|
-
|
|
368
|
+
s.sku.unit.abbrev
|
|
369
369
|
);
|
|
370
370
|
}
|
|
371
371
|
}
|
|
@@ -376,19 +376,19 @@ function Xe(m) {
|
|
|
376
376
|
}
|
|
377
377
|
},
|
|
378
378
|
...Array.from({ length: Math.max(v, 0) }).map(
|
|
379
|
-
(
|
|
380
|
-
id: `measurement${
|
|
379
|
+
(o, s) => ({
|
|
380
|
+
id: `measurement${s}`,
|
|
381
381
|
header: () => "",
|
|
382
382
|
enableSorting: !1,
|
|
383
383
|
size: "auto",
|
|
384
384
|
cell(b) {
|
|
385
385
|
var d, u, y, p;
|
|
386
|
-
const
|
|
387
|
-
return
|
|
388
|
-
|
|
386
|
+
const n = b.row.original, r = n.sku.unit.measurements[s];
|
|
387
|
+
return r ? x(
|
|
388
|
+
U.FmFormGroup,
|
|
389
389
|
{
|
|
390
|
-
modelValue: !((d =
|
|
391
|
-
value:
|
|
390
|
+
modelValue: !((d = n.disabledMeasurements) != null && d.includes(r.id)),
|
|
391
|
+
value: r.id
|
|
392
392
|
},
|
|
393
393
|
x(
|
|
394
394
|
"div",
|
|
@@ -396,43 +396,43 @@ function Xe(m) {
|
|
|
396
396
|
class: "flex items-center gap-4"
|
|
397
397
|
},
|
|
398
398
|
[
|
|
399
|
-
x(
|
|
400
|
-
value:
|
|
401
|
-
modelValue: !((u =
|
|
402
|
-
disabled: m.disabled || !((y =
|
|
399
|
+
x(U.FmCheckbox, {
|
|
400
|
+
value: r.id,
|
|
401
|
+
modelValue: !((u = n.disabledMeasurements) != null && u.includes(r.id)),
|
|
402
|
+
disabled: m.disabled || !((y = n.disabledMeasurements) != null && y.includes(r.id)) && ((p = n.disabledMeasurements) == null ? void 0 : p.includes(n.sku.unit._id)) && n.sku.unit.measurements.filter((w) => w.id != r.id).every((w) => {
|
|
403
403
|
var e;
|
|
404
|
-
return (e =
|
|
404
|
+
return (e = n.disabledMeasurements) == null ? void 0 : e.includes(w.id);
|
|
405
405
|
}),
|
|
406
|
-
"onUpdate:modelValue"(
|
|
406
|
+
"onUpdate:modelValue"(w) {
|
|
407
407
|
var e;
|
|
408
|
-
if (
|
|
408
|
+
if (w)
|
|
409
409
|
m.updateItem({
|
|
410
|
-
...
|
|
411
|
-
disabledMeasurements: (e =
|
|
412
|
-
(
|
|
410
|
+
...n,
|
|
411
|
+
disabledMeasurements: (e = n.disabledMeasurements) == null ? void 0 : e.filter(
|
|
412
|
+
(l) => l !== r.id
|
|
413
413
|
)
|
|
414
414
|
});
|
|
415
415
|
else {
|
|
416
|
-
const
|
|
416
|
+
const l = n.disabledMeasurements ?? [];
|
|
417
417
|
m.updateItem({
|
|
418
|
-
...
|
|
419
|
-
disabledMeasurements: [...
|
|
418
|
+
...n,
|
|
419
|
+
disabledMeasurements: [...l, r.id]
|
|
420
420
|
});
|
|
421
421
|
}
|
|
422
422
|
}
|
|
423
423
|
}),
|
|
424
424
|
x(
|
|
425
|
-
|
|
425
|
+
U.FmTooltip,
|
|
426
426
|
{ zIndex: 51 },
|
|
427
427
|
{
|
|
428
428
|
content() {
|
|
429
|
-
return
|
|
429
|
+
return r.abbrev;
|
|
430
430
|
},
|
|
431
431
|
default() {
|
|
432
432
|
return x(
|
|
433
433
|
"div",
|
|
434
434
|
{ class: "line-clamp-2 fm-typo-en-body-lg-400" },
|
|
435
|
-
|
|
435
|
+
r.abbrev
|
|
436
436
|
);
|
|
437
437
|
}
|
|
438
438
|
}
|
|
@@ -446,21 +446,21 @@ function Xe(m) {
|
|
|
446
446
|
{
|
|
447
447
|
id: "Delete",
|
|
448
448
|
header: "",
|
|
449
|
-
cell(
|
|
450
|
-
const
|
|
449
|
+
cell(o) {
|
|
450
|
+
const s = o.row.original;
|
|
451
451
|
return x(
|
|
452
452
|
"div",
|
|
453
453
|
{ class: "w-full flex justify-end" },
|
|
454
|
-
x(
|
|
454
|
+
x(U.FmButton, {
|
|
455
455
|
class: "delete-button",
|
|
456
|
-
key:
|
|
456
|
+
key: s.sku._id,
|
|
457
457
|
type: "button",
|
|
458
458
|
icon: "delete",
|
|
459
459
|
variant: "tertiary",
|
|
460
460
|
size: "md",
|
|
461
461
|
disabled: m.disabled,
|
|
462
462
|
onClick: () => {
|
|
463
|
-
m.deleteItem(
|
|
463
|
+
m.deleteItem(s);
|
|
464
464
|
}
|
|
465
465
|
})
|
|
466
466
|
);
|
|
@@ -476,40 +476,40 @@ function Xe(m) {
|
|
|
476
476
|
})
|
|
477
477
|
};
|
|
478
478
|
}
|
|
479
|
-
const
|
|
479
|
+
const et = { class: "flex flex-col gap-16 py-12" }, tt = { class: "flex" }, st = { class: "flex-1 flex flex-col" }, lt = { class: "fm-typo-en-title-sm-600 text-fm-color-typo-primary" }, ot = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, nt = { class: "flex flex-col gap-4" }, at = /* @__PURE__ */ Y({
|
|
480
480
|
__name: "ClosingTemplateItem",
|
|
481
481
|
props: {
|
|
482
482
|
cellByColId: {},
|
|
483
483
|
row: {}
|
|
484
484
|
},
|
|
485
485
|
setup(m) {
|
|
486
|
-
const g = m, v = P(() => g.row),
|
|
487
|
-
() => v.value.getVisibleCells().filter((
|
|
486
|
+
const g = m, v = P(() => g.row), t = P(
|
|
487
|
+
() => v.value.getVisibleCells().filter((o) => o.column.id !== L.Name && o.column.id !== L.Delete)
|
|
488
488
|
);
|
|
489
|
-
return (
|
|
490
|
-
var b,
|
|
491
|
-
return k(),
|
|
492
|
-
f("div",
|
|
493
|
-
f("div",
|
|
494
|
-
f("div",
|
|
495
|
-
f("div",
|
|
489
|
+
return (o, s) => {
|
|
490
|
+
var b, n, r, d, u;
|
|
491
|
+
return k(), S("div", et, [
|
|
492
|
+
f("div", tt, [
|
|
493
|
+
f("div", st, [
|
|
494
|
+
f("div", lt, I(v.value.original.sku.name), 1),
|
|
495
|
+
f("div", ot, I(v.value.original.sku.code), 1)
|
|
496
496
|
]),
|
|
497
497
|
f("div", null, [
|
|
498
|
-
|
|
499
|
-
render: (
|
|
500
|
-
props: (u = (d =
|
|
498
|
+
_(c(N), {
|
|
499
|
+
render: (r = (n = (b = o.cellByColId[c(L).Delete]) == null ? void 0 : b.column) == null ? void 0 : n.columnDef) == null ? void 0 : r.cell,
|
|
500
|
+
props: (u = (d = o.cellByColId[c(L).Delete]) == null ? void 0 : d.getContext) == null ? void 0 : u.call(d)
|
|
501
501
|
}, null, 8, ["render", "props"])
|
|
502
502
|
])
|
|
503
503
|
]),
|
|
504
|
-
f("div",
|
|
505
|
-
|
|
506
|
-
(k(!0),
|
|
507
|
-
var p,
|
|
508
|
-
return k(),
|
|
504
|
+
f("div", nt, [
|
|
505
|
+
s[0] || (s[0] = f("div", { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, "Enabled units", -1)),
|
|
506
|
+
(k(!0), S(_e, null, Ce(t.value, (y) => {
|
|
507
|
+
var p, w, e;
|
|
508
|
+
return k(), S("div", {
|
|
509
509
|
key: y.id
|
|
510
510
|
}, [
|
|
511
|
-
|
|
512
|
-
render: (
|
|
511
|
+
_(c(N), {
|
|
512
|
+
render: (w = (p = y.column) == null ? void 0 : p.columnDef) == null ? void 0 : w.cell,
|
|
513
513
|
props: (e = y.getContext) == null ? void 0 : e.call(y)
|
|
514
514
|
}, null, 8, ["render", "props"])
|
|
515
515
|
]);
|
|
@@ -518,179 +518,183 @@ const Ze = { class: "flex flex-col gap-16 py-12" }, et = { class: "flex" }, tt =
|
|
|
518
518
|
]);
|
|
519
519
|
};
|
|
520
520
|
}
|
|
521
|
-
}),
|
|
521
|
+
}), it = { class: "flex flex-col gap-16" }, rt = { class: "flex flex-col gap-24" }, ct = { class: "flex flex-col gap-16" }, ut = { class: "flex items-center" }, dt = { class: "flex flex-col gap-16" }, mt = { class: "flex items-center" }, pt = { class: "flex-1 gap-8 fm-typo-en-title-sm-800" }, ft = /* @__PURE__ */ Y({
|
|
522
522
|
__name: "ClosingTemplateForm",
|
|
523
523
|
props: {
|
|
524
524
|
modelValue: {},
|
|
525
525
|
disabled: { type: Boolean }
|
|
526
526
|
},
|
|
527
527
|
setup(m, { expose: g }) {
|
|
528
|
-
const v = m,
|
|
529
|
-
promptSelectLocations:
|
|
530
|
-
columnDefs:
|
|
528
|
+
const v = m, t = We(), { t: o } = J(), s = Ke(), b = Q(), {
|
|
529
|
+
promptSelectLocations: n,
|
|
530
|
+
columnDefs: r,
|
|
531
531
|
rowData: d
|
|
532
|
-
} =
|
|
532
|
+
} = Xe({
|
|
533
533
|
getLocations() {
|
|
534
|
-
return
|
|
534
|
+
return t.locations;
|
|
535
535
|
},
|
|
536
536
|
setLocations(e) {
|
|
537
|
-
|
|
537
|
+
t.locations = e;
|
|
538
538
|
}
|
|
539
|
-
}), u =
|
|
539
|
+
}), u = F();
|
|
540
540
|
g({
|
|
541
541
|
validateInputs: () => {
|
|
542
|
-
var e,
|
|
543
|
-
(
|
|
542
|
+
var e, l;
|
|
543
|
+
(l = (e = u.value) == null ? void 0 : e.validateInputs) == null || l.call(e);
|
|
544
544
|
},
|
|
545
545
|
resetInputsValidation: () => {
|
|
546
|
-
var e,
|
|
547
|
-
(
|
|
546
|
+
var e, l;
|
|
547
|
+
(l = (e = u.value) == null ? void 0 : e.resetInputsValidation) == null || l.call(e);
|
|
548
548
|
},
|
|
549
549
|
resetInputs: () => {
|
|
550
|
-
var e,
|
|
551
|
-
(
|
|
550
|
+
var e, l;
|
|
551
|
+
(l = (e = u.value) == null ? void 0 : e.resetInputs) == null || l.call(e);
|
|
552
552
|
}
|
|
553
553
|
});
|
|
554
|
-
const y =
|
|
554
|
+
const y = Ze({
|
|
555
555
|
updateItem: (e) => {
|
|
556
|
-
|
|
556
|
+
t.items = t.items.map((l) => l.sku._id !== e.sku._id ? l : e);
|
|
557
557
|
},
|
|
558
558
|
deleteItem: (e) => {
|
|
559
|
-
|
|
559
|
+
t.items = t.items.filter((l) => l.sku._id !== e.sku._id);
|
|
560
560
|
},
|
|
561
561
|
get items() {
|
|
562
|
-
return
|
|
562
|
+
return t.items;
|
|
563
563
|
},
|
|
564
564
|
get disabled() {
|
|
565
565
|
return v.disabled;
|
|
566
566
|
}
|
|
567
567
|
}), p = P(() => y.columnDefs.value);
|
|
568
|
-
function
|
|
569
|
-
const e =
|
|
568
|
+
function w() {
|
|
569
|
+
const e = s.skus.map((h) => ({
|
|
570
570
|
label: h.name,
|
|
571
571
|
sublabel: h.code,
|
|
572
572
|
value: h
|
|
573
|
-
})),
|
|
573
|
+
})), l = e.filter((h) => {
|
|
574
574
|
var D;
|
|
575
|
-
return (D =
|
|
575
|
+
return (D = t.items) == null ? void 0 : D.find(($) => $.sku._id === h.value._id);
|
|
576
576
|
}).map((h) => h.value);
|
|
577
577
|
b.open({
|
|
578
|
-
title:
|
|
578
|
+
title: o("inventory.closing.form.items.selectItem"),
|
|
579
579
|
closeButton: !0,
|
|
580
580
|
contentComponent: Je,
|
|
581
581
|
contentComponentProps: {
|
|
582
|
-
modelValue:
|
|
582
|
+
modelValue: l,
|
|
583
583
|
items: e,
|
|
584
584
|
virtualScroll: !0
|
|
585
585
|
},
|
|
586
586
|
primaryActions: {
|
|
587
|
-
text:
|
|
587
|
+
text: o("common.confirm"),
|
|
588
588
|
close: !0
|
|
589
589
|
},
|
|
590
590
|
secondaryActions: {
|
|
591
|
-
text:
|
|
591
|
+
text: o("common.close"),
|
|
592
592
|
close: !0,
|
|
593
593
|
variant: "tertiary"
|
|
594
594
|
}
|
|
595
595
|
}).onPrimary((h) => {
|
|
596
|
-
const D =
|
|
597
|
-
const
|
|
598
|
-
return
|
|
596
|
+
const D = t.items ?? [], $ = h.map((C) => {
|
|
597
|
+
const a = D.find((A) => A.sku._id === C._id);
|
|
598
|
+
return a || {
|
|
599
599
|
sku: C
|
|
600
600
|
};
|
|
601
601
|
});
|
|
602
|
-
$.sort((C,
|
|
602
|
+
$.sort((C, a) => C.sku.code.localeCompare(a.sku.code)), t.items = $;
|
|
603
603
|
});
|
|
604
604
|
}
|
|
605
|
-
return (e,
|
|
606
|
-
const h = V("FmTextField"), D = V("FmButton"), $ = V("FmTable"), C = V("FmForm");
|
|
607
|
-
return k(), B(
|
|
605
|
+
return (e, l) => {
|
|
606
|
+
const h = V("FmTextField"), D = V("FmButton"), $ = V("FmTable"), C = V("FmFormGroup"), a = V("FmForm");
|
|
607
|
+
return k(), B(a, {
|
|
608
608
|
ref_key: "formRef",
|
|
609
609
|
ref: u,
|
|
610
610
|
class: "flex flex-col gap-32",
|
|
611
611
|
disabled: e.disabled
|
|
612
612
|
}, {
|
|
613
|
-
default:
|
|
614
|
-
f("div",
|
|
615
|
-
f("div",
|
|
616
|
-
|
|
617
|
-
label: c(
|
|
613
|
+
default: R(() => [
|
|
614
|
+
f("div", it, [
|
|
615
|
+
f("div", rt, [
|
|
616
|
+
_(h, {
|
|
617
|
+
label: c(o)("inventory.closing.form.name"),
|
|
618
618
|
"label-mark": "required",
|
|
619
|
-
modelValue: c(
|
|
620
|
-
"onUpdate:modelValue":
|
|
621
|
-
rules: [c(
|
|
619
|
+
modelValue: c(t).name,
|
|
620
|
+
"onUpdate:modelValue": l[0] || (l[0] = (i) => c(t).name = i),
|
|
621
|
+
rules: [c(Ge)()]
|
|
622
622
|
}, null, 8, ["label", "modelValue", "rules"]),
|
|
623
|
-
|
|
624
|
-
label: c(
|
|
623
|
+
_(h, {
|
|
624
|
+
label: c(o)("inventory.closing.form.reference"),
|
|
625
625
|
"label-mark": "optional",
|
|
626
|
-
modelValue: c(
|
|
627
|
-
"onUpdate:modelValue":
|
|
626
|
+
modelValue: c(t).ref,
|
|
627
|
+
"onUpdate:modelValue": l[1] || (l[1] = (i) => c(t).ref = i)
|
|
628
628
|
}, null, 8, ["label", "modelValue"])
|
|
629
629
|
])
|
|
630
630
|
]),
|
|
631
|
-
f("div",
|
|
632
|
-
f("div",
|
|
633
|
-
|
|
634
|
-
|
|
631
|
+
f("div", ct, [
|
|
632
|
+
f("div", ut, [
|
|
633
|
+
l[3] || (l[3] = f("div", { class: "flex-1 fm-typo-en-title-sm-600" }, "Locations", -1)),
|
|
634
|
+
_(D, {
|
|
635
635
|
disabled: e.disabled,
|
|
636
636
|
label: "Select location",
|
|
637
637
|
"prepend-icon": "add",
|
|
638
638
|
variant: "plain",
|
|
639
639
|
class: "border-2 rounded-lg border-fm-color-primary",
|
|
640
|
-
onClick: c(
|
|
640
|
+
onClick: c(n)
|
|
641
641
|
}, null, 8, ["disabled", "onClick"])
|
|
642
642
|
]),
|
|
643
|
-
|
|
644
|
-
"column-defs": c(
|
|
643
|
+
_($, {
|
|
644
|
+
"column-defs": c(r),
|
|
645
645
|
"row-data": c(d),
|
|
646
646
|
"shrink-at": 9999,
|
|
647
|
-
onRowClick: c(
|
|
647
|
+
onRowClick: c(n),
|
|
648
648
|
"hide-footer": ""
|
|
649
649
|
}, null, 8, ["column-defs", "row-data", "onRowClick"])
|
|
650
650
|
]),
|
|
651
|
-
f("div",
|
|
652
|
-
f("div",
|
|
653
|
-
f("div",
|
|
654
|
-
|
|
651
|
+
f("div", dt, [
|
|
652
|
+
f("div", mt, [
|
|
653
|
+
f("div", pt, I(c(o)("inventory.closing.form.items.title")), 1),
|
|
654
|
+
_(D, {
|
|
655
655
|
disabled: e.disabled,
|
|
656
|
-
label: c(
|
|
656
|
+
label: c(o)("inventory.closing.form.items.addItem"),
|
|
657
657
|
"prepend-icon": "add",
|
|
658
658
|
variant: "plain",
|
|
659
659
|
class: "border-2 rounded-lg border-fm-color-primary",
|
|
660
|
-
onClick:
|
|
660
|
+
onClick: l[2] || (l[2] = (i) => w()),
|
|
661
661
|
size: "md"
|
|
662
662
|
}, null, 8, ["disabled", "label"])
|
|
663
663
|
]),
|
|
664
664
|
(k(), B($, {
|
|
665
665
|
"column-defs": p.value,
|
|
666
|
-
"row-data": c(
|
|
667
|
-
key: c(
|
|
666
|
+
"row-data": c(t).items,
|
|
667
|
+
key: c(t).items.map((i) => i.sku._id).join("."),
|
|
668
668
|
"hide-footer": "",
|
|
669
|
-
"page-size": c(
|
|
669
|
+
"page-size": c(t).items.length
|
|
670
670
|
}, {
|
|
671
|
-
"list-row":
|
|
671
|
+
"list-row": R((i) => [
|
|
672
672
|
(k(), B(Te, {
|
|
673
|
-
row:
|
|
674
|
-
key: c(
|
|
673
|
+
row: i,
|
|
674
|
+
key: c(t).items.map((A) => A.sku._id).join(".")
|
|
675
675
|
}, {
|
|
676
|
-
default:
|
|
677
|
-
|
|
678
|
-
row:
|
|
679
|
-
"cell-by-col-id":
|
|
676
|
+
default: R((A) => [
|
|
677
|
+
_(at, {
|
|
678
|
+
row: i,
|
|
679
|
+
"cell-by-col-id": A
|
|
680
680
|
}, null, 8, ["row", "cell-by-col-id"])
|
|
681
681
|
]),
|
|
682
682
|
_: 2
|
|
683
683
|
}, 1032, ["row"]))
|
|
684
684
|
]),
|
|
685
685
|
_: 1
|
|
686
|
-
}, 8, ["column-defs", "row-data", "page-size"]))
|
|
686
|
+
}, 8, ["column-defs", "row-data", "page-size"])),
|
|
687
|
+
_(C, {
|
|
688
|
+
"model-value": c(t).items.length,
|
|
689
|
+
rules: [c(He)(1)]
|
|
690
|
+
}, null, 8, ["model-value", "rules"])
|
|
687
691
|
])
|
|
688
692
|
]),
|
|
689
693
|
_: 1
|
|
690
694
|
}, 8, ["disabled"]);
|
|
691
695
|
};
|
|
692
696
|
}
|
|
693
|
-
}),
|
|
697
|
+
}), gt = { class: "flex items-center" }, vt = { class: "fm-typo-en-title-md-800" }, bt = { class: "flex gap-4" }, yt = /* @__PURE__ */ Y({
|
|
694
698
|
__name: "ClosingTemplateDialog",
|
|
695
699
|
props: {
|
|
696
700
|
mode: {},
|
|
@@ -700,7 +704,7 @@ const Ze = { class: "flex flex-col gap-16 py-12" }, et = { class: "flex" }, tt =
|
|
|
700
704
|
emits: ["update:show", "submitted"],
|
|
701
705
|
setup(m, { expose: g, emit: v }) {
|
|
702
706
|
var C;
|
|
703
|
-
const
|
|
707
|
+
const t = m, o = v, s = q(), b = W(), { t: n } = J(), r = Be(t, "show");
|
|
704
708
|
function d() {
|
|
705
709
|
return {
|
|
706
710
|
_id: "",
|
|
@@ -708,131 +712,131 @@ const Ze = { class: "flex flex-col gap-16 py-12" }, et = { class: "flex" }, tt =
|
|
|
708
712
|
items: []
|
|
709
713
|
};
|
|
710
714
|
}
|
|
711
|
-
const u =
|
|
715
|
+
const u = F(t.modelValue ?? d()), y = F(((C = t.modelValue) == null ? void 0 : C._id) ?? `${Math.random()}`);
|
|
712
716
|
Me(
|
|
713
|
-
() =>
|
|
714
|
-
(
|
|
715
|
-
var
|
|
716
|
-
|
|
717
|
+
() => t.show,
|
|
718
|
+
(a) => {
|
|
719
|
+
var i;
|
|
720
|
+
a && (u.value = t.modelValue ?? d(), y.value = ((i = t.modelValue) == null ? void 0 : i._id) ?? `${Math.random()}`);
|
|
717
721
|
}
|
|
718
722
|
);
|
|
719
|
-
const p =
|
|
720
|
-
switch (
|
|
721
|
-
case
|
|
723
|
+
const p = F(!1), w = P(() => {
|
|
724
|
+
switch (t.mode) {
|
|
725
|
+
case E.READ:
|
|
722
726
|
return "";
|
|
723
|
-
case
|
|
724
|
-
return
|
|
725
|
-
case
|
|
726
|
-
return
|
|
727
|
+
case E.CREATE:
|
|
728
|
+
return n("inventory.closing.template.create.title");
|
|
729
|
+
case E.UPDATE:
|
|
730
|
+
return n("inventory.closing.template.update.title");
|
|
727
731
|
}
|
|
728
732
|
return "";
|
|
729
|
-
}), e =
|
|
733
|
+
}), e = F();
|
|
730
734
|
g({
|
|
731
735
|
validateInputs: () => {
|
|
732
|
-
var
|
|
733
|
-
(
|
|
736
|
+
var a, i;
|
|
737
|
+
(i = (a = e.value) == null ? void 0 : a.validateInputs) == null || i.call(a);
|
|
734
738
|
},
|
|
735
739
|
resetInputsValidation: () => {
|
|
736
|
-
var
|
|
737
|
-
(
|
|
740
|
+
var a, i;
|
|
741
|
+
(i = (a = e.value) == null ? void 0 : a.resetInputsValidation) == null || i.call(a);
|
|
738
742
|
},
|
|
739
743
|
resetInputs: () => {
|
|
740
|
-
var
|
|
741
|
-
(
|
|
744
|
+
var a, i;
|
|
745
|
+
(i = (a = e.value) == null ? void 0 : a.resetInputs) == null || i.call(a);
|
|
742
746
|
}
|
|
743
747
|
});
|
|
744
|
-
async function
|
|
745
|
-
const
|
|
746
|
-
if (
|
|
748
|
+
async function l() {
|
|
749
|
+
const a = u.value;
|
|
750
|
+
if (a) {
|
|
747
751
|
p.value = !0;
|
|
748
752
|
try {
|
|
749
|
-
await
|
|
750
|
-
title:
|
|
751
|
-
message:
|
|
753
|
+
await s.createTemplate(a), await new Promise((i) => setTimeout(i, 1e3)), b.open({
|
|
754
|
+
title: n("inventory.closing.template.create.success"),
|
|
755
|
+
message: n("inventory.closing.template.create.successMessage"),
|
|
752
756
|
type: "success"
|
|
753
|
-
}),
|
|
754
|
-
} catch (
|
|
757
|
+
}), o("update:show", !1), o("submitted");
|
|
758
|
+
} catch (i) {
|
|
755
759
|
b.open({
|
|
756
|
-
title:
|
|
757
|
-
message:
|
|
760
|
+
title: n("inventory.closing.template.create.error"),
|
|
761
|
+
message: n("inventory.closing.template.create.errorMessage"),
|
|
758
762
|
type: "error"
|
|
759
|
-
}), console.error("Error in creating closing template",
|
|
763
|
+
}), console.error("Error in creating closing template", i);
|
|
760
764
|
} finally {
|
|
761
765
|
p.value = !1;
|
|
762
766
|
}
|
|
763
767
|
}
|
|
764
768
|
}
|
|
765
769
|
async function h() {
|
|
766
|
-
const
|
|
767
|
-
if (
|
|
770
|
+
const a = u.value;
|
|
771
|
+
if (a) {
|
|
768
772
|
p.value = !0;
|
|
769
773
|
try {
|
|
770
|
-
await
|
|
771
|
-
title:
|
|
772
|
-
message:
|
|
774
|
+
await s.updateTemplate(a), await new Promise((i) => setTimeout(i, 1e3)), b.open({
|
|
775
|
+
title: n("inventory.closing.template.update.success"),
|
|
776
|
+
message: n("inventory.closing.template.update.successMessage"),
|
|
773
777
|
type: "success"
|
|
774
|
-
}),
|
|
775
|
-
} catch (
|
|
778
|
+
}), o("update:show", !1), o("submitted");
|
|
779
|
+
} catch (i) {
|
|
776
780
|
b.open({
|
|
777
|
-
title:
|
|
778
|
-
message:
|
|
781
|
+
title: n("inventory.closing.template.update.error"),
|
|
782
|
+
message: n("inventory.closing.template.update.errorMessage"),
|
|
779
783
|
type: "error"
|
|
780
|
-
}), console.error("Error in updating closing template",
|
|
784
|
+
}), console.error("Error in updating closing template", i);
|
|
781
785
|
} finally {
|
|
782
786
|
p.value = !1;
|
|
783
787
|
}
|
|
784
788
|
}
|
|
785
789
|
}
|
|
786
790
|
function D() {
|
|
787
|
-
switch (
|
|
788
|
-
case
|
|
789
|
-
return
|
|
790
|
-
case
|
|
791
|
+
switch (t.mode) {
|
|
792
|
+
case E.CREATE:
|
|
793
|
+
return l();
|
|
794
|
+
case E.UPDATE:
|
|
791
795
|
return h();
|
|
792
796
|
}
|
|
793
797
|
}
|
|
794
798
|
function $() {
|
|
795
|
-
var
|
|
796
|
-
(
|
|
799
|
+
var a, i;
|
|
800
|
+
(i = (a = e.value) == null ? void 0 : a.validateInputs) == null || i.call(a);
|
|
797
801
|
}
|
|
798
|
-
return (
|
|
799
|
-
const
|
|
802
|
+
return (a, i) => {
|
|
803
|
+
const A = V("FmButton"), M = V("FmSideSheet");
|
|
800
804
|
return k(), B(M, {
|
|
801
|
-
modelValue: c(
|
|
802
|
-
"onUpdate:modelValue":
|
|
805
|
+
modelValue: c(r),
|
|
806
|
+
"onUpdate:modelValue": i[2] || (i[2] = (T) => Pe(r) ? r.value = T : null),
|
|
803
807
|
"dismiss-away": "",
|
|
804
808
|
"close-button": "",
|
|
805
809
|
"max-width": 800
|
|
806
810
|
}, {
|
|
807
|
-
"side-sheet-header":
|
|
808
|
-
f("div",
|
|
809
|
-
f("div",
|
|
811
|
+
"side-sheet-header": R(() => [
|
|
812
|
+
f("div", gt, [
|
|
813
|
+
f("div", vt, I(w.value), 1)
|
|
810
814
|
])
|
|
811
815
|
]),
|
|
812
|
-
default:
|
|
813
|
-
(k(), B(
|
|
816
|
+
default: R(() => [
|
|
817
|
+
(k(), B(ft, {
|
|
814
818
|
class: "w-full",
|
|
815
819
|
ref_key: "formRef",
|
|
816
820
|
ref: e,
|
|
817
821
|
onValidationSuccess: D,
|
|
818
822
|
"model-value": u.value,
|
|
819
|
-
"onUpdate:modelValue":
|
|
823
|
+
"onUpdate:modelValue": i[0] || (i[0] = (T) => u.value = T),
|
|
820
824
|
disabled: p.value,
|
|
821
825
|
key: y.value
|
|
822
826
|
}, null, 8, ["model-value", "disabled"]))
|
|
823
827
|
]),
|
|
824
|
-
"side-sheet-footer":
|
|
825
|
-
f("div",
|
|
826
|
-
|
|
828
|
+
"side-sheet-footer": R(() => [
|
|
829
|
+
f("div", bt, [
|
|
830
|
+
_(A, {
|
|
827
831
|
loading: p.value,
|
|
828
|
-
label: c(
|
|
832
|
+
label: c(n)("common.save"),
|
|
829
833
|
onClick: $
|
|
830
834
|
}, null, 8, ["loading", "label"]),
|
|
831
|
-
|
|
835
|
+
_(A, {
|
|
832
836
|
disabled: p.value,
|
|
833
837
|
variant: "tertiary",
|
|
834
|
-
label: c(
|
|
835
|
-
onClick:
|
|
838
|
+
label: c(n)("common.close"),
|
|
839
|
+
onClick: i[1] || (i[1] = (T) => o("update:show", !1))
|
|
836
840
|
}, null, 8, ["disabled", "label"])
|
|
837
841
|
])
|
|
838
842
|
]),
|
|
@@ -840,34 +844,34 @@ const Ze = { class: "flex flex-col gap-16 py-12" }, et = { class: "flex" }, tt =
|
|
|
840
844
|
}, 8, ["modelValue"]);
|
|
841
845
|
};
|
|
842
846
|
}
|
|
843
|
-
}),
|
|
844
|
-
function
|
|
845
|
-
return k(),
|
|
847
|
+
}), ht = {};
|
|
848
|
+
function _t(m, g) {
|
|
849
|
+
return k(), S("div");
|
|
846
850
|
}
|
|
847
|
-
const
|
|
851
|
+
const wt = /* @__PURE__ */ qe(ht, [["render", _t]]), xt = { class: "flex flex-col gap-40" }, kt = { key: 0 }, Tt = {
|
|
848
852
|
key: 1,
|
|
849
853
|
class: "flex gap-8 items-center"
|
|
850
|
-
},
|
|
854
|
+
}, Dt = {
|
|
851
855
|
key: 2,
|
|
852
856
|
class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary"
|
|
853
|
-
},
|
|
857
|
+
}, $t = {
|
|
854
858
|
key: 3,
|
|
855
859
|
class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary flex flex-col gap-12"
|
|
856
|
-
},
|
|
860
|
+
}, Ct = { key: 4 }, Mt = { class: "flex sm:flex-col xs:flex-col justify-end gap-8 w-full mb-16" }, Pt = /* @__PURE__ */ Y({
|
|
857
861
|
__name: "ClosingTemplatePublish",
|
|
858
862
|
emits: ["close"],
|
|
859
863
|
setup(m, { emit: g }) {
|
|
860
|
-
const v =
|
|
861
|
-
async function
|
|
864
|
+
const v = F(!1), t = W(), o = q(), s = De(), b = g;
|
|
865
|
+
async function n() {
|
|
862
866
|
v.value = !0;
|
|
863
867
|
try {
|
|
864
|
-
await
|
|
868
|
+
await o.startNewPublish().delayed(1e3), t.open({
|
|
865
869
|
title: "Success",
|
|
866
870
|
message: "You may refresh after a while to review publish status",
|
|
867
871
|
type: "success"
|
|
868
872
|
}), u();
|
|
869
873
|
} catch (y) {
|
|
870
|
-
|
|
874
|
+
t.open({
|
|
871
875
|
title: "Something went wrong",
|
|
872
876
|
message: "Please try again",
|
|
873
877
|
type: "error"
|
|
@@ -876,18 +880,18 @@ const _t = /* @__PURE__ */ qe(yt, [["render", ht]]), wt = { class: "flex flex-co
|
|
|
876
880
|
v.value = !1;
|
|
877
881
|
}
|
|
878
882
|
}
|
|
879
|
-
const
|
|
880
|
-
() =>
|
|
883
|
+
const r = P(() => s.recentPublish.recentJob), d = P(
|
|
884
|
+
() => s.templates.length && (!r.value || r.value.outlets.length === r.value.completed.length)
|
|
881
885
|
);
|
|
882
886
|
function u() {
|
|
883
887
|
b("close");
|
|
884
888
|
}
|
|
885
889
|
return (y, p) => {
|
|
886
|
-
const
|
|
887
|
-
return k(),
|
|
888
|
-
c(
|
|
890
|
+
const w = V("FmCircularProgress"), e = V("FmButton");
|
|
891
|
+
return k(), S("div", xt, [
|
|
892
|
+
c(s).templates.length ? v.value ? (k(), S("div", Tt, [
|
|
889
893
|
f("div", null, [
|
|
890
|
-
w
|
|
894
|
+
_(w, {
|
|
891
895
|
size: "md",
|
|
892
896
|
color: "neutral-gray-300"
|
|
893
897
|
})
|
|
@@ -895,22 +899,22 @@ const _t = /* @__PURE__ */ qe(yt, [["render", ht]]), wt = { class: "flex flex-co
|
|
|
895
899
|
p[0] || (p[0] = f("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary" }, [
|
|
896
900
|
f("span", null, "Sending a task to publish templates to all outlets...")
|
|
897
901
|
], -1))
|
|
898
|
-
])) :
|
|
902
|
+
])) : r.value ? r.value.outlets.length === r.value.completed.length ? (k(), S("div", $t, [
|
|
899
903
|
f("p", null, [
|
|
900
|
-
ve(" Your recent publishing task at " +
|
|
904
|
+
ve(" Your recent publishing task at " + I(c(he)(new Date(r.value.createdAt))) + " has ", 1),
|
|
901
905
|
p[1] || (p[1] = f("span", { class: "fm-typo-en-body-lg-600" }, "completed", -1)),
|
|
902
|
-
ve(" at " +
|
|
906
|
+
ve(" at " + I(c(he)(new Date(r.value.updatedAt))) + ". ", 1)
|
|
903
907
|
]),
|
|
904
908
|
p[2] || (p[2] = f("p", null, "Do you want to publish to all outlets?", -1))
|
|
905
|
-
])) : (k(),
|
|
906
|
-
f("div",
|
|
907
|
-
|
|
909
|
+
])) : (k(), S("div", Ct, " Your recent publishing task is still pending (" + I(r.value.completed.length) + " / " + I(r.value.outlets.length) + "). Please wait until all publishing task has completed. ", 1)) : (k(), S("div", Dt, " You have no recent publish activity. Do you want to publish to all outlets? ")) : (k(), S("div", kt, "You have no template to publish.")),
|
|
910
|
+
f("div", Mt, [
|
|
911
|
+
_(e, {
|
|
908
912
|
disabled: !d.value,
|
|
909
913
|
loading: v.value,
|
|
910
914
|
label: "Publish to all outlets",
|
|
911
|
-
onClick:
|
|
915
|
+
onClick: n
|
|
912
916
|
}, null, 8, ["disabled", "loading"]),
|
|
913
|
-
|
|
917
|
+
_(e, {
|
|
914
918
|
variant: "tertiary",
|
|
915
919
|
label: "Close",
|
|
916
920
|
onClick: u
|
|
@@ -919,45 +923,45 @@ const _t = /* @__PURE__ */ qe(yt, [["render", ht]]), wt = { class: "flex flex-co
|
|
|
919
923
|
]);
|
|
920
924
|
};
|
|
921
925
|
}
|
|
922
|
-
}),
|
|
926
|
+
}), Ft = { class: "flex-1 flex flex-col gap-8" }, St = { class: "flex flex-col" }, At = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Vt = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, It = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, Rt = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, qt = /* @__PURE__ */ Y({
|
|
923
927
|
__name: "ClosingTemplateView",
|
|
924
928
|
setup(m) {
|
|
925
|
-
const { t: g } =
|
|
926
|
-
b.watchLocation(
|
|
927
|
-
const y = P(() =>
|
|
928
|
-
function
|
|
929
|
-
switch (
|
|
930
|
-
case
|
|
929
|
+
const { t: g } = J(), { createTemplate: v, updateTemplate: t } = O(), { templateDialogProps: o, templateDetailsProps: s } = Ye(O()), b = ke(), n = Q(), r = De(), d = Ue(), { breakpoints: u } = Le();
|
|
930
|
+
b.watchLocation(r.fetchTemplates);
|
|
931
|
+
const y = P(() => r.loading), p = F(""), w = P(() => u.value.xs || u.value.sm), e = P(() => w.value ? 10 : 20);
|
|
932
|
+
function l(a) {
|
|
933
|
+
switch (a) {
|
|
934
|
+
case z.Add:
|
|
931
935
|
return v();
|
|
932
936
|
case "publish":
|
|
933
937
|
return h();
|
|
934
938
|
}
|
|
935
939
|
}
|
|
936
940
|
function h() {
|
|
937
|
-
|
|
941
|
+
n.open({
|
|
938
942
|
title: "Publish closing templates",
|
|
939
|
-
contentComponent:
|
|
943
|
+
contentComponent: Pt,
|
|
940
944
|
contentComponentProps: {
|
|
941
945
|
onClose() {
|
|
942
|
-
|
|
946
|
+
n.close();
|
|
943
947
|
}
|
|
944
948
|
}
|
|
945
949
|
});
|
|
946
950
|
}
|
|
947
|
-
function D(
|
|
948
|
-
return
|
|
951
|
+
function D(a) {
|
|
952
|
+
return a;
|
|
949
953
|
}
|
|
950
954
|
const $ = P(() => {
|
|
951
|
-
const
|
|
955
|
+
const a = [
|
|
952
956
|
{
|
|
953
957
|
label: g("inventory.closing.template.create.title"),
|
|
954
|
-
value:
|
|
958
|
+
value: z.Add,
|
|
955
959
|
isPrimary: !0,
|
|
956
960
|
prependIcon: "add"
|
|
957
961
|
}
|
|
958
962
|
];
|
|
959
|
-
return
|
|
960
|
-
...
|
|
963
|
+
return w.value ? a : [
|
|
964
|
+
...a,
|
|
961
965
|
{
|
|
962
966
|
label: "Publish",
|
|
963
967
|
value: "publish",
|
|
@@ -965,80 +969,80 @@ const _t = /* @__PURE__ */ qe(yt, [["render", ht]]), wt = { class: "flex flex-co
|
|
|
965
969
|
}
|
|
966
970
|
];
|
|
967
971
|
}), C = P(() => {
|
|
968
|
-
const
|
|
969
|
-
return
|
|
972
|
+
const a = [{ icon: "refresh", onClick: r.fetchTemplates }];
|
|
973
|
+
return w.value ? [{ icon: "publish", onClick: h }, ...a] : a;
|
|
970
974
|
});
|
|
971
|
-
return (
|
|
972
|
-
const
|
|
973
|
-
return k(),
|
|
974
|
-
|
|
975
|
+
return (a, i) => {
|
|
976
|
+
const A = V("FmTable");
|
|
977
|
+
return k(), S(_e, null, [
|
|
978
|
+
_(Ee, {
|
|
975
979
|
title: c(g)("inventory.closing.template.title"),
|
|
976
980
|
actions: $.value,
|
|
977
|
-
"onClick:action":
|
|
981
|
+
"onClick:action": l
|
|
978
982
|
}, {
|
|
979
|
-
default:
|
|
983
|
+
default: R(() => [
|
|
980
984
|
f("div", {
|
|
981
|
-
class:
|
|
985
|
+
class: Fe([
|
|
982
986
|
"flex flex-col gap-8 max-h-full",
|
|
983
987
|
{
|
|
984
|
-
"p-0":
|
|
985
|
-
"px-24 ": !
|
|
988
|
+
"p-0": w.value,
|
|
989
|
+
"px-24 ": !w.value
|
|
986
990
|
}
|
|
987
991
|
])
|
|
988
992
|
}, [
|
|
989
|
-
|
|
993
|
+
_(ze, {
|
|
990
994
|
searchable: "",
|
|
991
995
|
search: p.value,
|
|
992
|
-
"onUpdate:search":
|
|
996
|
+
"onUpdate:search": i[0] || (i[0] = (M) => p.value = M),
|
|
993
997
|
actions: C.value
|
|
994
998
|
}, null, 8, ["search", "actions"]),
|
|
995
|
-
|
|
996
|
-
style:
|
|
997
|
-
"column-defs": c(
|
|
998
|
-
"row-data": c(
|
|
999
|
+
_(A, {
|
|
1000
|
+
style: Se(c(d).tableHeight),
|
|
1001
|
+
"column-defs": c(r).columnDefs,
|
|
1002
|
+
"row-data": c(r).templates,
|
|
999
1003
|
"search-value": p.value,
|
|
1000
1004
|
loading: y.value,
|
|
1001
|
-
onRowClick:
|
|
1005
|
+
onRowClick: i[1] || (i[1] = (M) => c(t)(M.original)),
|
|
1002
1006
|
"page-size": e.value
|
|
1003
1007
|
}, {
|
|
1004
|
-
"list-row":
|
|
1005
|
-
|
|
1008
|
+
"list-row": R((M) => [
|
|
1009
|
+
_(Te, {
|
|
1006
1010
|
row: M,
|
|
1007
|
-
onRowClick: (T) => c(
|
|
1011
|
+
onRowClick: (T) => c(t)(T)
|
|
1008
1012
|
}, {
|
|
1009
|
-
default:
|
|
1010
|
-
var X, Z, ee, j, te, se, le, oe, K, ne, ae, ie, re, ce, ue,
|
|
1013
|
+
default: R((T) => {
|
|
1014
|
+
var X, Z, ee, j, te, se, le, oe, K, ne, ae, ie, re, ce, ue, G, de, me, pe, fe, H, ge;
|
|
1011
1015
|
return [
|
|
1012
|
-
f("div",
|
|
1016
|
+
f("div", Ft, [
|
|
1013
1017
|
f("div", St, [
|
|
1014
|
-
f("div",
|
|
1015
|
-
|
|
1018
|
+
f("div", At, [
|
|
1019
|
+
_(c(N), {
|
|
1016
1020
|
render: (ee = (Z = (X = T._id) == null ? void 0 : X.column) == null ? void 0 : Z.columnDef) == null ? void 0 : ee.cell,
|
|
1017
1021
|
props: (te = (j = T._id) == null ? void 0 : j.getContext) == null ? void 0 : te.call(j)
|
|
1018
1022
|
}, null, 8, ["render", "props"])
|
|
1019
1023
|
]),
|
|
1020
|
-
f("div",
|
|
1021
|
-
|
|
1024
|
+
f("div", Vt, [
|
|
1025
|
+
_(c(N), {
|
|
1022
1026
|
render: (oe = (le = (se = T.name) == null ? void 0 : se.column) == null ? void 0 : le.columnDef) == null ? void 0 : oe.cell,
|
|
1023
1027
|
props: (ne = (K = T.name) == null ? void 0 : K.getContext) == null ? void 0 : ne.call(K)
|
|
1024
1028
|
}, null, 8, ["render", "props"])
|
|
1025
1029
|
]),
|
|
1026
|
-
f("div", null,
|
|
1027
|
-
f("div",
|
|
1030
|
+
f("div", null, I((ae = M.original.locations) != null && ae.length ? `Enabled for ${(ie = M.original.locations) == null ? void 0 : ie.length} outlets` : "Enabled for all outlets"), 1),
|
|
1031
|
+
f("div", It, I([
|
|
1028
1032
|
...M.original.items.slice(0, 3).map(($e) => $e.sku.name),
|
|
1029
1033
|
...M.original.items.length >= 3 ? [`and ${M.original.items.length - 3} more items`] : []
|
|
1030
1034
|
].join(", ")), 1),
|
|
1031
|
-
f("div",
|
|
1032
|
-
|
|
1035
|
+
f("div", Rt, [
|
|
1036
|
+
_(c(N), {
|
|
1033
1037
|
render: (ue = (ce = (re = T.ref) == null ? void 0 : re.column) == null ? void 0 : ce.columnDef) == null ? void 0 : ue.cell,
|
|
1034
|
-
props: (de = (
|
|
1038
|
+
props: (de = (G = T.ref) == null ? void 0 : G.getContext) == null ? void 0 : de.call(G)
|
|
1035
1039
|
}, null, 8, ["render", "props"])
|
|
1036
1040
|
])
|
|
1037
1041
|
]),
|
|
1038
1042
|
f("div", null, [
|
|
1039
|
-
|
|
1043
|
+
_(c(N), {
|
|
1040
1044
|
render: (fe = (pe = (me = T.status) == null ? void 0 : me.column) == null ? void 0 : pe.columnDef) == null ? void 0 : fe.cell,
|
|
1041
|
-
props: (ge = (
|
|
1045
|
+
props: (ge = (H = T.status) == null ? void 0 : H.getContext) == null ? void 0 : ge.call(H)
|
|
1042
1046
|
}, null, 8, ["render", "props"])
|
|
1043
1047
|
])
|
|
1044
1048
|
])
|
|
@@ -1054,9 +1058,9 @@ const _t = /* @__PURE__ */ qe(yt, [["render", ht]]), wt = { class: "flex flex-co
|
|
|
1054
1058
|
_: 1
|
|
1055
1059
|
}, 8, ["title", "actions"]),
|
|
1056
1060
|
(k(), B(Ae, { to: "body" }, [
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
onSubmitted:
|
|
1061
|
+
_(wt, Ve(Ie(c(s))), null, 16),
|
|
1062
|
+
_(yt, Re(c(o), {
|
|
1063
|
+
onSubmitted: i[2] || (i[2] = (M) => c(r).fetchTemplates())
|
|
1060
1064
|
}), null, 16)
|
|
1061
1065
|
]))
|
|
1062
1066
|
], 64);
|