@feedmepos/mf-inventory-portal 0.0.22-dev.7 → 0.0.22-dev.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ApprovalView-B9s4exkr.js → ApprovalView-BNeTV3TV.js} +4 -4
- package/dist/{BindingsDialog-uksEDFFX.js → BindingsDialog-pBelBtiH.js} +1 -1
- package/dist/{BindingsPicker-B2rQ9kJH.js → BindingsPicker-VHr76FFM.js} +19 -19
- package/dist/{BindingsTable-BLN_bAjO.js → BindingsTable-CgIp6DKB.js} +1 -1
- package/dist/{ClosingTemplateView-Bi06Gxzo.js → ClosingTemplateView-FleQasJi.js} +34 -34
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CeBoTYGq.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BYfojQsH.js} +1 -1
- package/dist/{IngredientsView-DY6yY-Fk.js → IngredientsView-BEW8_MJ0.js} +3 -3
- package/dist/{IntegrationView-C74CJ4PS.js → IntegrationView-NnpJ8nYO.js} +2 -2
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BmsbeAvi.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CJMb1aR1.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-RoZStI7P.js → PremiumBadge.vue_vue_type_script_setup_true_lang-DWSq3JsJ.js} +1 -1
- package/dist/{PurchaseOrderPrintPreview-Dn5CQDnd.js → PurchaseOrderPrintPreview-BZ5uhyRy.js} +1 -1
- package/dist/{ReceiveRequestView-BC61WMFL.js → ReceiveRequestView-DN9u5HLn.js} +6 -6
- package/dist/{RecipeView-DYbuUEFK.js → RecipeView-DM20cOk3.js} +3 -3
- package/dist/{StockView-D_ZzX7yp.js → StockView-LppKR-nM.js} +6 -6
- package/dist/{SupplierView-ChewCZKN.js → SupplierView-DHh6MhoI.js} +37 -37
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-KHwccWdi.js +754 -0
- package/dist/TransferDialog.vue_vue_type_script_setup_true_lang-2QZK3Iu5.js +1485 -0
- package/dist/TransferTemplateView-CUQSQR8U.js +1278 -0
- package/dist/{UnitView-Cx1xe3Wg.js → UnitView-D8XJca7H.js} +4 -4
- package/dist/{WarehouseView-CQQf0YFc.js → WarehouseView-DTnx3-Fi.js} +2 -2
- package/dist/api/inventory.d.ts +1 -0
- package/dist/api/netsuite.d.ts +40 -0
- package/dist/api/purchase-order-template.d.ts +0 -4
- package/dist/{app-emo4vLKK.js → app-Cn0UYdAW.js} +8192 -7963
- package/dist/app.d.ts +6 -0
- package/dist/app.js +3 -3
- package/dist/{decimal-BO9I7LUt.js → decimal-BiLgcnqq.js} +1 -1
- package/dist/{defineDeepModel-D06lO_R2.js → defineDeepModel-CXCb8GcR.js} +4 -4
- package/dist/{format-time-from-id-HTOA-soi.js → format-time-from-id-5QzQNKlI.js} +1 -1
- package/dist/{id-to-date-DAnKDcfC.js → id-to-date-C-LYuoim.js} +1 -1
- package/dist/purchase-order-transaction-type-BV80Rx9h.js +676 -0
- package/dist/stores/api.d.ts +1 -0
- package/dist/stores/helper/core-store-proxy.d.ts +27 -0
- package/dist/stores/helper/generate-backend-urls.d.ts +1 -0
- package/dist/stores/netsuite.d.ts +49 -0
- package/dist/style.css +1 -1
- package/dist/{supplier-CBf_J6D6.js → supplier-Bg9MjX_y.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-template-enabled-locations-2-Bo3g55rA.js → use-template-enabled-locations-2-CzY-UFrc.js} +1 -1
- package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +14 -0
- package/dist/views/receive-request/composables/use-receive-request-form.d.ts +42 -0
- package/dist/views/receive-request/composables/use-receive-request-table.d.ts +42 -0
- package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-locations.d.ts +2 -2
- package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +84 -0
- package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +28 -986
- package/dist/views/transfer-template/helpers/remove-deleted-skus.helper.d.ts +7 -0
- package/dist/{xlsx-DX8dk9eD.js → xlsx-BsdfXPiA.js} +1 -1
- package/dist/{xlsx.util-BaeMOrlY.js → xlsx.util-B_ynXZ3Q.js} +2 -2
- package/package.json +5 -5
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-CXmk2PYd.js +0 -740
- package/dist/TransferDialog.vue_vue_type_script_setup_true_lang-D9XERa2u.js +0 -1409
- package/dist/TransferTemplateView-BIsn4jRY.js +0 -1238
- package/dist/purchase-order-transaction-type-73S8OLUt.js +0 -702
|
@@ -0,0 +1,1278 @@
|
|
|
1
|
+
import { defineComponent as J, onMounted as be, computed as M, ref as U, watch as _e, inject as Ye, resolveComponent as R, openBlock as D, createElementBlock as z, createElementVNode as o, createVNode as c, withCtx as O, renderSlot as Ae, withDirectives as Re, normalizeClass as ce, vModelText as Ie, reactive as We, h as Z, toDisplayString as F, unref as e, createBlock as j, isRef as Ue, createCommentVNode as se, Fragment as ye, renderList as Le, normalizeStyle as Ke, Teleport as Ze, mergeProps as Ve, normalizeProps as Je, guardReactiveProps as Xe } from "vue";
|
|
2
|
+
import { u as et, _ as tt, a as ot } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BYfojQsH.js";
|
|
3
|
+
import { useI18n as K } from "@feedmepos/mf-common";
|
|
4
|
+
import { P as q, a as nt, f as st, b as Oe, c as lt } from "./purchase-order-transaction-type-BV80Rx9h.js";
|
|
5
|
+
import { F as le, R as Pe } from "./row-action.enum-PMKMRrZR.js";
|
|
6
|
+
import { a0 as fe, t as Be, I as at, a1 as rt, a2 as it, a as H, D as Ee, R as ve, a3 as ut, a4 as dt, r as me, a5 as mt, l as ct, A as qe, M as pt, b as xe, u as ft, j as pe, y as Ne, k as yt, a6 as ue, a7 as vt, G as bt, a8 as _t } from "./app-Cn0UYdAW.js";
|
|
7
|
+
import { components as de, useDialog as ze, useSnackbar as xt, useProxiedModel as He, useBreakpoints as ht } from "@feedmepos/ui-library";
|
|
8
|
+
import { storeToRefs as gt } from "pinia";
|
|
9
|
+
import { d as je } from "./defineDeepModel-CXCb8GcR.js";
|
|
10
|
+
import { c as wt, u as kt, _ as Tt } from "./TransferDialog.vue_vue_type_script_setup_true_lang-2QZK3Iu5.js";
|
|
11
|
+
import { useRouter as Ft } from "vue-router";
|
|
12
|
+
import { u as Ct } from "./supplier-Bg9MjX_y.js";
|
|
13
|
+
import { F as N, _ as Qe } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
|
|
14
|
+
import { _ as St } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-DWSq3JsJ.js";
|
|
15
|
+
import { u as $t } from "./use-template-enabled-locations-2-CzY-UFrc.js";
|
|
16
|
+
import { f as Mt } from "./format-time-from-id-5QzQNKlI.js";
|
|
17
|
+
const Dt = { class: "flex flex-col" }, At = { class: "flex flex-col" }, Rt = { class: "flex-1" }, It = { class: "flex items-center" }, Lt = { class: "flex-1" }, Vt = { class: "flex-1" }, Ot = /* @__PURE__ */ J({
|
|
18
|
+
__name: "FmMinMaxInput",
|
|
19
|
+
props: {
|
|
20
|
+
rules: {},
|
|
21
|
+
label: {},
|
|
22
|
+
minPlaceholder: {},
|
|
23
|
+
maxPlaceholder: {},
|
|
24
|
+
modelValue: {},
|
|
25
|
+
precision: {},
|
|
26
|
+
minLength: {},
|
|
27
|
+
maxLength: {},
|
|
28
|
+
inputmode: {},
|
|
29
|
+
type: {},
|
|
30
|
+
readonly: { type: Boolean },
|
|
31
|
+
labelMark: {},
|
|
32
|
+
prependIcon: {},
|
|
33
|
+
appendIcon: {},
|
|
34
|
+
showValidBorder: { type: Boolean },
|
|
35
|
+
labelInfo: {},
|
|
36
|
+
showWordCount: { type: Boolean },
|
|
37
|
+
invalid: { type: Boolean },
|
|
38
|
+
autofocus: { type: Boolean },
|
|
39
|
+
formatter: { type: Function },
|
|
40
|
+
decimal: {},
|
|
41
|
+
datalist: {},
|
|
42
|
+
shiftDatalist: { type: Boolean },
|
|
43
|
+
datalistMaxHeight: {},
|
|
44
|
+
datalistMinHeight: {},
|
|
45
|
+
offsetDatalist: {},
|
|
46
|
+
datalistPlacement: {},
|
|
47
|
+
datalistZIndex: {},
|
|
48
|
+
datalistWidth: {},
|
|
49
|
+
disabled: { type: Boolean },
|
|
50
|
+
focused: { type: Boolean },
|
|
51
|
+
helperText: {},
|
|
52
|
+
helperState: {}
|
|
53
|
+
},
|
|
54
|
+
setup(m) {
|
|
55
|
+
const b = m, d = je("modelValue"), n = at();
|
|
56
|
+
be(() => {
|
|
57
|
+
const { min: f, max: u } = d ?? {};
|
|
58
|
+
if (!(!f || !u) && f.precision !== u.precision) {
|
|
59
|
+
const a = Math.max(f.precision, u.precision), t = fe(f, a), l = fe(u, a);
|
|
60
|
+
d.min = t, d.max = l;
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
const y = M(() => {
|
|
64
|
+
const { min: f, max: u } = d ?? {};
|
|
65
|
+
return Math.max((f == null ? void 0 : f.precision) ?? 0, (u == null ? void 0 : u.precision) ?? 0, b.precision ?? 0);
|
|
66
|
+
}), p = M(() => ({
|
|
67
|
+
...d
|
|
68
|
+
})), s = (f) => {
|
|
69
|
+
if (!f) return "";
|
|
70
|
+
const u = rt(f), a = y.value, t = fe(u, a);
|
|
71
|
+
return it(
|
|
72
|
+
+H(t),
|
|
73
|
+
t.precision
|
|
74
|
+
);
|
|
75
|
+
}, r = U(s(d.min)), x = U(s(d.max));
|
|
76
|
+
_e([r, x], ([f, u]) => {
|
|
77
|
+
const a = d ?? {}, t = n(f), l = n(u), i = y.value;
|
|
78
|
+
if (f !== "" && t === !0) {
|
|
79
|
+
const _ = Be(+f, i);
|
|
80
|
+
a.min = _;
|
|
81
|
+
} else
|
|
82
|
+
a.min = null;
|
|
83
|
+
if (u !== "" && l === !0) {
|
|
84
|
+
const _ = Be(+u, i);
|
|
85
|
+
a.max = _;
|
|
86
|
+
} else
|
|
87
|
+
a.max = null;
|
|
88
|
+
d.min = a.min, d.max = a.max;
|
|
89
|
+
});
|
|
90
|
+
const v = Symbol.for("fm:form-state"), w = Ye(v, null), I = M(() => b.disabled ?? (w == null ? void 0 : w.getDisabled()) ?? !1), $ = U(), k = U(), h = U(!1), C = U(!1), L = M(() => h.value || C.value), P = M(() => [...[
|
|
91
|
+
function() {
|
|
92
|
+
return typeof n(r.value) == "string" || typeof n(x.value) == "string" ? "Must be a number" : !0;
|
|
93
|
+
},
|
|
94
|
+
function(a) {
|
|
95
|
+
return !a || !a.min || !a.max ? !0 : +H(a.min) > +H(a.max) ? "Min must be less than or equal to max" : !0;
|
|
96
|
+
}
|
|
97
|
+
], ...b.rules ?? []]);
|
|
98
|
+
return (f, u) => {
|
|
99
|
+
const a = R("FmLabel"), t = R("FmField"), l = R("FmFormGroup");
|
|
100
|
+
return D(), z("div", Dt, [
|
|
101
|
+
o("div", At, [
|
|
102
|
+
o("div", Rt, [
|
|
103
|
+
c(a, {
|
|
104
|
+
label: f.label,
|
|
105
|
+
disabled: f.disabled,
|
|
106
|
+
required: f.labelMark === "required",
|
|
107
|
+
optional: f.labelMark === "optional"
|
|
108
|
+
}, null, 8, ["label", "disabled", "required", "optional"])
|
|
109
|
+
]),
|
|
110
|
+
c(t, { focused: L.value }, {
|
|
111
|
+
default: O(() => [
|
|
112
|
+
o("div", It, [
|
|
113
|
+
Ae(f.$slots, "prepend"),
|
|
114
|
+
u[6] || (u[6] = o("div", { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400 pr-4" }, "Min.", -1)),
|
|
115
|
+
o("div", Lt, [
|
|
116
|
+
Re(o("input", {
|
|
117
|
+
type: "text",
|
|
118
|
+
ref_key: "minInputRef",
|
|
119
|
+
ref: $,
|
|
120
|
+
onFocus: u[0] || (u[0] = () => h.value = !0),
|
|
121
|
+
onBlur: u[1] || (u[1] = () => h.value = !1),
|
|
122
|
+
"onUpdate:modelValue": u[2] || (u[2] = (i) => r.value = i),
|
|
123
|
+
class: ce({
|
|
124
|
+
"fm-text-field--input fm-typo-en-body-lg-400": !0,
|
|
125
|
+
"text-fm-color-typo-primary": !I.value,
|
|
126
|
+
"text-fm-color-typo-disabled": I.value
|
|
127
|
+
})
|
|
128
|
+
}, null, 34), [
|
|
129
|
+
[Ie, r.value]
|
|
130
|
+
])
|
|
131
|
+
]),
|
|
132
|
+
u[7] || (u[7] = o("div", { class: "block h-32 mx-4 w-[1px] bg-fm-color-neutral-gray-200" }, null, -1)),
|
|
133
|
+
u[8] || (u[8] = o("div", { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400 pr-4" }, "Max.", -1)),
|
|
134
|
+
o("div", Vt, [
|
|
135
|
+
Re(o("input", {
|
|
136
|
+
type: "text",
|
|
137
|
+
ref_key: "maxInputRef",
|
|
138
|
+
ref: k,
|
|
139
|
+
onFocus: u[3] || (u[3] = () => C.value = !0),
|
|
140
|
+
onBlur: u[4] || (u[4] = () => C.value = !1),
|
|
141
|
+
"onUpdate:modelValue": u[5] || (u[5] = (i) => x.value = i),
|
|
142
|
+
class: ce({
|
|
143
|
+
"fm-text-field--input fm-typo-en-body-lg-400": !0,
|
|
144
|
+
"text-fm-color-typo-primary": !I.value,
|
|
145
|
+
"text-fm-color-typo-disabled": I.value
|
|
146
|
+
})
|
|
147
|
+
}, null, 34), [
|
|
148
|
+
[Ie, x.value]
|
|
149
|
+
])
|
|
150
|
+
]),
|
|
151
|
+
Ae(f.$slots, "append")
|
|
152
|
+
])
|
|
153
|
+
]),
|
|
154
|
+
_: 3
|
|
155
|
+
}, 8, ["focused"])
|
|
156
|
+
]),
|
|
157
|
+
c(l, {
|
|
158
|
+
class: "flex-1",
|
|
159
|
+
"model-value": p.value,
|
|
160
|
+
info: f.labelInfo,
|
|
161
|
+
rules: P.value,
|
|
162
|
+
"helper-text": f.helperText,
|
|
163
|
+
"helper-state": f.helperState
|
|
164
|
+
}, null, 8, ["model-value", "info", "rules", "helper-text", "helper-state"])
|
|
165
|
+
]);
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
function Pt() {
|
|
170
|
+
return function(b) {
|
|
171
|
+
return !b || !b.min || !b.max ? "Required" : !0;
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
function Bt(m, b) {
|
|
175
|
+
return function(n) {
|
|
176
|
+
return !n || !n.min || !n.max ? !0 : +H(n.min) < m ? `Must be between ${m} and ${b}` : +H(n.max) > b ? `Must be between ${m} and ${b}` : !0;
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
var A = /* @__PURE__ */ ((m) => (m.Code = "Code", m.Name = "Name", m.DefaultAmount = "DefaultAmount", m.Limit = "Limit", m.MinimumAmount = "MinimumAmount", m.Step = "Step", m.Cost = "Cost", m.Delete = "Delete", m))(A || {});
|
|
180
|
+
function Et(m) {
|
|
181
|
+
const { t: b } = K(), d = We({});
|
|
182
|
+
be(() => {
|
|
183
|
+
for (const p of m.items) {
|
|
184
|
+
if (!p.totalCost)
|
|
185
|
+
continue;
|
|
186
|
+
const s = wt(p.sku, p.quantity, p.measurement, {
|
|
187
|
+
supplier: m.supplier
|
|
188
|
+
}), r = p.totalCost ?? Ee.reset();
|
|
189
|
+
s ? d[p.sku._id] = s.amount !== r.amount || s.precision !== r.precision : d[p.sku._id] = !0;
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
const n = [
|
|
193
|
+
{
|
|
194
|
+
id: "Code",
|
|
195
|
+
header: () => b("inventory.transfer.form.items.table.Code"),
|
|
196
|
+
accessorKey: "code",
|
|
197
|
+
size: 96,
|
|
198
|
+
cell(p) {
|
|
199
|
+
const s = p.row.original;
|
|
200
|
+
return Z(de.FmTextField, {
|
|
201
|
+
modelValue: s.code,
|
|
202
|
+
"onUpdate:modelValue": (r) => {
|
|
203
|
+
m.updateItem({
|
|
204
|
+
...s,
|
|
205
|
+
code: r
|
|
206
|
+
});
|
|
207
|
+
},
|
|
208
|
+
key: s.sku._id,
|
|
209
|
+
rules: [ve()],
|
|
210
|
+
labelMark: "required"
|
|
211
|
+
});
|
|
212
|
+
},
|
|
213
|
+
enableSorting: !1
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
id: "Name",
|
|
217
|
+
header: () => b("inventory.transfer.form.items.table.Name"),
|
|
218
|
+
minSize: 300,
|
|
219
|
+
cell(p) {
|
|
220
|
+
const s = p.row.original;
|
|
221
|
+
return Z(de.FmTextField, {
|
|
222
|
+
modelValue: s.name,
|
|
223
|
+
"onUpdate:modelValue": (r) => {
|
|
224
|
+
m.updateItem({
|
|
225
|
+
...s,
|
|
226
|
+
name: r
|
|
227
|
+
});
|
|
228
|
+
},
|
|
229
|
+
key: s.sku._id,
|
|
230
|
+
rules: [ve()],
|
|
231
|
+
labelMark: "required"
|
|
232
|
+
});
|
|
233
|
+
},
|
|
234
|
+
enableSorting: !1
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
id: "DefaultAmount",
|
|
238
|
+
header: () => b("inventory.transfer.form.items.table.DefaultAmount2"),
|
|
239
|
+
minSize: 200,
|
|
240
|
+
cell(p) {
|
|
241
|
+
const s = p.row.original;
|
|
242
|
+
return Z(ut, {
|
|
243
|
+
style: {
|
|
244
|
+
flex: "1 1 0%"
|
|
245
|
+
},
|
|
246
|
+
modelValue: {
|
|
247
|
+
amount: s.quantity ?? { amount: 1, precision: 0 },
|
|
248
|
+
measurement: s.measurement ?? null
|
|
249
|
+
},
|
|
250
|
+
disabled: m.disabled,
|
|
251
|
+
key: s.sku._id,
|
|
252
|
+
unit: s.sku.unit,
|
|
253
|
+
"onUpdate:modelValue": (r) => {
|
|
254
|
+
m.updateItem({
|
|
255
|
+
...s,
|
|
256
|
+
quantity: r.amount,
|
|
257
|
+
measurement: r.measurement
|
|
258
|
+
});
|
|
259
|
+
},
|
|
260
|
+
rules: [
|
|
261
|
+
dt(
|
|
262
|
+
+H(
|
|
263
|
+
s.minimumQuantity ?? {
|
|
264
|
+
amount: 1,
|
|
265
|
+
precision: me(s.sku.unit, s.measurement)
|
|
266
|
+
}
|
|
267
|
+
)
|
|
268
|
+
),
|
|
269
|
+
mt(
|
|
270
|
+
s.maximumQuantity ? +H(s.maximumQuantity) : 1 / 0
|
|
271
|
+
)
|
|
272
|
+
],
|
|
273
|
+
applyDefaultRules: !0
|
|
274
|
+
});
|
|
275
|
+
},
|
|
276
|
+
enableSorting: !1
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
id: "Limit",
|
|
280
|
+
header: () => "Limit",
|
|
281
|
+
// TODO: i18n,
|
|
282
|
+
minSize: 280,
|
|
283
|
+
cell(p) {
|
|
284
|
+
const s = p.row.original;
|
|
285
|
+
return Z(Ot, {
|
|
286
|
+
style: {
|
|
287
|
+
flex: "1 1 0%"
|
|
288
|
+
},
|
|
289
|
+
modelValue: {
|
|
290
|
+
min: s.minimumQuantity,
|
|
291
|
+
max: s.maximumQuantity
|
|
292
|
+
},
|
|
293
|
+
disabled: m.disabled,
|
|
294
|
+
key: s.sku._id,
|
|
295
|
+
unit: s.sku.unit,
|
|
296
|
+
"onUpdate:modelValue": (r) => {
|
|
297
|
+
const x = { ...s };
|
|
298
|
+
r != null && r.min && (x.minimumQuantity = r.min), r != null && r.max && (x.maximumQuantity = r.max), m.updateItem(x);
|
|
299
|
+
},
|
|
300
|
+
rules: [
|
|
301
|
+
Pt(),
|
|
302
|
+
Bt(
|
|
303
|
+
+H({
|
|
304
|
+
amount: 1,
|
|
305
|
+
precision: me(s.sku.unit, s.measurement)
|
|
306
|
+
}),
|
|
307
|
+
1 / 0
|
|
308
|
+
)
|
|
309
|
+
],
|
|
310
|
+
disableUnit: !0,
|
|
311
|
+
applyDefaultRules: !0
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
id: "Step",
|
|
317
|
+
header: () => b("inventory.transfer.form.items.table.Step"),
|
|
318
|
+
minSize: 100,
|
|
319
|
+
cell(p) {
|
|
320
|
+
const s = p.row.original;
|
|
321
|
+
return Z(de.FmTextField, {
|
|
322
|
+
modelValue: H(s.quantityStep ?? Ee.reset(), !1),
|
|
323
|
+
key: s.sku._id,
|
|
324
|
+
"onUpdate:modelValue": (r) => {
|
|
325
|
+
m.updateItem({
|
|
326
|
+
...s,
|
|
327
|
+
quantityStep: ct(+r)
|
|
328
|
+
});
|
|
329
|
+
},
|
|
330
|
+
rules: [
|
|
331
|
+
qe({
|
|
332
|
+
amount: 1,
|
|
333
|
+
precision: me(s.sku.unit, s.measurement)
|
|
334
|
+
}),
|
|
335
|
+
pt(s.sku.unit, s.measurement)
|
|
336
|
+
]
|
|
337
|
+
});
|
|
338
|
+
},
|
|
339
|
+
enableSorting: !1
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
id: "Delete",
|
|
343
|
+
header: "",
|
|
344
|
+
cell(p) {
|
|
345
|
+
const s = p.row.original;
|
|
346
|
+
return Z(de.FmButton, {
|
|
347
|
+
class: "delete-button",
|
|
348
|
+
key: s.sku._id,
|
|
349
|
+
type: "button",
|
|
350
|
+
icon: "delete",
|
|
351
|
+
variant: "tertiary",
|
|
352
|
+
size: "md",
|
|
353
|
+
disabled: m.disabled,
|
|
354
|
+
onClick: () => {
|
|
355
|
+
m.deleteItem(s);
|
|
356
|
+
}
|
|
357
|
+
});
|
|
358
|
+
},
|
|
359
|
+
enableSorting: !1,
|
|
360
|
+
size: 40,
|
|
361
|
+
meta: {
|
|
362
|
+
cellClass: "",
|
|
363
|
+
headerClass: ""
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
];
|
|
367
|
+
return {
|
|
368
|
+
columnDefs: M(() => xe().enableTotalCost && m.transferType === q.PURCHASE ? n : n.filter((s) => s.id !== "Cost"))
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
const Ut = { class: "flex flex-col gap-8 py-16" }, qt = { class: "flex items-center" }, Nt = { class: "flex-1 flex gap-1 items-center" }, zt = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Ht = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, jt = { class: "flex gap-8 w-full" }, Qt = { class: "flex-1 flex flex-col gap-4" }, Gt = { class: "flex-1 flex flex-col gap-4" }, Yt = { class: "flex gap-8 w-full" }, Wt = { class: "flex-1 flex flex-col gap-4" }, Kt = { class: "flex-1 flex flex-col gap-4" }, Zt = { class: "flex gap-8 w-full" }, Jt = { class: "flex-1 flex flex-col gap-4" }, Xt = { class: "flex-1 flex flex-col gap-4" }, eo = /* @__PURE__ */ J({
|
|
372
|
+
__name: "TransferTemplateItem",
|
|
373
|
+
props: {
|
|
374
|
+
cellByColId: {},
|
|
375
|
+
row: {}
|
|
376
|
+
},
|
|
377
|
+
setup(m) {
|
|
378
|
+
const { t: b } = K();
|
|
379
|
+
return (d, n) => {
|
|
380
|
+
var p, s, r, x, v, w, I, $, k, h, C, L, P, f, u, a, t, l, i, _, S, g, B, V, T, E, Q, X, G, ee, Y, te, oe, W, ne;
|
|
381
|
+
const y = R("FmLabel");
|
|
382
|
+
return D(), z("div", Ut, [
|
|
383
|
+
o("div", qt, [
|
|
384
|
+
o("div", Nt, [
|
|
385
|
+
o("span", zt, " (" + F(d.row.original.sku.code) + ") ", 1),
|
|
386
|
+
o("span", Ht, F(d.row.original.sku.name), 1)
|
|
387
|
+
]),
|
|
388
|
+
o("div", null, [
|
|
389
|
+
c(e(N), {
|
|
390
|
+
render: (r = (s = (p = d.cellByColId.Delete) == null ? void 0 : p.column) == null ? void 0 : s.columnDef) == null ? void 0 : r.cell,
|
|
391
|
+
props: (v = (x = d.cellByColId.Delete) == null ? void 0 : x.getContext) == null ? void 0 : v.call(x)
|
|
392
|
+
}, null, 8, ["render", "props"])
|
|
393
|
+
])
|
|
394
|
+
]),
|
|
395
|
+
o("div", jt, [
|
|
396
|
+
o("div", Qt, [
|
|
397
|
+
c(y, {
|
|
398
|
+
label: e(b)(`inventory.transfer.form.items.table.${e(A).Code}`)
|
|
399
|
+
}, null, 8, ["label"]),
|
|
400
|
+
c(e(N), {
|
|
401
|
+
render: ($ = (I = (w = d.cellByColId[e(A).Code]) == null ? void 0 : w.column) == null ? void 0 : I.columnDef) == null ? void 0 : $.cell,
|
|
402
|
+
props: (h = (k = d.cellByColId[e(A).Code]) == null ? void 0 : k.getContext) == null ? void 0 : h.call(k)
|
|
403
|
+
}, null, 8, ["render", "props"]),
|
|
404
|
+
n[0] || (n[0] = o("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
405
|
+
]),
|
|
406
|
+
o("div", Gt, [
|
|
407
|
+
c(y, {
|
|
408
|
+
label: e(b)(`inventory.transfer.form.items.table.${e(A).Name}`)
|
|
409
|
+
}, null, 8, ["label"]),
|
|
410
|
+
c(e(N), {
|
|
411
|
+
render: (P = (L = (C = d.cellByColId[e(A).Name]) == null ? void 0 : C.column) == null ? void 0 : L.columnDef) == null ? void 0 : P.cell,
|
|
412
|
+
props: (u = (f = d.cellByColId[e(A).Name]) == null ? void 0 : f.getContext) == null ? void 0 : u.call(f)
|
|
413
|
+
}, null, 8, ["render", "props"]),
|
|
414
|
+
n[1] || (n[1] = o("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
415
|
+
])
|
|
416
|
+
]),
|
|
417
|
+
o("div", Yt, [
|
|
418
|
+
o("div", Wt, [
|
|
419
|
+
c(y, {
|
|
420
|
+
label: e(b)(`inventory.transfer.form.items.table.${e(A).Limit}`)
|
|
421
|
+
}, null, 8, ["label"]),
|
|
422
|
+
c(e(N), {
|
|
423
|
+
render: (l = (t = (a = d.cellByColId[e(A).Limit]) == null ? void 0 : a.column) == null ? void 0 : t.columnDef) == null ? void 0 : l.cell,
|
|
424
|
+
props: (_ = (i = d.cellByColId[e(A).Limit]) == null ? void 0 : i.getContext) == null ? void 0 : _.call(i)
|
|
425
|
+
}, null, 8, ["render", "props"]),
|
|
426
|
+
n[2] || (n[2] = o("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
427
|
+
]),
|
|
428
|
+
o("div", Kt, [
|
|
429
|
+
c(y, {
|
|
430
|
+
label: e(b)(`inventory.transfer.form.items.table.${e(A).Step}`)
|
|
431
|
+
}, null, 8, ["label"]),
|
|
432
|
+
c(e(N), {
|
|
433
|
+
render: (B = (g = (S = d.cellByColId[e(A).Step]) == null ? void 0 : S.column) == null ? void 0 : g.columnDef) == null ? void 0 : B.cell,
|
|
434
|
+
props: (T = (V = d.cellByColId[e(A).Step]) == null ? void 0 : V.getContext) == null ? void 0 : T.call(V)
|
|
435
|
+
}, null, 8, ["render", "props"]),
|
|
436
|
+
n[3] || (n[3] = o("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
437
|
+
])
|
|
438
|
+
]),
|
|
439
|
+
o("div", Zt, [
|
|
440
|
+
o("div", Jt, [
|
|
441
|
+
c(y, {
|
|
442
|
+
label: e(b)(`inventory.transfer.form.items.table.${e(A).DefaultAmount}`)
|
|
443
|
+
}, null, 8, ["label"]),
|
|
444
|
+
c(e(N), {
|
|
445
|
+
render: (X = (Q = (E = d.cellByColId[e(A).DefaultAmount]) == null ? void 0 : E.column) == null ? void 0 : Q.columnDef) == null ? void 0 : X.cell,
|
|
446
|
+
props: (ee = (G = d.cellByColId[e(A).DefaultAmount]) == null ? void 0 : G.getContext) == null ? void 0 : ee.call(G)
|
|
447
|
+
}, null, 8, ["render", "props"]),
|
|
448
|
+
n[4] || (n[4] = o("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
449
|
+
]),
|
|
450
|
+
o("div", Xt, [
|
|
451
|
+
c(St, { "z-index": 50 }, {
|
|
452
|
+
default: O(() => [
|
|
453
|
+
c(y, {
|
|
454
|
+
label: e(b)(`inventory.transfer.form.items.table.${e(A).Cost}2`)
|
|
455
|
+
}, null, 8, ["label"])
|
|
456
|
+
]),
|
|
457
|
+
_: 1
|
|
458
|
+
}),
|
|
459
|
+
c(e(N), {
|
|
460
|
+
render: (oe = (te = (Y = d.cellByColId[e(A).Cost]) == null ? void 0 : Y.column) == null ? void 0 : te.columnDef) == null ? void 0 : oe.cell,
|
|
461
|
+
props: (ne = (W = d.cellByColId[e(A).Cost]) == null ? void 0 : W.getContext) == null ? void 0 : ne.call(W)
|
|
462
|
+
}, null, 8, ["render", "props"]),
|
|
463
|
+
n[5] || (n[5] = o("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
464
|
+
])
|
|
465
|
+
])
|
|
466
|
+
]);
|
|
467
|
+
};
|
|
468
|
+
}
|
|
469
|
+
}), to = { class: "flex flex-col gap-16" }, oo = { class: "flex flex-col gap-24" }, no = { class: "flex flex-col gap-16" }, so = { class: "flex items-center" }, lo = { class: "flex flex-col gap-16" }, ao = { class: "flex" }, ro = { class: "flex-1 gap-8 fm-typo-en-title-sm-800" }, io = /* @__PURE__ */ J({
|
|
470
|
+
__name: "TransferTemplateForm",
|
|
471
|
+
props: {
|
|
472
|
+
modelValue: {},
|
|
473
|
+
disabled: { type: Boolean }
|
|
474
|
+
},
|
|
475
|
+
setup(m, { expose: b }) {
|
|
476
|
+
const d = m, n = je(), { t: y } = K(), p = pe(), s = ft(), r = Ct();
|
|
477
|
+
_e(
|
|
478
|
+
() => d.modelValue,
|
|
479
|
+
(t) => {
|
|
480
|
+
console.log("TransferTemplateForm.model", t);
|
|
481
|
+
}
|
|
482
|
+
), p.watchLocation(async () => {
|
|
483
|
+
location && (n.purchaseOrder.supplier || (n.purchaseOrder.supplier = r.suppliers.find((t) => t) ?? n.purchaseOrder.supplier));
|
|
484
|
+
});
|
|
485
|
+
const x = ze(), v = kt(
|
|
486
|
+
() => n.purchaseOrder,
|
|
487
|
+
(t) => {
|
|
488
|
+
n.purchaseOrder = {
|
|
489
|
+
...n.purchaseOrder,
|
|
490
|
+
supplier: t.supplier
|
|
491
|
+
};
|
|
492
|
+
}
|
|
493
|
+
), w = M({
|
|
494
|
+
get() {
|
|
495
|
+
var t, l;
|
|
496
|
+
return typeof ((l = (t = n.purchaseOrder) == null ? void 0 : t.supplier) == null ? void 0 : l.internal) == "string" ? q.TRANSFER : q.PURCHASE;
|
|
497
|
+
},
|
|
498
|
+
set(t) {
|
|
499
|
+
var i, _;
|
|
500
|
+
const l = typeof ((_ = (i = n.purchaseOrder) == null ? void 0 : i.supplier) == null ? void 0 : _.internal) == "string" ? q.TRANSFER : q.PURCHASE;
|
|
501
|
+
t !== l && (n.purchaseOrder.supplier = t === q.PURCHASE ? v.locationOptionsTypePurchase.value[0] : v.locationOptionsTypeTransfer.value[0]);
|
|
502
|
+
}
|
|
503
|
+
}), I = M(() => v.transferLocationOptions.value), $ = M({
|
|
504
|
+
get() {
|
|
505
|
+
var t;
|
|
506
|
+
return (t = n.purchaseOrder.supplier) == null ? void 0 : t._id;
|
|
507
|
+
},
|
|
508
|
+
set(t) {
|
|
509
|
+
v.transferLocationModel.value = t;
|
|
510
|
+
}
|
|
511
|
+
}), {
|
|
512
|
+
promptSelectLocations: k,
|
|
513
|
+
columnDefs: h,
|
|
514
|
+
rowData: C
|
|
515
|
+
} = $t({
|
|
516
|
+
getLocations() {
|
|
517
|
+
return n.locations;
|
|
518
|
+
},
|
|
519
|
+
setLocations(t) {
|
|
520
|
+
n.locations = t;
|
|
521
|
+
}
|
|
522
|
+
}), L = M({
|
|
523
|
+
get() {
|
|
524
|
+
return n.purchaseOrder.remark ?? void 0;
|
|
525
|
+
},
|
|
526
|
+
set(t) {
|
|
527
|
+
n.purchaseOrder.remark = t;
|
|
528
|
+
}
|
|
529
|
+
}), P = U();
|
|
530
|
+
b({
|
|
531
|
+
validateInputs: () => {
|
|
532
|
+
var t, l;
|
|
533
|
+
(l = (t = P.value) == null ? void 0 : t.validateInputs) == null || l.call(t);
|
|
534
|
+
},
|
|
535
|
+
resetInputsValidation: () => {
|
|
536
|
+
var t, l;
|
|
537
|
+
(l = (t = P.value) == null ? void 0 : t.resetInputsValidation) == null || l.call(t);
|
|
538
|
+
},
|
|
539
|
+
resetInputs: () => {
|
|
540
|
+
var t, l;
|
|
541
|
+
(l = (t = P.value) == null ? void 0 : t.resetInputs) == null || l.call(t);
|
|
542
|
+
}
|
|
543
|
+
});
|
|
544
|
+
const f = Et({
|
|
545
|
+
updateItem: (t) => {
|
|
546
|
+
n.purchaseOrder.items = n.purchaseOrder.items.map((l) => l.sku._id !== t.sku._id ? l : t);
|
|
547
|
+
},
|
|
548
|
+
deleteItem: (t) => {
|
|
549
|
+
n.purchaseOrder.items = n.purchaseOrder.items.filter(
|
|
550
|
+
(l) => l.sku._id !== t.sku._id
|
|
551
|
+
);
|
|
552
|
+
},
|
|
553
|
+
get supplier() {
|
|
554
|
+
return n.purchaseOrder.supplier;
|
|
555
|
+
},
|
|
556
|
+
get items() {
|
|
557
|
+
return n.purchaseOrder.items;
|
|
558
|
+
},
|
|
559
|
+
get transferType() {
|
|
560
|
+
return q.PURCHASE;
|
|
561
|
+
},
|
|
562
|
+
get disabled() {
|
|
563
|
+
return d.disabled;
|
|
564
|
+
}
|
|
565
|
+
}), u = M(() => f.columnDefs.value);
|
|
566
|
+
function a() {
|
|
567
|
+
const t = s.skus.map((i) => ({
|
|
568
|
+
label: i.name,
|
|
569
|
+
sublabel: i.code,
|
|
570
|
+
value: i
|
|
571
|
+
})), l = t.filter((i) => {
|
|
572
|
+
var _;
|
|
573
|
+
return (_ = n.purchaseOrder.items) == null ? void 0 : _.find((S) => S.sku._id === i.value._id);
|
|
574
|
+
}).map((i) => i.value);
|
|
575
|
+
x.open({
|
|
576
|
+
title: y("inventory.transfer.form.items.selectItem"),
|
|
577
|
+
closeButton: !0,
|
|
578
|
+
contentComponent: Ne,
|
|
579
|
+
contentComponentProps: {
|
|
580
|
+
modelValue: l,
|
|
581
|
+
items: t,
|
|
582
|
+
virtualScroll: !0
|
|
583
|
+
},
|
|
584
|
+
primaryActions: {
|
|
585
|
+
text: y("common.confirm"),
|
|
586
|
+
close: !0
|
|
587
|
+
},
|
|
588
|
+
secondaryActions: {
|
|
589
|
+
text: y("common.close"),
|
|
590
|
+
close: !0,
|
|
591
|
+
variant: "tertiary"
|
|
592
|
+
}
|
|
593
|
+
}).onPrimary((i) => {
|
|
594
|
+
const _ = n.purchaseOrder.items ?? [], S = i.map((g) => {
|
|
595
|
+
const B = _.find((E) => E.sku._id === g._id);
|
|
596
|
+
if (B)
|
|
597
|
+
return B;
|
|
598
|
+
const V = { amount: 1, precision: me(g.unit) };
|
|
599
|
+
return {
|
|
600
|
+
sku: g,
|
|
601
|
+
code: g.code,
|
|
602
|
+
name: g.name,
|
|
603
|
+
quantity: V,
|
|
604
|
+
minimumQuantity: V,
|
|
605
|
+
maximumQuantity: yt(V, {
|
|
606
|
+
amount: 100,
|
|
607
|
+
precision: 0
|
|
608
|
+
}),
|
|
609
|
+
quantityStep: V
|
|
610
|
+
};
|
|
611
|
+
});
|
|
612
|
+
S.sort((g, B) => g.sku.code.localeCompare(B.sku.code)), n.purchaseOrder.items = S;
|
|
613
|
+
});
|
|
614
|
+
}
|
|
615
|
+
return (t, l) => {
|
|
616
|
+
const i = R("FmTextField"), _ = R("FmSelect"), S = R("FmTextarea"), g = R("FmButton"), B = R("FmTable"), V = R("FmForm");
|
|
617
|
+
return D(), j(V, {
|
|
618
|
+
ref_key: "formRef",
|
|
619
|
+
ref: P,
|
|
620
|
+
class: "flex flex-col gap-32",
|
|
621
|
+
disabled: t.disabled
|
|
622
|
+
}, {
|
|
623
|
+
default: O(() => [
|
|
624
|
+
o("div", to, [
|
|
625
|
+
o("div", oo, [
|
|
626
|
+
c(i, {
|
|
627
|
+
label: e(y)("inventory.transfer.form.name"),
|
|
628
|
+
"label-mark": "required",
|
|
629
|
+
modelValue: e(n).name,
|
|
630
|
+
"onUpdate:modelValue": l[0] || (l[0] = (T) => e(n).name = T),
|
|
631
|
+
rules: [e(ve)()]
|
|
632
|
+
}, null, 8, ["label", "modelValue", "rules"]),
|
|
633
|
+
c(_, {
|
|
634
|
+
label: e(y)("inventory.transfer.form.type.title"),
|
|
635
|
+
"model-value": w.value,
|
|
636
|
+
"onUpdate:modelValue": l[1] || (l[1] = (T) => w.value = T),
|
|
637
|
+
items: [
|
|
638
|
+
{
|
|
639
|
+
label: e(y)("inventory.transfer.form.type.purchase"),
|
|
640
|
+
value: e(q).PURCHASE,
|
|
641
|
+
disabled: !e(v).locationOptionsTypePurchase.value.length,
|
|
642
|
+
sublabel: e(v).locationOptionsTypePurchase.value.length ? void 0 : e(y)("inventory.transfer.form.noSupplierAvailable")
|
|
643
|
+
},
|
|
644
|
+
{
|
|
645
|
+
label: e(y)("inventory.transfer.form.type.transfer"),
|
|
646
|
+
value: e(q).TRANSFER,
|
|
647
|
+
disabled: !e(v).locationOptionsTypeTransfer.value.length,
|
|
648
|
+
sublabel: e(v).locationOptionsTypeTransfer.value.length ? void 0 : e(y)("inventory.transfer.form.noLocationAvailable")
|
|
649
|
+
}
|
|
650
|
+
],
|
|
651
|
+
rules: [e(qe)(1)(I.value)]
|
|
652
|
+
}, null, 8, ["label", "model-value", "items", "rules"]),
|
|
653
|
+
c(_, {
|
|
654
|
+
label: w.value === e(q).PURCHASE ? e(y)("inventory.transfer.form.purchaseFrom") : e(y)("inventory.transfer.form.transferFrom"),
|
|
655
|
+
modelValue: $.value,
|
|
656
|
+
"onUpdate:modelValue": l[2] || (l[2] = (T) => $.value = T),
|
|
657
|
+
items: I.value
|
|
658
|
+
}, null, 8, ["label", "modelValue", "items"]),
|
|
659
|
+
c(i, {
|
|
660
|
+
label: e(y)("inventory.transfer.form.reference"),
|
|
661
|
+
"label-mark": "optional",
|
|
662
|
+
modelValue: e(n).purchaseOrder.ref,
|
|
663
|
+
"onUpdate:modelValue": l[3] || (l[3] = (T) => e(n).purchaseOrder.ref = T)
|
|
664
|
+
}, null, 8, ["label", "modelValue"]),
|
|
665
|
+
c(S, {
|
|
666
|
+
label: e(y)("inventory.transfer.form.remark"),
|
|
667
|
+
"label-mark": "optional",
|
|
668
|
+
"max-length": 240,
|
|
669
|
+
modelValue: L.value,
|
|
670
|
+
"onUpdate:modelValue": l[4] || (l[4] = (T) => L.value = T),
|
|
671
|
+
class: ce({ "text-fm-color-typo-disabled": t.disabled })
|
|
672
|
+
}, null, 8, ["label", "modelValue", "class"])
|
|
673
|
+
])
|
|
674
|
+
]),
|
|
675
|
+
o("div", no, [
|
|
676
|
+
o("div", so, [
|
|
677
|
+
l[6] || (l[6] = o("div", { class: "flex-1 fm-typo-en-title-sm-600" }, "Locations", -1)),
|
|
678
|
+
c(g, {
|
|
679
|
+
disabled: t.disabled,
|
|
680
|
+
label: "Select location",
|
|
681
|
+
"prepend-icon": "add",
|
|
682
|
+
variant: "plain",
|
|
683
|
+
class: "border-2 rounded-lg border-fm-color-primary",
|
|
684
|
+
onClick: e(k)
|
|
685
|
+
}, null, 8, ["disabled", "onClick"])
|
|
686
|
+
]),
|
|
687
|
+
c(B, {
|
|
688
|
+
"column-defs": e(h),
|
|
689
|
+
"row-data": e(C),
|
|
690
|
+
"shrink-at": 9999,
|
|
691
|
+
"hide-footer": ""
|
|
692
|
+
}, null, 8, ["column-defs", "row-data"])
|
|
693
|
+
]),
|
|
694
|
+
o("div", lo, [
|
|
695
|
+
o("div", ao, [
|
|
696
|
+
o("div", ro, F(e(y)("inventory.transfer.form.items.title")), 1),
|
|
697
|
+
c(g, {
|
|
698
|
+
disabled: t.disabled,
|
|
699
|
+
label: e(y)("inventory.transfer.form.items.addItem"),
|
|
700
|
+
"prepend-icon": "add",
|
|
701
|
+
variant: "plain",
|
|
702
|
+
class: "border-2 rounded-lg border-fm-color-primary",
|
|
703
|
+
onClick: l[5] || (l[5] = (T) => a()),
|
|
704
|
+
size: "md"
|
|
705
|
+
}, null, 8, ["disabled", "label"])
|
|
706
|
+
]),
|
|
707
|
+
(D(), j(B, {
|
|
708
|
+
"column-defs": u.value,
|
|
709
|
+
"row-data": e(n).purchaseOrder.items,
|
|
710
|
+
key: e(n).purchaseOrder.items.map((T) => T.sku._id).join("."),
|
|
711
|
+
"hide-footer": ""
|
|
712
|
+
}, {
|
|
713
|
+
"list-row": O((T) => [
|
|
714
|
+
(D(), j(Qe, {
|
|
715
|
+
row: T,
|
|
716
|
+
key: e(n).purchaseOrder.items.map((E) => E.sku._id).join(".")
|
|
717
|
+
}, {
|
|
718
|
+
default: O((E) => [
|
|
719
|
+
c(eo, {
|
|
720
|
+
row: T,
|
|
721
|
+
"cell-by-col-id": E
|
|
722
|
+
}, null, 8, ["row", "cell-by-col-id"])
|
|
723
|
+
]),
|
|
724
|
+
_: 2
|
|
725
|
+
}, 1032, ["row"]))
|
|
726
|
+
]),
|
|
727
|
+
_: 1
|
|
728
|
+
}, 8, ["column-defs", "row-data"]))
|
|
729
|
+
])
|
|
730
|
+
]),
|
|
731
|
+
_: 1
|
|
732
|
+
}, 8, ["disabled"]);
|
|
733
|
+
};
|
|
734
|
+
}
|
|
735
|
+
}), uo = { class: "flex items-center" }, mo = { class: "fm-typo-en-title-md-800" }, co = { class: "flex gap-4" }, po = /* @__PURE__ */ J({
|
|
736
|
+
__name: "TransferTemplateDialog",
|
|
737
|
+
props: {
|
|
738
|
+
mode: {},
|
|
739
|
+
modelValue: {},
|
|
740
|
+
show: { type: Boolean }
|
|
741
|
+
},
|
|
742
|
+
emits: ["update:show", "submitted"],
|
|
743
|
+
setup(m, { expose: b, emit: d }) {
|
|
744
|
+
var u;
|
|
745
|
+
const n = m, y = d, p = nt(), s = xt(), { t: r } = K(), x = He(n, "show");
|
|
746
|
+
function v() {
|
|
747
|
+
return {
|
|
748
|
+
_id: "",
|
|
749
|
+
name: "",
|
|
750
|
+
purchaseOrder: {
|
|
751
|
+
remark: void 0,
|
|
752
|
+
ref: void 0,
|
|
753
|
+
stockSnapshotId: void 0,
|
|
754
|
+
effectiveAt: void 0,
|
|
755
|
+
items: [],
|
|
756
|
+
supplier: {
|
|
757
|
+
_rev: void 0,
|
|
758
|
+
email: void 0,
|
|
759
|
+
internal: void 0,
|
|
760
|
+
contactName: void 0,
|
|
761
|
+
phoneNumber: void 0,
|
|
762
|
+
registrationNumber: void 0,
|
|
763
|
+
supplyItems: void 0,
|
|
764
|
+
_id: "",
|
|
765
|
+
name: "",
|
|
766
|
+
address: {
|
|
767
|
+
line2: void 0,
|
|
768
|
+
line1: "",
|
|
769
|
+
state: "",
|
|
770
|
+
city: "",
|
|
771
|
+
postcode: "",
|
|
772
|
+
country: ""
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
};
|
|
777
|
+
}
|
|
778
|
+
const w = U(n.modelValue ?? v()), I = U(((u = n.modelValue) == null ? void 0 : u._id) ?? `${Math.random()}`);
|
|
779
|
+
_e(
|
|
780
|
+
() => n.show,
|
|
781
|
+
(a) => {
|
|
782
|
+
var t;
|
|
783
|
+
a && (w.value = n.modelValue ?? v(), I.value = ((t = n.modelValue) == null ? void 0 : t._id) ?? `${Math.random()}`);
|
|
784
|
+
}
|
|
785
|
+
);
|
|
786
|
+
const $ = U(!1), k = M(() => {
|
|
787
|
+
switch (n.mode) {
|
|
788
|
+
case le.READ:
|
|
789
|
+
return "";
|
|
790
|
+
case le.CREATE:
|
|
791
|
+
return r("inventory.transfer.template.create.title");
|
|
792
|
+
case le.UPDATE:
|
|
793
|
+
return r("inventory.transfer.template.update.title");
|
|
794
|
+
}
|
|
795
|
+
return "";
|
|
796
|
+
}), h = U();
|
|
797
|
+
b({
|
|
798
|
+
validateInputs: () => {
|
|
799
|
+
var a, t;
|
|
800
|
+
(t = (a = h.value) == null ? void 0 : a.validateInputs) == null || t.call(a);
|
|
801
|
+
},
|
|
802
|
+
resetInputsValidation: () => {
|
|
803
|
+
var a, t;
|
|
804
|
+
(t = (a = h.value) == null ? void 0 : a.resetInputsValidation) == null || t.call(a);
|
|
805
|
+
},
|
|
806
|
+
resetInputs: () => {
|
|
807
|
+
var a, t;
|
|
808
|
+
(t = (a = h.value) == null ? void 0 : a.resetInputs) == null || t.call(a);
|
|
809
|
+
}
|
|
810
|
+
});
|
|
811
|
+
async function C() {
|
|
812
|
+
var t, l;
|
|
813
|
+
const a = w.value;
|
|
814
|
+
if (a) {
|
|
815
|
+
$.value = !0, (((t = a.purchaseOrder.supplier) == null ? void 0 : t.internal) === ue.enum.warehouse || ((l = a.purchaseOrder.supplier) == null ? void 0 : l.internal) === ue.enum.restaurant) && (a.purchaseOrder.items = a.purchaseOrder.items.map(
|
|
816
|
+
({ totalCost: i, ..._ }) => _
|
|
817
|
+
));
|
|
818
|
+
try {
|
|
819
|
+
await p.createTemplate(a), await new Promise((i) => setTimeout(i, 1e3)), s.open({
|
|
820
|
+
title: r("inventory.transfer.template.create.success"),
|
|
821
|
+
message: r("inventory.transfer.template.create.successMessage"),
|
|
822
|
+
type: "success"
|
|
823
|
+
}), y("update:show", !1), y("submitted");
|
|
824
|
+
} catch (i) {
|
|
825
|
+
s.open({
|
|
826
|
+
title: r("inventory.transfer.template.create.error"),
|
|
827
|
+
message: r("inventory.transfer.template.create.errorMessage"),
|
|
828
|
+
type: "error"
|
|
829
|
+
}), console.error("Error in creating transfer template", i);
|
|
830
|
+
} finally {
|
|
831
|
+
$.value = !1;
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
async function L() {
|
|
836
|
+
var t, l;
|
|
837
|
+
const a = w.value;
|
|
838
|
+
if (a) {
|
|
839
|
+
$.value = !0, (((t = a.purchaseOrder.supplier) == null ? void 0 : t.internal) === ue.enum.warehouse || ((l = a.purchaseOrder.supplier) == null ? void 0 : l.internal) === ue.enum.restaurant) && (a.purchaseOrder.items = a.purchaseOrder.items.map(
|
|
840
|
+
({ totalCost: i, ..._ }) => _
|
|
841
|
+
));
|
|
842
|
+
try {
|
|
843
|
+
await p.updateTemplate(a), await new Promise((i) => setTimeout(i, 1e3)), s.open({
|
|
844
|
+
title: r("inventory.transfer.template.update.success"),
|
|
845
|
+
message: r("inventory.transfer.template.update.successMessage"),
|
|
846
|
+
type: "success"
|
|
847
|
+
}), y("update:show", !1), y("submitted");
|
|
848
|
+
} catch (i) {
|
|
849
|
+
s.open({
|
|
850
|
+
title: r("inventory.transfer.template.update.error"),
|
|
851
|
+
message: r("inventory.transfer.template.update.errorMessage"),
|
|
852
|
+
type: "error"
|
|
853
|
+
}), console.error("Error in updating transfer template", i);
|
|
854
|
+
} finally {
|
|
855
|
+
$.value = !1;
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
}
|
|
859
|
+
function P() {
|
|
860
|
+
switch (n.mode) {
|
|
861
|
+
case le.CREATE:
|
|
862
|
+
return C();
|
|
863
|
+
case le.UPDATE:
|
|
864
|
+
return L();
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
function f() {
|
|
868
|
+
var a, t;
|
|
869
|
+
(t = (a = h.value) == null ? void 0 : a.validateInputs) == null || t.call(a);
|
|
870
|
+
}
|
|
871
|
+
return (a, t) => {
|
|
872
|
+
const l = R("FmButton"), i = R("FmSideSheet");
|
|
873
|
+
return D(), j(i, {
|
|
874
|
+
modelValue: e(x),
|
|
875
|
+
"onUpdate:modelValue": t[2] || (t[2] = (_) => Ue(x) ? x.value = _ : null),
|
|
876
|
+
"dismiss-away": "",
|
|
877
|
+
"close-button": "",
|
|
878
|
+
"max-width": 1200
|
|
879
|
+
}, {
|
|
880
|
+
"side-sheet-header": O(() => [
|
|
881
|
+
o("div", uo, [
|
|
882
|
+
o("div", mo, F(k.value), 1)
|
|
883
|
+
])
|
|
884
|
+
]),
|
|
885
|
+
default: O(() => [
|
|
886
|
+
(D(), j(io, {
|
|
887
|
+
class: "w-full",
|
|
888
|
+
ref_key: "formRef",
|
|
889
|
+
ref: h,
|
|
890
|
+
onValidationSuccess: P,
|
|
891
|
+
"model-value": w.value,
|
|
892
|
+
"onUpdate:modelValue": t[0] || (t[0] = (_) => w.value = _),
|
|
893
|
+
disabled: $.value,
|
|
894
|
+
key: I.value
|
|
895
|
+
}, null, 8, ["model-value", "disabled"]))
|
|
896
|
+
]),
|
|
897
|
+
"side-sheet-footer": O(() => [
|
|
898
|
+
o("div", co, [
|
|
899
|
+
c(l, {
|
|
900
|
+
loading: $.value,
|
|
901
|
+
label: e(r)("common.save"),
|
|
902
|
+
onClick: f
|
|
903
|
+
}, null, 8, ["loading", "label"]),
|
|
904
|
+
c(l, {
|
|
905
|
+
disabled: $.value,
|
|
906
|
+
variant: "tertiary",
|
|
907
|
+
label: e(r)("common.close"),
|
|
908
|
+
onClick: t[1] || (t[1] = (_) => y("update:show", !1))
|
|
909
|
+
}, null, 8, ["disabled", "label"])
|
|
910
|
+
])
|
|
911
|
+
]),
|
|
912
|
+
_: 1
|
|
913
|
+
}, 8, ["modelValue"]);
|
|
914
|
+
};
|
|
915
|
+
}
|
|
916
|
+
});
|
|
917
|
+
function fo(m) {
|
|
918
|
+
const b = ze(), d = pe(), { t: n } = K(), y = M({
|
|
919
|
+
get() {
|
|
920
|
+
return Array.isArray(m.getLocations());
|
|
921
|
+
},
|
|
922
|
+
set(x) {
|
|
923
|
+
x ? m.setLocations([]) : m.setLocations(null);
|
|
924
|
+
}
|
|
925
|
+
});
|
|
926
|
+
function p() {
|
|
927
|
+
var x;
|
|
928
|
+
b.open({
|
|
929
|
+
title: "Select at least one location",
|
|
930
|
+
contentComponent: Ne,
|
|
931
|
+
contentComponentProps: {
|
|
932
|
+
modelValue: ((x = s.value) == null ? void 0 : x.map((v) => v.doc._id)) ?? [],
|
|
933
|
+
items: d.locations.map((v) => ({
|
|
934
|
+
label: v.name,
|
|
935
|
+
sublabel: v.type,
|
|
936
|
+
value: v.doc._id
|
|
937
|
+
}))
|
|
938
|
+
},
|
|
939
|
+
primaryActions: {
|
|
940
|
+
text: n("common.confirm"),
|
|
941
|
+
close: !0
|
|
942
|
+
},
|
|
943
|
+
secondaryActions: {
|
|
944
|
+
text: n("common.close"),
|
|
945
|
+
close: !0
|
|
946
|
+
}
|
|
947
|
+
}).onPrimary((v) => {
|
|
948
|
+
m.setLocations(d.locations.filter((w) => v.includes(w.doc._id)));
|
|
949
|
+
});
|
|
950
|
+
}
|
|
951
|
+
const s = M(() => {
|
|
952
|
+
var v;
|
|
953
|
+
const x = /* @__PURE__ */ new Set([...d.locations.map((w) => w.doc._id)]);
|
|
954
|
+
return (v = m.getLocations()) == null ? void 0 : v.filter((w) => x.has(w.doc._id));
|
|
955
|
+
});
|
|
956
|
+
function r(x) {
|
|
957
|
+
var v;
|
|
958
|
+
m.setLocations((v = m.getLocations()) == null ? void 0 : v.filter((w) => w.doc._id !== x));
|
|
959
|
+
}
|
|
960
|
+
return {
|
|
961
|
+
enabledLocations: s,
|
|
962
|
+
enabledLocationsSwitch: y,
|
|
963
|
+
promptSelectLocations: p,
|
|
964
|
+
removeLocation: r
|
|
965
|
+
};
|
|
966
|
+
}
|
|
967
|
+
const yo = { class: "flex flex-col gap-16 w-full h-full overflow-y-auto" }, vo = { class: "flex justify-between" }, bo = { class: "fm-typo-en-body-lg-600" }, _o = { class: "flex flex-col gap-8" }, xo = { class: "flex flex-col gap-4" }, ho = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, go = { class: "flex gap-1" }, wo = { class: "fm-typo-en-body-lg-600" }, ko = {
|
|
968
|
+
key: 0,
|
|
969
|
+
class: "flex flex-col gap-4"
|
|
970
|
+
}, To = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Fo = { class: "fm-typo-en-body-lg-600" }, Co = { class: "flex flex-col gap-4" }, So = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, $o = { class: "fm-typo-en-body-lg-600" }, Mo = {
|
|
971
|
+
key: 1,
|
|
972
|
+
class: "flex flex-col gap-4"
|
|
973
|
+
}, Do = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ao = { class: "fm-typo-en-body-lg-600" }, Ro = {
|
|
974
|
+
key: 2,
|
|
975
|
+
class: "flex flex-col gap-4"
|
|
976
|
+
}, Io = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Lo = { class: "fm-typo-en-body-lg-600" }, Vo = {
|
|
977
|
+
key: 3,
|
|
978
|
+
class: "flex flex-col gap-4"
|
|
979
|
+
}, Oo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Po = { class: "fm-typo-en-body-lg-600" }, Bo = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" }, Eo = { class: "flex flex-col gap-8" }, Uo = { class: "fm-typo-en-body-lg-600" }, qo = { class: "flex w-full gap-4" }, No = { class: "grow fm-typo-en-body-lg-400 line-clamp-2" }, zo = { class: "fm-typo-en-body-lg-600 shrink-0" }, Ho = { class: "flex w-full gap-4 fm-typo-en-body-sm-400" }, jo = { class: "grow fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, Qo = {
|
|
980
|
+
key: 0,
|
|
981
|
+
class: "shrink-0 fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
|
|
982
|
+
}, Go = { class: "flex gap-8 xs:flex-col" }, Yo = /* @__PURE__ */ J({
|
|
983
|
+
__name: "TransferTemplateDetails",
|
|
984
|
+
props: {
|
|
985
|
+
template: {},
|
|
986
|
+
show: { type: Boolean }
|
|
987
|
+
},
|
|
988
|
+
emits: ["update:show", "action:use", "action:edit"],
|
|
989
|
+
setup(m, { emit: b }) {
|
|
990
|
+
const d = m, n = b, y = xe(), p = pe(), { t: s } = K(), r = M(() => {
|
|
991
|
+
var k;
|
|
992
|
+
return (k = d.template) == null ? void 0 : k.purchaseOrder;
|
|
993
|
+
}), { enabledLocations: x } = fo({
|
|
994
|
+
getLocations() {
|
|
995
|
+
var k;
|
|
996
|
+
return (k = d.template) == null ? void 0 : k.locations;
|
|
997
|
+
},
|
|
998
|
+
setLocations() {
|
|
999
|
+
}
|
|
1000
|
+
}), v = M(() => {
|
|
1001
|
+
if (!p.businessLevel)
|
|
1002
|
+
return [p.currentLocation];
|
|
1003
|
+
const k = Array.isArray(x.value) ? x.value : p.locations, h = /* @__PURE__ */ new Set([...k.map((C) => C.doc._id)]);
|
|
1004
|
+
return p.locations.filter((C) => h.has(C.doc._id));
|
|
1005
|
+
}), w = M(
|
|
1006
|
+
() => {
|
|
1007
|
+
var k, h, C, L;
|
|
1008
|
+
return ((h = (k = r.value) == null ? void 0 : k.supplier) == null ? void 0 : h.internal) === "restaurant" || ((L = (C = r.value) == null ? void 0 : C.supplier) == null ? void 0 : L.internal) === "warehouse" ? q.TRANSFER : q.PURCHASE;
|
|
1009
|
+
}
|
|
1010
|
+
), I = U(!0), $ = He(d, "show");
|
|
1011
|
+
return (k, h) => {
|
|
1012
|
+
var t;
|
|
1013
|
+
const C = R("FmMenuDivider"), L = R("FmCard"), P = R("FmButton"), f = R("FmListItem"), u = R("FmList"), a = R("FmSideSheet");
|
|
1014
|
+
return D(), j(a, {
|
|
1015
|
+
header: e(s)("inventory.transfer.template.details.view", { template: (t = k.template) == null ? void 0 : t.name }),
|
|
1016
|
+
modelValue: e($),
|
|
1017
|
+
"onUpdate:modelValue": h[1] || (h[1] = (l) => Ue($) ? $.value = l : null),
|
|
1018
|
+
"dismiss-away": I.value,
|
|
1019
|
+
"close-button": "",
|
|
1020
|
+
"max-width": 500
|
|
1021
|
+
}, {
|
|
1022
|
+
default: O(() => {
|
|
1023
|
+
var l;
|
|
1024
|
+
return [
|
|
1025
|
+
o("div", yo, [
|
|
1026
|
+
o("div", null, [
|
|
1027
|
+
c(L, {
|
|
1028
|
+
variant: "outlined",
|
|
1029
|
+
class: "flex flex-col gap-8 px-12 py-16"
|
|
1030
|
+
}, {
|
|
1031
|
+
default: O(() => {
|
|
1032
|
+
var i, _, S, g, B, V, T, E, Q;
|
|
1033
|
+
return [
|
|
1034
|
+
o("div", vo, [
|
|
1035
|
+
o("div", bo, F(e(s)("inventory.transfer.template.details.templateSummary")), 1)
|
|
1036
|
+
]),
|
|
1037
|
+
c(C),
|
|
1038
|
+
o("div", _o, [
|
|
1039
|
+
o("div", xo, [
|
|
1040
|
+
o("div", ho, [
|
|
1041
|
+
o("div", go, F(e(s)("inventory.transfer.receiveRequest.details.createdAt")), 1)
|
|
1042
|
+
]),
|
|
1043
|
+
o("div", wo, F(e(Mt)(((i = k.template) == null ? void 0 : i._id) ?? "")), 1)
|
|
1044
|
+
]),
|
|
1045
|
+
(_ = r.value) != null && _.effectiveAt ? (D(), z("div", ko, [
|
|
1046
|
+
o("div", To, F(e(s)("inventory.transfer.receiveRequest.details.backdatedTo")), 1),
|
|
1047
|
+
o("div", Fo, F(e(vt)(new Date((S = r.value) == null ? void 0 : S.effectiveAt))), 1)
|
|
1048
|
+
])) : se("", !0),
|
|
1049
|
+
o("div", Co, [
|
|
1050
|
+
o("div", So, F(e(s)("inventory.transfer.receiveRequest.details.type.title")), 1),
|
|
1051
|
+
o("div", $o, F(e(s)(
|
|
1052
|
+
`inventory.transfer.receiveRequest.details.type.${w.value.toLocaleLowerCase("en-US")}`
|
|
1053
|
+
)), 1)
|
|
1054
|
+
]),
|
|
1055
|
+
(B = (g = r.value) == null ? void 0 : g.supplier) != null && B.name ? (D(), z("div", Mo, [
|
|
1056
|
+
o("div", Do, F(e(s)("inventory.transfer.receiveRequest.details.from")), 1),
|
|
1057
|
+
o("div", Ao, F((T = (V = r.value) == null ? void 0 : V.supplier) == null ? void 0 : T.name), 1)
|
|
1058
|
+
])) : se("", !0),
|
|
1059
|
+
(E = r.value) != null && E.ref ? (D(), z("div", Ro, [
|
|
1060
|
+
o("div", Io, F(e(s)("inventory.transfer.receiveRequest.details.reference")), 1),
|
|
1061
|
+
o("div", Lo, F(r.value.ref), 1)
|
|
1062
|
+
])) : se("", !0),
|
|
1063
|
+
(Q = r.value) != null && Q.remark ? (D(), z("div", Vo, [
|
|
1064
|
+
o("div", Oo, F(e(s)("inventory.transfer.receiveRequest.details.remark")), 1),
|
|
1065
|
+
o("div", Po, F(r.value.remark), 1)
|
|
1066
|
+
])) : se("", !0)
|
|
1067
|
+
])
|
|
1068
|
+
];
|
|
1069
|
+
}),
|
|
1070
|
+
_: 1
|
|
1071
|
+
})
|
|
1072
|
+
]),
|
|
1073
|
+
o("div", Bo, [
|
|
1074
|
+
o("div", Eo, [
|
|
1075
|
+
o("div", Uo, F(e(s)("inventory.transfer.receiveRequest.details.requestedItems")), 1),
|
|
1076
|
+
(D(!0), z(ye, null, Le(((l = r.value) == null ? void 0 : l.items) ?? [], (i) => (D(), z("div", {
|
|
1077
|
+
key: i.code,
|
|
1078
|
+
class: "flex flex-col"
|
|
1079
|
+
}, [
|
|
1080
|
+
o("div", qo, [
|
|
1081
|
+
o("div", No, F(i.name), 1),
|
|
1082
|
+
h[2] || (h[2] = o("div", { class: "flex-1 min-w-32" }, null, -1)),
|
|
1083
|
+
o("div", zo, F(e(st)(i.quantity, i.sku.unit, i.measurement)), 1)
|
|
1084
|
+
]),
|
|
1085
|
+
o("div", Ho, [
|
|
1086
|
+
o("div", jo, F(i.code), 1),
|
|
1087
|
+
i.totalCost && e(y).enableTotalCost ? (D(), z("div", Qo, " (" + F(e(bt)(i.totalCost)) + ") ", 1)) : se("", !0)
|
|
1088
|
+
])
|
|
1089
|
+
]))), 128))
|
|
1090
|
+
])
|
|
1091
|
+
]),
|
|
1092
|
+
o("div", null, [
|
|
1093
|
+
c(L, {
|
|
1094
|
+
variant: "outlined",
|
|
1095
|
+
class: "flex flex-col"
|
|
1096
|
+
}, {
|
|
1097
|
+
default: O(() => [
|
|
1098
|
+
h[3] || (h[3] = o("div", { class: "flex flex-col p-16" }, [
|
|
1099
|
+
o("div", { class: "fm-typo-en-body-lg-600" }, "Enabled locations"),
|
|
1100
|
+
o("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Click to use template on the location ")
|
|
1101
|
+
], -1)),
|
|
1102
|
+
c(u, null, {
|
|
1103
|
+
default: O(() => [
|
|
1104
|
+
(D(!0), z(ye, null, Le(v.value, (i) => (D(), j(f, {
|
|
1105
|
+
key: i.doc._id,
|
|
1106
|
+
label: i.name,
|
|
1107
|
+
sublabel: i.type,
|
|
1108
|
+
onClick: (_) => n("action:use", i.doc._id)
|
|
1109
|
+
}, {
|
|
1110
|
+
append: O(() => [
|
|
1111
|
+
c(P, {
|
|
1112
|
+
"prepend-icon": "chevron_right",
|
|
1113
|
+
variant: "tertiary"
|
|
1114
|
+
})
|
|
1115
|
+
]),
|
|
1116
|
+
_: 2
|
|
1117
|
+
}, 1032, ["label", "sublabel", "onClick"]))), 128))
|
|
1118
|
+
]),
|
|
1119
|
+
_: 1
|
|
1120
|
+
})
|
|
1121
|
+
]),
|
|
1122
|
+
_: 1
|
|
1123
|
+
})
|
|
1124
|
+
])
|
|
1125
|
+
])
|
|
1126
|
+
];
|
|
1127
|
+
}),
|
|
1128
|
+
"side-sheet-footer": O(() => [
|
|
1129
|
+
o("div", Go, [
|
|
1130
|
+
c(P, {
|
|
1131
|
+
label: e(s)("common.edit"),
|
|
1132
|
+
onClick: h[0] || (h[0] = (l) => n("action:edit")),
|
|
1133
|
+
variant: "tertiary"
|
|
1134
|
+
}, null, 8, ["label"])
|
|
1135
|
+
])
|
|
1136
|
+
]),
|
|
1137
|
+
_: 1
|
|
1138
|
+
}, 8, ["header", "modelValue", "dismiss-away"]);
|
|
1139
|
+
};
|
|
1140
|
+
}
|
|
1141
|
+
}), Wo = { class: "flex-1 flex flex-col gap-8" }, Ko = { class: "flex flex-col" }, Zo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Jo = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Xo = { class: "fm-typo-en-body-lg-400" }, en = { class: "fm-typo-en-body-lg-400 line-clamp-1" }, tn = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, xn = /* @__PURE__ */ J({
|
|
1142
|
+
__name: "TransferTemplateView",
|
|
1143
|
+
setup(m) {
|
|
1144
|
+
const { t: b } = K(), { createTemplate: d, viewTemplate: n } = Oe(), { templateDialogProps: y, transferFormDialogProps: p, templateDetailsProps: s } = gt(
|
|
1145
|
+
Oe()
|
|
1146
|
+
), r = lt(), x = et(), v = pe(), w = xe(), { breakpoints: I } = ht();
|
|
1147
|
+
be(r.fetchTemplates);
|
|
1148
|
+
const $ = M(
|
|
1149
|
+
() => r.loading.value || !v._currentLocation
|
|
1150
|
+
), k = M(() => r.templates.value), h = U(""), C = M(() => I.value.xs || I.value.sm), L = M(() => C.value ? 10 : 20);
|
|
1151
|
+
function P(t) {
|
|
1152
|
+
switch (t) {
|
|
1153
|
+
case Pe.Add:
|
|
1154
|
+
return d();
|
|
1155
|
+
}
|
|
1156
|
+
}
|
|
1157
|
+
const f = Ft();
|
|
1158
|
+
function u() {
|
|
1159
|
+
f.push({ name: _t.RECEIVE_REQUEST });
|
|
1160
|
+
}
|
|
1161
|
+
function a(t) {
|
|
1162
|
+
return t;
|
|
1163
|
+
}
|
|
1164
|
+
return (t, l) => {
|
|
1165
|
+
const i = R("FmTable");
|
|
1166
|
+
return D(), z(ye, null, [
|
|
1167
|
+
c(tt, {
|
|
1168
|
+
title: e(b)("inventory.transfer.template.title2"),
|
|
1169
|
+
actions: [
|
|
1170
|
+
{
|
|
1171
|
+
label: e(b)("inventory.transfer.template.create.title"),
|
|
1172
|
+
value: e(Pe).Add,
|
|
1173
|
+
isPrimary: !0,
|
|
1174
|
+
prependIcon: "add"
|
|
1175
|
+
}
|
|
1176
|
+
],
|
|
1177
|
+
"onClick:action": P
|
|
1178
|
+
}, {
|
|
1179
|
+
default: O(() => {
|
|
1180
|
+
var _;
|
|
1181
|
+
return [
|
|
1182
|
+
o("div", {
|
|
1183
|
+
class: ce([
|
|
1184
|
+
"flex flex-col gap-8 max-h-full",
|
|
1185
|
+
{
|
|
1186
|
+
"p-0": C.value,
|
|
1187
|
+
"px-24 ": !C.value
|
|
1188
|
+
}
|
|
1189
|
+
])
|
|
1190
|
+
}, [
|
|
1191
|
+
c(ot, {
|
|
1192
|
+
searchable: "",
|
|
1193
|
+
"change-location": !e(w).mustManageBusinessOnlyPoTemplate,
|
|
1194
|
+
search: h.value,
|
|
1195
|
+
"onUpdate:search": l[0] || (l[0] = (S) => h.value = S),
|
|
1196
|
+
actions: [{ icon: "refresh", onClick: e(r).fetchTemplates }],
|
|
1197
|
+
"show-business": ""
|
|
1198
|
+
}, null, 8, ["change-location", "search", "actions"]),
|
|
1199
|
+
(D(), j(i, {
|
|
1200
|
+
style: Ke(e(x).tableHeight),
|
|
1201
|
+
"column-defs": e(r).columnDefs,
|
|
1202
|
+
"row-data": k.value,
|
|
1203
|
+
"search-value": h.value,
|
|
1204
|
+
loading: $.value,
|
|
1205
|
+
key: (_ = e(v)._currentLocation) == null ? void 0 : _.dbName,
|
|
1206
|
+
onRowClick: l[1] || (l[1] = (S) => e(n)(S.original)),
|
|
1207
|
+
"page-size": L.value
|
|
1208
|
+
}, {
|
|
1209
|
+
"list-row": O((S) => [
|
|
1210
|
+
c(Qe, {
|
|
1211
|
+
row: S,
|
|
1212
|
+
onRowClick: (g) => e(n)(g)
|
|
1213
|
+
}, {
|
|
1214
|
+
default: O((g) => {
|
|
1215
|
+
var B, V, T, E, Q, X, G, ee, Y, te, oe, W, ne, ae, he, ge, we, ke, Te, Fe, re, Ce, Se, $e, Me, ie, De;
|
|
1216
|
+
return [
|
|
1217
|
+
o("div", Wo, [
|
|
1218
|
+
o("div", Ko, [
|
|
1219
|
+
o("div", Zo, [
|
|
1220
|
+
c(e(N), {
|
|
1221
|
+
render: (T = (V = (B = g._id) == null ? void 0 : B.column) == null ? void 0 : V.columnDef) == null ? void 0 : T.cell,
|
|
1222
|
+
props: (Q = (E = g._id) == null ? void 0 : E.getContext) == null ? void 0 : Q.call(E)
|
|
1223
|
+
}, null, 8, ["render", "props"])
|
|
1224
|
+
]),
|
|
1225
|
+
o("div", Jo, [
|
|
1226
|
+
c(e(N), {
|
|
1227
|
+
render: (ee = (G = (X = g.name) == null ? void 0 : X.column) == null ? void 0 : G.columnDef) == null ? void 0 : ee.cell,
|
|
1228
|
+
props: (te = (Y = g.name) == null ? void 0 : Y.getContext) == null ? void 0 : te.call(Y)
|
|
1229
|
+
}, null, 8, ["render", "props"])
|
|
1230
|
+
]),
|
|
1231
|
+
o("div", Xo, [
|
|
1232
|
+
c(e(N), {
|
|
1233
|
+
render: (ne = (W = (oe = g.supplier) == null ? void 0 : oe.column) == null ? void 0 : W.columnDef) == null ? void 0 : ne.cell,
|
|
1234
|
+
props: (he = (ae = g.supplier) == null ? void 0 : ae.getContext) == null ? void 0 : he.call(ae)
|
|
1235
|
+
}, null, 8, ["render", "props"])
|
|
1236
|
+
]),
|
|
1237
|
+
o("div", null, F((ge = S.original.locations) != null && ge.length ? `Enabled for ${(we = S.original.locations) == null ? void 0 : we.length} outlets` : "Enabled for all outlets"), 1),
|
|
1238
|
+
o("div", en, F(S.original.purchaseOrder.items.length ? S.original.purchaseOrder.items.map((Ge) => Ge.name).join(", ") : "No items"), 1),
|
|
1239
|
+
o("div", tn, [
|
|
1240
|
+
c(e(N), {
|
|
1241
|
+
render: (Fe = (Te = (ke = g.ref) == null ? void 0 : ke.column) == null ? void 0 : Te.columnDef) == null ? void 0 : Fe.cell,
|
|
1242
|
+
props: (Ce = (re = g.ref) == null ? void 0 : re.getContext) == null ? void 0 : Ce.call(re)
|
|
1243
|
+
}, null, 8, ["render", "props"])
|
|
1244
|
+
])
|
|
1245
|
+
]),
|
|
1246
|
+
o("div", null, [
|
|
1247
|
+
c(e(N), {
|
|
1248
|
+
render: (Me = ($e = (Se = g.type) == null ? void 0 : Se.column) == null ? void 0 : $e.columnDef) == null ? void 0 : Me.cell,
|
|
1249
|
+
props: (De = (ie = g.type) == null ? void 0 : ie.getContext) == null ? void 0 : De.call(ie)
|
|
1250
|
+
}, null, 8, ["render", "props"])
|
|
1251
|
+
])
|
|
1252
|
+
])
|
|
1253
|
+
];
|
|
1254
|
+
}),
|
|
1255
|
+
_: 2
|
|
1256
|
+
}, 1032, ["row", "onRowClick"])
|
|
1257
|
+
]),
|
|
1258
|
+
_: 1
|
|
1259
|
+
}, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]))
|
|
1260
|
+
], 2)
|
|
1261
|
+
];
|
|
1262
|
+
}),
|
|
1263
|
+
_: 1
|
|
1264
|
+
}, 8, ["title", "actions"]),
|
|
1265
|
+
(D(), j(Ze, { to: "body" }, [
|
|
1266
|
+
c(Tt, Ve(e(p), { onSubmitted: u }), null, 16),
|
|
1267
|
+
c(Yo, Je(Xe(e(s))), null, 16),
|
|
1268
|
+
c(po, Ve(e(y), {
|
|
1269
|
+
onSubmitted: l[2] || (l[2] = (_) => e(r).fetchTemplates())
|
|
1270
|
+
}), null, 16)
|
|
1271
|
+
]))
|
|
1272
|
+
], 64);
|
|
1273
|
+
};
|
|
1274
|
+
}
|
|
1275
|
+
});
|
|
1276
|
+
export {
|
|
1277
|
+
xn as default
|
|
1278
|
+
};
|