@feedmepos/mf-inventory-portal 0.0.23-dev.19 → 0.0.23-dev.20
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-DY01VbHo.js → App-N2myASr3.js} +44 -41
- package/dist/{ApprovalView-DtwXb5T7.js → ApprovalView-B87DpnNq.js} +20 -23
- package/dist/{BindingsDialog-ClnnwUTV.js → BindingsDialog-DehCgt1T.js} +7 -7
- package/dist/{BindingsPicker-DbdkXiHx.js → BindingsPicker-BBtJ3rBB.js} +7 -8
- package/dist/{BindingsTable-Cqh3Ku0d.js → BindingsTable-CfHuy-K1.js} +16 -20
- package/dist/{ClosingDraftView-CzuMTeC1.js → ClosingDraftView-BYZ1mZrG.js} +190 -196
- package/dist/{ClosingTemplateView-CVQlOya4.js → ClosingTemplateView-CAL9jYaf.js} +49 -60
- package/dist/{FmDroppableField-8RzKjEdL.js → FmDroppableField-CC7RiBoR.js} +1 -1
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BO1wCa9i.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-C4G9LaXv.js} +24 -25
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-sgvBxxkn.js → FmUnitInput.vue_vue_type_script_setup_true_lang-BBf7jmJz.js} +56 -57
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-D7uvrzFU.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-DjTvrLPs.js} +7 -7
- package/dist/{IngredientGroupView-DgDZnggI.js → IngredientGroupView-X0ST4tW9.js} +30 -37
- package/dist/{IngredientsView-SuCckJrj.js → IngredientsView-BUJXzpVr.js} +106 -112
- package/dist/{IntegrationView-CZQoHCkX.js → IntegrationView-QbuIwjec.js} +63 -65
- package/dist/{InventoryBindingForm-C-E3EINv.js → InventoryBindingForm-C1BR_h_3.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-B3nsmCuj.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-CRwcFskQ.js} +18 -20
- package/dist/{InventoryBindingSummary-DNiOKfO8.js → InventoryBindingSummary-gn3Gq1ok.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CdYa8Pv2.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-GY3FFm5_.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-BwxgZ-vM.js → PremiumBadge.vue_vue_type_script_setup_true_lang-DVwtuUg9.js} +8 -8
- package/dist/{PurchaseOrderPrintPreview-C6i2S9L-.js → PurchaseOrderPrintPreview-FuOYaO56.js} +13 -14
- package/dist/{ReceiveRequestView-BABjGvIn.js → ReceiveRequestView-BNz1brve.js} +66 -75
- package/dist/{RecipeView-CoMcIuHu.js → RecipeView-DRKTODfC.js} +58 -64
- package/dist/{StockView-DhJshtaj.js → StockView-DnMcfkGG.js} +80 -87
- package/dist/{SupplierView-hQtDIQzE.js → SupplierView-DAnnWZUN.js} +45 -52
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-DsJUSZsm.js → TransferDetails.vue_vue_type_script_setup_true_lang-BBARPa0S.js} +103 -110
- package/dist/{TransferTemplateView-GzwT4hp-.js → TransferTemplateView-2qlKwwKg.js} +217 -227
- package/dist/{UnitView-CRMF6RWu.js → UnitView-u5wZGetF.js} +103 -108
- package/dist/{WarehouseView-AVEDff0v.js → WarehouseView-Z80N7FJV.js} +77 -84
- package/dist/api/adjustment-template.d.ts +23 -0
- package/dist/app-Fc2FPGhO.js +58871 -0
- package/dist/app.d.ts +51 -0
- package/dist/app.js +2 -2
- package/dist/components/FmMultiselectDialogProps.d.ts +1 -0
- package/dist/composable/defineDeepModel.d.ts +1 -1
- package/dist/{decimal-N5ymnwhP.js → decimal-BDD-e5Lb.js} +1 -1
- package/dist/{feature-Bfq8yWgS.js → feature-BMEyYowI.js} +1 -1
- package/dist/{format-unit-display-CXawcmvj.js → format-unit-display-DvlR_z--.js} +205 -212
- package/dist/{index-CcCqc9jx.js → index-CR22QBdu.js} +1 -1
- package/dist/{netsuite-DX6L1oLu.js → netsuite-CqMWgzKo.js} +9 -9
- package/dist/router/name.d.ts +1 -0
- package/dist/{stock-Btlxmf8R.js → stock-sIy40ix1.js} +7 -8
- package/dist/style.css +1 -1
- package/dist/supplier-Cf24JqTH.js +77 -0
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-inventory-binding-dialog-BFqxWNzX.js → use-inventory-binding-dialog-Br9Uv9o8.js} +10 -11
- package/dist/views/adjustment-template/wastage-template/WastageTemplateDetails.vue.d.ts +2 -0
- package/dist/views/adjustment-template/wastage-template/WastageTemplateDialog.vue.d.ts +22 -0
- package/dist/views/adjustment-template/wastage-template/WastageTemplatePublish.vue.d.ts +6 -0
- package/dist/views/adjustment-template/wastage-template/WastageTemplateView.vue.d.ts +2 -0
- package/dist/views/adjustment-template/wastage-template/actions.d.ts +1295 -0
- package/dist/views/adjustment-template/wastage-template/form/WastageTemplateForm.vue.d.ts +16 -0
- package/dist/views/adjustment-template/wastage-template/form/WastageTemplateItemTable.vue.d.ts +35 -0
- package/dist/views/adjustment-template/wastage-template/form/useAdjustmentTemplateItems.d.ts +20 -0
- package/dist/views/adjustment-template/wastage-template/props.d.ts +29 -0
- package/dist/views/adjustment-template/wastage-template/table.d.ts +1273 -0
- package/dist/views/stock/components/dialog/AdjustedItemForm.vue.d.ts +2 -2
- package/dist/views/stock/helper/compute-summary-total.d.ts +2 -2
- package/dist/{xlsx-C3L2eW52.js → xlsx-sL0sD2HQ.js} +1 -1
- package/dist/{xlsx.util-CJKLCuWK.js → xlsx.util-D2Tdwf8J.js} +1 -1
- package/package.json +3 -3
- package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-m92y5x0G.js +0 -436
- package/dist/FmMultiselectDialog-Jr9uL_z_.js +0 -415
- package/dist/TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js +0 -135
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
- package/dist/app-ww5ibHkL.js +0 -33540
- package/dist/date2-D5MTVjlP.js +0 -117
- package/dist/dayjs.min-7pwGJ2aW.js +0 -282
- package/dist/defineDeepModel-DJODEpcR.js +0 -13
- package/dist/form-mode.enum-BKiNVH6A.js +0 -4
- package/dist/format-time-from-id-0UkRUr39.js +0 -15
- package/dist/fuzzy-DdOiOd-q.js +0 -41
- package/dist/index-Cin_fxtb.js +0 -45
- package/dist/index-gvJJ-xRY.js +0 -22283
- package/dist/row-action.enum-7rGLGZ5v.js +0 -55
- package/dist/rules-C83wiSGb.js +0 -203
- package/dist/supplier-CSzla-9I.js +0 -77
- package/dist/use-template-enabled-locations-2-CUkqC-cd.js +0 -86
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
import { defineComponent as K, computed as _, openBlock as v, createElementBlock as w, createElementVNode as l, Fragment as q, renderList as H, toDisplayString as V, createCommentVNode as Y, ref as M, resolveComponent as I, createBlock as T, withCtx as R, createVNode as y, unref as a, isRef as Z, normalizeClass as ae, normalizeStyle as re, Teleport as ie, normalizeProps as ue, guardReactiveProps as de } from "vue";
|
|
2
|
-
import { a as G, S as me,
|
|
3
|
-
import { useDialog as
|
|
4
|
-
import { i as
|
|
5
|
-
import {
|
|
6
|
-
import { defineStore as be, storeToRefs as ge } from "pinia";
|
|
7
|
-
import { D as oe, R as N } from "./row-action.enum-7rGLGZ5v.js";
|
|
8
|
-
import { c as xe, _ as _e, F as he } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
|
|
2
|
+
import { a as G, c as U, S as me, e as ce, D as ee, f as N, d as oe, k as j, A as pe, h as J, z as fe, B as ve, m as te, u as ye, p as be, q as ge, r as xe, s as _e, v as he } from "./app-Fc2FPGhO.js";
|
|
3
|
+
import { useDialog as Ve, useSnackbar as le, useProxiedModel as ne, useBreakpoints as Ue } from "@feedmepos/ui-library";
|
|
4
|
+
import { i as we, _ as Ce } from "./is-linked-ingredient-error-fJ2TJb3z.js";
|
|
5
|
+
import { defineStore as ke, storeToRefs as Se } from "pinia";
|
|
9
6
|
import { useI18n as O } from "@feedmepos/mf-common";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { F as Se } from "./decimal-N5ymnwhP.js";
|
|
13
|
-
import { _ as $e } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CdYa8Pv2.js";
|
|
7
|
+
import { F as Fe } from "./decimal-BDD-e5Lb.js";
|
|
8
|
+
import { _ as $e } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-GY3FFm5_.js";
|
|
14
9
|
const Ee = { class: "flex flex-col gap-8" }, Ie = {
|
|
15
10
|
key: 0,
|
|
16
11
|
class: "flex flex-col"
|
|
@@ -35,7 +30,7 @@ const Ee = { class: "flex flex-col gap-8" }, Ie = {
|
|
|
35
30
|
unit: {}
|
|
36
31
|
},
|
|
37
32
|
setup(k) {
|
|
38
|
-
const f = k, b = G(), i = _(() => b.validateUnitUsage(f.unit)), r = _(() => i.value.filter((c) => c.from === "INGREDIENT")),
|
|
33
|
+
const f = k, b = G(), i = _(() => b.validateUnitUsage(f.unit)), r = _(() => i.value.filter((c) => c.from === "INGREDIENT")), o = _(() => i.value.filter((c) => c.from === "RECIPE")), m = _(() => i.value.filter((c) => c.from === "MENU"));
|
|
39
34
|
return (c, p) => (v(), w("div", Ee, [
|
|
40
35
|
p[3] || (p[3] = l("div", { class: "fm-typo-en-body-md-400" }, "Sorry, this unit is used in the following modules:", -1)),
|
|
41
36
|
r.value.length ? (v(), w("div", Ie, [
|
|
@@ -47,17 +42,17 @@ const Ee = { class: "flex flex-col gap-8" }, Ie = {
|
|
|
47
42
|
}, "Used in")
|
|
48
43
|
], -1)),
|
|
49
44
|
(v(!0), w(q, null, H(r.value, (s) => {
|
|
50
|
-
var
|
|
45
|
+
var n;
|
|
51
46
|
return v(), w("div", {
|
|
52
47
|
key: s.code,
|
|
53
48
|
class: "flex flex-row fm-typo-en-body-md-400 h-48 items-center border-b border-b-fm-color-neutral-gray-100"
|
|
54
49
|
}, [
|
|
55
50
|
l("div", De, V(s.code) + " " + V(s.name), 1),
|
|
56
|
-
l("div", Ae, V((
|
|
51
|
+
l("div", Ae, V((n = s.bindedIngredient) != null && n.length ? "Convert binding" : "Item unit"), 1)
|
|
57
52
|
]);
|
|
58
53
|
}), 128))
|
|
59
54
|
])) : Y("", !0),
|
|
60
|
-
|
|
55
|
+
o.value.length ? (v(), w("div", Re, [
|
|
61
56
|
p[1] || (p[1] = l("div", { class: "flex flex-row fm-typo-en-body-md-600 bg-fm-color-neutral-gray-100 text-fm-color-typo-secondary h-48 items-center" }, [
|
|
62
57
|
l("div", { class: "flex-1 py-8 px-16" }, "Recipe"),
|
|
63
58
|
l("div", {
|
|
@@ -65,14 +60,14 @@ const Ee = { class: "flex flex-col gap-8" }, Ie = {
|
|
|
65
60
|
style: { "flex-basis": "240px" }
|
|
66
61
|
}, "Used in")
|
|
67
62
|
], -1)),
|
|
68
|
-
(v(!0), w(q, null, H(
|
|
69
|
-
var
|
|
63
|
+
(v(!0), w(q, null, H(o.value, (s) => {
|
|
64
|
+
var n, u, g;
|
|
70
65
|
return v(), w("div", {
|
|
71
66
|
key: s.code,
|
|
72
67
|
class: "flex flex-row fm-typo-en-body-md-400 h-48 items-center border-b border-b-fm-color-neutral-gray-100"
|
|
73
68
|
}, [
|
|
74
69
|
l("div", Me, V(s.code) + " " + V(s.name), 1),
|
|
75
|
-
l("div", Pe, V((
|
|
70
|
+
l("div", Pe, V((n = s.bindedIngredient) == null ? void 0 : n.slice(0, 3).map((x) => x.code).join(", ")) + " " + V(s.bindedIngredient && ((u = s.bindedIngredient) == null ? void 0 : u.length) > 3 ? `and ${((g = s.bindedIngredient) == null ? void 0 : g.length) - 3} more` : ""), 1)
|
|
76
71
|
]);
|
|
77
72
|
}), 128))
|
|
78
73
|
])) : Y("", !0),
|
|
@@ -85,56 +80,56 @@ const Ee = { class: "flex flex-col gap-8" }, Ie = {
|
|
|
85
80
|
}, "Used in")
|
|
86
81
|
], -1)),
|
|
87
82
|
(v(!0), w(q, null, H(m.value, (s) => {
|
|
88
|
-
var
|
|
83
|
+
var n, u, g;
|
|
89
84
|
return v(), w("div", {
|
|
90
85
|
key: s.code,
|
|
91
86
|
class: "flex flex-row fm-typo-en-body-md-400 h-48 items-center border-b border-b-fm-color-neutral-gray-100"
|
|
92
87
|
}, [
|
|
93
88
|
l("div", Be, V(s.code) + " " + V(s.name), 1),
|
|
94
|
-
l("div", ze, V((
|
|
89
|
+
l("div", ze, V((n = s.bindedIngredient) == null ? void 0 : n.slice(0, 3).map((x) => x.code).join(", ")) + " " + V(s.bindedIngredient && ((u = s.bindedIngredient) == null ? void 0 : u.length) > 3 ? `and ${((g = s.bindedIngredient) == null ? void 0 : g.length) - 3} more` : ""), 1)
|
|
95
90
|
]);
|
|
96
91
|
}), 128))
|
|
97
92
|
])) : Y("", !0)
|
|
98
93
|
]));
|
|
99
94
|
}
|
|
100
|
-
}), Q =
|
|
101
|
-
const f =
|
|
95
|
+
}), Q = ke("unitForm", function() {
|
|
96
|
+
const f = Ve(), b = le(), i = G(), r = M(!1), o = M();
|
|
102
97
|
function m() {
|
|
103
|
-
const
|
|
98
|
+
const n = {
|
|
104
99
|
unit: {},
|
|
105
100
|
mode: U.CREATE,
|
|
106
101
|
show: !0,
|
|
107
102
|
"onUpdate:show"(u) {
|
|
108
|
-
|
|
103
|
+
o.value.show = u;
|
|
109
104
|
}
|
|
110
105
|
};
|
|
111
|
-
|
|
106
|
+
o.value = n;
|
|
112
107
|
}
|
|
113
|
-
async function c(
|
|
108
|
+
async function c(n) {
|
|
114
109
|
const u = {
|
|
115
|
-
unit:
|
|
110
|
+
unit: n,
|
|
116
111
|
mode: U.UPDATE,
|
|
117
112
|
show: !0,
|
|
118
113
|
"onUpdate:show"(g) {
|
|
119
|
-
|
|
114
|
+
o.value.show = g;
|
|
120
115
|
}
|
|
121
116
|
};
|
|
122
|
-
|
|
117
|
+
o.value = u;
|
|
123
118
|
}
|
|
124
|
-
async function p(
|
|
119
|
+
async function p(n) {
|
|
125
120
|
r.value = !0;
|
|
126
121
|
try {
|
|
127
|
-
await i.deleteUnit(
|
|
122
|
+
await i.deleteUnit(n), b.open({
|
|
128
123
|
title: "Success",
|
|
129
|
-
message: `Deleted ${
|
|
124
|
+
message: `Deleted ${n.name}`,
|
|
130
125
|
type: "success"
|
|
131
126
|
});
|
|
132
127
|
} catch (u) {
|
|
133
|
-
u instanceof me &&
|
|
128
|
+
u instanceof me && we(u) ? f.open({
|
|
134
129
|
title: "Cannot delete unit",
|
|
135
|
-
contentComponent:
|
|
130
|
+
contentComponent: Ce,
|
|
136
131
|
contentComponentProps: {
|
|
137
|
-
subject: (
|
|
132
|
+
subject: (n == null ? void 0 : n.name) ?? "",
|
|
138
133
|
items: u.errorResponse.message
|
|
139
134
|
},
|
|
140
135
|
secondaryActions: {
|
|
@@ -142,7 +137,7 @@ const Ee = { class: "flex flex-col gap-8" }, Ie = {
|
|
|
142
137
|
close: !0
|
|
143
138
|
}
|
|
144
139
|
}) : console.log("unable to delete unit", u), b.open({
|
|
145
|
-
title: `Cannot delete ${
|
|
140
|
+
title: `Cannot delete ${n.name}`,
|
|
146
141
|
message: "Please try again.",
|
|
147
142
|
type: "error"
|
|
148
143
|
}), console.error("failed to delete unit", u);
|
|
@@ -150,16 +145,16 @@ const Ee = { class: "flex flex-col gap-8" }, Ie = {
|
|
|
150
145
|
r.value = !1;
|
|
151
146
|
}
|
|
152
147
|
}
|
|
153
|
-
function s(
|
|
154
|
-
if (i.validateUnitUsage(
|
|
148
|
+
function s(n) {
|
|
149
|
+
if (i.validateUnitUsage(n).length) {
|
|
155
150
|
f.open({
|
|
156
|
-
title: `Cannot delete ${(
|
|
151
|
+
title: `Cannot delete ${(n == null ? void 0 : n.name) ?? "unit"}`,
|
|
157
152
|
overlay: !0,
|
|
158
153
|
dismissAway: !0,
|
|
159
154
|
closeButton: !0,
|
|
160
155
|
contentComponent: Le,
|
|
161
156
|
contentComponentProps: {
|
|
162
|
-
unit:
|
|
157
|
+
unit: n
|
|
163
158
|
},
|
|
164
159
|
primaryActions: {
|
|
165
160
|
text: "Confirm",
|
|
@@ -169,7 +164,7 @@ const Ee = { class: "flex flex-col gap-8" }, Ie = {
|
|
|
169
164
|
return;
|
|
170
165
|
}
|
|
171
166
|
f.open({
|
|
172
|
-
title: `Delete ${(
|
|
167
|
+
title: `Delete ${(n == null ? void 0 : n.name) ?? "unit"}?`,
|
|
173
168
|
closeButton: !1,
|
|
174
169
|
message: "You may not be able to delete this unit if it is linked in any of the inventory modules.",
|
|
175
170
|
primaryActions: {
|
|
@@ -181,25 +176,25 @@ const Ee = { class: "flex flex-col gap-8" }, Ie = {
|
|
|
181
176
|
text: "Cancel",
|
|
182
177
|
close: !0
|
|
183
178
|
}
|
|
184
|
-
}).onPrimary(() => p(
|
|
179
|
+
}).onPrimary(() => p(n));
|
|
185
180
|
}
|
|
186
181
|
return {
|
|
187
182
|
createUnit: m,
|
|
188
183
|
updateUnit: c,
|
|
189
184
|
deleteUnit: s,
|
|
190
|
-
unitDialogProps:
|
|
185
|
+
unitDialogProps: o,
|
|
191
186
|
unitViewLoading: r
|
|
192
187
|
};
|
|
193
188
|
});
|
|
194
189
|
function Ne() {
|
|
195
190
|
const { updateUnit: k, deleteUnit: f } = Q(), { t: b } = O();
|
|
196
|
-
async function i(
|
|
197
|
-
const c =
|
|
198
|
-
if (
|
|
191
|
+
async function i(o, m) {
|
|
192
|
+
const c = oe(m);
|
|
193
|
+
if (o === N.Edit) {
|
|
199
194
|
await k(c);
|
|
200
195
|
return;
|
|
201
196
|
}
|
|
202
|
-
if (
|
|
197
|
+
if (o === N.Delete) {
|
|
203
198
|
await f(c);
|
|
204
199
|
return;
|
|
205
200
|
}
|
|
@@ -220,11 +215,11 @@ function Ne() {
|
|
|
220
215
|
{
|
|
221
216
|
id: "action",
|
|
222
217
|
header: "",
|
|
223
|
-
cell(
|
|
224
|
-
return
|
|
225
|
-
[
|
|
218
|
+
cell(o) {
|
|
219
|
+
return ce(
|
|
220
|
+
[ee[N.Edit], ee[N.Delete]],
|
|
226
221
|
(m) => {
|
|
227
|
-
i(m,
|
|
222
|
+
i(m, o.row.original);
|
|
228
223
|
}
|
|
229
224
|
);
|
|
230
225
|
},
|
|
@@ -246,7 +241,7 @@ const je = { class: "flex flex-col gap-24" }, qe = { class: "flex gap-24" }, He
|
|
|
246
241
|
},
|
|
247
242
|
emits: ["update:modelValue", "click:submit"],
|
|
248
243
|
setup(k, { expose: f, emit: b }) {
|
|
249
|
-
const i = k, r = b, { t:
|
|
244
|
+
const i = k, r = b, { t: o } = O();
|
|
250
245
|
function m() {
|
|
251
246
|
r("click:submit");
|
|
252
247
|
}
|
|
@@ -277,7 +272,7 @@ const je = { class: "flex flex-col gap-24" }, qe = { class: "flex gap-24" }, He
|
|
|
277
272
|
const t = i.modelValue ?? {};
|
|
278
273
|
t.precision = e, r("update:modelValue", t);
|
|
279
274
|
}
|
|
280
|
-
}),
|
|
275
|
+
}), n = _({
|
|
281
276
|
get() {
|
|
282
277
|
var e;
|
|
283
278
|
return ((e = i.modelValue) == null ? void 0 : e.measurements) ?? [];
|
|
@@ -321,7 +316,7 @@ const je = { class: "flex flex-col gap-24" }, qe = { class: "flex gap-24" }, He
|
|
|
321
316
|
(t = (e = x.value) == null ? void 0 : e.resetInputs) == null || t.call(e);
|
|
322
317
|
}
|
|
323
318
|
}), (e, t) => {
|
|
324
|
-
const d = I("FmTextField"), D = I("FmStepperField"),
|
|
319
|
+
const d = I("FmTextField"), D = I("FmStepperField"), S = I("FmButton"), F = I("FmCard"), E = I("FmForm");
|
|
325
320
|
return v(), T(E, {
|
|
326
321
|
ref_key: "formRef",
|
|
327
322
|
ref: x,
|
|
@@ -336,7 +331,7 @@ const je = { class: "flex flex-col gap-24" }, qe = { class: "flex gap-24" }, He
|
|
|
336
331
|
l("div", He, [
|
|
337
332
|
y(d, {
|
|
338
333
|
disabled: e.disabled,
|
|
339
|
-
label: a(
|
|
334
|
+
label: a(o)("inventory.unit.name"),
|
|
340
335
|
modelValue: c.value,
|
|
341
336
|
"onUpdate:modelValue": t[0] || (t[0] = (C) => c.value = C),
|
|
342
337
|
rules: [a(j)()],
|
|
@@ -346,7 +341,7 @@ const je = { class: "flex flex-col gap-24" }, qe = { class: "flex gap-24" }, He
|
|
|
346
341
|
l("div", Ke, [
|
|
347
342
|
y(d, {
|
|
348
343
|
disabled: e.disabled,
|
|
349
|
-
label: a(
|
|
344
|
+
label: a(o)("inventory.unit.symbol"),
|
|
350
345
|
modelValue: p.value,
|
|
351
346
|
"onUpdate:modelValue": t[1] || (t[1] = (C) => p.value = C),
|
|
352
347
|
rules: [a(j)()],
|
|
@@ -358,32 +353,32 @@ const je = { class: "flex flex-col gap-24" }, qe = { class: "flex gap-24" }, He
|
|
|
358
353
|
y(D, {
|
|
359
354
|
disabled: e.disabled,
|
|
360
355
|
class: "col-span-3",
|
|
361
|
-
label: a(
|
|
356
|
+
label: a(o)("inventory.unit.precision"),
|
|
362
357
|
modelValue: s.value,
|
|
363
358
|
"onUpdate:modelValue": t[2] || (t[2] = (C) => s.value = C),
|
|
364
|
-
rules: [a(
|
|
359
|
+
rules: [a(pe)(0)]
|
|
365
360
|
}, null, 8, ["disabled", "label", "modelValue", "rules"])
|
|
366
361
|
])
|
|
367
362
|
]),
|
|
368
363
|
l("div", Ge, [
|
|
369
|
-
y(
|
|
364
|
+
y(S, {
|
|
370
365
|
disabled: e.disabled,
|
|
371
366
|
type: "button",
|
|
372
367
|
"prepend-icon": "add",
|
|
373
|
-
label: a(
|
|
368
|
+
label: a(o)("inventory.unit.measurement.addMeasurement"),
|
|
374
369
|
variant: "plain",
|
|
375
370
|
onClick: u
|
|
376
371
|
}, null, 8, ["disabled", "label"])
|
|
377
372
|
]),
|
|
378
|
-
(v(!0), w(q, null, H((P = e.modelValue) == null ? void 0 : P.measurements, (C, h) => (v(), T(
|
|
373
|
+
(v(!0), w(q, null, H((P = e.modelValue) == null ? void 0 : P.measurements, (C, h) => (v(), T(F, {
|
|
379
374
|
class: "flex flex-col gap-16 p-16",
|
|
380
375
|
variant: "outlined",
|
|
381
376
|
key: C.id
|
|
382
377
|
}, {
|
|
383
378
|
default: R(() => [
|
|
384
379
|
l("div", Oe, [
|
|
385
|
-
l("div", Ye, V(a(
|
|
386
|
-
y(
|
|
380
|
+
l("div", Ye, V(a(o)("inventory.unit.measurement.measurementDefault", [h + 1])), 1),
|
|
381
|
+
y(S, {
|
|
387
382
|
disabled: e.disabled,
|
|
388
383
|
variant: "tertiary",
|
|
389
384
|
"prepend-icon": "delete",
|
|
@@ -396,7 +391,7 @@ const je = { class: "flex flex-col gap-24" }, qe = { class: "flex gap-24" }, He
|
|
|
396
391
|
y(d, {
|
|
397
392
|
disabled: e.disabled,
|
|
398
393
|
class: "col-span-2",
|
|
399
|
-
label: a(
|
|
394
|
+
label: a(o)("inventory.unit.measurement.name"),
|
|
400
395
|
modelValue: e.modelValue.measurements[h].name,
|
|
401
396
|
"onUpdate:modelValue": ($) => e.modelValue.measurements[h].name = $,
|
|
402
397
|
rules: [a(j)()],
|
|
@@ -406,7 +401,7 @@ const je = { class: "flex flex-col gap-24" }, qe = { class: "flex gap-24" }, He
|
|
|
406
401
|
l("div", Xe, [
|
|
407
402
|
y(d, {
|
|
408
403
|
disabled: e.disabled,
|
|
409
|
-
label: a(
|
|
404
|
+
label: a(o)("inventory.unit.measurement.symbol"),
|
|
410
405
|
modelValue: e.modelValue.measurements[h].abbrev,
|
|
411
406
|
"onUpdate:modelValue": ($) => e.modelValue.measurements[h].abbrev = $,
|
|
412
407
|
rules: [a(j)()],
|
|
@@ -417,20 +412,20 @@ const je = { class: "flex flex-col gap-24" }, qe = { class: "flex gap-24" }, He
|
|
|
417
412
|
y($e, {
|
|
418
413
|
disabled: e.disabled,
|
|
419
414
|
class: "col-span-3",
|
|
420
|
-
label: a(
|
|
415
|
+
label: a(o)("inventory.unit.measurement.conversion"),
|
|
421
416
|
"model-value": +a(J)(e.modelValue.measurements[h].conversion),
|
|
422
|
-
"onUpdate:modelValue": ($) =>
|
|
417
|
+
"onUpdate:modelValue": ($) => n.value = n.value.map(
|
|
423
418
|
(A, B) => B === h ? {
|
|
424
419
|
...A,
|
|
425
|
-
conversion: a(
|
|
426
|
-
a(
|
|
420
|
+
conversion: a(Fe).toPrecision(
|
|
421
|
+
a(fe)($),
|
|
427
422
|
s.value
|
|
428
423
|
)
|
|
429
424
|
} : A
|
|
430
425
|
),
|
|
431
|
-
rules: [a(
|
|
426
|
+
rules: [a(ve)(0)],
|
|
432
427
|
step: +a(J)({ amount: 1, precision: s.value }),
|
|
433
|
-
"helper-text": a(
|
|
428
|
+
"helper-text": a(o)("inventory.unit.measurement.conversionHelper", {
|
|
434
429
|
measurementSymbol: e.modelValue.measurements[h].name || " measurement unit",
|
|
435
430
|
conversion: +a(J)(e.modelValue.measurements[h].conversion),
|
|
436
431
|
unitSymbol: p.value || "base unit"
|
|
@@ -455,7 +450,7 @@ const je = { class: "flex flex-col gap-24" }, qe = { class: "flex gap-24" }, He
|
|
|
455
450
|
},
|
|
456
451
|
emits: ["update:show"],
|
|
457
452
|
setup(k) {
|
|
458
|
-
const f = k, b = G(), i = le(), { t: r } = O(),
|
|
453
|
+
const f = k, b = G(), i = le(), { t: r } = O(), o = ne(f, "show"), m = ne(f, "unit"), c = _(() => {
|
|
459
454
|
switch (f.mode) {
|
|
460
455
|
case U.READ:
|
|
461
456
|
return "";
|
|
@@ -475,42 +470,42 @@ const je = { class: "flex flex-col gap-24" }, qe = { class: "flex gap-24" }, He
|
|
|
475
470
|
return r("common.add");
|
|
476
471
|
}
|
|
477
472
|
return "";
|
|
478
|
-
}), s = M(),
|
|
473
|
+
}), s = M(), n = M(!1);
|
|
479
474
|
async function u() {
|
|
480
|
-
|
|
475
|
+
n.value = !0;
|
|
481
476
|
try {
|
|
482
|
-
const t =
|
|
483
|
-
t.precision ?? (t.precision = 0), t.measurements ?? (t.measurements = []), await b.createUnit(t),
|
|
477
|
+
const t = oe(m.value);
|
|
478
|
+
t.precision ?? (t.precision = 0), t.measurements ?? (t.measurements = []), await b.createUnit(t), o.value = !1, i.open({
|
|
484
479
|
title: r("inventory.common.success"),
|
|
485
480
|
message: r("inventory.unit.create.success", { name: m.value.name }),
|
|
486
481
|
type: "success"
|
|
487
482
|
});
|
|
488
483
|
} catch (t) {
|
|
489
|
-
t instanceof
|
|
484
|
+
t instanceof te || i.open({
|
|
490
485
|
title: r("inventory.unit.create.error.title"),
|
|
491
486
|
message: r("inventory.unit.create.error.message"),
|
|
492
487
|
type: "error"
|
|
493
488
|
});
|
|
494
489
|
} finally {
|
|
495
|
-
|
|
490
|
+
n.value = !1;
|
|
496
491
|
}
|
|
497
492
|
}
|
|
498
493
|
async function g() {
|
|
499
|
-
|
|
494
|
+
n.value = !0;
|
|
500
495
|
try {
|
|
501
|
-
await b.updateUnit(m.value),
|
|
496
|
+
await b.updateUnit(m.value), o.value = !1, i.open({
|
|
502
497
|
title: r("inventory.common.success"),
|
|
503
498
|
message: r("inventory.unit.update.success", { name: m.value.name }),
|
|
504
499
|
type: "success"
|
|
505
500
|
});
|
|
506
501
|
} catch (t) {
|
|
507
|
-
t instanceof
|
|
502
|
+
t instanceof te || i.open({
|
|
508
503
|
title: r("inventory.unit.update.error.title"),
|
|
509
504
|
message: r("inventory.unit.update.error.message"),
|
|
510
505
|
type: "error"
|
|
511
506
|
});
|
|
512
507
|
} finally {
|
|
513
|
-
|
|
508
|
+
n.value = !1;
|
|
514
509
|
}
|
|
515
510
|
}
|
|
516
511
|
function x() {
|
|
@@ -528,10 +523,10 @@ const je = { class: "flex flex-col gap-24" }, qe = { class: "flex gap-24" }, He
|
|
|
528
523
|
}
|
|
529
524
|
}
|
|
530
525
|
return (t, d) => {
|
|
531
|
-
const D = I("FmButton"),
|
|
532
|
-
return v(), T(
|
|
533
|
-
"model-value": a(
|
|
534
|
-
"onUpdate:modelValue": d[3] || (d[3] = (
|
|
526
|
+
const D = I("FmButton"), S = I("FmSideSheet");
|
|
527
|
+
return v(), T(S, {
|
|
528
|
+
"model-value": a(o),
|
|
529
|
+
"onUpdate:modelValue": d[3] || (d[3] = (F) => Z(o) ? o.value = F : null),
|
|
535
530
|
header: c.value,
|
|
536
531
|
"close-button": "",
|
|
537
532
|
"dismiss-away": "",
|
|
@@ -540,15 +535,15 @@ const je = { class: "flex flex-col gap-24" }, qe = { class: "flex gap-24" }, He
|
|
|
540
535
|
"side-sheet-footer": R(() => [
|
|
541
536
|
l("div", et, [
|
|
542
537
|
y(D, {
|
|
543
|
-
loading:
|
|
538
|
+
loading: n.value,
|
|
544
539
|
label: p.value,
|
|
545
540
|
onClick: x
|
|
546
541
|
}, null, 8, ["loading", "label"]),
|
|
547
542
|
y(D, {
|
|
548
|
-
disabled:
|
|
543
|
+
disabled: n.value,
|
|
549
544
|
label: a(r)("common.close"),
|
|
550
545
|
variant: "tertiary",
|
|
551
|
-
onClick: d[2] || (d[2] = (
|
|
546
|
+
onClick: d[2] || (d[2] = (F) => o.value = !1)
|
|
552
547
|
}, null, 8, ["disabled", "label"])
|
|
553
548
|
])
|
|
554
549
|
]),
|
|
@@ -558,27 +553,27 @@ const je = { class: "flex flex-col gap-24" }, qe = { class: "flex gap-24" }, He
|
|
|
558
553
|
ref_key: "hasValidationExpose",
|
|
559
554
|
ref: s,
|
|
560
555
|
modelValue: a(m),
|
|
561
|
-
"onUpdate:modelValue": d[0] || (d[0] = (
|
|
556
|
+
"onUpdate:modelValue": d[0] || (d[0] = (F) => Z(m) ? m.value = F : null),
|
|
562
557
|
mode: t.mode,
|
|
563
|
-
disabled:
|
|
564
|
-
"onClick:submit": d[1] || (d[1] = (
|
|
558
|
+
disabled: n.value,
|
|
559
|
+
"onClick:submit": d[1] || (d[1] = (F) => e())
|
|
565
560
|
}, null, 8, ["modelValue", "mode", "disabled"])
|
|
566
561
|
]),
|
|
567
562
|
_: 1
|
|
568
563
|
}, 8, ["model-value", "header"]);
|
|
569
564
|
};
|
|
570
565
|
}
|
|
571
|
-
}),
|
|
566
|
+
}), nt = { class: "flex flex-col py-8" }, ot = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, lt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, pt = /* @__PURE__ */ K({
|
|
572
567
|
__name: "UnitView",
|
|
573
568
|
setup(k) {
|
|
574
|
-
const f = G(), b =
|
|
569
|
+
const f = G(), b = ye(), i = _(() => f.units), { createUnit: r, updateUnit: o } = Q(), { unitDialogProps: m, unitViewLoading: c } = Se(Q()), { columnDefs: p } = Ne();
|
|
575
570
|
function s(D) {
|
|
576
571
|
D === "add" && r();
|
|
577
572
|
}
|
|
578
|
-
const
|
|
579
|
-
return (D,
|
|
580
|
-
const
|
|
581
|
-
return v(), T(
|
|
573
|
+
const n = M(""), u = _(() => c.value), { breakpoints: g } = Ue(), x = _(() => g.value.xs || g.value.sm), e = _(() => x.value ? 10 : 20), t = be(), { t: d } = O();
|
|
574
|
+
return (D, S) => {
|
|
575
|
+
const F = I("FmTable");
|
|
576
|
+
return v(), T(ge, {
|
|
582
577
|
title: a(d)("inventory.unit.title"),
|
|
583
578
|
actions: [
|
|
584
579
|
{ label: a(d)("inventory.unit.create.title"), value: "add", isPrimary: !0, prependIcon: "add" }
|
|
@@ -595,30 +590,30 @@ const je = { class: "flex flex-col gap-24" }, qe = { class: "flex gap-24" }, He
|
|
|
595
590
|
}
|
|
596
591
|
])
|
|
597
592
|
}, [
|
|
598
|
-
y(
|
|
593
|
+
y(xe, {
|
|
599
594
|
searchable: "",
|
|
600
|
-
search:
|
|
601
|
-
"onUpdate:search":
|
|
595
|
+
search: n.value,
|
|
596
|
+
"onUpdate:search": S[0] || (S[0] = (E) => n.value = E)
|
|
602
597
|
}, null, 8, ["search"]),
|
|
603
|
-
y(
|
|
598
|
+
y(F, {
|
|
604
599
|
style: re(a(t).tableHeight),
|
|
605
600
|
"column-defs": a(p),
|
|
606
601
|
"row-data": i.value,
|
|
607
|
-
"search-value":
|
|
602
|
+
"search-value": n.value,
|
|
608
603
|
loading: !a(b)._currentLocation || u.value,
|
|
609
|
-
onRowClick:
|
|
604
|
+
onRowClick: S[1] || (S[1] = (E) => a(o)(E.original)),
|
|
610
605
|
"page-size": e.value
|
|
611
606
|
}, {
|
|
612
607
|
"list-row": R((E) => [
|
|
613
608
|
y(_e, {
|
|
614
609
|
row: E,
|
|
615
|
-
onRowClick: a(
|
|
610
|
+
onRowClick: a(o)
|
|
616
611
|
}, {
|
|
617
612
|
default: R((P) => {
|
|
618
613
|
var C, h, $, A, B, z, W, L, X;
|
|
619
614
|
return [
|
|
620
|
-
l("div",
|
|
621
|
-
l("div",
|
|
615
|
+
l("div", nt, [
|
|
616
|
+
l("div", ot, [
|
|
622
617
|
y(a(he), {
|
|
623
618
|
render: ($ = (h = (C = P.name) == null ? void 0 : C.column) == null ? void 0 : h.columnDef) == null ? void 0 : $.cell,
|
|
624
619
|
props: (B = (A = P.name) == null ? void 0 : A.getContext) == null ? void 0 : B.call(A)
|
|
@@ -644,5 +639,5 @@ const je = { class: "flex flex-col gap-24" }, qe = { class: "flex gap-24" }, He
|
|
|
644
639
|
}
|
|
645
640
|
});
|
|
646
641
|
export {
|
|
647
|
-
|
|
642
|
+
pt as default
|
|
648
643
|
};
|