@feedmepos/mf-inventory-portal 0.0.21-dev.4 → 0.0.21-dev.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ApprovalView-BHoJzHuo.js +129 -0
- package/dist/{BindingsDialog-BFLeun5L.js → BindingsDialog-sUZjZtSl.js} +1 -1
- package/dist/{BindingsPicker-CnjJZH9t.js → BindingsPicker-CqzSUVc_.js} +1 -1
- package/dist/{BindingsTable-C3VTa0YL.js → BindingsTable-C1o5EgLy.js} +1 -1
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DYBTXD_J.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CpN5Kn8b.js} +1 -1
- package/dist/{IngredientsView-CQYJfAze.js → IngredientsView-CrXPIQme.js} +99 -91
- package/dist/IntegrationView-BJT-KMVp.js +1141 -0
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Wv8RvXJL.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DH0CcGmX.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-DsOGlAb7.js → PremiumBadge.vue_vue_type_script_setup_true_lang-kJKVCH40.js} +1 -1
- package/dist/{PurchaseOrderPrintPreview-B0hDduXB.js → PurchaseOrderPrintPreview-k26o__vy.js} +1 -1
- package/dist/ReceiveRequestView-ysOzzBTW.js +216 -0
- package/dist/{RecipeView-DYKhSgtw.js → RecipeView-DAH8YIzY.js} +182 -174
- package/dist/{StockView-BIGGG87A.js → StockView-BlCpuSLe.js} +547 -539
- package/dist/{SupplierView-DQzopnzt.js → SupplierView-Bwknjcke.js} +263 -255
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-D8-sMRGm.js → TransferDetails.vue_vue_type_script_setup_true_lang-LCNiBfi7.js} +3 -3
- package/dist/{TransferDialog.vue_vue_type_script_setup_true_lang-CSUnXAyq.js → TransferDialog.vue_vue_type_script_setup_true_lang-BDvtif2q.js} +4 -4
- package/dist/{TransferTemplateView-DWF54okN.js → TransferTemplateView-DcMdNiH6.js} +372 -364
- package/dist/{UnitView-Cdw8xxzV.js → UnitView-BVMr4KlR.js} +186 -178
- package/dist/{WarehouseView-DOelxuIh.js → WarehouseView-Dd-e-IlG.js} +388 -380
- package/dist/{app-SBnQEeEV.js → app-S6iG6Hux.js} +4 -4
- package/dist/app.js +1 -1
- package/dist/{decimal-BlEB2PrM.js → decimal-nOOdFIFP.js} +1 -1
- package/dist/{id-to-date-Y6berpHs.js → id-to-date-CKQ0n3Qi.js} +1 -1
- package/dist/{purchase-order-transaction-type-Dp0wsGal.js → purchase-order-transaction-type-CQ-RpJ0h.js} +2 -2
- package/dist/{supplier-I_rYvljH.js → supplier-DQsAfn3q.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{xlsx-DGwG2ekM.js → xlsx-Dgjf-KvE.js} +1 -1
- package/dist/{xlsx.util-Dsf-EgrG.js → xlsx.util-CODYzgF8.js} +2 -2
- package/package.json +3 -3
- package/dist/ApprovalView-BS4jzhAR.js +0 -121
- package/dist/IntegrationView-9V2OcyP_.js +0 -1172
- package/dist/ReceiveRequestView-3boFHkOO.js +0 -208
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { u as
|
|
3
|
-
import { D as
|
|
4
|
-
import { c as
|
|
5
|
-
import { c as
|
|
6
|
-
import { useI18n as
|
|
7
|
-
import { useDialog as
|
|
8
|
-
import { u as
|
|
9
|
-
import { _ as
|
|
10
|
-
function
|
|
11
|
-
const { t: h } =
|
|
1
|
+
import { defineComponent as W, mergeModels as xe, computed as b, useModel as ke, resolveComponent as P, openBlock as U, createElementBlock as B, createElementVNode as r, createVNode as m, withCtx as N, toDisplayString as T, unref as l, Fragment as Ce, renderList as Ie, ref as L, createBlock as z, createCommentVNode as Z, isRef as ve, watch as Me, onMounted as $e, normalizeClass as Ae, normalizeStyle as Ue, Teleport as De } from "vue";
|
|
2
|
+
import { u as ge } from "./supplier-DQsAfn3q.js";
|
|
3
|
+
import { D as fe, R as J, F as A } from "./row-action.enum-PMKMRrZR.js";
|
|
4
|
+
import { c as Fe, _ as Re, F as Q } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
|
|
5
|
+
import { c as ee, u as Ve, a2 as Pe, d as ye, g as Ne, y as Ee, C as X, h as Te, R as F, b as _e, j as he } from "./app-S6iG6Hux.js";
|
|
6
|
+
import { useI18n as q, useCoreStore as Be } from "@feedmepos/mf-common";
|
|
7
|
+
import { useDialog as Se, useSnackbar as we, useProxiedModel as be, useBreakpoints as Le } from "@feedmepos/ui-library";
|
|
8
|
+
import { u as ze, _ as qe, a as Ye } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CpN5Kn8b.js";
|
|
9
|
+
import { _ as He } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
|
|
10
|
+
function Ke(R, C) {
|
|
11
|
+
const { t: h } = q();
|
|
12
12
|
function o(f, a) {
|
|
13
|
-
if (f ===
|
|
14
|
-
R(
|
|
13
|
+
if (f === J.Edit) {
|
|
14
|
+
R(ee(a));
|
|
15
15
|
return;
|
|
16
16
|
}
|
|
17
|
-
if (f ===
|
|
18
|
-
C(
|
|
17
|
+
if (f === J.Delete) {
|
|
18
|
+
C(ee(a));
|
|
19
19
|
return;
|
|
20
20
|
}
|
|
21
21
|
}
|
|
@@ -48,8 +48,8 @@ function Ye(R, C) {
|
|
|
48
48
|
id: "action",
|
|
49
49
|
header: "",
|
|
50
50
|
cell(f) {
|
|
51
|
-
return
|
|
52
|
-
[
|
|
51
|
+
return Fe(
|
|
52
|
+
[fe[J.Edit], fe[J.Delete]],
|
|
53
53
|
(a) => {
|
|
54
54
|
o(a, f.row.original);
|
|
55
55
|
}
|
|
@@ -63,7 +63,7 @@ function Ye(R, C) {
|
|
|
63
63
|
}
|
|
64
64
|
] };
|
|
65
65
|
}
|
|
66
|
-
const
|
|
66
|
+
const je = { class: "flex flex-col gap-12" }, Ge = { class: "flex flex-col" }, Oe = { class: "flex items-center gap-8 py-8" }, Je = { class: "flex-1" }, Qe = { class: "fm-typo-en-title-sm-800" }, We = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Xe = { class: "flex flex-col gap-4" }, Ze = { class: "flex-1" }, et = { class: "flex flex-col" }, tt = { class: "fm-typo-en-body-lg-400" }, lt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, st = { class: "flex-1" }, ot = { class: "flex" }, nt = { class: "text-fm-color-typo-secondary" }, at = /* @__PURE__ */ W({
|
|
67
67
|
__name: "SupplierSupplyItemField",
|
|
68
68
|
props: /* @__PURE__ */ xe({
|
|
69
69
|
modelValue: {}
|
|
@@ -73,23 +73,23 @@ const He = { class: "flex flex-col gap-12" }, Ke = { class: "flex flex-col" }, j
|
|
|
73
73
|
}),
|
|
74
74
|
emits: ["update:modelValue"],
|
|
75
75
|
setup(R) {
|
|
76
|
-
const C =
|
|
77
|
-
function
|
|
76
|
+
const C = Be(), h = Ve(), o = b(() => h.skus), v = Se(), { t: f } = q(), a = ke(R, "modelValue");
|
|
77
|
+
function u() {
|
|
78
78
|
var V;
|
|
79
|
-
const n = h.skus.map((
|
|
80
|
-
label:
|
|
81
|
-
sublabel:
|
|
82
|
-
value:
|
|
83
|
-
})), S = ((V = a.value) == null ? void 0 : V.map((
|
|
79
|
+
const n = h.skus.map((i) => ({
|
|
80
|
+
label: i.name,
|
|
81
|
+
sublabel: i.code,
|
|
82
|
+
value: i._id
|
|
83
|
+
})), S = ((V = a.value) == null ? void 0 : V.map((i) => i.skuId)) ?? [], k = b(
|
|
84
84
|
() => {
|
|
85
|
-
var
|
|
86
|
-
return ((
|
|
85
|
+
var i;
|
|
86
|
+
return ((i = Ne(C.currentCountry.value)) == null ? void 0 : i.currency) ?? "MYR";
|
|
87
87
|
}
|
|
88
88
|
);
|
|
89
89
|
v.open({
|
|
90
90
|
title: f("inventory.supplier.supplyItems.selectItem"),
|
|
91
91
|
closeButton: !0,
|
|
92
|
-
contentComponent:
|
|
92
|
+
contentComponent: Ee,
|
|
93
93
|
contentComponentProps: {
|
|
94
94
|
modelValue: S,
|
|
95
95
|
items: n
|
|
@@ -103,15 +103,15 @@ const He = { class: "flex flex-col gap-12" }, Ke = { class: "flex flex-col" }, j
|
|
|
103
103
|
close: !0,
|
|
104
104
|
variant: "tertiary"
|
|
105
105
|
}
|
|
106
|
-
}).onPrimary((
|
|
107
|
-
const s =
|
|
108
|
-
s.sort((
|
|
109
|
-
const
|
|
110
|
-
var
|
|
111
|
-
const
|
|
112
|
-
return
|
|
113
|
-
skuId:
|
|
114
|
-
defaultCost:
|
|
106
|
+
}).onPrimary((i) => {
|
|
107
|
+
const s = i.map((_) => h.skuById[_]).filter((_) => _);
|
|
108
|
+
s.sort((_, x) => _.code.localeCompare(x.code));
|
|
109
|
+
const d = s.map((_) => {
|
|
110
|
+
var c;
|
|
111
|
+
const x = (c = a.value) == null ? void 0 : c.find((t) => t.skuId === _._id);
|
|
112
|
+
return x || {
|
|
113
|
+
skuId: _._id,
|
|
114
|
+
defaultCost: _.defaultCost ?? {
|
|
115
115
|
costPerUnit: {
|
|
116
116
|
currency: k.value,
|
|
117
117
|
amount: 0,
|
|
@@ -120,16 +120,16 @@ const He = { class: "flex flex-col gap-12" }, Ke = { class: "flex flex-col" }, j
|
|
|
120
120
|
}
|
|
121
121
|
};
|
|
122
122
|
});
|
|
123
|
-
a.value =
|
|
123
|
+
a.value = d;
|
|
124
124
|
});
|
|
125
125
|
}
|
|
126
|
-
function
|
|
126
|
+
function y(n) {
|
|
127
127
|
switch (n) {
|
|
128
|
-
case
|
|
128
|
+
case X.MY:
|
|
129
129
|
return "MYR";
|
|
130
|
-
case
|
|
130
|
+
case X.SG:
|
|
131
131
|
return "SGD";
|
|
132
|
-
case
|
|
132
|
+
case X.ID:
|
|
133
133
|
return "IDR";
|
|
134
134
|
default:
|
|
135
135
|
return "MYR";
|
|
@@ -141,7 +141,7 @@ const He = { class: "flex flex-col gap-12" }, Ke = { class: "flex flex-col" }, j
|
|
|
141
141
|
}
|
|
142
142
|
function E(n) {
|
|
143
143
|
var V;
|
|
144
|
-
const S = n.skuId, k = (V = o.value.find((
|
|
144
|
+
const S = n.skuId, k = (V = o.value.find((i) => i._id === S)) == null ? void 0 : V.unit;
|
|
145
145
|
if (!k)
|
|
146
146
|
throw new Error(`Cannot find ingredient: ${S}`);
|
|
147
147
|
return k;
|
|
@@ -153,13 +153,13 @@ const He = { class: "flex flex-col gap-12" }, Ke = { class: "flex flex-col" }, j
|
|
|
153
153
|
};
|
|
154
154
|
}
|
|
155
155
|
function D(n, S) {
|
|
156
|
-
const V = (a.value ?? []).map((
|
|
157
|
-
...
|
|
156
|
+
const V = (a.value ?? []).map((i) => i.skuId !== n.skuId ? i : {
|
|
157
|
+
...i,
|
|
158
158
|
defaultCost: {
|
|
159
|
-
...
|
|
159
|
+
...i.defaultCost,
|
|
160
160
|
measurement: S.measurement,
|
|
161
161
|
costPerUnit: {
|
|
162
|
-
...
|
|
162
|
+
...i.defaultCost.costPerUnit,
|
|
163
163
|
...S.amount
|
|
164
164
|
}
|
|
165
165
|
}
|
|
@@ -168,66 +168,66 @@ const He = { class: "flex flex-col gap-12" }, Ke = { class: "flex flex-col" }, j
|
|
|
168
168
|
}
|
|
169
169
|
return (n, S) => {
|
|
170
170
|
const k = P("FmButton");
|
|
171
|
-
return U(), B("div",
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
m(
|
|
171
|
+
return U(), B("div", je, [
|
|
172
|
+
r("div", Ge, [
|
|
173
|
+
r("div", Oe, [
|
|
174
|
+
r("div", Je, [
|
|
175
|
+
m(He, { "z-index": 50 }, {
|
|
176
176
|
default: N(() => [
|
|
177
|
-
|
|
177
|
+
r("div", Qe, T(l(f)("inventory.supplier.supplyItems.title")), 1)
|
|
178
178
|
]),
|
|
179
179
|
_: 1
|
|
180
180
|
})
|
|
181
181
|
]),
|
|
182
|
-
|
|
182
|
+
r("div", null, [
|
|
183
183
|
m(k, {
|
|
184
184
|
"prepend-icon": "link",
|
|
185
185
|
label: l(f)("inventory.supplier.supplyItems.addItems"),
|
|
186
186
|
variant: "plain",
|
|
187
|
-
onClick:
|
|
187
|
+
onClick: u
|
|
188
188
|
}, null, 8, ["label"])
|
|
189
189
|
])
|
|
190
190
|
]),
|
|
191
|
-
|
|
191
|
+
r("div", We, T(l(f)("inventory.supplier.supplyItems.overridePriceHint")), 1)
|
|
192
192
|
]),
|
|
193
|
-
|
|
194
|
-
(U(!0), B(
|
|
195
|
-
var s,
|
|
193
|
+
r("div", Xe, [
|
|
194
|
+
(U(!0), B(Ce, null, Ie(a.value, (V, i) => {
|
|
195
|
+
var s, d, _;
|
|
196
196
|
return U(), B("div", {
|
|
197
197
|
key: V.skuId,
|
|
198
198
|
class: "flex"
|
|
199
199
|
}, [
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
200
|
+
r("div", Ze, [
|
|
201
|
+
r("div", et, [
|
|
202
|
+
r("div", tt, T((s = l(h).skuById[V.skuId]) == null ? void 0 : s.name), 1),
|
|
203
|
+
r("div", lt, T((d = l(h).skuById[V.skuId]) == null ? void 0 : d.code), 1)
|
|
204
204
|
])
|
|
205
205
|
]),
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
m(
|
|
206
|
+
r("div", st, [
|
|
207
|
+
r("div", ot, [
|
|
208
|
+
m(Pe, {
|
|
209
209
|
"model-value": g(V),
|
|
210
210
|
unit: E(V),
|
|
211
|
-
"onUpdate:modelValue": (
|
|
212
|
-
placement: a.value &&
|
|
211
|
+
"onUpdate:modelValue": (x) => D(V, x),
|
|
212
|
+
placement: a.value && i === ((_ = a.value) == null ? void 0 : _.length) - 1 ? "top" : "bottom",
|
|
213
213
|
separator: "/",
|
|
214
214
|
"apply-default-rules": "",
|
|
215
215
|
precision: 4,
|
|
216
216
|
"format-minimum-precision": 2
|
|
217
217
|
}, {
|
|
218
218
|
prepend: N(() => {
|
|
219
|
-
var
|
|
219
|
+
var x, I;
|
|
220
220
|
return [
|
|
221
|
-
|
|
221
|
+
r("div", nt, T(y(((x = l(C).currentCountry) == null ? void 0 : x.value) ?? l(ye)) === "MYR" ? "RM" : y(((I = l(C).currentCountry) == null ? void 0 : I.value) ?? l(ye))), 1)
|
|
222
222
|
];
|
|
223
223
|
}),
|
|
224
224
|
_: 2
|
|
225
225
|
}, 1032, ["model-value", "unit", "onUpdate:modelValue", "placement"]),
|
|
226
|
-
|
|
226
|
+
r("div", null, [
|
|
227
227
|
m(k, {
|
|
228
228
|
"prepend-icon": "close",
|
|
229
229
|
variant: "tertiary",
|
|
230
|
-
onClick: (
|
|
230
|
+
onClick: (x) => $(i)
|
|
231
231
|
}, null, 8, ["onClick"])
|
|
232
232
|
])
|
|
233
233
|
])
|
|
@@ -238,10 +238,10 @@ const He = { class: "flex flex-col gap-12" }, Ke = { class: "flex flex-col" }, j
|
|
|
238
238
|
]);
|
|
239
239
|
};
|
|
240
240
|
}
|
|
241
|
-
}),
|
|
241
|
+
}), rt = { class: "flex flex-col gap-40" }, ut = { class: "flex flex-col gap-16" }, it = { key: 0 }, dt = { class: "flex flex-col gap-8" }, pt = { class: "fm-typo-en-title-sm-800" }, ct = { class: "grid grid-cols-2 gap-24" }, mt = { class: "flex flex-col gap-8" }, vt = { class: "fm-typo-en-title-sm-800" }, ft = { class: "flex flex-col gap-16" }, yt = {
|
|
242
242
|
key: 0,
|
|
243
243
|
class: "flex flex-col gap-8"
|
|
244
|
-
},
|
|
244
|
+
}, bt = /* @__PURE__ */ W({
|
|
245
245
|
__name: "SupplierForm",
|
|
246
246
|
props: {
|
|
247
247
|
modelValue: {},
|
|
@@ -249,7 +249,7 @@ const He = { class: "flex flex-col gap-12" }, Ke = { class: "flex flex-col" }, j
|
|
|
249
249
|
},
|
|
250
250
|
emits: ["update:modelValue", "validation-success"],
|
|
251
251
|
setup(R, { expose: C, emit: h }) {
|
|
252
|
-
const o = R, v = h, f =
|
|
252
|
+
const o = R, v = h, f = _e(), a = Ve(), u = b(() => Te(a.skus, "_id")), { t: y } = q(), $ = he(), E = b(() => $.businessLevel), g = b({
|
|
253
253
|
get() {
|
|
254
254
|
var t;
|
|
255
255
|
return ((t = o.modelValue) == null ? void 0 : t.name) ?? "";
|
|
@@ -258,7 +258,7 @@ const He = { class: "flex flex-col gap-12" }, Ke = { class: "flex flex-col" }, j
|
|
|
258
258
|
const e = o.modelValue ?? {};
|
|
259
259
|
e.name = t, v("update:modelValue", e);
|
|
260
260
|
}
|
|
261
|
-
}), D =
|
|
261
|
+
}), D = b({
|
|
262
262
|
get() {
|
|
263
263
|
var t;
|
|
264
264
|
return ((t = o.modelValue) == null ? void 0 : t.registrationNumber) ?? "";
|
|
@@ -267,7 +267,7 @@ const He = { class: "flex flex-col gap-12" }, Ke = { class: "flex flex-col" }, j
|
|
|
267
267
|
const e = o.modelValue ?? {};
|
|
268
268
|
e.registrationNumber = t, v("update:modelValue", e);
|
|
269
269
|
}
|
|
270
|
-
}), n =
|
|
270
|
+
}), n = b({
|
|
271
271
|
get() {
|
|
272
272
|
var t, e;
|
|
273
273
|
return ((e = (t = o.modelValue) == null ? void 0 : t.address) == null ? void 0 : e.line1) ?? "";
|
|
@@ -276,7 +276,7 @@ const He = { class: "flex flex-col gap-12" }, Ke = { class: "flex flex-col" }, j
|
|
|
276
276
|
const e = o.modelValue ?? {};
|
|
277
277
|
e.address ?? (e.address = {}), e.address.line1 = t, v("update:modelValue", e);
|
|
278
278
|
}
|
|
279
|
-
}), S =
|
|
279
|
+
}), S = b({
|
|
280
280
|
get() {
|
|
281
281
|
var t, e;
|
|
282
282
|
return ((e = (t = o.modelValue) == null ? void 0 : t.address) == null ? void 0 : e.line2) ?? "";
|
|
@@ -285,7 +285,7 @@ const He = { class: "flex flex-col gap-12" }, Ke = { class: "flex flex-col" }, j
|
|
|
285
285
|
const e = o.modelValue ?? {};
|
|
286
286
|
e.address ?? (e.address = {}), e.address.line2 = t, v("update:modelValue", e);
|
|
287
287
|
}
|
|
288
|
-
}), k =
|
|
288
|
+
}), k = b({
|
|
289
289
|
get() {
|
|
290
290
|
var t, e;
|
|
291
291
|
return ((e = (t = o.modelValue) == null ? void 0 : t.address) == null ? void 0 : e.city) ?? "";
|
|
@@ -294,7 +294,7 @@ const He = { class: "flex flex-col gap-12" }, Ke = { class: "flex flex-col" }, j
|
|
|
294
294
|
const e = o.modelValue ?? {};
|
|
295
295
|
e.address ?? (e.address = {}), e.address.city = t, v("update:modelValue", e);
|
|
296
296
|
}
|
|
297
|
-
}), V =
|
|
297
|
+
}), V = b({
|
|
298
298
|
get() {
|
|
299
299
|
var t, e;
|
|
300
300
|
return ((e = (t = o.modelValue) == null ? void 0 : t.address) == null ? void 0 : e.postcode) ?? "";
|
|
@@ -303,7 +303,7 @@ const He = { class: "flex flex-col gap-12" }, Ke = { class: "flex flex-col" }, j
|
|
|
303
303
|
const e = o.modelValue ?? {};
|
|
304
304
|
e.address ?? (e.address = {}), e.address.postcode = t, v("update:modelValue", e);
|
|
305
305
|
}
|
|
306
|
-
}),
|
|
306
|
+
}), i = b({
|
|
307
307
|
get() {
|
|
308
308
|
var t, e;
|
|
309
309
|
return ((e = (t = o.modelValue) == null ? void 0 : t.address) == null ? void 0 : e.state) ?? "";
|
|
@@ -312,7 +312,7 @@ const He = { class: "flex flex-col gap-12" }, Ke = { class: "flex flex-col" }, j
|
|
|
312
312
|
const e = o.modelValue ?? {};
|
|
313
313
|
e.address ?? (e.address = {}), e.address.state = t, v("update:modelValue", e);
|
|
314
314
|
}
|
|
315
|
-
}), s =
|
|
315
|
+
}), s = b({
|
|
316
316
|
get() {
|
|
317
317
|
var t, e;
|
|
318
318
|
return ((e = (t = o.modelValue) == null ? void 0 : t.address) == null ? void 0 : e.country) ?? "";
|
|
@@ -321,7 +321,7 @@ const He = { class: "flex flex-col gap-12" }, Ke = { class: "flex flex-col" }, j
|
|
|
321
321
|
const e = o.modelValue ?? {};
|
|
322
322
|
e.address ?? (e.address = {}), e.address.country = t, v("update:modelValue", e);
|
|
323
323
|
}
|
|
324
|
-
}),
|
|
324
|
+
}), d = b({
|
|
325
325
|
get() {
|
|
326
326
|
var t;
|
|
327
327
|
return ((t = o.modelValue) == null ? void 0 : t.contactName) ?? "";
|
|
@@ -330,7 +330,7 @@ const He = { class: "flex flex-col gap-12" }, Ke = { class: "flex flex-col" }, j
|
|
|
330
330
|
const e = o.modelValue ?? {};
|
|
331
331
|
e.contactName = t, v("update:modelValue", e);
|
|
332
332
|
}
|
|
333
|
-
}),
|
|
333
|
+
}), _ = b({
|
|
334
334
|
get() {
|
|
335
335
|
var t;
|
|
336
336
|
return ((t = o.modelValue) == null ? void 0 : t.phoneNumber) ?? "";
|
|
@@ -339,7 +339,7 @@ const He = { class: "flex flex-col gap-12" }, Ke = { class: "flex flex-col" }, j
|
|
|
339
339
|
const e = o.modelValue ?? {};
|
|
340
340
|
e.phoneNumber = t, v("update:modelValue", e);
|
|
341
341
|
}
|
|
342
|
-
}),
|
|
342
|
+
}), x = b({
|
|
343
343
|
get() {
|
|
344
344
|
var t;
|
|
345
345
|
return ((t = o.modelValue) == null ? void 0 : t.email) ?? "";
|
|
@@ -348,155 +348,155 @@ const He = { class: "flex flex-col gap-12" }, Ke = { class: "flex flex-col" }, j
|
|
|
348
348
|
const e = o.modelValue ?? {};
|
|
349
349
|
e.email = t, v("update:modelValue", e);
|
|
350
350
|
}
|
|
351
|
-
}),
|
|
351
|
+
}), I = b({
|
|
352
352
|
get() {
|
|
353
353
|
var e;
|
|
354
|
-
return (((e = o.modelValue) == null ? void 0 : e.supplyItems) ?? []).filter((M) =>
|
|
354
|
+
return (((e = o.modelValue) == null ? void 0 : e.supplyItems) ?? []).filter((M) => u.value[M.skuId]);
|
|
355
355
|
},
|
|
356
356
|
set(t) {
|
|
357
357
|
const e = o.modelValue ?? {};
|
|
358
358
|
e.supplyItems = t, v("update:modelValue", e);
|
|
359
359
|
}
|
|
360
|
-
}),
|
|
360
|
+
}), c = L();
|
|
361
361
|
return C({
|
|
362
362
|
validateInputs: () => {
|
|
363
363
|
var t, e;
|
|
364
|
-
(e = (t =
|
|
364
|
+
(e = (t = c.value) == null ? void 0 : t.validateInputs) == null || e.call(t);
|
|
365
365
|
},
|
|
366
366
|
resetInputsValidation: () => {
|
|
367
367
|
var t, e;
|
|
368
|
-
(e = (t =
|
|
368
|
+
(e = (t = c.value) == null ? void 0 : t.resetInputsValidation) == null || e.call(t);
|
|
369
369
|
},
|
|
370
370
|
resetInputs: () => {
|
|
371
371
|
var t, e;
|
|
372
|
-
(e = (t =
|
|
372
|
+
(e = (t = c.value) == null ? void 0 : t.resetInputs) == null || e.call(t);
|
|
373
373
|
}
|
|
374
374
|
}), (t, e) => {
|
|
375
|
-
const M = P("FmChip"),
|
|
376
|
-
return U(),
|
|
375
|
+
const M = P("FmChip"), w = P("FmTextField"), Y = P("FmPhoneNumber"), H = P("FmForm");
|
|
376
|
+
return U(), z(H, {
|
|
377
377
|
ref_key: "formRef",
|
|
378
|
-
ref:
|
|
379
|
-
onValidationSuccess: e[12] || (e[12] = (
|
|
378
|
+
ref: c,
|
|
379
|
+
onValidationSuccess: e[12] || (e[12] = (p) => v("validation-success"))
|
|
380
380
|
}, {
|
|
381
381
|
default: N(() => [
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
E.value ? (U(), B("div",
|
|
382
|
+
r("div", rt, [
|
|
383
|
+
r("div", ut, [
|
|
384
|
+
E.value ? (U(), B("div", it, [
|
|
385
385
|
m(M, {
|
|
386
386
|
label: "Business supplier",
|
|
387
387
|
compact: ""
|
|
388
388
|
})
|
|
389
|
-
])) :
|
|
390
|
-
m(
|
|
389
|
+
])) : Z("", !0),
|
|
390
|
+
m(w, {
|
|
391
391
|
disabled: t.disabled,
|
|
392
392
|
rules: [l(F)()],
|
|
393
393
|
"label-mark": "required",
|
|
394
|
-
label: l(
|
|
394
|
+
label: l(y)("inventory.supplier.companyName"),
|
|
395
395
|
modelValue: g.value,
|
|
396
|
-
"onUpdate:modelValue": e[0] || (e[0] = (
|
|
396
|
+
"onUpdate:modelValue": e[0] || (e[0] = (p) => g.value = p)
|
|
397
397
|
}, null, 8, ["disabled", "rules", "label", "modelValue"]),
|
|
398
|
-
m(
|
|
398
|
+
m(w, {
|
|
399
399
|
disabled: t.disabled,
|
|
400
400
|
rules: [l(F)()],
|
|
401
401
|
"label-mark": "required",
|
|
402
|
-
label: l(
|
|
402
|
+
label: l(y)("inventory.supplier.registrationNo"),
|
|
403
403
|
modelValue: D.value,
|
|
404
|
-
"onUpdate:modelValue": e[1] || (e[1] = (
|
|
404
|
+
"onUpdate:modelValue": e[1] || (e[1] = (p) => D.value = p)
|
|
405
405
|
}, null, 8, ["disabled", "rules", "label", "modelValue"])
|
|
406
406
|
]),
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
m(
|
|
407
|
+
r("div", dt, [
|
|
408
|
+
r("div", pt, T(l(y)("inventory.supplier.address.title")), 1),
|
|
409
|
+
r("div", ct, [
|
|
410
|
+
m(w, {
|
|
411
411
|
disabled: t.disabled,
|
|
412
412
|
rules: [l(F)()],
|
|
413
413
|
"label-mark": "required",
|
|
414
|
-
label: l(
|
|
414
|
+
label: l(y)("inventory.supplier.address.line1"),
|
|
415
415
|
modelValue: n.value,
|
|
416
|
-
"onUpdate:modelValue": e[2] || (e[2] = (
|
|
416
|
+
"onUpdate:modelValue": e[2] || (e[2] = (p) => n.value = p)
|
|
417
417
|
}, null, 8, ["disabled", "rules", "label", "modelValue"]),
|
|
418
|
-
m(
|
|
418
|
+
m(w, {
|
|
419
419
|
disabled: t.disabled,
|
|
420
420
|
"label-mark": "optional",
|
|
421
|
-
label: l(
|
|
421
|
+
label: l(y)("inventory.supplier.address.line2"),
|
|
422
422
|
modelValue: S.value,
|
|
423
|
-
"onUpdate:modelValue": e[3] || (e[3] = (
|
|
423
|
+
"onUpdate:modelValue": e[3] || (e[3] = (p) => S.value = p)
|
|
424
424
|
}, null, 8, ["disabled", "label", "modelValue"]),
|
|
425
|
-
m(
|
|
425
|
+
m(w, {
|
|
426
426
|
disabled: t.disabled,
|
|
427
427
|
rules: [l(F)()],
|
|
428
428
|
"label-mark": "required",
|
|
429
|
-
label: l(
|
|
429
|
+
label: l(y)("inventory.supplier.address.city"),
|
|
430
430
|
modelValue: k.value,
|
|
431
|
-
"onUpdate:modelValue": e[4] || (e[4] = (
|
|
431
|
+
"onUpdate:modelValue": e[4] || (e[4] = (p) => k.value = p)
|
|
432
432
|
}, null, 8, ["disabled", "rules", "label", "modelValue"]),
|
|
433
|
-
m(
|
|
433
|
+
m(w, {
|
|
434
434
|
disabled: t.disabled,
|
|
435
435
|
rules: [l(F)()],
|
|
436
436
|
"label-mark": "required",
|
|
437
|
-
label: l(
|
|
437
|
+
label: l(y)("inventory.supplier.address.postcode"),
|
|
438
438
|
modelValue: V.value,
|
|
439
|
-
"onUpdate:modelValue": e[5] || (e[5] = (
|
|
439
|
+
"onUpdate:modelValue": e[5] || (e[5] = (p) => V.value = p)
|
|
440
440
|
}, null, 8, ["disabled", "rules", "label", "modelValue"]),
|
|
441
|
-
m(
|
|
441
|
+
m(w, {
|
|
442
442
|
disabled: t.disabled,
|
|
443
443
|
rules: [l(F)()],
|
|
444
444
|
"label-mark": "required",
|
|
445
|
-
label: l(
|
|
446
|
-
modelValue:
|
|
447
|
-
"onUpdate:modelValue": e[6] || (e[6] = (
|
|
445
|
+
label: l(y)("inventory.supplier.address.state"),
|
|
446
|
+
modelValue: i.value,
|
|
447
|
+
"onUpdate:modelValue": e[6] || (e[6] = (p) => i.value = p)
|
|
448
448
|
}, null, 8, ["disabled", "rules", "label", "modelValue"]),
|
|
449
|
-
m(
|
|
449
|
+
m(w, {
|
|
450
450
|
disabled: t.disabled,
|
|
451
451
|
rules: [l(F)()],
|
|
452
452
|
"label-mark": "required",
|
|
453
|
-
label: l(
|
|
453
|
+
label: l(y)("inventory.supplier.address.country"),
|
|
454
454
|
modelValue: s.value,
|
|
455
|
-
"onUpdate:modelValue": e[7] || (e[7] = (
|
|
455
|
+
"onUpdate:modelValue": e[7] || (e[7] = (p) => s.value = p)
|
|
456
456
|
}, null, 8, ["disabled", "rules", "label", "modelValue"])
|
|
457
457
|
])
|
|
458
458
|
]),
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
m(
|
|
459
|
+
r("div", mt, [
|
|
460
|
+
r("div", vt, T(l(y)("inventory.supplier.contact.title")), 1),
|
|
461
|
+
r("div", ft, [
|
|
462
|
+
m(w, {
|
|
463
463
|
disabled: t.disabled,
|
|
464
464
|
rules: [l(F)()],
|
|
465
465
|
"label-mark": "required",
|
|
466
|
-
label: l(
|
|
467
|
-
modelValue:
|
|
468
|
-
"onUpdate:modelValue": e[8] || (e[8] = (
|
|
466
|
+
label: l(y)("inventory.supplier.contact.pic"),
|
|
467
|
+
modelValue: d.value,
|
|
468
|
+
"onUpdate:modelValue": e[8] || (e[8] = (p) => d.value = p)
|
|
469
469
|
}, null, 8, ["disabled", "rules", "label", "modelValue"]),
|
|
470
470
|
m(Y, {
|
|
471
471
|
disabled: t.disabled,
|
|
472
472
|
rules: [l(F)()],
|
|
473
473
|
"label-mark": "required",
|
|
474
|
-
label: l(
|
|
475
|
-
modelValue:
|
|
476
|
-
"onUpdate:modelValue": e[9] || (e[9] = (
|
|
474
|
+
label: l(y)("inventory.supplier.contact.phoneNumber"),
|
|
475
|
+
modelValue: _.value,
|
|
476
|
+
"onUpdate:modelValue": e[9] || (e[9] = (p) => _.value = p)
|
|
477
477
|
}, null, 8, ["disabled", "rules", "label", "modelValue"]),
|
|
478
|
-
m(
|
|
478
|
+
m(w, {
|
|
479
479
|
disabled: t.disabled,
|
|
480
480
|
"label-mark": "optional",
|
|
481
|
-
label: l(
|
|
482
|
-
modelValue:
|
|
483
|
-
"onUpdate:modelValue": e[10] || (e[10] = (
|
|
481
|
+
label: l(y)("inventory.supplier.contact.email"),
|
|
482
|
+
modelValue: x.value,
|
|
483
|
+
"onUpdate:modelValue": e[10] || (e[10] = (p) => x.value = p)
|
|
484
484
|
}, null, 8, ["disabled", "label", "modelValue"])
|
|
485
485
|
])
|
|
486
486
|
]),
|
|
487
|
-
l(f).enableTotalCost ? (U(), B("div",
|
|
488
|
-
m(
|
|
489
|
-
modelValue:
|
|
490
|
-
"onUpdate:modelValue": e[11] || (e[11] = (
|
|
487
|
+
l(f).enableTotalCost ? (U(), B("div", yt, [
|
|
488
|
+
m(at, {
|
|
489
|
+
modelValue: I.value,
|
|
490
|
+
"onUpdate:modelValue": e[11] || (e[11] = (p) => I.value = p)
|
|
491
491
|
}, null, 8, ["modelValue"])
|
|
492
|
-
])) :
|
|
492
|
+
])) : Z("", !0)
|
|
493
493
|
])
|
|
494
494
|
]),
|
|
495
495
|
_: 1
|
|
496
496
|
}, 512);
|
|
497
497
|
};
|
|
498
498
|
}
|
|
499
|
-
}),
|
|
499
|
+
}), gt = { class: "flex gap-4" }, Vt = /* @__PURE__ */ W({
|
|
500
500
|
__name: "SupplierDialog",
|
|
501
501
|
props: {
|
|
502
502
|
mode: {},
|
|
@@ -505,52 +505,52 @@ const He = { class: "flex flex-col gap-12" }, Ke = { class: "flex flex-col" }, j
|
|
|
505
505
|
},
|
|
506
506
|
emits: ["update:show", "submitted"],
|
|
507
507
|
setup(R, { expose: C, emit: h }) {
|
|
508
|
-
const o = R, v = h, f = L(!1), a =
|
|
508
|
+
const o = R, v = h, f = L(!1), a = we(), { t: u } = q(), y = ge(), $ = b(() => {
|
|
509
509
|
switch (o.mode) {
|
|
510
510
|
case A.READ:
|
|
511
511
|
return "";
|
|
512
512
|
case A.UPDATE:
|
|
513
|
-
return
|
|
513
|
+
return u("inventory.supplier.update.title");
|
|
514
514
|
case A.CREATE:
|
|
515
|
-
return
|
|
515
|
+
return u("inventory.supplier.create.title");
|
|
516
516
|
}
|
|
517
517
|
return "";
|
|
518
|
-
}), E =
|
|
518
|
+
}), E = b(() => {
|
|
519
519
|
switch (o.mode) {
|
|
520
520
|
case A.READ:
|
|
521
521
|
return "";
|
|
522
522
|
case A.UPDATE:
|
|
523
|
-
return
|
|
523
|
+
return u("common.save");
|
|
524
524
|
case A.CREATE:
|
|
525
|
-
return
|
|
525
|
+
return u("common.add");
|
|
526
526
|
}
|
|
527
527
|
return "";
|
|
528
528
|
}), g = L();
|
|
529
529
|
C({
|
|
530
530
|
validateInputs: () => {
|
|
531
|
-
var s,
|
|
532
|
-
(
|
|
531
|
+
var s, d;
|
|
532
|
+
(d = (s = g.value) == null ? void 0 : s.validateInputs) == null || d.call(s);
|
|
533
533
|
},
|
|
534
534
|
resetInputsValidation: () => {
|
|
535
|
-
var s,
|
|
536
|
-
(
|
|
535
|
+
var s, d;
|
|
536
|
+
(d = (s = g.value) == null ? void 0 : s.resetInputsValidation) == null || d.call(s);
|
|
537
537
|
},
|
|
538
538
|
resetInputs: () => {
|
|
539
|
-
var s,
|
|
540
|
-
(
|
|
539
|
+
var s, d;
|
|
540
|
+
(d = (s = g.value) == null ? void 0 : s.resetInputs) == null || d.call(s);
|
|
541
541
|
}
|
|
542
542
|
});
|
|
543
|
-
const D =
|
|
543
|
+
const D = be(o, "show"), n = be(o, "supplier");
|
|
544
544
|
function S() {
|
|
545
|
-
var s,
|
|
546
|
-
(
|
|
545
|
+
var s, d;
|
|
546
|
+
(d = (s = g.value) == null ? void 0 : s.validateInputs) == null || d.call(s);
|
|
547
547
|
}
|
|
548
548
|
function k() {
|
|
549
549
|
switch (o.mode) {
|
|
550
550
|
case A.READ:
|
|
551
551
|
return;
|
|
552
552
|
case A.UPDATE:
|
|
553
|
-
return
|
|
553
|
+
return i();
|
|
554
554
|
case A.CREATE:
|
|
555
555
|
return V();
|
|
556
556
|
}
|
|
@@ -559,11 +559,11 @@ const He = { class: "flex flex-col gap-12" }, Ke = { class: "flex flex-col" }, j
|
|
|
559
559
|
f.value = !0;
|
|
560
560
|
try {
|
|
561
561
|
await Promise.all([
|
|
562
|
-
|
|
562
|
+
y.createSupplier(n.value),
|
|
563
563
|
new Promise((s) => setTimeout(s, 1e3))
|
|
564
564
|
]), a.open({
|
|
565
|
-
title:
|
|
566
|
-
message:
|
|
565
|
+
title: u("common.success"),
|
|
566
|
+
message: u("inventory.supplier.create.success", { name: n.value.name }),
|
|
567
567
|
type: "success"
|
|
568
568
|
}), v("update:show", !1), v("submitted");
|
|
569
569
|
} catch (s) {
|
|
@@ -576,11 +576,11 @@ const He = { class: "flex flex-col gap-12" }, Ke = { class: "flex flex-col" }, j
|
|
|
576
576
|
f.value = !1;
|
|
577
577
|
}
|
|
578
578
|
}
|
|
579
|
-
async function
|
|
579
|
+
async function i() {
|
|
580
580
|
if (n.value === null) {
|
|
581
581
|
a.open({
|
|
582
|
-
title:
|
|
583
|
-
message:
|
|
582
|
+
title: u("inventory.supplier.update.error.title"),
|
|
583
|
+
message: u("inventory.supplier.update.error.emptySupplier"),
|
|
584
584
|
type: "error"
|
|
585
585
|
});
|
|
586
586
|
return;
|
|
@@ -588,51 +588,51 @@ const He = { class: "flex flex-col gap-12" }, Ke = { class: "flex flex-col" }, j
|
|
|
588
588
|
f.value = !0;
|
|
589
589
|
try {
|
|
590
590
|
await Promise.all([
|
|
591
|
-
|
|
591
|
+
y.updateSupplier(n.value),
|
|
592
592
|
new Promise((s) => setTimeout(s, 1e3))
|
|
593
593
|
]), a.open({
|
|
594
|
-
title:
|
|
595
|
-
message:
|
|
594
|
+
title: u("common.success"),
|
|
595
|
+
message: u("inventory.supplier.update.success", { name: n.value.name }),
|
|
596
596
|
type: "success"
|
|
597
597
|
}), v("update:show", !1), v("submitted");
|
|
598
598
|
} catch (s) {
|
|
599
599
|
a.open({
|
|
600
|
-
title:
|
|
601
|
-
message:
|
|
600
|
+
title: u("inventory.supplier.update.error.title"),
|
|
601
|
+
message: u("inventory.supplier.update.error.message"),
|
|
602
602
|
type: "error"
|
|
603
603
|
}), console.error("cannot update supplier", s);
|
|
604
604
|
} finally {
|
|
605
605
|
f.value = !1;
|
|
606
606
|
}
|
|
607
607
|
}
|
|
608
|
-
return (s,
|
|
609
|
-
const
|
|
610
|
-
return U(),
|
|
608
|
+
return (s, d) => {
|
|
609
|
+
const _ = P("FmButton"), x = P("FmSideSheet");
|
|
610
|
+
return U(), z(x, {
|
|
611
611
|
header: $.value,
|
|
612
612
|
modelValue: l(D),
|
|
613
|
-
"onUpdate:modelValue":
|
|
613
|
+
"onUpdate:modelValue": d[1] || (d[1] = (I) => ve(D) ? D.value = I : null),
|
|
614
614
|
"dismiss-away": !f.value,
|
|
615
615
|
"close-button": "",
|
|
616
616
|
"max-width": 500
|
|
617
617
|
}, {
|
|
618
618
|
default: N(() => {
|
|
619
|
-
var
|
|
619
|
+
var I;
|
|
620
620
|
return [
|
|
621
|
-
(U(),
|
|
621
|
+
(U(), z(bt, {
|
|
622
622
|
class: "w-full",
|
|
623
623
|
ref_key: "formRef",
|
|
624
624
|
ref: g,
|
|
625
625
|
modelValue: l(n),
|
|
626
|
-
"onUpdate:modelValue":
|
|
626
|
+
"onUpdate:modelValue": d[0] || (d[0] = (c) => ve(n) ? n.value = c : null),
|
|
627
627
|
onValidationSuccess: k,
|
|
628
|
-
key: ((
|
|
628
|
+
key: ((I = s.supplier) == null ? void 0 : I._id) ?? "",
|
|
629
629
|
disabled: f.value
|
|
630
630
|
}, null, 8, ["modelValue", "disabled"]))
|
|
631
631
|
];
|
|
632
632
|
}),
|
|
633
633
|
"side-sheet-footer": N(() => [
|
|
634
|
-
|
|
635
|
-
m(
|
|
634
|
+
r("div", gt, [
|
|
635
|
+
m(_, {
|
|
636
636
|
loading: f.value,
|
|
637
637
|
label: E.value,
|
|
638
638
|
onClick: S
|
|
@@ -643,16 +643,16 @@ const He = { class: "flex flex-col gap-12" }, Ke = { class: "flex flex-col" }, j
|
|
|
643
643
|
}, 8, ["header", "modelValue", "dismiss-away"]);
|
|
644
644
|
};
|
|
645
645
|
}
|
|
646
|
-
}),
|
|
646
|
+
}), _t = { class: "flex flex-col py-8" }, ht = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, St = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, wt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, xt = {
|
|
647
647
|
key: 0,
|
|
648
648
|
class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
649
|
-
},
|
|
649
|
+
}, kt = "You are managing business-level supplier list. These suppliers will be made visible to all locations.", Pt = /* @__PURE__ */ W({
|
|
650
650
|
__name: "SupplierView",
|
|
651
651
|
setup(R) {
|
|
652
|
-
const C =
|
|
652
|
+
const C = ge(), h = he(), o = _e(), v = L(!1), f = Se(), a = we(), { t: u } = q();
|
|
653
653
|
h.watchLocation($);
|
|
654
|
-
const
|
|
655
|
-
|
|
654
|
+
const y = b(() => h.businessLevel);
|
|
655
|
+
Me(y, $), $e(() => {
|
|
656
656
|
o.enableSupplierMasterList || (h.businessLevel = !1);
|
|
657
657
|
});
|
|
658
658
|
async function $() {
|
|
@@ -661,7 +661,7 @@ const He = { class: "flex flex-col gap-12" }, Ke = { class: "flex flex-col" }, j
|
|
|
661
661
|
try {
|
|
662
662
|
await Promise.all([
|
|
663
663
|
C.readSuppliers(),
|
|
664
|
-
new Promise((
|
|
664
|
+
new Promise((t) => setTimeout(t, 1e3))
|
|
665
665
|
]);
|
|
666
666
|
} catch {
|
|
667
667
|
a.open({
|
|
@@ -673,123 +673,131 @@ const He = { class: "flex flex-col gap-12" }, Ke = { class: "flex flex-col" }, j
|
|
|
673
673
|
}
|
|
674
674
|
}
|
|
675
675
|
}
|
|
676
|
-
const E =
|
|
677
|
-
() =>
|
|
676
|
+
const E = b(
|
|
677
|
+
() => y.value ? C.businessSuppliers : C.locationSuppliers
|
|
678
678
|
), g = L({});
|
|
679
679
|
function D() {
|
|
680
680
|
g.value.mode = A.CREATE, g.value.supplier = {}, g.value.show = !0;
|
|
681
681
|
}
|
|
682
|
-
function n(
|
|
683
|
-
g.value.mode = A.UPDATE, g.value.supplier =
|
|
682
|
+
function n(c) {
|
|
683
|
+
g.value.mode = A.UPDATE, g.value.supplier = ee(c), g.value.show = !0;
|
|
684
684
|
}
|
|
685
|
-
async function S(
|
|
685
|
+
async function S(c) {
|
|
686
686
|
f.open({
|
|
687
|
-
title:
|
|
688
|
-
message:
|
|
687
|
+
title: u("inventory.supplier.delete.confirm"),
|
|
688
|
+
message: u("inventory.supplier.delete.confirmMessage", { name: c.name }),
|
|
689
689
|
primaryActions: {
|
|
690
|
-
text:
|
|
690
|
+
text: u("common.delete"),
|
|
691
691
|
close: !0,
|
|
692
692
|
variant: "destructive"
|
|
693
693
|
},
|
|
694
694
|
secondaryActions: {
|
|
695
|
-
text:
|
|
695
|
+
text: u("common.cancel"),
|
|
696
696
|
close: !0
|
|
697
697
|
}
|
|
698
|
-
}).onPrimary(() => k(
|
|
698
|
+
}).onPrimary(() => k(c));
|
|
699
699
|
}
|
|
700
|
-
async function k(
|
|
700
|
+
async function k(c) {
|
|
701
701
|
f.open({
|
|
702
|
-
title:
|
|
702
|
+
title: u("inventory.supplier.deletingSupplier"),
|
|
703
703
|
closeButton: !1
|
|
704
704
|
});
|
|
705
705
|
try {
|
|
706
|
-
await C.deleteSupplier(
|
|
707
|
-
title:
|
|
708
|
-
message:
|
|
706
|
+
await C.deleteSupplier(c), a.open({
|
|
707
|
+
title: u("inventory.supplier.delete.success"),
|
|
708
|
+
message: u("inventory.supplier.delete.successMessage", { name: c == null ? void 0 : c.name }),
|
|
709
709
|
type: "success"
|
|
710
710
|
}), $();
|
|
711
|
-
} catch (
|
|
711
|
+
} catch (t) {
|
|
712
712
|
a.open({
|
|
713
|
-
title:
|
|
714
|
-
message:
|
|
713
|
+
title: u("inventory.supplier.delete.error"),
|
|
714
|
+
message: u("inventory.supplier.delete.errorMessage", { name: c == null ? void 0 : c.name }),
|
|
715
715
|
type: "error"
|
|
716
|
-
}), console.error("failed to delete supplier",
|
|
716
|
+
}), console.error("failed to delete supplier", t);
|
|
717
717
|
} finally {
|
|
718
718
|
f.close();
|
|
719
719
|
}
|
|
720
720
|
}
|
|
721
|
-
const { columnDefs: V } =
|
|
722
|
-
function
|
|
723
|
-
|
|
721
|
+
const { columnDefs: V } = Ke(n, S);
|
|
722
|
+
function i(c) {
|
|
723
|
+
c === "create" && D();
|
|
724
724
|
}
|
|
725
|
-
const s = L(""), { breakpoints:
|
|
726
|
-
return (
|
|
727
|
-
const
|
|
728
|
-
return U(),
|
|
729
|
-
title: l(
|
|
725
|
+
const s = L(""), { breakpoints: d } = Le(), _ = b(() => d.value.xs || d.value.sm), x = b(() => _.value ? 10 : 20), I = ze();
|
|
726
|
+
return (c, t) => {
|
|
727
|
+
const e = P("FmTable");
|
|
728
|
+
return U(), z(qe, {
|
|
729
|
+
title: l(u)("inventory.supplier.title"),
|
|
730
730
|
actions: [
|
|
731
731
|
{
|
|
732
|
-
label: l(
|
|
732
|
+
label: l(u)("inventory.supplier.create.title"),
|
|
733
733
|
value: "create",
|
|
734
734
|
isPrimary: !0,
|
|
735
735
|
prependIcon: "add"
|
|
736
736
|
}
|
|
737
737
|
],
|
|
738
|
-
"onClick:action":
|
|
739
|
-
"using-business-helper-text":
|
|
738
|
+
"onClick:action": i,
|
|
739
|
+
"using-business-helper-text": kt
|
|
740
740
|
}, {
|
|
741
741
|
default: N(() => [
|
|
742
|
-
|
|
743
|
-
|
|
742
|
+
r("div", {
|
|
743
|
+
class: Ae([
|
|
744
|
+
"flex flex-col gap-8 max-h-full",
|
|
745
|
+
{
|
|
746
|
+
"p-0": _.value,
|
|
747
|
+
"px-24 ": !_.value
|
|
748
|
+
}
|
|
749
|
+
])
|
|
750
|
+
}, [
|
|
751
|
+
m(Ye, {
|
|
744
752
|
searchable: "",
|
|
745
753
|
"change-location": "",
|
|
746
754
|
search: s.value,
|
|
747
|
-
"onUpdate:search":
|
|
755
|
+
"onUpdate:search": t[0] || (t[0] = (M) => s.value = M),
|
|
748
756
|
"show-business": l(o).enableSupplierMasterList,
|
|
749
757
|
actions: [{ icon: "refresh", onClick: () => $() }]
|
|
750
758
|
}, null, 8, ["search", "show-business", "actions"]),
|
|
751
|
-
m(
|
|
752
|
-
style:
|
|
759
|
+
m(e, {
|
|
760
|
+
style: Ue(l(I).tableHeight),
|
|
753
761
|
"column-defs": l(V),
|
|
754
762
|
"row-data": E.value,
|
|
755
763
|
"search-value": s.value,
|
|
756
764
|
loading: !l(h)._currentLocation || v.value,
|
|
757
|
-
onRowClick:
|
|
765
|
+
onRowClick: t[1] || (t[1] = (M) => n(M.original)),
|
|
758
766
|
"page-size": x.value
|
|
759
767
|
}, {
|
|
760
|
-
"list-row": N((
|
|
761
|
-
m(
|
|
762
|
-
row:
|
|
768
|
+
"list-row": N((M) => [
|
|
769
|
+
m(Re, {
|
|
770
|
+
row: M,
|
|
763
771
|
onRowClick: n
|
|
764
772
|
}, {
|
|
765
|
-
default: N((
|
|
766
|
-
var
|
|
773
|
+
default: N((w) => {
|
|
774
|
+
var Y, H, p, K, te, le, se, oe, j, ne, ae, re, ue, G, ie, de, pe, ce, O, me;
|
|
767
775
|
return [
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
m(l(
|
|
771
|
-
render: (
|
|
772
|
-
props: (
|
|
776
|
+
r("div", _t, [
|
|
777
|
+
r("div", ht, [
|
|
778
|
+
m(l(Q), {
|
|
779
|
+
render: (p = (H = (Y = w.name) == null ? void 0 : Y.column) == null ? void 0 : H.columnDef) == null ? void 0 : p.cell,
|
|
780
|
+
props: (te = (K = w.name) == null ? void 0 : K.getContext) == null ? void 0 : te.call(K)
|
|
773
781
|
}, null, 8, ["render", "props"])
|
|
774
782
|
]),
|
|
775
|
-
|
|
776
|
-
m(l(
|
|
777
|
-
render: (
|
|
778
|
-
props: (
|
|
783
|
+
r("div", St, [
|
|
784
|
+
m(l(Q), {
|
|
785
|
+
render: (oe = (se = (le = w.contactName) == null ? void 0 : le.column) == null ? void 0 : se.columnDef) == null ? void 0 : oe.cell,
|
|
786
|
+
props: (ne = (j = w.contactName) == null ? void 0 : j.getContext) == null ? void 0 : ne.call(j)
|
|
779
787
|
}, null, 8, ["render", "props"])
|
|
780
788
|
]),
|
|
781
|
-
|
|
782
|
-
m(l(
|
|
783
|
-
render: (
|
|
784
|
-
props: (
|
|
789
|
+
r("div", wt, [
|
|
790
|
+
m(l(Q), {
|
|
791
|
+
render: (ue = (re = (ae = w.phoneNumber) == null ? void 0 : ae.column) == null ? void 0 : re.columnDef) == null ? void 0 : ue.cell,
|
|
792
|
+
props: (ie = (G = w.phoneNumber) == null ? void 0 : G.getContext) == null ? void 0 : ie.call(G)
|
|
785
793
|
}, null, 8, ["render", "props"])
|
|
786
794
|
]),
|
|
787
|
-
|
|
788
|
-
m(l(
|
|
789
|
-
render: (
|
|
790
|
-
props: (
|
|
795
|
+
M.original.email ? (U(), B("div", xt, [
|
|
796
|
+
m(l(Q), {
|
|
797
|
+
render: (ce = (pe = (de = w.email) == null ? void 0 : de.column) == null ? void 0 : pe.columnDef) == null ? void 0 : ce.cell,
|
|
798
|
+
props: (me = (O = w.email) == null ? void 0 : O.getContext) == null ? void 0 : me.call(O)
|
|
791
799
|
}, null, 8, ["render", "props"])
|
|
792
|
-
])) :
|
|
800
|
+
])) : Z("", !0)
|
|
793
801
|
])
|
|
794
802
|
];
|
|
795
803
|
}),
|
|
@@ -798,14 +806,14 @@ const He = { class: "flex flex-col gap-12" }, Ke = { class: "flex flex-col" }, j
|
|
|
798
806
|
]),
|
|
799
807
|
_: 1
|
|
800
808
|
}, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"])
|
|
801
|
-
]),
|
|
802
|
-
(U(),
|
|
803
|
-
m(
|
|
809
|
+
], 2),
|
|
810
|
+
(U(), z(De, { to: "body" }, [
|
|
811
|
+
m(Vt, {
|
|
804
812
|
show: g.value.show,
|
|
805
|
-
"onUpdate:show":
|
|
813
|
+
"onUpdate:show": t[2] || (t[2] = (M) => g.value.show = M),
|
|
806
814
|
supplier: g.value.supplier,
|
|
807
815
|
mode: g.value.mode,
|
|
808
|
-
onSubmitted:
|
|
816
|
+
onSubmitted: t[3] || (t[3] = (M) => $())
|
|
809
817
|
}, null, 8, ["show", "supplier", "mode"])
|
|
810
818
|
]))
|
|
811
819
|
]),
|
|
@@ -815,5 +823,5 @@ const He = { class: "flex flex-col gap-12" }, Ke = { class: "flex flex-col" }, j
|
|
|
815
823
|
}
|
|
816
824
|
});
|
|
817
825
|
export {
|
|
818
|
-
|
|
826
|
+
Pt as default
|
|
819
827
|
};
|