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