@feedmepos/mf-inventory-portal 0.0.21-dev.7 → 0.0.22-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ApprovalView-BYJfdiYM.js → ApprovalView-CtH8I01g.js} +4 -4
- package/dist/{BindingsDialog-BryZK4Tg.js → BindingsDialog-DFrk_fyd.js} +1 -1
- package/dist/{BindingsPicker-IWAltg_U.js → BindingsPicker-400gISaV.js} +1 -1
- package/dist/{BindingsTable-DDwukKAy.js → BindingsTable-CnFKI6iP.js} +1 -1
- package/dist/ClosingTemplateView--8m8cua_.js +919 -0
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CLBgszfX.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-B9RU_arW.js} +1 -1
- package/dist/{IngredientsView-DgSzNCNX.js → IngredientsView-CRTAgKJz.js} +3 -3
- package/dist/{IntegrationView-BtXzjG3j.js → IntegrationView-CNFTKqjk.js} +2 -2
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-sPzZAvKH.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-VkiVLx1K.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-BYX1ubPe.js → PremiumBadge.vue_vue_type_script_setup_true_lang-DkZrgqyr.js} +1 -1
- package/dist/{PurchaseOrderPrintPreview-Ke1-hYgN.js → PurchaseOrderPrintPreview-CJli-_Vn.js} +1 -1
- package/dist/{ReceiveRequestView-CE9BFQn3.js → ReceiveRequestView-DV_GDzJG.js} +6 -6
- package/dist/{RecipeView-K3f9W_AV.js → RecipeView-CTm_7oNG.js} +3 -3
- package/dist/{StockView-BH3wK8AT.js → StockView-DtHT2ulM.js} +6 -6
- package/dist/{SupplierView-DwVN-3IQ.js → SupplierView-B9A5R2Vm.js} +3 -3
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-B0Vdby5t.js → TransferDetails.vue_vue_type_script_setup_true_lang-mUNCQTNw.js} +40 -39
- package/dist/{TransferDialog.vue_vue_type_script_setup_true_lang-DijNNVgt.js → TransferDialog.vue_vue_type_script_setup_true_lang-BwkUuXqj.js} +493 -501
- package/dist/{TransferTemplateView-ikRXcgOO.js → TransferTemplateView-DnyenkGu.js} +454 -498
- package/dist/{UnitView-yexlK1KM.js → UnitView-BL-jtVuZ.js} +4 -4
- package/dist/{WarehouseView-BjBJrjbZ.js → WarehouseView-BkUv1792.js} +2 -2
- package/dist/api/closing-template.d.ts +7 -0
- package/dist/{app-BD7MP1Oe.js → app-C-z1MfF6.js} +3992 -3929
- package/dist/app.d.ts +35 -0
- package/dist/app.js +1 -1
- package/dist/{decimal-Ct-e_mRV.js → decimal-DZz-_lgE.js} +1 -1
- package/dist/defineDeepModel-7VQajdPt.js +13 -0
- package/dist/format-time-from-id-9XFszs1J.js +15 -0
- package/dist/{id-to-date-Chhy1kB3.js → id-to-date-Bkue77uI.js} +1 -1
- package/dist/layout/layout-routes.d.ts +0 -1
- package/dist/{purchase-order-transaction-type-Bqu6bNsx.js → purchase-order-transaction-type-DHzMBgFs.js} +90 -101
- package/dist/router/name.d.ts +1 -0
- package/dist/style.css +1 -1
- package/dist/{supplier-DErisCtS.js → supplier-C6YWXF2Y.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/use-template-enabled-locations-CFCfbaOd.js +57 -0
- package/dist/views/closing-template/ClosingTemplateView.vue.d.ts +2 -0
- package/dist/views/closing-template/components/closing-template-details/ClosingTemplateDetails.vue.d.ts +2 -0
- package/dist/views/closing-template/components/closing-template-details/ClosingTemplateDetailsProps.d.ts +8 -0
- package/dist/views/closing-template/components/closing-template-dialog/ClosingTemplateDialog.vue.d.ts +22 -0
- package/dist/views/closing-template/components/closing-template-dialog/ClosingTemplateDialogProps.d.ts +10 -0
- package/dist/views/closing-template/components/closing-template-form/ClosingTemplateForm.vue.d.ts +16 -0
- package/dist/views/closing-template/components/closing-template-form/ClosingTemplateFormProps.d.ts +7 -0
- package/dist/views/closing-template/components/closing-template-form/components/ClosingTemplateItem.vue.d.ts +18 -0
- package/dist/views/closing-template/components/closing-template-form/composables/use-closing-template-items.d.ts +79 -0
- package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +2165 -0
- package/dist/views/closing-template/composables/use-closing-template-table.d.ts +2084 -0
- package/dist/views/transfer-template/components/transfer-template-details/TransferTemplateDetails.vue.d.ts +1 -1
- package/dist/{xlsx-DyScN5Bf.js → xlsx-Dl6dAHFx.js} +1 -1
- package/dist/{xlsx.util-DEyeAnEa.js → xlsx.util-C1tUhDb8.js} +2 -2
- package/package.json +3 -3
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { u as st, _ as nt, a as lt } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-
|
|
3
|
-
import { useI18n as
|
|
4
|
-
import { P as pe, a as at, f as rt, b as
|
|
5
|
-
import { F as ne, R as
|
|
6
|
-
import { $ as
|
|
7
|
-
import { useBreakpoints as
|
|
8
|
-
import { storeToRefs as
|
|
9
|
-
import { d as Qe
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { _ as
|
|
14
|
-
|
|
1
|
+
import { defineComponent as J, onMounted as _e, computed as O, ref as U, watch as fe, inject as Ke, resolveComponent as C, openBlock as w, createElementBlock as P, createElementVNode as s, createVNode as u, withCtx as D, renderSlot as Re, withDirectives as Ae, normalizeClass as me, vModelText as Oe, reactive as Ze, h as Z, toDisplayString as T, unref as e, createBlock as N, createCommentVNode as H, isRef as xe, Fragment as ce, renderList as ve, onUnmounted as Je, normalizeStyle as Xe, Teleport as et, mergeProps as Pe, 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-B9RU_arW.js";
|
|
3
|
+
import { useI18n as X } from "@feedmepos/mf-common";
|
|
4
|
+
import { P as pe, a as at, f as rt, b as Be, c as it } from "./purchase-order-transaction-type-DHzMBgFs.js";
|
|
5
|
+
import { F as ne, R as qe } from "./row-action.enum-PMKMRrZR.js";
|
|
6
|
+
import { $ as ye, t as Ue, I as ut, a0 as dt, a1 as mt, a as G, D as Ee, R as be, a2 as ct, a3 as pt, r as de, a4 as ft, l as yt, A as Ne, M as vt, b as he, u as bt, j as ge, y as _t, a5 as ie, a6 as xt, G as ht, a7 as gt } from "./app-C-z1MfF6.js";
|
|
7
|
+
import { useBreakpoints as ze, components as ue, useDialog as kt, useSnackbar as wt, useProxiedModel as je } from "@feedmepos/ui-library";
|
|
8
|
+
import { storeToRefs as Ft } from "pinia";
|
|
9
|
+
import { d as Qe } from "./defineDeepModel-7VQajdPt.js";
|
|
10
|
+
import { c as He, _ as Tt } from "./TransferDialog.vue_vue_type_script_setup_true_lang-BwkUuXqj.js";
|
|
11
|
+
import { useRouter as Ct } from "vue-router";
|
|
12
|
+
import { u as $t } from "./supplier-C6YWXF2Y.js";
|
|
13
|
+
import { F as E, _ as Ge } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
|
|
14
|
+
import { _ as St } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-DkZrgqyr.js";
|
|
15
|
+
import { u as Ye } from "./use-template-enabled-locations-CFCfbaOd.js";
|
|
16
|
+
import { f as Mt } from "./format-time-from-id-9XFszs1J.js";
|
|
17
|
+
const It = { class: "flex flex-col" }, Dt = { class: "flex flex-col" }, Lt = { class: "flex-1" }, Vt = { class: "flex items-center" }, Rt = { class: "flex-1" }, At = { class: "flex-1" }, Ot = /* @__PURE__ */ J({
|
|
15
18
|
__name: "FmMinMaxInput",
|
|
16
19
|
props: {
|
|
17
20
|
rules: {},
|
|
@@ -48,142 +51,142 @@ const St = { class: "flex flex-col" }, Lt = { class: "flex flex-col" }, Mt = { c
|
|
|
48
51
|
helperText: {},
|
|
49
52
|
helperState: {}
|
|
50
53
|
},
|
|
51
|
-
setup(
|
|
52
|
-
const y =
|
|
53
|
-
|
|
54
|
-
const { min:
|
|
55
|
-
if (!(!
|
|
56
|
-
const t = Math.max(
|
|
57
|
-
|
|
54
|
+
setup(f) {
|
|
55
|
+
const y = f, d = Qe("modelValue"), l = ut();
|
|
56
|
+
_e(() => {
|
|
57
|
+
const { min: p, max: o } = d ?? {};
|
|
58
|
+
if (!(!p || !o) && p.precision !== o.precision) {
|
|
59
|
+
const t = Math.max(p.precision, o.precision), r = ye(p, t), m = ye(o, t);
|
|
60
|
+
d.min = r, d.max = m;
|
|
58
61
|
}
|
|
59
62
|
});
|
|
60
|
-
const _ =
|
|
61
|
-
const { min:
|
|
62
|
-
return Math.max((
|
|
63
|
-
}), c =
|
|
64
|
-
...
|
|
65
|
-
})), n = (
|
|
66
|
-
if (!
|
|
67
|
-
const o =
|
|
68
|
-
return
|
|
63
|
+
const _ = O(() => {
|
|
64
|
+
const { min: p, max: o } = d ?? {};
|
|
65
|
+
return Math.max((p == null ? void 0 : p.precision) ?? 0, (o == null ? void 0 : o.precision) ?? 0, y.precision ?? 0);
|
|
66
|
+
}), c = O(() => ({
|
|
67
|
+
...d
|
|
68
|
+
})), n = (p) => {
|
|
69
|
+
if (!p) return "";
|
|
70
|
+
const o = dt(p), t = _.value, r = ye(o, t);
|
|
71
|
+
return mt(
|
|
69
72
|
+G(r),
|
|
70
73
|
r.precision
|
|
71
74
|
);
|
|
72
|
-
}, a = U(n(
|
|
73
|
-
fe([a,
|
|
74
|
-
const t =
|
|
75
|
-
if (
|
|
76
|
-
const
|
|
77
|
-
t.min =
|
|
75
|
+
}, a = U(n(d.min)), F = U(n(d.max));
|
|
76
|
+
fe([a, F], ([p, o]) => {
|
|
77
|
+
const t = d ?? {}, r = l(p), m = l(o), i = _.value;
|
|
78
|
+
if (p !== "" && r === !0) {
|
|
79
|
+
const b = Ue(+p, i);
|
|
80
|
+
t.min = b;
|
|
78
81
|
} else
|
|
79
82
|
t.min = null;
|
|
80
|
-
if (o !== "" &&
|
|
81
|
-
const
|
|
82
|
-
t.max =
|
|
83
|
+
if (o !== "" && m === !0) {
|
|
84
|
+
const b = Ue(+o, i);
|
|
85
|
+
t.max = b;
|
|
83
86
|
} else
|
|
84
87
|
t.max = null;
|
|
85
|
-
|
|
88
|
+
d.min = t.min, d.max = t.max;
|
|
86
89
|
});
|
|
87
|
-
const
|
|
90
|
+
const L = Symbol.for("fm:form-state"), S = Ke(L, null), M = O(() => y.disabled ?? (S == null ? void 0 : S.getDisabled()) ?? !1), I = U(), h = U(), v = U(!1), g = U(!1), R = O(() => v.value || g.value), q = O(() => [...[
|
|
88
91
|
function() {
|
|
89
|
-
return typeof l(a.value) == "string" || typeof l(
|
|
92
|
+
return typeof l(a.value) == "string" || typeof l(F.value) == "string" ? "Must be a number" : !0;
|
|
90
93
|
},
|
|
91
94
|
function(t) {
|
|
92
95
|
return !t || !t.min || !t.max ? !0 : +G(t.min) > +G(t.max) ? "Min must be less than or equal to max" : !0;
|
|
93
96
|
}
|
|
94
97
|
], ...y.rules ?? []]);
|
|
95
|
-
return (
|
|
96
|
-
const t =
|
|
97
|
-
return
|
|
98
|
-
s("div",
|
|
99
|
-
s("div",
|
|
100
|
-
|
|
101
|
-
label:
|
|
102
|
-
disabled:
|
|
103
|
-
required:
|
|
104
|
-
optional:
|
|
98
|
+
return (p, o) => {
|
|
99
|
+
const t = C("FmLabel"), r = C("FmField"), m = C("FmFormGroup");
|
|
100
|
+
return w(), P("div", It, [
|
|
101
|
+
s("div", Dt, [
|
|
102
|
+
s("div", Lt, [
|
|
103
|
+
u(t, {
|
|
104
|
+
label: p.label,
|
|
105
|
+
disabled: p.disabled,
|
|
106
|
+
required: p.labelMark === "required",
|
|
107
|
+
optional: p.labelMark === "optional"
|
|
105
108
|
}, null, 8, ["label", "disabled", "required", "optional"])
|
|
106
109
|
]),
|
|
107
|
-
|
|
110
|
+
u(r, { focused: R.value }, {
|
|
108
111
|
default: D(() => [
|
|
109
|
-
s("div",
|
|
110
|
-
|
|
112
|
+
s("div", Vt, [
|
|
113
|
+
Re(p.$slots, "prepend"),
|
|
111
114
|
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
|
-
|
|
115
|
+
s("div", Rt, [
|
|
116
|
+
Ae(s("input", {
|
|
114
117
|
type: "text",
|
|
115
118
|
ref_key: "minInputRef",
|
|
116
|
-
ref:
|
|
117
|
-
onFocus: o[0] || (o[0] = () =>
|
|
118
|
-
onBlur: o[1] || (o[1] = () =>
|
|
119
|
+
ref: I,
|
|
120
|
+
onFocus: o[0] || (o[0] = () => v.value = !0),
|
|
121
|
+
onBlur: o[1] || (o[1] = () => v.value = !1),
|
|
119
122
|
"onUpdate:modelValue": o[2] || (o[2] = (i) => a.value = i),
|
|
120
123
|
class: me({
|
|
121
124
|
"fm-text-field--input fm-typo-en-body-lg-400": !0,
|
|
122
|
-
"text-fm-color-typo-primary": !
|
|
123
|
-
"text-fm-color-typo-disabled":
|
|
125
|
+
"text-fm-color-typo-primary": !M.value,
|
|
126
|
+
"text-fm-color-typo-disabled": M.value
|
|
124
127
|
})
|
|
125
128
|
}, null, 34), [
|
|
126
|
-
[
|
|
129
|
+
[Oe, a.value]
|
|
127
130
|
])
|
|
128
131
|
]),
|
|
129
132
|
o[7] || (o[7] = s("div", { class: "block h-32 mx-4 w-[1px] bg-fm-color-neutral-gray-200" }, null, -1)),
|
|
130
133
|
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
|
-
|
|
134
|
+
s("div", At, [
|
|
135
|
+
Ae(s("input", {
|
|
133
136
|
type: "text",
|
|
134
137
|
ref_key: "maxInputRef",
|
|
135
|
-
ref:
|
|
136
|
-
onFocus: o[3] || (o[3] = () =>
|
|
137
|
-
onBlur: o[4] || (o[4] = () =>
|
|
138
|
-
"onUpdate:modelValue": o[5] || (o[5] = (i) =>
|
|
138
|
+
ref: h,
|
|
139
|
+
onFocus: o[3] || (o[3] = () => g.value = !0),
|
|
140
|
+
onBlur: o[4] || (o[4] = () => g.value = !1),
|
|
141
|
+
"onUpdate:modelValue": o[5] || (o[5] = (i) => F.value = i),
|
|
139
142
|
class: me({
|
|
140
143
|
"fm-text-field--input fm-typo-en-body-lg-400": !0,
|
|
141
|
-
"text-fm-color-typo-primary": !
|
|
142
|
-
"text-fm-color-typo-disabled":
|
|
144
|
+
"text-fm-color-typo-primary": !M.value,
|
|
145
|
+
"text-fm-color-typo-disabled": M.value
|
|
143
146
|
})
|
|
144
147
|
}, null, 34), [
|
|
145
|
-
[
|
|
148
|
+
[Oe, F.value]
|
|
146
149
|
])
|
|
147
150
|
]),
|
|
148
|
-
|
|
151
|
+
Re(p.$slots, "append")
|
|
149
152
|
])
|
|
150
153
|
]),
|
|
151
154
|
_: 3
|
|
152
155
|
}, 8, ["focused"])
|
|
153
156
|
]),
|
|
154
|
-
|
|
157
|
+
u(m, {
|
|
155
158
|
class: "flex-1",
|
|
156
159
|
"model-value": c.value,
|
|
157
|
-
info:
|
|
160
|
+
info: p.labelInfo,
|
|
158
161
|
rules: q.value,
|
|
159
|
-
"helper-text":
|
|
160
|
-
"helper-state":
|
|
162
|
+
"helper-text": p.helperText,
|
|
163
|
+
"helper-state": p.helperState
|
|
161
164
|
}, null, 8, ["model-value", "info", "rules", "helper-text", "helper-state"])
|
|
162
165
|
]);
|
|
163
166
|
};
|
|
164
167
|
}
|
|
165
168
|
});
|
|
166
|
-
function
|
|
169
|
+
function Pt() {
|
|
167
170
|
return function(y) {
|
|
168
171
|
return !y || !y.min || !y.max ? "Required" : !0;
|
|
169
172
|
};
|
|
170
173
|
}
|
|
171
|
-
function
|
|
174
|
+
function Bt(f, y) {
|
|
172
175
|
return function(l) {
|
|
173
|
-
return !l || !l.min || !l.max ? !0 : +G(l.min) <
|
|
176
|
+
return !l || !l.min || !l.max ? !0 : +G(l.min) < f ? `Must be between ${f} and ${y}` : +G(l.max) > y ? `Must be between ${f} and ${y}` : !0;
|
|
174
177
|
};
|
|
175
178
|
}
|
|
176
|
-
var
|
|
177
|
-
function
|
|
178
|
-
const { t: y } =
|
|
179
|
-
|
|
180
|
-
for (const c of
|
|
179
|
+
var V = /* @__PURE__ */ ((f) => (f.Code = "Code", f.Name = "Name", f.DefaultAmount = "DefaultAmount", f.Limit = "Limit", f.MinimumAmount = "MinimumAmount", f.Step = "Step", f.Cost = "Cost", f.Delete = "Delete", f))(V || {});
|
|
180
|
+
function qt(f) {
|
|
181
|
+
const { t: y } = X(), d = Ze({});
|
|
182
|
+
ze(), _e(() => {
|
|
183
|
+
for (const c of f.items) {
|
|
181
184
|
if (!c.totalCost)
|
|
182
185
|
continue;
|
|
183
186
|
const n = He(c.sku, c.quantity, c.measurement, {
|
|
184
|
-
supplier:
|
|
185
|
-
}), a = c.totalCost ??
|
|
186
|
-
n ?
|
|
187
|
+
supplier: f.supplier
|
|
188
|
+
}), a = c.totalCost ?? Ee.reset();
|
|
189
|
+
n ? d[c.sku._id] = n.amount !== a.amount || n.precision !== a.precision : d[c.sku._id] = !0;
|
|
187
190
|
}
|
|
188
191
|
});
|
|
189
192
|
const l = [
|
|
@@ -194,16 +197,16 @@ function Pt(m) {
|
|
|
194
197
|
size: 96,
|
|
195
198
|
cell(c) {
|
|
196
199
|
const n = c.row.original;
|
|
197
|
-
return
|
|
200
|
+
return Z(ue.FmTextField, {
|
|
198
201
|
modelValue: n.code,
|
|
199
202
|
"onUpdate:modelValue": (a) => {
|
|
200
|
-
|
|
203
|
+
f.updateItem({
|
|
201
204
|
...n,
|
|
202
205
|
code: a
|
|
203
206
|
});
|
|
204
207
|
},
|
|
205
208
|
key: n.sku._id,
|
|
206
|
-
rules: [
|
|
209
|
+
rules: [be()],
|
|
207
210
|
labelMark: "required"
|
|
208
211
|
});
|
|
209
212
|
},
|
|
@@ -215,16 +218,16 @@ function Pt(m) {
|
|
|
215
218
|
minSize: 300,
|
|
216
219
|
cell(c) {
|
|
217
220
|
const n = c.row.original;
|
|
218
|
-
return
|
|
221
|
+
return Z(ue.FmTextField, {
|
|
219
222
|
modelValue: n.name,
|
|
220
223
|
"onUpdate:modelValue": (a) => {
|
|
221
|
-
|
|
224
|
+
f.updateItem({
|
|
222
225
|
...n,
|
|
223
226
|
name: a
|
|
224
227
|
});
|
|
225
228
|
},
|
|
226
229
|
key: n.sku._id,
|
|
227
|
-
rules: [
|
|
230
|
+
rules: [be()],
|
|
228
231
|
labelMark: "required"
|
|
229
232
|
});
|
|
230
233
|
},
|
|
@@ -236,7 +239,7 @@ function Pt(m) {
|
|
|
236
239
|
minSize: 200,
|
|
237
240
|
cell(c) {
|
|
238
241
|
const n = c.row.original;
|
|
239
|
-
return
|
|
242
|
+
return Z(ct, {
|
|
240
243
|
style: {
|
|
241
244
|
flex: "1 1 0%"
|
|
242
245
|
},
|
|
@@ -244,18 +247,18 @@ function Pt(m) {
|
|
|
244
247
|
amount: n.quantity ?? { amount: 1, precision: 0 },
|
|
245
248
|
measurement: n.measurement ?? null
|
|
246
249
|
},
|
|
247
|
-
disabled:
|
|
250
|
+
disabled: f.disabled,
|
|
248
251
|
key: n.sku._id,
|
|
249
252
|
unit: n.sku.unit,
|
|
250
253
|
"onUpdate:modelValue": (a) => {
|
|
251
|
-
|
|
254
|
+
f.updateItem({
|
|
252
255
|
...n,
|
|
253
256
|
quantity: a.amount,
|
|
254
257
|
measurement: a.measurement
|
|
255
258
|
});
|
|
256
259
|
},
|
|
257
260
|
rules: [
|
|
258
|
-
|
|
261
|
+
pt(
|
|
259
262
|
+G(
|
|
260
263
|
n.minimumQuantity ?? {
|
|
261
264
|
amount: 1,
|
|
@@ -263,7 +266,7 @@ function Pt(m) {
|
|
|
263
266
|
}
|
|
264
267
|
)
|
|
265
268
|
),
|
|
266
|
-
|
|
269
|
+
ft(
|
|
267
270
|
n.maximumQuantity ? +G(n.maximumQuantity) : 1 / 0
|
|
268
271
|
)
|
|
269
272
|
],
|
|
@@ -279,7 +282,7 @@ function Pt(m) {
|
|
|
279
282
|
minSize: 280,
|
|
280
283
|
cell(c) {
|
|
281
284
|
const n = c.row.original;
|
|
282
|
-
return
|
|
285
|
+
return Z(Ot, {
|
|
283
286
|
style: {
|
|
284
287
|
flex: "1 1 0%"
|
|
285
288
|
},
|
|
@@ -287,16 +290,16 @@ function Pt(m) {
|
|
|
287
290
|
min: n.minimumQuantity,
|
|
288
291
|
max: n.maximumQuantity
|
|
289
292
|
},
|
|
290
|
-
disabled:
|
|
293
|
+
disabled: f.disabled,
|
|
291
294
|
key: n.sku._id,
|
|
292
295
|
unit: n.sku.unit,
|
|
293
296
|
"onUpdate:modelValue": (a) => {
|
|
294
|
-
const
|
|
295
|
-
a != null && a.min && (
|
|
297
|
+
const F = { ...n };
|
|
298
|
+
a != null && a.min && (F.minimumQuantity = a.min), a != null && a.max && (F.maximumQuantity = a.max), f.updateItem(F);
|
|
296
299
|
},
|
|
297
300
|
rules: [
|
|
298
|
-
|
|
299
|
-
|
|
301
|
+
Pt(),
|
|
302
|
+
Bt(
|
|
300
303
|
+G({
|
|
301
304
|
amount: 1,
|
|
302
305
|
precision: de(n.sku.unit, n.measurement)
|
|
@@ -315,21 +318,21 @@ function Pt(m) {
|
|
|
315
318
|
minSize: 100,
|
|
316
319
|
cell(c) {
|
|
317
320
|
const n = c.row.original;
|
|
318
|
-
return
|
|
319
|
-
modelValue: G(n.quantityStep ??
|
|
321
|
+
return Z(ue.FmTextField, {
|
|
322
|
+
modelValue: G(n.quantityStep ?? Ee.reset(), !1),
|
|
320
323
|
key: n.sku._id,
|
|
321
324
|
"onUpdate:modelValue": (a) => {
|
|
322
|
-
|
|
325
|
+
f.updateItem({
|
|
323
326
|
...n,
|
|
324
|
-
quantityStep:
|
|
327
|
+
quantityStep: yt(+a)
|
|
325
328
|
});
|
|
326
329
|
},
|
|
327
330
|
rules: [
|
|
328
|
-
|
|
331
|
+
Ne({
|
|
329
332
|
amount: 1,
|
|
330
333
|
precision: de(n.sku.unit, n.measurement)
|
|
331
334
|
}),
|
|
332
|
-
|
|
335
|
+
vt(n.sku.unit, n.measurement)
|
|
333
336
|
]
|
|
334
337
|
});
|
|
335
338
|
},
|
|
@@ -460,16 +463,16 @@ function Pt(m) {
|
|
|
460
463
|
header: "",
|
|
461
464
|
cell(c) {
|
|
462
465
|
const n = c.row.original;
|
|
463
|
-
return
|
|
466
|
+
return Z(ue.FmButton, {
|
|
464
467
|
class: "delete-button",
|
|
465
468
|
key: n.sku._id,
|
|
466
469
|
type: "button",
|
|
467
470
|
icon: "delete",
|
|
468
471
|
variant: "tertiary",
|
|
469
472
|
size: "md",
|
|
470
|
-
disabled:
|
|
473
|
+
disabled: f.disabled,
|
|
471
474
|
onClick: () => {
|
|
472
|
-
|
|
475
|
+
f.deleteItem(n);
|
|
473
476
|
}
|
|
474
477
|
});
|
|
475
478
|
},
|
|
@@ -482,100 +485,100 @@ function Pt(m) {
|
|
|
482
485
|
}
|
|
483
486
|
];
|
|
484
487
|
return {
|
|
485
|
-
columnDefs:
|
|
488
|
+
columnDefs: O(() => he().enableTotalCost && f.transferType === pe.PURCHASE ? l : l.filter((n) => n.id !== "Cost"))
|
|
486
489
|
};
|
|
487
490
|
}
|
|
488
|
-
const
|
|
491
|
+
const Ut = { class: "flex flex-col gap-8 py-16" }, Et = { 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" }, jt = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Qt = { class: "flex gap-8 w-full" }, Ht = { 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({
|
|
489
492
|
__name: "TransferTemplateItem",
|
|
490
493
|
props: {
|
|
491
494
|
cellByColId: {},
|
|
492
495
|
row: {}
|
|
493
496
|
},
|
|
494
|
-
setup(
|
|
495
|
-
const { t: y } =
|
|
496
|
-
return (
|
|
497
|
-
var c, n, a,
|
|
498
|
-
const _ =
|
|
499
|
-
return
|
|
500
|
-
s("div",
|
|
501
|
-
s("div",
|
|
502
|
-
s("span",
|
|
503
|
-
s("span",
|
|
497
|
+
setup(f) {
|
|
498
|
+
const { t: y } = X();
|
|
499
|
+
return (d, l) => {
|
|
500
|
+
var c, n, a, F, L, S, M, I, h, v, g, R, q, p, o, t, r, m, i, b, A, $, k, B, z, j, x, Q, Y, ee, te, W, oe, K, se;
|
|
501
|
+
const _ = C("FmLabel");
|
|
502
|
+
return w(), P("div", Ut, [
|
|
503
|
+
s("div", Et, [
|
|
504
|
+
s("div", Nt, [
|
|
505
|
+
s("span", zt, " (" + T(d.row.original.sku.code) + ") ", 1),
|
|
506
|
+
s("span", jt, T(d.row.original.sku.name), 1)
|
|
504
507
|
]),
|
|
505
508
|
s("div", null, [
|
|
506
|
-
|
|
507
|
-
render: (a = (n = (c =
|
|
508
|
-
props: (
|
|
509
|
+
u(e(E), {
|
|
510
|
+
render: (a = (n = (c = d.cellByColId.Delete) == null ? void 0 : c.column) == null ? void 0 : n.columnDef) == null ? void 0 : a.cell,
|
|
511
|
+
props: (L = (F = d.cellByColId.Delete) == null ? void 0 : F.getContext) == null ? void 0 : L.call(F)
|
|
509
512
|
}, null, 8, ["render", "props"])
|
|
510
513
|
])
|
|
511
514
|
]),
|
|
512
|
-
s("div",
|
|
513
|
-
s("div",
|
|
514
|
-
|
|
515
|
-
label: e(y)(`inventory.transfer.form.items.table.${e(
|
|
515
|
+
s("div", Qt, [
|
|
516
|
+
s("div", Ht, [
|
|
517
|
+
u(_, {
|
|
518
|
+
label: e(y)(`inventory.transfer.form.items.table.${e(V).Code}`)
|
|
516
519
|
}, null, 8, ["label"]),
|
|
517
|
-
|
|
518
|
-
render: (
|
|
519
|
-
props: (
|
|
520
|
+
u(e(E), {
|
|
521
|
+
render: (I = (M = (S = d.cellByColId[e(V).Code]) == null ? void 0 : S.column) == null ? void 0 : M.columnDef) == null ? void 0 : I.cell,
|
|
522
|
+
props: (v = (h = d.cellByColId[e(V).Code]) == null ? void 0 : h.getContext) == null ? void 0 : v.call(h)
|
|
520
523
|
}, null, 8, ["render", "props"]),
|
|
521
524
|
l[0] || (l[0] = s("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
522
525
|
]),
|
|
523
|
-
s("div",
|
|
524
|
-
|
|
525
|
-
label: e(y)(`inventory.transfer.form.items.table.${e(
|
|
526
|
+
s("div", Gt, [
|
|
527
|
+
u(_, {
|
|
528
|
+
label: e(y)(`inventory.transfer.form.items.table.${e(V).Name}`)
|
|
526
529
|
}, null, 8, ["label"]),
|
|
527
|
-
|
|
528
|
-
render: (q = (R = (
|
|
529
|
-
props: (o = (
|
|
530
|
+
u(e(E), {
|
|
531
|
+
render: (q = (R = (g = d.cellByColId[e(V).Name]) == null ? void 0 : g.column) == null ? void 0 : R.columnDef) == null ? void 0 : q.cell,
|
|
532
|
+
props: (o = (p = d.cellByColId[e(V).Name]) == null ? void 0 : p.getContext) == null ? void 0 : o.call(p)
|
|
530
533
|
}, null, 8, ["render", "props"]),
|
|
531
534
|
l[1] || (l[1] = s("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
532
535
|
])
|
|
533
536
|
]),
|
|
534
|
-
s("div",
|
|
535
|
-
s("div",
|
|
536
|
-
|
|
537
|
-
label: e(y)(`inventory.transfer.form.items.table.${e(
|
|
537
|
+
s("div", Yt, [
|
|
538
|
+
s("div", Wt, [
|
|
539
|
+
u(_, {
|
|
540
|
+
label: e(y)(`inventory.transfer.form.items.table.${e(V).Limit}`)
|
|
538
541
|
}, null, 8, ["label"]),
|
|
539
|
-
|
|
540
|
-
render: (
|
|
541
|
-
props: (
|
|
542
|
+
u(e(E), {
|
|
543
|
+
render: (m = (r = (t = d.cellByColId[e(V).Limit]) == null ? void 0 : t.column) == null ? void 0 : r.columnDef) == null ? void 0 : m.cell,
|
|
544
|
+
props: (b = (i = d.cellByColId[e(V).Limit]) == null ? void 0 : i.getContext) == null ? void 0 : b.call(i)
|
|
542
545
|
}, null, 8, ["render", "props"]),
|
|
543
546
|
l[2] || (l[2] = s("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
544
547
|
]),
|
|
545
|
-
s("div",
|
|
546
|
-
|
|
547
|
-
label: e(y)(`inventory.transfer.form.items.table.${e(
|
|
548
|
+
s("div", Kt, [
|
|
549
|
+
u(_, {
|
|
550
|
+
label: e(y)(`inventory.transfer.form.items.table.${e(V).Step}`)
|
|
548
551
|
}, null, 8, ["label"]),
|
|
549
|
-
|
|
550
|
-
render: (
|
|
551
|
-
props: (z = (B =
|
|
552
|
+
u(e(E), {
|
|
553
|
+
render: (k = ($ = (A = d.cellByColId[e(V).Step]) == null ? void 0 : A.column) == null ? void 0 : $.columnDef) == null ? void 0 : k.cell,
|
|
554
|
+
props: (z = (B = d.cellByColId[e(V).Step]) == null ? void 0 : B.getContext) == null ? void 0 : z.call(B)
|
|
552
555
|
}, null, 8, ["render", "props"]),
|
|
553
556
|
l[3] || (l[3] = s("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
554
557
|
])
|
|
555
558
|
]),
|
|
556
|
-
s("div",
|
|
557
|
-
s("div",
|
|
558
|
-
|
|
559
|
-
label: e(y)(`inventory.transfer.form.items.table.${e(
|
|
559
|
+
s("div", Zt, [
|
|
560
|
+
s("div", Jt, [
|
|
561
|
+
u(_, {
|
|
562
|
+
label: e(y)(`inventory.transfer.form.items.table.${e(V).DefaultAmount}`)
|
|
560
563
|
}, null, 8, ["label"]),
|
|
561
|
-
|
|
562
|
-
render: (Q = (
|
|
563
|
-
props: (ee = (Y =
|
|
564
|
+
u(e(E), {
|
|
565
|
+
render: (Q = (x = (j = d.cellByColId[e(V).DefaultAmount]) == null ? void 0 : j.column) == null ? void 0 : x.columnDef) == null ? void 0 : Q.cell,
|
|
566
|
+
props: (ee = (Y = d.cellByColId[e(V).DefaultAmount]) == null ? void 0 : Y.getContext) == null ? void 0 : ee.call(Y)
|
|
564
567
|
}, null, 8, ["render", "props"]),
|
|
565
568
|
l[4] || (l[4] = s("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
566
569
|
]),
|
|
567
|
-
s("div",
|
|
568
|
-
|
|
570
|
+
s("div", Xt, [
|
|
571
|
+
u(St, { "z-index": 50 }, {
|
|
569
572
|
default: D(() => [
|
|
570
|
-
|
|
571
|
-
label: e(y)(`inventory.transfer.form.items.table.${e(
|
|
573
|
+
u(_, {
|
|
574
|
+
label: e(y)(`inventory.transfer.form.items.table.${e(V).Cost}2`)
|
|
572
575
|
}, null, 8, ["label"])
|
|
573
576
|
]),
|
|
574
577
|
_: 1
|
|
575
578
|
}),
|
|
576
|
-
|
|
577
|
-
render: (oe = (W = (te =
|
|
578
|
-
props: (se = (K =
|
|
579
|
+
u(e(E), {
|
|
580
|
+
render: (oe = (W = (te = d.cellByColId[e(V).Cost]) == null ? void 0 : te.column) == null ? void 0 : W.columnDef) == null ? void 0 : oe.cell,
|
|
581
|
+
props: (se = (K = d.cellByColId[e(V).Cost]) == null ? void 0 : K.getContext) == null ? void 0 : se.call(K)
|
|
579
582
|
}, null, 8, ["render", "props"]),
|
|
580
583
|
l[5] || (l[5] = s("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
|
|
581
584
|
])
|
|
@@ -583,106 +586,55 @@ const Bt = { class: "flex flex-col gap-8 py-16" }, qt = { class: "flex items-cen
|
|
|
583
586
|
]);
|
|
584
587
|
};
|
|
585
588
|
}
|
|
586
|
-
})
|
|
587
|
-
function Ye(m) {
|
|
588
|
-
const y = ze(), u = ye(), { t: l } = Z(), _ = V({
|
|
589
|
-
get() {
|
|
590
|
-
return Array.isArray(m.getLocations());
|
|
591
|
-
},
|
|
592
|
-
set(v) {
|
|
593
|
-
v ? m.setLocations([]) : m.setLocations(null);
|
|
594
|
-
}
|
|
595
|
-
});
|
|
596
|
-
function c() {
|
|
597
|
-
var v;
|
|
598
|
-
y.open({
|
|
599
|
-
title: "Select at least one location",
|
|
600
|
-
contentComponent: Ne,
|
|
601
|
-
contentComponentProps: {
|
|
602
|
-
modelValue: ((v = n.value) == null ? void 0 : v.map((b) => b.doc._id)) ?? [],
|
|
603
|
-
items: u.locations.map((b) => ({
|
|
604
|
-
label: b.name,
|
|
605
|
-
sublabel: b.type,
|
|
606
|
-
value: b.doc._id
|
|
607
|
-
}))
|
|
608
|
-
},
|
|
609
|
-
primaryActions: {
|
|
610
|
-
text: l("common.confirm"),
|
|
611
|
-
close: !0
|
|
612
|
-
},
|
|
613
|
-
secondaryActions: {
|
|
614
|
-
text: l("common.close"),
|
|
615
|
-
close: !0
|
|
616
|
-
}
|
|
617
|
-
}).onPrimary((b) => {
|
|
618
|
-
m.setLocations(u.locations.filter((g) => b.includes(g.doc._id)));
|
|
619
|
-
});
|
|
620
|
-
}
|
|
621
|
-
const n = V(() => {
|
|
622
|
-
var b;
|
|
623
|
-
const v = /* @__PURE__ */ new Set([...u.locations.map((g) => g.doc._id)]);
|
|
624
|
-
return (b = m.getLocations()) == null ? void 0 : b.filter((g) => v.has(g.doc._id));
|
|
625
|
-
});
|
|
626
|
-
function a(v) {
|
|
627
|
-
var b;
|
|
628
|
-
m.setLocations((b = m.getLocations()) == null ? void 0 : b.filter((g) => g.doc._id !== v));
|
|
629
|
-
}
|
|
630
|
-
return {
|
|
631
|
-
enabledLocations: n,
|
|
632
|
-
enabledLocationsSwitch: _,
|
|
633
|
-
promptSelectLocations: c,
|
|
634
|
-
removeLocation: a
|
|
635
|
-
};
|
|
636
|
-
}
|
|
637
|
-
const Xt = { class: "flex flex-col gap-16" }, eo = { key: 0 }, to = { class: "flex flex-col gap-24" }, oo = {
|
|
589
|
+
}), to = { class: "flex flex-col gap-16" }, oo = { key: 0 }, so = { class: "flex flex-col gap-24" }, no = {
|
|
638
590
|
key: 0,
|
|
639
591
|
class: "p-16 border border-fm-color-neutral-gray-300 fm-corner-radius-md flex flex-col gap-16"
|
|
640
|
-
},
|
|
592
|
+
}, lo = { key: 1 }, ao = { class: "flex flex-col gap-16" }, ro = { class: "flex" }, io = { class: "flex-1 gap-8 fm-typo-en-title-sm-800" }, uo = /* @__PURE__ */ J({
|
|
641
593
|
__name: "TransferTemplateForm",
|
|
642
594
|
props: {
|
|
643
595
|
modelValue: {},
|
|
644
596
|
disabled: { type: Boolean }
|
|
645
597
|
},
|
|
646
|
-
setup(
|
|
647
|
-
const
|
|
598
|
+
setup(f, { expose: y }) {
|
|
599
|
+
const d = f, l = Qe(), { t: _ } = X(), c = ge(), n = bt(), a = $t(), F = O(() => c.businessLevel);
|
|
648
600
|
fe(
|
|
649
|
-
() =>
|
|
601
|
+
() => d.modelValue,
|
|
650
602
|
(o) => {
|
|
651
603
|
console.log("TransferTemplateForm.model", o);
|
|
652
604
|
}
|
|
653
605
|
), c.watchLocation(async () => {
|
|
654
606
|
location && (l.purchaseOrder.supplier || (l.purchaseOrder.supplier = a.suppliers.find((o) => o) ?? l.purchaseOrder.supplier));
|
|
655
607
|
});
|
|
656
|
-
const
|
|
608
|
+
const L = kt(), { enabledLocations: S, enabledLocationsSwitch: M, promptSelectLocations: I, removeLocation: h } = Ye({
|
|
657
609
|
getLocations() {
|
|
658
610
|
return l.locations;
|
|
659
611
|
},
|
|
660
612
|
setLocations(o) {
|
|
661
613
|
l.locations = o;
|
|
662
614
|
}
|
|
663
|
-
}),
|
|
615
|
+
}), v = O({
|
|
664
616
|
get() {
|
|
665
617
|
return l.purchaseOrder.remark ?? void 0;
|
|
666
618
|
},
|
|
667
619
|
set(o) {
|
|
668
620
|
l.purchaseOrder.remark = o;
|
|
669
621
|
}
|
|
670
|
-
}),
|
|
622
|
+
}), g = U();
|
|
671
623
|
y({
|
|
672
624
|
validateInputs: () => {
|
|
673
625
|
var o, t;
|
|
674
|
-
(t = (o =
|
|
626
|
+
(t = (o = g.value) == null ? void 0 : o.validateInputs) == null || t.call(o);
|
|
675
627
|
},
|
|
676
628
|
resetInputsValidation: () => {
|
|
677
629
|
var o, t;
|
|
678
|
-
(t = (o =
|
|
630
|
+
(t = (o = g.value) == null ? void 0 : o.resetInputsValidation) == null || t.call(o);
|
|
679
631
|
},
|
|
680
632
|
resetInputs: () => {
|
|
681
633
|
var o, t;
|
|
682
|
-
(t = (o =
|
|
634
|
+
(t = (o = g.value) == null ? void 0 : o.resetInputs) == null || t.call(o);
|
|
683
635
|
}
|
|
684
636
|
});
|
|
685
|
-
const R =
|
|
637
|
+
const R = qt({
|
|
686
638
|
updateItem: (o) => {
|
|
687
639
|
l.purchaseOrder.items = l.purchaseOrder.items.map((t) => t.sku._id !== o.sku._id ? t : o);
|
|
688
640
|
},
|
|
@@ -701,22 +653,22 @@ const Xt = { class: "flex flex-col gap-16" }, eo = { key: 0 }, to = { class: "fl
|
|
|
701
653
|
return pe.PURCHASE;
|
|
702
654
|
},
|
|
703
655
|
get disabled() {
|
|
704
|
-
return
|
|
656
|
+
return d.disabled;
|
|
705
657
|
}
|
|
706
|
-
}), q =
|
|
707
|
-
function
|
|
658
|
+
}), q = O(() => R.columnDefs.value);
|
|
659
|
+
function p() {
|
|
708
660
|
const o = n.skus.map((r) => ({
|
|
709
661
|
label: r.name,
|
|
710
662
|
sublabel: r.code,
|
|
711
663
|
value: r
|
|
712
664
|
})), t = o.filter((r) => {
|
|
713
|
-
var
|
|
714
|
-
return (
|
|
665
|
+
var m;
|
|
666
|
+
return (m = l.purchaseOrder.items) == null ? void 0 : m.find((i) => i.sku._id === r.value._id);
|
|
715
667
|
}).map((r) => r.value);
|
|
716
|
-
|
|
668
|
+
L.open({
|
|
717
669
|
title: _("inventory.transfer.form.items.selectItem"),
|
|
718
670
|
closeButton: !0,
|
|
719
|
-
contentComponent:
|
|
671
|
+
contentComponent: _t,
|
|
720
672
|
contentComponentProps: {
|
|
721
673
|
modelValue: t,
|
|
722
674
|
items: o
|
|
@@ -731,100 +683,100 @@ const Xt = { class: "flex flex-col gap-16" }, eo = { key: 0 }, to = { class: "fl
|
|
|
731
683
|
variant: "tertiary"
|
|
732
684
|
}
|
|
733
685
|
}).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:
|
|
686
|
+
const m = l.purchaseOrder.items ?? [], i = r.map((b) => {
|
|
687
|
+
const A = m.find((B) => B.sku._id === b._id);
|
|
688
|
+
if (A)
|
|
689
|
+
return A;
|
|
690
|
+
const $ = { amount: 1, precision: de(b.unit) }, k = {
|
|
691
|
+
sku: b,
|
|
692
|
+
code: b.code,
|
|
693
|
+
name: b.name,
|
|
694
|
+
quantity: $,
|
|
695
|
+
minimumQuantity: $,
|
|
696
|
+
maximumQuantity: $,
|
|
697
|
+
quantityStep: $
|
|
746
698
|
};
|
|
747
|
-
return
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
699
|
+
return k.totalCost = He(
|
|
700
|
+
k.sku,
|
|
701
|
+
k.quantity,
|
|
702
|
+
k.measurement,
|
|
751
703
|
{
|
|
752
704
|
supplier: l.purchaseOrder.supplier
|
|
753
705
|
}
|
|
754
|
-
),
|
|
706
|
+
), k;
|
|
755
707
|
});
|
|
756
|
-
i.sort((
|
|
708
|
+
i.sort((b, A) => b.sku.code.localeCompare(A.sku.code)), l.purchaseOrder.items = i;
|
|
757
709
|
});
|
|
758
710
|
}
|
|
759
711
|
return (o, t) => {
|
|
760
|
-
const r =
|
|
761
|
-
return
|
|
712
|
+
const r = C("FmChip"), m = C("FmTextField"), i = C("FmTextarea"), b = C("FmSwitch"), A = C("FmButton"), $ = C("FmListItem"), k = C("FmList"), B = C("FmFormGroup"), z = C("FmTable"), j = C("FmForm");
|
|
713
|
+
return w(), N(j, {
|
|
762
714
|
ref_key: "formRef",
|
|
763
|
-
ref:
|
|
715
|
+
ref: g,
|
|
764
716
|
class: "flex flex-col gap-32",
|
|
765
717
|
disabled: o.disabled
|
|
766
718
|
}, {
|
|
767
719
|
default: D(() => [
|
|
768
|
-
s("div",
|
|
769
|
-
|
|
770
|
-
|
|
720
|
+
s("div", to, [
|
|
721
|
+
F.value ? (w(), P("div", oo, [
|
|
722
|
+
u(r, {
|
|
771
723
|
label: "Business template",
|
|
772
724
|
compact: ""
|
|
773
725
|
})
|
|
774
726
|
])) : H("", !0),
|
|
775
|
-
s("div",
|
|
776
|
-
|
|
727
|
+
s("div", so, [
|
|
728
|
+
u(m, {
|
|
777
729
|
label: e(_)("inventory.transfer.form.name"),
|
|
778
730
|
"label-mark": "required",
|
|
779
731
|
modelValue: e(l).name,
|
|
780
|
-
"onUpdate:modelValue": t[0] || (t[0] = (
|
|
781
|
-
rules: [e(
|
|
732
|
+
"onUpdate:modelValue": t[0] || (t[0] = (x) => e(l).name = x),
|
|
733
|
+
rules: [e(be)()]
|
|
782
734
|
}, null, 8, ["label", "modelValue", "rules"]),
|
|
783
|
-
|
|
735
|
+
u(m, {
|
|
784
736
|
label: e(_)("inventory.transfer.form.reference"),
|
|
785
737
|
"label-mark": "optional",
|
|
786
738
|
modelValue: e(l).purchaseOrder.ref,
|
|
787
|
-
"onUpdate:modelValue": t[1] || (t[1] = (
|
|
739
|
+
"onUpdate:modelValue": t[1] || (t[1] = (x) => e(l).purchaseOrder.ref = x)
|
|
788
740
|
}, null, 8, ["label", "modelValue"]),
|
|
789
|
-
|
|
741
|
+
u(i, {
|
|
790
742
|
label: e(_)("inventory.transfer.form.remark"),
|
|
791
743
|
"label-mark": "optional",
|
|
792
744
|
"max-length": 240,
|
|
793
|
-
modelValue:
|
|
794
|
-
"onUpdate:modelValue": t[2] || (t[2] = (
|
|
745
|
+
modelValue: v.value,
|
|
746
|
+
"onUpdate:modelValue": t[2] || (t[2] = (x) => v.value = x),
|
|
795
747
|
class: me({ "text-fm-color-typo-disabled": o.disabled })
|
|
796
748
|
}, null, 8, ["label", "modelValue", "class"])
|
|
797
749
|
])
|
|
798
750
|
]),
|
|
799
|
-
e(c).businessLevel ? (
|
|
800
|
-
|
|
801
|
-
modelValue: e(
|
|
802
|
-
"onUpdate:modelValue": t[3] || (t[3] = (
|
|
751
|
+
e(c).businessLevel ? (w(), P("div", no, [
|
|
752
|
+
u(b, {
|
|
753
|
+
modelValue: e(M),
|
|
754
|
+
"onUpdate:modelValue": t[3] || (t[3] = (x) => xe(M) ? M.value = x : null),
|
|
803
755
|
label: "Locations rule",
|
|
804
756
|
sublabel: "Enable template for specific locations only",
|
|
805
757
|
"label-placement": "right"
|
|
806
758
|
}, null, 8, ["modelValue"]),
|
|
807
|
-
e(
|
|
759
|
+
e(M) ? (w(), N(B, {
|
|
808
760
|
key: 0,
|
|
809
|
-
modelValue: e(
|
|
810
|
-
rules: [e(
|
|
761
|
+
modelValue: e(S),
|
|
762
|
+
rules: [e(Ne)(1)],
|
|
811
763
|
class: "flex-1 flex gap-8 h-48 xs:flex-col xs:pt-16 sm:flex-col sm:pt-16"
|
|
812
764
|
}, {
|
|
813
765
|
default: D(() => [
|
|
814
|
-
|
|
766
|
+
u(k, null, {
|
|
815
767
|
default: D(() => [
|
|
816
|
-
(
|
|
817
|
-
key:
|
|
818
|
-
label:
|
|
819
|
-
sublabel:
|
|
768
|
+
(w(!0), P(ce, null, ve(e(S), (x) => (w(), N($, {
|
|
769
|
+
key: x.doc._id,
|
|
770
|
+
label: x.name,
|
|
771
|
+
sublabel: x.type,
|
|
820
772
|
disabled: o.disabled
|
|
821
773
|
}, {
|
|
822
774
|
append: D(() => [
|
|
823
|
-
|
|
775
|
+
u(A, {
|
|
824
776
|
"prepend-icon": "delete",
|
|
825
777
|
variant: "tertiary",
|
|
826
778
|
disabled: o.disabled,
|
|
827
|
-
onClick: (Q) => e(
|
|
779
|
+
onClick: (Q) => e(h)(x.doc._id)
|
|
828
780
|
}, null, 8, ["disabled", "onClick"])
|
|
829
781
|
]),
|
|
830
782
|
_: 2
|
|
@@ -835,44 +787,44 @@ const Xt = { class: "flex flex-col gap-16" }, eo = { key: 0 }, to = { class: "fl
|
|
|
835
787
|
]),
|
|
836
788
|
_: 1
|
|
837
789
|
}, 8, ["modelValue", "rules"])) : H("", !0),
|
|
838
|
-
e(
|
|
839
|
-
|
|
790
|
+
e(M) ? (w(), P("div", lo, [
|
|
791
|
+
u(A, {
|
|
840
792
|
disabled: o.disabled,
|
|
841
793
|
label: e(_)("inventory.transfer.form.items.addItem"),
|
|
842
794
|
"prepend-icon": "add",
|
|
843
795
|
variant: "plain",
|
|
844
796
|
class: "border-2 rounded-lg border-fm-color-primary",
|
|
845
|
-
onClick: e(
|
|
797
|
+
onClick: e(I)
|
|
846
798
|
}, null, 8, ["disabled", "label", "onClick"])
|
|
847
799
|
])) : H("", !0)
|
|
848
800
|
])) : H("", !0),
|
|
849
|
-
s("div",
|
|
850
|
-
s("div",
|
|
851
|
-
s("div",
|
|
852
|
-
|
|
801
|
+
s("div", ao, [
|
|
802
|
+
s("div", ro, [
|
|
803
|
+
s("div", io, T(e(_)("inventory.transfer.form.items.title")), 1),
|
|
804
|
+
u(A, {
|
|
853
805
|
disabled: o.disabled,
|
|
854
806
|
label: e(_)("inventory.transfer.form.items.addItem"),
|
|
855
807
|
"prepend-icon": "add",
|
|
856
808
|
variant: "plain",
|
|
857
809
|
class: "border-2 rounded-lg border-fm-color-primary",
|
|
858
|
-
onClick: t[4] || (t[4] = (
|
|
810
|
+
onClick: t[4] || (t[4] = (x) => p()),
|
|
859
811
|
size: "md"
|
|
860
812
|
}, null, 8, ["disabled", "label"])
|
|
861
813
|
]),
|
|
862
|
-
(
|
|
814
|
+
(w(), N(z, {
|
|
863
815
|
"column-defs": q.value,
|
|
864
816
|
"row-data": e(l).purchaseOrder.items,
|
|
865
|
-
key: e(l).purchaseOrder.items.map((
|
|
817
|
+
key: e(l).purchaseOrder.items.map((x) => x.sku._id).join("."),
|
|
866
818
|
"hide-footer": ""
|
|
867
819
|
}, {
|
|
868
|
-
"list-row": D((
|
|
869
|
-
(
|
|
870
|
-
row:
|
|
820
|
+
"list-row": D((x) => [
|
|
821
|
+
(w(), N(Ge, {
|
|
822
|
+
row: x,
|
|
871
823
|
key: e(l).purchaseOrder.items.map((Q) => Q.sku._id).join(".")
|
|
872
824
|
}, {
|
|
873
825
|
default: D((Q) => [
|
|
874
|
-
|
|
875
|
-
row:
|
|
826
|
+
u(eo, {
|
|
827
|
+
row: x,
|
|
876
828
|
"cell-by-col-id": Q
|
|
877
829
|
}, null, 8, ["row", "cell-by-col-id"])
|
|
878
830
|
]),
|
|
@@ -887,7 +839,7 @@ const Xt = { class: "flex flex-col gap-16" }, eo = { key: 0 }, to = { class: "fl
|
|
|
887
839
|
}, 8, ["disabled"]);
|
|
888
840
|
};
|
|
889
841
|
}
|
|
890
|
-
}),
|
|
842
|
+
}), mo = { class: "flex items-center" }, co = { class: "fm-typo-en-title-md-800" }, po = { class: "flex gap-4" }, fo = /* @__PURE__ */ J({
|
|
891
843
|
__name: "TransferTemplateDialog",
|
|
892
844
|
props: {
|
|
893
845
|
mode: {},
|
|
@@ -895,10 +847,10 @@ const Xt = { class: "flex flex-col gap-16" }, eo = { key: 0 }, to = { class: "fl
|
|
|
895
847
|
show: { type: Boolean }
|
|
896
848
|
},
|
|
897
849
|
emits: ["update:show", "submitted"],
|
|
898
|
-
setup(
|
|
850
|
+
setup(f, { expose: y, emit: d }) {
|
|
899
851
|
var o;
|
|
900
|
-
const l =
|
|
901
|
-
function
|
|
852
|
+
const l = f, _ = d, c = at(), n = wt(), { t: a } = X(), F = je(l, "show");
|
|
853
|
+
function L() {
|
|
902
854
|
return {
|
|
903
855
|
_id: "",
|
|
904
856
|
name: "",
|
|
@@ -930,15 +882,15 @@ const Xt = { class: "flex flex-col gap-16" }, eo = { key: 0 }, to = { class: "fl
|
|
|
930
882
|
}
|
|
931
883
|
};
|
|
932
884
|
}
|
|
933
|
-
const
|
|
885
|
+
const S = U(l.modelValue ?? L()), M = U(((o = l.modelValue) == null ? void 0 : o._id) ?? `${Math.random()}`);
|
|
934
886
|
fe(
|
|
935
887
|
() => l.show,
|
|
936
888
|
(t) => {
|
|
937
889
|
var r;
|
|
938
|
-
t && (
|
|
890
|
+
t && (S.value = l.modelValue ?? L(), M.value = ((r = l.modelValue) == null ? void 0 : r._id) ?? `${Math.random()}`);
|
|
939
891
|
}
|
|
940
892
|
);
|
|
941
|
-
const
|
|
893
|
+
const I = U(!1), h = O(() => {
|
|
942
894
|
switch (l.mode) {
|
|
943
895
|
case ne.READ:
|
|
944
896
|
return "";
|
|
@@ -948,27 +900,27 @@ const Xt = { class: "flex flex-col gap-16" }, eo = { key: 0 }, to = { class: "fl
|
|
|
948
900
|
return a("inventory.transfer.template.update.title");
|
|
949
901
|
}
|
|
950
902
|
return "";
|
|
951
|
-
}),
|
|
903
|
+
}), v = U();
|
|
952
904
|
y({
|
|
953
905
|
validateInputs: () => {
|
|
954
906
|
var t, r;
|
|
955
|
-
(r = (t =
|
|
907
|
+
(r = (t = v.value) == null ? void 0 : t.validateInputs) == null || r.call(t);
|
|
956
908
|
},
|
|
957
909
|
resetInputsValidation: () => {
|
|
958
910
|
var t, r;
|
|
959
|
-
(r = (t =
|
|
911
|
+
(r = (t = v.value) == null ? void 0 : t.resetInputsValidation) == null || r.call(t);
|
|
960
912
|
},
|
|
961
913
|
resetInputs: () => {
|
|
962
914
|
var t, r;
|
|
963
|
-
(r = (t =
|
|
915
|
+
(r = (t = v.value) == null ? void 0 : t.resetInputs) == null || r.call(t);
|
|
964
916
|
}
|
|
965
917
|
});
|
|
966
|
-
async function
|
|
967
|
-
var r,
|
|
968
|
-
const t =
|
|
918
|
+
async function g() {
|
|
919
|
+
var r, m;
|
|
920
|
+
const t = S.value;
|
|
969
921
|
if (t) {
|
|
970
|
-
|
|
971
|
-
({ totalCost: i, ...
|
|
922
|
+
I.value = !0, (((r = t.purchaseOrder.supplier) == null ? void 0 : r.internal) === ie.enum.warehouse || ((m = t.purchaseOrder.supplier) == null ? void 0 : m.internal) === ie.enum.restaurant) && (t.purchaseOrder.items = t.purchaseOrder.items.map(
|
|
923
|
+
({ totalCost: i, ...b }) => b
|
|
972
924
|
));
|
|
973
925
|
try {
|
|
974
926
|
await c.createTemplate(t), await new Promise((i) => setTimeout(i, 1e3)), n.open({
|
|
@@ -983,16 +935,16 @@ const Xt = { class: "flex flex-col gap-16" }, eo = { key: 0 }, to = { class: "fl
|
|
|
983
935
|
type: "error"
|
|
984
936
|
}), console.error("Error in creating transfer template", i);
|
|
985
937
|
} finally {
|
|
986
|
-
|
|
938
|
+
I.value = !1;
|
|
987
939
|
}
|
|
988
940
|
}
|
|
989
941
|
}
|
|
990
942
|
async function R() {
|
|
991
|
-
var r,
|
|
992
|
-
const t =
|
|
943
|
+
var r, m;
|
|
944
|
+
const t = S.value;
|
|
993
945
|
if (t) {
|
|
994
|
-
|
|
995
|
-
({ totalCost: i, ...
|
|
946
|
+
I.value = !0, (((r = t.purchaseOrder.supplier) == null ? void 0 : r.internal) === ie.enum.warehouse || ((m = t.purchaseOrder.supplier) == null ? void 0 : m.internal) === ie.enum.restaurant) && (t.purchaseOrder.items = t.purchaseOrder.items.map(
|
|
947
|
+
({ totalCost: i, ...b }) => b
|
|
996
948
|
));
|
|
997
949
|
try {
|
|
998
950
|
await c.updateTemplate(t), await new Promise((i) => setTimeout(i, 1e3)), n.open({
|
|
@@ -1007,60 +959,60 @@ const Xt = { class: "flex flex-col gap-16" }, eo = { key: 0 }, to = { class: "fl
|
|
|
1007
959
|
type: "error"
|
|
1008
960
|
}), console.error("Error in updating transfer template", i);
|
|
1009
961
|
} finally {
|
|
1010
|
-
|
|
962
|
+
I.value = !1;
|
|
1011
963
|
}
|
|
1012
964
|
}
|
|
1013
965
|
}
|
|
1014
966
|
function q() {
|
|
1015
967
|
switch (l.mode) {
|
|
1016
968
|
case ne.CREATE:
|
|
1017
|
-
return
|
|
969
|
+
return g();
|
|
1018
970
|
case ne.UPDATE:
|
|
1019
971
|
return R();
|
|
1020
972
|
}
|
|
1021
973
|
}
|
|
1022
|
-
function
|
|
974
|
+
function p() {
|
|
1023
975
|
var t, r;
|
|
1024
|
-
(r = (t =
|
|
976
|
+
(r = (t = v.value) == null ? void 0 : t.validateInputs) == null || r.call(t);
|
|
1025
977
|
}
|
|
1026
978
|
return (t, r) => {
|
|
1027
|
-
const
|
|
1028
|
-
return
|
|
1029
|
-
modelValue: e(
|
|
1030
|
-
"onUpdate:modelValue": r[2] || (r[2] = (
|
|
979
|
+
const m = C("FmButton"), i = C("FmSideSheet");
|
|
980
|
+
return w(), N(i, {
|
|
981
|
+
modelValue: e(F),
|
|
982
|
+
"onUpdate:modelValue": r[2] || (r[2] = (b) => xe(F) ? F.value = b : null),
|
|
1031
983
|
"dismiss-away": "",
|
|
1032
984
|
"close-button": "",
|
|
1033
985
|
"max-width": 1200
|
|
1034
986
|
}, {
|
|
1035
987
|
"side-sheet-header": D(() => [
|
|
1036
|
-
s("div",
|
|
1037
|
-
s("div",
|
|
988
|
+
s("div", mo, [
|
|
989
|
+
s("div", co, T(h.value), 1)
|
|
1038
990
|
])
|
|
1039
991
|
]),
|
|
1040
992
|
default: D(() => [
|
|
1041
|
-
(
|
|
993
|
+
(w(), N(uo, {
|
|
1042
994
|
class: "w-full",
|
|
1043
995
|
ref_key: "formRef",
|
|
1044
|
-
ref:
|
|
996
|
+
ref: v,
|
|
1045
997
|
onValidationSuccess: q,
|
|
1046
|
-
"model-value":
|
|
1047
|
-
"onUpdate:modelValue": r[0] || (r[0] = (
|
|
1048
|
-
disabled:
|
|
1049
|
-
key:
|
|
998
|
+
"model-value": S.value,
|
|
999
|
+
"onUpdate:modelValue": r[0] || (r[0] = (b) => S.value = b),
|
|
1000
|
+
disabled: I.value,
|
|
1001
|
+
key: M.value
|
|
1050
1002
|
}, null, 8, ["model-value", "disabled"]))
|
|
1051
1003
|
]),
|
|
1052
1004
|
"side-sheet-footer": D(() => [
|
|
1053
|
-
s("div",
|
|
1054
|
-
|
|
1055
|
-
loading:
|
|
1005
|
+
s("div", po, [
|
|
1006
|
+
u(m, {
|
|
1007
|
+
loading: I.value,
|
|
1056
1008
|
label: e(a)("common.save"),
|
|
1057
|
-
onClick:
|
|
1009
|
+
onClick: p
|
|
1058
1010
|
}, null, 8, ["loading", "label"]),
|
|
1059
|
-
|
|
1060
|
-
disabled:
|
|
1011
|
+
u(m, {
|
|
1012
|
+
disabled: I.value,
|
|
1061
1013
|
variant: "tertiary",
|
|
1062
1014
|
label: e(a)("common.close"),
|
|
1063
|
-
onClick: r[1] || (r[1] = (
|
|
1015
|
+
onClick: r[1] || (r[1] = (b) => _("update:show", !1))
|
|
1064
1016
|
}, null, 8, ["disabled", "label"])
|
|
1065
1017
|
])
|
|
1066
1018
|
]),
|
|
@@ -1068,105 +1020,105 @@ const Xt = { class: "flex flex-col gap-16" }, eo = { key: 0 }, to = { class: "fl
|
|
|
1068
1020
|
}, 8, ["modelValue"]);
|
|
1069
1021
|
};
|
|
1070
1022
|
}
|
|
1071
|
-
}),
|
|
1023
|
+
}), 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" }, ko = { class: "fm-typo-en-body-lg-600" }, wo = {
|
|
1072
1024
|
key: 0,
|
|
1073
1025
|
class: "flex flex-col gap-4"
|
|
1074
|
-
},
|
|
1026
|
+
}, Fo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, To = { class: "fm-typo-en-body-lg-600" }, Co = { class: "flex flex-col gap-4" }, $o = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, So = { class: "fm-typo-en-body-lg-600" }, Mo = {
|
|
1075
1027
|
key: 1,
|
|
1076
1028
|
class: "flex flex-col gap-4"
|
|
1077
|
-
},
|
|
1029
|
+
}, Io = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Do = { class: "fm-typo-en-body-lg-600" }, Lo = {
|
|
1078
1030
|
key: 2,
|
|
1079
1031
|
class: "flex flex-col gap-4"
|
|
1080
|
-
},
|
|
1032
|
+
}, Vo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ro = { class: "fm-typo-en-body-lg-600" }, Ao = {
|
|
1081
1033
|
key: 3,
|
|
1082
1034
|
class: "flex flex-col gap-4"
|
|
1083
|
-
},
|
|
1035
|
+
}, 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" }, qo = { class: "flex flex-col gap-8" }, Uo = { class: "fm-typo-en-body-lg-600" }, Eo = { 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" }, jo = { class: "flex w-full gap-4 fm-typo-en-body-sm-400" }, Qo = { class: "grow fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, Ho = {
|
|
1084
1036
|
key: 0,
|
|
1085
1037
|
class: "shrink-0 fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
|
|
1086
|
-
},
|
|
1038
|
+
}, Go = { class: "flex gap-8 xs:flex-col" }, Yo = /* @__PURE__ */ J({
|
|
1087
1039
|
__name: "TransferTemplateDetails",
|
|
1088
1040
|
props: {
|
|
1089
1041
|
template: {},
|
|
1090
1042
|
show: { type: Boolean }
|
|
1091
1043
|
},
|
|
1092
1044
|
emits: ["update:show", "action:use", "action:edit"],
|
|
1093
|
-
setup(
|
|
1094
|
-
const
|
|
1095
|
-
var
|
|
1096
|
-
return (
|
|
1097
|
-
}), { enabledLocations:
|
|
1045
|
+
setup(f, { emit: y }) {
|
|
1046
|
+
const d = f, l = y, _ = he(), c = ge(), { t: n } = X(), a = O(() => {
|
|
1047
|
+
var h;
|
|
1048
|
+
return (h = d.template) == null ? void 0 : h.purchaseOrder;
|
|
1049
|
+
}), { enabledLocations: F } = Ye({
|
|
1098
1050
|
getLocations() {
|
|
1099
|
-
var
|
|
1100
|
-
return (
|
|
1051
|
+
var h;
|
|
1052
|
+
return (h = d.template) == null ? void 0 : h.locations;
|
|
1101
1053
|
},
|
|
1102
1054
|
setLocations() {
|
|
1103
1055
|
}
|
|
1104
|
-
}),
|
|
1056
|
+
}), L = O(() => {
|
|
1105
1057
|
if (!c.businessLevel)
|
|
1106
1058
|
return [c.currentLocation];
|
|
1107
|
-
const
|
|
1108
|
-
return c.locations.filter((
|
|
1109
|
-
}),
|
|
1059
|
+
const h = Array.isArray(F.value) ? F.value : c.locations, v = /* @__PURE__ */ new Set([...h.map((g) => g.doc._id)]);
|
|
1060
|
+
return c.locations.filter((g) => v.has(g.doc._id));
|
|
1061
|
+
}), S = O(
|
|
1110
1062
|
() => {
|
|
1111
|
-
var
|
|
1112
|
-
return ((
|
|
1063
|
+
var h, v, g, R;
|
|
1064
|
+
return ((v = (h = a.value) == null ? void 0 : h.supplier) == null ? void 0 : v.internal) === "restaurant" || ((R = (g = a.value) == null ? void 0 : g.supplier) == null ? void 0 : R.internal) === "warehouse" ? pe.TRANSFER : pe.PURCHASE;
|
|
1113
1065
|
}
|
|
1114
|
-
),
|
|
1115
|
-
return (
|
|
1066
|
+
), M = U(!0), I = je(d, "show");
|
|
1067
|
+
return (h, v) => {
|
|
1116
1068
|
var r;
|
|
1117
|
-
const
|
|
1118
|
-
return
|
|
1119
|
-
header: e(n)("inventory.transfer.template.details.view", { template: (r =
|
|
1120
|
-
modelValue: e(
|
|
1121
|
-
"onUpdate:modelValue":
|
|
1122
|
-
"dismiss-away":
|
|
1069
|
+
const g = C("FmMenuDivider"), R = C("FmCard"), q = C("FmButton"), p = C("FmListItem"), o = C("FmList"), t = C("FmSideSheet");
|
|
1070
|
+
return w(), N(t, {
|
|
1071
|
+
header: e(n)("inventory.transfer.template.details.view", { template: (r = h.template) == null ? void 0 : r.name }),
|
|
1072
|
+
modelValue: e(I),
|
|
1073
|
+
"onUpdate:modelValue": v[1] || (v[1] = (m) => xe(I) ? I.value = m : null),
|
|
1074
|
+
"dismiss-away": M.value,
|
|
1123
1075
|
"close-button": "",
|
|
1124
1076
|
"max-width": 500
|
|
1125
1077
|
}, {
|
|
1126
1078
|
default: D(() => {
|
|
1127
|
-
var
|
|
1079
|
+
var m;
|
|
1128
1080
|
return [
|
|
1129
|
-
s("div",
|
|
1081
|
+
s("div", yo, [
|
|
1130
1082
|
s("div", null, [
|
|
1131
|
-
|
|
1083
|
+
u(R, {
|
|
1132
1084
|
variant: "outlined",
|
|
1133
1085
|
class: "flex flex-col gap-8 px-12 py-16"
|
|
1134
1086
|
}, {
|
|
1135
1087
|
default: D(() => {
|
|
1136
|
-
var i,
|
|
1088
|
+
var i, b, A, $, k, B, z, j, x;
|
|
1137
1089
|
return [
|
|
1138
|
-
s("div", fo, [
|
|
1139
|
-
s("div", yo, $(e(n)("inventory.transfer.template.details.templateSummary")), 1)
|
|
1140
|
-
]),
|
|
1141
|
-
d(F),
|
|
1142
1090
|
s("div", vo, [
|
|
1143
|
-
s("div", bo,
|
|
1144
|
-
|
|
1145
|
-
|
|
1091
|
+
s("div", bo, T(e(n)("inventory.transfer.template.details.templateSummary")), 1)
|
|
1092
|
+
]),
|
|
1093
|
+
u(g),
|
|
1094
|
+
s("div", _o, [
|
|
1095
|
+
s("div", xo, [
|
|
1096
|
+
s("div", ho, [
|
|
1097
|
+
s("div", go, T(e(n)("inventory.transfer.receiveRequest.details.createdAt")), 1)
|
|
1146
1098
|
]),
|
|
1147
|
-
s("div",
|
|
1099
|
+
s("div", ko, T(e(Mt)(((i = h.template) == null ? void 0 : i._id) ?? "")), 1)
|
|
1148
1100
|
]),
|
|
1149
|
-
(
|
|
1150
|
-
s("div",
|
|
1151
|
-
s("div",
|
|
1101
|
+
(b = a.value) != null && b.effectiveAt ? (w(), P("div", wo, [
|
|
1102
|
+
s("div", Fo, T(e(n)("inventory.transfer.receiveRequest.details.backdatedTo")), 1),
|
|
1103
|
+
s("div", To, T(e(xt)(new Date((A = a.value) == null ? void 0 : A.effectiveAt))), 1)
|
|
1152
1104
|
])) : H("", !0),
|
|
1153
|
-
s("div",
|
|
1154
|
-
s("div",
|
|
1155
|
-
s("div",
|
|
1156
|
-
`inventory.transfer.receiveRequest.details.type.${
|
|
1105
|
+
s("div", Co, [
|
|
1106
|
+
s("div", $o, T(e(n)("inventory.transfer.receiveRequest.details.type.title")), 1),
|
|
1107
|
+
s("div", So, T(e(n)(
|
|
1108
|
+
`inventory.transfer.receiveRequest.details.type.${S.value.toLocaleLowerCase("en-US")}`
|
|
1157
1109
|
)), 1)
|
|
1158
1110
|
]),
|
|
1159
|
-
(
|
|
1160
|
-
s("div",
|
|
1161
|
-
s("div",
|
|
1111
|
+
(k = ($ = a.value) == null ? void 0 : $.supplier) != null && k.name ? (w(), P("div", Mo, [
|
|
1112
|
+
s("div", Io, T(e(n)("inventory.transfer.receiveRequest.details.from")), 1),
|
|
1113
|
+
s("div", Do, T((z = (B = a.value) == null ? void 0 : B.supplier) == null ? void 0 : z.name), 1)
|
|
1162
1114
|
])) : H("", !0),
|
|
1163
|
-
(j = a.value) != null && j.ref ? (
|
|
1164
|
-
s("div",
|
|
1165
|
-
s("div",
|
|
1115
|
+
(j = a.value) != null && j.ref ? (w(), P("div", Lo, [
|
|
1116
|
+
s("div", Vo, T(e(n)("inventory.transfer.receiveRequest.details.reference")), 1),
|
|
1117
|
+
s("div", Ro, T(a.value.ref), 1)
|
|
1166
1118
|
])) : H("", !0),
|
|
1167
|
-
(
|
|
1168
|
-
s("div",
|
|
1169
|
-
s("div",
|
|
1119
|
+
(x = a.value) != null && x.remark ? (w(), P("div", Ao, [
|
|
1120
|
+
s("div", Oo, T(e(n)("inventory.transfer.receiveRequest.details.remark")), 1),
|
|
1121
|
+
s("div", Po, T(a.value.remark), 1)
|
|
1170
1122
|
])) : H("", !0)
|
|
1171
1123
|
])
|
|
1172
1124
|
];
|
|
@@ -1174,45 +1126,45 @@ const Xt = { class: "flex flex-col gap-16" }, eo = { key: 0 }, to = { class: "fl
|
|
|
1174
1126
|
_: 1
|
|
1175
1127
|
})
|
|
1176
1128
|
]),
|
|
1177
|
-
s("div",
|
|
1178
|
-
s("div",
|
|
1179
|
-
s("div",
|
|
1180
|
-
(
|
|
1129
|
+
s("div", Bo, [
|
|
1130
|
+
s("div", qo, [
|
|
1131
|
+
s("div", Uo, T(e(n)("inventory.transfer.receiveRequest.details.requestedItems")), 1),
|
|
1132
|
+
(w(!0), P(ce, null, ve(((m = a.value) == null ? void 0 : m.items) ?? [], (i) => (w(), P("div", {
|
|
1181
1133
|
key: i.code,
|
|
1182
1134
|
class: "flex flex-col"
|
|
1183
1135
|
}, [
|
|
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
|
-
]),
|
|
1189
1136
|
s("div", Eo, [
|
|
1190
|
-
s("div",
|
|
1191
|
-
|
|
1137
|
+
s("div", No, T(i.name), 1),
|
|
1138
|
+
v[2] || (v[2] = s("div", { class: "flex-1 min-w-32" }, null, -1)),
|
|
1139
|
+
s("div", zo, T(e(rt)(i.quantity, i.sku.unit, i.measurement)), 1)
|
|
1140
|
+
]),
|
|
1141
|
+
s("div", jo, [
|
|
1142
|
+
s("div", Qo, T(i.code), 1),
|
|
1143
|
+
i.totalCost && e(_).enableTotalCost ? (w(), P("div", Ho, " (" + T(e(ht)(i.totalCost)) + ") ", 1)) : H("", !0)
|
|
1192
1144
|
])
|
|
1193
1145
|
]))), 128))
|
|
1194
1146
|
])
|
|
1195
1147
|
]),
|
|
1196
1148
|
s("div", null, [
|
|
1197
|
-
|
|
1149
|
+
u(R, {
|
|
1198
1150
|
variant: "outlined",
|
|
1199
1151
|
class: "flex flex-col"
|
|
1200
1152
|
}, {
|
|
1201
1153
|
default: D(() => [
|
|
1202
|
-
|
|
1154
|
+
v[3] || (v[3] = s("div", { class: "flex flex-col p-16" }, [
|
|
1203
1155
|
s("div", { class: "fm-typo-en-body-lg-600" }, "Enabled locations"),
|
|
1204
1156
|
s("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Click to use template on the location ")
|
|
1205
1157
|
], -1)),
|
|
1206
|
-
|
|
1158
|
+
u(o, null, {
|
|
1207
1159
|
default: D(() => [
|
|
1208
|
-
(
|
|
1160
|
+
(w(!0), P(ce, null, ve(L.value, (i) => (w(), N(p, {
|
|
1209
1161
|
key: i.doc._id,
|
|
1210
1162
|
label: i.name,
|
|
1211
1163
|
sublabel: i.type,
|
|
1212
|
-
onClick: (
|
|
1164
|
+
onClick: (b) => l("action:use", i.doc._id)
|
|
1213
1165
|
}, {
|
|
1214
1166
|
append: D(() => [
|
|
1215
|
-
|
|
1167
|
+
u(q, {
|
|
1216
1168
|
"prepend-icon": "chevron_right",
|
|
1217
1169
|
variant: "tertiary"
|
|
1218
1170
|
})
|
|
@@ -1230,10 +1182,10 @@ const Xt = { class: "flex flex-col gap-16" }, eo = { key: 0 }, to = { class: "fl
|
|
|
1230
1182
|
];
|
|
1231
1183
|
}),
|
|
1232
1184
|
"side-sheet-footer": D(() => [
|
|
1233
|
-
s("div",
|
|
1234
|
-
|
|
1185
|
+
s("div", Go, [
|
|
1186
|
+
u(q, {
|
|
1235
1187
|
label: e(n)("common.edit"),
|
|
1236
|
-
onClick:
|
|
1188
|
+
onClick: v[0] || (v[0] = (m) => l("action:edit")),
|
|
1237
1189
|
variant: "tertiary"
|
|
1238
1190
|
}, null, 8, ["label"])
|
|
1239
1191
|
])
|
|
@@ -1242,58 +1194,61 @@ const Xt = { class: "flex flex-col gap-16" }, eo = { key: 0 }, to = { class: "fl
|
|
|
1242
1194
|
}, 8, ["header", "modelValue", "dismiss-away"]);
|
|
1243
1195
|
};
|
|
1244
1196
|
}
|
|
1245
|
-
}),
|
|
1197
|
+
}), 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" }, es = { class: "fm-typo-en-body-lg-400 line-clamp-1" }, ts = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, _s = /* @__PURE__ */ J({
|
|
1246
1198
|
__name: "TransferTemplateView",
|
|
1247
|
-
setup(
|
|
1248
|
-
const { t: y } =
|
|
1249
|
-
|
|
1250
|
-
), a =
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
}), fe(
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1199
|
+
setup(f) {
|
|
1200
|
+
const { t: y } = X(), { createTemplate: d, viewTemplate: l } = Be(), { templateDialogProps: _, transferFormDialogProps: c, templateDetailsProps: n } = Ft(
|
|
1201
|
+
Be()
|
|
1202
|
+
), a = it(), F = st(), L = ge(), S = he(), { breakpoints: M } = ze();
|
|
1203
|
+
L.watchLocation(a.fetchTemplates), _e(() => {
|
|
1204
|
+
S.mustManageBusinessOnlyPoTemplate && (L.businessLevel = !0);
|
|
1205
|
+
}), fe(
|
|
1206
|
+
() => {
|
|
1207
|
+
var m;
|
|
1208
|
+
return (m = c.value) == null ? void 0 : m.show;
|
|
1209
|
+
},
|
|
1210
|
+
(m) => {
|
|
1211
|
+
m === !1 && S.mustManageBusinessOnlyPoTemplate && (L.businessLevel = !0);
|
|
1212
|
+
}
|
|
1213
|
+
), Je(() => {
|
|
1214
|
+
L.businessLevel = !1;
|
|
1260
1215
|
});
|
|
1261
|
-
const
|
|
1262
|
-
() => a.loading.value || !
|
|
1263
|
-
),
|
|
1264
|
-
() =>
|
|
1265
|
-
),
|
|
1266
|
-
function
|
|
1267
|
-
switch (
|
|
1268
|
-
case
|
|
1269
|
-
return
|
|
1216
|
+
const I = O(() => L.businessLevel), h = O(
|
|
1217
|
+
() => a.loading.value || !L._currentLocation
|
|
1218
|
+
), v = O(
|
|
1219
|
+
() => I.value ? a.businessTemplates.value : a.locationTemplates.value
|
|
1220
|
+
), g = U(""), R = O(() => M.value.xs || M.value.sm), q = O(() => R.value ? 10 : 20);
|
|
1221
|
+
function p(m) {
|
|
1222
|
+
switch (m) {
|
|
1223
|
+
case qe.Add:
|
|
1224
|
+
return d();
|
|
1270
1225
|
}
|
|
1271
1226
|
}
|
|
1272
|
-
const o =
|
|
1227
|
+
const o = Ct();
|
|
1273
1228
|
function t() {
|
|
1274
1229
|
o.push({ name: gt.RECEIVE_REQUEST });
|
|
1275
1230
|
}
|
|
1276
|
-
function r(
|
|
1277
|
-
return
|
|
1231
|
+
function r(m) {
|
|
1232
|
+
return m;
|
|
1278
1233
|
}
|
|
1279
|
-
return (
|
|
1280
|
-
const
|
|
1281
|
-
return
|
|
1282
|
-
|
|
1234
|
+
return (m, i) => {
|
|
1235
|
+
const b = C("FmTable");
|
|
1236
|
+
return w(), P(ce, null, [
|
|
1237
|
+
u(nt, {
|
|
1283
1238
|
title: e(y)("inventory.transfer.template.title2"),
|
|
1284
1239
|
actions: [
|
|
1285
1240
|
{
|
|
1286
1241
|
label: e(y)("inventory.transfer.template.create.title"),
|
|
1287
|
-
value: e(
|
|
1242
|
+
value: e(qe).Add,
|
|
1288
1243
|
isPrimary: !0,
|
|
1289
1244
|
prependIcon: "add"
|
|
1290
1245
|
}
|
|
1291
1246
|
],
|
|
1292
|
-
"onClick:action":
|
|
1247
|
+
"onClick:action": p,
|
|
1293
1248
|
"using-business-helper-text": "You are managing business-level template list. These templates will be made visible to all locations."
|
|
1294
1249
|
}, {
|
|
1295
1250
|
default: D(() => {
|
|
1296
|
-
var
|
|
1251
|
+
var A;
|
|
1297
1252
|
return [
|
|
1298
1253
|
s("div", {
|
|
1299
1254
|
class: me([
|
|
@@ -1304,64 +1259,65 @@ const Xt = { class: "flex flex-col gap-16" }, eo = { key: 0 }, to = { class: "fl
|
|
|
1304
1259
|
}
|
|
1305
1260
|
])
|
|
1306
1261
|
}, [
|
|
1307
|
-
|
|
1262
|
+
u(lt, {
|
|
1308
1263
|
searchable: "",
|
|
1309
|
-
"change-location": !e(
|
|
1310
|
-
search:
|
|
1311
|
-
"onUpdate:search": i[0] || (i[0] = (
|
|
1264
|
+
"change-location": !e(S).mustManageBusinessOnlyPoTemplate,
|
|
1265
|
+
search: g.value,
|
|
1266
|
+
"onUpdate:search": i[0] || (i[0] = ($) => g.value = $),
|
|
1312
1267
|
actions: [{ icon: "refresh", onClick: e(a).fetchTemplates }],
|
|
1313
1268
|
"show-business": ""
|
|
1314
1269
|
}, null, 8, ["change-location", "search", "actions"]),
|
|
1315
|
-
(
|
|
1316
|
-
style: Xe(e(
|
|
1270
|
+
(w(), N(b, {
|
|
1271
|
+
style: Xe(e(F).tableHeight),
|
|
1317
1272
|
"column-defs": e(a).columnDefs,
|
|
1318
|
-
"row-data":
|
|
1319
|
-
"search-value":
|
|
1320
|
-
loading:
|
|
1321
|
-
key: (
|
|
1322
|
-
onRowClick: i[1] || (i[1] = (
|
|
1273
|
+
"row-data": v.value,
|
|
1274
|
+
"search-value": g.value,
|
|
1275
|
+
loading: h.value,
|
|
1276
|
+
key: (A = e(L)._currentLocation) == null ? void 0 : A.dbName,
|
|
1277
|
+
onRowClick: i[1] || (i[1] = ($) => e(l)($.original)),
|
|
1323
1278
|
"page-size": q.value
|
|
1324
1279
|
}, {
|
|
1325
|
-
"list-row": D((
|
|
1326
|
-
|
|
1327
|
-
row:
|
|
1328
|
-
onRowClick: (
|
|
1280
|
+
"list-row": D(($) => [
|
|
1281
|
+
u(Ge, {
|
|
1282
|
+
row: $,
|
|
1283
|
+
onRowClick: (k) => e(l)(k)
|
|
1329
1284
|
}, {
|
|
1330
|
-
default: D((
|
|
1331
|
-
var B, z, j,
|
|
1285
|
+
default: D((k) => {
|
|
1286
|
+
var B, z, j, x, Q, Y, ee, te, W, oe, K, se, ke, le, we, Fe, Te, Ce, $e, Se, ae, Me, Ie, De, Le, re, Ve;
|
|
1332
1287
|
return [
|
|
1333
|
-
s("div",
|
|
1334
|
-
s("div",
|
|
1335
|
-
s("div",
|
|
1336
|
-
|
|
1337
|
-
render: (j = (z = (B =
|
|
1338
|
-
props: (Q = (
|
|
1288
|
+
s("div", Wo, [
|
|
1289
|
+
s("div", Ko, [
|
|
1290
|
+
s("div", Zo, [
|
|
1291
|
+
u(e(E), {
|
|
1292
|
+
render: (j = (z = (B = k._id) == null ? void 0 : B.column) == null ? void 0 : z.columnDef) == null ? void 0 : j.cell,
|
|
1293
|
+
props: (Q = (x = k._id) == null ? void 0 : x.getContext) == null ? void 0 : Q.call(x)
|
|
1339
1294
|
}, null, 8, ["render", "props"])
|
|
1340
1295
|
]),
|
|
1341
|
-
s("div",
|
|
1342
|
-
|
|
1343
|
-
render: (te = (ee = (Y =
|
|
1344
|
-
props: (oe = (W =
|
|
1296
|
+
s("div", Jo, [
|
|
1297
|
+
u(e(E), {
|
|
1298
|
+
render: (te = (ee = (Y = k.name) == null ? void 0 : Y.column) == null ? void 0 : ee.columnDef) == null ? void 0 : te.cell,
|
|
1299
|
+
props: (oe = (W = k.name) == null ? void 0 : W.getContext) == null ? void 0 : oe.call(W)
|
|
1345
1300
|
}, null, 8, ["render", "props"])
|
|
1346
1301
|
]),
|
|
1347
|
-
s("div",
|
|
1348
|
-
|
|
1349
|
-
render: (ke = (se = (K =
|
|
1350
|
-
props: (we = (le =
|
|
1302
|
+
s("div", Xo, [
|
|
1303
|
+
u(e(E), {
|
|
1304
|
+
render: (ke = (se = (K = k.supplier) == null ? void 0 : K.column) == null ? void 0 : se.columnDef) == null ? void 0 : ke.cell,
|
|
1305
|
+
props: (we = (le = k.supplier) == null ? void 0 : le.getContext) == null ? void 0 : we.call(le)
|
|
1351
1306
|
}, null, 8, ["render", "props"])
|
|
1352
1307
|
]),
|
|
1353
|
-
s("div",
|
|
1354
|
-
s("div",
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1308
|
+
s("div", null, T((Fe = $.original.locations) != null && Fe.length ? `Enabled for ${(Te = $.original.locations) == null ? void 0 : Te.length} outlets` : "Enabled for all outlets"), 1),
|
|
1309
|
+
s("div", es, T($.original.purchaseOrder.items.length ? $.original.purchaseOrder.items.map((We) => We.name).join(", ") : "No items"), 1),
|
|
1310
|
+
s("div", ts, [
|
|
1311
|
+
u(e(E), {
|
|
1312
|
+
render: (Se = ($e = (Ce = k.ref) == null ? void 0 : Ce.column) == null ? void 0 : $e.columnDef) == null ? void 0 : Se.cell,
|
|
1313
|
+
props: (Me = (ae = k.ref) == null ? void 0 : ae.getContext) == null ? void 0 : Me.call(ae)
|
|
1358
1314
|
}, null, 8, ["render", "props"])
|
|
1359
1315
|
])
|
|
1360
1316
|
]),
|
|
1361
1317
|
s("div", null, [
|
|
1362
|
-
|
|
1363
|
-
render: (
|
|
1364
|
-
props: (
|
|
1318
|
+
u(e(E), {
|
|
1319
|
+
render: (Le = (De = (Ie = k.type) == null ? void 0 : Ie.column) == null ? void 0 : De.columnDef) == null ? void 0 : Le.cell,
|
|
1320
|
+
props: (Ve = (re = k.type) == null ? void 0 : re.getContext) == null ? void 0 : Ve.call(re)
|
|
1365
1321
|
}, null, 8, ["render", "props"])
|
|
1366
1322
|
])
|
|
1367
1323
|
])
|
|
@@ -1377,11 +1333,11 @@ const Xt = { class: "flex flex-col gap-16" }, eo = { key: 0 }, to = { class: "fl
|
|
|
1377
1333
|
}),
|
|
1378
1334
|
_: 1
|
|
1379
1335
|
}, 8, ["title", "actions"]),
|
|
1380
|
-
(
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
onSubmitted: i[2] || (i[2] = (
|
|
1336
|
+
(w(), N(et, { to: "body" }, [
|
|
1337
|
+
u(Tt, Pe(e(c), { onSubmitted: t }), null, 16),
|
|
1338
|
+
u(Yo, tt(ot(e(n))), null, 16),
|
|
1339
|
+
u(fo, Pe(e(_), {
|
|
1340
|
+
onSubmitted: i[2] || (i[2] = (A) => e(a).fetchTemplates())
|
|
1385
1341
|
}), null, 16)
|
|
1386
1342
|
]))
|
|
1387
1343
|
], 64);
|
|
@@ -1389,5 +1345,5 @@ const Xt = { class: "flex flex-col gap-16" }, eo = { key: 0 }, to = { class: "fl
|
|
|
1389
1345
|
}
|
|
1390
1346
|
});
|
|
1391
1347
|
export {
|
|
1392
|
-
|
|
1348
|
+
_s as default
|
|
1393
1349
|
};
|