@feedmepos/mf-order-setting 0.0.48 → 0.0.50
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/{KioskDevicesView-iZTQ--DO.js → KioskDevicesView-u14hzPbE.js} +1 -1
- package/dist/KioskDevicesView.vue_vue_type_script_setup_true_lang-DBgRDIoS.js +501 -0
- package/dist/{KioskSettingView-mN7UPNYu.js → KioskSettingView-DmvtZcV1.js} +34 -33
- package/dist/KioskView-M8V91gD5.js +474 -0
- package/dist/{OrderSettingsView-B5Nq_u9Z.js → OrderSettingsView-Bl3LshG3.js} +15016 -14688
- package/dist/{app-B3KtJhiw.js → app-CLewMjcd.js} +89 -25
- package/dist/app.js +1 -1
- package/dist/{dayjs.min-GjkM9dM2.js → dayjs.min-DCTYRWyD.js} +1 -1
- package/dist/frontend/mf-order/src/api/restaurant-setting/index.d.ts +2 -1
- package/dist/frontend/mf-order/src/app.d.ts +64 -0
- package/dist/frontend/mf-order/src/main.d.ts +64 -0
- package/dist/frontend/mf-order/src/modules/kiosk/interface.d.ts +1 -0
- package/dist/frontend/mf-order/src/stores/kiosk/index.d.ts +3 -0
- package/dist/frontend/mf-order/src/stores/menu/menu.d.ts +1 -0
- package/dist/frontend/mf-order/src/stores/restaurant/index.d.ts +5 -2
- package/dist/frontend/mf-order/src/views/kiosk/devices/KioskDevicesView.vue.d.ts +6 -3
- package/dist/frontend/mf-order/src/views/order-settings/delivery/integrated-delivery/ExternalSetting.vue.d.ts +8 -0
- package/dist/frontend/mf-order/src/views/order-settings/drive-thru/DriveThruSetting.vue.d.ts +2 -0
- package/dist/frontend/mf-order/src/views/order-settings/servicecharge/ServiceChargeRule.vue.d.ts +2 -2
- package/dist/frontend/mf-order/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{index-Dwzta1U-.js → index-B7LtJeBJ.js} +2 -2
- package/dist/{menu.dto-DgPhiIVk.js → menu.dto-Co7iXHNr.js} +25558 -25019
- package/dist/package/entity/incoming-order/incoming-order-to-bill.dto.d.ts +108 -16
- package/dist/package/entity/incoming-order/incoming-order.do.d.ts +63 -18
- package/dist/package/entity/incoming-order/incoming-order.dto.d.ts +118 -18
- package/dist/package/entity/kiosk/kiosk.do.d.ts +32 -0
- package/dist/package/entity/kiosk/kiosk.dto.d.ts +44 -0
- package/dist/package/entity/kiosk/marketing/marketing.dto.d.ts +1071 -0
- package/dist/package/entity/order/order-item/order-item.dto.d.ts +8 -0
- package/dist/package/entity/order/order.dto.d.ts +16 -8
- package/dist/package/entity/order/order.enum.d.ts +2 -0
- package/dist/package/entity/order-platform/deliveroo/deliveroo-dto.d.ts +2 -2
- package/dist/package/entity/order-platform/deliveroo/deliveroo-setting.do.d.ts +2 -2
- package/dist/package/entity/order-platform/external/order/external-order.do.d.ts +62 -0
- package/dist/package/entity/order-platform/external/order/external-order.dto.d.ts +178 -0
- package/dist/package/entity/order-platform/external/setting/external-setting.do.d.ts +6 -0
- package/dist/package/entity/order-platform/external/setting/external-setting.dto.d.ts +6 -0
- package/dist/package/entity/order-platform/foodpanda/foodpanda-settings.do.d.ts +4 -4
- package/dist/package/entity/order-platform/foodpanda/foodpanda-settings.dto.d.ts +5 -5
- package/dist/package/entity/order-platform/grabfood/grabfood-menu.do.d.ts +15 -0
- package/dist/package/entity/order-platform/grabfood/grabfood-omni.do.d.ts +1834 -15
- package/dist/package/entity/order-platform/grabfood/grabfood-order.do.d.ts +13 -13
- package/dist/package/entity/order-platform/grabfood/grabfood-settings.do.d.ts +5 -2
- package/dist/package/entity/order-platform/grabfood/grabfood-webhook.dto.d.ts +528 -805
- package/dist/package/entity/order-platform/grabfood/grabfood.dto.d.ts +14 -11
- package/dist/package/entity/order-platform/grabfood/grabfood.enum.d.ts +1 -1
- package/dist/package/entity/order-platform/order-platform.dto.d.ts +0 -20
- package/dist/package/entity/order-platform/shopeefood/shopeefood-settings.do.d.ts +2 -2
- package/dist/package/entity/order-platform/shopeefood/shopeefood-settings.dto.d.ts +2 -2
- package/dist/package/entity/queue/queue.do.d.ts +12 -0
- package/dist/package/entity/queue/queue.dto.d.ts +26 -6
- package/package.json +4 -4
- package/src/api/restaurant-setting/index.ts +6 -0
- package/src/locales/en-US.json +16 -0
- package/src/locales/ja-JP.json +16 -0
- package/src/locales/th-TH.json +16 -0
- package/src/locales/zh-CN.json +16 -0
- package/src/main.ts +2 -2
- package/src/modules/kiosk/interface.ts +1 -0
- package/src/stores/kiosk/mapper.ts +1 -0
- package/src/stores/restaurant/index.ts +6 -0
- package/src/views/kiosk/KioskSummary.vue +37 -31
- package/src/views/kiosk/KioskView.vue +4 -1
- package/src/views/kiosk/devices/KioskDeviceCard.vue +205 -89
- package/src/views/kiosk/devices/KioskDevicesView.vue +133 -17
- package/src/views/kiosk/settings/KioskPaymentTypeSection.vue +8 -3
- package/src/views/order-settings/OrderSettingsView.vue +6 -1
- package/src/views/order-settings/delivery/integrated-delivery/ExternalSetting.vue +22 -1
- package/src/views/order-settings/drive-thru/DriveThruSetting.vue +101 -0
- package/dist/KioskDevicesView.vue_vue_type_script_setup_true_lang-CPDemTBj.js +0 -306
- package/dist/KioskView-NEpc7Ivb.js +0 -452
|
@@ -0,0 +1,474 @@
|
|
|
1
|
+
import { defineComponent as S, computed as h, createElementBlock as f, openBlock as i, normalizeClass as Z, createCommentVNode as b, createElementVNode as l, toDisplayString as u, unref as c, Fragment as ee, renderList as te, ref as I, defineAsyncComponent as ae, onMounted as ne, watch as se, resolveComponent as C, createVNode as g, withCtx as oe, withDirectives as le, vShow as re, createBlock as B } from "vue";
|
|
2
|
+
import { u as ce, _ as de } from "./KioskDevicesView.vue_vue_type_script_setup_true_lang-DBgRDIoS.js";
|
|
3
|
+
import { useI18n as U, useCoreStore as ue } from "@feedmepos/mf-common";
|
|
4
|
+
import { F as V, a as ie, b as pe } from "./menu.dto-Co7iXHNr.js";
|
|
5
|
+
import { useDialog as ye, useSnackbar as me, useBreakpoints as fe } from "@feedmepos/ui-library";
|
|
6
|
+
import { defineStore as _e } from "pinia";
|
|
7
|
+
import { O as E, c as M } from "./index-B7LtJeBJ.js";
|
|
8
|
+
const ve = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "fm-typo-en-title-sm-600"
|
|
11
|
+
}, be = {
|
|
12
|
+
key: 1,
|
|
13
|
+
class: "my-[0.25rem]"
|
|
14
|
+
}, he = { class: "flex flex-col gap-4" }, xe = { class: "flex flex-col gap-2" }, Pe = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, we = {
|
|
15
|
+
key: 0,
|
|
16
|
+
class: "flex flex-col gap-1"
|
|
17
|
+
}, ge = { class: "px-1.5 py-0.5 fm-corner-radius-sm bg-fm-color-neutral-gray-100 text-fm-color-typo-secondary fm-typo-en-body-xs-600 uppercase" }, Te = {
|
|
18
|
+
key: 0,
|
|
19
|
+
class: "fm-typo-en-body-sm-600"
|
|
20
|
+
}, Ce = ["title"], Ie = {
|
|
21
|
+
key: 1,
|
|
22
|
+
class: "fm-typo-en-body-lg-600"
|
|
23
|
+
}, Ae = {
|
|
24
|
+
key: 0,
|
|
25
|
+
class: "flex flex-col gap-1"
|
|
26
|
+
}, Oe = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Ke = { class: "fm-typo-en-body-lg-600" }, Se = {
|
|
27
|
+
key: 1,
|
|
28
|
+
class: "flex flex-col gap-1"
|
|
29
|
+
}, Ue = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, $e = { class: "fm-typo-en-body-lg-600" }, Fe = {
|
|
30
|
+
key: 2,
|
|
31
|
+
class: "flex flex-col gap-1"
|
|
32
|
+
}, qe = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Re = { class: "fm-typo-en-body-lg-600" }, De = {
|
|
33
|
+
key: 3,
|
|
34
|
+
class: "flex flex-col gap-1"
|
|
35
|
+
}, Be = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Ve = { class: "fm-typo-en-body-lg-600" }, Ee = { key: 0 }, N = /* @__PURE__ */ S({
|
|
36
|
+
__name: "KioskSummary",
|
|
37
|
+
props: {
|
|
38
|
+
restaurantId: {},
|
|
39
|
+
devices: {},
|
|
40
|
+
kioskOrderSetting: {},
|
|
41
|
+
dialogType: { type: Boolean }
|
|
42
|
+
},
|
|
43
|
+
setup(t) {
|
|
44
|
+
const { t: e } = U(), o = t, r = h(() => {
|
|
45
|
+
var a;
|
|
46
|
+
return (a = o.kioskOrderSetting) != null && a.dineIn.enabled ? e("order.activated") : e("order.deactivated");
|
|
47
|
+
}), n = h(() => {
|
|
48
|
+
var a;
|
|
49
|
+
return (a = o.kioskOrderSetting) != null && a.takeaway.enabled ? e("order.activated") : e("order.deactivated");
|
|
50
|
+
}), s = h(() => {
|
|
51
|
+
var a, y;
|
|
52
|
+
return (a = o.kioskOrderSetting) != null && a.dineIn.displayStand ? e("order.tableService") : (y = o.kioskOrderSetting) != null && y.dineIn && !o.kioskOrderSetting.dineIn.displayStand ? e("order.pickAtCounter") : e("order.unknown");
|
|
53
|
+
}), p = h(() => {
|
|
54
|
+
var a;
|
|
55
|
+
return ((a = o.kioskOrderSetting) == null ? void 0 : a.paymentSetting.paymentTypes.includes(V.enum.cash)) ?? !1;
|
|
56
|
+
}), d = h(() => {
|
|
57
|
+
var y, _;
|
|
58
|
+
const a = [];
|
|
59
|
+
if ((y = o.kioskOrderSetting) == null || y.paymentSetting.paymentTypes.forEach((v) => {
|
|
60
|
+
v === V.enum.ePayment && a.push(e("order.ePayment"));
|
|
61
|
+
}), a.length > 0 && Object.keys(o.kioskOrderSetting.paymentSetting.ePaymentTypes).length !== 0) {
|
|
62
|
+
const v = (_ = o.kioskOrderSetting) == null ? void 0 : _.paymentSetting.ePaymentTypes;
|
|
63
|
+
(v.card.terminal || v.card.nfc) && a.push(e("order.bankCard")), (v.eWallet.scanPay || v.eWallet.qrPay) && a.push(e("order.eWallet"));
|
|
64
|
+
}
|
|
65
|
+
return a.join(", ");
|
|
66
|
+
});
|
|
67
|
+
return (a, y) => (i(), f("div", {
|
|
68
|
+
class: Z(a.dialogType ? "" : ["p-[1.5rem] border fm-corner-radius-lg flex flex-col gap-5 fixed ml-40 w-[320px]"])
|
|
69
|
+
}, [
|
|
70
|
+
a.dialogType ? b("", !0) : (i(), f("span", ve, u(c(e)("order.kioskSummary")), 1)),
|
|
71
|
+
a.dialogType ? b("", !0) : (i(), f("hr", be)),
|
|
72
|
+
l("div", he, [
|
|
73
|
+
l("div", xe, [
|
|
74
|
+
l("span", Pe, u(c(e)("order.kioskDisplay")), 1),
|
|
75
|
+
a.devices.length > 0 ? (i(), f("div", we, [
|
|
76
|
+
(i(!0), f(ee, null, te(a.devices, (_) => (i(), f("div", {
|
|
77
|
+
key: _.machineId,
|
|
78
|
+
class: "fm-typo-en-body-sm-400 flex items-center gap-2"
|
|
79
|
+
}, [
|
|
80
|
+
l("span", ge, u(_.deviceAppType === "TABLET_APP" ? "T" : "K"), 1),
|
|
81
|
+
_.slotInfo ? (i(), f("span", Te, u(_.slotInfo), 1)) : b("", !0),
|
|
82
|
+
l("span", {
|
|
83
|
+
class: "text-fm-color-typo-secondary truncate flex-1",
|
|
84
|
+
title: _.name
|
|
85
|
+
}, u(_.name), 9, Ce)
|
|
86
|
+
]))), 128))
|
|
87
|
+
])) : (i(), f("div", Ie, "-"))
|
|
88
|
+
]),
|
|
89
|
+
r.value === c(e)("order.activated") ? (i(), f("div", Ae, [
|
|
90
|
+
l("span", Oe, u(c(e)("order.dineIn")), 1),
|
|
91
|
+
l("div", Ke, u(r.value), 1)
|
|
92
|
+
])) : b("", !0),
|
|
93
|
+
r.value === c(e)("order.activated") && s.value !== c(e)("order.unknown") ? (i(), f("div", Se, [
|
|
94
|
+
l("span", Ue, u(c(e)("order.dineInType")), 1),
|
|
95
|
+
l("div", $e, u(s.value), 1)
|
|
96
|
+
])) : b("", !0),
|
|
97
|
+
n.value === c(e)("order.activated") ? (i(), f("div", Fe, [
|
|
98
|
+
l("span", qe, u(c(e)("order.takeaway")), 1),
|
|
99
|
+
l("div", Re, u(n.value), 1)
|
|
100
|
+
])) : b("", !0),
|
|
101
|
+
d.value || p.value ? (i(), f("div", De, [
|
|
102
|
+
l("span", Be, u(c(e)("order.acceptedPayment")), 1),
|
|
103
|
+
l("div", Ve, [
|
|
104
|
+
p.value ? (i(), f("div", Ee, u(c(e)("order.offlinePayment")), 1)) : b("", !0),
|
|
105
|
+
l("div", null, u(d.value), 1)
|
|
106
|
+
])
|
|
107
|
+
])) : b("", !0)
|
|
108
|
+
])
|
|
109
|
+
], 2));
|
|
110
|
+
}
|
|
111
|
+
}), Me = { class: "flex flex-col gap-5 pb-6" }, Ne = { class: "fm-typo-en-body-md-400 block" }, We = { class: "fm-typo-en-title-md-600" }, Le = /* @__PURE__ */ S({
|
|
112
|
+
__name: "KioskOtpDialog",
|
|
113
|
+
props: {
|
|
114
|
+
otp: {}
|
|
115
|
+
},
|
|
116
|
+
setup(t) {
|
|
117
|
+
const { t: e } = U();
|
|
118
|
+
return (o, r) => (i(), f("div", Me, [
|
|
119
|
+
l("span", Ne, u(c(e)("order.bindDeviceMessage")), 1),
|
|
120
|
+
l("div", We, u(o.otp), 1)
|
|
121
|
+
]));
|
|
122
|
+
}
|
|
123
|
+
}), L = {
|
|
124
|
+
enabled: !1,
|
|
125
|
+
prefix: null,
|
|
126
|
+
padDigit: 0,
|
|
127
|
+
standSlotRange: {
|
|
128
|
+
min: 1,
|
|
129
|
+
max: 10
|
|
130
|
+
},
|
|
131
|
+
enablePaxDialog: !1,
|
|
132
|
+
submitOrderInstruction: {
|
|
133
|
+
payAtCounter: null,
|
|
134
|
+
paid: null
|
|
135
|
+
}
|
|
136
|
+
}, je = {
|
|
137
|
+
enabled: !1,
|
|
138
|
+
submitOrderInstruction: {
|
|
139
|
+
payAtCounter: null,
|
|
140
|
+
paid: null
|
|
141
|
+
}
|
|
142
|
+
}, j = {
|
|
143
|
+
enabled: !1,
|
|
144
|
+
submitOrderInstruction: {
|
|
145
|
+
payAtCounter: null,
|
|
146
|
+
paid: null
|
|
147
|
+
},
|
|
148
|
+
enablePaxDialog: !1
|
|
149
|
+
}, He = {
|
|
150
|
+
dineIn: {
|
|
151
|
+
enabled: !1,
|
|
152
|
+
pickUp: j,
|
|
153
|
+
sequenceNumber: ie.parse({}),
|
|
154
|
+
displayStand: L
|
|
155
|
+
},
|
|
156
|
+
takeaway: je,
|
|
157
|
+
paymentSetting: {
|
|
158
|
+
paymentTypes: [],
|
|
159
|
+
offlinePaymentTypes: [],
|
|
160
|
+
ePaymentTypes: {
|
|
161
|
+
terminal: !1,
|
|
162
|
+
card: {
|
|
163
|
+
terminal: !1,
|
|
164
|
+
nfc: !1
|
|
165
|
+
},
|
|
166
|
+
eWallet: {
|
|
167
|
+
terminalQrPay: !1,
|
|
168
|
+
terminalScanPay: !1,
|
|
169
|
+
qrPay: !1,
|
|
170
|
+
scanPay: !1
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
menuItem: {
|
|
175
|
+
showAllOnly: !1
|
|
176
|
+
}
|
|
177
|
+
}, K = {
|
|
178
|
+
payAtCounter: null,
|
|
179
|
+
paid: null
|
|
180
|
+
}, Ye = (t) => {
|
|
181
|
+
var e;
|
|
182
|
+
return {
|
|
183
|
+
kiosk: ze(t.kioskSettings, (e = t.sequenceSettings) == null ? void 0 : e.kioskDineIn)
|
|
184
|
+
};
|
|
185
|
+
}, ze = (t, e) => {
|
|
186
|
+
var o, r, n, s, p, d, a, y, _, v, P;
|
|
187
|
+
return {
|
|
188
|
+
dineIn: Qe(
|
|
189
|
+
e ?? {
|
|
190
|
+
current: 0,
|
|
191
|
+
prefix: "#K"
|
|
192
|
+
},
|
|
193
|
+
(t == null ? void 0 : t.dineIn) ?? void 0
|
|
194
|
+
),
|
|
195
|
+
takeaway: {
|
|
196
|
+
enabled: (t == null ? void 0 : t.canTakeaway) ?? !1,
|
|
197
|
+
submitOrderInstruction: (o = t == null ? void 0 : t.takeaway) != null && o.submitOrderInstruction ? {
|
|
198
|
+
payAtCounter: ((s = (n = (r = t == null ? void 0 : t.takeaway) == null ? void 0 : r.submitOrderInstruction) == null ? void 0 : n.payAtCounter) == null ? void 0 : s.en) ?? null,
|
|
199
|
+
paid: ((a = (d = (p = t == null ? void 0 : t.takeaway) == null ? void 0 : p.submitOrderInstruction) == null ? void 0 : d.paid) == null ? void 0 : a.en) ?? null
|
|
200
|
+
} : K
|
|
201
|
+
},
|
|
202
|
+
paymentSetting: {
|
|
203
|
+
paymentTypes: ((y = t == null ? void 0 : t.paymentSetting) == null ? void 0 : y.paymentTypes) ?? [],
|
|
204
|
+
offlinePaymentTypes: ((_ = t == null ? void 0 : t.paymentSetting) == null ? void 0 : _.offlinePaymentTypes) ?? [],
|
|
205
|
+
ePaymentTypes: ((v = t == null ? void 0 : t.paymentSetting) == null ? void 0 : v.ePaymentTypes) ?? pe.parse({
|
|
206
|
+
card: {
|
|
207
|
+
terminal: !1,
|
|
208
|
+
nfc: !1
|
|
209
|
+
},
|
|
210
|
+
eWallet: {
|
|
211
|
+
qrPay: !1,
|
|
212
|
+
scanPay: !1
|
|
213
|
+
}
|
|
214
|
+
})
|
|
215
|
+
},
|
|
216
|
+
menuItem: {
|
|
217
|
+
showAllOnly: ((P = t == null ? void 0 : t.menuItem) == null ? void 0 : P.showAllOnly) ?? !1
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
}, Qe = (t, e) => {
|
|
221
|
+
var o, r, n, s, p, d, a, y;
|
|
222
|
+
return {
|
|
223
|
+
enabled: !!e,
|
|
224
|
+
sequenceNumber: t,
|
|
225
|
+
pickUp: e != null && e.pickUp ? {
|
|
226
|
+
...e.pickUp,
|
|
227
|
+
submitOrderInstruction: e.pickUp.submitOrderInstruction ? {
|
|
228
|
+
payAtCounter: ((r = (o = e.pickUp.submitOrderInstruction) == null ? void 0 : o.payAtCounter) == null ? void 0 : r.en) ?? null,
|
|
229
|
+
paid: ((s = (n = e.pickUp.submitOrderInstruction) == null ? void 0 : n.paid) == null ? void 0 : s.en) ?? null
|
|
230
|
+
} : K,
|
|
231
|
+
enablePaxDialog: e.pickUp.enablePaxDialog ? e.pickUp.enablePaxDialog : !1
|
|
232
|
+
} : j,
|
|
233
|
+
displayStand: e != null && e.displayStand ? {
|
|
234
|
+
enabled: e.displayStand.enabled,
|
|
235
|
+
standSlotRange: e.displayStand.standSlotRange,
|
|
236
|
+
prefix: e.displayStand.prefix,
|
|
237
|
+
padDigit: e.displayStand.padDigit,
|
|
238
|
+
enablePaxDialog: e.displayStand.enablePaxDialog ?? !1,
|
|
239
|
+
submitOrderInstruction: e.displayStand.submitOrderInstruction ? {
|
|
240
|
+
payAtCounter: ((d = (p = e.displayStand.submitOrderInstruction) == null ? void 0 : p.payAtCounter) == null ? void 0 : d.en) ?? null,
|
|
241
|
+
paid: ((y = (a = e.displayStand.submitOrderInstruction) == null ? void 0 : a.paid) == null ? void 0 : y.en) ?? null
|
|
242
|
+
} : K
|
|
243
|
+
} : L
|
|
244
|
+
};
|
|
245
|
+
}, ke = (t) => {
|
|
246
|
+
const e = (n) => {
|
|
247
|
+
var s, p, d, a;
|
|
248
|
+
return {
|
|
249
|
+
requiredSlot: !!n.displayStand,
|
|
250
|
+
displayStand: {
|
|
251
|
+
...n.displayStand,
|
|
252
|
+
submitOrderInstruction: {
|
|
253
|
+
payAtCounter: (s = n.displayStand.submitOrderInstruction) != null && s.payAtCounter ? {
|
|
254
|
+
en: n.displayStand.submitOrderInstruction.payAtCounter
|
|
255
|
+
} : null,
|
|
256
|
+
paid: (p = n.displayStand.submitOrderInstruction) != null && p.paid ? {
|
|
257
|
+
en: n.displayStand.submitOrderInstruction.paid
|
|
258
|
+
} : null
|
|
259
|
+
}
|
|
260
|
+
},
|
|
261
|
+
pickUp: {
|
|
262
|
+
...n.pickUp,
|
|
263
|
+
submitOrderInstruction: {
|
|
264
|
+
payAtCounter: (d = n.pickUp.submitOrderInstruction) != null && d.payAtCounter ? {
|
|
265
|
+
en: n.pickUp.submitOrderInstruction.payAtCounter
|
|
266
|
+
} : null,
|
|
267
|
+
paid: (a = n.pickUp.submitOrderInstruction) != null && a.paid ? {
|
|
268
|
+
en: n.pickUp.submitOrderInstruction.paid
|
|
269
|
+
} : null
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
};
|
|
273
|
+
}, o = (n) => ({
|
|
274
|
+
canTakeaway: t.takeaway.enabled,
|
|
275
|
+
dineIn: n,
|
|
276
|
+
menuItem: t.menuItem,
|
|
277
|
+
paymentSetting: r(t.paymentSetting),
|
|
278
|
+
takeaway: t.takeaway.submitOrderInstruction ? {
|
|
279
|
+
submitOrderInstruction: {
|
|
280
|
+
payAtCounter: t.takeaway.submitOrderInstruction.payAtCounter ? {
|
|
281
|
+
en: t.takeaway.submitOrderInstruction.payAtCounter
|
|
282
|
+
} : null,
|
|
283
|
+
paid: t.takeaway.submitOrderInstruction.paid ? {
|
|
284
|
+
en: t.takeaway.submitOrderInstruction.paid
|
|
285
|
+
} : null
|
|
286
|
+
}
|
|
287
|
+
} : void 0
|
|
288
|
+
}), r = (n) => ({
|
|
289
|
+
paymentTypes: n.paymentTypes,
|
|
290
|
+
offlinePaymentTypes: n.offlinePaymentTypes,
|
|
291
|
+
ePaymentTypes: n.ePaymentTypes
|
|
292
|
+
});
|
|
293
|
+
return t.dineIn.enabled ? {
|
|
294
|
+
kioskSettings: o(e(t.dineIn)),
|
|
295
|
+
kioskDineIn: t.dineIn.sequenceNumber
|
|
296
|
+
} : {
|
|
297
|
+
kioskSettings: o()
|
|
298
|
+
};
|
|
299
|
+
}, W = {
|
|
300
|
+
convertOrderSettingDto: Ye,
|
|
301
|
+
toOrderKioskSettingsDto: ke
|
|
302
|
+
}, Ge = _e("orderSetting", () => {
|
|
303
|
+
const t = I({});
|
|
304
|
+
async function e() {
|
|
305
|
+
const s = await E.getOrderSetting();
|
|
306
|
+
r(s);
|
|
307
|
+
}
|
|
308
|
+
async function o() {
|
|
309
|
+
if (t.value.orderSetting && t.value.kiosk) {
|
|
310
|
+
const { _id: s, ...p } = t.value.orderSetting, d = W.toOrderKioskSettingsDto(t.value.kiosk), a = {
|
|
311
|
+
...p,
|
|
312
|
+
kioskSettings: d.kioskSettings
|
|
313
|
+
}, y = await E.updateOrderSetting(a);
|
|
314
|
+
r(y);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
function r(s) {
|
|
318
|
+
t.value.orderSetting = s, t.value.kiosk = W.convertOrderSettingDto(s).kiosk;
|
|
319
|
+
}
|
|
320
|
+
function n(s) {
|
|
321
|
+
t.value.kiosk = s;
|
|
322
|
+
}
|
|
323
|
+
return {
|
|
324
|
+
state: t.value,
|
|
325
|
+
getSetting: e,
|
|
326
|
+
updateKioskSetting: o,
|
|
327
|
+
setKioskOrderSetting: n
|
|
328
|
+
};
|
|
329
|
+
}), Je = { class: "py-[1.5rem]" }, Xe = { class: "flex px-[1.5rem]" }, Ze = { class: "flex-[2_2_0%]" }, et = { class: "pt-[1.5rem]" }, tt = { class: "flex flex-col gap-10" }, at = { class: "flex flex-col gap-2" }, nt = { class: "fm-typo-en-title-sm-600" }, st = { class: "fm-typo-en-title-sm-400" }, ot = {
|
|
330
|
+
key: 0,
|
|
331
|
+
class: "flex-[1_1_0%]"
|
|
332
|
+
}, yt = /* @__PURE__ */ S({
|
|
333
|
+
__name: "KioskView",
|
|
334
|
+
setup(t) {
|
|
335
|
+
var R, D;
|
|
336
|
+
const { t: e } = U(), o = ae(
|
|
337
|
+
() => import("./KioskSettingView-DmvtZcV1.js")
|
|
338
|
+
), r = I("device"), n = ce(), s = Ge(), p = ye(), { currentRestaurant: d, restaurants: a, changeRestaurant: y } = ue(), _ = me(), v = fe(), P = h(() => v.breakpoints.value.xs), T = I(((R = d.value) == null ? void 0 : R._id) ?? void 0), H = h(() => a.value.map((m) => ({
|
|
339
|
+
label: m.profile.name,
|
|
340
|
+
value: m._id
|
|
341
|
+
}))), w = I(((D = d.value) == null ? void 0 : D._id) ?? "");
|
|
342
|
+
function Y() {
|
|
343
|
+
var m;
|
|
344
|
+
p.open({
|
|
345
|
+
title: M(e("order.kioskSummary")),
|
|
346
|
+
contentComponent: N,
|
|
347
|
+
contentComponentProps: {
|
|
348
|
+
restaurantId: (m = d.value) == null ? void 0 : m._id,
|
|
349
|
+
devices: n.state.devices,
|
|
350
|
+
kioskOrderSetting: s.state.kiosk,
|
|
351
|
+
dialogType: !0
|
|
352
|
+
}
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
async function $(m) {
|
|
356
|
+
const x = a.value.find((A) => A._id == m);
|
|
357
|
+
await y(x), await F(), T.value = m, w.value = m;
|
|
358
|
+
}
|
|
359
|
+
async function F() {
|
|
360
|
+
await s.getSetting(), await n.getDevices();
|
|
361
|
+
}
|
|
362
|
+
const z = h(() => [
|
|
363
|
+
{
|
|
364
|
+
label: e("order.deviceBinding"),
|
|
365
|
+
value: "device"
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
label: e("order.settings"),
|
|
369
|
+
value: "setting"
|
|
370
|
+
}
|
|
371
|
+
]), q = h(() => n.state.devices);
|
|
372
|
+
async function Q() {
|
|
373
|
+
await n.requestOtp(), p.open({
|
|
374
|
+
title: M(e("order.bindDevice")),
|
|
375
|
+
contentComponent: Le,
|
|
376
|
+
contentComponentProps: {
|
|
377
|
+
otp: n.state.otp
|
|
378
|
+
}
|
|
379
|
+
}).onClose(async () => {
|
|
380
|
+
await n.getDevices();
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
async function k(m) {
|
|
384
|
+
try {
|
|
385
|
+
s.setKioskOrderSetting(m), await s.updateKioskSetting(), _.open({
|
|
386
|
+
title: e("order.kioskSettingSuccess"),
|
|
387
|
+
type: "success"
|
|
388
|
+
});
|
|
389
|
+
} catch {
|
|
390
|
+
_.open({
|
|
391
|
+
title: e("order.kioskSettingFailed"),
|
|
392
|
+
type: "error"
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
return ne(async () => {
|
|
397
|
+
var m;
|
|
398
|
+
(m = d.value) != null && m._id && (w.value = d.value._id, await F());
|
|
399
|
+
}), se(
|
|
400
|
+
() => a.value.length,
|
|
401
|
+
async (m) => {
|
|
402
|
+
T.value === void 0 && a.value.length > 0 && await $(a.value[0]._id);
|
|
403
|
+
},
|
|
404
|
+
{ immediate: !0 }
|
|
405
|
+
), (m, x) => {
|
|
406
|
+
const A = C("FmButton"), G = C("FmPageHead"), J = C("FmTabs"), X = C("FmSelect");
|
|
407
|
+
return i(), f("div", Je, [
|
|
408
|
+
g(G, {
|
|
409
|
+
title: c(e)("order.kiosk")
|
|
410
|
+
}, {
|
|
411
|
+
append: oe(() => [
|
|
412
|
+
le(g(A, {
|
|
413
|
+
icon: "info",
|
|
414
|
+
variant: "tertiary",
|
|
415
|
+
onClick: Y
|
|
416
|
+
}, null, 512), [
|
|
417
|
+
[re, P.value]
|
|
418
|
+
])
|
|
419
|
+
]),
|
|
420
|
+
_: 1
|
|
421
|
+
}, 8, ["title"]),
|
|
422
|
+
l("div", Xe, [
|
|
423
|
+
l("div", Ze, [
|
|
424
|
+
g(J, {
|
|
425
|
+
"model-value": r.value,
|
|
426
|
+
"onUpdate:modelValue": x[0] || (x[0] = (O) => r.value = O),
|
|
427
|
+
items: z.value
|
|
428
|
+
}, null, 8, ["model-value", "items"]),
|
|
429
|
+
l("div", et, [
|
|
430
|
+
l("div", tt, [
|
|
431
|
+
l("div", at, [
|
|
432
|
+
l("span", nt, u(c(e)("order.activateLocation")), 1),
|
|
433
|
+
l("span", st, u(c(e)("order.selectRestaurant")) + ": ", 1),
|
|
434
|
+
g(X, {
|
|
435
|
+
class: "w-1/2",
|
|
436
|
+
modelValue: T.value,
|
|
437
|
+
"onUpdate:modelValue": [
|
|
438
|
+
x[1] || (x[1] = (O) => T.value = O),
|
|
439
|
+
$
|
|
440
|
+
],
|
|
441
|
+
items: H.value,
|
|
442
|
+
placeholder: c(e)("order.selectItem")
|
|
443
|
+
}, null, 8, ["modelValue", "items", "placeholder"])
|
|
444
|
+
]),
|
|
445
|
+
r.value == "device" ? (i(), B(de, {
|
|
446
|
+
key: 0,
|
|
447
|
+
devices: q.value,
|
|
448
|
+
onRequestOtp: Q
|
|
449
|
+
}, null, 8, ["devices"])) : b("", !0),
|
|
450
|
+
r.value == "setting" ? (i(), B(c(o), {
|
|
451
|
+
key: `KioskSettingView-${w.value}`,
|
|
452
|
+
"restaurant-id": w.value,
|
|
453
|
+
onUpdateKioskOrderSetting: k,
|
|
454
|
+
form: c(s).state.kiosk ?? c(He)
|
|
455
|
+
}, null, 8, ["restaurant-id", "form"])) : b("", !0)
|
|
456
|
+
])
|
|
457
|
+
])
|
|
458
|
+
]),
|
|
459
|
+
P.value ? b("", !0) : (i(), f("div", ot, [
|
|
460
|
+
g(N, {
|
|
461
|
+
"restaurant-id": w.value,
|
|
462
|
+
devices: q.value,
|
|
463
|
+
"kiosk-order-setting": c(s).state.kiosk,
|
|
464
|
+
dialogType: !1
|
|
465
|
+
}, null, 8, ["restaurant-id", "devices", "kiosk-order-setting"])
|
|
466
|
+
]))
|
|
467
|
+
])
|
|
468
|
+
]);
|
|
469
|
+
};
|
|
470
|
+
}
|
|
471
|
+
});
|
|
472
|
+
export {
|
|
473
|
+
yt as default
|
|
474
|
+
};
|