@feedmepos/mf-inventory-portal 0.0.23-dev.4 → 0.0.23-dev.40
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-DReDvY0M.js → App-D8DXxTIq.js} +84 -72
- package/dist/{ApprovalView-BMZlYmRk.js → ApprovalView-BWGXkHV6.js} +25 -28
- package/dist/{BindingsDialog-Y2K4I7H7.js → BindingsDialog-D7WypDot.js} +6 -6
- package/dist/{BindingsPicker-DKBq9c37.js → BindingsPicker-DUlGwkwM.js} +8 -9
- package/dist/{BindingsTable-45v4SDfp.js → BindingsTable-BjeZYCaJ.js} +18 -22
- package/dist/ClosingDraftView-o2LEUfo8.js +1190 -0
- package/dist/{ClosingTemplateView-CKJVYSbj.js → ClosingTemplateView-Dt983Cg4.js} +271 -285
- package/dist/FmCustomAttribute.vue_vue_type_script_setup_true_lang-Dc_7IyBG.js +142 -0
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CMEOp-0r.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-wocPyZls.js} +18 -19
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-C1DjyjyH.js → FmUnitInput.vue_vue_type_script_setup_true_lang-DzoEp-Pg.js} +25 -26
- package/dist/{IngredientGroupView-BuP-HGeg.js → IngredientGroupView-CIPpIpv1.js} +63 -69
- package/dist/IngredientsView-CFV3kX7Q.js +1707 -0
- package/dist/{IntegrationView-kYCaKG0o.js → IntegrationView-DkW32m-t.js} +89 -92
- package/dist/{InventoryBindingForm-BXHq4h-n.js → InventoryBindingForm-B4CBet9W.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-CVxJ_bV3.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-DpdDVf6O.js} +112 -104
- package/dist/{InventoryBindingSummary-Bjasfc_v.js → InventoryBindingSummary-75ImZtqK.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DM0C4raP.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DfpG3Fy8.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-C3O3JebE.js → PremiumBadge.vue_vue_type_script_setup_true_lang-B4d0c3nk.js} +19 -20
- package/dist/{PurchaseOrderPrintPreview-CmjkfTTS.js → PurchaseOrderPrintPreview-BYO0JcQW.js} +17 -18
- package/dist/ReceiveRequestView-cFLNExw9.js +4194 -0
- package/dist/RecipeView-CjfpaHaT.js +609 -0
- package/dist/StockView-HMtD9qar.js +1818 -0
- package/dist/{SupplierView-DAx7E7sR.js → SupplierView-Cidfe-Xm.js} +2325 -787
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-CdU3HPBC.js +1275 -0
- package/dist/TransferTemplateView-Doxr1fXP.js +1264 -0
- package/dist/{UnitView-CQPGZ8-r.js → UnitView-C1af71aM.js} +228 -227
- package/dist/{WarehouseView-jy-RNCgy.js → WarehouseView-CviOLXfX.js} +100 -106
- package/dist/api/adjustment-template.d.ts +25 -0
- package/dist/api/bill.d.ts +240 -84
- package/dist/api/closing-draft.d.ts +6 -0
- package/dist/api/closing.d.ts +1 -0
- package/dist/api/inventory.d.ts +15 -6
- package/dist/api/netsuite.d.ts +3 -3
- package/dist/app-BE8SgDqI.js +84466 -0
- package/dist/app.d.ts +64 -0
- package/dist/app.js +2 -2
- package/dist/components/FmCustomAttribute.vue.d.ts +23 -0
- package/dist/components/FmLockableField.vue.d.ts +37 -0
- package/dist/components/FmMultiselectDialogProps.d.ts +1 -0
- package/dist/components/inventory-binding/InventoryBinding.vue.d.ts +3 -1
- package/dist/components/row-action.enum.d.ts +1 -0
- package/dist/components/shell/inventory/binding-ui.vue.d.ts +3 -1
- package/dist/composable/defineDeepModel.d.ts +1 -1
- package/dist/{decimal-BAc9M88Q.js → decimal-xj3kVOP6.js} +1 -1
- package/dist/feature-CWpNYcWJ.js +946 -0
- package/dist/format-unit-display-CZ835oaL.js +1215 -0
- package/dist/index-B8IWDKYv.js +29202 -0
- package/dist/{StockView-D9no-mrA.js → index-C6SzYqK7.js} +2242 -3986
- package/dist/router/name.d.ts +2 -0
- package/dist/stock-C2xyYnS7.js +125 -0
- package/dist/stores/feature.d.ts +6 -0
- package/dist/stores/integration/netsuite.d.ts +70 -2
- package/dist/stores/inventory.d.ts +21 -12
- package/dist/stores/supplier.d.ts +1 -1
- package/dist/style.css +1 -1
- package/dist/{supplier-DJC0UZWv.js → supplier-B-7o9hg1.js} +15 -15
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-inventory-binding-dialog-PEQbFRvO.js → use-inventory-binding-dialog-Dm8Ky1MH.js} +10 -11
- package/dist/views/adjustment-template/import/AdjustmentTemplateImport.vue.d.ts +2 -0
- package/dist/views/adjustment-template/import/AdjustmentTemplateImportItem.vue.d.ts +18 -0
- package/dist/views/adjustment-template/import/export.d.ts +60 -0
- 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/WastageTemplateReason.vue.d.ts +18 -0
- package/dist/views/adjustment-template/wastage-template/WastageTemplateView.vue.d.ts +2 -0
- package/dist/views/adjustment-template/wastage-template/actions.d.ts +1329 -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 +36 -0
- package/dist/views/adjustment-template/wastage-template/table.d.ts +1303 -0
- package/dist/views/closing-draft/ClosingDraftView.vue.d.ts +2 -0
- package/dist/views/closing-draft/components/closing-draft-action/ClosingDraftAction.vue.d.ts +22 -0
- package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +625 -0
- package/dist/views/closing-draft/composables/use-closing-draft-actions.d.ts +25 -0
- package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +3645 -0
- package/dist/views/closing-draft/helpers/draft-status-to-class-name.helper.d.ts +1 -0
- package/dist/views/closing-draft/helpers/export-draft.helper.d.ts +19 -0
- package/dist/views/closing-draft/helpers/get-calculated-total.helper.d.ts +4 -0
- package/dist/views/closing-template/components/closing-template-form/composables/use-closing-template-items.d.ts +2 -1
- package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +48 -204
- package/dist/views/closing-template/composables/use-closing-template-table.d.ts +49 -205
- package/dist/views/ingredient-group/composables/use-ingredient-group-table.d.ts +6 -3
- package/dist/views/ingredients/components/convert/ConvertFormProps.d.ts +1 -0
- package/dist/views/ingredients/components/ingredient-form/IngredientForm.vue.d.ts +4 -2
- package/dist/views/ingredients/components/inventory-binding/InventoryBindingForm.vue.d.ts +1 -0
- package/dist/views/ingredients/composables/use-ingredient-table.d.ts +2 -1
- package/dist/views/receive-request/components/netsuite/NetSuiteInfo.vue.d.ts +12 -0
- package/dist/views/receive-request/components/netsuite/NetSuiteProps.d.ts +13 -0
- package/dist/views/receive-request/components/netsuite/NetSuiteSync.vue.d.ts +12 -0
- package/dist/views/receive-request/components/transfer-form/NetSuiteField.vue.d.ts +2 -0
- package/dist/views/receive-request/components/transfer-form/SparkIcon.vue.d.ts +1 -1
- package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +40 -17
- package/dist/views/receive-request/components/transfer-form/components/ForecastStock.vue.d.ts +4 -2
- package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +2 -1
- package/dist/views/receive-request/composables/use-receive-request-form.d.ts +57 -24
- package/dist/views/receive-request/composables/use-receive-request-table.d.ts +57 -24
- package/dist/views/recipe/components/recipe-form/RecipeForm.vue.d.ts +2 -0
- package/dist/views/stock/components/StockRecordCard.vue.d.ts +120 -42
- package/dist/views/stock/components/dialog/AdjustedItemForm.vue.d.ts +6 -4
- package/dist/views/stock/helper/compute-summary-total.d.ts +2 -2
- package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.d.ts +2 -1
- package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +24 -12
- package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +24 -12
- package/dist/views/transfer-template/helpers/import-export.helper.d.ts +2 -1
- package/package.json +5 -4
- package/dist/FmDroppableField-8RzKjEdL.js +0 -154
- package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BhdcqRh-.js +0 -436
- package/dist/FmMultiselectDialog-D7YtdoyJ.js +0 -415
- package/dist/IngredientBindedItem.vue_vue_type_script_setup_true_lang-zjvFEF5C.js +0 -51
- package/dist/IngredientsView-DMRN-odY.js +0 -1613
- package/dist/ReceiveRequestView-aQZJO8sq.js +0 -4165
- package/dist/RecipeView-DXO43tFi.js +0 -597
- package/dist/TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js +0 -135
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-DCA0RUfu.js +0 -1209
- package/dist/TransferTemplateView-CfxdQF1t.js +0 -1261
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
- package/dist/app-KnSMkJBV.js +0 -33496
- package/dist/date2-CIeUqUIc.js +0 -117
- package/dist/dayjs.min-Df5jSnDJ.js +0 -282
- package/dist/defineDeepModel-BfuQAIoM.js +0 -13
- package/dist/feature-dwB4OxRQ.js +0 -86
- package/dist/format-time-from-id-BbvzyIN6.js +0 -15
- package/dist/format-unit-display-BBWblJEt.js +0 -1216
- package/dist/fuzzy-B9ryZ9VZ.js +0 -41
- package/dist/index-BN0CY3sZ.js +0 -22277
- package/dist/index-Bj1fJum-.js +0 -45
- package/dist/index-C4yL_7rR.js +0 -10545
- package/dist/netsuite-ByWOS6tI.js +0 -194
- package/dist/normalizeArguments-DP7Hrren.js +0 -1552
- package/dist/row-action.enum-PMKMRrZR.js +0 -50
- package/dist/rules-C12nWDD1.js +0 -198
- package/dist/use-template-enabled-locations-2-k9g5t8tt.js +0 -86
- package/dist/xlsx-B4XHad7S.js +0 -24004
- package/dist/xlsx.util-BSO4SHJi.js +0 -78
|
@@ -1,43 +1,39 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { a as G, S as
|
|
3
|
-
import { useDialog as
|
|
4
|
-
import { i as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
import { R as j, A as Ce, a as J, c as ke, d as Fe } from "./rules-C12nWDD1.js";
|
|
11
|
-
import { F as Se } from "./decimal-BAc9M88Q.js";
|
|
12
|
-
import { _ as $e } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DM0C4raP.js";
|
|
13
|
-
const Ee = { class: "flex flex-col gap-8" }, Ie = {
|
|
1
|
+
import { defineComponent as H, computed as g, openBlock as v, createElementBlock as C, createElementVNode as l, Fragment as j, renderList as q, toDisplayString as V, createCommentVNode as Y, ref as M, resolveComponent as $, createBlock as T, withCtx as A, createVNode as y, unref as o, isRef as ee, normalizeClass as re, normalizeStyle as ie, Teleport as ue, normalizeProps as de, guardReactiveProps as me } from "vue";
|
|
2
|
+
import { a as G, d as w, S as ce, f as pe, D as te, h as L, e as le, l as N, A as fe, i as J, L as ve, N as ye, o as ne, u as be, b as ge, y as xe, z as _e, B as he, E as Ve, G as Ue } from "./app-BE8SgDqI.js";
|
|
3
|
+
import { useDialog as we, useSnackbar as se, useProxiedModel as oe, useBreakpoints as Ce } from "@feedmepos/ui-library";
|
|
4
|
+
import { i as Se, _ as ke } from "./is-linked-ingredient-error-fJ2TJb3z.js";
|
|
5
|
+
import { defineStore as Ee, storeToRefs as Fe } from "pinia";
|
|
6
|
+
import { useI18n as K } from "@feedmepos/mf-common";
|
|
7
|
+
import { F as $e } from "./decimal-xj3kVOP6.js";
|
|
8
|
+
import { _ as Ie } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DfpG3Fy8.js";
|
|
9
|
+
const De = { class: "flex flex-col gap-8" }, Ae = {
|
|
14
10
|
key: 0,
|
|
15
11
|
class: "flex flex-col"
|
|
16
|
-
},
|
|
12
|
+
}, Re = { class: "flex-1 py-8 px-16" }, Me = {
|
|
17
13
|
class: "flex-0 py-8 px-16",
|
|
18
14
|
style: { "flex-basis": "240px" }
|
|
19
|
-
},
|
|
15
|
+
}, Pe = {
|
|
20
16
|
key: 1,
|
|
21
17
|
class: "flex flex-col"
|
|
22
|
-
},
|
|
18
|
+
}, Te = { class: "flex-1 py-8 px-16" }, Be = {
|
|
23
19
|
class: "flex-0 py-8 px-16",
|
|
24
20
|
style: { "flex-basis": "240px" }
|
|
25
|
-
},
|
|
21
|
+
}, ze = {
|
|
26
22
|
key: 2,
|
|
27
23
|
class: "flex flex-col"
|
|
28
|
-
},
|
|
24
|
+
}, Le = { class: "flex-1 py-8 px-16" }, Ne = {
|
|
29
25
|
class: "flex-0 py-8 px-16",
|
|
30
26
|
style: { "flex-basis": "240px" }
|
|
31
|
-
},
|
|
27
|
+
}, je = /* @__PURE__ */ H({
|
|
32
28
|
__name: "UnitUsedBy",
|
|
33
29
|
props: {
|
|
34
30
|
unit: {}
|
|
35
31
|
},
|
|
36
32
|
setup(k) {
|
|
37
|
-
const f = k, b = G(), i =
|
|
38
|
-
return (c, p) => (v(),
|
|
33
|
+
const f = k, b = G(), i = g(() => b.validateUnitUsage(f.unit)), r = g(() => i.value.filter((c) => c.from === "INGREDIENT")), s = g(() => i.value.filter((c) => c.from === "RECIPE")), d = g(() => i.value.filter((c) => c.from === "MENU"));
|
|
34
|
+
return (c, p) => (v(), C("div", De, [
|
|
39
35
|
p[3] || (p[3] = l("div", { class: "fm-typo-en-body-md-400" }, "Sorry, this unit is used in the following modules:", -1)),
|
|
40
|
-
r.value.length ? (v(),
|
|
36
|
+
r.value.length ? (v(), C("div", Ae, [
|
|
41
37
|
p[0] || (p[0] = 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" }, [
|
|
42
38
|
l("div", { class: "flex-1 py-8 px-16" }, "Ingredient"),
|
|
43
39
|
l("div", {
|
|
@@ -45,18 +41,18 @@ const Ee = { class: "flex flex-col gap-8" }, Ie = {
|
|
|
45
41
|
style: { "flex-basis": "240px" }
|
|
46
42
|
}, "Used in")
|
|
47
43
|
], -1)),
|
|
48
|
-
(v(!0),
|
|
44
|
+
(v(!0), C(j, null, q(r.value, (a) => {
|
|
49
45
|
var n;
|
|
50
|
-
return v(),
|
|
51
|
-
key:
|
|
46
|
+
return v(), C("div", {
|
|
47
|
+
key: a.code,
|
|
52
48
|
class: "flex flex-row fm-typo-en-body-md-400 h-48 items-center border-b border-b-fm-color-neutral-gray-100"
|
|
53
49
|
}, [
|
|
54
|
-
l("div",
|
|
55
|
-
l("div",
|
|
50
|
+
l("div", Re, V(a.code) + " " + V(a.name), 1),
|
|
51
|
+
l("div", Me, V((n = a.bindedIngredient) != null && n.length ? "Convert binding" : "Item unit"), 1)
|
|
56
52
|
]);
|
|
57
53
|
}), 128))
|
|
58
54
|
])) : Y("", !0),
|
|
59
|
-
|
|
55
|
+
s.value.length ? (v(), C("div", Pe, [
|
|
60
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" }, [
|
|
61
57
|
l("div", { class: "flex-1 py-8 px-16" }, "Recipe"),
|
|
62
58
|
l("div", {
|
|
@@ -64,18 +60,18 @@ const Ee = { class: "flex flex-col gap-8" }, Ie = {
|
|
|
64
60
|
style: { "flex-basis": "240px" }
|
|
65
61
|
}, "Used in")
|
|
66
62
|
], -1)),
|
|
67
|
-
(v(!0),
|
|
68
|
-
var n, u,
|
|
69
|
-
return v(),
|
|
70
|
-
key:
|
|
63
|
+
(v(!0), C(j, null, q(s.value, (a) => {
|
|
64
|
+
var n, u, x;
|
|
65
|
+
return v(), C("div", {
|
|
66
|
+
key: a.code,
|
|
71
67
|
class: "flex flex-row fm-typo-en-body-md-400 h-48 items-center border-b border-b-fm-color-neutral-gray-100"
|
|
72
68
|
}, [
|
|
73
|
-
l("div",
|
|
74
|
-
l("div",
|
|
69
|
+
l("div", Te, V(a.code) + " " + V(a.name), 1),
|
|
70
|
+
l("div", Be, V((n = a.bindedIngredient) == null ? void 0 : n.slice(0, 3).map((_) => _.code).join(", ")) + " " + V(a.bindedIngredient && ((u = a.bindedIngredient) == null ? void 0 : u.length) > 3 ? `and ${((x = a.bindedIngredient) == null ? void 0 : x.length) - 3} more` : ""), 1)
|
|
75
71
|
]);
|
|
76
72
|
}), 128))
|
|
77
73
|
])) : Y("", !0),
|
|
78
|
-
|
|
74
|
+
d.value.length ? (v(), C("div", ze, [
|
|
79
75
|
p[2] || (p[2] = 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" }, [
|
|
80
76
|
l("div", { class: "flex-1 py-8 px-16" }, "Menu"),
|
|
81
77
|
l("div", {
|
|
@@ -83,42 +79,42 @@ const Ee = { class: "flex flex-col gap-8" }, Ie = {
|
|
|
83
79
|
style: { "flex-basis": "240px" }
|
|
84
80
|
}, "Used in")
|
|
85
81
|
], -1)),
|
|
86
|
-
(v(!0),
|
|
87
|
-
var n, u,
|
|
88
|
-
return v(),
|
|
89
|
-
key:
|
|
82
|
+
(v(!0), C(j, null, q(d.value, (a) => {
|
|
83
|
+
var n, u, x;
|
|
84
|
+
return v(), C("div", {
|
|
85
|
+
key: a.code,
|
|
90
86
|
class: "flex flex-row fm-typo-en-body-md-400 h-48 items-center border-b border-b-fm-color-neutral-gray-100"
|
|
91
87
|
}, [
|
|
92
|
-
l("div",
|
|
93
|
-
l("div",
|
|
88
|
+
l("div", Le, V(a.code) + " " + V(a.name), 1),
|
|
89
|
+
l("div", Ne, V((n = a.bindedIngredient) == null ? void 0 : n.slice(0, 3).map((_) => _.code).join(", ")) + " " + V(a.bindedIngredient && ((u = a.bindedIngredient) == null ? void 0 : u.length) > 3 ? `and ${((x = a.bindedIngredient) == null ? void 0 : x.length) - 3} more` : ""), 1)
|
|
94
90
|
]);
|
|
95
91
|
}), 128))
|
|
96
92
|
])) : Y("", !0)
|
|
97
93
|
]));
|
|
98
94
|
}
|
|
99
|
-
}), Q =
|
|
100
|
-
const f =
|
|
101
|
-
function
|
|
95
|
+
}), Q = Ee("unitForm", function() {
|
|
96
|
+
const f = we(), b = se(), i = G(), r = M(!1), s = M();
|
|
97
|
+
function d() {
|
|
102
98
|
const n = {
|
|
103
99
|
unit: {},
|
|
104
|
-
mode:
|
|
100
|
+
mode: w.CREATE,
|
|
105
101
|
show: !0,
|
|
106
102
|
"onUpdate:show"(u) {
|
|
107
|
-
|
|
103
|
+
s.value.show = u;
|
|
108
104
|
}
|
|
109
105
|
};
|
|
110
|
-
|
|
106
|
+
s.value = n;
|
|
111
107
|
}
|
|
112
108
|
async function c(n) {
|
|
113
109
|
const u = {
|
|
114
110
|
unit: n,
|
|
115
|
-
mode:
|
|
111
|
+
mode: w.UPDATE,
|
|
116
112
|
show: !0,
|
|
117
|
-
"onUpdate:show"(
|
|
118
|
-
|
|
113
|
+
"onUpdate:show"(x) {
|
|
114
|
+
s.value.show = x;
|
|
119
115
|
}
|
|
120
116
|
};
|
|
121
|
-
|
|
117
|
+
s.value = u;
|
|
122
118
|
}
|
|
123
119
|
async function p(n) {
|
|
124
120
|
r.value = !0;
|
|
@@ -129,9 +125,9 @@ const Ee = { class: "flex flex-col gap-8" }, Ie = {
|
|
|
129
125
|
type: "success"
|
|
130
126
|
});
|
|
131
127
|
} catch (u) {
|
|
132
|
-
u instanceof
|
|
128
|
+
u instanceof ce && Se(u) ? f.open({
|
|
133
129
|
title: "Cannot delete unit",
|
|
134
|
-
contentComponent:
|
|
130
|
+
contentComponent: ke,
|
|
135
131
|
contentComponentProps: {
|
|
136
132
|
subject: (n == null ? void 0 : n.name) ?? "",
|
|
137
133
|
items: u.errorResponse.message
|
|
@@ -149,14 +145,14 @@ const Ee = { class: "flex flex-col gap-8" }, Ie = {
|
|
|
149
145
|
r.value = !1;
|
|
150
146
|
}
|
|
151
147
|
}
|
|
152
|
-
function
|
|
148
|
+
function a(n) {
|
|
153
149
|
if (i.validateUnitUsage(n).length) {
|
|
154
150
|
f.open({
|
|
155
151
|
title: `Cannot delete ${(n == null ? void 0 : n.name) ?? "unit"}`,
|
|
156
152
|
overlay: !0,
|
|
157
153
|
dismissAway: !0,
|
|
158
154
|
closeButton: !0,
|
|
159
|
-
contentComponent:
|
|
155
|
+
contentComponent: je,
|
|
160
156
|
contentComponentProps: {
|
|
161
157
|
unit: n
|
|
162
158
|
},
|
|
@@ -183,22 +179,22 @@ const Ee = { class: "flex flex-col gap-8" }, Ie = {
|
|
|
183
179
|
}).onPrimary(() => p(n));
|
|
184
180
|
}
|
|
185
181
|
return {
|
|
186
|
-
createUnit:
|
|
182
|
+
createUnit: d,
|
|
187
183
|
updateUnit: c,
|
|
188
|
-
deleteUnit:
|
|
189
|
-
unitDialogProps:
|
|
184
|
+
deleteUnit: a,
|
|
185
|
+
unitDialogProps: s,
|
|
190
186
|
unitViewLoading: r
|
|
191
187
|
};
|
|
192
188
|
});
|
|
193
|
-
function
|
|
194
|
-
const { updateUnit: k, deleteUnit: f } = Q(), { t: b } =
|
|
195
|
-
async function i(
|
|
196
|
-
const c =
|
|
197
|
-
if (
|
|
189
|
+
function qe() {
|
|
190
|
+
const { updateUnit: k, deleteUnit: f } = Q(), { t: b } = K();
|
|
191
|
+
async function i(s, d) {
|
|
192
|
+
const c = le(d);
|
|
193
|
+
if (s === L.Edit) {
|
|
198
194
|
await k(c);
|
|
199
195
|
return;
|
|
200
196
|
}
|
|
201
|
-
if (
|
|
197
|
+
if (s === L.Delete) {
|
|
202
198
|
await f(c);
|
|
203
199
|
return;
|
|
204
200
|
}
|
|
@@ -219,11 +215,11 @@ function Ne() {
|
|
|
219
215
|
{
|
|
220
216
|
id: "action",
|
|
221
217
|
header: "",
|
|
222
|
-
cell(
|
|
223
|
-
return
|
|
224
|
-
[
|
|
225
|
-
(
|
|
226
|
-
i(
|
|
218
|
+
cell(s) {
|
|
219
|
+
return pe(
|
|
220
|
+
[te[L.Edit], te[L.Delete]],
|
|
221
|
+
(d) => {
|
|
222
|
+
i(d, s.row.original);
|
|
227
223
|
}
|
|
228
224
|
);
|
|
229
225
|
},
|
|
@@ -236,7 +232,7 @@ function Ne() {
|
|
|
236
232
|
}
|
|
237
233
|
] };
|
|
238
234
|
}
|
|
239
|
-
const
|
|
235
|
+
const He = { class: "flex flex-col gap-24" }, Ge = { class: "flex gap-24" }, Ke = { class: "flex-1" }, Oe = { class: "flex-1" }, Ye = { class: "flex" }, Je = { class: "flex items-center" }, Qe = { class: "fm-typo-en-body-lg-600 flex-grow" }, We = { class: "flex flex-col gap-24" }, Xe = { class: "flex gap-24" }, Ze = { class: "flex-1" }, et = { class: "flex-1" }, tt = /* @__PURE__ */ H({
|
|
240
236
|
__name: "UnitForm",
|
|
241
237
|
props: {
|
|
242
238
|
mode: {},
|
|
@@ -245,11 +241,11 @@ const je = { class: "flex flex-col gap-24" }, qe = { class: "flex gap-24" }, He
|
|
|
245
241
|
},
|
|
246
242
|
emits: ["update:modelValue", "click:submit"],
|
|
247
243
|
setup(k, { expose: f, emit: b }) {
|
|
248
|
-
const i = k, r = b, { t:
|
|
249
|
-
function
|
|
244
|
+
const i = k, r = b, { t: s } = K();
|
|
245
|
+
function d() {
|
|
250
246
|
r("click:submit");
|
|
251
247
|
}
|
|
252
|
-
const c =
|
|
248
|
+
const c = g({
|
|
253
249
|
get() {
|
|
254
250
|
var e;
|
|
255
251
|
return ((e = i.modelValue) == null ? void 0 : e.name) ?? "";
|
|
@@ -258,7 +254,7 @@ const je = { class: "flex flex-col gap-24" }, qe = { class: "flex gap-24" }, He
|
|
|
258
254
|
const t = i.modelValue ?? {};
|
|
259
255
|
t.name = e, r("update:modelValue", t);
|
|
260
256
|
}
|
|
261
|
-
}), p =
|
|
257
|
+
}), p = g({
|
|
262
258
|
get() {
|
|
263
259
|
var e;
|
|
264
260
|
return ((e = i.modelValue) == null ? void 0 : e.abbrev) ?? "";
|
|
@@ -267,7 +263,7 @@ const je = { class: "flex flex-col gap-24" }, qe = { class: "flex gap-24" }, He
|
|
|
267
263
|
const t = i.modelValue ?? {};
|
|
268
264
|
t.abbrev = e, r("update:modelValue", t);
|
|
269
265
|
}
|
|
270
|
-
}),
|
|
266
|
+
}), a = g({
|
|
271
267
|
get() {
|
|
272
268
|
var e;
|
|
273
269
|
return ((e = i.modelValue) == null ? void 0 : e.precision) ?? 0;
|
|
@@ -276,7 +272,7 @@ const je = { class: "flex flex-col gap-24" }, qe = { class: "flex gap-24" }, He
|
|
|
276
272
|
const t = i.modelValue ?? {};
|
|
277
273
|
t.precision = e, r("update:modelValue", t);
|
|
278
274
|
}
|
|
279
|
-
}), n =
|
|
275
|
+
}), n = g({
|
|
280
276
|
get() {
|
|
281
277
|
var e;
|
|
282
278
|
return ((e = i.modelValue) == null ? void 0 : e.measurements) ?? [];
|
|
@@ -301,137 +297,137 @@ const je = { class: "flex flex-col gap-24" }, qe = { class: "flex gap-24" }, He
|
|
|
301
297
|
}
|
|
302
298
|
], r("update:modelValue", e);
|
|
303
299
|
}
|
|
304
|
-
function
|
|
305
|
-
const t = i.modelValue ?? {},
|
|
306
|
-
|
|
300
|
+
function x(e) {
|
|
301
|
+
const t = i.modelValue ?? {}, m = t.measurements ?? [];
|
|
302
|
+
m.splice(e, 1), t.measurements = m, r("update:modelValue", t);
|
|
307
303
|
}
|
|
308
|
-
const
|
|
304
|
+
const _ = M();
|
|
309
305
|
return f({
|
|
310
306
|
validateInputs: () => {
|
|
311
307
|
var e, t;
|
|
312
|
-
(t = (e =
|
|
308
|
+
(t = (e = _.value) == null ? void 0 : e.validateInputs) == null || t.call(e);
|
|
313
309
|
},
|
|
314
310
|
resetInputsValidation: () => {
|
|
315
311
|
var e, t;
|
|
316
|
-
(t = (e =
|
|
312
|
+
(t = (e = _.value) == null ? void 0 : e.resetInputsValidation) == null || t.call(e);
|
|
317
313
|
},
|
|
318
314
|
resetInputs: () => {
|
|
319
315
|
var e, t;
|
|
320
|
-
(t = (e =
|
|
316
|
+
(t = (e = _.value) == null ? void 0 : e.resetInputs) == null || t.call(e);
|
|
321
317
|
}
|
|
322
318
|
}), (e, t) => {
|
|
323
|
-
const
|
|
324
|
-
return v(), T(
|
|
319
|
+
const m = $("FmTextField"), I = $("FmStepperField"), D = $("FmButton"), U = $("FmCard"), O = $("FmForm");
|
|
320
|
+
return v(), T(O, {
|
|
325
321
|
ref_key: "formRef",
|
|
326
|
-
ref:
|
|
322
|
+
ref: _,
|
|
327
323
|
class: "flex flex-col gap-40",
|
|
328
|
-
onValidationSuccess:
|
|
324
|
+
onValidationSuccess: d
|
|
329
325
|
}, {
|
|
330
|
-
default:
|
|
331
|
-
var
|
|
326
|
+
default: A(() => {
|
|
327
|
+
var E;
|
|
332
328
|
return [
|
|
333
|
-
l("div",
|
|
334
|
-
l("div",
|
|
335
|
-
l("div",
|
|
336
|
-
y(
|
|
329
|
+
l("div", He, [
|
|
330
|
+
l("div", Ge, [
|
|
331
|
+
l("div", Ke, [
|
|
332
|
+
y(m, {
|
|
337
333
|
disabled: e.disabled,
|
|
338
|
-
label:
|
|
334
|
+
label: o(s)("inventory.unit.name"),
|
|
339
335
|
modelValue: c.value,
|
|
340
|
-
"onUpdate:modelValue": t[0] || (t[0] = (
|
|
341
|
-
rules: [
|
|
336
|
+
"onUpdate:modelValue": t[0] || (t[0] = (S) => c.value = S),
|
|
337
|
+
rules: [o(N)()],
|
|
342
338
|
"label-mark": "required"
|
|
343
339
|
}, null, 8, ["disabled", "label", "modelValue", "rules"])
|
|
344
340
|
]),
|
|
345
|
-
l("div",
|
|
346
|
-
y(
|
|
341
|
+
l("div", Oe, [
|
|
342
|
+
y(m, {
|
|
347
343
|
disabled: e.disabled,
|
|
348
|
-
label:
|
|
344
|
+
label: o(s)("inventory.unit.symbol"),
|
|
349
345
|
modelValue: p.value,
|
|
350
|
-
"onUpdate:modelValue": t[1] || (t[1] = (
|
|
351
|
-
rules: [
|
|
346
|
+
"onUpdate:modelValue": t[1] || (t[1] = (S) => p.value = S),
|
|
347
|
+
rules: [o(N)()],
|
|
352
348
|
"label-mark": "required"
|
|
353
349
|
}, null, 8, ["disabled", "label", "modelValue", "rules"])
|
|
354
350
|
])
|
|
355
351
|
]),
|
|
356
352
|
l("div", null, [
|
|
357
|
-
y(
|
|
353
|
+
y(I, {
|
|
358
354
|
disabled: e.disabled,
|
|
359
355
|
class: "col-span-3",
|
|
360
|
-
label:
|
|
361
|
-
modelValue:
|
|
362
|
-
"onUpdate:modelValue": t[2] || (t[2] = (
|
|
363
|
-
rules: [
|
|
356
|
+
label: o(s)("inventory.unit.precision"),
|
|
357
|
+
modelValue: a.value,
|
|
358
|
+
"onUpdate:modelValue": t[2] || (t[2] = (S) => a.value = S),
|
|
359
|
+
rules: [o(fe)(0)]
|
|
364
360
|
}, null, 8, ["disabled", "label", "modelValue", "rules"])
|
|
365
361
|
])
|
|
366
362
|
]),
|
|
367
|
-
l("div",
|
|
368
|
-
y(
|
|
363
|
+
l("div", Ye, [
|
|
364
|
+
y(D, {
|
|
369
365
|
disabled: e.disabled,
|
|
370
366
|
type: "button",
|
|
371
367
|
"prepend-icon": "add",
|
|
372
|
-
label:
|
|
368
|
+
label: o(s)("inventory.unit.measurement.addMeasurement"),
|
|
373
369
|
variant: "plain",
|
|
374
370
|
onClick: u
|
|
375
371
|
}, null, 8, ["disabled", "label"])
|
|
376
372
|
]),
|
|
377
|
-
(v(!0),
|
|
373
|
+
(v(!0), C(j, null, q((E = e.modelValue) == null ? void 0 : E.measurements, (S, h) => (v(), T(U, {
|
|
378
374
|
class: "flex flex-col gap-16 p-16",
|
|
379
375
|
variant: "outlined",
|
|
380
|
-
key:
|
|
376
|
+
key: S.id
|
|
381
377
|
}, {
|
|
382
|
-
default:
|
|
383
|
-
l("div",
|
|
384
|
-
l("div",
|
|
385
|
-
y(
|
|
378
|
+
default: A(() => [
|
|
379
|
+
l("div", Je, [
|
|
380
|
+
l("div", Qe, V(o(s)("inventory.unit.measurement.measurementDefault", [h + 1])), 1),
|
|
381
|
+
y(D, {
|
|
386
382
|
disabled: e.disabled,
|
|
387
383
|
variant: "tertiary",
|
|
388
384
|
"prepend-icon": "delete",
|
|
389
|
-
onClick: (
|
|
385
|
+
onClick: (F) => x(h)
|
|
390
386
|
}, null, 8, ["disabled", "onClick"])
|
|
391
387
|
]),
|
|
392
|
-
l("div",
|
|
393
|
-
l("div",
|
|
394
|
-
l("div",
|
|
395
|
-
y(
|
|
388
|
+
l("div", We, [
|
|
389
|
+
l("div", Xe, [
|
|
390
|
+
l("div", Ze, [
|
|
391
|
+
y(m, {
|
|
396
392
|
disabled: e.disabled,
|
|
397
393
|
class: "col-span-2",
|
|
398
|
-
label:
|
|
394
|
+
label: o(s)("inventory.unit.measurement.name"),
|
|
399
395
|
modelValue: e.modelValue.measurements[h].name,
|
|
400
|
-
"onUpdate:modelValue": (
|
|
401
|
-
rules: [
|
|
396
|
+
"onUpdate:modelValue": (F) => e.modelValue.measurements[h].name = F,
|
|
397
|
+
rules: [o(N)()],
|
|
402
398
|
"label-mark": "required"
|
|
403
399
|
}, null, 8, ["disabled", "label", "modelValue", "onUpdate:modelValue", "rules"])
|
|
404
400
|
]),
|
|
405
|
-
l("div",
|
|
406
|
-
y(
|
|
401
|
+
l("div", et, [
|
|
402
|
+
y(m, {
|
|
407
403
|
disabled: e.disabled,
|
|
408
|
-
label:
|
|
404
|
+
label: o(s)("inventory.unit.measurement.symbol"),
|
|
409
405
|
modelValue: e.modelValue.measurements[h].abbrev,
|
|
410
|
-
"onUpdate:modelValue": (
|
|
411
|
-
rules: [
|
|
406
|
+
"onUpdate:modelValue": (F) => e.modelValue.measurements[h].abbrev = F,
|
|
407
|
+
rules: [o(N)()],
|
|
412
408
|
"label-mark": "required"
|
|
413
409
|
}, null, 8, ["disabled", "label", "modelValue", "onUpdate:modelValue", "rules"])
|
|
414
410
|
])
|
|
415
411
|
]),
|
|
416
|
-
y(
|
|
412
|
+
y(Ie, {
|
|
417
413
|
disabled: e.disabled,
|
|
418
414
|
class: "col-span-3",
|
|
419
|
-
label:
|
|
420
|
-
"model-value": +
|
|
421
|
-
"onUpdate:modelValue": (
|
|
422
|
-
(
|
|
423
|
-
...
|
|
424
|
-
conversion:
|
|
425
|
-
|
|
426
|
-
|
|
415
|
+
label: o(s)("inventory.unit.measurement.conversion"),
|
|
416
|
+
"model-value": +o(J)(e.modelValue.measurements[h].conversion),
|
|
417
|
+
"onUpdate:modelValue": (F) => n.value = n.value.map(
|
|
418
|
+
(P, R) => R === h ? {
|
|
419
|
+
...P,
|
|
420
|
+
conversion: o($e).toPrecision(
|
|
421
|
+
o(ve)(F),
|
|
422
|
+
a.value
|
|
427
423
|
)
|
|
428
|
-
} :
|
|
424
|
+
} : P
|
|
429
425
|
),
|
|
430
|
-
rules: [
|
|
431
|
-
step: +
|
|
432
|
-
"helper-text":
|
|
426
|
+
rules: [o(ye)(0)],
|
|
427
|
+
step: +o(J)({ amount: 1, precision: a.value }),
|
|
428
|
+
"helper-text": o(s)("inventory.unit.measurement.conversionHelper", {
|
|
433
429
|
measurementSymbol: e.modelValue.measurements[h].name || " measurement unit",
|
|
434
|
-
conversion: +
|
|
430
|
+
conversion: +o(J)(e.modelValue.measurements[h].conversion),
|
|
435
431
|
unitSymbol: p.value || "base unit"
|
|
436
432
|
})
|
|
437
433
|
}, null, 8, ["disabled", "label", "model-value", "onUpdate:modelValue", "rules", "step", "helper-text"])
|
|
@@ -445,47 +441,47 @@ const je = { class: "flex flex-col gap-24" }, qe = { class: "flex gap-24" }, He
|
|
|
445
441
|
}, 512);
|
|
446
442
|
};
|
|
447
443
|
}
|
|
448
|
-
}),
|
|
444
|
+
}), nt = { class: "flex gap-4" }, ot = /* @__PURE__ */ H({
|
|
449
445
|
__name: "UnitDialog",
|
|
450
446
|
props: {
|
|
451
447
|
show: { type: Boolean },
|
|
452
448
|
unit: {},
|
|
453
|
-
mode: { default:
|
|
449
|
+
mode: { default: w.READ }
|
|
454
450
|
},
|
|
455
451
|
emits: ["update:show"],
|
|
456
452
|
setup(k) {
|
|
457
|
-
const f = k, b = G(), i =
|
|
453
|
+
const f = k, b = G(), i = se(), { t: r } = K(), s = oe(f, "show"), d = oe(f, "unit"), c = g(() => {
|
|
458
454
|
switch (f.mode) {
|
|
459
|
-
case
|
|
455
|
+
case w.READ:
|
|
460
456
|
return "";
|
|
461
|
-
case
|
|
457
|
+
case w.UPDATE:
|
|
462
458
|
return r("inventory.unit.update.title");
|
|
463
|
-
case
|
|
459
|
+
case w.CREATE:
|
|
464
460
|
return r("inventory.unit.create.title");
|
|
465
461
|
}
|
|
466
462
|
return "";
|
|
467
|
-
}), p =
|
|
463
|
+
}), p = g(() => {
|
|
468
464
|
switch (f.mode) {
|
|
469
|
-
case
|
|
465
|
+
case w.READ:
|
|
470
466
|
return "";
|
|
471
|
-
case
|
|
467
|
+
case w.UPDATE:
|
|
472
468
|
return r("common.save");
|
|
473
|
-
case
|
|
469
|
+
case w.CREATE:
|
|
474
470
|
return r("common.add");
|
|
475
471
|
}
|
|
476
472
|
return "";
|
|
477
|
-
}),
|
|
473
|
+
}), a = M(), n = M(!1);
|
|
478
474
|
async function u() {
|
|
479
475
|
n.value = !0;
|
|
480
476
|
try {
|
|
481
|
-
const t =
|
|
482
|
-
t.precision ?? (t.precision = 0), t.measurements ?? (t.measurements = []), await b.createUnit(t),
|
|
477
|
+
const t = le(d.value);
|
|
478
|
+
t.precision ?? (t.precision = 0), t.measurements ?? (t.measurements = []), await b.createUnit(t), s.value = !1, i.open({
|
|
483
479
|
title: r("inventory.common.success"),
|
|
484
|
-
message: r("inventory.unit.create.success", { name:
|
|
480
|
+
message: r("inventory.unit.create.success", { name: d.value.name }),
|
|
485
481
|
type: "success"
|
|
486
482
|
});
|
|
487
483
|
} catch (t) {
|
|
488
|
-
t instanceof
|
|
484
|
+
t instanceof ne || i.open({
|
|
489
485
|
title: r("inventory.unit.create.error.title"),
|
|
490
486
|
message: r("inventory.unit.create.error.message"),
|
|
491
487
|
type: "error"
|
|
@@ -494,16 +490,16 @@ const je = { class: "flex flex-col gap-24" }, qe = { class: "flex gap-24" }, He
|
|
|
494
490
|
n.value = !1;
|
|
495
491
|
}
|
|
496
492
|
}
|
|
497
|
-
async function
|
|
493
|
+
async function x() {
|
|
498
494
|
n.value = !0;
|
|
499
495
|
try {
|
|
500
|
-
await b.updateUnit(
|
|
496
|
+
await b.updateUnit(d.value), s.value = !1, i.open({
|
|
501
497
|
title: r("inventory.common.success"),
|
|
502
|
-
message: r("inventory.unit.update.success", { name:
|
|
498
|
+
message: r("inventory.unit.update.success", { name: d.value.name }),
|
|
503
499
|
type: "success"
|
|
504
500
|
});
|
|
505
501
|
} catch (t) {
|
|
506
|
-
t instanceof
|
|
502
|
+
t instanceof ne || i.open({
|
|
507
503
|
title: r("inventory.unit.update.error.title"),
|
|
508
504
|
message: r("inventory.unit.update.error.message"),
|
|
509
505
|
type: "error"
|
|
@@ -512,118 +508,123 @@ const je = { class: "flex flex-col gap-24" }, qe = { class: "flex gap-24" }, He
|
|
|
512
508
|
n.value = !1;
|
|
513
509
|
}
|
|
514
510
|
}
|
|
515
|
-
function
|
|
516
|
-
var t,
|
|
517
|
-
(
|
|
511
|
+
function _() {
|
|
512
|
+
var t, m;
|
|
513
|
+
(m = (t = a.value) == null ? void 0 : t.validateInputs) == null || m.call(t);
|
|
518
514
|
}
|
|
519
515
|
function e() {
|
|
520
516
|
switch (f.mode) {
|
|
521
|
-
case
|
|
517
|
+
case w.READ:
|
|
522
518
|
return;
|
|
523
|
-
case
|
|
524
|
-
return
|
|
525
|
-
case
|
|
519
|
+
case w.UPDATE:
|
|
520
|
+
return x();
|
|
521
|
+
case w.CREATE:
|
|
526
522
|
return u();
|
|
527
523
|
}
|
|
528
524
|
}
|
|
529
|
-
return (t,
|
|
530
|
-
const
|
|
531
|
-
return v(), T(
|
|
532
|
-
"model-value":
|
|
533
|
-
"onUpdate:modelValue":
|
|
525
|
+
return (t, m) => {
|
|
526
|
+
const I = $("FmButton"), D = $("FmSideSheet");
|
|
527
|
+
return v(), T(D, {
|
|
528
|
+
"model-value": o(s),
|
|
529
|
+
"onUpdate:modelValue": m[3] || (m[3] = (U) => ee(s) ? s.value = U : null),
|
|
534
530
|
header: c.value,
|
|
535
531
|
"close-button": "",
|
|
536
532
|
"dismiss-away": "",
|
|
537
533
|
"max-width": 500
|
|
538
534
|
}, {
|
|
539
|
-
"side-sheet-footer":
|
|
540
|
-
l("div",
|
|
541
|
-
y(
|
|
535
|
+
"side-sheet-footer": A(() => [
|
|
536
|
+
l("div", nt, [
|
|
537
|
+
y(I, {
|
|
542
538
|
loading: n.value,
|
|
543
539
|
label: p.value,
|
|
544
|
-
onClick:
|
|
540
|
+
onClick: _
|
|
545
541
|
}, null, 8, ["loading", "label"]),
|
|
546
|
-
y(
|
|
542
|
+
y(I, {
|
|
547
543
|
disabled: n.value,
|
|
548
|
-
label:
|
|
544
|
+
label: o(r)("common.close"),
|
|
549
545
|
variant: "tertiary",
|
|
550
|
-
onClick:
|
|
546
|
+
onClick: m[2] || (m[2] = (U) => s.value = !1)
|
|
551
547
|
}, null, 8, ["disabled", "label"])
|
|
552
548
|
])
|
|
553
549
|
]),
|
|
554
|
-
default:
|
|
555
|
-
y(
|
|
550
|
+
default: A(() => [
|
|
551
|
+
y(tt, {
|
|
556
552
|
class: "w-full",
|
|
557
553
|
ref_key: "hasValidationExpose",
|
|
558
|
-
ref:
|
|
559
|
-
modelValue:
|
|
560
|
-
"onUpdate:modelValue":
|
|
554
|
+
ref: a,
|
|
555
|
+
modelValue: o(d),
|
|
556
|
+
"onUpdate:modelValue": m[0] || (m[0] = (U) => ee(d) ? d.value = U : null),
|
|
561
557
|
mode: t.mode,
|
|
562
558
|
disabled: n.value,
|
|
563
|
-
"onClick:submit":
|
|
559
|
+
"onClick:submit": m[1] || (m[1] = (U) => e())
|
|
564
560
|
}, null, 8, ["modelValue", "mode", "disabled"])
|
|
565
561
|
]),
|
|
566
562
|
_: 1
|
|
567
563
|
}, 8, ["model-value", "header"]);
|
|
568
564
|
};
|
|
569
565
|
}
|
|
570
|
-
}),
|
|
566
|
+
}), lt = { class: "flex flex-col py-8" }, st = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, vt = /* @__PURE__ */ H({
|
|
571
567
|
__name: "UnitView",
|
|
572
568
|
setup(k) {
|
|
573
|
-
const f = G(), b =
|
|
574
|
-
function
|
|
575
|
-
D === "add" &&
|
|
569
|
+
const f = G(), b = be(), i = ge(), r = g(() => f.units), { createUnit: s, updateUnit: d } = Q(), { unitDialogProps: c, unitViewLoading: p } = Fe(Q()), { columnDefs: a } = qe();
|
|
570
|
+
function n(D) {
|
|
571
|
+
D === "add" && s();
|
|
576
572
|
}
|
|
577
|
-
const
|
|
578
|
-
return (D,
|
|
579
|
-
const
|
|
580
|
-
return v(), T(
|
|
581
|
-
title:
|
|
582
|
-
actions: [
|
|
583
|
-
{
|
|
573
|
+
const u = M(""), x = g(() => p.value), { breakpoints: _ } = Ce(), e = g(() => _.value.xs || _.value.sm), t = g(() => e.value ? 10 : 20), m = xe(), { t: I } = K();
|
|
574
|
+
return (D, U) => {
|
|
575
|
+
const O = $("FmTable");
|
|
576
|
+
return v(), T(_e, {
|
|
577
|
+
title: o(I)("inventory.unit.title"),
|
|
578
|
+
actions: o(i).isEnabled ? [] : [
|
|
579
|
+
{
|
|
580
|
+
label: o(I)("inventory.unit.create.title"),
|
|
581
|
+
value: "add",
|
|
582
|
+
isPrimary: !0,
|
|
583
|
+
prependIcon: "add"
|
|
584
|
+
}
|
|
584
585
|
],
|
|
585
|
-
"onClick:action":
|
|
586
|
+
"onClick:action": n
|
|
586
587
|
}, {
|
|
587
|
-
default:
|
|
588
|
+
default: A(() => [
|
|
588
589
|
l("div", {
|
|
589
|
-
class:
|
|
590
|
+
class: re([
|
|
590
591
|
"flex flex-col gap-8 max-h-full",
|
|
591
592
|
{
|
|
592
|
-
"p-0":
|
|
593
|
-
"px-24 ": !
|
|
593
|
+
"p-0": e.value,
|
|
594
|
+
"px-24 ": !e.value
|
|
594
595
|
}
|
|
595
596
|
])
|
|
596
597
|
}, [
|
|
597
|
-
y(
|
|
598
|
+
y(he, {
|
|
598
599
|
searchable: "",
|
|
599
|
-
search:
|
|
600
|
-
"onUpdate:search":
|
|
600
|
+
search: u.value,
|
|
601
|
+
"onUpdate:search": U[0] || (U[0] = (E) => u.value = E)
|
|
601
602
|
}, null, 8, ["search"]),
|
|
602
|
-
y(
|
|
603
|
-
style:
|
|
604
|
-
"column-defs": a
|
|
605
|
-
"row-data":
|
|
606
|
-
"search-value":
|
|
607
|
-
loading: !
|
|
608
|
-
onRowClick:
|
|
609
|
-
"page-size":
|
|
603
|
+
y(O, {
|
|
604
|
+
style: ie(o(m).tableHeight),
|
|
605
|
+
"column-defs": o(a),
|
|
606
|
+
"row-data": r.value,
|
|
607
|
+
"search-value": u.value,
|
|
608
|
+
loading: !o(b)._currentLocation || x.value,
|
|
609
|
+
onRowClick: U[1] || (U[1] = (E) => o(d)(E.original)),
|
|
610
|
+
"page-size": t.value
|
|
610
611
|
}, {
|
|
611
|
-
"list-row":
|
|
612
|
-
y(
|
|
612
|
+
"list-row": A((E) => [
|
|
613
|
+
y(Ve, {
|
|
613
614
|
row: E,
|
|
614
|
-
onRowClick:
|
|
615
|
+
onRowClick: o(d)
|
|
615
616
|
}, {
|
|
616
|
-
default:
|
|
617
|
-
var
|
|
617
|
+
default: A((S) => {
|
|
618
|
+
var h, F, P, R, W, B, X, z, Z;
|
|
618
619
|
return [
|
|
619
|
-
l("div",
|
|
620
|
-
l("div",
|
|
621
|
-
y(
|
|
622
|
-
render: (
|
|
623
|
-
props: (
|
|
620
|
+
l("div", lt, [
|
|
621
|
+
l("div", st, [
|
|
622
|
+
y(o(Ue), {
|
|
623
|
+
render: (P = (F = (h = S.name) == null ? void 0 : h.column) == null ? void 0 : F.columnDef) == null ? void 0 : P.cell,
|
|
624
|
+
props: (W = (R = S.name) == null ? void 0 : R.getContext) == null ? void 0 : W.call(R)
|
|
624
625
|
}, null, 8, ["render", "props"])
|
|
625
626
|
]),
|
|
626
|
-
l("div",
|
|
627
|
+
l("div", at, V((Z = (z = (X = (B = E.original.measurements) == null ? void 0 : B.map) == null ? void 0 : X.call(B, (ae) => ae.name)) == null ? void 0 : z.join) == null ? void 0 : Z.call(z, ", ")), 1)
|
|
627
628
|
])
|
|
628
629
|
];
|
|
629
630
|
}),
|
|
@@ -633,8 +634,8 @@ const je = { class: "flex flex-col gap-24" }, qe = { class: "flex gap-24" }, He
|
|
|
633
634
|
_: 1
|
|
634
635
|
}, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"])
|
|
635
636
|
], 2),
|
|
636
|
-
(v(), T(
|
|
637
|
-
y(
|
|
637
|
+
(v(), T(ue, { to: "body" }, [
|
|
638
|
+
y(ot, de(me(o(c))), null, 16)
|
|
638
639
|
]))
|
|
639
640
|
]),
|
|
640
641
|
_: 1
|
|
@@ -643,5 +644,5 @@ const je = { class: "flex flex-col gap-24" }, qe = { class: "flex gap-24" }, He
|
|
|
643
644
|
}
|
|
644
645
|
});
|
|
645
646
|
export {
|
|
646
|
-
|
|
647
|
+
vt as default
|
|
647
648
|
};
|