@feedmepos/mf-inventory-portal 0.0.25-dev.2 → 0.0.25-dev.21
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-D6WBVERc.js +278 -0
- package/dist/ApprovalView-BIBoagE8.js +146 -0
- package/dist/{BindingsDialog-qeGh3ND8.js → BindingsDialog-DHRRkK1Z.js} +6 -6
- package/dist/{BindingsPicker-SfiA8fmD.js → BindingsPicker-DohvMDDF.js} +3 -3
- package/dist/{BindingsTable-BjW-eJr6.js → BindingsTable-C_JwU9ei.js} +6 -6
- package/dist/ClosingDraftView-BBebhUj-.js +1308 -0
- package/dist/ClosingTemplateView-CXRN19-D.js +1859 -0
- package/dist/FmCustomAttribute.vue_vue_type_script_setup_true_lang-D-IWRjRD.js +34 -0
- package/dist/FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BJufUQNE.js +215 -0
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-5rldKjyh.js → FmUnitInput.vue_vue_type_script_setup_true_lang-C5Xk19jY.js} +52 -52
- package/dist/IngredientBindedItem.vue_vue_type_script_setup_true_lang-7HNI82u-.js +51 -0
- package/dist/{IngredientGroupView-CGyyFyvj.js → IngredientGroupView-l2bAc1Kj.js} +1 -1
- package/dist/{IngredientsView-BLKk-VxQ.js → IngredientsView-zDXt7KEx.js} +394 -382
- package/dist/{IntegrationView-C6gwvZ9b.js → IntegrationView-BYnlAPrP.js} +660 -623
- package/dist/{InventoryBindingForm-BB3ZN3Lx.js → InventoryBindingForm-BuweG4Vl.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-PT7Quw7j.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-DgxN0U4N.js} +99 -99
- package/dist/{InventoryBindingSummary-yr0oie3c.js → InventoryBindingSummary-BpEo0JsK.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DjJGUE9a.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CcjzkzCt.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-O1mYRa5W.js → PremiumBadge.vue_vue_type_script_setup_true_lang-Ej20iSHA.js} +15 -15
- package/dist/PublishView-DCZ0zIaP.js +222 -0
- package/dist/{PurchaseOrderPrintPreview-Q_9-KVNj.js → PurchaseOrderPrintPreview-Cag7UEvz.js} +1 -1
- package/dist/ReceiveRequestView-ChIJGA98.js +2319 -0
- package/dist/{RecipeView-DBfugmRY.js → RecipeView-bBshe0eF.js} +32 -31
- package/dist/{index-CgspzSQi.js → StockView-D6-oKpAC.js} +3577 -1764
- package/dist/{SupplierView-BQViPyfj.js → SupplierView-dyIcGp9Q.js} +12 -11
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-C_7wbQow.js +1771 -0
- package/dist/TransferTemplateView-D2rxV0k_.js +1660 -0
- package/dist/{UnitView-CrbFeWaB.js → UnitView-DVS5Az5c.js} +14 -14
- package/dist/{WarehouseView-Dy5GljxY.js → WarehouseView-CR03TpnA.js} +332 -314
- package/dist/api/closing-draft.d.ts +1 -0
- package/dist/api/inventory.d.ts +9 -6
- package/dist/api/purchase-order.d.ts +2 -1
- package/dist/{app-D0O4wr2X.js → app-oV9ISfFL.js} +28343 -28141
- package/dist/app.js +1 -1
- package/dist/components/FmAutocompleteTextField.vue.d.ts +31 -0
- package/dist/components/FmCustomAttribute.vue.d.ts +3 -8
- package/dist/components/FmLockableField.vue.d.ts +3 -0
- package/dist/components/FmMultiselectDialog.d.ts +46 -0
- package/dist/components/FmMultiselectDialog.vue.d.ts +20 -3
- package/dist/components/FmMultiselectDialogProps.d.ts +2 -0
- package/dist/components/MountListener.vue.d.ts +15 -0
- package/dist/components/inventory-binding/InventoryBinding.vue.d.ts +1 -1
- package/dist/components/shell/inventory/binding-ui.vue.d.ts +1 -1
- package/dist/{decimal-CPGmj9BT.js → decimal-C7zgfr5G.js} +1 -1
- package/dist/feature-CDQQ-mV9.js +1003 -0
- package/dist/{format-unit-display-CMM6DZJj.js → format-unit-display-CVBzrNQ4.js} +334 -327
- package/dist/helper/fuzzy.d.ts +10 -0
- package/dist/index-0VS4cuk3.js +35546 -0
- package/dist/{stock-9nTT4Amy.js → stock-BIP_NIK_.js} +3 -3
- package/dist/stores/feature.d.ts +4 -7
- package/dist/stores/integration/netsuite.d.ts +5 -0
- package/dist/stores/inventory.d.ts +135 -8
- package/dist/stores/location.d.ts +100 -0
- package/dist/stores/warehouse.d.ts +1 -0
- package/dist/style.css +1 -1
- package/dist/{supplier-CH4EwBZM.js → supplier-DUQ2VSMg.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/use-ingredient-select-dialog-VkU5_Aaj.js +51 -0
- package/dist/{use-inventory-binding-dialog-Dli3xtq4.js → use-inventory-binding-dialog-BXp0z3v_.js} +1 -1
- package/dist/views/adjustment-template/wastage-template/actions.d.ts +24 -0
- package/dist/views/adjustment-template/wastage-template/table.d.ts +24 -0
- package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +8 -4
- package/dist/views/closing-draft/composables/use-closing-draft-actions.d.ts +4 -1
- package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +48 -24
- package/dist/views/closing-draft/helpers/export-draft.helper.d.ts +1 -1
- package/dist/views/closing-template/components/closing-template-form/composables/use-closing-template-items.d.ts +1 -1
- package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +36 -12
- package/dist/views/closing-template/composables/use-closing-template-table.d.ts +36 -12
- package/dist/views/dev/components/AutocompleteTextField.vue.d.ts +2 -0
- package/dist/views/ingredient-group/composables/use-ingredient-group-table.d.ts +3 -3
- package/dist/views/ingredients/components/ingredient-form/IngredientForm.vue.d.ts +2 -2
- package/dist/views/ingredients/composables/use-ingredient-select-dialog.d.ts +16 -0
- package/dist/views/ingredients/composables/use-ingredient-table.d.ts +1 -1
- package/dist/views/receive-request/components/netsuite/NetSuiteProps.d.ts +2 -0
- package/dist/views/receive-request/components/transfer-details/TransferDetails.vue.d.ts +1387 -0
- package/dist/views/receive-request/components/transfer-details/TransferDetailsProps.d.ts +5 -1
- package/dist/views/receive-request/components/transfer-dialog/TransferDialogProps.d.ts +3 -0
- package/dist/views/receive-request/components/transfer-form/TransferFormProps.d.ts +1 -2
- package/dist/views/receive-request/components/transfer-form/components/ForecastStock.vue.d.ts +48 -2
- package/dist/views/receive-request/components/transfer-form/components/TransferItemTable.vue.d.ts +490 -2
- package/dist/views/receive-request/components/transfer-form/components/TransferSubItemTable.vue.d.ts +72 -0
- package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +25 -2
- package/dist/views/receive-request/components/transfer-form/helpers/calculate-sub-item-total.helper.d.ts +4 -0
- package/dist/views/receive-request/composables/use-receive-request-form.d.ts +693 -35
- package/dist/views/receive-request/composables/use-receive-request-table.d.ts +684 -35
- package/dist/views/receive-request/helper/po-to-po-template.util.d.ts +1 -0
- package/dist/views/receive-request/helper/print-po.d.ts +9 -2
- package/dist/views/stock/components/dialog/AdjustedItemForm.vue.d.ts +2 -2
- package/dist/views/transfer-template/components/transfer-template-form/components/TransferTemplateItem.vue.d.ts +270 -2
- package/dist/views/transfer-template/components/transfer-template-form/components/TransferTemplateItemTable.vue.d.ts +286 -0
- package/dist/views/transfer-template/components/transfer-template-form/components/TransferTemplateSubItem.vue.d.ts +74 -0
- package/dist/views/transfer-template/components/transfer-template-form/components/TransferTemplateSubItemTable.vue.d.ts +92 -0
- package/dist/views/transfer-template/components/transfer-template-form/composables/use-template-enabled-locations-2.d.ts +8 -0
- package/dist/views/transfer-template/components/transfer-template-form/composables/use-template-enabled-locations.d.ts +1 -0
- package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.d.ts +36 -2
- package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +456 -12
- package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +456 -12
- package/dist/views/transfer-template/helpers/location-to-po-supplier.util.d.ts +75 -0
- package/dist/views/warehouse/components/WarehouseForm.vue.d.ts +2 -0
- package/dist/{vue-i18n-BcYt8MNZ.js → vue-i18n-CCd5_SRR.js} +212 -212
- package/package.json +3 -3
- package/dist/App-oKNdl2la.js +0 -276
- package/dist/ApprovalView-hDGkcBDy.js +0 -138
- package/dist/ClosingDraftView-CEeeL7W4.js +0 -1225
- package/dist/ClosingTemplateView-CkS9e0MV.js +0 -1819
- package/dist/FmCustomAttribute.vue_vue_type_script_setup_true_lang-CIBSvY0s.js +0 -142
- package/dist/FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-Dg_7ELeT.js +0 -286
- package/dist/PublishView-ByXdmuJL.js +0 -192
- package/dist/ReceiveRequestView-CApg7LGM.js +0 -1876
- package/dist/StockView-D6o_oUlz.js +0 -1817
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-D2skLe2M.js +0 -1327
- package/dist/TransferTemplateView-DVesObTd.js +0 -1284
- package/dist/components/FmCustomAttribute2.vue.d.ts +0 -18
- package/dist/index-P5iEcRw3.js +0 -29202
- package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +0 -2628
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
import { defineComponent as g, openBlock as a, createElementBlock as i, createElementVNode as m, toDisplayString as u, unref as h, Fragment as C, renderList as N, computed as v, resolveComponent as V, createVNode as S, createCommentVNode as w, h as B } from "vue";
|
|
2
|
-
import { j as b, K as F, f as $ } from "./app-D0O4wr2X.js";
|
|
3
|
-
import { useI18n as k, useCoreStore as I } from "@feedmepos/mf-common";
|
|
4
|
-
import { components as O } from "@feedmepos/ui-library";
|
|
5
|
-
const T = { class: "flex flex-col" }, j = { 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" }, z = { class: "flex-1 py-8 px-16" }, D = {
|
|
6
|
-
class: "flex-0 py-8 px-16",
|
|
7
|
-
style: { "flex-basis": "120px" }
|
|
8
|
-
}, E = { class: "flex-1 py-8 px-16" }, K = {
|
|
9
|
-
key: 0,
|
|
10
|
-
class: "flex-0 py-8 px-16",
|
|
11
|
-
style: { "flex-basis": "120px" }
|
|
12
|
-
}, M = {
|
|
13
|
-
key: 1,
|
|
14
|
-
class: "flex-0 py-8 px-16",
|
|
15
|
-
style: { "flex-basis": "120px" }
|
|
16
|
-
}, G = /* @__PURE__ */ g({
|
|
17
|
-
__name: "IngredientBindedItem",
|
|
18
|
-
props: {
|
|
19
|
-
name: {},
|
|
20
|
-
bindings: {}
|
|
21
|
-
},
|
|
22
|
-
setup(_) {
|
|
23
|
-
const { t: p } = k();
|
|
24
|
-
function l(o, c) {
|
|
25
|
-
var n;
|
|
26
|
-
if (o.measurement) {
|
|
27
|
-
const d = F(o.amount, o.measurement.conversion);
|
|
28
|
-
return `${b(d, !1)} ${(n = o.measurement) == null ? void 0 : n.abbrev}`;
|
|
29
|
-
}
|
|
30
|
-
return `${b(o.amount, !1)} ${c.abbrev}`;
|
|
31
|
-
}
|
|
32
|
-
function f(o) {
|
|
33
|
-
return o.unit !== void 0;
|
|
34
|
-
}
|
|
35
|
-
return (o, c) => (a(), i("div", T, [
|
|
36
|
-
m("div", j, [
|
|
37
|
-
m("div", z, u(o.name), 1),
|
|
38
|
-
m("div", D, u(h(p)("inventory.ingredient.bindedItems.amount")), 1)
|
|
39
|
-
]),
|
|
40
|
-
(a(!0), i(C, null, N(o.bindings, (n) => (a(), i("div", {
|
|
41
|
-
key: n.id,
|
|
42
|
-
class: "flex flex-row fm-typo-en-body-md-400 h-48 items-center border-b border-b-fm-color-neutral-gray-100"
|
|
43
|
-
}, [
|
|
44
|
-
m("div", E, u(n.name), 1),
|
|
45
|
-
f(n) ? (a(), i("div", K, u(l(n, n.unit)), 1)) : (a(), i("div", M, u(h(b)(n.amount, !1)), 1))
|
|
46
|
-
]))), 128))
|
|
47
|
-
]));
|
|
48
|
-
}
|
|
49
|
-
}), U = {
|
|
50
|
-
key: 0,
|
|
51
|
-
class: "flex flex-col gap-16"
|
|
52
|
-
}, H = /* @__PURE__ */ g({
|
|
53
|
-
__name: "FmCustomAttribute",
|
|
54
|
-
props: {
|
|
55
|
-
entity: {},
|
|
56
|
-
modelValue: {},
|
|
57
|
-
valueOptions: {}
|
|
58
|
-
},
|
|
59
|
-
emits: ["update:modelValue"],
|
|
60
|
-
setup(_, { emit: p }) {
|
|
61
|
-
const l = _, f = p, { t: o } = k(), c = I();
|
|
62
|
-
function n(s) {
|
|
63
|
-
var e, t;
|
|
64
|
-
if ((t = (e = l.valueOptions) == null ? void 0 : e[s]) != null && t.length)
|
|
65
|
-
return l.valueOptions[s];
|
|
66
|
-
}
|
|
67
|
-
const d = v(() => {
|
|
68
|
-
const s = /* @__PURE__ */ new Set(["671005de24a7f4001c87e25e"]), e = c.currentBusiness.value;
|
|
69
|
-
return e ? s.has(e._id) ? [
|
|
70
|
-
{
|
|
71
|
-
key: "tag",
|
|
72
|
-
type: "string",
|
|
73
|
-
entity: "inventorySku"
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
key: "tag",
|
|
77
|
-
type: "string",
|
|
78
|
-
entity: "inventoryRecipe"
|
|
79
|
-
}
|
|
80
|
-
].filter((r) => r.entity === l.entity) : [] : [];
|
|
81
|
-
}), y = v(() => d.value.map((s) => {
|
|
82
|
-
var t;
|
|
83
|
-
const e = n(s.key);
|
|
84
|
-
return {
|
|
85
|
-
key: s.key,
|
|
86
|
-
type: s.type,
|
|
87
|
-
value: ((t = l.modelValue) == null ? void 0 : t[s.key]) || "",
|
|
88
|
-
options: e
|
|
89
|
-
};
|
|
90
|
-
}) || []), A = [
|
|
91
|
-
{
|
|
92
|
-
header: () => o("portalshell.customAttributes.form.key"),
|
|
93
|
-
accessorKey: "key",
|
|
94
|
-
enableSorting: !1
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
header: () => o("portalshell.customAttributes.form.value"),
|
|
98
|
-
accessorKey: "value",
|
|
99
|
-
enableSorting: !1,
|
|
100
|
-
cell: (s) => {
|
|
101
|
-
const e = s.row.original;
|
|
102
|
-
return B(O.FmTextField, {
|
|
103
|
-
modelValue: e.value,
|
|
104
|
-
placeholder: o("portalshell.customAttributes.form.valuePlaceholder"),
|
|
105
|
-
datalist: e.options,
|
|
106
|
-
rules: [
|
|
107
|
-
(t) => e.type === "number" && isNaN(Number(t)) ? o("portalshell.customAttributes.form.attributeValueMustBeNumber") : !0
|
|
108
|
-
],
|
|
109
|
-
"onUpdate:modelValue": (t) => {
|
|
110
|
-
const r = $(l.modelValue);
|
|
111
|
-
if (r[e.key] = t == null ? void 0 : t.trim(), e.type === "number") {
|
|
112
|
-
if (isNaN(Number(t)))
|
|
113
|
-
return;
|
|
114
|
-
r[e.key] = Number(t);
|
|
115
|
-
}
|
|
116
|
-
Object.keys(r).forEach((x) => {
|
|
117
|
-
r[x] || delete r[x];
|
|
118
|
-
}), f("update:modelValue", r);
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
];
|
|
124
|
-
return (s, e) => {
|
|
125
|
-
const t = V("FmTable");
|
|
126
|
-
return y.value.length ? (a(), i("div", U, [
|
|
127
|
-
e[0] || (e[0] = m("div", { class: "fm-typo-en-title-sm-600" }, "Custom attributes", -1)),
|
|
128
|
-
S(t, {
|
|
129
|
-
"column-defs": A,
|
|
130
|
-
"row-data": y.value,
|
|
131
|
-
"shrink-at": !1,
|
|
132
|
-
"page-size": y.value.length,
|
|
133
|
-
"hide-footer": ""
|
|
134
|
-
}, null, 8, ["row-data", "page-size"])
|
|
135
|
-
])) : w("", !0);
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
});
|
|
139
|
-
export {
|
|
140
|
-
G as _,
|
|
141
|
-
H as a
|
|
142
|
-
};
|
|
@@ -1,286 +0,0 @@
|
|
|
1
|
-
import { j as L, t as I, ao as x, u as R, at as B, aD as H, aE as M } from "./app-D0O4wr2X.js";
|
|
2
|
-
import { u as j } from "./supplier-CH4EwBZM.js";
|
|
3
|
-
import { P as S } from "./format-unit-display-CMM6DZJj.js";
|
|
4
|
-
import { computed as y, defineComponent as W, mergeModels as $, useModel as J, ref as K, resolveComponent as U, openBlock as F, createElementBlock as A, normalizeStyle as Q, createElementVNode as D, createVNode as X, withCtx as Y, createBlock as V, createCommentVNode as E, Fragment as Z, renderList as z, unref as w } from "vue";
|
|
5
|
-
function G(a, o, e) {
|
|
6
|
-
var s;
|
|
7
|
-
if (!!o.measurement === !!e && ((s = o.measurement) == null ? void 0 : s.id) === e)
|
|
8
|
-
return o;
|
|
9
|
-
if (!e)
|
|
10
|
-
return {
|
|
11
|
-
costPerUnit: o.costPerUnit
|
|
12
|
-
};
|
|
13
|
-
const i = a.measurements.find((r) => r.id === e);
|
|
14
|
-
return i ? {
|
|
15
|
-
costPerUnit: o.costPerUnit,
|
|
16
|
-
measurement: i
|
|
17
|
-
} : {
|
|
18
|
-
costPerUnit: o.costPerUnit
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
function oe(a, o, e, n) {
|
|
22
|
-
var P, g, c;
|
|
23
|
-
if (n != null && n.manualTotalCost)
|
|
24
|
-
return n == null ? void 0 : n.manualTotalCost;
|
|
25
|
-
const t = (c = (g = (P = n == null ? void 0 : n.supplier) == null ? void 0 : P.supplyItems) == null ? void 0 : g.find(
|
|
26
|
-
(l) => l.skuId === a._id
|
|
27
|
-
)) == null ? void 0 : c.defaultCost, i = a.defaultCost ? G(a.unit, a.defaultCost, a.trackingMeasurement) : void 0, s = t ?? i, r = s == null ? void 0 : s.costPerUnit, u = r ? s != null && s.measurement ? +L(r) / +L(s == null ? void 0 : s.measurement.conversion) : +L(r) : void 0, p = u ? e ? u * +L(e.conversion) : u : void 0, v = p ? +L(o) * p : void 0;
|
|
28
|
-
return v ? {
|
|
29
|
-
...I(v ?? 0, 2),
|
|
30
|
-
currency: x()
|
|
31
|
-
} : {
|
|
32
|
-
amount: 0,
|
|
33
|
-
precision: 0,
|
|
34
|
-
currency: x()
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
function T(a) {
|
|
38
|
-
return H.parse(a);
|
|
39
|
-
}
|
|
40
|
-
function C(a) {
|
|
41
|
-
return {
|
|
42
|
-
_id: a.doc._id,
|
|
43
|
-
internal: a.type,
|
|
44
|
-
contactName: a.doc.profile.name,
|
|
45
|
-
name: a.doc.profile.name ?? "",
|
|
46
|
-
email: a.doc.profile.email,
|
|
47
|
-
phoneNumber: a.doc.profile.phoneNo,
|
|
48
|
-
registrationNumber: a.doc.profile.regNo,
|
|
49
|
-
address: a.doc.profile.address ?? {
|
|
50
|
-
line1: "",
|
|
51
|
-
state: "",
|
|
52
|
-
city: "",
|
|
53
|
-
postcode: "",
|
|
54
|
-
country: ""
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
function re(a, o, e = !1, n = !1) {
|
|
59
|
-
const t = j(), i = R();
|
|
60
|
-
i.watchLocation(async () => {
|
|
61
|
-
var b;
|
|
62
|
-
await t.readSuppliers();
|
|
63
|
-
const c = a();
|
|
64
|
-
if ((b = c.supplier) != null && b._id) return;
|
|
65
|
-
const l = n ? t.suppliers[0] : t.businessSuppliers[0], f = (e ? i.locations.filter((m) => m.doc._id !== i.currentLocation.doc._id) : i.locations)[0];
|
|
66
|
-
o({
|
|
67
|
-
...c,
|
|
68
|
-
supplier: l ? T(l) : f ? C(f) : c.supplier
|
|
69
|
-
});
|
|
70
|
-
});
|
|
71
|
-
const s = y(
|
|
72
|
-
() => {
|
|
73
|
-
var c, l;
|
|
74
|
-
return typeof ((l = (c = a()) == null ? void 0 : c.supplier) == null ? void 0 : l.internal) == "string" ? S.TRANSFER : S.PURCHASE;
|
|
75
|
-
}
|
|
76
|
-
), r = y({
|
|
77
|
-
get() {
|
|
78
|
-
var c, l;
|
|
79
|
-
return (l = (c = a()) == null ? void 0 : c.supplier) == null ? void 0 : l._id;
|
|
80
|
-
},
|
|
81
|
-
set(c) {
|
|
82
|
-
const l = a() ?? {};
|
|
83
|
-
if (s.value === S.PURCHASE) {
|
|
84
|
-
const _ = (n ? t.suppliers : t.businessSuppliers).find((N) => N._id === c);
|
|
85
|
-
o({
|
|
86
|
-
...l,
|
|
87
|
-
supplier: _ ? T(_) : l.supplier
|
|
88
|
-
});
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
const b = (e ? i.locations.filter((m) => m.doc._id !== i.currentLocation.doc._id) : i.locations).find((m) => m.doc._id === c);
|
|
92
|
-
o({
|
|
93
|
-
...l,
|
|
94
|
-
supplier: b ? C(b) : l.supplier
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
}), u = y(() => t.locationSuppliers.map(T)), p = y(() => t.businessSuppliers.map(T)), v = y(() => {
|
|
98
|
-
const c = [...u.value], l = [...p.value];
|
|
99
|
-
return n ? [...l, ...c] : l;
|
|
100
|
-
}), d = y(() => {
|
|
101
|
-
var h;
|
|
102
|
-
const c = ((h = i._currentLocation) == null ? void 0 : h.type) === B.warehouse;
|
|
103
|
-
return (e ? i.locations.filter((f) => f.doc._id !== i.currentLocation.doc._id) : i.locations).filter((f) => c || f.acceptRequest).map(C);
|
|
104
|
-
}), P = y(() => {
|
|
105
|
-
if (s.value === S.PURCHASE) {
|
|
106
|
-
const l = u.value.map((f) => ({
|
|
107
|
-
label: f.name,
|
|
108
|
-
value: f._id
|
|
109
|
-
})), h = p.value.map((f) => ({
|
|
110
|
-
label: f.name,
|
|
111
|
-
sublabel: "Business supplier",
|
|
112
|
-
value: f._id
|
|
113
|
-
}));
|
|
114
|
-
return n ? [...l, ...h] : h;
|
|
115
|
-
}
|
|
116
|
-
return d.value.map((l) => ({
|
|
117
|
-
label: l.name,
|
|
118
|
-
sublabel: l.internal ? `${l.internal}` : void 0,
|
|
119
|
-
value: l._id
|
|
120
|
-
}));
|
|
121
|
-
}), g = y(() => {
|
|
122
|
-
var f, b;
|
|
123
|
-
const c = (b = (f = a()) == null ? void 0 : f.supplier) == null ? void 0 : b._id;
|
|
124
|
-
if (s.value === S.PURCHASE) {
|
|
125
|
-
const m = t.suppliers.find((_) => _._id === c);
|
|
126
|
-
return m ? T(m) : null;
|
|
127
|
-
}
|
|
128
|
-
const h = i.locations.find((m) => m.doc._id);
|
|
129
|
-
return h ? C(h) : null;
|
|
130
|
-
});
|
|
131
|
-
return {
|
|
132
|
-
transferLocationModel: r,
|
|
133
|
-
transferLocationOptions: P,
|
|
134
|
-
locationOptionsTypePurchase: v,
|
|
135
|
-
locationOptionsTypePurchaseLocationLevel: u,
|
|
136
|
-
locationOptionsTypeTransfer: d,
|
|
137
|
-
selectedLocation: g
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
class O {
|
|
141
|
-
static getDescendantProperty(o, e, n = []) {
|
|
142
|
-
let t, i, s, r, u, p;
|
|
143
|
-
if (e) {
|
|
144
|
-
if (s = e.indexOf("."), s === -1 ? t = e : (t = e.slice(0, s), i = e.slice(s + 1)), r = o[t], r !== null && typeof r < "u")
|
|
145
|
-
if (!i && (typeof r == "string" || typeof r == "number"))
|
|
146
|
-
n.push(r);
|
|
147
|
-
else if (Object.prototype.toString.call(r) === "[object Array]")
|
|
148
|
-
for (u = 0, p = r.length; u < p; u++)
|
|
149
|
-
O.getDescendantProperty(r[u], i, n);
|
|
150
|
-
else i && O.getDescendantProperty(r, i, n);
|
|
151
|
-
} else
|
|
152
|
-
n.push(o);
|
|
153
|
-
return n;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
class k {
|
|
157
|
-
constructor(o = [], e = [], n = {}) {
|
|
158
|
-
Array.isArray(e) || (n = e, e = []), this.haystack = o, this.keys = e, this.options = Object.assign({
|
|
159
|
-
caseSensitive: !1,
|
|
160
|
-
sort: !1
|
|
161
|
-
}, n);
|
|
162
|
-
}
|
|
163
|
-
search(o = "") {
|
|
164
|
-
if (o === "")
|
|
165
|
-
return this.haystack;
|
|
166
|
-
const e = [];
|
|
167
|
-
for (let n = 0; n < this.haystack.length; n++) {
|
|
168
|
-
const t = this.haystack[n];
|
|
169
|
-
if (this.keys.length === 0) {
|
|
170
|
-
const i = k.isMatch(t, o, this.options.caseSensitive);
|
|
171
|
-
i && e.push({ item: t, score: i });
|
|
172
|
-
} else
|
|
173
|
-
for (let i = 0; i < this.keys.length; i++) {
|
|
174
|
-
const s = O.getDescendantProperty(t, this.keys[i]);
|
|
175
|
-
let r = !1;
|
|
176
|
-
for (let u = 0; u < s.length; u++) {
|
|
177
|
-
const p = k.isMatch(s[u], o, this.options.caseSensitive);
|
|
178
|
-
if (p) {
|
|
179
|
-
r = !0, e.push({ item: t, score: p });
|
|
180
|
-
break;
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
if (r)
|
|
184
|
-
break;
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
return this.options.sort && e.sort((n, t) => n.score - t.score), e.map((n) => n.item);
|
|
188
|
-
}
|
|
189
|
-
static isMatch(o, e, n) {
|
|
190
|
-
o = String(o), e = String(e), n || (o = o.toLocaleLowerCase(), e = e.toLocaleLowerCase());
|
|
191
|
-
const t = k.nearestIndexesFor(o, e);
|
|
192
|
-
return t ? o === e ? 1 : t.length > 1 ? 2 + (t[t.length - 1] - t[0]) : 2 + t[0] : !1;
|
|
193
|
-
}
|
|
194
|
-
static nearestIndexesFor(o, e) {
|
|
195
|
-
const n = e.split("");
|
|
196
|
-
let t = [];
|
|
197
|
-
return k.indexesOfFirstLetter(o, e).forEach((s, r) => {
|
|
198
|
-
let u = s + 1;
|
|
199
|
-
t[r] = [s];
|
|
200
|
-
for (let p = 1; p < n.length; p++) {
|
|
201
|
-
const v = n[p];
|
|
202
|
-
if (u = o.indexOf(v, u), u === -1) {
|
|
203
|
-
t[r] = !1;
|
|
204
|
-
break;
|
|
205
|
-
}
|
|
206
|
-
t[r].push(u), u++;
|
|
207
|
-
}
|
|
208
|
-
}), t = t.filter((s) => s !== !1), t.length ? t.sort((s, r) => s.length === 1 ? s[0] - r[0] : (s = s[s.length - 1] - s[0], r = r[r.length - 1] - r[0], s - r))[0] : !1;
|
|
209
|
-
}
|
|
210
|
-
static indexesOfFirstLetter(o, e) {
|
|
211
|
-
const n = e[0];
|
|
212
|
-
return o.split("").map((t, i) => t !== n ? !1 : i).filter((t) => t !== !1);
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
const q = { class: "overflow-y-auto h-full pb-8" }, ie = /* @__PURE__ */ W({
|
|
216
|
-
__name: "FmFilterableMenuOptions",
|
|
217
|
-
props: /* @__PURE__ */ $({
|
|
218
|
-
modelValue: {},
|
|
219
|
-
maxHeight: {},
|
|
220
|
-
width: {},
|
|
221
|
-
handleItemChange: { type: Function },
|
|
222
|
-
items: {},
|
|
223
|
-
options: {}
|
|
224
|
-
}, {
|
|
225
|
-
search: {},
|
|
226
|
-
searchModifiers: {}
|
|
227
|
-
}),
|
|
228
|
-
emits: ["update:search"],
|
|
229
|
-
setup(a) {
|
|
230
|
-
const o = a, e = J(a, "search"), n = y(
|
|
231
|
-
() => new k(o.items, ["label", "sublabel"], o.options)
|
|
232
|
-
), t = y(() => n.value.search(e.value)), i = K();
|
|
233
|
-
return console.log({ stickyRef: i }), (s, r) => {
|
|
234
|
-
const u = U("FmButton"), p = U("FmTextField"), v = U("FmMenuItem");
|
|
235
|
-
return F(), A("div", {
|
|
236
|
-
class: "relative",
|
|
237
|
-
style: Q({ width: s.width })
|
|
238
|
-
}, [
|
|
239
|
-
D("div", {
|
|
240
|
-
class: "sticky top-0 bg-white mb-8",
|
|
241
|
-
ref_key: "stickyRef",
|
|
242
|
-
ref: i
|
|
243
|
-
}, [
|
|
244
|
-
X(p, {
|
|
245
|
-
modelValue: e.value,
|
|
246
|
-
"onUpdate:modelValue": r[1] || (r[1] = (d) => e.value = d),
|
|
247
|
-
placeholder: "Filter options"
|
|
248
|
-
}, {
|
|
249
|
-
append: Y(() => [
|
|
250
|
-
e.value ? (F(), V(u, {
|
|
251
|
-
key: 0,
|
|
252
|
-
variant: "tertiary",
|
|
253
|
-
"prepend-icon": "close",
|
|
254
|
-
onClick: r[0] || (r[0] = (d) => e.value = "")
|
|
255
|
-
})) : E("", !0)
|
|
256
|
-
]),
|
|
257
|
-
_: 1
|
|
258
|
-
}, 8, ["modelValue"])
|
|
259
|
-
], 512),
|
|
260
|
-
D("div", q, [
|
|
261
|
-
(F(!0), A(Z, null, z(t.value, (d, P) => (F(), V(v, {
|
|
262
|
-
key: P,
|
|
263
|
-
label: d.label,
|
|
264
|
-
sublabel: d.sublabel,
|
|
265
|
-
"model-value": w(M)(s.modelValue, d.value),
|
|
266
|
-
onClick: () => s.handleItemChange(w(M)(s.modelValue, d.value), d),
|
|
267
|
-
onVnodeMounted: (g) => {
|
|
268
|
-
var c, l;
|
|
269
|
-
return w(M)(s.modelValue, d.value) && ((c = g.el) == null || c.scrollIntoView({ behavior: "instant", block: "end" }), (l = g.el) == null || l.scrollIntoView({ behavior: "smooth", block: "center" })), void 0;
|
|
270
|
-
}
|
|
271
|
-
}, null, 8, ["label", "sublabel", "model-value", "onClick", "onVnodeMounted"]))), 128)),
|
|
272
|
-
t.value.length ? E("", !0) : (F(), V(v, {
|
|
273
|
-
key: 0,
|
|
274
|
-
disabled: "",
|
|
275
|
-
label: "No options available"
|
|
276
|
-
}))
|
|
277
|
-
])
|
|
278
|
-
], 4);
|
|
279
|
-
};
|
|
280
|
-
}
|
|
281
|
-
});
|
|
282
|
-
export {
|
|
283
|
-
ie as _,
|
|
284
|
-
oe as c,
|
|
285
|
-
re as u
|
|
286
|
-
};
|
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
import { defineComponent as j, computed as i, ref as q, resolveComponent as a, openBlock as k, createBlock as D, unref as p, createSlots as G, withCtx as r, createElementVNode as b, normalizeClass as J, createVNode as n, normalizeStyle as Q, Teleport as W, h } from "vue";
|
|
2
|
-
import { u as X, a as Z, z as ee, _ as te, ae as P } from "./app-D0O4wr2X.js";
|
|
3
|
-
import { useBreakpoints as oe, components as ne } from "@feedmepos/ui-library";
|
|
4
|
-
import { u as le } from "./vue-i18n-BcYt8MNZ.js";
|
|
5
|
-
const ae = { class: "flex flex-col py-8" }, se = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ie = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, pe = /* @__PURE__ */ j({
|
|
6
|
-
__name: "PublishView",
|
|
7
|
-
setup(re) {
|
|
8
|
-
const { t: l } = le(), { breakpoints: y } = oe(), _ = X(), g = Z(), u = i(() => g.state.inventory.updatedAt ? g.state.inventory.updatedAt : null), H = ee(), L = i(() => _.locations), f = i(() => y.value.xs || y.value.sm), R = i(() => f.value ? 10 : 20), Y = i(() => [
|
|
9
|
-
// { label: t('inventory.publish.actions.publishAll'), value: 'publish' }
|
|
10
|
-
]);
|
|
11
|
-
function B(e) {
|
|
12
|
-
switch (e) {
|
|
13
|
-
case "publish":
|
|
14
|
-
console.log("publish all");
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
const v = q(!1), I = [
|
|
18
|
-
{
|
|
19
|
-
value: "publish",
|
|
20
|
-
label: l("inventory.publish.actions.publishAll")
|
|
21
|
-
}
|
|
22
|
-
];
|
|
23
|
-
function N(e) {
|
|
24
|
-
switch (v.value = !1, e) {
|
|
25
|
-
case "publish":
|
|
26
|
-
console.log("publish all");
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
const U = [
|
|
30
|
-
{
|
|
31
|
-
id: "type",
|
|
32
|
-
header: () => l("inventory.publish.columns.type"),
|
|
33
|
-
enableSorting: !0,
|
|
34
|
-
cell(e) {
|
|
35
|
-
return h(ne.FmChip, {
|
|
36
|
-
color: "primary",
|
|
37
|
-
label: e.row.original.type
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
accessorKey: "name",
|
|
43
|
-
header: () => l("inventory.publish.columns.location"),
|
|
44
|
-
enableSorting: !0,
|
|
45
|
-
size: 300
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
id: "version",
|
|
49
|
-
header: () => l("inventory.publish.columns.version"),
|
|
50
|
-
enableSorting: !0,
|
|
51
|
-
cell(e) {
|
|
52
|
-
var t, o;
|
|
53
|
-
return (t = e.row.original.inventory) != null && t.updatedAt ? P((o = e.row.original.inventory) == null ? void 0 : o.updatedAt) : "";
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
id: "status",
|
|
58
|
-
header: () => l("inventory.publish.columns.status"),
|
|
59
|
-
enableSorting: !0,
|
|
60
|
-
cell(e) {
|
|
61
|
-
var o;
|
|
62
|
-
if (!u.value)
|
|
63
|
-
return "";
|
|
64
|
-
const t = ((o = e.row.original.inventory) == null ? void 0 : o.updatedAt) == u.value;
|
|
65
|
-
return h(
|
|
66
|
-
"div",
|
|
67
|
-
{
|
|
68
|
-
class: "flex"
|
|
69
|
-
},
|
|
70
|
-
h(
|
|
71
|
-
"div",
|
|
72
|
-
{
|
|
73
|
-
class: [
|
|
74
|
-
"fm-status-badge",
|
|
75
|
-
t ? "fm-status-badge-success-secondary" : "fm-status-badge-info-secondary"
|
|
76
|
-
]
|
|
77
|
-
},
|
|
78
|
-
t ? "Published" : "Outdated"
|
|
79
|
-
)
|
|
80
|
-
);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
// {
|
|
84
|
-
// id: 'action',
|
|
85
|
-
// header: '',
|
|
86
|
-
// cell(props) {
|
|
87
|
-
// return createContextMenuComponents(
|
|
88
|
-
// [DefaultRowActions[RowActionEnum.Edit], DefaultRowActions[RowActionEnum.Delete]],
|
|
89
|
-
// (action) => {
|
|
90
|
-
// onActionMenu(action, props.row.original)
|
|
91
|
-
// }
|
|
92
|
-
// )
|
|
93
|
-
// },
|
|
94
|
-
// enableSorting: false,
|
|
95
|
-
// size: 40,
|
|
96
|
-
// meta: {
|
|
97
|
-
// cellClass: '',
|
|
98
|
-
// headerClass: ''
|
|
99
|
-
// }
|
|
100
|
-
// }
|
|
101
|
-
];
|
|
102
|
-
return (e, t) => {
|
|
103
|
-
const o = a("FmChip"), x = a("FlexRender"), $ = a("TableActionableRow"), E = a("FmTable"), K = a("FmCollapsibleTabs"), O = a("FmBottomSheet");
|
|
104
|
-
return k(), D(te, {
|
|
105
|
-
title: p(l)("inventory.publish.title"),
|
|
106
|
-
actions: Y.value,
|
|
107
|
-
"onClick:action": B
|
|
108
|
-
}, G({
|
|
109
|
-
default: r(() => {
|
|
110
|
-
var w;
|
|
111
|
-
return [
|
|
112
|
-
b("div", {
|
|
113
|
-
class: J([
|
|
114
|
-
"flex flex-col gap-8 max-h-full",
|
|
115
|
-
{
|
|
116
|
-
"p-0": f.value,
|
|
117
|
-
"px-24 ": !f.value
|
|
118
|
-
}
|
|
119
|
-
])
|
|
120
|
-
}, [
|
|
121
|
-
n(E, {
|
|
122
|
-
style: Q(p(H).tableHeight),
|
|
123
|
-
"column-defs": U,
|
|
124
|
-
"row-data": L.value,
|
|
125
|
-
loading: ((w = p(_)._locations) == null ? void 0 : w.length) === 0,
|
|
126
|
-
"loading-text": "Loading",
|
|
127
|
-
"page-size": R.value
|
|
128
|
-
}, {
|
|
129
|
-
"list-row": r((s) => [
|
|
130
|
-
n($, { row: s }, {
|
|
131
|
-
default: r((c) => {
|
|
132
|
-
var S, A, F, d, M, C, T, V, m, z;
|
|
133
|
-
return [
|
|
134
|
-
b("div", ae, [
|
|
135
|
-
b("div", se, [
|
|
136
|
-
n(x, {
|
|
137
|
-
render: (F = (A = (S = c.code) == null ? void 0 : S.column) == null ? void 0 : A.columnDef) == null ? void 0 : F.cell,
|
|
138
|
-
props: (M = (d = c.code) == null ? void 0 : d.getContext) == null ? void 0 : M.call(d)
|
|
139
|
-
}, null, 8, ["render", "props"])
|
|
140
|
-
]),
|
|
141
|
-
b("div", ie, [
|
|
142
|
-
n(x, {
|
|
143
|
-
render: (V = (T = (C = c.name) == null ? void 0 : C.column) == null ? void 0 : T.columnDef) == null ? void 0 : V.cell,
|
|
144
|
-
props: (z = (m = c.name) == null ? void 0 : m.getContext) == null ? void 0 : z.call(m)
|
|
145
|
-
}, null, 8, ["render", "props"])
|
|
146
|
-
])
|
|
147
|
-
])
|
|
148
|
-
];
|
|
149
|
-
}),
|
|
150
|
-
_: 2
|
|
151
|
-
}, 1032, ["row"])
|
|
152
|
-
]),
|
|
153
|
-
_: 1
|
|
154
|
-
}, 8, ["style", "row-data", "loading", "page-size"])
|
|
155
|
-
], 2),
|
|
156
|
-
(k(), D(W, { to: "body" }, [
|
|
157
|
-
n(O, {
|
|
158
|
-
"dismiss-away": "",
|
|
159
|
-
modelValue: v.value,
|
|
160
|
-
"onUpdate:modelValue": t[1] || (t[1] = (s) => v.value = s)
|
|
161
|
-
}, {
|
|
162
|
-
default: r(() => [
|
|
163
|
-
n(K, {
|
|
164
|
-
class: "pb-8",
|
|
165
|
-
items: I,
|
|
166
|
-
"onUpdate:modelValue": t[0] || (t[0] = (s) => N(s))
|
|
167
|
-
})
|
|
168
|
-
]),
|
|
169
|
-
_: 1
|
|
170
|
-
}, 8, ["modelValue"])
|
|
171
|
-
]))
|
|
172
|
-
];
|
|
173
|
-
}),
|
|
174
|
-
_: 2
|
|
175
|
-
}, [
|
|
176
|
-
u.value ? {
|
|
177
|
-
name: "headerInfo",
|
|
178
|
-
fn: r(() => [
|
|
179
|
-
n(o, {
|
|
180
|
-
variant: "info",
|
|
181
|
-
label: `Latest: ${p(P)(u.value)}`
|
|
182
|
-
}, null, 8, ["label"])
|
|
183
|
-
]),
|
|
184
|
-
key: "0"
|
|
185
|
-
} : void 0
|
|
186
|
-
]), 1032, ["title", "actions"]);
|
|
187
|
-
};
|
|
188
|
-
}
|
|
189
|
-
});
|
|
190
|
-
export {
|
|
191
|
-
pe as default
|
|
192
|
-
};
|