@feedmepos/mf-payment 1.1.7 → 1.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{PayoutAccount-C362ShA8.js → PayoutAccount-BAXvKwol.js} +5 -5
- package/dist/{PayoutAccount-CAdClj2Y.js → PayoutAccount-C9TC-nLW.js} +3 -3
- package/dist/{PayoutAccountSetting-Cbl5b1Jr.js → PayoutAccountSetting-CsY4Dr_E.js} +3 -3
- package/dist/{Restaurant-ClDu-bSv.js → Restaurant-C9GmwxpU.js} +4 -4
- package/dist/{RestaurantSetting-D5h5RoHf.js → RestaurantSetting-DaSalR0b.js} +3 -3
- package/dist/Settlement-BvUs3MyQ.js +454 -0
- package/dist/Settlement-C7oFzVbb.js +219 -0
- package/dist/{SettlementTransactions-Cpaq8K6x.js → SettlementTransactions-BRo_oigl.js} +75 -69
- package/dist/{SettlementTransactions-DIvLOEw6.js → SettlementTransactions-qSgW0VCV.js} +80 -78
- package/dist/{Terminal-Cmed6xrj.js → Terminal-DXGKrm3G.js} +5 -5
- package/dist/TerminalSetting-bLxGkMlN.js +497 -0
- package/dist/{Transaction-BQn5rvxe.js → Transaction-B7ICajHR.js} +6 -6
- package/dist/{Transaction-8m9pEyyX.js → Transaction-BI2ZRsxe.js} +52 -47
- package/dist/{TransactionOld-CX-Odthg.js → TransactionOld-GLsvtHyF.js} +5 -5
- package/dist/{TransactionTable.vue_vue_type_script_setup_true_lang-BX7YIl4i.js → TransactionTable.vue_vue_type_script_setup_true_lang-UjV7RID1.js} +12 -8
- package/dist/api/settlement/index.d.ts +1 -1
- package/dist/api/terminal/index.d.ts +4 -0
- package/dist/api/transaction/index.d.ts +1 -1
- package/dist/{app-QYQdqlqy.js → app-DVnyclnX.js} +327 -321
- package/dist/app.d.ts +6 -0
- package/dist/app.js +1 -1
- package/dist/{assets-Da-9jPqG.js → assets-BZmrImt4.js} +49 -52
- package/dist/{grafana-BDr-LF8O.js → grafana-DRnPxAqM.js} +1 -1
- package/dist/{index-0Dl-qVTd.js → index-BMF26WT4.js} +29 -29
- package/dist/{index-DFq7xhNQ.js → index-C1Hgyi3j.js} +1 -1
- package/dist/{index-Dg0Vf3qd.js → index-CD59SyVI.js} +1 -1
- package/dist/{index-DTH2dIPG.js → index-DZMn5Qjp.js} +796 -796
- package/dist/{index-Dq07OgOJ.js → index-a-Vqap7Z.js} +9 -1
- package/dist/{index-DbBsTEVS.js → index-gSE1T266.js} +1 -1
- package/dist/{index.vue_vue_type_script_setup_true_lang-JHB8s5dZ.js → index.vue_vue_type_script_setup_true_lang-FgXpWvbs.js} +1 -1
- package/dist/model/transaction.d.ts +3 -0
- package/dist/package.json +1 -1
- package/dist/{payout-account--IA1DbB5.js → payout-account-B76ODsn2.js} +2 -2
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/views/admin/terminal/tabs/SettingRequest.vue.d.ts +87 -0
- package/dist/views/admin/terminal/tabs/settings/KioskMode.vue.d.ts +87 -0
- package/package.json +1 -1
- package/dist/Settlement-B06tIr4_.js +0 -445
- package/dist/Settlement-C2BVxmir.js +0 -219
- package/dist/TerminalSetting-BrTRbBF7.js +0 -389
@@ -0,0 +1,497 @@
|
|
1
|
+
import { defineComponent as T, openBlock as w, createElementBlock as C, Fragment as N, createElementVNode as F, createTextVNode as U, toDisplayString as O, toRef as R, ref as I, watch as B, onMounted as M, computed as K, resolveComponent as v, unref as _, createVNode as b, createBlock as k, withCtx as G, createCommentVNode as V, isRef as P, resolveDynamicComponent as Y, normalizeProps as $, mergeProps as j } from "vue";
|
2
|
+
import { u as D, e as x } from "./index-DZMn5Qjp.js";
|
3
|
+
import { useRouter as H } from "vue-router";
|
4
|
+
import { t as q } from "./index-a-Vqap7Z.js";
|
5
|
+
import { _ as Q } from "./Layout.vue_vue_type_script_setup_true_lang-DJm5br5a.js";
|
6
|
+
import { u as h } from "./index-C1Hgyi3j.js";
|
7
|
+
import { useSnackbar as L } from "@feedmepos/ui-library";
|
8
|
+
import { u as W } from "./error-K1CakhA9.js";
|
9
|
+
import { z as J, a as X } from "./validator-D5jtpt9A.js";
|
10
|
+
import { useCoreStore as A } from "@feedmepos/mf-common";
|
11
|
+
const Z = /* @__PURE__ */ T({
|
12
|
+
__name: "Information",
|
13
|
+
props: {
|
14
|
+
terminal: {
|
15
|
+
type: Object,
|
16
|
+
required: !0
|
17
|
+
}
|
18
|
+
},
|
19
|
+
setup(f) {
|
20
|
+
return (i, e) => (w(), C(N, null, [
|
21
|
+
e[0] || (e[0] = F("b", null, "Name", -1)),
|
22
|
+
U(": " + O(f.terminal.name), 1),
|
23
|
+
e[1] || (e[1] = F("br", null, null, -1)),
|
24
|
+
e[2] || (e[2] = F("b", null, "Status", -1)),
|
25
|
+
U(": " + O(f.terminal.status), 1),
|
26
|
+
e[3] || (e[3] = F("br", null, null, -1)),
|
27
|
+
e[4] || (e[4] = F("b", null, "Device ID", -1)),
|
28
|
+
U(": " + O(f.terminal.deviceId ?? "-"), 1),
|
29
|
+
e[5] || (e[5] = F("br", null, null, -1)),
|
30
|
+
e[6] || (e[6] = F("b", null, "Device Type", -1)),
|
31
|
+
U(": " + O(f.terminal.deviceType ?? "-"), 1),
|
32
|
+
e[7] || (e[7] = F("br", null, null, -1))
|
33
|
+
], 64));
|
34
|
+
}
|
35
|
+
}), ee = {
|
36
|
+
key: 0,
|
37
|
+
class: "flex items-center justify-center min-h-[80vh]"
|
38
|
+
}, te = { class: "flex mt-6 space-x-6" }, ae = /* @__PURE__ */ T({
|
39
|
+
__name: "TerminalGateway",
|
40
|
+
props: {
|
41
|
+
terminal: {
|
42
|
+
type: Object,
|
43
|
+
required: !0
|
44
|
+
},
|
45
|
+
onUpdate: {
|
46
|
+
type: Function,
|
47
|
+
required: !0
|
48
|
+
}
|
49
|
+
},
|
50
|
+
setup(f) {
|
51
|
+
const { isLoading: i, startAsyncCall: e } = D(), c = f, t = R(() => c.terminal), r = I(), d = I(), a = I(-1), n = I({
|
52
|
+
terminalId: ""
|
53
|
+
}), s = () => {
|
54
|
+
n.value.terminalId = "", a.value = -1;
|
55
|
+
}, o = () => {
|
56
|
+
if (e(async () => {
|
57
|
+
r.value = await q.getRestaurantTerminals(c.terminal.referenceId);
|
58
|
+
}), !c.terminal.ecrs)
|
59
|
+
return s();
|
60
|
+
const l = c.terminal.ecrs.findIndex((y) => y && y.gateway && y.gateway === "FeedMe");
|
61
|
+
if (l === -1)
|
62
|
+
return s();
|
63
|
+
a.value = l;
|
64
|
+
const m = c.terminal.ecrs.at(l);
|
65
|
+
m.gateway === "FeedMe" && m.config && (n.value = {
|
66
|
+
terminalId: m.config.terminalId
|
67
|
+
});
|
68
|
+
};
|
69
|
+
B(t, o), M(o);
|
70
|
+
const p = K(() => (r.value ?? []).map((l) => ({
|
71
|
+
label: l.name ?? l._id,
|
72
|
+
value: l._id
|
73
|
+
})));
|
74
|
+
async function u(l) {
|
75
|
+
var m;
|
76
|
+
(m = c.terminal.ecrs) == null || m.splice(l, 1), c.onUpdate(c.terminal);
|
77
|
+
}
|
78
|
+
return (l, m) => {
|
79
|
+
const y = v("FmCircularProgress"), S = v("FmSelect"), g = v("FmButton"), E = v("FmForm");
|
80
|
+
return _(i) ? (w(), C("div", ee, [
|
81
|
+
b(y, { size: "xxl" })
|
82
|
+
])) : (w(), k(E, {
|
83
|
+
key: 1,
|
84
|
+
ref: d.value,
|
85
|
+
class: "flex flex-col gap-16 w-[500px]",
|
86
|
+
onValidationSuccess: m[1] || (m[1] = () => {
|
87
|
+
a.value > -1 ? t.value.ecrs[a.value] = { gateway: "FeedMe", config: n.value } : (t.value.ecrs || (t.value.ecrs = []), t.value.ecrs.push({ gateway: "FeedMe", config: n.value })), c.onUpdate(t.value);
|
88
|
+
})
|
89
|
+
}, {
|
90
|
+
default: G(() => [
|
91
|
+
b(S, {
|
92
|
+
modelValue: n.value.terminalId,
|
93
|
+
"onUpdate:modelValue": m[0] || (m[0] = (z) => n.value.terminalId = z),
|
94
|
+
label: "Terminal ID",
|
95
|
+
items: p.value,
|
96
|
+
rules: _(J)(_(X).string())
|
97
|
+
}, null, 8, ["modelValue", "items", "rules"]),
|
98
|
+
F("div", te, [
|
99
|
+
a.value > -1 ? (w(), k(g, {
|
100
|
+
key: 0,
|
101
|
+
class: "flex-1",
|
102
|
+
variant: "secondary",
|
103
|
+
label: "Delete",
|
104
|
+
onclick: () => u(a.value)
|
105
|
+
}, null, 8, ["onclick"])) : V("", !0),
|
106
|
+
b(g, {
|
107
|
+
type: "submit",
|
108
|
+
class: "flex-1",
|
109
|
+
variant: "primary",
|
110
|
+
label: "Save"
|
111
|
+
})
|
112
|
+
])
|
113
|
+
]),
|
114
|
+
_: 1
|
115
|
+
}, 512));
|
116
|
+
};
|
117
|
+
}
|
118
|
+
}), ne = { class: "flex mt-6 space-x-6" }, le = /* @__PURE__ */ T({
|
119
|
+
__name: "FiuuGateway",
|
120
|
+
props: {
|
121
|
+
terminal: {
|
122
|
+
type: Object,
|
123
|
+
required: !0
|
124
|
+
},
|
125
|
+
onUpdate: {
|
126
|
+
type: Function,
|
127
|
+
required: !0
|
128
|
+
}
|
129
|
+
},
|
130
|
+
setup(f) {
|
131
|
+
const i = f, e = A().currentCountry, c = [
|
132
|
+
{
|
133
|
+
label: "Fiuu Malaysia",
|
134
|
+
value: "cc.feedme.payment.rms",
|
135
|
+
region: x.F_COUNTRY.enum.MY
|
136
|
+
},
|
137
|
+
{
|
138
|
+
label: "Fiuu Malaysia V2",
|
139
|
+
value: "cc.feedme.payment.fiuu_my",
|
140
|
+
region: x.F_COUNTRY.enum.MY
|
141
|
+
},
|
142
|
+
{
|
143
|
+
label: "Fiuu Singapore",
|
144
|
+
value: "cc.feedme.payment.fiuu_sg",
|
145
|
+
region: x.F_COUNTRY.enum.SG
|
146
|
+
}
|
147
|
+
], t = R(() => i.terminal), r = I(), d = I(-1), a = I({
|
148
|
+
packageId: "",
|
149
|
+
uniqueId: ""
|
150
|
+
}), n = () => {
|
151
|
+
a.value.uniqueId = "", a.value.packageId = "", d.value = -1;
|
152
|
+
}, s = () => {
|
153
|
+
if (!t.value.gateways)
|
154
|
+
return n();
|
155
|
+
const p = t.value.gateways.findIndex((l) => l && l.gateway && l.gateway === "Fiuu");
|
156
|
+
if (p === -1)
|
157
|
+
return n();
|
158
|
+
d.value = p;
|
159
|
+
const u = t.value.gateways.at(p);
|
160
|
+
u.gateway === "Fiuu" && u.config && (a.value = {
|
161
|
+
packageId: u.config.packageId,
|
162
|
+
uniqueId: u.config.uniqueId
|
163
|
+
});
|
164
|
+
};
|
165
|
+
B(t, s), M(s);
|
166
|
+
async function o(p) {
|
167
|
+
var u;
|
168
|
+
(u = t.value.gateways) == null || u.splice(p, 1), i.onUpdate(t.value);
|
169
|
+
}
|
170
|
+
return (p, u) => {
|
171
|
+
const l = v("FmSelect"), m = v("FmTextField"), y = v("FmButton"), S = v("FmForm");
|
172
|
+
return w(), k(S, {
|
173
|
+
ref: r.value,
|
174
|
+
class: "flex flex-col gap-16 w-[500px]",
|
175
|
+
onValidationSuccess: u[2] || (u[2] = () => {
|
176
|
+
d.value > -1 ? t.value.gateways[d.value] = { gateway: "Fiuu", config: a.value } : (t.value.gateways || (t.value.gateways = []), t.value.gateways.push({ gateway: "Fiuu", config: a.value })), i.onUpdate(t.value);
|
177
|
+
})
|
178
|
+
}, {
|
179
|
+
default: G(() => [
|
180
|
+
b(l, {
|
181
|
+
modelValue: a.value.packageId,
|
182
|
+
"onUpdate:modelValue": u[0] || (u[0] = (g) => a.value.packageId = g),
|
183
|
+
label: "Package ID",
|
184
|
+
items: c.filter((g) => g.region === _(e))
|
185
|
+
}, null, 8, ["modelValue", "items"]),
|
186
|
+
b(m, {
|
187
|
+
modelValue: a.value.uniqueId,
|
188
|
+
"onUpdate:modelValue": u[1] || (u[1] = (g) => a.value.uniqueId = g),
|
189
|
+
label: "Unique ID"
|
190
|
+
}, null, 8, ["modelValue"]),
|
191
|
+
F("div", ne, [
|
192
|
+
d.value > -1 ? (w(), k(y, {
|
193
|
+
key: 0,
|
194
|
+
class: "flex-1",
|
195
|
+
variant: "secondary",
|
196
|
+
label: "Delete",
|
197
|
+
onclick: () => o(d.value)
|
198
|
+
}, null, 8, ["onclick"])) : V("", !0),
|
199
|
+
b(y, {
|
200
|
+
type: "submit",
|
201
|
+
class: "flex-1",
|
202
|
+
variant: "primary",
|
203
|
+
label: "Save"
|
204
|
+
})
|
205
|
+
])
|
206
|
+
]),
|
207
|
+
_: 1
|
208
|
+
}, 512);
|
209
|
+
};
|
210
|
+
}
|
211
|
+
}), oe = { class: "flex mt-6 space-x-6" }, re = /* @__PURE__ */ T({
|
212
|
+
__name: "GhlGateway",
|
213
|
+
props: {
|
214
|
+
terminal: {
|
215
|
+
type: Object,
|
216
|
+
required: !0
|
217
|
+
},
|
218
|
+
onUpdate: {
|
219
|
+
type: Function,
|
220
|
+
required: !0
|
221
|
+
}
|
222
|
+
},
|
223
|
+
setup(f) {
|
224
|
+
const i = f, e = R(() => i.terminal), c = I(), t = I(-1), r = I({
|
225
|
+
merchantId: "",
|
226
|
+
terminalId: "",
|
227
|
+
privateKey: ""
|
228
|
+
}), d = () => {
|
229
|
+
r.value.merchantId = "", r.value.terminalId = "", r.value.privateKey = "", t.value = -1;
|
230
|
+
}, a = () => {
|
231
|
+
if (!e.value.ecrs)
|
232
|
+
return d();
|
233
|
+
const s = e.value.ecrs.findIndex((p) => p && p.gateway && p.gateway === "Ghl");
|
234
|
+
if (s === -1)
|
235
|
+
return d();
|
236
|
+
t.value = s;
|
237
|
+
const o = e.value.ecrs.at(s);
|
238
|
+
o.gateway === "Ghl" && o.config && (r.value = {
|
239
|
+
merchantId: o.config.merchantId,
|
240
|
+
terminalId: o.config.terminalId,
|
241
|
+
privateKey: o.config.privateKey
|
242
|
+
});
|
243
|
+
};
|
244
|
+
B(e, a), M(a);
|
245
|
+
async function n(s) {
|
246
|
+
var o;
|
247
|
+
(o = e.value.ecrs) == null || o.splice(s, 1), i.onUpdate(e.value);
|
248
|
+
}
|
249
|
+
return (s, o) => {
|
250
|
+
const p = v("FmTextField"), u = v("FmTextarea"), l = v("FmButton"), m = v("FmForm");
|
251
|
+
return w(), k(m, {
|
252
|
+
ref: c.value,
|
253
|
+
class: "flex flex-col gap-16 w-[500px]",
|
254
|
+
onValidationSuccess: o[3] || (o[3] = () => {
|
255
|
+
t.value > -1 ? e.value.ecrs[t.value] = { gateway: "Ghl", config: r.value } : (e.value.ecrs || (e.value.ecrs = []), e.value.ecrs.push({ gateway: "Ghl", config: r.value })), i.onUpdate(e.value);
|
256
|
+
})
|
257
|
+
}, {
|
258
|
+
default: G(() => [
|
259
|
+
b(p, {
|
260
|
+
modelValue: r.value.merchantId,
|
261
|
+
"onUpdate:modelValue": o[0] || (o[0] = (y) => r.value.merchantId = y),
|
262
|
+
label: "Merchant ID"
|
263
|
+
}, null, 8, ["modelValue"]),
|
264
|
+
b(p, {
|
265
|
+
modelValue: r.value.terminalId,
|
266
|
+
"onUpdate:modelValue": o[1] || (o[1] = (y) => r.value.terminalId = y),
|
267
|
+
label: "Terminal ID"
|
268
|
+
}, null, 8, ["modelValue"]),
|
269
|
+
b(u, {
|
270
|
+
modelValue: r.value.privateKey,
|
271
|
+
"onUpdate:modelValue": o[2] || (o[2] = (y) => r.value.privateKey = y),
|
272
|
+
label: "Private Key"
|
273
|
+
}, null, 8, ["modelValue"]),
|
274
|
+
F("div", oe, [
|
275
|
+
t.value > -1 ? (w(), k(l, {
|
276
|
+
key: 0,
|
277
|
+
class: "flex-1",
|
278
|
+
variant: "secondary",
|
279
|
+
label: "Delete",
|
280
|
+
onclick: () => n(t.value)
|
281
|
+
}, null, 8, ["onclick"])) : V("", !0),
|
282
|
+
b(l, {
|
283
|
+
type: "submit",
|
284
|
+
class: "flex-1",
|
285
|
+
variant: "primary",
|
286
|
+
label: "Save"
|
287
|
+
})
|
288
|
+
])
|
289
|
+
]),
|
290
|
+
_: 1
|
291
|
+
}, 512);
|
292
|
+
};
|
293
|
+
}
|
294
|
+
}), ue = { key: 0 }, se = { class: "mt-6 space-x-6" }, ie = /* @__PURE__ */ T({
|
295
|
+
__name: "KioskMode",
|
296
|
+
props: {
|
297
|
+
terminal: {
|
298
|
+
type: Object,
|
299
|
+
required: !0
|
300
|
+
}
|
301
|
+
},
|
302
|
+
setup(f) {
|
303
|
+
const { isLoading: i, startAsyncCall: e } = D(!1), c = L(), t = I({
|
304
|
+
enable: !1,
|
305
|
+
password: []
|
306
|
+
}), r = f;
|
307
|
+
function d() {
|
308
|
+
return t.value.enable && t.value.password.filter((a) => !!a).length !== 6 ? c.open({
|
309
|
+
type: "error",
|
310
|
+
message: "Unlock PIN is required when setting up kiosk mode for terminal."
|
311
|
+
}) : e(async () => {
|
312
|
+
const a = { enable: t.value.enable };
|
313
|
+
a.enable && Object.assign(a, {
|
314
|
+
password: t.value.password.join("")
|
315
|
+
});
|
316
|
+
const n = await q.kioskModeRequest(r.terminal._id, a);
|
317
|
+
if (n === "OK")
|
318
|
+
return c.open({ type: "info", message: "Kiosk mode applied successfully." });
|
319
|
+
let s = n;
|
320
|
+
return n === "client_not_connected" && (s = "Terminal not connected to the websocket server."), n.startsWith("terminal: ") && (s = n.replaceAll("terminal: ", "")), c.open({
|
321
|
+
type: "error",
|
322
|
+
message: s
|
323
|
+
});
|
324
|
+
});
|
325
|
+
}
|
326
|
+
return (a, n) => {
|
327
|
+
const s = v("FmSwitch"), o = v("FmPinField"), p = v("FmButton");
|
328
|
+
return w(), C(N, null, [
|
329
|
+
b(s, {
|
330
|
+
modelValue: t.value.enable,
|
331
|
+
"onUpdate:modelValue": n[0] || (n[0] = (u) => t.value.enable = u),
|
332
|
+
label: "Enable Kiosk Mode?"
|
333
|
+
}, null, 8, ["modelValue"]),
|
334
|
+
t.value.enable ? (w(), C("div", ue, [
|
335
|
+
n[2] || (n[2] = F("p", { class: "mt-6" }, "Unlock PIN: ", -1)),
|
336
|
+
b(o, {
|
337
|
+
modelValue: t.value.password,
|
338
|
+
"onUpdate:modelValue": n[1] || (n[1] = (u) => t.value.password = u)
|
339
|
+
}, null, 8, ["modelValue"])
|
340
|
+
])) : V("", !0),
|
341
|
+
F("div", se, [
|
342
|
+
b(p, {
|
343
|
+
variant: "primary",
|
344
|
+
label: "Send",
|
345
|
+
icon: "send",
|
346
|
+
loading: _(i),
|
347
|
+
onclick: d
|
348
|
+
}, null, 8, ["loading"])
|
349
|
+
])
|
350
|
+
], 64);
|
351
|
+
};
|
352
|
+
}
|
353
|
+
}), me = /* @__PURE__ */ T({
|
354
|
+
__name: "SettingRequest",
|
355
|
+
props: {
|
356
|
+
terminal: {
|
357
|
+
type: Object,
|
358
|
+
required: !0
|
359
|
+
}
|
360
|
+
},
|
361
|
+
setup(f) {
|
362
|
+
const { settingTab: i } = h({
|
363
|
+
settingTab: "kiosk_mode"
|
364
|
+
}), e = [
|
365
|
+
{
|
366
|
+
label: "Kiosk Mode",
|
367
|
+
value: "kiosk_mode",
|
368
|
+
render: ie
|
369
|
+
}
|
370
|
+
], c = f, t = K(() => e.find((r) => r.value === i.value));
|
371
|
+
return (r, d) => {
|
372
|
+
var n;
|
373
|
+
const a = v("FmTabs");
|
374
|
+
return w(), C(N, null, [
|
375
|
+
d[1] || (d[1] = F("p", { className: "mt-1 my-6 text-gray-600" }, [
|
376
|
+
F("b", null, "Note: "),
|
377
|
+
U(" Setting request will perform remotely without caching so make sure terminal is connected to the network also to our websocket as well. ")
|
378
|
+
], -1)),
|
379
|
+
b(a, {
|
380
|
+
"model-value": _(i),
|
381
|
+
"onUpdate:modelValue": d[0] || (d[0] = (s) => P(i) ? i.value = s : null),
|
382
|
+
class: "mb-6",
|
383
|
+
items: e
|
384
|
+
}, null, 8, ["model-value"]),
|
385
|
+
_(i) ? (w(), k(Y((n = t.value) == null ? void 0 : n.render), $(j({ key: 0 }, { terminal: c.terminal })), null, 16)) : V("", !0)
|
386
|
+
], 64);
|
387
|
+
};
|
388
|
+
}
|
389
|
+
}), _e = /* @__PURE__ */ T({
|
390
|
+
__name: "TerminalSetting",
|
391
|
+
props: {
|
392
|
+
terminalId: {
|
393
|
+
type: String,
|
394
|
+
required: !0
|
395
|
+
}
|
396
|
+
},
|
397
|
+
setup(f) {
|
398
|
+
const i = f, { tab: e } = h({
|
399
|
+
tab: "information"
|
400
|
+
}), { isLoading: c, startAsyncCall: t } = D(!0), r = H(), d = L(), a = I();
|
401
|
+
async function n(l) {
|
402
|
+
t(async () => {
|
403
|
+
try {
|
404
|
+
await q.updateById(
|
405
|
+
i.terminalId,
|
406
|
+
{
|
407
|
+
name: l.name,
|
408
|
+
status: l.status,
|
409
|
+
ecrs: l.ecrs ?? [],
|
410
|
+
gateways: l.gateways ?? []
|
411
|
+
}
|
412
|
+
), a.value = await q.readById(i.terminalId), d.open({
|
413
|
+
type: "success",
|
414
|
+
message: "Terminal updated successfully"
|
415
|
+
});
|
416
|
+
} catch (m) {
|
417
|
+
d.open({
|
418
|
+
type: "error",
|
419
|
+
title: "Error occurs when update terminal",
|
420
|
+
message: W(m)
|
421
|
+
});
|
422
|
+
}
|
423
|
+
});
|
424
|
+
}
|
425
|
+
const s = [
|
426
|
+
{
|
427
|
+
label: "Information",
|
428
|
+
value: "information",
|
429
|
+
icon: "overview",
|
430
|
+
render: Z
|
431
|
+
},
|
432
|
+
{
|
433
|
+
label: "Setting Request",
|
434
|
+
value: "settings",
|
435
|
+
icon: "settings",
|
436
|
+
render: me,
|
437
|
+
onlyFor: ["TERMINAL"]
|
438
|
+
},
|
439
|
+
{
|
440
|
+
label: "Fiuu",
|
441
|
+
value: "fiuu",
|
442
|
+
icon: "payment",
|
443
|
+
render: le,
|
444
|
+
region: [x.F_COUNTRY.enum.MY, x.F_COUNTRY.enum.SG]
|
445
|
+
},
|
446
|
+
{
|
447
|
+
label: "FeedMe Terminal",
|
448
|
+
value: "terminal",
|
449
|
+
icon: "shopping_cart_checkout",
|
450
|
+
render: ae,
|
451
|
+
onlyFor: ["POS", "KIOSK"]
|
452
|
+
},
|
453
|
+
{
|
454
|
+
label: "GHL Terminal (V2)",
|
455
|
+
value: "ghl",
|
456
|
+
icon: "shopping_cart_checkout",
|
457
|
+
render: re,
|
458
|
+
onlyFor: ["POS", "KIOSK"],
|
459
|
+
region: [x.F_COUNTRY.enum.MY]
|
460
|
+
}
|
461
|
+
], o = A().currentCountry, p = K(() => {
|
462
|
+
var l;
|
463
|
+
return (l = s.find((m) => m.value === e.value)) == null ? void 0 : l.render;
|
464
|
+
});
|
465
|
+
async function u() {
|
466
|
+
t(async () => {
|
467
|
+
a.value = await q.readById(i.terminalId);
|
468
|
+
});
|
469
|
+
}
|
470
|
+
return M(u), (l, m) => {
|
471
|
+
var S;
|
472
|
+
const y = v("FmTabs");
|
473
|
+
return w(), k(Q, {
|
474
|
+
title: `Terminal (${(S = a.value) == null ? void 0 : S._id})`,
|
475
|
+
loading: _(c),
|
476
|
+
onBack: _(r).back
|
477
|
+
}, {
|
478
|
+
default: G(() => [
|
479
|
+
b(y, {
|
480
|
+
"model-value": _(e),
|
481
|
+
"onUpdate:modelValue": m[0] || (m[0] = (g) => P(e) ? e.value = g : null),
|
482
|
+
class: "mb-6",
|
483
|
+
items: s.filter((g) => !g.onlyFor || g.onlyFor.includes(a.value.deviceType)).filter((g) => !g.region || g.region.includes(_(o) ?? _(x.F_COUNTRY).enum.MY))
|
484
|
+
}, null, 8, ["model-value", "items"]),
|
485
|
+
_(e) ? (w(), k(Y(p.value), $(j({ key: 0 }, {
|
486
|
+
terminal: a.value,
|
487
|
+
onUpdate: n
|
488
|
+
})), null, 16)) : V("", !0)
|
489
|
+
]),
|
490
|
+
_: 1
|
491
|
+
}, 8, ["title", "loading", "onBack"]);
|
492
|
+
};
|
493
|
+
}
|
494
|
+
});
|
495
|
+
export {
|
496
|
+
_e as default
|
497
|
+
};
|
@@ -1,16 +1,16 @@
|
|
1
1
|
import { defineComponent as B, ref as g, watch as E, computed as I, onMounted as J, resolveComponent as y, openBlock as v, createElementBlock as P, Fragment as Y, unref as t, createBlock as N, createCommentVNode as O, withCtx as T, createVNode as i, renderList as k, createElementVNode as V, isRef as b } from "vue";
|
2
|
-
import { t as L, b as G } from "./assets-
|
3
|
-
import { u as K, _ as C } from "./index-
|
4
|
-
import { _ as Q } from "./TransactionTable.vue_vue_type_script_setup_true_lang-
|
2
|
+
import { t as L, b as G } from "./assets-BZmrImt4.js";
|
3
|
+
import { u as K, _ as C } from "./index-DZMn5Qjp.js";
|
4
|
+
import { _ as Q } from "./TransactionTable.vue_vue_type_script_setup_true_lang-UjV7RID1.js";
|
5
5
|
import { h as $ } from "./moment-h96o7c8I.js";
|
6
6
|
import { useI18n as j, useCoreStore as q } from "@feedmepos/mf-common";
|
7
7
|
import { _ as H } from "./Layout.vue_vue_type_script_setup_true_lang-DJm5br5a.js";
|
8
|
-
import { u as W } from "./index-
|
8
|
+
import { u as W } from "./index-C1Hgyi3j.js";
|
9
9
|
import { _ as X } from "./AsyncButton.vue_vue_type_script_setup_true_lang-DcjzvYwT.js";
|
10
10
|
import { _ as Z } from "./SelectAll.vue_vue_type_script_setup_true_lang-DA4rs3tk.js";
|
11
11
|
import { _ as ee } from "./DateRangePicker.vue_vue_type_script_setup_true_lang-dP_5WjEJ.js";
|
12
|
-
import { p as te } from "./index-
|
13
|
-
import { t as ae } from "./index-
|
12
|
+
import { p as te } from "./index-gSE1T266.js";
|
13
|
+
import { t as ae } from "./index-a-Vqap7Z.js";
|
14
14
|
const ne = /* @__PURE__ */ B({
|
15
15
|
__name: "SourceSelector",
|
16
16
|
props: {
|