@feedmepos/mf-inventory-portal 0.0.21-dev.4 → 0.0.21-dev.5
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-BHoJzHuo.js +129 -0
- package/dist/{BindingsDialog-BFLeun5L.js → BindingsDialog-sUZjZtSl.js} +1 -1
- package/dist/{BindingsPicker-CnjJZH9t.js → BindingsPicker-CqzSUVc_.js} +1 -1
- package/dist/{BindingsTable-C3VTa0YL.js → BindingsTable-C1o5EgLy.js} +1 -1
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DYBTXD_J.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CpN5Kn8b.js} +1 -1
- package/dist/{IngredientsView-CQYJfAze.js → IngredientsView-CrXPIQme.js} +99 -91
- package/dist/IntegrationView-BJT-KMVp.js +1141 -0
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Wv8RvXJL.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DH0CcGmX.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-DsOGlAb7.js → PremiumBadge.vue_vue_type_script_setup_true_lang-kJKVCH40.js} +1 -1
- package/dist/{PurchaseOrderPrintPreview-B0hDduXB.js → PurchaseOrderPrintPreview-k26o__vy.js} +1 -1
- package/dist/ReceiveRequestView-ysOzzBTW.js +216 -0
- package/dist/{RecipeView-DYKhSgtw.js → RecipeView-DAH8YIzY.js} +182 -174
- package/dist/{StockView-BIGGG87A.js → StockView-BlCpuSLe.js} +547 -539
- package/dist/{SupplierView-DQzopnzt.js → SupplierView-Bwknjcke.js} +263 -255
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-D8-sMRGm.js → TransferDetails.vue_vue_type_script_setup_true_lang-LCNiBfi7.js} +3 -3
- package/dist/{TransferDialog.vue_vue_type_script_setup_true_lang-CSUnXAyq.js → TransferDialog.vue_vue_type_script_setup_true_lang-BDvtif2q.js} +4 -4
- package/dist/{TransferTemplateView-DWF54okN.js → TransferTemplateView-DcMdNiH6.js} +372 -364
- package/dist/{UnitView-Cdw8xxzV.js → UnitView-BVMr4KlR.js} +186 -178
- package/dist/{WarehouseView-DOelxuIh.js → WarehouseView-Dd-e-IlG.js} +388 -380
- package/dist/{app-SBnQEeEV.js → app-S6iG6Hux.js} +4 -4
- package/dist/app.js +1 -1
- package/dist/{decimal-BlEB2PrM.js → decimal-nOOdFIFP.js} +1 -1
- package/dist/{id-to-date-Y6berpHs.js → id-to-date-CKQ0n3Qi.js} +1 -1
- package/dist/{purchase-order-transaction-type-Dp0wsGal.js → purchase-order-transaction-type-CQ-RpJ0h.js} +2 -2
- package/dist/{supplier-I_rYvljH.js → supplier-DQsAfn3q.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{xlsx-DGwG2ekM.js → xlsx-Dgjf-KvE.js} +1 -1
- package/dist/{xlsx.util-Dsf-EgrG.js → xlsx.util-CODYzgF8.js} +2 -2
- package/package.json +3 -3
- package/dist/ApprovalView-BS4jzhAR.js +0 -121
- package/dist/IntegrationView-9V2OcyP_.js +0 -1172
- package/dist/ReceiveRequestView-3boFHkOO.js +0 -208
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { defineComponent as X, onMounted as xe, computed as
|
|
2
|
-
import { u as
|
|
1
|
+
import { defineComponent as X, onMounted as xe, computed as V, ref as U, watch as fe, inject as Ke, resolveComponent as S, openBlock as C, createElementBlock as P, createElementVNode as s, createVNode as d, withCtx as D, renderSlot as De, withDirectives as Ve, normalizeClass as me, vModelText as Ae, reactive as Ze, h as J, toDisplayString as $, unref as e, createBlock as E, createCommentVNode as H, isRef as he, Fragment as ce, renderList as be, onUnmounted as Je, normalizeStyle as Xe, Teleport as et, mergeProps as Re, normalizeProps as tt, guardReactiveProps as ot } from "vue";
|
|
2
|
+
import { u as st, _ as nt, a as lt } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CpN5Kn8b.js";
|
|
3
3
|
import { useI18n as Z } from "@feedmepos/mf-common";
|
|
4
|
-
import { P as
|
|
5
|
-
import { F as ne, R as
|
|
6
|
-
import { $ as
|
|
7
|
-
import { useBreakpoints as
|
|
8
|
-
import { storeToRefs as
|
|
9
|
-
import { d as
|
|
10
|
-
import { useRouter as
|
|
11
|
-
import { u as
|
|
12
|
-
import { F as
|
|
13
|
-
import { _ as
|
|
14
|
-
const
|
|
4
|
+
import { P as pe, a as at, f as rt, b as it, c as Oe, d as ut } from "./purchase-order-transaction-type-CQ-RpJ0h.js";
|
|
5
|
+
import { F as ne, R as Pe } from "./row-action.enum-PMKMRrZR.js";
|
|
6
|
+
import { $ as ve, t as Be, I as dt, a0 as mt, a1 as ct, a as G, D as qe, R as _e, a2 as pt, a3 as ft, r as de, a4 as yt, l as vt, A as Ue, M as bt, b as ge, j as ye, y as Ne, u as _t, a5 as ie, a6 as xt, G as ht, a7 as gt } from "./app-S6iG6Hux.js";
|
|
7
|
+
import { useBreakpoints as Ee, components as ue, useDialog as ze, useSnackbar as kt, useProxiedModel as je } from "@feedmepos/ui-library";
|
|
8
|
+
import { storeToRefs as wt } from "pinia";
|
|
9
|
+
import { d as Qe, c as He, _ as Ft } from "./TransferDialog.vue_vue_type_script_setup_true_lang-BDvtif2q.js";
|
|
10
|
+
import { useRouter as Tt } from "vue-router";
|
|
11
|
+
import { u as Ct } from "./supplier-DQsAfn3q.js";
|
|
12
|
+
import { F as N, _ as Ge } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
|
|
13
|
+
import { _ as $t } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-kJKVCH40.js";
|
|
14
|
+
const St = { class: "flex flex-col" }, Lt = { class: "flex flex-col" }, Mt = { class: "flex-1" }, It = { class: "flex items-center" }, Dt = { class: "flex-1" }, Vt = { class: "flex-1" }, At = /* @__PURE__ */ X({
|
|
15
15
|
__name: "FmMinMaxInput",
|
|
16
16
|
props: {
|
|
17
17
|
rules: {},
|
|
@@ -49,42 +49,42 @@ const $t = { class: "flex flex-col" }, St = { class: "flex flex-col" }, Lt = { c
|
|
|
49
49
|
helperState: {}
|
|
50
50
|
},
|
|
51
51
|
setup(m) {
|
|
52
|
-
const y = m, u =
|
|
52
|
+
const y = m, u = Qe("modelValue"), l = dt();
|
|
53
53
|
xe(() => {
|
|
54
|
-
const { min:
|
|
55
|
-
if (!(!
|
|
56
|
-
const t = Math.max(
|
|
57
|
-
u.min = r, u.max =
|
|
54
|
+
const { min: f, max: o } = u ?? {};
|
|
55
|
+
if (!(!f || !o) && f.precision !== o.precision) {
|
|
56
|
+
const t = Math.max(f.precision, o.precision), r = ve(f, t), p = ve(o, t);
|
|
57
|
+
u.min = r, u.max = p;
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
|
-
const
|
|
61
|
-
const { min:
|
|
62
|
-
return Math.max((
|
|
63
|
-
}), c =
|
|
60
|
+
const _ = V(() => {
|
|
61
|
+
const { min: f, max: o } = u ?? {};
|
|
62
|
+
return Math.max((f == null ? void 0 : f.precision) ?? 0, (o == null ? void 0 : o.precision) ?? 0, y.precision ?? 0);
|
|
63
|
+
}), c = V(() => ({
|
|
64
64
|
...u
|
|
65
|
-
})), n = (
|
|
66
|
-
if (!
|
|
67
|
-
const o =
|
|
68
|
-
return
|
|
65
|
+
})), n = (f) => {
|
|
66
|
+
if (!f) return "";
|
|
67
|
+
const o = mt(f), t = _.value, r = ve(o, t);
|
|
68
|
+
return ct(
|
|
69
69
|
+G(r),
|
|
70
70
|
r.precision
|
|
71
71
|
);
|
|
72
72
|
}, a = U(n(u.min)), v = U(n(u.max));
|
|
73
|
-
|
|
74
|
-
const t = u ?? {}, r = l(
|
|
75
|
-
if (
|
|
76
|
-
const
|
|
77
|
-
t.min =
|
|
73
|
+
fe([a, v], ([f, o]) => {
|
|
74
|
+
const t = u ?? {}, r = l(f), p = l(o), i = _.value;
|
|
75
|
+
if (f !== "" && r === !0) {
|
|
76
|
+
const h = Be(+f, i);
|
|
77
|
+
t.min = h;
|
|
78
78
|
} else
|
|
79
79
|
t.min = null;
|
|
80
|
-
if (o !== "" &&
|
|
81
|
-
const
|
|
82
|
-
t.max =
|
|
80
|
+
if (o !== "" && p === !0) {
|
|
81
|
+
const h = Be(+o, i);
|
|
82
|
+
t.max = h;
|
|
83
83
|
} else
|
|
84
84
|
t.max = null;
|
|
85
85
|
u.min = t.min, u.max = t.max;
|
|
86
86
|
});
|
|
87
|
-
const b = Symbol.for("fm:form-state"), g =
|
|
87
|
+
const b = Symbol.for("fm:form-state"), g = Ke(b, null), L = V(() => y.disabled ?? (g == null ? void 0 : g.getDisabled()) ?? !1), M = U(), w = U(), x = U(!1), F = U(!1), R = V(() => x.value || F.value), q = V(() => [...[
|
|
88
88
|
function() {
|
|
89
89
|
return typeof l(a.value) == "string" || typeof l(v.value) == "string" ? "Must be a number" : !0;
|
|
90
90
|
},
|
|
@@ -92,97 +92,97 @@ const $t = { class: "flex flex-col" }, St = { class: "flex flex-col" }, Lt = { c
|
|
|
92
92
|
return !t || !t.min || !t.max ? !0 : +G(t.min) > +G(t.max) ? "Min must be less than or equal to max" : !0;
|
|
93
93
|
}
|
|
94
94
|
], ...y.rules ?? []]);
|
|
95
|
-
return (
|
|
96
|
-
const t = S("FmLabel"), r = S("FmField"),
|
|
97
|
-
return
|
|
98
|
-
s("div",
|
|
99
|
-
s("div",
|
|
95
|
+
return (f, o) => {
|
|
96
|
+
const t = S("FmLabel"), r = S("FmField"), p = S("FmFormGroup");
|
|
97
|
+
return C(), P("div", St, [
|
|
98
|
+
s("div", Lt, [
|
|
99
|
+
s("div", Mt, [
|
|
100
100
|
d(t, {
|
|
101
|
-
label:
|
|
102
|
-
disabled:
|
|
103
|
-
required:
|
|
104
|
-
optional:
|
|
101
|
+
label: f.label,
|
|
102
|
+
disabled: f.disabled,
|
|
103
|
+
required: f.labelMark === "required",
|
|
104
|
+
optional: f.labelMark === "optional"
|
|
105
105
|
}, null, 8, ["label", "disabled", "required", "optional"])
|
|
106
106
|
]),
|
|
107
107
|
d(r, { focused: R.value }, {
|
|
108
108
|
default: D(() => [
|
|
109
109
|
s("div", It, [
|
|
110
|
-
|
|
110
|
+
De(f.$slots, "prepend"),
|
|
111
111
|
o[6] || (o[6] = s("div", { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400 pr-4" }, "Min.", -1)),
|
|
112
|
-
s("div",
|
|
113
|
-
|
|
112
|
+
s("div", Dt, [
|
|
113
|
+
Ve(s("input", {
|
|
114
114
|
type: "text",
|
|
115
115
|
ref_key: "minInputRef",
|
|
116
116
|
ref: M,
|
|
117
|
-
onFocus: o[0] || (o[0] = () =>
|
|
118
|
-
onBlur: o[1] || (o[1] = () =>
|
|
117
|
+
onFocus: o[0] || (o[0] = () => x.value = !0),
|
|
118
|
+
onBlur: o[1] || (o[1] = () => x.value = !1),
|
|
119
119
|
"onUpdate:modelValue": o[2] || (o[2] = (i) => a.value = i),
|
|
120
|
-
class:
|
|
120
|
+
class: me({
|
|
121
121
|
"fm-text-field--input fm-typo-en-body-lg-400": !0,
|
|
122
|
-
"text-fm-color-typo-primary": !
|
|
123
|
-
"text-fm-color-typo-disabled":
|
|
122
|
+
"text-fm-color-typo-primary": !L.value,
|
|
123
|
+
"text-fm-color-typo-disabled": L.value
|
|
124
124
|
})
|
|
125
125
|
}, null, 34), [
|
|
126
|
-
[
|
|
126
|
+
[Ae, a.value]
|
|
127
127
|
])
|
|
128
128
|
]),
|
|
129
129
|
o[7] || (o[7] = s("div", { class: "block h-32 mx-4 w-[1px] bg-fm-color-neutral-gray-200" }, null, -1)),
|
|
130
130
|
o[8] || (o[8] = s("div", { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400 pr-4" }, "Max.", -1)),
|
|
131
|
-
s("div",
|
|
132
|
-
|
|
131
|
+
s("div", Vt, [
|
|
132
|
+
Ve(s("input", {
|
|
133
133
|
type: "text",
|
|
134
134
|
ref_key: "maxInputRef",
|
|
135
135
|
ref: w,
|
|
136
136
|
onFocus: o[3] || (o[3] = () => F.value = !0),
|
|
137
137
|
onBlur: o[4] || (o[4] = () => F.value = !1),
|
|
138
138
|
"onUpdate:modelValue": o[5] || (o[5] = (i) => v.value = i),
|
|
139
|
-
class:
|
|
139
|
+
class: me({
|
|
140
140
|
"fm-text-field--input fm-typo-en-body-lg-400": !0,
|
|
141
|
-
"text-fm-color-typo-primary": !
|
|
142
|
-
"text-fm-color-typo-disabled":
|
|
141
|
+
"text-fm-color-typo-primary": !L.value,
|
|
142
|
+
"text-fm-color-typo-disabled": L.value
|
|
143
143
|
})
|
|
144
144
|
}, null, 34), [
|
|
145
|
-
[
|
|
145
|
+
[Ae, v.value]
|
|
146
146
|
])
|
|
147
147
|
]),
|
|
148
|
-
|
|
148
|
+
De(f.$slots, "append")
|
|
149
149
|
])
|
|
150
150
|
]),
|
|
151
151
|
_: 3
|
|
152
152
|
}, 8, ["focused"])
|
|
153
153
|
]),
|
|
154
|
-
d(
|
|
154
|
+
d(p, {
|
|
155
155
|
class: "flex-1",
|
|
156
156
|
"model-value": c.value,
|
|
157
|
-
info:
|
|
157
|
+
info: f.labelInfo,
|
|
158
158
|
rules: q.value,
|
|
159
|
-
"helper-text":
|
|
160
|
-
"helper-state":
|
|
159
|
+
"helper-text": f.helperText,
|
|
160
|
+
"helper-state": f.helperState
|
|
161
161
|
}, null, 8, ["model-value", "info", "rules", "helper-text", "helper-state"])
|
|
162
162
|
]);
|
|
163
163
|
};
|
|
164
164
|
}
|
|
165
165
|
});
|
|
166
|
-
function
|
|
166
|
+
function Rt() {
|
|
167
167
|
return function(y) {
|
|
168
168
|
return !y || !y.min || !y.max ? "Required" : !0;
|
|
169
169
|
};
|
|
170
170
|
}
|
|
171
|
-
function
|
|
171
|
+
function Ot(m, y) {
|
|
172
172
|
return function(l) {
|
|
173
173
|
return !l || !l.min || !l.max ? !0 : +G(l.min) < m ? `Must be between ${m} and ${y}` : +G(l.max) > y ? `Must be between ${m} and ${y}` : !0;
|
|
174
174
|
};
|
|
175
175
|
}
|
|
176
|
-
var
|
|
177
|
-
function
|
|
178
|
-
const { t: y } = Z(), u =
|
|
179
|
-
|
|
176
|
+
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 || {});
|
|
177
|
+
function Pt(m) {
|
|
178
|
+
const { t: y } = Z(), u = Ze({});
|
|
179
|
+
Ee(), xe(() => {
|
|
180
180
|
for (const c of m.items) {
|
|
181
181
|
if (!c.totalCost)
|
|
182
182
|
continue;
|
|
183
|
-
const n =
|
|
183
|
+
const n = He(c.sku, c.quantity, c.measurement, {
|
|
184
184
|
supplier: m.supplier
|
|
185
|
-
}), a = c.totalCost ??
|
|
185
|
+
}), a = c.totalCost ?? qe.reset();
|
|
186
186
|
n ? u[c.sku._id] = n.amount !== a.amount || n.precision !== a.precision : u[c.sku._id] = !0;
|
|
187
187
|
}
|
|
188
188
|
});
|
|
@@ -236,7 +236,7 @@ function Ot(m) {
|
|
|
236
236
|
minSize: 200,
|
|
237
237
|
cell(c) {
|
|
238
238
|
const n = c.row.original;
|
|
239
|
-
return J(
|
|
239
|
+
return J(pt, {
|
|
240
240
|
style: {
|
|
241
241
|
flex: "1 1 0%"
|
|
242
242
|
},
|
|
@@ -255,7 +255,7 @@ function Ot(m) {
|
|
|
255
255
|
});
|
|
256
256
|
},
|
|
257
257
|
rules: [
|
|
258
|
-
|
|
258
|
+
ft(
|
|
259
259
|
+G(
|
|
260
260
|
n.minimumQuantity ?? {
|
|
261
261
|
amount: 1,
|
|
@@ -263,7 +263,7 @@ function Ot(m) {
|
|
|
263
263
|
}
|
|
264
264
|
)
|
|
265
265
|
),
|
|
266
|
-
|
|
266
|
+
yt(
|
|
267
267
|
n.maximumQuantity ? +G(n.maximumQuantity) : 1 / 0
|
|
268
268
|
)
|
|
269
269
|
],
|
|
@@ -279,7 +279,7 @@ function Ot(m) {
|
|
|
279
279
|
minSize: 280,
|
|
280
280
|
cell(c) {
|
|
281
281
|
const n = c.row.original;
|
|
282
|
-
return J(
|
|
282
|
+
return J(At, {
|
|
283
283
|
style: {
|
|
284
284
|
flex: "1 1 0%"
|
|
285
285
|
},
|
|
@@ -295,8 +295,8 @@ function Ot(m) {
|
|
|
295
295
|
a != null && a.min && (v.minimumQuantity = a.min), a != null && a.max && (v.maximumQuantity = a.max), m.updateItem(v);
|
|
296
296
|
},
|
|
297
297
|
rules: [
|
|
298
|
-
|
|
299
|
-
|
|
298
|
+
Rt(),
|
|
299
|
+
Ot(
|
|
300
300
|
+G({
|
|
301
301
|
amount: 1,
|
|
302
302
|
precision: de(n.sku.unit, n.measurement)
|
|
@@ -316,20 +316,20 @@ function Ot(m) {
|
|
|
316
316
|
cell(c) {
|
|
317
317
|
const n = c.row.original;
|
|
318
318
|
return J(ue.FmTextField, {
|
|
319
|
-
modelValue: G(n.quantityStep ??
|
|
319
|
+
modelValue: G(n.quantityStep ?? qe.reset(), !1),
|
|
320
320
|
key: n.sku._id,
|
|
321
321
|
"onUpdate:modelValue": (a) => {
|
|
322
322
|
m.updateItem({
|
|
323
323
|
...n,
|
|
324
|
-
quantityStep:
|
|
324
|
+
quantityStep: vt(+a)
|
|
325
325
|
});
|
|
326
326
|
},
|
|
327
327
|
rules: [
|
|
328
|
-
|
|
328
|
+
Ue({
|
|
329
329
|
amount: 1,
|
|
330
330
|
precision: de(n.sku.unit, n.measurement)
|
|
331
331
|
}),
|
|
332
|
-
|
|
332
|
+
bt(n.sku.unit, n.measurement)
|
|
333
333
|
]
|
|
334
334
|
});
|
|
335
335
|
},
|
|
@@ -482,10 +482,10 @@ function Ot(m) {
|
|
|
482
482
|
}
|
|
483
483
|
];
|
|
484
484
|
return {
|
|
485
|
-
columnDefs:
|
|
485
|
+
columnDefs: V(() => ge().enableTotalCost && m.transferType === pe.PURCHASE ? l : l.filter((n) => n.id !== "Cost"))
|
|
486
486
|
};
|
|
487
487
|
}
|
|
488
|
-
const
|
|
488
|
+
const Bt = { class: "flex flex-col gap-8 py-16" }, qt = { class: "flex items-center" }, Ut = { class: "flex-1 flex gap-1 items-center" }, Nt = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Et = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, zt = { class: "flex gap-8 w-full" }, jt = { class: "flex-1 flex flex-col gap-4" }, Qt = { class: "flex-1 flex flex-col gap-4" }, Ht = { class: "flex gap-8 w-full" }, Gt = { class: "flex-1 flex flex-col gap-4" }, Yt = { class: "flex-1 flex flex-col gap-4" }, Wt = { class: "flex gap-8 w-full" }, Kt = { class: "flex-1 flex flex-col gap-4" }, Zt = { class: "flex-1 flex flex-col gap-4" }, Jt = /* @__PURE__ */ X({
|
|
489
489
|
__name: "TransferTemplateItem",
|
|
490
490
|
props: {
|
|
491
491
|
cellByColId: {},
|
|
@@ -494,88 +494,88 @@ const Pt = { class: "flex flex-col gap-8 py-16" }, Bt = { class: "flex items-cen
|
|
|
494
494
|
setup(m) {
|
|
495
495
|
const { t: y } = Z();
|
|
496
496
|
return (u, l) => {
|
|
497
|
-
var c, n, a, v, b, g,
|
|
498
|
-
const
|
|
499
|
-
return
|
|
500
|
-
s("div",
|
|
501
|
-
s("div",
|
|
502
|
-
s("span",
|
|
503
|
-
s("span",
|
|
497
|
+
var c, n, a, v, b, g, L, M, w, x, F, R, q, f, o, t, r, p, i, h, O, I, T, B, z, j, k, Q, Y, ee, te, W, oe, K, se;
|
|
498
|
+
const _ = S("FmLabel");
|
|
499
|
+
return C(), P("div", Bt, [
|
|
500
|
+
s("div", qt, [
|
|
501
|
+
s("div", Ut, [
|
|
502
|
+
s("span", Nt, " (" + $(u.row.original.sku.code) + ") ", 1),
|
|
503
|
+
s("span", Et, $(u.row.original.sku.name), 1)
|
|
504
504
|
]),
|
|
505
505
|
s("div", null, [
|
|
506
|
-
d(e(
|
|
506
|
+
d(e(N), {
|
|
507
507
|
render: (a = (n = (c = u.cellByColId.Delete) == null ? void 0 : c.column) == null ? void 0 : n.columnDef) == null ? void 0 : a.cell,
|
|
508
508
|
props: (b = (v = u.cellByColId.Delete) == null ? void 0 : v.getContext) == null ? void 0 : b.call(v)
|
|
509
509
|
}, null, 8, ["render", "props"])
|
|
510
510
|
])
|
|
511
511
|
]),
|
|
512
|
-
s("div",
|
|
513
|
-
s("div",
|
|
514
|
-
d(
|
|
515
|
-
label: e(y)(`inventory.transfer.form.items.table.${e(
|
|
512
|
+
s("div", zt, [
|
|
513
|
+
s("div", jt, [
|
|
514
|
+
d(_, {
|
|
515
|
+
label: e(y)(`inventory.transfer.form.items.table.${e(A).Code}`)
|
|
516
516
|
}, null, 8, ["label"]),
|
|
517
|
-
d(e(
|
|
518
|
-
render: (M = (
|
|
519
|
-
props: (
|
|
517
|
+
d(e(N), {
|
|
518
|
+
render: (M = (L = (g = u.cellByColId[e(A).Code]) == null ? void 0 : g.column) == null ? void 0 : L.columnDef) == null ? void 0 : M.cell,
|
|
519
|
+
props: (x = (w = u.cellByColId[e(A).Code]) == null ? void 0 : w.getContext) == null ? void 0 : x.call(w)
|
|
520
520
|
}, null, 8, ["render", "props"]),
|
|
521
521
|
l[0] || (l[0] = s("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
522
522
|
]),
|
|
523
|
-
s("div",
|
|
524
|
-
d(
|
|
525
|
-
label: e(y)(`inventory.transfer.form.items.table.${e(
|
|
523
|
+
s("div", Qt, [
|
|
524
|
+
d(_, {
|
|
525
|
+
label: e(y)(`inventory.transfer.form.items.table.${e(A).Name}`)
|
|
526
526
|
}, null, 8, ["label"]),
|
|
527
|
-
d(e(
|
|
528
|
-
render: (q = (R = (F = u.cellByColId[e(
|
|
529
|
-
props: (o = (
|
|
527
|
+
d(e(N), {
|
|
528
|
+
render: (q = (R = (F = u.cellByColId[e(A).Name]) == null ? void 0 : F.column) == null ? void 0 : R.columnDef) == null ? void 0 : q.cell,
|
|
529
|
+
props: (o = (f = u.cellByColId[e(A).Name]) == null ? void 0 : f.getContext) == null ? void 0 : o.call(f)
|
|
530
530
|
}, null, 8, ["render", "props"]),
|
|
531
531
|
l[1] || (l[1] = s("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
532
532
|
])
|
|
533
533
|
]),
|
|
534
|
-
s("div",
|
|
535
|
-
s("div",
|
|
536
|
-
d(
|
|
537
|
-
label: e(y)(`inventory.transfer.form.items.table.${e(
|
|
534
|
+
s("div", Ht, [
|
|
535
|
+
s("div", Gt, [
|
|
536
|
+
d(_, {
|
|
537
|
+
label: e(y)(`inventory.transfer.form.items.table.${e(A).Limit}`)
|
|
538
538
|
}, null, 8, ["label"]),
|
|
539
|
-
d(e(
|
|
540
|
-
render: (
|
|
541
|
-
props: (
|
|
539
|
+
d(e(N), {
|
|
540
|
+
render: (p = (r = (t = u.cellByColId[e(A).Limit]) == null ? void 0 : t.column) == null ? void 0 : r.columnDef) == null ? void 0 : p.cell,
|
|
541
|
+
props: (h = (i = u.cellByColId[e(A).Limit]) == null ? void 0 : i.getContext) == null ? void 0 : h.call(i)
|
|
542
542
|
}, null, 8, ["render", "props"]),
|
|
543
543
|
l[2] || (l[2] = s("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
544
544
|
]),
|
|
545
|
-
s("div",
|
|
546
|
-
d(
|
|
547
|
-
label: e(y)(`inventory.transfer.form.items.table.${e(
|
|
545
|
+
s("div", Yt, [
|
|
546
|
+
d(_, {
|
|
547
|
+
label: e(y)(`inventory.transfer.form.items.table.${e(A).Step}`)
|
|
548
548
|
}, null, 8, ["label"]),
|
|
549
|
-
d(e(
|
|
550
|
-
render: (
|
|
551
|
-
props: (
|
|
549
|
+
d(e(N), {
|
|
550
|
+
render: (T = (I = (O = u.cellByColId[e(A).Step]) == null ? void 0 : O.column) == null ? void 0 : I.columnDef) == null ? void 0 : T.cell,
|
|
551
|
+
props: (z = (B = u.cellByColId[e(A).Step]) == null ? void 0 : B.getContext) == null ? void 0 : z.call(B)
|
|
552
552
|
}, null, 8, ["render", "props"]),
|
|
553
553
|
l[3] || (l[3] = s("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
554
554
|
])
|
|
555
555
|
]),
|
|
556
|
-
s("div",
|
|
557
|
-
s("div",
|
|
558
|
-
d(
|
|
559
|
-
label: e(y)(`inventory.transfer.form.items.table.${e(
|
|
556
|
+
s("div", Wt, [
|
|
557
|
+
s("div", Kt, [
|
|
558
|
+
d(_, {
|
|
559
|
+
label: e(y)(`inventory.transfer.form.items.table.${e(A).DefaultAmount}`)
|
|
560
560
|
}, null, 8, ["label"]),
|
|
561
|
-
d(e(
|
|
562
|
-
render: (Q = (k = (
|
|
563
|
-
props: (ee = (Y = u.cellByColId[e(
|
|
561
|
+
d(e(N), {
|
|
562
|
+
render: (Q = (k = (j = u.cellByColId[e(A).DefaultAmount]) == null ? void 0 : j.column) == null ? void 0 : k.columnDef) == null ? void 0 : Q.cell,
|
|
563
|
+
props: (ee = (Y = u.cellByColId[e(A).DefaultAmount]) == null ? void 0 : Y.getContext) == null ? void 0 : ee.call(Y)
|
|
564
564
|
}, null, 8, ["render", "props"]),
|
|
565
565
|
l[4] || (l[4] = s("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
566
566
|
]),
|
|
567
|
-
s("div",
|
|
568
|
-
d(
|
|
567
|
+
s("div", Zt, [
|
|
568
|
+
d($t, { "z-index": 50 }, {
|
|
569
569
|
default: D(() => [
|
|
570
|
-
d(
|
|
571
|
-
label: e(y)(`inventory.transfer.form.items.table.${e(
|
|
570
|
+
d(_, {
|
|
571
|
+
label: e(y)(`inventory.transfer.form.items.table.${e(A).Cost}2`)
|
|
572
572
|
}, null, 8, ["label"])
|
|
573
573
|
]),
|
|
574
574
|
_: 1
|
|
575
575
|
}),
|
|
576
|
-
d(e(
|
|
577
|
-
render: (oe = (
|
|
578
|
-
props: (se = (K = u.cellByColId[e(
|
|
576
|
+
d(e(N), {
|
|
577
|
+
render: (oe = (W = (te = u.cellByColId[e(A).Cost]) == null ? void 0 : te.column) == null ? void 0 : W.columnDef) == null ? void 0 : oe.cell,
|
|
578
|
+
props: (se = (K = u.cellByColId[e(A).Cost]) == null ? void 0 : K.getContext) == null ? void 0 : se.call(K)
|
|
579
579
|
}, null, 8, ["render", "props"]),
|
|
580
580
|
l[5] || (l[5] = s("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
581
581
|
])
|
|
@@ -584,8 +584,8 @@ const Pt = { class: "flex flex-col gap-8 py-16" }, Bt = { class: "flex items-cen
|
|
|
584
584
|
};
|
|
585
585
|
}
|
|
586
586
|
});
|
|
587
|
-
function
|
|
588
|
-
const y =
|
|
587
|
+
function Ye(m) {
|
|
588
|
+
const y = ze(), u = ye(), { t: l } = Z(), _ = V({
|
|
589
589
|
get() {
|
|
590
590
|
return Array.isArray(m.getLocations());
|
|
591
591
|
},
|
|
@@ -597,7 +597,7 @@ function Ge(m) {
|
|
|
597
597
|
var v;
|
|
598
598
|
y.open({
|
|
599
599
|
title: "Select at least one location",
|
|
600
|
-
contentComponent:
|
|
600
|
+
contentComponent: Ne,
|
|
601
601
|
contentComponentProps: {
|
|
602
602
|
modelValue: ((v = n.value) == null ? void 0 : v.map((b) => b.doc._id)) ?? [],
|
|
603
603
|
items: u.locations.map((b) => ({
|
|
@@ -618,7 +618,7 @@ function Ge(m) {
|
|
|
618
618
|
m.setLocations(u.locations.filter((g) => b.includes(g.doc._id)));
|
|
619
619
|
});
|
|
620
620
|
}
|
|
621
|
-
const n =
|
|
621
|
+
const n = V(() => {
|
|
622
622
|
var b;
|
|
623
623
|
const v = /* @__PURE__ */ new Set([...u.locations.map((g) => g.doc._id)]);
|
|
624
624
|
return (b = m.getLocations()) == null ? void 0 : b.filter((g) => v.has(g.doc._id));
|
|
@@ -629,23 +629,23 @@ function Ge(m) {
|
|
|
629
629
|
}
|
|
630
630
|
return {
|
|
631
631
|
enabledLocations: n,
|
|
632
|
-
enabledLocationsSwitch:
|
|
632
|
+
enabledLocationsSwitch: _,
|
|
633
633
|
promptSelectLocations: c,
|
|
634
634
|
removeLocation: a
|
|
635
635
|
};
|
|
636
636
|
}
|
|
637
|
-
const
|
|
637
|
+
const Xt = { class: "flex flex-col gap-16" }, eo = { key: 0 }, to = { class: "flex flex-col gap-24" }, oo = {
|
|
638
638
|
key: 0,
|
|
639
639
|
class: "p-16 border border-fm-color-neutral-gray-300 fm-corner-radius-md flex flex-col gap-16"
|
|
640
|
-
},
|
|
640
|
+
}, so = { key: 1 }, no = { class: "flex flex-col gap-16" }, lo = { class: "flex" }, ao = { class: "flex-1 gap-8 fm-typo-en-title-sm-800" }, ro = /* @__PURE__ */ X({
|
|
641
641
|
__name: "TransferTemplateForm",
|
|
642
642
|
props: {
|
|
643
643
|
modelValue: {},
|
|
644
644
|
disabled: { type: Boolean }
|
|
645
645
|
},
|
|
646
646
|
setup(m, { expose: y }) {
|
|
647
|
-
const u = m, l =
|
|
648
|
-
|
|
647
|
+
const u = m, l = Qe(), { t: _ } = Z(), c = ye(), n = _t(), a = Ct(), v = V(() => c.businessLevel);
|
|
648
|
+
fe(
|
|
649
649
|
() => u.modelValue,
|
|
650
650
|
(o) => {
|
|
651
651
|
console.log("TransferTemplateForm.model", o);
|
|
@@ -653,14 +653,14 @@ const Jt = { class: "flex flex-col gap-16" }, Xt = { key: 0 }, eo = { class: "fl
|
|
|
653
653
|
), c.watchLocation(async () => {
|
|
654
654
|
location && (l.purchaseOrder.supplier || (l.purchaseOrder.supplier = a.suppliers.find((o) => o) ?? l.purchaseOrder.supplier));
|
|
655
655
|
});
|
|
656
|
-
const b =
|
|
656
|
+
const b = ze(), { enabledLocations: g, enabledLocationsSwitch: L, promptSelectLocations: M, removeLocation: w } = Ye({
|
|
657
657
|
getLocations() {
|
|
658
658
|
return l.locations;
|
|
659
659
|
},
|
|
660
660
|
setLocations(o) {
|
|
661
661
|
l.locations = o;
|
|
662
662
|
}
|
|
663
|
-
}),
|
|
663
|
+
}), x = V({
|
|
664
664
|
get() {
|
|
665
665
|
return l.purchaseOrder.remark ?? void 0;
|
|
666
666
|
},
|
|
@@ -682,7 +682,7 @@ const Jt = { class: "flex flex-col gap-16" }, Xt = { key: 0 }, eo = { class: "fl
|
|
|
682
682
|
(t = (o = F.value) == null ? void 0 : o.resetInputs) == null || t.call(o);
|
|
683
683
|
}
|
|
684
684
|
});
|
|
685
|
-
const R =
|
|
685
|
+
const R = Pt({
|
|
686
686
|
updateItem: (o) => {
|
|
687
687
|
l.purchaseOrder.items = l.purchaseOrder.items.map((t) => t.sku._id !== o.sku._id ? t : o);
|
|
688
688
|
},
|
|
@@ -698,129 +698,129 @@ const Jt = { class: "flex flex-col gap-16" }, Xt = { key: 0 }, eo = { class: "fl
|
|
|
698
698
|
return l.purchaseOrder.items;
|
|
699
699
|
},
|
|
700
700
|
get transferType() {
|
|
701
|
-
return
|
|
701
|
+
return pe.PURCHASE;
|
|
702
702
|
},
|
|
703
703
|
get disabled() {
|
|
704
704
|
return u.disabled;
|
|
705
705
|
}
|
|
706
|
-
}), q =
|
|
707
|
-
function
|
|
706
|
+
}), q = V(() => R.columnDefs.value);
|
|
707
|
+
function f() {
|
|
708
708
|
const o = n.skus.map((r) => ({
|
|
709
709
|
label: r.name,
|
|
710
710
|
sublabel: r.code,
|
|
711
711
|
value: r
|
|
712
712
|
})), t = o.filter((r) => {
|
|
713
|
-
var
|
|
714
|
-
return (
|
|
713
|
+
var p;
|
|
714
|
+
return (p = l.purchaseOrder.items) == null ? void 0 : p.find((i) => i.sku._id === r.value._id);
|
|
715
715
|
}).map((r) => r.value);
|
|
716
716
|
b.open({
|
|
717
|
-
title:
|
|
717
|
+
title: _("inventory.transfer.form.items.selectItem"),
|
|
718
718
|
closeButton: !0,
|
|
719
|
-
contentComponent:
|
|
719
|
+
contentComponent: Ne,
|
|
720
720
|
contentComponentProps: {
|
|
721
721
|
modelValue: t,
|
|
722
722
|
items: o
|
|
723
723
|
},
|
|
724
724
|
primaryActions: {
|
|
725
|
-
text:
|
|
725
|
+
text: _("common.confirm"),
|
|
726
726
|
close: !0
|
|
727
727
|
},
|
|
728
728
|
secondaryActions: {
|
|
729
|
-
text:
|
|
729
|
+
text: _("common.close"),
|
|
730
730
|
close: !0,
|
|
731
731
|
variant: "tertiary"
|
|
732
732
|
}
|
|
733
733
|
}).onPrimary((r) => {
|
|
734
|
-
const
|
|
735
|
-
const
|
|
736
|
-
if (
|
|
737
|
-
return
|
|
738
|
-
const
|
|
739
|
-
sku:
|
|
740
|
-
code:
|
|
741
|
-
name:
|
|
742
|
-
quantity:
|
|
743
|
-
minimumQuantity:
|
|
744
|
-
maximumQuantity:
|
|
745
|
-
quantityStep:
|
|
734
|
+
const p = l.purchaseOrder.items ?? [], i = r.map((h) => {
|
|
735
|
+
const O = p.find((B) => B.sku._id === h._id);
|
|
736
|
+
if (O)
|
|
737
|
+
return O;
|
|
738
|
+
const I = { amount: 1, precision: de(h.unit) }, T = {
|
|
739
|
+
sku: h,
|
|
740
|
+
code: h.code,
|
|
741
|
+
name: h.name,
|
|
742
|
+
quantity: I,
|
|
743
|
+
minimumQuantity: I,
|
|
744
|
+
maximumQuantity: I,
|
|
745
|
+
quantityStep: I
|
|
746
746
|
};
|
|
747
|
-
return
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
747
|
+
return T.totalCost = He(
|
|
748
|
+
T.sku,
|
|
749
|
+
T.quantity,
|
|
750
|
+
T.measurement,
|
|
751
751
|
{
|
|
752
752
|
supplier: l.purchaseOrder.supplier
|
|
753
753
|
}
|
|
754
|
-
),
|
|
754
|
+
), T;
|
|
755
755
|
});
|
|
756
|
-
i.sort((
|
|
756
|
+
i.sort((h, O) => h.sku.code.localeCompare(O.sku.code)), l.purchaseOrder.items = i;
|
|
757
757
|
});
|
|
758
758
|
}
|
|
759
759
|
return (o, t) => {
|
|
760
|
-
const r = S("FmChip"),
|
|
761
|
-
return
|
|
760
|
+
const r = S("FmChip"), p = S("FmTextField"), i = S("FmTextarea"), h = S("FmSwitch"), O = S("FmButton"), I = S("FmListItem"), T = S("FmList"), B = S("FmFormGroup"), z = S("FmTable"), j = S("FmForm");
|
|
761
|
+
return C(), E(j, {
|
|
762
762
|
ref_key: "formRef",
|
|
763
763
|
ref: F,
|
|
764
764
|
class: "flex flex-col gap-32",
|
|
765
765
|
disabled: o.disabled
|
|
766
766
|
}, {
|
|
767
767
|
default: D(() => [
|
|
768
|
-
s("div",
|
|
769
|
-
v.value ? (
|
|
768
|
+
s("div", Xt, [
|
|
769
|
+
v.value ? (C(), P("div", eo, [
|
|
770
770
|
d(r, {
|
|
771
771
|
label: "Business template",
|
|
772
772
|
compact: ""
|
|
773
773
|
})
|
|
774
774
|
])) : H("", !0),
|
|
775
|
-
s("div",
|
|
776
|
-
d(
|
|
777
|
-
label: e(
|
|
775
|
+
s("div", to, [
|
|
776
|
+
d(p, {
|
|
777
|
+
label: e(_)("inventory.transfer.form.name"),
|
|
778
778
|
"label-mark": "required",
|
|
779
779
|
modelValue: e(l).name,
|
|
780
780
|
"onUpdate:modelValue": t[0] || (t[0] = (k) => e(l).name = k),
|
|
781
781
|
rules: [e(_e)()]
|
|
782
782
|
}, null, 8, ["label", "modelValue", "rules"]),
|
|
783
|
-
d(
|
|
784
|
-
label: e(
|
|
783
|
+
d(p, {
|
|
784
|
+
label: e(_)("inventory.transfer.form.reference"),
|
|
785
785
|
"label-mark": "optional",
|
|
786
786
|
modelValue: e(l).purchaseOrder.ref,
|
|
787
787
|
"onUpdate:modelValue": t[1] || (t[1] = (k) => e(l).purchaseOrder.ref = k)
|
|
788
788
|
}, null, 8, ["label", "modelValue"]),
|
|
789
789
|
d(i, {
|
|
790
|
-
label: e(
|
|
790
|
+
label: e(_)("inventory.transfer.form.remark"),
|
|
791
791
|
"label-mark": "optional",
|
|
792
792
|
"max-length": 240,
|
|
793
|
-
modelValue:
|
|
794
|
-
"onUpdate:modelValue": t[2] || (t[2] = (k) =>
|
|
795
|
-
class:
|
|
793
|
+
modelValue: x.value,
|
|
794
|
+
"onUpdate:modelValue": t[2] || (t[2] = (k) => x.value = k),
|
|
795
|
+
class: me({ "text-fm-color-typo-disabled": o.disabled })
|
|
796
796
|
}, null, 8, ["label", "modelValue", "class"])
|
|
797
797
|
])
|
|
798
798
|
]),
|
|
799
|
-
e(c).businessLevel ? (
|
|
800
|
-
d(
|
|
801
|
-
modelValue: e(
|
|
802
|
-
"onUpdate:modelValue": t[3] || (t[3] = (k) => he(
|
|
799
|
+
e(c).businessLevel ? (C(), P("div", oo, [
|
|
800
|
+
d(h, {
|
|
801
|
+
modelValue: e(L),
|
|
802
|
+
"onUpdate:modelValue": t[3] || (t[3] = (k) => he(L) ? L.value = k : null),
|
|
803
803
|
label: "Locations rule",
|
|
804
804
|
sublabel: "Enable template for specific locations only",
|
|
805
805
|
"label-placement": "right"
|
|
806
806
|
}, null, 8, ["modelValue"]),
|
|
807
|
-
e(
|
|
807
|
+
e(L) ? (C(), E(B, {
|
|
808
808
|
key: 0,
|
|
809
809
|
modelValue: e(g),
|
|
810
|
-
rules: [e(
|
|
810
|
+
rules: [e(Ue)(1)],
|
|
811
811
|
class: "flex-1 flex gap-8 h-48 xs:flex-col xs:pt-16 sm:flex-col sm:pt-16"
|
|
812
812
|
}, {
|
|
813
813
|
default: D(() => [
|
|
814
|
-
d(
|
|
814
|
+
d(T, null, {
|
|
815
815
|
default: D(() => [
|
|
816
|
-
(
|
|
816
|
+
(C(!0), P(ce, null, be(e(g), (k) => (C(), E(I, {
|
|
817
817
|
key: k.doc._id,
|
|
818
818
|
label: k.name,
|
|
819
819
|
sublabel: k.type,
|
|
820
820
|
disabled: o.disabled
|
|
821
821
|
}, {
|
|
822
822
|
append: D(() => [
|
|
823
|
-
d(
|
|
823
|
+
d(O, {
|
|
824
824
|
"prepend-icon": "delete",
|
|
825
825
|
variant: "tertiary",
|
|
826
826
|
disabled: o.disabled,
|
|
@@ -835,10 +835,10 @@ const Jt = { class: "flex flex-col gap-16" }, Xt = { key: 0 }, eo = { class: "fl
|
|
|
835
835
|
]),
|
|
836
836
|
_: 1
|
|
837
837
|
}, 8, ["modelValue", "rules"])) : H("", !0),
|
|
838
|
-
e(
|
|
839
|
-
d(
|
|
838
|
+
e(L) ? (C(), P("div", so, [
|
|
839
|
+
d(O, {
|
|
840
840
|
disabled: o.disabled,
|
|
841
|
-
label: e(
|
|
841
|
+
label: e(_)("inventory.transfer.form.items.addItem"),
|
|
842
842
|
"prepend-icon": "add",
|
|
843
843
|
variant: "plain",
|
|
844
844
|
class: "border-2 rounded-lg border-fm-color-primary",
|
|
@@ -846,32 +846,32 @@ const Jt = { class: "flex flex-col gap-16" }, Xt = { key: 0 }, eo = { class: "fl
|
|
|
846
846
|
}, null, 8, ["disabled", "label", "onClick"])
|
|
847
847
|
])) : H("", !0)
|
|
848
848
|
])) : H("", !0),
|
|
849
|
-
s("div",
|
|
850
|
-
s("div",
|
|
851
|
-
s("div",
|
|
852
|
-
d(
|
|
849
|
+
s("div", no, [
|
|
850
|
+
s("div", lo, [
|
|
851
|
+
s("div", ao, $(e(_)("inventory.transfer.form.items.title")), 1),
|
|
852
|
+
d(O, {
|
|
853
853
|
disabled: o.disabled,
|
|
854
|
-
label: e(
|
|
854
|
+
label: e(_)("inventory.transfer.form.items.addItem"),
|
|
855
855
|
"prepend-icon": "add",
|
|
856
856
|
variant: "plain",
|
|
857
857
|
class: "border-2 rounded-lg border-fm-color-primary",
|
|
858
|
-
onClick: t[4] || (t[4] = (k) =>
|
|
858
|
+
onClick: t[4] || (t[4] = (k) => f()),
|
|
859
859
|
size: "md"
|
|
860
860
|
}, null, 8, ["disabled", "label"])
|
|
861
861
|
]),
|
|
862
|
-
(
|
|
862
|
+
(C(), E(z, {
|
|
863
863
|
"column-defs": q.value,
|
|
864
864
|
"row-data": e(l).purchaseOrder.items,
|
|
865
865
|
key: e(l).purchaseOrder.items.map((k) => k.sku._id).join("."),
|
|
866
866
|
"hide-footer": ""
|
|
867
867
|
}, {
|
|
868
868
|
"list-row": D((k) => [
|
|
869
|
-
(
|
|
869
|
+
(C(), E(Ge, {
|
|
870
870
|
row: k,
|
|
871
871
|
key: e(l).purchaseOrder.items.map((Q) => Q.sku._id).join(".")
|
|
872
872
|
}, {
|
|
873
873
|
default: D((Q) => [
|
|
874
|
-
d(
|
|
874
|
+
d(Jt, {
|
|
875
875
|
row: k,
|
|
876
876
|
"cell-by-col-id": Q
|
|
877
877
|
}, null, 8, ["row", "cell-by-col-id"])
|
|
@@ -887,7 +887,7 @@ const Jt = { class: "flex flex-col gap-16" }, Xt = { key: 0 }, eo = { class: "fl
|
|
|
887
887
|
}, 8, ["disabled"]);
|
|
888
888
|
};
|
|
889
889
|
}
|
|
890
|
-
}),
|
|
890
|
+
}), io = { class: "flex items-center" }, uo = { class: "fm-typo-en-title-md-800" }, mo = { class: "flex gap-4" }, co = /* @__PURE__ */ X({
|
|
891
891
|
__name: "TransferTemplateDialog",
|
|
892
892
|
props: {
|
|
893
893
|
mode: {},
|
|
@@ -897,7 +897,7 @@ const Jt = { class: "flex flex-col gap-16" }, Xt = { key: 0 }, eo = { class: "fl
|
|
|
897
897
|
emits: ["update:show", "submitted"],
|
|
898
898
|
setup(m, { expose: y, emit: u }) {
|
|
899
899
|
var o;
|
|
900
|
-
const l = m,
|
|
900
|
+
const l = m, _ = u, c = at(), n = kt(), { t: a } = Z(), v = je(l, "show");
|
|
901
901
|
function b() {
|
|
902
902
|
return {
|
|
903
903
|
_id: "",
|
|
@@ -930,15 +930,15 @@ const Jt = { class: "flex flex-col gap-16" }, Xt = { key: 0 }, eo = { class: "fl
|
|
|
930
930
|
}
|
|
931
931
|
};
|
|
932
932
|
}
|
|
933
|
-
const g = U(l.modelValue ?? b()),
|
|
934
|
-
|
|
933
|
+
const g = U(l.modelValue ?? b()), L = U(((o = l.modelValue) == null ? void 0 : o._id) ?? `${Math.random()}`);
|
|
934
|
+
fe(
|
|
935
935
|
() => l.show,
|
|
936
936
|
(t) => {
|
|
937
937
|
var r;
|
|
938
|
-
t && (g.value = l.modelValue ?? b(),
|
|
938
|
+
t && (g.value = l.modelValue ?? b(), L.value = ((r = l.modelValue) == null ? void 0 : r._id) ?? `${Math.random()}`);
|
|
939
939
|
}
|
|
940
940
|
);
|
|
941
|
-
const M = U(!1), w =
|
|
941
|
+
const M = U(!1), w = V(() => {
|
|
942
942
|
switch (l.mode) {
|
|
943
943
|
case ne.READ:
|
|
944
944
|
return "";
|
|
@@ -948,34 +948,34 @@ const Jt = { class: "flex flex-col gap-16" }, Xt = { key: 0 }, eo = { class: "fl
|
|
|
948
948
|
return a("inventory.transfer.template.update.title");
|
|
949
949
|
}
|
|
950
950
|
return "";
|
|
951
|
-
}),
|
|
951
|
+
}), x = U();
|
|
952
952
|
y({
|
|
953
953
|
validateInputs: () => {
|
|
954
954
|
var t, r;
|
|
955
|
-
(r = (t =
|
|
955
|
+
(r = (t = x.value) == null ? void 0 : t.validateInputs) == null || r.call(t);
|
|
956
956
|
},
|
|
957
957
|
resetInputsValidation: () => {
|
|
958
958
|
var t, r;
|
|
959
|
-
(r = (t =
|
|
959
|
+
(r = (t = x.value) == null ? void 0 : t.resetInputsValidation) == null || r.call(t);
|
|
960
960
|
},
|
|
961
961
|
resetInputs: () => {
|
|
962
962
|
var t, r;
|
|
963
|
-
(r = (t =
|
|
963
|
+
(r = (t = x.value) == null ? void 0 : t.resetInputs) == null || r.call(t);
|
|
964
964
|
}
|
|
965
965
|
});
|
|
966
966
|
async function F() {
|
|
967
|
-
var r,
|
|
967
|
+
var r, p;
|
|
968
968
|
const t = g.value;
|
|
969
969
|
if (t) {
|
|
970
|
-
M.value = !0, (((r = t.purchaseOrder.supplier) == null ? void 0 : r.internal) === ie.enum.warehouse || ((
|
|
971
|
-
({ totalCost: i, ...
|
|
970
|
+
M.value = !0, (((r = t.purchaseOrder.supplier) == null ? void 0 : r.internal) === ie.enum.warehouse || ((p = t.purchaseOrder.supplier) == null ? void 0 : p.internal) === ie.enum.restaurant) && (t.purchaseOrder.items = t.purchaseOrder.items.map(
|
|
971
|
+
({ totalCost: i, ...h }) => h
|
|
972
972
|
));
|
|
973
973
|
try {
|
|
974
974
|
await c.createTemplate(t), await new Promise((i) => setTimeout(i, 1e3)), n.open({
|
|
975
975
|
title: a("inventory.transfer.template.create.success"),
|
|
976
976
|
message: a("inventory.transfer.template.create.successMessage"),
|
|
977
977
|
type: "success"
|
|
978
|
-
}),
|
|
978
|
+
}), _("update:show", !1), _("submitted");
|
|
979
979
|
} catch (i) {
|
|
980
980
|
n.open({
|
|
981
981
|
title: a("inventory.transfer.template.create.error"),
|
|
@@ -988,18 +988,18 @@ const Jt = { class: "flex flex-col gap-16" }, Xt = { key: 0 }, eo = { class: "fl
|
|
|
988
988
|
}
|
|
989
989
|
}
|
|
990
990
|
async function R() {
|
|
991
|
-
var r,
|
|
991
|
+
var r, p;
|
|
992
992
|
const t = g.value;
|
|
993
993
|
if (t) {
|
|
994
|
-
M.value = !0, (((r = t.purchaseOrder.supplier) == null ? void 0 : r.internal) === ie.enum.warehouse || ((
|
|
995
|
-
({ totalCost: i, ...
|
|
994
|
+
M.value = !0, (((r = t.purchaseOrder.supplier) == null ? void 0 : r.internal) === ie.enum.warehouse || ((p = t.purchaseOrder.supplier) == null ? void 0 : p.internal) === ie.enum.restaurant) && (t.purchaseOrder.items = t.purchaseOrder.items.map(
|
|
995
|
+
({ totalCost: i, ...h }) => h
|
|
996
996
|
));
|
|
997
997
|
try {
|
|
998
998
|
await c.updateTemplate(t), await new Promise((i) => setTimeout(i, 1e3)), n.open({
|
|
999
999
|
title: a("inventory.transfer.template.update.success"),
|
|
1000
1000
|
message: a("inventory.transfer.template.update.successMessage"),
|
|
1001
1001
|
type: "success"
|
|
1002
|
-
}),
|
|
1002
|
+
}), _("update:show", !1), _("submitted");
|
|
1003
1003
|
} catch (i) {
|
|
1004
1004
|
n.open({
|
|
1005
1005
|
title: a("inventory.transfer.template.update.error"),
|
|
@@ -1019,48 +1019,48 @@ const Jt = { class: "flex flex-col gap-16" }, Xt = { key: 0 }, eo = { class: "fl
|
|
|
1019
1019
|
return R();
|
|
1020
1020
|
}
|
|
1021
1021
|
}
|
|
1022
|
-
function
|
|
1022
|
+
function f() {
|
|
1023
1023
|
var t, r;
|
|
1024
|
-
(r = (t =
|
|
1024
|
+
(r = (t = x.value) == null ? void 0 : t.validateInputs) == null || r.call(t);
|
|
1025
1025
|
}
|
|
1026
1026
|
return (t, r) => {
|
|
1027
|
-
const
|
|
1028
|
-
return
|
|
1027
|
+
const p = S("FmButton"), i = S("FmSideSheet");
|
|
1028
|
+
return C(), E(i, {
|
|
1029
1029
|
modelValue: e(v),
|
|
1030
|
-
"onUpdate:modelValue": r[2] || (r[2] = (
|
|
1030
|
+
"onUpdate:modelValue": r[2] || (r[2] = (h) => he(v) ? v.value = h : null),
|
|
1031
1031
|
"dismiss-away": "",
|
|
1032
1032
|
"close-button": "",
|
|
1033
1033
|
"max-width": 1200
|
|
1034
1034
|
}, {
|
|
1035
1035
|
"side-sheet-header": D(() => [
|
|
1036
|
-
s("div",
|
|
1037
|
-
s("div",
|
|
1036
|
+
s("div", io, [
|
|
1037
|
+
s("div", uo, $(w.value), 1)
|
|
1038
1038
|
])
|
|
1039
1039
|
]),
|
|
1040
1040
|
default: D(() => [
|
|
1041
|
-
(
|
|
1041
|
+
(C(), E(ro, {
|
|
1042
1042
|
class: "w-full",
|
|
1043
1043
|
ref_key: "formRef",
|
|
1044
|
-
ref:
|
|
1044
|
+
ref: x,
|
|
1045
1045
|
onValidationSuccess: q,
|
|
1046
1046
|
"model-value": g.value,
|
|
1047
|
-
"onUpdate:modelValue": r[0] || (r[0] = (
|
|
1047
|
+
"onUpdate:modelValue": r[0] || (r[0] = (h) => g.value = h),
|
|
1048
1048
|
disabled: M.value,
|
|
1049
|
-
key:
|
|
1049
|
+
key: L.value
|
|
1050
1050
|
}, null, 8, ["model-value", "disabled"]))
|
|
1051
1051
|
]),
|
|
1052
1052
|
"side-sheet-footer": D(() => [
|
|
1053
|
-
s("div",
|
|
1054
|
-
d(
|
|
1053
|
+
s("div", mo, [
|
|
1054
|
+
d(p, {
|
|
1055
1055
|
loading: M.value,
|
|
1056
1056
|
label: e(a)("common.save"),
|
|
1057
|
-
onClick:
|
|
1057
|
+
onClick: f
|
|
1058
1058
|
}, null, 8, ["loading", "label"]),
|
|
1059
|
-
d(
|
|
1059
|
+
d(p, {
|
|
1060
1060
|
disabled: M.value,
|
|
1061
1061
|
variant: "tertiary",
|
|
1062
1062
|
label: e(a)("common.close"),
|
|
1063
|
-
onClick: r[1] || (r[1] = (
|
|
1063
|
+
onClick: r[1] || (r[1] = (h) => _("update:show", !1))
|
|
1064
1064
|
}, null, 8, ["disabled", "label"])
|
|
1065
1065
|
])
|
|
1066
1066
|
]),
|
|
@@ -1068,22 +1068,22 @@ const Jt = { class: "flex flex-col gap-16" }, Xt = { key: 0 }, eo = { class: "fl
|
|
|
1068
1068
|
}, 8, ["modelValue"]);
|
|
1069
1069
|
};
|
|
1070
1070
|
}
|
|
1071
|
-
}),
|
|
1071
|
+
}), po = { class: "flex flex-col gap-16 w-full h-full overflow-y-auto" }, fo = { class: "flex justify-between" }, yo = { class: "fm-typo-en-body-lg-600" }, vo = { class: "flex flex-col gap-8" }, bo = { class: "flex flex-col gap-4" }, _o = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, xo = { class: "flex gap-1" }, ho = { class: "fm-typo-en-body-lg-600" }, go = {
|
|
1072
1072
|
key: 0,
|
|
1073
1073
|
class: "flex flex-col gap-4"
|
|
1074
|
-
},
|
|
1074
|
+
}, ko = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, wo = { class: "fm-typo-en-body-lg-600" }, Fo = { class: "flex flex-col gap-4" }, To = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Co = { class: "fm-typo-en-body-lg-600" }, $o = {
|
|
1075
1075
|
key: 1,
|
|
1076
1076
|
class: "flex flex-col gap-4"
|
|
1077
|
-
},
|
|
1077
|
+
}, So = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Lo = { class: "fm-typo-en-body-lg-600" }, Mo = {
|
|
1078
1078
|
key: 2,
|
|
1079
1079
|
class: "flex flex-col gap-4"
|
|
1080
|
-
}, Io = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" },
|
|
1080
|
+
}, Io = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Do = { class: "fm-typo-en-body-lg-600" }, Vo = {
|
|
1081
1081
|
key: 3,
|
|
1082
1082
|
class: "flex flex-col gap-4"
|
|
1083
|
-
},
|
|
1083
|
+
}, Ao = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ro = { class: "fm-typo-en-body-lg-600" }, Oo = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" }, Po = { class: "flex flex-col gap-8" }, Bo = { class: "fm-typo-en-body-lg-600" }, qo = { class: "flex w-full gap-4" }, Uo = { class: "grow fm-typo-en-body-lg-400 line-clamp-2" }, No = { class: "fm-typo-en-body-lg-600 shrink-0" }, Eo = { class: "flex w-full gap-4 fm-typo-en-body-sm-400" }, zo = { class: "grow fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, jo = {
|
|
1084
1084
|
key: 0,
|
|
1085
1085
|
class: "shrink-0 fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
|
|
1086
|
-
},
|
|
1086
|
+
}, Qo = { class: "flex gap-8 xs:flex-col" }, Ho = /* @__PURE__ */ X({
|
|
1087
1087
|
__name: "TransferTemplateDetails",
|
|
1088
1088
|
props: {
|
|
1089
1089
|
template: {},
|
|
@@ -1091,82 +1091,82 @@ const Jt = { class: "flex flex-col gap-16" }, Xt = { key: 0 }, eo = { class: "fl
|
|
|
1091
1091
|
},
|
|
1092
1092
|
emits: ["update:show", "action:use", "action:edit"],
|
|
1093
1093
|
setup(m, { emit: y }) {
|
|
1094
|
-
const u = m, l = y,
|
|
1094
|
+
const u = m, l = y, _ = ge(), c = ye(), { t: n } = Z(), a = V(() => {
|
|
1095
1095
|
var w;
|
|
1096
1096
|
return (w = u.template) == null ? void 0 : w.purchaseOrder;
|
|
1097
|
-
}), { enabledLocations: v } =
|
|
1097
|
+
}), { enabledLocations: v } = Ye({
|
|
1098
1098
|
getLocations() {
|
|
1099
1099
|
var w;
|
|
1100
1100
|
return (w = u.template) == null ? void 0 : w.locations;
|
|
1101
1101
|
},
|
|
1102
1102
|
setLocations() {
|
|
1103
1103
|
}
|
|
1104
|
-
}), b =
|
|
1104
|
+
}), b = V(() => {
|
|
1105
1105
|
if (!c.businessLevel)
|
|
1106
1106
|
return [c.currentLocation];
|
|
1107
|
-
const w = Array.isArray(v.value) ? v.value : c.locations,
|
|
1108
|
-
return c.locations.filter((F) =>
|
|
1109
|
-
}), g =
|
|
1107
|
+
const w = Array.isArray(v.value) ? v.value : c.locations, x = /* @__PURE__ */ new Set([...w.map((F) => F.doc._id)]);
|
|
1108
|
+
return c.locations.filter((F) => x.has(F.doc._id));
|
|
1109
|
+
}), g = V(
|
|
1110
1110
|
() => {
|
|
1111
|
-
var w,
|
|
1112
|
-
return ((
|
|
1111
|
+
var w, x, F, R;
|
|
1112
|
+
return ((x = (w = a.value) == null ? void 0 : w.supplier) == null ? void 0 : x.internal) === "restaurant" || ((R = (F = a.value) == null ? void 0 : F.supplier) == null ? void 0 : R.internal) === "warehouse" ? pe.TRANSFER : pe.PURCHASE;
|
|
1113
1113
|
}
|
|
1114
|
-
),
|
|
1115
|
-
return (w,
|
|
1114
|
+
), L = U(!0), M = je(u, "show");
|
|
1115
|
+
return (w, x) => {
|
|
1116
1116
|
var r;
|
|
1117
|
-
const F = S("FmMenuDivider"), R = S("FmCard"), q = S("FmButton"),
|
|
1118
|
-
return
|
|
1117
|
+
const F = S("FmMenuDivider"), R = S("FmCard"), q = S("FmButton"), f = S("FmListItem"), o = S("FmList"), t = S("FmSideSheet");
|
|
1118
|
+
return C(), E(t, {
|
|
1119
1119
|
header: e(n)("inventory.transfer.template.details.view", { template: (r = w.template) == null ? void 0 : r.name }),
|
|
1120
1120
|
modelValue: e(M),
|
|
1121
|
-
"onUpdate:modelValue":
|
|
1122
|
-
"dismiss-away":
|
|
1121
|
+
"onUpdate:modelValue": x[1] || (x[1] = (p) => he(M) ? M.value = p : null),
|
|
1122
|
+
"dismiss-away": L.value,
|
|
1123
1123
|
"close-button": "",
|
|
1124
1124
|
"max-width": 500
|
|
1125
1125
|
}, {
|
|
1126
1126
|
default: D(() => {
|
|
1127
|
-
var
|
|
1127
|
+
var p;
|
|
1128
1128
|
return [
|
|
1129
|
-
s("div",
|
|
1129
|
+
s("div", po, [
|
|
1130
1130
|
s("div", null, [
|
|
1131
1131
|
d(R, {
|
|
1132
1132
|
variant: "outlined",
|
|
1133
1133
|
class: "flex flex-col gap-8 px-12 py-16"
|
|
1134
1134
|
}, {
|
|
1135
1135
|
default: D(() => {
|
|
1136
|
-
var i,
|
|
1136
|
+
var i, h, O, I, T, B, z, j, k;
|
|
1137
1137
|
return [
|
|
1138
|
-
s("div",
|
|
1139
|
-
s("div",
|
|
1138
|
+
s("div", fo, [
|
|
1139
|
+
s("div", yo, $(e(n)("inventory.transfer.template.details.templateSummary")), 1)
|
|
1140
1140
|
]),
|
|
1141
1141
|
d(F),
|
|
1142
|
-
s("div",
|
|
1143
|
-
s("div",
|
|
1144
|
-
s("div",
|
|
1145
|
-
s("div",
|
|
1142
|
+
s("div", vo, [
|
|
1143
|
+
s("div", bo, [
|
|
1144
|
+
s("div", _o, [
|
|
1145
|
+
s("div", xo, $(e(n)("inventory.transfer.receiveRequest.details.createdAt")), 1)
|
|
1146
1146
|
]),
|
|
1147
|
-
s("div",
|
|
1147
|
+
s("div", ho, $(e(rt)(((i = w.template) == null ? void 0 : i._id) ?? "")), 1)
|
|
1148
1148
|
]),
|
|
1149
|
-
(
|
|
1150
|
-
s("div",
|
|
1151
|
-
s("div",
|
|
1149
|
+
(h = a.value) != null && h.effectiveAt ? (C(), P("div", go, [
|
|
1150
|
+
s("div", ko, $(e(n)("inventory.transfer.receiveRequest.details.backdatedTo")), 1),
|
|
1151
|
+
s("div", wo, $(e(xt)(new Date((O = a.value) == null ? void 0 : O.effectiveAt))), 1)
|
|
1152
1152
|
])) : H("", !0),
|
|
1153
|
-
s("div",
|
|
1154
|
-
s("div",
|
|
1155
|
-
s("div",
|
|
1153
|
+
s("div", Fo, [
|
|
1154
|
+
s("div", To, $(e(n)("inventory.transfer.receiveRequest.details.type.title")), 1),
|
|
1155
|
+
s("div", Co, $(e(n)(
|
|
1156
1156
|
`inventory.transfer.receiveRequest.details.type.${g.value.toLocaleLowerCase("en-US")}`
|
|
1157
1157
|
)), 1)
|
|
1158
1158
|
]),
|
|
1159
|
-
(
|
|
1160
|
-
s("div",
|
|
1161
|
-
s("div",
|
|
1159
|
+
(T = (I = a.value) == null ? void 0 : I.supplier) != null && T.name ? (C(), P("div", $o, [
|
|
1160
|
+
s("div", So, $(e(n)("inventory.transfer.receiveRequest.details.from")), 1),
|
|
1161
|
+
s("div", Lo, $((z = (B = a.value) == null ? void 0 : B.supplier) == null ? void 0 : z.name), 1)
|
|
1162
1162
|
])) : H("", !0),
|
|
1163
|
-
(
|
|
1163
|
+
(j = a.value) != null && j.ref ? (C(), P("div", Mo, [
|
|
1164
1164
|
s("div", Io, $(e(n)("inventory.transfer.receiveRequest.details.reference")), 1),
|
|
1165
|
-
s("div",
|
|
1165
|
+
s("div", Do, $(a.value.ref), 1)
|
|
1166
1166
|
])) : H("", !0),
|
|
1167
|
-
(k = a.value) != null && k.remark ? (
|
|
1168
|
-
s("div",
|
|
1169
|
-
s("div",
|
|
1167
|
+
(k = a.value) != null && k.remark ? (C(), P("div", Vo, [
|
|
1168
|
+
s("div", Ao, $(e(n)("inventory.transfer.receiveRequest.details.remark")), 1),
|
|
1169
|
+
s("div", Ro, $(a.value.remark), 1)
|
|
1170
1170
|
])) : H("", !0)
|
|
1171
1171
|
])
|
|
1172
1172
|
];
|
|
@@ -1174,21 +1174,21 @@ const Jt = { class: "flex flex-col gap-16" }, Xt = { key: 0 }, eo = { class: "fl
|
|
|
1174
1174
|
_: 1
|
|
1175
1175
|
})
|
|
1176
1176
|
]),
|
|
1177
|
-
s("div",
|
|
1178
|
-
s("div",
|
|
1179
|
-
s("div",
|
|
1180
|
-
(
|
|
1177
|
+
s("div", Oo, [
|
|
1178
|
+
s("div", Po, [
|
|
1179
|
+
s("div", Bo, $(e(n)("inventory.transfer.receiveRequest.details.requestedItems")), 1),
|
|
1180
|
+
(C(!0), P(ce, null, be(((p = a.value) == null ? void 0 : p.items) ?? [], (i) => (C(), P("div", {
|
|
1181
1181
|
key: i.code,
|
|
1182
1182
|
class: "flex flex-col"
|
|
1183
1183
|
}, [
|
|
1184
|
-
s("div",
|
|
1185
|
-
s("div",
|
|
1186
|
-
|
|
1187
|
-
s("div",
|
|
1184
|
+
s("div", qo, [
|
|
1185
|
+
s("div", Uo, $(i.name), 1),
|
|
1186
|
+
x[2] || (x[2] = s("div", { class: "flex-1 min-w-32" }, null, -1)),
|
|
1187
|
+
s("div", No, $(e(it)(i.quantity, i.sku.unit, i.measurement)), 1)
|
|
1188
1188
|
]),
|
|
1189
|
-
s("div",
|
|
1190
|
-
s("div",
|
|
1191
|
-
i.totalCost && e(
|
|
1189
|
+
s("div", Eo, [
|
|
1190
|
+
s("div", zo, $(i.code), 1),
|
|
1191
|
+
i.totalCost && e(_).enableTotalCost ? (C(), P("div", jo, " (" + $(e(ht)(i.totalCost)) + ") ", 1)) : H("", !0)
|
|
1192
1192
|
])
|
|
1193
1193
|
]))), 128))
|
|
1194
1194
|
])
|
|
@@ -1199,17 +1199,17 @@ const Jt = { class: "flex flex-col gap-16" }, Xt = { key: 0 }, eo = { class: "fl
|
|
|
1199
1199
|
class: "flex flex-col"
|
|
1200
1200
|
}, {
|
|
1201
1201
|
default: D(() => [
|
|
1202
|
-
|
|
1202
|
+
x[3] || (x[3] = s("div", { class: "flex flex-col p-16" }, [
|
|
1203
1203
|
s("div", { class: "fm-typo-en-body-lg-600" }, "Enabled locations"),
|
|
1204
1204
|
s("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Click to use template on the location ")
|
|
1205
1205
|
], -1)),
|
|
1206
1206
|
d(o, null, {
|
|
1207
1207
|
default: D(() => [
|
|
1208
|
-
(
|
|
1208
|
+
(C(!0), P(ce, null, be(b.value, (i) => (C(), E(f, {
|
|
1209
1209
|
key: i.doc._id,
|
|
1210
1210
|
label: i.name,
|
|
1211
1211
|
sublabel: i.type,
|
|
1212
|
-
onClick: (
|
|
1212
|
+
onClick: (h) => l("action:use", i.doc._id)
|
|
1213
1213
|
}, {
|
|
1214
1214
|
append: D(() => [
|
|
1215
1215
|
d(q, {
|
|
@@ -1230,10 +1230,10 @@ const Jt = { class: "flex flex-col gap-16" }, Xt = { key: 0 }, eo = { class: "fl
|
|
|
1230
1230
|
];
|
|
1231
1231
|
}),
|
|
1232
1232
|
"side-sheet-footer": D(() => [
|
|
1233
|
-
s("div",
|
|
1233
|
+
s("div", Qo, [
|
|
1234
1234
|
d(q, {
|
|
1235
1235
|
label: e(n)("common.edit"),
|
|
1236
|
-
onClick:
|
|
1236
|
+
onClick: x[0] || (x[0] = (p) => l("action:edit")),
|
|
1237
1237
|
variant: "tertiary"
|
|
1238
1238
|
}, null, 8, ["label"])
|
|
1239
1239
|
])
|
|
@@ -1242,118 +1242,126 @@ const Jt = { class: "flex flex-col gap-16" }, Xt = { key: 0 }, eo = { class: "fl
|
|
|
1242
1242
|
}, 8, ["header", "modelValue", "dismiss-away"]);
|
|
1243
1243
|
};
|
|
1244
1244
|
}
|
|
1245
|
-
}),
|
|
1245
|
+
}), Go = { class: "flex-1 flex flex-col gap-8" }, Yo = { class: "flex flex-col" }, Wo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ko = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Zo = { class: "fm-typo-en-body-lg-400" }, Jo = { class: "fm-typo-en-body-lg-400 line-clamp-1" }, Xo = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, ps = /* @__PURE__ */ X({
|
|
1246
1246
|
__name: "TransferTemplateView",
|
|
1247
1247
|
setup(m) {
|
|
1248
|
-
const { t: y } = Z(), { createTemplate: u, viewTemplate: l } =
|
|
1249
|
-
|
|
1250
|
-
), a =
|
|
1248
|
+
const { t: y } = Z(), { createTemplate: u, viewTemplate: l } = Oe(), { templateDialogProps: _, transferFormDialogProps: c, templateDetailsProps: n } = wt(
|
|
1249
|
+
Oe()
|
|
1250
|
+
), a = ut(), v = st(), b = ye(), g = ge(), { breakpoints: L } = Ee();
|
|
1251
1251
|
b.watchLocation(a.fetchTemplates), xe(() => {
|
|
1252
1252
|
g.mustManageBusinessOnlyPoTemplate && (b.businessLevel = !0);
|
|
1253
|
-
}),
|
|
1254
|
-
var
|
|
1255
|
-
return (
|
|
1256
|
-
}, (
|
|
1257
|
-
|
|
1258
|
-
}),
|
|
1253
|
+
}), fe(() => {
|
|
1254
|
+
var p;
|
|
1255
|
+
return (p = c.value) == null ? void 0 : p.show;
|
|
1256
|
+
}, (p) => {
|
|
1257
|
+
p === !1 && g.mustManageBusinessOnlyPoTemplate && (b.businessLevel = !0);
|
|
1258
|
+
}), Je(() => {
|
|
1259
1259
|
b.businessLevel = !1;
|
|
1260
1260
|
});
|
|
1261
|
-
const M =
|
|
1261
|
+
const M = V(() => b.businessLevel), w = V(
|
|
1262
1262
|
() => a.loading.value || !b._currentLocation
|
|
1263
|
-
),
|
|
1263
|
+
), x = V(
|
|
1264
1264
|
() => M.value ? a.businessTemplates.value : a.locationTemplates.value
|
|
1265
|
-
), F = U(""), R =
|
|
1266
|
-
function
|
|
1267
|
-
switch (
|
|
1268
|
-
case
|
|
1265
|
+
), F = U(""), R = V(() => L.value.xs || L.value.sm), q = V(() => R.value ? 10 : 20);
|
|
1266
|
+
function f(p) {
|
|
1267
|
+
switch (p) {
|
|
1268
|
+
case Pe.Add:
|
|
1269
1269
|
return u();
|
|
1270
1270
|
}
|
|
1271
1271
|
}
|
|
1272
|
-
const
|
|
1273
|
-
function
|
|
1274
|
-
|
|
1272
|
+
const o = Tt();
|
|
1273
|
+
function t() {
|
|
1274
|
+
o.push({ name: gt.RECEIVE_REQUEST });
|
|
1275
1275
|
}
|
|
1276
|
-
function
|
|
1277
|
-
return
|
|
1276
|
+
function r(p) {
|
|
1277
|
+
return p;
|
|
1278
1278
|
}
|
|
1279
|
-
return (
|
|
1280
|
-
const
|
|
1281
|
-
return
|
|
1282
|
-
d(
|
|
1279
|
+
return (p, i) => {
|
|
1280
|
+
const h = S("FmTable");
|
|
1281
|
+
return C(), P(ce, null, [
|
|
1282
|
+
d(nt, {
|
|
1283
1283
|
title: e(y)("inventory.transfer.template.title2"),
|
|
1284
1284
|
actions: [
|
|
1285
1285
|
{
|
|
1286
1286
|
label: e(y)("inventory.transfer.template.create.title"),
|
|
1287
|
-
value: e(
|
|
1287
|
+
value: e(Pe).Add,
|
|
1288
1288
|
isPrimary: !0,
|
|
1289
1289
|
prependIcon: "add"
|
|
1290
1290
|
}
|
|
1291
1291
|
],
|
|
1292
|
-
"onClick:action":
|
|
1292
|
+
"onClick:action": f,
|
|
1293
1293
|
"using-business-helper-text": "You are managing business-level template list. These templates will be made visible to all locations."
|
|
1294
1294
|
}, {
|
|
1295
1295
|
default: D(() => {
|
|
1296
|
-
var
|
|
1296
|
+
var O;
|
|
1297
1297
|
return [
|
|
1298
|
-
s("div",
|
|
1299
|
-
|
|
1298
|
+
s("div", {
|
|
1299
|
+
class: me([
|
|
1300
|
+
"flex flex-col gap-8 max-h-full",
|
|
1301
|
+
{
|
|
1302
|
+
"p-0": R.value,
|
|
1303
|
+
"px-24 ": !R.value
|
|
1304
|
+
}
|
|
1305
|
+
])
|
|
1306
|
+
}, [
|
|
1307
|
+
d(lt, {
|
|
1300
1308
|
searchable: "",
|
|
1301
1309
|
"change-location": !e(g).mustManageBusinessOnlyPoTemplate,
|
|
1302
1310
|
search: F.value,
|
|
1303
|
-
"onUpdate:search":
|
|
1311
|
+
"onUpdate:search": i[0] || (i[0] = (I) => F.value = I),
|
|
1304
1312
|
actions: [{ icon: "refresh", onClick: e(a).fetchTemplates }],
|
|
1305
1313
|
"show-business": ""
|
|
1306
1314
|
}, null, 8, ["change-location", "search", "actions"]),
|
|
1307
|
-
(
|
|
1308
|
-
style:
|
|
1315
|
+
(C(), E(h, {
|
|
1316
|
+
style: Xe(e(v).tableHeight),
|
|
1309
1317
|
"column-defs": e(a).columnDefs,
|
|
1310
|
-
"row-data":
|
|
1318
|
+
"row-data": x.value,
|
|
1311
1319
|
"search-value": F.value,
|
|
1312
1320
|
loading: w.value,
|
|
1313
|
-
key: (
|
|
1314
|
-
onRowClick:
|
|
1315
|
-
"page-size":
|
|
1321
|
+
key: (O = e(b)._currentLocation) == null ? void 0 : O.dbName,
|
|
1322
|
+
onRowClick: i[1] || (i[1] = (I) => e(l)(I.original)),
|
|
1323
|
+
"page-size": q.value
|
|
1316
1324
|
}, {
|
|
1317
|
-
"list-row": D((
|
|
1318
|
-
d(
|
|
1319
|
-
row:
|
|
1320
|
-
onRowClick: (
|
|
1325
|
+
"list-row": D((I) => [
|
|
1326
|
+
d(Ge, {
|
|
1327
|
+
row: I,
|
|
1328
|
+
onRowClick: (T) => e(l)(T)
|
|
1321
1329
|
}, {
|
|
1322
|
-
default: D((
|
|
1323
|
-
var
|
|
1330
|
+
default: D((T) => {
|
|
1331
|
+
var B, z, j, k, Q, Y, ee, te, W, oe, K, se, ke, le, we, Fe, Te, Ce, ae, $e, Se, Le, Me, re, Ie;
|
|
1324
1332
|
return [
|
|
1325
1333
|
s("div", Go, [
|
|
1326
1334
|
s("div", Yo, [
|
|
1327
1335
|
s("div", Wo, [
|
|
1328
|
-
d(e(
|
|
1329
|
-
render: (j = (
|
|
1330
|
-
props: (
|
|
1336
|
+
d(e(N), {
|
|
1337
|
+
render: (j = (z = (B = T._id) == null ? void 0 : B.column) == null ? void 0 : z.columnDef) == null ? void 0 : j.cell,
|
|
1338
|
+
props: (Q = (k = T._id) == null ? void 0 : k.getContext) == null ? void 0 : Q.call(k)
|
|
1331
1339
|
}, null, 8, ["render", "props"])
|
|
1332
1340
|
]),
|
|
1333
1341
|
s("div", Ko, [
|
|
1334
|
-
d(e(
|
|
1335
|
-
render: (
|
|
1336
|
-
props: (
|
|
1342
|
+
d(e(N), {
|
|
1343
|
+
render: (te = (ee = (Y = T.name) == null ? void 0 : Y.column) == null ? void 0 : ee.columnDef) == null ? void 0 : te.cell,
|
|
1344
|
+
props: (oe = (W = T.name) == null ? void 0 : W.getContext) == null ? void 0 : oe.call(W)
|
|
1337
1345
|
}, null, 8, ["render", "props"])
|
|
1338
1346
|
]),
|
|
1339
1347
|
s("div", Zo, [
|
|
1340
|
-
d(e(
|
|
1341
|
-
render: (
|
|
1342
|
-
props: (
|
|
1348
|
+
d(e(N), {
|
|
1349
|
+
render: (ke = (se = (K = T.supplier) == null ? void 0 : K.column) == null ? void 0 : se.columnDef) == null ? void 0 : ke.cell,
|
|
1350
|
+
props: (we = (le = T.supplier) == null ? void 0 : le.getContext) == null ? void 0 : we.call(le)
|
|
1343
1351
|
}, null, 8, ["render", "props"])
|
|
1344
1352
|
]),
|
|
1345
|
-
s("div", Jo, $(
|
|
1353
|
+
s("div", Jo, $(I.original.purchaseOrder.items.length ? I.original.purchaseOrder.items.map((We) => We.name).join(", ") : "No items"), 1),
|
|
1346
1354
|
s("div", Xo, [
|
|
1347
|
-
d(e(
|
|
1348
|
-
render: (
|
|
1349
|
-
props: (
|
|
1355
|
+
d(e(N), {
|
|
1356
|
+
render: (Ce = (Te = (Fe = T.ref) == null ? void 0 : Fe.column) == null ? void 0 : Te.columnDef) == null ? void 0 : Ce.cell,
|
|
1357
|
+
props: ($e = (ae = T.ref) == null ? void 0 : ae.getContext) == null ? void 0 : $e.call(ae)
|
|
1350
1358
|
}, null, 8, ["render", "props"])
|
|
1351
1359
|
])
|
|
1352
1360
|
]),
|
|
1353
1361
|
s("div", null, [
|
|
1354
|
-
d(e(
|
|
1355
|
-
render: (
|
|
1356
|
-
props: (Ie = (re =
|
|
1362
|
+
d(e(N), {
|
|
1363
|
+
render: (Me = (Le = (Se = T.type) == null ? void 0 : Se.column) == null ? void 0 : Le.columnDef) == null ? void 0 : Me.cell,
|
|
1364
|
+
props: (Ie = (re = T.type) == null ? void 0 : re.getContext) == null ? void 0 : Ie.call(re)
|
|
1357
1365
|
}, null, 8, ["render", "props"])
|
|
1358
1366
|
])
|
|
1359
1367
|
])
|
|
@@ -1364,16 +1372,16 @@ const Jt = { class: "flex flex-col gap-16" }, Xt = { key: 0 }, eo = { class: "fl
|
|
|
1364
1372
|
]),
|
|
1365
1373
|
_: 1
|
|
1366
1374
|
}, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]))
|
|
1367
|
-
])
|
|
1375
|
+
], 2)
|
|
1368
1376
|
];
|
|
1369
1377
|
}),
|
|
1370
1378
|
_: 1
|
|
1371
1379
|
}, 8, ["title", "actions"]),
|
|
1372
|
-
(
|
|
1373
|
-
d(
|
|
1374
|
-
d(
|
|
1375
|
-
d(
|
|
1376
|
-
onSubmitted:
|
|
1380
|
+
(C(), E(et, { to: "body" }, [
|
|
1381
|
+
d(Ft, Re(e(c), { onSubmitted: t }), null, 16),
|
|
1382
|
+
d(Ho, tt(ot(e(n))), null, 16),
|
|
1383
|
+
d(co, Re(e(_), {
|
|
1384
|
+
onSubmitted: i[2] || (i[2] = (O) => e(a).fetchTemplates())
|
|
1377
1385
|
}), null, 16)
|
|
1378
1386
|
]))
|
|
1379
1387
|
], 64);
|