@feedmepos/mf-inventory-portal 1.2.30-dev.1 → 1.2.31-dev.1
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-kX4bqoEe.js → App-DfKh34ES.js} +43 -41
- package/dist/{ApprovalView-DCNKqVE2.js → ApprovalView-DyoKsEqh.js} +34 -28
- package/dist/{BindingsDialog-d7f1f8gf.js → BindingsDialog-7rGLzkyA.js} +8 -8
- package/dist/{BindingsPicker-2HJOx0QW.js → BindingsPicker-Cj1DvhQN.js} +6 -5
- package/dist/{BindingsTable-CPAjxOZG.js → BindingsTable-CAreptqr.js} +28 -24
- package/dist/{ClosingDraftView-CUng41eo.js → ClosingDraftView-DoDGz9Y8.js} +183 -175
- package/dist/{ClosingHistoryView-CcGc2NwU.js → ClosingHistoryView-BJSE7ZSv.js} +43 -41
- package/dist/{ClosingTemplateView-D8IAdhDb.js → ClosingTemplateView-Dr2eJk4h.js} +94 -76
- package/dist/{DeliveryOrderPrintPreview-BsM-CCc5.js → DeliveryOrderPrintPreview-BzYLm6J6.js} +15 -14
- package/dist/FmDroppableField-J0xUsOTV.js +154 -0
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-cuggJ5Xd.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-16r_hkBE.js} +74 -72
- package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-Csesow4V.js +279 -0
- package/dist/FmMultiselectDialog-BGhSjgbj.js +597 -0
- package/dist/{FmMultiselectDialog-BGbrqXUF.js → FmMultiselectDialog-DUrpqAkF.js} +1 -1
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-isogcN1O.js → FmUnitInput.vue_vue_type_script_setup_true_lang-CSv7osJW.js} +51 -49
- package/dist/{ImportView-wAVrMEwL.js → ImportView-BAkyTU_3.js} +81 -74
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-DVUF4I2Q.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-z0IAsrH_.js} +5 -5
- package/dist/{IngredientGroupView-BZczeXdL.js → IngredientGroupView-D7gurA7T.js} +73 -65
- package/dist/{IngredientsView-D5N5Y1ZY.js → IngredientsView-hwfpMtTX.js} +358 -345
- package/dist/{IntegrationView-Hrslmuc1.js → IntegrationView-DwqzQ6E3.js} +1618 -1593
- package/dist/{InventoryBindingForm-DH6wgxOG.js → InventoryBindingForm-CwjM6Rqk.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-Drr5vD6f.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-BPr8PDwu.js} +41 -40
- package/dist/{InventoryBindingSummary-BU1ehpQZ.js → InventoryBindingSummary-B7UFFMkm.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-1ueC4GfZ.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Djo2b2Ix.js} +5 -5
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-FHcU1zZt.js → PremiumBadge.vue_vue_type_script_setup_true_lang-BSgGGiN6.js} +22 -21
- package/dist/{PublishView-CQtj0f31.js → PublishView-CA9gFV_r.js} +26 -23
- package/dist/{PurchaseOrderPrintPreview-BQyXtHST.js → PurchaseOrderPrintPreview-BeHd82Y0.js} +10 -9
- package/dist/{ReceiveRequestView-Dm-h_SrY.js → ReceiveRequestView-DEthRdM1.js} +472 -456
- package/dist/{RecipeView-DNNRvr1w.js → RecipeView-D45gkYHY.js} +73 -64
- package/dist/SingleColumnLayout.vue_vue_type_script_setup_true_lang-CWZkVCAj.js +251 -0
- package/dist/{StockView-CaOm5BCx.js → StockView-COx7A4Ac.js} +292 -282
- package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Z91XRszD.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DX35xDkm.js} +1 -1
- package/dist/{SupplierView-JSII9qwL.js → SupplierView-DHM3dJMZ.js} +92 -80
- package/dist/SystemTrailDialog.vue_vue_type_script_setup_true_lang-Bg2K2ULw.js +177 -0
- package/dist/TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js +135 -0
- package/dist/TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CyMEGFh5.js +123 -0
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-Mehd4lGs.js → TransferDetails.vue_vue_type_script_setup_true_lang-CVm2bXic.js} +318 -305
- package/dist/{TransferTemplateView-DyCpNKJd.js → TransferTemplateView-BtYozLuk.js} +228 -216
- package/dist/{UnitView-CqN7mlJ2.js → UnitView-B4mqodQa.js} +70 -63
- package/dist/{WarehouseView-gFWD-m8e.js → WarehouseView-CjDM8L_V.js} +123 -114
- package/dist/WastageTemplateView-Be4Y_zV8.js +2288 -0
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
- package/dist/api/netsuite.d.ts +9 -3
- package/dist/app-DYsP0gKj.js +64121 -0
- package/dist/app-rgirz_52.js +8024 -0
- package/dist/app.js +6 -6
- package/dist/closing-template-BVy1ga2g.js +117 -0
- package/dist/date2-BO7HiZTk.js +116 -0
- package/dist/dayjs.min-HNt4C1ja.js +282 -0
- package/dist/{decimal-DfF_g5rc.js → decimal-BJ8rKm1R.js} +4 -3
- package/dist/defineDeepModel-CidpVmK7.js +19 -0
- package/dist/duplicate-template-C25Z0lvq.js +34 -0
- package/dist/feature-DCia3aqG.js +20162 -0
- package/dist/form-mode.enum-BKiNVH6A.js +4 -0
- package/dist/format-time-from-id-BPws326b.js +15 -0
- package/dist/{format-unit-display-ivAljvlo.js → format-unit-display-C2P3mS8l.js} +308 -297
- package/dist/{import-export.helper-B2MWv9v7.js → import-export.helper-Dt6ZMAPT.js} +56 -52
- package/dist/{index-DZaT0ZaL.js → index-6zxXdF-V.js} +1 -1
- package/dist/index-BjUDHtA2.js +45 -0
- package/dist/{index-BbhuWHyh.js → index-tZj47B-j.js} +16 -14
- package/dist/lodash-DLMgBu6M.js +3678 -0
- package/dist/netsuite-BSMLXIQa.js +4979 -0
- package/dist/{purchase-order-template-DdybMC_P.js → purchase-order-template-D5NGCbI2.js} +1 -1
- package/dist/router/shared.spec.d.ts +1 -0
- package/dist/row-action.enum-BcW_L_nE.js +67 -0
- package/dist/rules-BiaGzhvQ.js +201 -0
- package/dist/{stock-BYagIdsj.js → stock-DOCQ91Jh.js} +1 -1
- package/dist/{stock-V4ciPiBe.js → stock-Ty-89Ap8.js} +11 -10
- package/dist/stores/integration/netsuite.d.ts +5 -1
- package/dist/style.css +1 -1
- package/dist/{supplier-CgtB1I9I.js → supplier-Dxb5ULjF.js} +27 -26
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-ingredient-select-dialog-BIQovyZX.js → use-ingredient-select-dialog-BI0yIG6A.js} +4 -3
- package/dist/{use-inventory-binding-dialog-DyjicXgc.js → use-inventory-binding-dialog-CbZC-VuL.js} +4 -3
- package/dist/use-template-enabled-locations-2-Dhttpl0B.js +111 -0
- package/dist/views/adjustment-template/wastage-template/table.d.ts +1 -1
- package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +1 -1
- package/dist/views/integration/components/netsuite/business/BusinessNetSuiteSideSheet.vue.d.ts +6 -2
- package/dist/vue-i18n-Cqx7gNJF.js +2365 -0
- package/dist/xlsx-ex8Bmftq.js +24004 -0
- package/dist/xlsx.util-C8YXEqEl.js +78 -0
- package/package.json +2 -2
- package/dist/app-CnQ49Lyb.js +0 -131483
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { defineComponent as U, ref as d, computed as y, resolveComponent as k, openBlock as s, createElementBlock as c, createElementVNode as p, createCommentVNode as S, renderSlot as u, createBlock as C, normalizeClass as f, toDisplayString as F, unref as B } from "vue";
|
|
2
|
+
import { useI18n as W } from "@feedmepos/mf-common";
|
|
3
|
+
import { _ as q } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
|
+
const G = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "relative"
|
|
7
|
+
}, H = ["accept", "disabled"], J = { class: "flex flex-col gap-8" }, K = ["accept", "disabled"], M = /* @__PURE__ */ U({
|
|
8
|
+
__name: "FmDroppableField",
|
|
9
|
+
props: {
|
|
10
|
+
buttonLabel: {},
|
|
11
|
+
label: { default: "" },
|
|
12
|
+
disabled: { type: Boolean, default: !1 },
|
|
13
|
+
accept: { default: "" },
|
|
14
|
+
maxFileSize: { default: 8e6 },
|
|
15
|
+
contentClass: {}
|
|
16
|
+
},
|
|
17
|
+
emits: ["file-upload", "file-rejected"],
|
|
18
|
+
setup(T, { emit: V }) {
|
|
19
|
+
const l = T, g = V, { t: r } = W(), t = d(!1), i = d(null), n = d(null), m = d(), R = (e) => {
|
|
20
|
+
l.disabled || (e.stopPropagation(), e.preventDefault());
|
|
21
|
+
}, $ = (e) => {
|
|
22
|
+
l.disabled || (e.stopPropagation(), e.preventDefault(), t.value = !0);
|
|
23
|
+
}, j = (e) => {
|
|
24
|
+
l.disabled || (e.stopPropagation(), e.preventDefault(), t.value = !1);
|
|
25
|
+
}, E = (e) => {
|
|
26
|
+
var a;
|
|
27
|
+
l.disabled || (e.stopPropagation(), e.preventDefault(), t.value = !1, h((a = e.dataTransfer) == null ? void 0 : a.files));
|
|
28
|
+
};
|
|
29
|
+
function h(e) {
|
|
30
|
+
if (e)
|
|
31
|
+
if (m.value = e, i.value = I(e[0]), n.value = P(e[0]), i.value && n.value)
|
|
32
|
+
g("file-upload", e[0]);
|
|
33
|
+
else {
|
|
34
|
+
const a = L();
|
|
35
|
+
g("file-rejected", [
|
|
36
|
+
{
|
|
37
|
+
file: e[0],
|
|
38
|
+
reason: a
|
|
39
|
+
}
|
|
40
|
+
]);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
const L = () => {
|
|
44
|
+
const e = new Array();
|
|
45
|
+
return i.value || e.push("invalid-type"), n.value || e.push("invalid-size"), e;
|
|
46
|
+
}, I = (e) => {
|
|
47
|
+
if (!l.accept) return !0;
|
|
48
|
+
const a = l.accept.split(",").map((o) => o.trim());
|
|
49
|
+
for (const o of a)
|
|
50
|
+
if (w(o)) {
|
|
51
|
+
if (D(o) === D(e.type)) return !0;
|
|
52
|
+
} else if (A(e) === o || e.type === o) return !0;
|
|
53
|
+
return !1;
|
|
54
|
+
}, P = (e) => e.size <= l.maxFileSize * 1024 * 1024, w = (e) => e.indexOf("*") !== -1, A = (e) => "." + e.name.split(".").pop(), D = (e) => e.substring(0, e.indexOf("/")), O = y(() => {
|
|
55
|
+
if (t.value) return r("inventory.formField.dropField.dropToUpload");
|
|
56
|
+
if (i.value) {
|
|
57
|
+
if (!n.value)
|
|
58
|
+
return r("inventory.formField.dropField.fileSizeExceeded", { size: l.maxFileSize });
|
|
59
|
+
} else return r("inventory.formField.dropField.invalidFileType");
|
|
60
|
+
return "";
|
|
61
|
+
}), v = y(() => m.value ? !i.value || !n.value : !1), _ = (e) => {
|
|
62
|
+
const a = e.target;
|
|
63
|
+
h(a.files);
|
|
64
|
+
}, N = y(() => {
|
|
65
|
+
var e;
|
|
66
|
+
return (e = m.value) == null ? void 0 : e.item(0);
|
|
67
|
+
}), b = d();
|
|
68
|
+
return (e, a) => {
|
|
69
|
+
const o = k("FmLabel"), x = k("FmButton");
|
|
70
|
+
return s(), c("label", {
|
|
71
|
+
class: "fm-droppable-field",
|
|
72
|
+
ref_key: "fmButtonRef",
|
|
73
|
+
ref: b
|
|
74
|
+
}, [
|
|
75
|
+
e.$slots.default ? (s(), c("div", G, [
|
|
76
|
+
p("input", {
|
|
77
|
+
accept: e.accept,
|
|
78
|
+
disabled: e.disabled,
|
|
79
|
+
class: "fm-droppable-field__input",
|
|
80
|
+
type: "file",
|
|
81
|
+
onChange: _
|
|
82
|
+
}, null, 40, H)
|
|
83
|
+
])) : S("", !0),
|
|
84
|
+
u(e.$slots, "default", {
|
|
85
|
+
isDragging: t.value,
|
|
86
|
+
isValidFileType: i.value,
|
|
87
|
+
isValidFileSize: n.value,
|
|
88
|
+
singleValidFile: N.value,
|
|
89
|
+
openFileDialog: () => {
|
|
90
|
+
var z;
|
|
91
|
+
return console.log("click", b.value), (z = b.value) == null ? void 0 : z.click();
|
|
92
|
+
}
|
|
93
|
+
}, () => [
|
|
94
|
+
p("div", J, [
|
|
95
|
+
e.$slots.label ? u(e.$slots, "label", { key: 0 }, void 0, !0) : (s(), C(o, {
|
|
96
|
+
key: 1,
|
|
97
|
+
label: e.label
|
|
98
|
+
}, null, 8, ["label"]))
|
|
99
|
+
]),
|
|
100
|
+
p("div", {
|
|
101
|
+
class: f([[
|
|
102
|
+
e.contentClass ? e.contentClass : "w-full h-full",
|
|
103
|
+
{
|
|
104
|
+
"fm-droppable-field__container--dragging": t.value,
|
|
105
|
+
"fm-droppable-field__container--invalid": v.value && !e.disabled,
|
|
106
|
+
"fm-droppable-field__container--disabled": e.disabled
|
|
107
|
+
}
|
|
108
|
+
], "fm-droppable-field__container"]),
|
|
109
|
+
onDragenter: R,
|
|
110
|
+
onDragleave: j,
|
|
111
|
+
onDragover: $,
|
|
112
|
+
onDrop: E
|
|
113
|
+
}, [
|
|
114
|
+
(t.value || v.value) && !e.disabled ? (s(), c("div", {
|
|
115
|
+
key: 0,
|
|
116
|
+
class: f({
|
|
117
|
+
"fm-typo-en-body-lg-600": !0,
|
|
118
|
+
"text-fm-color-primary": t.value,
|
|
119
|
+
"text-fm-color-typo-error": v.value
|
|
120
|
+
})
|
|
121
|
+
}, F(O.value), 3)) : (s(), C(x, {
|
|
122
|
+
key: 1,
|
|
123
|
+
disabled: e.disabled,
|
|
124
|
+
label: e.buttonLabel ?? "Add files",
|
|
125
|
+
size: "md",
|
|
126
|
+
variant: "secondary"
|
|
127
|
+
}, null, 8, ["disabled", "label"])),
|
|
128
|
+
u(e.$slots, "accept-text", {}, () => [
|
|
129
|
+
l.accept ? (s(), c("div", {
|
|
130
|
+
key: 0,
|
|
131
|
+
class: f([[e.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-secondary"], "fm-typo-en-body-md-400"])
|
|
132
|
+
}, F(B(r)("inventory.formField.dropField.accepts", { fileTypes: e.accept })), 3)) : S("", !0)
|
|
133
|
+
], !0),
|
|
134
|
+
p("input", {
|
|
135
|
+
accept: e.accept,
|
|
136
|
+
disabled: e.disabled,
|
|
137
|
+
class: "fm-droppable-field__input",
|
|
138
|
+
type: "file",
|
|
139
|
+
onChange: _
|
|
140
|
+
}, null, 40, K)
|
|
141
|
+
], 34),
|
|
142
|
+
u(e.$slots, "helper-text", {}, () => [
|
|
143
|
+
p("div", {
|
|
144
|
+
class: f([[e.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-secondary"], "fm-typo-en-body-sm-400"])
|
|
145
|
+
}, F(B(r)("inventory.formField.dropField.maxSize", { size: e.maxFileSize })), 3)
|
|
146
|
+
], !0)
|
|
147
|
+
], !0)
|
|
148
|
+
], 512);
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
}), Z = /* @__PURE__ */ q(M, [["__scopeId", "data-v-2937afd0"]]);
|
|
152
|
+
export {
|
|
153
|
+
Z as F
|
|
154
|
+
};
|
|
@@ -1,54 +1,56 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import { G as g, u as E, K as R, M as B, x as U } from "./app-DYsP0gKj.js";
|
|
2
|
+
import { a as C, t as D } from "./rules-BiaGzhvQ.js";
|
|
3
|
+
import { u as H } from "./supplier-Dxb5ULjF.js";
|
|
4
|
+
import { P as T } from "./format-unit-display-C2P3mS8l.js";
|
|
5
|
+
import { computed as f, defineComponent as z, mergeModels as x, useModel as j, ref as q, resolveComponent as w, openBlock as L, createElementBlock as O, normalizeStyle as W, createElementVNode as I, createVNode as $, withCtx as K, createBlock as M, createCommentVNode as N, Fragment as J, renderList as Q, unref as V } from "vue";
|
|
6
|
+
import { F as X } from "./FmMultiselectDialog-BGhSjgbj.js";
|
|
7
|
+
function Y(e, r, a) {
|
|
6
8
|
var o;
|
|
7
|
-
if (!!
|
|
8
|
-
return
|
|
9
|
-
if (!
|
|
9
|
+
if (!!r.measurement === !!a && ((o = r.measurement) == null ? void 0 : o.id) === a)
|
|
10
|
+
return r;
|
|
11
|
+
if (!a)
|
|
10
12
|
return {
|
|
11
|
-
costPerUnit:
|
|
13
|
+
costPerUnit: r.costPerUnit
|
|
12
14
|
};
|
|
13
|
-
const n = e.measurements.find((p) => p.id ===
|
|
15
|
+
const n = e.measurements.find((p) => p.id === a);
|
|
14
16
|
return n ? {
|
|
15
|
-
costPerUnit:
|
|
17
|
+
costPerUnit: r.costPerUnit,
|
|
16
18
|
measurement: n
|
|
17
19
|
} : {
|
|
18
|
-
costPerUnit:
|
|
20
|
+
costPerUnit: r.costPerUnit
|
|
19
21
|
};
|
|
20
22
|
}
|
|
21
|
-
function
|
|
23
|
+
function re(e, r, a, u) {
|
|
22
24
|
var P, _, s;
|
|
23
|
-
const
|
|
25
|
+
const i = (s = (_ = (P = u == null ? void 0 : u.supplier) == null ? void 0 : P.supplyItems) == null ? void 0 : _.find(
|
|
24
26
|
(t) => t.skuId === e._id
|
|
25
27
|
)) == null ? void 0 : s.defaultCost;
|
|
26
28
|
if (u != null && u.manualTotalCost)
|
|
27
29
|
return {
|
|
28
30
|
cost: u.manualTotalCost,
|
|
29
31
|
skuDefaultCost: e.defaultCost ?? void 0,
|
|
30
|
-
supplierOverrideCost:
|
|
32
|
+
supplierOverrideCost: i ?? void 0
|
|
31
33
|
};
|
|
32
|
-
const n = e.defaultCost ?
|
|
34
|
+
const n = e.defaultCost ? Y(e.unit, e.defaultCost, e.trackingMeasurement) : void 0, o = i ?? n, p = o == null ? void 0 : o.costPerUnit, v = p ? o != null && o.measurement ? +C(p) / +C(o == null ? void 0 : o.measurement.conversion) : +C(p) : void 0, b = v ? a ? v * +C(a.conversion) : v : void 0, h = b ? +C(r) * b : void 0;
|
|
33
35
|
return {
|
|
34
36
|
cost: h ? {
|
|
35
|
-
...
|
|
36
|
-
currency:
|
|
37
|
+
...D(h ?? 0, 2),
|
|
38
|
+
currency: g()
|
|
37
39
|
} : {
|
|
38
40
|
amount: 0,
|
|
39
41
|
precision: 0,
|
|
40
|
-
currency:
|
|
42
|
+
currency: g()
|
|
41
43
|
},
|
|
42
44
|
skuDefaultCost: e.defaultCost ?? void 0,
|
|
43
|
-
supplierOverrideCost:
|
|
45
|
+
supplierOverrideCost: i ?? void 0
|
|
44
46
|
};
|
|
45
47
|
}
|
|
46
48
|
function k(e) {
|
|
47
|
-
const
|
|
48
|
-
if (
|
|
49
|
+
const r = B.safeParse(e);
|
|
50
|
+
if (r.success) return r.data;
|
|
49
51
|
throw new Error("Invalid supplier data");
|
|
50
52
|
}
|
|
51
|
-
function
|
|
53
|
+
function S(e) {
|
|
52
54
|
return {
|
|
53
55
|
_id: e.doc._id,
|
|
54
56
|
internal: e.type,
|
|
@@ -67,17 +69,17 @@ function F(e) {
|
|
|
67
69
|
preparationTime: e.preparationTime
|
|
68
70
|
};
|
|
69
71
|
}
|
|
70
|
-
function
|
|
71
|
-
const
|
|
72
|
+
function ae(e, r, a = !1, u = !1) {
|
|
73
|
+
const i = H(), n = E();
|
|
72
74
|
n.watchLocation(async () => {
|
|
73
75
|
var y;
|
|
74
|
-
await
|
|
76
|
+
await i.readSuppliers();
|
|
75
77
|
const s = e();
|
|
76
78
|
if ((y = s.supplier) != null && y._id) return;
|
|
77
|
-
const t = u ?
|
|
78
|
-
|
|
79
|
+
const t = u ? i.suppliers[0] : i.businessSuppliers[0], l = (a ? n.locations.filter((d) => d.doc._id !== n.currentLocation.doc._id) : n.locations)[0];
|
|
80
|
+
r({
|
|
79
81
|
...s,
|
|
80
|
-
supplier: t ? k(t) :
|
|
82
|
+
supplier: t ? k(t) : l ? S(l) : s.supplier
|
|
81
83
|
});
|
|
82
84
|
});
|
|
83
85
|
const o = f(
|
|
@@ -93,39 +95,39 @@ function ne(e, a, r = !1, u = !1) {
|
|
|
93
95
|
set(s) {
|
|
94
96
|
const t = e() ?? {};
|
|
95
97
|
if (o.value === T.PURCHASE) {
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
+
const F = (u ? i.suppliers : i.businessSuppliers).find((A) => A._id === s);
|
|
99
|
+
r({
|
|
98
100
|
...t,
|
|
99
|
-
supplier:
|
|
101
|
+
supplier: F ? k(F) : t.supplier
|
|
100
102
|
});
|
|
101
103
|
return;
|
|
102
104
|
}
|
|
103
|
-
const y = (
|
|
105
|
+
const y = (a ? n.allLocations.filter(
|
|
104
106
|
(d) => d.doc._id !== n.currentLocation.doc._id
|
|
105
107
|
) : n.allLocations).find((d) => d.doc._id === s);
|
|
106
|
-
|
|
108
|
+
r({
|
|
107
109
|
...t,
|
|
108
|
-
supplier: y ?
|
|
110
|
+
supplier: y ? S(y) : t.supplier
|
|
109
111
|
});
|
|
110
112
|
}
|
|
111
|
-
}), v = f(() =>
|
|
113
|
+
}), v = f(() => i.locationSuppliers.map(k)), b = f(() => i.businessSuppliers.map(k)), h = f(() => {
|
|
112
114
|
const s = [...v.value], t = [...b.value];
|
|
113
115
|
return u ? [...t, ...s] : t;
|
|
114
116
|
}), c = f(() => {
|
|
115
117
|
var m;
|
|
116
118
|
const s = ((m = n._currentLocation) == null ? void 0 : m.type) === R.warehouse;
|
|
117
|
-
return (
|
|
118
|
-
(
|
|
119
|
-
) : n.allLocations).filter((
|
|
119
|
+
return (a ? n.allLocations.filter(
|
|
120
|
+
(l) => l.doc._id !== n.currentLocation.doc._id
|
|
121
|
+
) : n.allLocations).filter((l) => s || l.acceptRequest).map(S);
|
|
120
122
|
}), P = f(() => {
|
|
121
123
|
if (o.value === T.PURCHASE) {
|
|
122
|
-
const t = v.value.map((
|
|
123
|
-
label:
|
|
124
|
-
value:
|
|
125
|
-
})), m = b.value.map((
|
|
126
|
-
label:
|
|
124
|
+
const t = v.value.map((l) => ({
|
|
125
|
+
label: l.name,
|
|
126
|
+
value: l._id
|
|
127
|
+
})), m = b.value.map((l) => ({
|
|
128
|
+
label: l.name,
|
|
127
129
|
sublabel: "Business supplier",
|
|
128
|
-
value:
|
|
130
|
+
value: l._id
|
|
129
131
|
}));
|
|
130
132
|
return u ? [...t, ...m] : m;
|
|
131
133
|
}
|
|
@@ -135,14 +137,14 @@ function ne(e, a, r = !1, u = !1) {
|
|
|
135
137
|
value: t._id
|
|
136
138
|
}));
|
|
137
139
|
}), _ = f(() => {
|
|
138
|
-
var
|
|
139
|
-
const s = (y = (
|
|
140
|
+
var l, y;
|
|
141
|
+
const s = (y = (l = e()) == null ? void 0 : l.supplier) == null ? void 0 : y._id;
|
|
140
142
|
if (o.value === T.PURCHASE) {
|
|
141
|
-
const d =
|
|
143
|
+
const d = i.suppliers.find((F) => F._id === s);
|
|
142
144
|
return d ? k(d) : null;
|
|
143
145
|
}
|
|
144
146
|
const m = n.allLocations.find((d) => d.doc._id);
|
|
145
|
-
return m ?
|
|
147
|
+
return m ? S(m) : null;
|
|
146
148
|
});
|
|
147
149
|
return {
|
|
148
150
|
transferLocationModel: p,
|
|
@@ -153,9 +155,9 @@ function ne(e, a, r = !1, u = !1) {
|
|
|
153
155
|
selectedLocation: _
|
|
154
156
|
};
|
|
155
157
|
}
|
|
156
|
-
const Z = { class: "overflow-y-auto h-full pb-8" },
|
|
158
|
+
const Z = { class: "overflow-y-auto h-full pb-8" }, ie = /* @__PURE__ */ z({
|
|
157
159
|
__name: "FmFilterableMenuOptions",
|
|
158
|
-
props: /* @__PURE__ */
|
|
160
|
+
props: /* @__PURE__ */ x({
|
|
159
161
|
modelValue: {},
|
|
160
162
|
maxHeight: {},
|
|
161
163
|
width: {},
|
|
@@ -168,52 +170,52 @@ const Z = { class: "overflow-y-auto h-full pb-8" }, ae = /* @__PURE__ */ j({
|
|
|
168
170
|
}),
|
|
169
171
|
emits: ["update:search"],
|
|
170
172
|
setup(e) {
|
|
171
|
-
const
|
|
172
|
-
() => new
|
|
173
|
+
const r = e, a = j(e, "search"), u = f(
|
|
174
|
+
() => new X(r.items, ["label", "sublabel"], {
|
|
173
175
|
caseSensitive: !1,
|
|
174
176
|
sort: !0
|
|
175
177
|
})
|
|
176
|
-
),
|
|
178
|
+
), i = f(() => u.value.search(a.value)), n = q();
|
|
177
179
|
return console.log({ stickyRef: n }), (o, p) => {
|
|
178
180
|
const v = w("FmButton"), b = w("FmTextField"), h = w("FmMenuItem");
|
|
179
181
|
return L(), O("div", {
|
|
180
182
|
class: "relative",
|
|
181
|
-
style:
|
|
183
|
+
style: W({ width: o.width })
|
|
182
184
|
}, [
|
|
183
|
-
|
|
185
|
+
I("div", {
|
|
184
186
|
class: "sticky top-0 bg-white mb-8",
|
|
185
187
|
ref_key: "stickyRef",
|
|
186
188
|
ref: n
|
|
187
189
|
}, [
|
|
188
|
-
|
|
189
|
-
modelValue:
|
|
190
|
-
"onUpdate:modelValue": p[1] || (p[1] = (c) =>
|
|
190
|
+
$(b, {
|
|
191
|
+
modelValue: a.value,
|
|
192
|
+
"onUpdate:modelValue": p[1] || (p[1] = (c) => a.value = c),
|
|
191
193
|
placeholder: "Filter options"
|
|
192
194
|
}, {
|
|
193
|
-
append:
|
|
194
|
-
|
|
195
|
+
append: K(() => [
|
|
196
|
+
a.value ? (L(), M(v, {
|
|
195
197
|
key: 0,
|
|
196
198
|
variant: "tertiary",
|
|
197
199
|
"prepend-icon": "close",
|
|
198
|
-
onClick: p[0] || (p[0] = (c) =>
|
|
199
|
-
})) :
|
|
200
|
+
onClick: p[0] || (p[0] = (c) => a.value = "")
|
|
201
|
+
})) : N("", !0)
|
|
200
202
|
]),
|
|
201
203
|
_: 1
|
|
202
204
|
}, 8, ["modelValue"])
|
|
203
205
|
], 512),
|
|
204
|
-
|
|
205
|
-
(L(!0), O(J, null,
|
|
206
|
+
I("div", Z, [
|
|
207
|
+
(L(!0), O(J, null, Q(i.value, (c, P) => (L(), M(h, {
|
|
206
208
|
key: P,
|
|
207
209
|
label: c.label,
|
|
208
210
|
sublabel: c.sublabel,
|
|
209
|
-
"model-value":
|
|
210
|
-
onClick: () => o.handleItemChange(
|
|
211
|
+
"model-value": V(U)(o.modelValue, c.value),
|
|
212
|
+
onClick: () => o.handleItemChange(V(U)(o.modelValue, c.value), c),
|
|
211
213
|
onVnodeMounted: (_) => {
|
|
212
214
|
var s, t;
|
|
213
|
-
return
|
|
215
|
+
return V(U)(o.modelValue, c.value) && ((s = _.el) == null || s.scrollIntoView({ behavior: "instant", block: "end" }), (t = _.el) == null || t.scrollIntoView({ behavior: "smooth", block: "center" })), void 0;
|
|
214
216
|
}
|
|
215
217
|
}, null, 8, ["label", "sublabel", "model-value", "onClick", "onVnodeMounted"]))), 128)),
|
|
216
|
-
|
|
218
|
+
i.value.length ? N("", !0) : (L(), M(h, {
|
|
217
219
|
key: 0,
|
|
218
220
|
disabled: "",
|
|
219
221
|
label: "No options available"
|
|
@@ -224,7 +226,7 @@ const Z = { class: "overflow-y-auto h-full pb-8" }, ae = /* @__PURE__ */ j({
|
|
|
224
226
|
}
|
|
225
227
|
});
|
|
226
228
|
export {
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
229
|
+
ie as _,
|
|
230
|
+
re as c,
|
|
231
|
+
ae as u
|
|
230
232
|
};
|