@feedmepos/mf-order-setting 0.0.102 → 0.0.103
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/{DisplaySystemView-jnt6letY.js → DisplaySystemView-BBiZqcWq.js} +1497 -1468
- package/dist/{FoodCourtInvitationsView-DoynqFWB.js → FoodCourtInvitationsView-DwOkVs9m.js} +4 -4
- package/dist/{FoodCourtOrderSettingsView-DYZLhTHy.js → FoodCourtOrderSettingsView-C9Ag5Bsg.js} +1 -1
- package/dist/FoodCourtOrdersView-y4EwK3sn.js +1173 -0
- package/dist/{FoodCourtStallsView-CRMTt5BB.js → FoodCourtStallsView-Bi8H-yR7.js} +2 -2
- package/dist/{FoodCourtStatusView-C-b-eI-8.js → FoodCourtStatusView-jugAzTKg.js} +1 -1
- package/dist/KioskDevicesView-CYiew4X5.js +4 -0
- package/dist/KioskDevicesView.vue_vue_type_script_setup_true_lang-BCvbeo7R.js +1497 -0
- package/dist/KioskSettingView-AKBiij9a.js +1124 -0
- package/dist/KioskView-zKB6mC8I.js +765 -0
- package/dist/{OrderSettingsView-BBCnekaj.js → OrderSettingsView-CoV_yX3m.js} +22064 -21635
- package/dist/{RestaurantSelector.vue_vue_type_script_setup_true_lang-DjoTyV6m.js → RestaurantSelector.vue_vue_type_script_setup_true_lang-KSMU_jGl.js} +1 -1
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
- package/dist/{app-Dvk30CIa.js → app-CmuI6uSl.js} +3589 -2902
- package/dist/app.js +1 -1
- package/dist/{dayjs.min-DUFHhM7O.js → dayjs.min-B3MssMma.js} +1 -1
- package/dist/{featureFlag-BvcirzHS.js → featureFlag-CWvkPOBY.js} +123 -130
- package/dist/frontend/mf-order/src/api/food-court/index.d.ts +51 -0
- package/dist/frontend/mf-order/src/api/kiosk/index.d.ts +4 -0
- package/dist/frontend/mf-order/src/api/payment/index.d.ts +8 -0
- package/dist/frontend/mf-order/src/api/queue/index.d.ts +13 -0
- package/dist/frontend/mf-order/src/api/restaurant-setting/index.d.ts +9 -1
- package/dist/frontend/mf-order/src/app.d.ts +687 -0
- package/dist/frontend/mf-order/src/main.d.ts +687 -0
- package/dist/frontend/mf-order/src/modules/display-system/interface.d.ts +5 -0
- package/dist/frontend/mf-order/src/modules/kiosk/interface.d.ts +4 -0
- package/dist/frontend/mf-order/src/modules/kiosk/license.d.ts +92 -0
- package/dist/frontend/mf-order/src/modules/kiosk/outletLoad.d.ts +15 -0
- package/dist/frontend/mf-order/src/modules/kiosk/settingsSections.d.ts +24 -0
- package/dist/frontend/mf-order/src/modules/kiosk/useKioskSettings.d.ts +29 -0
- package/dist/frontend/mf-order/src/modules/payment/paymentDevice.d.ts +58 -0
- package/dist/frontend/mf-order/src/stores/kiosk/index.d.ts +67 -1
- package/dist/frontend/mf-order/src/stores/order-setting/index.d.ts +19 -10
- package/dist/frontend/mf-order/src/stores/payment/index.d.ts +59 -1
- package/dist/frontend/mf-order/src/views/food-court/food-court-export.d.ts +38 -0
- package/dist/frontend/mf-order/src/views/kiosk/devices/KioskDeviceCard.vue.d.ts +3 -0
- package/dist/frontend/mf-order/src/views/kiosk/devices/KioskDevicesView.vue.d.ts +7 -0
- package/dist/frontend/mf-order/src/views/kiosk/devices/KioskLicenseSummary.vue.d.ts +7 -0
- package/dist/frontend/mf-order/src/views/kiosk/devices/KioskLicensesView.vue.d.ts +6 -0
- package/dist/frontend/mf-order/src/views/kiosk/devices/KioskOtpDialog.vue.d.ts +3 -0
- package/dist/frontend/mf-order/src/views/kiosk/devices/KioskPaymentDeviceCard.vue.d.ts +17 -0
- package/dist/frontend/mf-order/src/views/kiosk/settings/KioskSettingView.vue.d.ts +5 -2
- package/dist/frontend/mf-order/src/views/order-settings/pickup/PickUpSettingDialogContent.vue.d.ts +0 -9
- package/dist/frontend/mf-order/src/views/order-settings/pos-status/PosOrderingStatus.vue.d.ts +17 -0
- package/dist/frontend/mf-order/src/views/order-settings/pos-status/pos-status.d.ts +44 -0
- package/dist/frontend/mf-order/src/views/order-settings/queue/called-message.d.ts +1 -0
- package/dist/frontend/mf-order/src/views/order-settings/queue/phone-join-mode.d.ts +25 -0
- package/dist/frontend/mf-order/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{index-C4n5H7t3.js → index-BQa8AudZ.js} +3 -3
- package/dist/index-CMOvrim4.js +147 -0
- package/dist/{index-CW4VlFWz.js → index-D5qh2_4b.js} +1 -1
- package/dist/{index-C5n6lil6.js → index-Dup6kWLX.js} +6 -6
- package/dist/{index-CGxCWKHB.js → index-wuFIsXHT.js} +188 -179
- package/dist/{order.dto-Cb_gh3iB.js → order.dto-BD9raQG5.js} +2782 -2735
- package/dist/package/entity/display/blocks.d.ts +12 -2
- package/dist/package/entity/marketing/marketing.dto.d.ts +18 -18
- package/dist/package/entity/order-platform/external/reconciliation/external-reconciliation.do.d.ts +24 -24
- package/dist/package/entity/order-platform/menu.dto.d.ts +20 -20
- package/dist/package/entity/order-setting/order-setting.do.d.ts +10 -0
- package/dist/package/entity/order-setting/order-setting.dto.d.ts +26 -0
- package/dist/package/entity/order-setting/queue/queue.do.d.ts +23 -0
- package/dist/package/entity/order-setting/queue/queue.dto.d.ts +14 -0
- package/dist/package/entity/queue/queue.do.d.ts +153 -0
- package/dist/package/entity/queue/queue.dto.d.ts +221 -2
- package/dist/package/entity/queue/queue.enum.d.ts +5 -0
- package/dist/package/entity/restaurant/restaurant.dto.d.ts +20 -0
- package/dist/style.css +1 -1
- package/dist/{index-ILnighyU.js → useInternalUser-CHtaur9A.js} +93 -81
- package/package.json +2 -1
- package/src/api/food-court/index.ts +63 -0
- package/src/api/kiosk/index.ts +8 -0
- package/src/api/payment/index.ts +18 -1
- package/src/api/queue/index.ts +39 -0
- package/src/api/restaurant-setting/index.ts +14 -0
- package/src/locales/en-US.json +197 -26
- package/src/locales/ja-JP.json +193 -23
- package/src/locales/th-TH.json +193 -21
- package/src/locales/zh-CN.json +197 -23
- package/src/modules/display-system/interface.spec.ts +26 -1
- package/src/modules/display-system/interface.ts +20 -0
- package/src/modules/kiosk/interface.ts +4 -0
- package/src/modules/kiosk/license.spec.ts +167 -0
- package/src/modules/kiosk/license.ts +175 -0
- package/src/modules/kiosk/outletLoad.spec.ts +25 -0
- package/src/modules/kiosk/outletLoad.ts +19 -0
- package/src/modules/kiosk/settingsSections.spec.ts +85 -0
- package/src/modules/kiosk/settingsSections.ts +82 -0
- package/src/modules/kiosk/useKioskSettings.spec.ts +157 -0
- package/src/modules/kiosk/useKioskSettings.ts +61 -0
- package/src/modules/payment/paymentDevice.spec.ts +175 -0
- package/src/modules/payment/paymentDevice.ts +156 -0
- package/src/stores/kiosk/index.ts +16 -1
- package/src/stores/kiosk/mapper.ts +2 -0
- package/src/stores/order-setting/index.spec.ts +83 -0
- package/src/stores/order-setting/index.ts +49 -27
- package/src/stores/payment/index.spec.ts +86 -0
- package/src/stores/payment/index.ts +48 -2
- package/src/views/display-system/DisplayInspector.vue +17 -8
- package/src/views/display-system/DisplayTemplateEditor.vue +3 -1
- package/src/views/food-court/FoodCourtOrdersView.vue +46 -1
- package/src/views/food-court/food-court-export.spec.ts +151 -0
- package/src/views/food-court/food-court-export.ts +283 -0
- package/src/views/kiosk/KioskStatePanel.vue +2 -2
- package/src/views/kiosk/KioskView.vue +219 -82
- package/src/views/kiosk/devices/KioskDeviceCard.vue +148 -23
- package/src/views/kiosk/devices/KioskDevicesView.vue +48 -10
- package/src/views/kiosk/devices/KioskLicenseSummary.vue +79 -0
- package/src/views/kiosk/devices/KioskLicensesView.vue +152 -0
- package/src/views/kiosk/devices/KioskOtpDialog.vue +41 -1
- package/src/views/kiosk/devices/KioskPaymentDeviceCard.spec.ts +97 -0
- package/src/views/kiosk/devices/KioskPaymentDeviceCard.vue +221 -0
- package/src/views/kiosk/settings/KioskPaymentTypeSection.vue +1 -1
- package/src/views/kiosk/settings/KioskSettingView.vue +702 -419
- package/src/views/order-settings/delivery/DeliverySetting.vue +4 -0
- package/src/views/order-settings/dine-in/DineInSetting.vue +4 -0
- package/src/views/order-settings/pickup/PickUpSetting.vue +4 -4
- package/src/views/order-settings/pickup/PickUpSettingDialogContent.vue +0 -23
- package/src/views/order-settings/pos-status/PosOrderingStatus.spec.ts +207 -0
- package/src/views/order-settings/pos-status/PosOrderingStatus.vue +209 -0
- package/src/views/order-settings/pos-status/pos-status.spec.ts +103 -0
- package/src/views/order-settings/pos-status/pos-status.ts +86 -0
- package/src/views/order-settings/queue/QueueSetting.source.spec.ts +43 -0
- package/src/views/order-settings/queue/QueueSetting.vue +289 -15
- package/src/views/order-settings/queue/called-message.spec.ts +29 -1
- package/src/views/order-settings/queue/called-message.ts +18 -0
- package/src/views/order-settings/queue/phone-join-mode.spec.ts +90 -0
- package/src/views/order-settings/queue/phone-join-mode.ts +49 -0
- package/dist/FoodCourtOrdersView-CAPOycT3.js +0 -544
- package/dist/KioskDevicesView-B0U9JxRl.js +0 -4
- package/dist/KioskDevicesView.vue_vue_type_script_setup_true_lang-V3ai4FVI.js +0 -937
- package/dist/KioskSettingView-rdom_aS8.js +0 -880
- package/dist/KioskView-DOON9zR6.js +0 -516
- package/dist/frontend/mf-order/src/views/kiosk/settings/KioskDisplayStandSection.vue.d.ts +0 -10
- package/dist/frontend/mf-order/src/views/kiosk/settings/KioskInstructionSection.vue.d.ts +0 -15
- package/dist/frontend/mf-order/src/views/kiosk/settings/KioskPickAtCounterSection.vue.d.ts +0 -10
- package/dist/index-CaHG3M7C.js +0 -135
- package/src/views/kiosk/settings/KioskDisplayStandSection.vue +0 -189
- package/src/views/kiosk/settings/KioskInstructionSection.vue +0 -40
- package/src/views/kiosk/settings/KioskPickAtCounterSection.vue +0 -68
|
@@ -1,422 +1,650 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
2
|
+
<div
|
|
3
|
+
v-if="!!kioskOrderSettingForm"
|
|
4
|
+
ref="formRoot"
|
|
5
|
+
class="flex flex-row gap-32 xs:flex-col xs:gap-16"
|
|
6
|
+
:style="{ paddingBottom: `${saveBarSpace}px` }"
|
|
7
|
+
>
|
|
8
|
+
<!--
|
|
9
|
+
One section at a time: a section menu on the left (a row of buttons on
|
|
10
|
+
phones), so the merchant scrolls one short section instead of the whole
|
|
11
|
+
form. Each section says whether tablets use it. Every section stays mounted
|
|
12
|
+
(v-show), so edits in a hidden section are kept and saved with the rest.
|
|
13
|
+
-->
|
|
14
|
+
<nav :aria-label="t('order.settingsSectionsLabel')" class="w-[200px] shrink-0 xs:w-full">
|
|
15
|
+
<div
|
|
16
|
+
role="tablist"
|
|
17
|
+
aria-orientation="vertical"
|
|
18
|
+
class="flex flex-col gap-4 xs:flex-row xs:flex-wrap xs:gap-8"
|
|
19
|
+
>
|
|
20
|
+
<button
|
|
21
|
+
v-for="section in sections"
|
|
22
|
+
:id="`kiosk-settings-tab-${section}`"
|
|
23
|
+
:key="section"
|
|
24
|
+
type="button"
|
|
25
|
+
role="tab"
|
|
26
|
+
:aria-selected="activeSection === section"
|
|
27
|
+
:aria-controls="`kiosk-settings-panel-${section}`"
|
|
28
|
+
class="flex flex-row items-center justify-between gap-8 px-12 py-8 fm-corner-radius-md text-left whitespace-nowrap fm-typo-en-body-md-600 transition-colors"
|
|
29
|
+
:class="
|
|
30
|
+
activeSection === section
|
|
31
|
+
? 'bg-fm-color-neutral-gray-100 text-fm-color-typo-primary'
|
|
32
|
+
: 'text-fm-color-typo-secondary hover:bg-fm-color-neutral-gray-100'
|
|
33
|
+
"
|
|
34
|
+
@click="activeSection = section"
|
|
35
|
+
>
|
|
36
|
+
<span>{{ t(SECTION_TEXT[section].title) }}</span>
|
|
37
|
+
<FmIcon
|
|
38
|
+
v-if="invalidSections.includes(section)"
|
|
39
|
+
name="error"
|
|
40
|
+
size="sm"
|
|
41
|
+
color="system-error-300"
|
|
42
|
+
:aria-label="t('order.settingsSectionError')"
|
|
43
|
+
/>
|
|
44
|
+
</button>
|
|
15
45
|
</div>
|
|
16
|
-
</
|
|
46
|
+
</nav>
|
|
47
|
+
|
|
48
|
+
<div class="flex-1 min-w-0 max-w-[720px]">
|
|
49
|
+
<!-- Ordering: kiosks and tablets; the dine-in modes and order number are kiosk only -->
|
|
50
|
+
<section
|
|
51
|
+
v-show="activeSection === 'ordering'"
|
|
52
|
+
id="kiosk-settings-panel-ordering"
|
|
53
|
+
role="tabpanel"
|
|
54
|
+
aria-labelledby="kiosk-settings-tab-ordering"
|
|
55
|
+
class="flex flex-col gap-32"
|
|
56
|
+
>
|
|
57
|
+
<div class="flex flex-col gap-4">
|
|
58
|
+
<h2 class="fm-typo-en-title-md-600">{{ t('order.settingsSectionOrdering') }}</h2>
|
|
59
|
+
<p class="fm-typo-en-body-md-400 text-fm-color-typo-secondary">
|
|
60
|
+
{{ t('order.settingsSectionOrderingHint') }}
|
|
61
|
+
</p>
|
|
62
|
+
</div>
|
|
63
|
+
<!-- Dine In Section -->
|
|
64
|
+
<div class="flex flex-col gap-8">
|
|
65
|
+
<span class="fm-typo-en-title-sm-600">{{ t('order.dineIn') }}</span>
|
|
66
|
+
<FmSwitch
|
|
67
|
+
v-model="kioskOrderSettingForm.dineIn.enabled"
|
|
68
|
+
:label="t('order.dineInSwitch')"
|
|
69
|
+
:sublabel="t('order.dineInSwitchHint')"
|
|
70
|
+
label-placement="right"
|
|
71
|
+
/>
|
|
72
|
+
<div v-show="kioskOrderSettingForm.dineIn.enabled" class="flex flex-col gap-16 pt-8">
|
|
73
|
+
<!-- Pick Up at Counter -->
|
|
74
|
+
<div class="flex flex-col gap-8">
|
|
75
|
+
<FmSwitch
|
|
76
|
+
v-model="kioskOrderSettingForm.dineIn.pickUp.enabled"
|
|
77
|
+
:label="t('order.pickAtCounter')"
|
|
78
|
+
label-placement="right"
|
|
79
|
+
/>
|
|
80
|
+
<div
|
|
81
|
+
v-show="kioskOrderSettingForm.dineIn.pickUp.enabled"
|
|
82
|
+
class="ml-[60px] xs:ml-0 flex flex-col gap-8"
|
|
83
|
+
>
|
|
84
|
+
<div class="flex flex-row flex-wrap items-center gap-x-8">
|
|
85
|
+
<FmButton
|
|
86
|
+
class="-ml-[12px]"
|
|
87
|
+
variant="tertiary"
|
|
88
|
+
size="md"
|
|
89
|
+
:label="t('order.customiseMessages')"
|
|
90
|
+
:append-icon="messagesOpen.pickUp ? 'expand_less' : 'expand_more'"
|
|
91
|
+
:aria-expanded="messagesOpen.pickUp"
|
|
92
|
+
@click="messagesOpen.pickUp = !messagesOpen.pickUp"
|
|
93
|
+
/>
|
|
94
|
+
<span class="fm-typo-en-body-sm-400 text-fm-color-typo-secondary">{{
|
|
95
|
+
hasCustomMessages(kioskOrderSettingForm.dineIn.pickUp.submitOrderInstruction)
|
|
96
|
+
? t('order.messagesCustom')
|
|
97
|
+
: t('order.messagesDefault')
|
|
98
|
+
}}</span>
|
|
99
|
+
</div>
|
|
100
|
+
<div
|
|
101
|
+
v-show="messagesOpen.pickUp"
|
|
102
|
+
class="border p-16 fm-corner-radius-lg flex flex-col gap-8"
|
|
103
|
+
>
|
|
104
|
+
<span class="fm-typo-en-body-md-600">{{ t('order.submitOrderInstruction') }}</span>
|
|
105
|
+
<FmTextField
|
|
106
|
+
v-model="kioskOrderSettingForm.dineIn.pickUp.submitOrderInstruction.payAtCounter"
|
|
107
|
+
:label="t('order.payAtCounter')"
|
|
108
|
+
:placeholder="'Collect your transaction slip below and present it to the cashier'"
|
|
109
|
+
/>
|
|
110
|
+
<FmTextField
|
|
111
|
+
v-model="kioskOrderSettingForm.dineIn.pickUp.submitOrderInstruction.paid"
|
|
112
|
+
:label="t('order.paid')"
|
|
113
|
+
:placeholder="'Please wait as we prepare your food. We\'ll call your number when it\'s ready.'"
|
|
114
|
+
/>
|
|
115
|
+
</div>
|
|
116
|
+
</div>
|
|
117
|
+
</div>
|
|
17
118
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
119
|
+
<!-- Display Stand -->
|
|
120
|
+
<div class="flex flex-col gap-8">
|
|
121
|
+
<FmSwitch
|
|
122
|
+
v-model="kioskOrderSettingForm.dineIn.displayStand.enabled"
|
|
123
|
+
:label="t('order.displayStand')"
|
|
124
|
+
label-placement="right"
|
|
125
|
+
/>
|
|
126
|
+
<div
|
|
127
|
+
v-show="kioskOrderSettingForm.dineIn.displayStand.enabled"
|
|
128
|
+
class="ml-[60px] xs:ml-0 flex flex-col gap-8"
|
|
129
|
+
>
|
|
130
|
+
<span class="fm-typo-en-body-md-600">{{ t('order.tableServiceSetting') }}</span>
|
|
131
|
+
<!-- The table numbers on one row: prefix, first, last, digits -->
|
|
132
|
+
<div class="grid grid-cols-4 gap-12 xs:grid-cols-2">
|
|
133
|
+
<FmTextField
|
|
134
|
+
v-model="kioskOrderSettingForm.dineIn.displayStand.prefix"
|
|
135
|
+
:label="t('order.prefix')"
|
|
136
|
+
:placeholder="t('order.prefix')"
|
|
137
|
+
/>
|
|
138
|
+
<FmStepperField
|
|
139
|
+
v-model="kioskOrderSettingForm.dineIn.displayStand.standSlotRange.min"
|
|
140
|
+
:label="t('order.start')"
|
|
141
|
+
labelMark="required"
|
|
142
|
+
:rules="minRules"
|
|
143
|
+
:placeholder="t('order.enterANumber')"
|
|
144
|
+
/>
|
|
145
|
+
<FmStepperField
|
|
146
|
+
v-model="kioskOrderSettingForm.dineIn.displayStand.standSlotRange.max"
|
|
147
|
+
:label="t('order.end')"
|
|
148
|
+
labelMark="required"
|
|
149
|
+
:rules="maxRules"
|
|
150
|
+
:placeholder="t('order.enterANumber')"
|
|
151
|
+
/>
|
|
152
|
+
<FmStepperField
|
|
153
|
+
v-model="kioskOrderSettingForm.dineIn.displayStand.padDigit"
|
|
154
|
+
:label="t('order.padDigit')"
|
|
155
|
+
labelMark="required"
|
|
156
|
+
:rules="padDigitRules"
|
|
157
|
+
:placeholder="t('order.padDigit')"
|
|
158
|
+
/>
|
|
159
|
+
</div>
|
|
160
|
+
<div class="flex flex-row flex-wrap items-center gap-x-8">
|
|
161
|
+
<FmButton
|
|
162
|
+
class="-ml-[12px]"
|
|
163
|
+
variant="tertiary"
|
|
164
|
+
size="md"
|
|
165
|
+
:label="t('order.customiseMessages')"
|
|
166
|
+
:append-icon="messagesOpen.displayStand ? 'expand_less' : 'expand_more'"
|
|
167
|
+
:aria-expanded="messagesOpen.displayStand"
|
|
168
|
+
@click="messagesOpen.displayStand = !messagesOpen.displayStand"
|
|
169
|
+
/>
|
|
170
|
+
<span class="fm-typo-en-body-sm-400 text-fm-color-typo-secondary">{{
|
|
171
|
+
hasCustomMessages(kioskOrderSettingForm.dineIn.displayStand.submitOrderInstruction)
|
|
172
|
+
? t('order.messagesCustom')
|
|
173
|
+
: t('order.messagesDefault')
|
|
174
|
+
}}</span>
|
|
175
|
+
</div>
|
|
176
|
+
<div
|
|
177
|
+
v-show="messagesOpen.displayStand"
|
|
178
|
+
class="border p-16 fm-corner-radius-lg flex flex-col gap-8"
|
|
179
|
+
>
|
|
180
|
+
<span class="fm-typo-en-body-md-600">{{ t('order.submitOrderInstruction') }}</span>
|
|
181
|
+
<FmTextField
|
|
182
|
+
v-model="
|
|
183
|
+
kioskOrderSettingForm.dineIn.displayStand.submitOrderInstruction.payAtCounter
|
|
184
|
+
"
|
|
185
|
+
:label="t('order.payAtCounter')"
|
|
186
|
+
:placeholder="'Collect your transaction slip below and present it to the cashier'"
|
|
187
|
+
/>
|
|
188
|
+
<FmTextField
|
|
189
|
+
v-model="kioskOrderSettingForm.dineIn.displayStand.submitOrderInstruction.paid"
|
|
190
|
+
:label="t('order.paid')"
|
|
191
|
+
:placeholder="'Please collect your receipt and we\'ll bring your food to your table once it\'s ready.'"
|
|
192
|
+
/>
|
|
193
|
+
</div>
|
|
194
|
+
</div>
|
|
195
|
+
</div>
|
|
196
|
+
</div>
|
|
197
|
+
</div>
|
|
198
|
+
<!-- Takeaway Section -->
|
|
199
|
+
<div class="flex flex-col gap-8">
|
|
200
|
+
<span class="fm-typo-en-title-sm-600">{{ t('order.takeawayTitle') }}</span>
|
|
201
|
+
<FmSwitch
|
|
202
|
+
v-model="kioskOrderSettingForm.takeaway.enabled"
|
|
203
|
+
:label="t('order.takeawaySwitch')"
|
|
204
|
+
label-placement="right"
|
|
205
|
+
/>
|
|
206
|
+
<div
|
|
207
|
+
v-show="kioskOrderSettingForm.takeaway.enabled"
|
|
208
|
+
class="ml-[60px] xs:ml-0 flex flex-col gap-8"
|
|
209
|
+
>
|
|
210
|
+
<div class="flex flex-row flex-wrap items-center gap-x-8">
|
|
211
|
+
<FmButton
|
|
212
|
+
class="-ml-[12px]"
|
|
213
|
+
variant="tertiary"
|
|
214
|
+
size="md"
|
|
215
|
+
:label="t('order.customiseMessages')"
|
|
216
|
+
:append-icon="messagesOpen.takeaway ? 'expand_less' : 'expand_more'"
|
|
217
|
+
:aria-expanded="messagesOpen.takeaway"
|
|
218
|
+
@click="messagesOpen.takeaway = !messagesOpen.takeaway"
|
|
219
|
+
/>
|
|
220
|
+
<span class="fm-typo-en-body-sm-400 text-fm-color-typo-secondary">{{
|
|
221
|
+
hasCustomMessages(kioskOrderSettingForm.takeaway.submitOrderInstruction)
|
|
222
|
+
? t('order.messagesCustom')
|
|
223
|
+
: t('order.messagesDefault')
|
|
224
|
+
}}</span>
|
|
225
|
+
</div>
|
|
35
226
|
<div
|
|
36
|
-
v-show="
|
|
37
|
-
class="border p-
|
|
227
|
+
v-show="messagesOpen.takeaway"
|
|
228
|
+
class="border p-16 fm-corner-radius-lg flex flex-col gap-8"
|
|
38
229
|
>
|
|
39
|
-
<span class="fm-typo-en-
|
|
230
|
+
<span class="fm-typo-en-body-md-600">{{ t('order.submitOrderInstruction') }}</span>
|
|
40
231
|
<FmTextField
|
|
41
|
-
v-model="kioskOrderSettingForm.
|
|
232
|
+
v-model="kioskOrderSettingForm.takeaway.submitOrderInstruction.payAtCounter"
|
|
42
233
|
:label="t('order.payAtCounter')"
|
|
43
234
|
:placeholder="'Collect your transaction slip below and present it to the cashier'"
|
|
44
235
|
/>
|
|
45
236
|
<FmTextField
|
|
46
|
-
v-model="kioskOrderSettingForm.
|
|
237
|
+
v-model="kioskOrderSettingForm.takeaway.submitOrderInstruction.paid"
|
|
47
238
|
:label="t('order.paid')"
|
|
48
239
|
:placeholder="'Please wait as we prepare your food. We\'ll call your number when it\'s ready.'"
|
|
49
240
|
/>
|
|
50
241
|
</div>
|
|
51
242
|
</div>
|
|
52
|
-
|
|
53
|
-
|
|
243
|
+
</div>
|
|
244
|
+
<!-- Kiosk order number (KDI-5264) -->
|
|
245
|
+
<div class="flex flex-col gap-8">
|
|
246
|
+
<span class="fm-typo-en-title-sm-600">{{ t('order.kioskOrderNumber') }}</span>
|
|
247
|
+
<FmTextField
|
|
248
|
+
v-model="kioskOrderSettingForm.dineIn.sequenceNumber.prefix"
|
|
249
|
+
class="max-w-[360px]"
|
|
250
|
+
:label="t('order.kioskOrderNumberPrefix')"
|
|
251
|
+
:placeholder="'#K'"
|
|
252
|
+
:helper-text="t('order.kioskOrderNumberHint')"
|
|
253
|
+
/>
|
|
254
|
+
<!-- Kiosk takeaway counts on the kiosk number instead of the takeaway (#TA) one. Every
|
|
255
|
+
other takeaway keeps #TA, so the switch changes nothing outside the kiosk. -->
|
|
256
|
+
<FmSwitch
|
|
257
|
+
v-model="kioskOrderSettingForm.shareNumber"
|
|
258
|
+
:label="t('order.kioskShareNumber')"
|
|
259
|
+
:sublabel="t('order.kioskShareNumberSublabel')"
|
|
260
|
+
label-placement="right"
|
|
261
|
+
/>
|
|
262
|
+
</div>
|
|
263
|
+
<!-- Display Pax Dialog Section -->
|
|
264
|
+
<div class="flex flex-col gap-8">
|
|
265
|
+
<span class="fm-typo-en-title-sm-600">{{ t('order.displayPaxDialogTitle') }}</span>
|
|
266
|
+
<FmSwitch
|
|
267
|
+
v-model="enablePaxDialog"
|
|
268
|
+
:label="t('order.displayPaxDialogDescription')"
|
|
269
|
+
:sublabel="t('order.paxDialogTabletNote')"
|
|
270
|
+
label-placement="right"
|
|
271
|
+
/>
|
|
272
|
+
</div>
|
|
273
|
+
<!-- Menu Item Section -->
|
|
274
|
+
<div class="flex flex-col gap-8">
|
|
275
|
+
<span class="fm-typo-en-title-sm-600">{{ t('order.menuItem') }}</span>
|
|
276
|
+
<FmSwitch
|
|
277
|
+
v-model="kioskOrderSettingForm.menuItem.showAllOnly"
|
|
278
|
+
:label="t('order.showNotAvailableMenuItem')"
|
|
279
|
+
label-placement="right"
|
|
280
|
+
/>
|
|
281
|
+
</div>
|
|
282
|
+
<!-- Weighing scale: minimum weight (KDI-5138) -->
|
|
283
|
+
<div class="flex flex-col gap-8">
|
|
284
|
+
<span class="fm-typo-en-title-sm-600">{{ t('order.minWeighGrams') }}</span>
|
|
54
285
|
<div>
|
|
55
|
-
<
|
|
56
|
-
v-model="
|
|
57
|
-
|
|
58
|
-
label
|
|
286
|
+
<FmStepperField
|
|
287
|
+
v-model="minWeighGrams"
|
|
288
|
+
class="max-w-[240px]"
|
|
289
|
+
:label="t('order.minWeighGramsLabel')"
|
|
290
|
+
:min="1"
|
|
291
|
+
:max="MAX_MIN_WEIGH_GRAMS"
|
|
292
|
+
:placeholder="t('order.minWeighGramsPlaceholder')"
|
|
59
293
|
/>
|
|
294
|
+
<span class="fm-typo-en-body-sm-400 text-fm-color-typo-secondary">{{
|
|
295
|
+
t('order.minWeighGramsHint')
|
|
296
|
+
}}</span>
|
|
297
|
+
</div>
|
|
298
|
+
</div>
|
|
299
|
+
</section>
|
|
300
|
+
|
|
301
|
+
<!-- Look and photos: kiosks and tablets -->
|
|
302
|
+
<section
|
|
303
|
+
v-show="activeSection === 'look'"
|
|
304
|
+
id="kiosk-settings-panel-look"
|
|
305
|
+
role="tabpanel"
|
|
306
|
+
aria-labelledby="kiosk-settings-tab-look"
|
|
307
|
+
class="flex flex-col gap-32"
|
|
308
|
+
>
|
|
309
|
+
<div class="flex flex-col gap-4">
|
|
310
|
+
<h2 class="fm-typo-en-title-md-600">{{ t('order.settingsSectionLook') }}</h2>
|
|
311
|
+
<p class="fm-typo-en-body-md-400 text-fm-color-typo-secondary">
|
|
312
|
+
{{ t('order.settingsSectionLookHint') }}
|
|
313
|
+
</p>
|
|
314
|
+
</div>
|
|
315
|
+
<!-- Language Section -->
|
|
316
|
+
<div class="flex flex-col gap-8">
|
|
317
|
+
<span class="fm-typo-en-title-sm-600">{{ t('order.kioskLanguage') }}</span>
|
|
318
|
+
<span class="fm-typo-en-body-sm-400 text-fm-color-typo-secondary">
|
|
319
|
+
{{ t('order.kioskLanguageHint') }}
|
|
320
|
+
</span>
|
|
321
|
+
<FmSwitch
|
|
322
|
+
:model-value="restrictLanguages"
|
|
323
|
+
:label="t('order.kioskLanguageRestrict')"
|
|
324
|
+
:sublabel="t('order.kioskLanguageRestrictSublabel')"
|
|
325
|
+
label-placement="right"
|
|
326
|
+
@update:model-value="onRestrictLanguagesChange"
|
|
327
|
+
/>
|
|
328
|
+
<div v-show="restrictLanguages" class="ml-[60px] xs:ml-0 grid grid-cols-2 xs:grid-cols-1 gap-8">
|
|
329
|
+
<FmCheckbox
|
|
330
|
+
v-for="option in languageOptions"
|
|
331
|
+
:key="option.code"
|
|
332
|
+
:model-value="selectedLanguages.includes(option.code)"
|
|
333
|
+
:value="option.code"
|
|
334
|
+
:label="option.label"
|
|
335
|
+
@update:model-value="(v: boolean) => toggleLanguage(option.code, v)"
|
|
336
|
+
/>
|
|
337
|
+
</div>
|
|
338
|
+
<span
|
|
339
|
+
v-if="restrictLanguages && selectedLanguages.length === 0"
|
|
340
|
+
class="ml-[60px] xs:ml-0 fm-typo-en-body-sm-400 text-fm-color-system-error-300"
|
|
341
|
+
>
|
|
342
|
+
{{ t('order.kioskLanguageAtLeastOne') }}
|
|
343
|
+
</span>
|
|
344
|
+
</div>
|
|
345
|
+
<!--
|
|
346
|
+
Cover images: small previews here, the full editor in a dialog (it is
|
|
347
|
+
as tall as two screens). The dialog edits the same draft, so its
|
|
348
|
+
changes are saved with Save settings like every other field.
|
|
349
|
+
-->
|
|
350
|
+
<div class="flex flex-col gap-8">
|
|
351
|
+
<span class="fm-typo-en-title-sm-600">{{ t('order.coverImage') }}</span>
|
|
352
|
+
<span class="fm-typo-en-body-sm-400 text-fm-color-typo-secondary">{{
|
|
353
|
+
t('order.coverImageFallbackHint')
|
|
354
|
+
}}</span>
|
|
355
|
+
<div class="flex flex-row flex-wrap items-end gap-24 pt-4">
|
|
60
356
|
<div
|
|
61
|
-
v-
|
|
62
|
-
|
|
357
|
+
v-for="orientation in COVER_ORIENTATIONS"
|
|
358
|
+
:key="`cover-preview-${orientation.value}`"
|
|
359
|
+
class="flex flex-col gap-8"
|
|
63
360
|
>
|
|
64
|
-
<span class="fm-typo-en-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
:
|
|
77
|
-
:
|
|
361
|
+
<span class="fm-typo-en-body-sm-600">
|
|
362
|
+
{{ t(orientation.labelKey) }} ·
|
|
363
|
+
{{
|
|
364
|
+
t('order.coverImageCount', {
|
|
365
|
+
count: coverImages(orientation.value).length,
|
|
366
|
+
max: MAX_COVER_IMAGES
|
|
367
|
+
})
|
|
368
|
+
}}
|
|
369
|
+
</span>
|
|
370
|
+
<div class="flex flex-row gap-4">
|
|
371
|
+
<img
|
|
372
|
+
v-for="(image, index) in coverImages(orientation.value).slice(0, 4)"
|
|
373
|
+
:key="`cover-preview-${orientation.value}-${index}`"
|
|
374
|
+
:src="image"
|
|
375
|
+
:alt="`${t(orientation.labelKey)} ${index + 1}`"
|
|
376
|
+
:class="[orientation.thumbClass, 'object-cover rounded-md border border-fm-color-neutral-gray-200']"
|
|
78
377
|
/>
|
|
79
|
-
<
|
|
80
|
-
v-
|
|
81
|
-
|
|
82
|
-
:label="t('order.
|
|
83
|
-
|
|
84
|
-
:rules="maxRules"
|
|
85
|
-
:placeholder="t('order.enterANumber')"
|
|
378
|
+
<div
|
|
379
|
+
v-if="coverImages(orientation.value).length === 0"
|
|
380
|
+
role="img"
|
|
381
|
+
:aria-label="t('order.coverNoImage')"
|
|
382
|
+
:class="[orientation.thumbClass, 'rounded-md border border-dashed border-fm-color-neutral-gray-400']"
|
|
86
383
|
/>
|
|
87
384
|
</div>
|
|
88
|
-
<FmStepperField
|
|
89
|
-
v-model="kioskOrderSettingForm.dineIn.displayStand.padDigit"
|
|
90
|
-
:label="t('order.padDigit')"
|
|
91
|
-
labelMark="required"
|
|
92
|
-
:rules="padDigitRules"
|
|
93
|
-
:placeholder="t('order.padDigit')"
|
|
94
|
-
/>
|
|
95
|
-
</div>
|
|
96
|
-
|
|
97
|
-
<div
|
|
98
|
-
v-show="kioskOrderSettingForm.dineIn.displayStand.enabled"
|
|
99
|
-
class="border p-[1.5rem] fm-corner-radius-lg flex flex-col gap-2 my-5 w-11/12"
|
|
100
|
-
>
|
|
101
|
-
<span class="fm-typo-en-title-sm-600">{{ t('order.submitOrderInstruction') }}</span>
|
|
102
|
-
<FmTextField
|
|
103
|
-
v-model="
|
|
104
|
-
kioskOrderSettingForm.dineIn.displayStand.submitOrderInstruction.payAtCounter
|
|
105
|
-
"
|
|
106
|
-
:label="t('order.payAtCounter')"
|
|
107
|
-
:placeholder="'Collect your transaction slip below and present it to the cashier'"
|
|
108
|
-
/>
|
|
109
|
-
<FmTextField
|
|
110
|
-
v-model="kioskOrderSettingForm.dineIn.displayStand.submitOrderInstruction.paid"
|
|
111
|
-
:label="t('order.paid')"
|
|
112
|
-
:placeholder="'Please collect your receipt and we\'ll bring your food to your table once it\'s ready.'"
|
|
113
|
-
/>
|
|
114
385
|
</div>
|
|
386
|
+
<FmButton
|
|
387
|
+
variant="secondary"
|
|
388
|
+
size="md"
|
|
389
|
+
prepend-icon="edit"
|
|
390
|
+
:label="t('order.changeCovers')"
|
|
391
|
+
@click="coverDialogOpen = true"
|
|
392
|
+
/>
|
|
115
393
|
</div>
|
|
116
394
|
</div>
|
|
117
|
-
</
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
label-placement="right"
|
|
127
|
-
class="mb-5"
|
|
128
|
-
/>
|
|
129
|
-
<div
|
|
130
|
-
v-show="kioskOrderSettingForm.takeaway.enabled"
|
|
131
|
-
class="border p-[1.5rem] fm-corner-radius-lg flex flex-col gap-2 my-5 w-11/12"
|
|
395
|
+
</section>
|
|
396
|
+
|
|
397
|
+
<!-- Payment: kiosk only -->
|
|
398
|
+
<section
|
|
399
|
+
v-show="activeSection === 'payment'"
|
|
400
|
+
id="kiosk-settings-panel-payment"
|
|
401
|
+
role="tabpanel"
|
|
402
|
+
aria-labelledby="kiosk-settings-tab-payment"
|
|
403
|
+
class="flex flex-col gap-32"
|
|
132
404
|
>
|
|
133
|
-
<
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
<
|
|
140
|
-
|
|
141
|
-
:
|
|
142
|
-
:
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
<FmTextField
|
|
152
|
-
v-model="kioskOrderSettingForm.dineIn.sequenceNumber.prefix"
|
|
153
|
-
:label="t('order.kioskOrderNumberPrefix')"
|
|
154
|
-
:placeholder="'#K'"
|
|
155
|
-
:helper-text="t('order.kioskOrderNumberHint')"
|
|
156
|
-
/>
|
|
157
|
-
<!-- Kiosk takeaway counts on the kiosk number instead of the takeaway (#TA) one. Every
|
|
158
|
-
other takeaway keeps #TA, so the switch changes nothing outside the kiosk. -->
|
|
159
|
-
<FmSwitch
|
|
160
|
-
v-model="kioskOrderSettingForm.shareNumber"
|
|
161
|
-
:label="t('order.kioskShareNumber')"
|
|
162
|
-
:sublabel="t('order.kioskShareNumberSublabel')"
|
|
163
|
-
label-placement="right"
|
|
164
|
-
/>
|
|
165
|
-
</div>
|
|
166
|
-
</div>
|
|
167
|
-
|
|
168
|
-
<!-- Menu Item Section -->
|
|
169
|
-
<div class="flex flex-col gap-2">
|
|
170
|
-
<span class="fm-typo-en-title-sm-600">{{ t('order.menuItem') }}</span>
|
|
171
|
-
<FmSwitch
|
|
172
|
-
v-model="kioskOrderSettingForm.menuItem.showAllOnly"
|
|
173
|
-
:label="t('order.showNotAvailableMenuItem')"
|
|
174
|
-
label-placement="right"
|
|
175
|
-
class="mb-5"
|
|
176
|
-
/>
|
|
177
|
-
</div>
|
|
178
|
-
|
|
179
|
-
<!-- Language Section -->
|
|
180
|
-
<div class="flex flex-col gap-2">
|
|
181
|
-
<span class="fm-typo-en-title-sm-600">{{ t('order.kioskLanguage') }}</span>
|
|
182
|
-
<span class="fm-typo-en-body-sm-400 text-fm-color-typo-secondary">
|
|
183
|
-
{{ t('order.kioskLanguageHint') }}
|
|
184
|
-
</span>
|
|
185
|
-
<div class="border p-[1.5rem] fm-corner-radius-lg flex flex-col gap-4 my-5 w-11/12">
|
|
186
|
-
<FmSwitch
|
|
187
|
-
:model-value="restrictLanguages"
|
|
188
|
-
:label="t('order.kioskLanguageRestrict')"
|
|
189
|
-
:sublabel="t('order.kioskLanguageRestrictSublabel')"
|
|
190
|
-
label-placement="right"
|
|
191
|
-
@update:model-value="onRestrictLanguagesChange"
|
|
405
|
+
<div class="flex flex-col gap-4">
|
|
406
|
+
<h2 class="fm-typo-en-title-md-600">{{ t('order.settingsSectionPayment') }}</h2>
|
|
407
|
+
<p class="fm-typo-en-body-md-400 text-fm-color-typo-secondary">
|
|
408
|
+
{{ t('order.settingsSectionPaymentHint') }}
|
|
409
|
+
</p>
|
|
410
|
+
</div>
|
|
411
|
+
<KioskPaymentTypeSection
|
|
412
|
+
:payment-types="(kioskOrderSettingForm.paymentSetting.paymentTypes as _F_ORDER_PAYMENT_TYPE[]) ?? []"
|
|
413
|
+
:allow-credit="true"
|
|
414
|
+
:allow-e-payment="allowEPayment"
|
|
415
|
+
:offline-payment-types="kioskOrderSettingForm.paymentSetting.offlinePaymentTypes ?? []"
|
|
416
|
+
:ePaymentTypes="kioskOrderSettingForm.paymentSetting.ePaymentTypes ?? {}"
|
|
417
|
+
@update:payment-types="updatePaymentSetting"
|
|
418
|
+
@update:offline-payment-types="
|
|
419
|
+
(v: FdoOfflinePaymentMethod[]) =>
|
|
420
|
+
(kioskOrderSettingForm.paymentSetting.offlinePaymentTypes = v)
|
|
421
|
+
"
|
|
422
|
+
@update:ePaymentTypes="updateEPaymentSetting"
|
|
192
423
|
/>
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
424
|
+
<!-- Order Setting Section -->
|
|
425
|
+
<!--
|
|
426
|
+
Hidden for now: kiosk auto-close should not override the order-type
|
|
427
|
+
(dine-in) setting yet. The form still round-trips whatever is saved:
|
|
428
|
+
unset fields stay null so the backend keeps inheriting dineInSettings,
|
|
429
|
+
and an already-set value is sent back unchanged. Flip v-if back to true
|
|
430
|
+
to expose it again.
|
|
431
|
+
-->
|
|
432
|
+
<div v-if="false" class="flex flex-col gap-2">
|
|
433
|
+
<span class="fm-typo-en-title-sm-600">{{ t('order.orderSetting') }}</span>
|
|
434
|
+
<div class="flex flex-col gap-5">
|
|
435
|
+
<FmSwitch
|
|
436
|
+
:model-value="kioskOrderSettingForm.autoCloseBill ?? false"
|
|
437
|
+
:label="t('order.autoCloseBill')"
|
|
438
|
+
:sublabel="t('order.autoCloseBillSublabel')"
|
|
439
|
+
label-placement="right"
|
|
440
|
+
@update:model-value="onAutoCloseBillChange"
|
|
441
|
+
/>
|
|
442
|
+
<FmSwitch
|
|
443
|
+
v-show="kioskOrderSettingForm.autoCloseBill"
|
|
444
|
+
:model-value="kioskOrderSettingForm.printReceiptAfterClose ?? true"
|
|
445
|
+
@update:model-value="(v: boolean) => (kioskOrderSettingForm.printReceiptAfterClose = v)"
|
|
446
|
+
:label="t('order.printReceiptAfterClose')"
|
|
447
|
+
:sublabel="t('order.printReceiptAfterCloseSublabel')"
|
|
448
|
+
label-placement="right"
|
|
449
|
+
/>
|
|
450
|
+
</div>
|
|
451
|
+
</div>
|
|
452
|
+
</section>
|
|
453
|
+
|
|
454
|
+
<!-- Updates: admins only -->
|
|
455
|
+
<section
|
|
456
|
+
v-if="isAdmin"
|
|
457
|
+
v-show="activeSection === 'updates'"
|
|
458
|
+
id="kiosk-settings-panel-updates"
|
|
459
|
+
role="tabpanel"
|
|
460
|
+
aria-labelledby="kiosk-settings-tab-updates"
|
|
461
|
+
class="flex flex-col gap-32"
|
|
462
|
+
>
|
|
463
|
+
<div class="flex flex-col gap-4">
|
|
464
|
+
<h2 class="fm-typo-en-title-md-600">{{ t('order.settingsSectionUpdates') }}</h2>
|
|
465
|
+
<p class="fm-typo-en-body-md-400 text-fm-color-typo-secondary">
|
|
466
|
+
{{ t('order.settingsSectionUpdatesHint') }}
|
|
467
|
+
</p>
|
|
468
|
+
</div>
|
|
469
|
+
<!-- OTA Channel Section -->
|
|
470
|
+
<div class="flex flex-col gap-4 max-w-[360px]">
|
|
471
|
+
<FmTextField
|
|
472
|
+
v-model="kioskOrderSettingForm.otaChannel"
|
|
473
|
+
:label="t('order.otaChannel')"
|
|
201
474
|
/>
|
|
475
|
+
<span class="fm-typo-en-body-sm-400 text-fm-color-typo-secondary">
|
|
476
|
+
{{ t('order.otaChannelHint') }}
|
|
477
|
+
</span>
|
|
202
478
|
</div>
|
|
203
|
-
|
|
204
|
-
v-if="restrictLanguages && selectedLanguages.length === 0"
|
|
205
|
-
class="fm-typo-en-body-sm-400 text-fm-color-system-error-300"
|
|
206
|
-
>
|
|
207
|
-
{{ t('order.kioskLanguageAtLeastOne') }}
|
|
208
|
-
</span>
|
|
209
|
-
</div>
|
|
479
|
+
</section>
|
|
210
480
|
</div>
|
|
211
481
|
|
|
212
482
|
<!--
|
|
213
|
-
Cover
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
into the two stored fields, so nothing here has to know that a
|
|
218
|
-
single-image merchant keeps writing `coverImage*` exactly as before.
|
|
483
|
+
Cover image editor. One ordered list per orientation, not one image: the
|
|
484
|
+
kiosk landing screen cross-fades between them. `coverCarousel.ts` is what
|
|
485
|
+
turns a list back into the two stored fields, so nothing here has to know
|
|
486
|
+
that a single-image merchant keeps writing `coverImage*` exactly as before.
|
|
219
487
|
-->
|
|
220
|
-
<
|
|
221
|
-
<
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
}}</span>
|
|
228
|
-
|
|
229
|
-
<div
|
|
230
|
-
v-for="orientation in COVER_ORIENTATIONS"
|
|
231
|
-
:key="orientation.value"
|
|
232
|
-
class="border p-[1.5rem] fm-corner-radius-lg flex flex-col gap-4 my-5 w-11/12"
|
|
233
|
-
>
|
|
234
|
-
<span class="fm-typo-en-body-md-600">{{ t(orientation.labelKey) }}</span>
|
|
488
|
+
<FmDialog v-model="coverDialogOpen" :max-width="800">
|
|
489
|
+
<template #dialog-header>
|
|
490
|
+
<div class="fm-typo-en-title-sm-600 text-fm-color-typo-primary">
|
|
491
|
+
{{ t('order.coverImage') }}
|
|
492
|
+
</div>
|
|
493
|
+
</template>
|
|
494
|
+
<div class="flex flex-col gap-16">
|
|
235
495
|
<span class="fm-typo-en-body-sm-400 text-fm-color-typo-secondary">{{
|
|
236
|
-
t(
|
|
496
|
+
t('order.coverCarouselHint', { max: MAX_COVER_IMAGES })
|
|
237
497
|
}}</span>
|
|
498
|
+
<div
|
|
499
|
+
v-for="orientation in COVER_ORIENTATIONS"
|
|
500
|
+
:key="orientation.value"
|
|
501
|
+
class="border p-16 fm-corner-radius-lg flex flex-col gap-8"
|
|
502
|
+
>
|
|
503
|
+
<span class="fm-typo-en-body-md-600">{{ t(orientation.labelKey) }}</span>
|
|
504
|
+
<span class="fm-typo-en-body-sm-400 text-fm-color-typo-secondary">{{
|
|
505
|
+
t(orientation.hintKey)
|
|
506
|
+
}}</span>
|
|
238
507
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
/>
|
|
508
|
+
<div class="flex flex-wrap items-start gap-8">
|
|
509
|
+
<div
|
|
510
|
+
v-for="(image, index) in coverImages(orientation.value)"
|
|
511
|
+
:key="`${orientation.value}-${index}-${image}`"
|
|
512
|
+
class="flex flex-col gap-2"
|
|
513
|
+
>
|
|
514
|
+
<div class="relative">
|
|
515
|
+
<img
|
|
516
|
+
:src="image"
|
|
517
|
+
:alt="`${t(orientation.labelKey)} ${index + 1}`"
|
|
518
|
+
:class="[
|
|
519
|
+
orientation.previewClass,
|
|
520
|
+
'object-cover rounded-md border border-fm-color-neutral-gray-200'
|
|
521
|
+
]"
|
|
522
|
+
/>
|
|
523
|
+
<!--
|
|
524
|
+
The number is the point of the list: order is what the kiosk
|
|
525
|
+
fades through, and a wall of thumbnails does not show it.
|
|
526
|
+
|
|
527
|
+
`bg-fm-color-typo-primary`, not the neutral-gray-500 you would
|
|
528
|
+
expect: that token generates NOTHING in this app (measured
|
|
529
|
+
transparent), which left white text sitting on a photo.
|
|
530
|
+
-->
|
|
531
|
+
<span
|
|
532
|
+
class="absolute top-2 left-2 px-2 rounded-full bg-fm-color-typo-primary text-fm-color-neutral-white fm-typo-en-body-sm-400"
|
|
533
|
+
>
|
|
534
|
+
{{ index + 1 }}
|
|
535
|
+
</span>
|
|
536
|
+
</div>
|
|
537
|
+
<div class="flex items-center gap-1">
|
|
538
|
+
<FmButton
|
|
539
|
+
variant="tertiary"
|
|
540
|
+
size="md"
|
|
541
|
+
prepend-icon="arrow_back"
|
|
542
|
+
:disabled="index === 0"
|
|
543
|
+
:aria-label="t('order.coverCarouselMoveEarlier')"
|
|
544
|
+
@click="moveCoverImage(orientation.value, index, index - 1)"
|
|
545
|
+
/>
|
|
546
|
+
<FmButton
|
|
547
|
+
variant="tertiary"
|
|
548
|
+
size="md"
|
|
549
|
+
prepend-icon="arrow_forward"
|
|
550
|
+
:disabled="index === coverImages(orientation.value).length - 1"
|
|
551
|
+
:aria-label="t('order.coverCarouselMoveLater')"
|
|
552
|
+
@click="moveCoverImage(orientation.value, index, index + 1)"
|
|
553
|
+
/>
|
|
554
|
+
<FmButton
|
|
555
|
+
variant="tertiary"
|
|
556
|
+
size="md"
|
|
557
|
+
prepend-icon="delete"
|
|
558
|
+
:aria-label="t('common.delete')"
|
|
559
|
+
@click="removeCoverImage(orientation.value, index)"
|
|
560
|
+
/>
|
|
561
|
+
</div>
|
|
294
562
|
</div>
|
|
563
|
+
|
|
564
|
+
<FmDropField
|
|
565
|
+
v-if="coverImages(orientation.value).length < MAX_COVER_IMAGES"
|
|
566
|
+
accept="image/*"
|
|
567
|
+
:max-file-size="MAX_IMAGE_FILE_SIZE"
|
|
568
|
+
:content-class="orientation.dropClass"
|
|
569
|
+
@file-upload="addCoverImage(orientation.value, $event)"
|
|
570
|
+
@file-rejected="handleCoverImageRejected(orientation.value, $event)"
|
|
571
|
+
/>
|
|
295
572
|
</div>
|
|
573
|
+
</div>
|
|
296
574
|
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
575
|
+
<!--
|
|
576
|
+
Only worth showing once there is something to fade between — with a
|
|
577
|
+
single image the kiosk never starts its timer.
|
|
578
|
+
-->
|
|
579
|
+
<div v-if="hasCoverCarousel">
|
|
580
|
+
<FmStepperField
|
|
581
|
+
v-model="coverIntervalSeconds"
|
|
582
|
+
class="max-w-[240px]"
|
|
583
|
+
:label="t('order.coverCarouselInterval')"
|
|
584
|
+
:min="MIN_COVER_INTERVAL_SECONDS"
|
|
585
|
+
:max="MAX_COVER_INTERVAL_SECONDS"
|
|
586
|
+
:placeholder="String(DEFAULT_COVER_INTERVAL_SECONDS)"
|
|
304
587
|
/>
|
|
588
|
+
<span class="fm-typo-en-body-sm-400 text-fm-color-typo-secondary">{{
|
|
589
|
+
t('order.coverCarouselIntervalHint', { seconds: DEFAULT_COVER_INTERVAL_SECONDS })
|
|
590
|
+
}}</span>
|
|
305
591
|
</div>
|
|
306
592
|
</div>
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
:
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
t('order.minWeighGramsHint')
|
|
341
|
-
}}</span>
|
|
342
|
-
</div>
|
|
343
|
-
</div>
|
|
344
|
-
|
|
345
|
-
<!-- Display Pax Dialog Section -->
|
|
346
|
-
<div class="flex flex-col gap-2">
|
|
347
|
-
<span class="fm-typo-en-title-sm-600">{{ t('order.displayPaxDialogTitle') }}</span>
|
|
348
|
-
<FmSwitch
|
|
349
|
-
v-model="enablePaxDialog"
|
|
350
|
-
:label="t('order.displayPaxDialogDescription')"
|
|
351
|
-
label-placement="right"
|
|
352
|
-
class="mb-5"
|
|
353
|
-
/>
|
|
354
|
-
</div>
|
|
355
|
-
|
|
356
|
-
<!-- Order Setting Section -->
|
|
357
|
-
<!--
|
|
358
|
-
Hidden for now: kiosk auto-close should not override the order-type
|
|
359
|
-
(dine-in) setting yet. The form still round-trips whatever is saved:
|
|
360
|
-
unset fields stay null so the backend keeps inheriting dineInSettings,
|
|
361
|
-
and an already-set value is sent back unchanged. Flip v-if back to true
|
|
362
|
-
to expose it again.
|
|
363
|
-
-->
|
|
364
|
-
<div v-if="false" class="flex flex-col gap-2">
|
|
365
|
-
<span class="fm-typo-en-title-sm-600">{{ t('order.orderSetting') }}</span>
|
|
366
|
-
<div class="flex flex-col gap-5">
|
|
367
|
-
<FmSwitch
|
|
368
|
-
:model-value="kioskOrderSettingForm.autoCloseBill ?? false"
|
|
369
|
-
:label="t('order.autoCloseBill')"
|
|
370
|
-
:sublabel="t('order.autoCloseBillSublabel')"
|
|
371
|
-
label-placement="right"
|
|
372
|
-
@update:model-value="onAutoCloseBillChange"
|
|
593
|
+
<template #dialog-footer>
|
|
594
|
+
<div class="w-full flex flex-row items-center justify-between gap-12 xs:flex-col xs:items-stretch">
|
|
595
|
+
<span class="fm-typo-en-body-sm-400 text-fm-color-typo-secondary">{{
|
|
596
|
+
t('order.coverDialogNote')
|
|
597
|
+
}}</span>
|
|
598
|
+
<FmButton variant="primary" :label="t('order.done')" @click="coverDialogOpen = false" />
|
|
599
|
+
</div>
|
|
600
|
+
</template>
|
|
601
|
+
</FmDialog>
|
|
602
|
+
|
|
603
|
+
<!-- Save bar fixed to the bottom of the screen, as wide as this form: always in
|
|
604
|
+
reach, and it says when there are unsaved edits. Not `position: sticky`: in
|
|
605
|
+
the portal, mf-order's App.vue wrapper is an `overflow-auto` box that never
|
|
606
|
+
scrolls, so sticky has nothing to stick to. -->
|
|
607
|
+
<div
|
|
608
|
+
ref="saveBar"
|
|
609
|
+
class="fixed bottom-0 z-[1] px-24 py-12 bg-fm-color-neutral-white border-t border-fm-color-neutral-gray-200 flex flex-row items-center justify-between gap-12 xs:flex-col xs:items-stretch"
|
|
610
|
+
:style="saveBarStyle"
|
|
611
|
+
data-testid="kiosk-settings-save-bar"
|
|
612
|
+
>
|
|
613
|
+
<span
|
|
614
|
+
class="fm-typo-en-body-md-600"
|
|
615
|
+
:class="isDirty ? 'text-fm-color-typo-primary' : 'text-fm-color-typo-secondary'"
|
|
616
|
+
>
|
|
617
|
+
{{ isDirty ? t('order.unsavedChanges') : t('order.allChangesSaved') }}
|
|
618
|
+
</span>
|
|
619
|
+
<div class="flex flex-row gap-8">
|
|
620
|
+
<FmButton
|
|
621
|
+
class="xs:flex-1"
|
|
622
|
+
variant="tertiary"
|
|
623
|
+
:label="t('order.discardChanges')"
|
|
624
|
+
:disabled="!isDirty || saving"
|
|
625
|
+
@click="resetDraft"
|
|
373
626
|
/>
|
|
374
|
-
<
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
:
|
|
379
|
-
:
|
|
380
|
-
|
|
627
|
+
<FmButton
|
|
628
|
+
class="xs:flex-1"
|
|
629
|
+
variant="primary"
|
|
630
|
+
:label="t('order.updateSetting')"
|
|
631
|
+
:disabled="!isDirty || saving"
|
|
632
|
+
:loading="saving"
|
|
633
|
+
@click="submitForm"
|
|
381
634
|
/>
|
|
382
635
|
</div>
|
|
383
636
|
</div>
|
|
384
|
-
|
|
385
|
-
<!-- Payment Section -->
|
|
386
|
-
<div class="flex flex-col gap-2">
|
|
387
|
-
<KioskPaymentTypeSection
|
|
388
|
-
:payment-types="(kioskOrderSettingForm.paymentSetting.paymentTypes as _F_ORDER_PAYMENT_TYPE[]) ?? []"
|
|
389
|
-
:allow-credit="true"
|
|
390
|
-
:allow-e-payment="allowEPayment"
|
|
391
|
-
:offline-payment-types="kioskOrderSettingForm.paymentSetting.offlinePaymentTypes ?? []"
|
|
392
|
-
:ePaymentTypes="kioskOrderSettingForm.paymentSetting.ePaymentTypes ?? {}"
|
|
393
|
-
@update:payment-types="updatePaymentSetting"
|
|
394
|
-
@update:offline-payment-types="
|
|
395
|
-
(v: FdoOfflinePaymentMethod[]) =>
|
|
396
|
-
(kioskOrderSettingForm.paymentSetting.offlinePaymentTypes = v)
|
|
397
|
-
"
|
|
398
|
-
@update:ePaymentTypes="updateEPaymentSetting"
|
|
399
|
-
/>
|
|
400
|
-
</div>
|
|
401
|
-
|
|
402
|
-
<FmButton
|
|
403
|
-
class="w-1/4 mb-10"
|
|
404
|
-
variant="primary"
|
|
405
|
-
:label="t('order.updateSetting')"
|
|
406
|
-
:disabled="!validKioskOrderSetting"
|
|
407
|
-
@click="submitForm"
|
|
408
|
-
/>
|
|
409
637
|
</div>
|
|
410
638
|
<div v-else>
|
|
411
639
|
{{ t('order.pleaseSelectRestaurant') }}
|
|
412
640
|
</div>
|
|
413
641
|
</template>
|
|
414
642
|
<script setup lang="ts">
|
|
415
|
-
import { computed, ref, watch } from 'vue'
|
|
643
|
+
import { computed, nextTick, onBeforeUnmount, onMounted, reactive, ref, toRaw, watch } from 'vue'
|
|
416
644
|
import KioskPaymentTypeSection from './KioskPaymentTypeSection.vue'
|
|
417
645
|
import { useRestaurantStore } from '@/stores/restaurant'
|
|
418
646
|
import { FdoOfflinePaymentMethod, F_ORDER_PAYMENT_TYPE as _F_ORDER_PAYMENT_TYPE } from '@feedmepos/core/entity'
|
|
419
|
-
import { FdoEPaymentMethod
|
|
647
|
+
import { FdoEPaymentMethod } from '@entity'
|
|
420
648
|
import type {
|
|
421
649
|
MfKioskOrderSetting,
|
|
422
650
|
MfKioskOrderSettingForm,
|
|
@@ -442,27 +670,54 @@ import {
|
|
|
442
670
|
reorderCoverImages,
|
|
443
671
|
type CoverOrientation
|
|
444
672
|
} from '@/modules/order-setting/kiosk/coverCarousel'
|
|
673
|
+
import {
|
|
674
|
+
hasCustomMessages,
|
|
675
|
+
invalidSettingsSections,
|
|
676
|
+
MAX_MIN_WEIGH_GRAMS,
|
|
677
|
+
visibleSettingsSections,
|
|
678
|
+
type KioskSettingsSection
|
|
679
|
+
} from '@/modules/kiosk/settingsSections'
|
|
445
680
|
|
|
446
681
|
const { t } = useI18n()
|
|
447
682
|
const CoreStore = useCoreStore()
|
|
448
683
|
const isAdmin = computed(() => CoreStore.sessionUser.value?.role.isAdmin ?? false)
|
|
449
684
|
|
|
685
|
+
// One section at a time (see `settingsSections.ts`). The view is keyed per outlet,
|
|
686
|
+
// so a new outlet opens on Ordering.
|
|
687
|
+
const sections = computed(() => visibleSettingsSections(isAdmin.value))
|
|
688
|
+
const activeSection = ref<KioskSettingsSection>('ordering')
|
|
689
|
+
const SECTION_TEXT: Record<KioskSettingsSection, { title: string }> = {
|
|
690
|
+
ordering: { title: 'order.settingsSectionOrdering' },
|
|
691
|
+
look: { title: 'order.settingsSectionLook' },
|
|
692
|
+
payment: { title: 'order.settingsSectionPayment' },
|
|
693
|
+
updates: { title: 'order.settingsSectionUpdates' }
|
|
694
|
+
}
|
|
695
|
+
const coverDialogOpen = ref(false)
|
|
696
|
+
/** The "Customise messages" boxes, closed until asked for: most merchants keep the defaults. */
|
|
697
|
+
const messagesOpen = reactive({ pickUp: false, displayStand: false, takeaway: false })
|
|
698
|
+
|
|
450
699
|
interface Props {
|
|
451
700
|
restaurantId: string
|
|
701
|
+
/** This outlet's saved settings. The form edits a copy (the draft), never this object. */
|
|
452
702
|
form: MfKioskOrderSettingForm
|
|
703
|
+
/** Saves the settings; resolves only after the backend accepted them, rejects on failure. */
|
|
704
|
+
save: (form: MfKioskOrderSetting) => Promise<void>
|
|
453
705
|
}
|
|
454
706
|
|
|
455
707
|
const props = defineProps<Props>()
|
|
456
708
|
|
|
457
709
|
const SnackBar = useSnackbar()
|
|
458
710
|
|
|
459
|
-
|
|
460
|
-
(e: '
|
|
461
|
-
}
|
|
711
|
+
const emit = defineEmits<{
|
|
712
|
+
(e: 'dirtyChange', dirty: boolean): void
|
|
713
|
+
}>()
|
|
462
714
|
|
|
463
|
-
|
|
715
|
+
function cloneForm(form: MfKioskOrderSettingForm): MfKioskOrderSettingForm {
|
|
716
|
+
return structuredClone(toRaw(form))
|
|
717
|
+
}
|
|
464
718
|
|
|
465
|
-
|
|
719
|
+
/** The draft the merchant edits. It reaches the store only through `save`. */
|
|
720
|
+
const kioskOrderSettingForm = ref<MfKioskOrderSettingForm>(cloneForm(props.form))
|
|
466
721
|
|
|
467
722
|
// autoCloseBill / printReceiptAfterClose stay null until the merchant actually
|
|
468
723
|
// picks one, so the backend keeps inheriting dineInSettings. Turning auto-close
|
|
@@ -514,51 +769,13 @@ const padDigitRules = computed(() => [nonNegativeRule])
|
|
|
514
769
|
const minRules = computed(() => [nonNegativeRule])
|
|
515
770
|
const maxRules = computed(() => [nonNegativeRule, greaterThanMinRule])
|
|
516
771
|
|
|
772
|
+
/** Sections with a field that cannot be saved; their menu entry shows an error icon. */
|
|
773
|
+
const invalidSections = computed(() => invalidSettingsSections(kioskOrderSettingForm.value))
|
|
774
|
+
|
|
517
775
|
const validKioskOrderSetting = computed<MfKioskOrderSetting | null>(() => {
|
|
518
776
|
const f = kioskOrderSettingForm.value
|
|
519
777
|
const otaChannel = f.otaChannel?.trim()
|
|
520
|
-
|
|
521
|
-
// Validate display stand settings if both dineIn and displayStand are enabled
|
|
522
|
-
if (f.dineIn.enabled && f.dineIn.displayStand.enabled) {
|
|
523
|
-
const { padDigit, standSlotRange } = f.dineIn.displayStand
|
|
524
|
-
const isValid =
|
|
525
|
-
padDigit != null &&
|
|
526
|
-
padDigit >= 0 &&
|
|
527
|
-
standSlotRange.min != null &&
|
|
528
|
-
standSlotRange.max != null &&
|
|
529
|
-
standSlotRange.min <= standSlotRange.max
|
|
530
|
-
|
|
531
|
-
if (!isValid) return null
|
|
532
|
-
}
|
|
533
|
-
|
|
534
|
-
// A restriction that allows no language would leave the kiosk with nothing to
|
|
535
|
-
// render. Saving it would also be a no-op, since [] round-trips as null.
|
|
536
|
-
if (f.languages != null && f.languages.length === 0) return null
|
|
537
|
-
|
|
538
|
-
// A minimum weight must be a whole number of grams, at least 1 (KDI-5138).
|
|
539
|
-
if (
|
|
540
|
-
f.minWeighGrams != null &&
|
|
541
|
-
(!Number.isInteger(f.minWeighGrams) || f.minWeighGrams < 1 || f.minWeighGrams > MAX_MIN_WEIGH_GRAMS)
|
|
542
|
-
) {
|
|
543
|
-
return null
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
// Validate payment settings
|
|
547
|
-
const payment = f.paymentSetting
|
|
548
|
-
if (payment?.paymentTypes?.includes(F_ORDER_PAYMENT_TYPE.enum.ePayment)) {
|
|
549
|
-
const ePayment = payment.ePaymentTypes
|
|
550
|
-
if (!ePayment) return null
|
|
551
|
-
|
|
552
|
-
const hasCard = ePayment.card?.terminal || ePayment.card?.nfc
|
|
553
|
-
const hasWallet =
|
|
554
|
-
ePayment.eWallet?.qrPay ||
|
|
555
|
-
ePayment.eWallet?.scanPay ||
|
|
556
|
-
ePayment.eWallet?.terminalScanPay ||
|
|
557
|
-
ePayment.eWallet?.terminalQrPay
|
|
558
|
-
const hasTerminal = ePayment.terminal
|
|
559
|
-
|
|
560
|
-
if (!hasCard && !hasWallet && !hasTerminal) return null
|
|
561
|
-
}
|
|
778
|
+
if (invalidSections.value.length > 0) return null
|
|
562
779
|
|
|
563
780
|
// Return the form as-is if valid, with display stand disabled when dineIn is disabled
|
|
564
781
|
return {
|
|
@@ -608,6 +825,7 @@ const COVER_ORIENTATIONS = [
|
|
|
608
825
|
labelKey: 'order.coverImageLandscape',
|
|
609
826
|
hintKey: 'order.coverImageLandscapeHint',
|
|
610
827
|
previewClass: 'w-[280px] aspect-video',
|
|
828
|
+
thumbClass: 'h-[56px] aspect-video',
|
|
611
829
|
dropClass: 'w-[280px] aspect-video'
|
|
612
830
|
},
|
|
613
831
|
{
|
|
@@ -615,6 +833,7 @@ const COVER_ORIENTATIONS = [
|
|
|
615
833
|
labelKey: 'order.coverImagePortrait',
|
|
616
834
|
hintKey: 'order.coverImagePortraitHint',
|
|
617
835
|
previewClass: 'w-[160px] aspect-[9/16]',
|
|
836
|
+
thumbClass: 'h-[72px] aspect-[9/16]',
|
|
618
837
|
dropClass: 'w-[160px] aspect-[9/16]'
|
|
619
838
|
}
|
|
620
839
|
] as const
|
|
@@ -644,8 +863,7 @@ function removeCoverImage(orientation: CoverOrientation, index: number) {
|
|
|
644
863
|
}
|
|
645
864
|
|
|
646
865
|
// Minimum sellable weight for sold-by-weight items, in whole grams (KDI-5138).
|
|
647
|
-
// Empty = no minimum (more than 0 g, like POS).
|
|
648
|
-
const MAX_MIN_WEIGH_GRAMS = 100000
|
|
866
|
+
// Empty = no minimum (more than 0 g, like POS). The limit is MAX_MIN_WEIGH_GRAMS.
|
|
649
867
|
const minWeighGrams = computed<number | null>({
|
|
650
868
|
get: () => kioskOrderSettingForm.value.minWeighGrams ?? null,
|
|
651
869
|
set: (grams) => {
|
|
@@ -749,17 +967,82 @@ watch(
|
|
|
749
967
|
{ immediate: true }
|
|
750
968
|
)
|
|
751
969
|
|
|
970
|
+
// Unsaved edits = the draft differs from the snapshot taken when the form was set
|
|
971
|
+
// up. The snapshot waits for mount, so corrections the form applies on its own while
|
|
972
|
+
// opening (e.g. the dine-in mode watcher above) do not count as edits.
|
|
973
|
+
const baseline = ref<string | null>(null)
|
|
974
|
+
const snapshot = () => JSON.stringify(kioskOrderSettingForm.value)
|
|
975
|
+
const isDirty = computed(() => baseline.value !== null && snapshot() !== baseline.value)
|
|
976
|
+
watch(isDirty, (dirty) => emit('dirtyChange', dirty))
|
|
977
|
+
|
|
978
|
+
onMounted(async () => {
|
|
979
|
+
await nextTick()
|
|
980
|
+
baseline.value = snapshot()
|
|
981
|
+
})
|
|
982
|
+
|
|
983
|
+
/** Start again from the saved settings (Discard, or after a successful save). */
|
|
984
|
+
async function resetDraft() {
|
|
985
|
+
kioskOrderSettingForm.value = cloneForm(props.form)
|
|
986
|
+
await nextTick()
|
|
987
|
+
baseline.value = snapshot()
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
const saving = ref(false)
|
|
991
|
+
|
|
992
|
+
// Place the fixed save bar over this form's column (plus the page's 24 px side
|
|
993
|
+
// padding), and keep that much space free under the last field.
|
|
994
|
+
const PAGE_GUTTER_PX = 24
|
|
995
|
+
const formRoot = ref<HTMLElement | null>(null)
|
|
996
|
+
const saveBar = ref<HTMLElement | null>(null)
|
|
997
|
+
const saveBarStyle = ref<Record<string, string>>({})
|
|
998
|
+
const saveBarSpace = ref(0)
|
|
999
|
+
let saveBarObserver: ResizeObserver | null = null
|
|
1000
|
+
|
|
1001
|
+
function placeSaveBar() {
|
|
1002
|
+
const root = formRoot.value
|
|
1003
|
+
if (!root) return
|
|
1004
|
+
const box = root.getBoundingClientRect()
|
|
1005
|
+
saveBarStyle.value = {
|
|
1006
|
+
left: `${box.left - PAGE_GUTTER_PX}px`,
|
|
1007
|
+
width: `${box.width + 2 * PAGE_GUTTER_PX}px`
|
|
1008
|
+
}
|
|
1009
|
+
saveBarSpace.value = (saveBar.value?.offsetHeight ?? 0) + PAGE_GUTTER_PX
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
onMounted(() => {
|
|
1013
|
+
placeSaveBar()
|
|
1014
|
+
saveBarObserver = new ResizeObserver(placeSaveBar)
|
|
1015
|
+
if (formRoot.value) saveBarObserver.observe(formRoot.value)
|
|
1016
|
+
if (saveBar.value) saveBarObserver.observe(saveBar.value)
|
|
1017
|
+
window.addEventListener('resize', placeSaveBar)
|
|
1018
|
+
})
|
|
1019
|
+
|
|
1020
|
+
onBeforeUnmount(() => {
|
|
1021
|
+
saveBarObserver?.disconnect()
|
|
1022
|
+
window.removeEventListener('resize', placeSaveBar)
|
|
1023
|
+
})
|
|
1024
|
+
|
|
752
1025
|
async function submitForm() {
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
})
|
|
758
|
-
} else {
|
|
1026
|
+
const kioskOrderSetting = validKioskOrderSetting.value
|
|
1027
|
+
if (!kioskOrderSetting) {
|
|
1028
|
+
// Show the section with the error; it may not be the one on screen.
|
|
1029
|
+
activeSection.value = invalidSections.value[0] ?? activeSection.value
|
|
759
1030
|
SnackBar.open({
|
|
760
1031
|
title: t('order.failedToUpdateSetting'),
|
|
761
1032
|
type: 'error'
|
|
762
1033
|
})
|
|
1034
|
+
return
|
|
1035
|
+
}
|
|
1036
|
+
saving.value = true
|
|
1037
|
+
try {
|
|
1038
|
+
await props.save(kioskOrderSetting)
|
|
1039
|
+
// Show what the backend stored, and mark it as saved.
|
|
1040
|
+
await nextTick()
|
|
1041
|
+
await resetDraft()
|
|
1042
|
+
} catch {
|
|
1043
|
+
// The page already said the save failed; keep the edits as unsaved.
|
|
1044
|
+
} finally {
|
|
1045
|
+
saving.value = false
|
|
763
1046
|
}
|
|
764
1047
|
}
|
|
765
1048
|
</script>
|