@feedmepos/mf-order-setting 0.0.52 → 0.0.53
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/.env.dev +1 -1
- package/.env.prod +1 -1
- package/dist/{KioskDevicesView-D_YT-CL0.js → KioskDevicesView-CMKNjgWx.js} +1 -1
- package/dist/{KioskDevicesView.vue_vue_type_script_setup_true_lang-Bxv6oiFw.js → KioskDevicesView.vue_vue_type_script_setup_true_lang-B1sNvlUC.js} +2 -2
- package/dist/KioskSettingView-BE_pMA-i.js +720 -0
- package/dist/KioskView-U-Wg8oMC.js +480 -0
- package/dist/OrderSettingsView-BWzaITT6.js +51916 -0
- package/dist/app-CFfgPAd8.js +10445 -0
- package/dist/app.js +3 -3
- package/dist/dayjs.min-CuRr-wlf.js +283 -0
- package/dist/frontend/mf-order/src/app.d.ts +60 -8
- package/dist/frontend/mf-order/src/main.d.ts +60 -8
- package/dist/frontend/mf-order/src/modules/order-setting/kiosk/interface.d.ts +4 -2
- package/dist/frontend/mf-order/src/stores/order-setting/index.d.ts +15 -6
- package/dist/frontend/mf-order/src/stores/restaurant/index.d.ts +3 -3
- package/dist/frontend/mf-order/src/utils/firebase-app.d.ts +4 -0
- package/dist/frontend/mf-order/src/utils/firebase-storage.d.ts +2 -0
- package/dist/frontend/mf-order/src/views/all-orders/ReflowOrder.vue.d.ts +2 -2
- package/dist/frontend/mf-order/src/views/order-settings/delivery/inhouse/InHouseDelivery.vue.d.ts +2 -2
- package/dist/frontend/mf-order/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{index-Bjwv8B4h.js → index-Bj0bCGTm.js} +25 -26
- package/dist/menu.dto-DAh1J2ES.js +128627 -0
- package/dist/package/entity/booking/booking.do.d.ts +30 -30
- package/dist/package/entity/delivery/delivery.dto.d.ts +6 -6
- package/dist/package/entity/food-court/order.do.d.ts +24 -4
- package/dist/package/entity/incoming-order/incoming-order-to-bill.dto.d.ts +12553 -162
- package/dist/package/entity/incoming-order/incoming-order.do.d.ts +43 -22268
- package/dist/package/entity/incoming-order/incoming-order.dto.d.ts +14805 -66
- package/dist/package/entity/incoming-order/incoming-order.enum.d.ts +1 -1
- package/dist/package/entity/index.d.ts +3 -0
- package/dist/package/entity/kiosk/marketing/marketing.dto.d.ts +1 -19864
- package/dist/package/entity/order/order-item/order-item.dto.d.ts +1 -3721
- package/dist/package/entity/order/order.dto.d.ts +342 -7293
- package/dist/package/entity/order/payment/payment.dto.d.ts +3 -344
- package/dist/package/entity/order-platform/foodpanda/foodpanda-order.dto.d.ts +6 -6
- package/dist/package/entity/order-platform/grabfood/grabfood-edit-order.do.d.ts +144 -0
- package/dist/package/entity/order-platform/grabfood/grabfood-omni.do.d.ts +282 -47
- package/dist/package/entity/order-platform/grabfood/grabfood-order.do.d.ts +6 -6
- package/dist/package/entity/order-platform/grabfood/grabfood-webhook.dto.d.ts +69 -14
- package/dist/package/entity/order-platform/grabfood/grabfood.enum.d.ts +2 -0
- package/dist/package/entity/order-platform/order-platform.dto.d.ts +7306 -3
- package/dist/package/entity/order-platform/shopeefood/shopeefood-order.do.d.ts +6 -6
- package/dist/package/entity/order-setting/dine-in/dine-in.do.d.ts +12 -0
- package/dist/package/entity/order-setting/dine-in/dine-in.dto.d.ts +12 -0
- package/dist/package/entity/order-setting/kiosk/kiosk.do.d.ts +6 -3
- package/dist/package/entity/order-setting/kiosk/kiosk.dto.d.ts +6 -3
- package/dist/package/entity/order-setting/order-setting.do.d.ts +13 -8
- package/dist/package/entity/order-setting/order-setting.dto.d.ts +30 -10
- package/dist/package/entity/queue/queue.do.d.ts +1 -11
- package/dist/package/entity/restaurant/restaurant.dto.d.ts +14 -9
- package/dist/package/entity/websocket/websocket.dto.d.ts +24 -12
- package/package.json +4 -2
- package/src/App.vue +3 -0
- package/src/locales/en-US.json +15 -2
- package/src/locales/ja-JP.json +31 -18
- package/src/locales/th-TH.json +15 -2
- package/src/locales/zh-CN.json +15 -2
- package/src/main.ts +10 -20
- package/src/modules/order-setting/kiosk/interface.ts +4 -2
- package/src/stores/order-setting/mapper.ts +63 -60
- package/src/utils/firebase-app.ts +34 -0
- package/src/utils/firebase-storage.ts +112 -0
- package/src/views/kiosk/settings/KioskPaymentTypeSection.vue +1 -19
- package/src/views/kiosk/settings/KioskSettingView.vue +136 -43
- package/src/views/order-settings/OrderSettingsView.vue +1 -1
- package/src/views/order-settings/dine-in/DineInSetting.vue +23 -1
- package/src/views/order-settings/drive-thru/DriveThruSetting.vue +19 -18
- package/src/views/order-settings/servicecharge/ServiceChargeRule.vue +5 -1
- package/dist/KioskSettingView-DS5vEQ07.js +0 -573
- package/dist/KioskView-B8NHcyGz.js +0 -477
- package/dist/OrderSettingsView-BhEN-2ZZ.js +0 -51602
- package/dist/app-BWFBpJUR.js +0 -2986
- package/dist/dayjs.min-CD9R3x-Y.js +0 -2092
- package/dist/menu.dto-Wzm4Tz0i.js +0 -101874
|
@@ -92,16 +92,6 @@ const initializeCheckboxes = () => {
|
|
|
92
92
|
eWalletPaymentCheckboxVal.value.push(F_ORDER_E_PAYMENT_TYPE.enum.SCANPAY)
|
|
93
93
|
useEwallet.value = true
|
|
94
94
|
}
|
|
95
|
-
|
|
96
|
-
if (props.ePaymentTypes.eWallet.terminalScanPay) {
|
|
97
|
-
eWalletPaymentCheckboxVal.value.push(F_ORDER_E_PAYMENT_TYPE.enum.TERMINAL_SCAN_PAY)
|
|
98
|
-
useEwallet.value = true
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
if (props.ePaymentTypes.eWallet.terminalQrPay) {
|
|
102
|
-
eWalletPaymentCheckboxVal.value.push(F_ORDER_E_PAYMENT_TYPE.enum.TERMINAL_QR_PAY)
|
|
103
|
-
useEwallet.value = true
|
|
104
|
-
}
|
|
105
95
|
}
|
|
106
96
|
}
|
|
107
97
|
|
|
@@ -164,9 +154,7 @@ const handleEPaymentCardUpdate = (ev: string) => {
|
|
|
164
154
|
},
|
|
165
155
|
eWallet: {
|
|
166
156
|
qrPay: false,
|
|
167
|
-
scanPay: false
|
|
168
|
-
terminalScanPay: false,
|
|
169
|
-
terminalQrPay: false,
|
|
157
|
+
scanPay: false
|
|
170
158
|
}
|
|
171
159
|
} as FdoEPaymentMethod
|
|
172
160
|
|
|
@@ -187,12 +175,6 @@ const handleEPaymentCardUpdate = (ev: string) => {
|
|
|
187
175
|
if (eWalletPaymentCheckboxVal.value.includes(F_ORDER_E_PAYMENT_TYPE.enum.SCANPAY)) {
|
|
188
176
|
ePaymentObj.eWallet.scanPay = true
|
|
189
177
|
}
|
|
190
|
-
if (eWalletPaymentCheckboxVal.value.includes(F_ORDER_E_PAYMENT_TYPE.enum.TERMINAL_SCAN_PAY)) {
|
|
191
|
-
ePaymentObj.eWallet.terminalScanPay = true
|
|
192
|
-
}
|
|
193
|
-
if (eWalletPaymentCheckboxVal.value.includes(F_ORDER_E_PAYMENT_TYPE.enum.TERMINAL_QR_PAY)) {
|
|
194
|
-
ePaymentObj.eWallet.terminalQrPay = true
|
|
195
|
-
}
|
|
196
178
|
}
|
|
197
179
|
}
|
|
198
180
|
|
|
@@ -1,23 +1,8 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div v-if="!!kioskOrderSettingForm" class="flex flex-col gap-32">
|
|
3
|
-
<!--
|
|
4
|
-
<div
|
|
5
|
-
<span class="fm-typo-en-title-sm-600">{{ t('order.
|
|
6
|
-
<div class="flex flex-col gap-1 w-full md:w-1/2">
|
|
7
|
-
<FmTextField
|
|
8
|
-
v-model="kioskOrderSettingForm.otaChannel"
|
|
9
|
-
:label="t('order.otaChannel')"
|
|
10
|
-
:placeholder="t('order.otaChannelHint')"
|
|
11
|
-
/>
|
|
12
|
-
<span class="fm-typo-en-body-sm-400 text-fm-color-typo-secondary">
|
|
13
|
-
{{ t('order.otaChannelHint') }}
|
|
14
|
-
</span>
|
|
15
|
-
</div>
|
|
16
|
-
</div>
|
|
17
|
-
|
|
18
|
-
<!-- Dine In Section -->
|
|
19
|
-
<div class="flex flex-col gap-2">
|
|
20
|
-
<span class="fm-typo-en-title-sm-600">{{ t('order.dineIn') }}</span>
|
|
1
|
+
<template>
|
|
2
|
+
<div v-if="!!kioskOrderSettingForm" class="flex flex-col gap-32">
|
|
3
|
+
<!-- Dine In Section -->
|
|
4
|
+
<div class="flex flex-col gap-2">
|
|
5
|
+
<span class="fm-typo-en-title-sm-600">{{ t('order.dineIn') }}</span>
|
|
21
6
|
<div class="flex flex-col gap-5">
|
|
22
7
|
<FmSwitch
|
|
23
8
|
v-model="kioskOrderSettingForm.dineIn.enabled"
|
|
@@ -155,6 +140,68 @@
|
|
|
155
140
|
/>
|
|
156
141
|
</div>
|
|
157
142
|
|
|
143
|
+
<!-- Cover Image Section -->
|
|
144
|
+
<div class="flex flex-col gap-2">
|
|
145
|
+
<span class="fm-typo-en-title-sm-600">{{ t('order.coverImage') }}</span>
|
|
146
|
+
<span class="fm-typo-en-body-sm-400 text-fm-color-typo-secondary">{{
|
|
147
|
+
t('order.coverImageFallbackHint')
|
|
148
|
+
}}</span>
|
|
149
|
+
|
|
150
|
+
<div class="border p-[1.5rem] fm-corner-radius-lg flex flex-col gap-4 my-5 w-11/12">
|
|
151
|
+
<span class="fm-typo-en-body-md-600">{{ t('order.coverImageLandscape') }}</span>
|
|
152
|
+
<span class="fm-typo-en-body-sm-400 text-fm-color-typo-secondary">{{
|
|
153
|
+
t('order.coverImageLandscapeHint')
|
|
154
|
+
}}</span>
|
|
155
|
+
<FmDropField
|
|
156
|
+
v-if="!getCoverImagePreview('coverImageLandscape')"
|
|
157
|
+
accept="image/*"
|
|
158
|
+
:max-file-size="MAX_IMAGE_FILE_SIZE"
|
|
159
|
+
@file-upload="uploadCoverImage('coverImageLandscape', $event)"
|
|
160
|
+
@file-rejected="handleCoverImageRejected('coverImageLandscape', $event)"
|
|
161
|
+
/>
|
|
162
|
+
<div v-else class="flex flex-col gap-2">
|
|
163
|
+
<img
|
|
164
|
+
:src="getCoverImagePreview('coverImageLandscape')!"
|
|
165
|
+
:alt="t('order.coverImageLandscape')"
|
|
166
|
+
class="w-full max-w-[360px] max-h-[200px] object-cover rounded-md border border-fm-color-neutral-gray-200"
|
|
167
|
+
/>
|
|
168
|
+
<FmButton
|
|
169
|
+
variant="tertiary"
|
|
170
|
+
class="mr-auto"
|
|
171
|
+
:label="t('common.delete')"
|
|
172
|
+
@click="clearCoverImage('coverImageLandscape')"
|
|
173
|
+
/>
|
|
174
|
+
</div>
|
|
175
|
+
</div>
|
|
176
|
+
|
|
177
|
+
<div class="border p-[1.5rem] fm-corner-radius-lg flex flex-col gap-4 my-5 w-11/12">
|
|
178
|
+
<span class="fm-typo-en-body-md-600">{{ t('order.coverImagePortrait') }}</span>
|
|
179
|
+
<span class="fm-typo-en-body-sm-400 text-fm-color-typo-secondary">{{
|
|
180
|
+
t('order.coverImagePortraitHint')
|
|
181
|
+
}}</span>
|
|
182
|
+
<FmDropField
|
|
183
|
+
v-if="!getCoverImagePreview('coverImagePortrait')"
|
|
184
|
+
accept="image/*"
|
|
185
|
+
:max-file-size="MAX_IMAGE_FILE_SIZE"
|
|
186
|
+
@file-upload="uploadCoverImage('coverImagePortrait', $event)"
|
|
187
|
+
@file-rejected="handleCoverImageRejected('coverImagePortrait', $event)"
|
|
188
|
+
/>
|
|
189
|
+
<div v-else class="flex flex-col gap-2">
|
|
190
|
+
<img
|
|
191
|
+
:src="getCoverImagePreview('coverImagePortrait')!"
|
|
192
|
+
:alt="t('order.coverImagePortrait')"
|
|
193
|
+
class="w-full max-w-[360px] max-h-[200px] object-cover rounded-md border border-fm-color-neutral-gray-200"
|
|
194
|
+
/>
|
|
195
|
+
<FmButton
|
|
196
|
+
variant="tertiary"
|
|
197
|
+
class="mr-auto"
|
|
198
|
+
:label="t('common.delete')"
|
|
199
|
+
@click="clearCoverImage('coverImagePortrait')"
|
|
200
|
+
/>
|
|
201
|
+
</div>
|
|
202
|
+
</div>
|
|
203
|
+
</div>
|
|
204
|
+
|
|
158
205
|
<!-- Display Pax Dialog Section -->
|
|
159
206
|
<div class="flex flex-col gap-2">
|
|
160
207
|
<span class="fm-typo-en-title-sm-600">{{ t('order.displayPaxDialogTitle') }}</span>
|
|
@@ -198,22 +245,20 @@
|
|
|
198
245
|
</template>
|
|
199
246
|
<script setup lang="ts">
|
|
200
247
|
import { computed, ref } from 'vue'
|
|
201
|
-
import KioskPaymentTypeSection from './KioskPaymentTypeSection.vue'
|
|
202
|
-
import { FdoOfflinePaymentMethod } from '@feedmepos/core/entity'
|
|
203
|
-
import { FdoEPaymentMethod, F_ORDER_PAYMENT_TYPE } from '@entity'
|
|
204
|
-
import type {
|
|
205
|
-
MfKioskOrderSetting,
|
|
248
|
+
import KioskPaymentTypeSection from './KioskPaymentTypeSection.vue'
|
|
249
|
+
import { FdoOfflinePaymentMethod } from '@feedmepos/core/entity'
|
|
250
|
+
import { FdoEPaymentMethod, F_ORDER_PAYMENT_TYPE } from '@entity'
|
|
251
|
+
import type {
|
|
252
|
+
MfKioskOrderSetting,
|
|
206
253
|
MfKioskOrderSettingForm,
|
|
207
254
|
KioskPaymentTypesForm
|
|
208
255
|
} from '@/modules/order-setting/kiosk/interface'
|
|
209
|
-
import { useLoading } from '@/composables/loading'
|
|
210
|
-
import { useSnackbar } from '@feedmepos/ui-library'
|
|
211
|
-
import { useI18n } from '@feedmepos/mf-common'
|
|
212
|
-
import {
|
|
213
|
-
|
|
214
|
-
const { t } = useI18n()
|
|
215
|
-
const CoreStore = useCoreStore()
|
|
216
|
-
const isAdmin = computed(() => CoreStore.sessionUser.value?.role.isAdmin ?? false)
|
|
256
|
+
import { useLoading } from '@/composables/loading'
|
|
257
|
+
import { useSnackbar } from '@feedmepos/ui-library'
|
|
258
|
+
import { useI18n } from '@feedmepos/mf-common'
|
|
259
|
+
import { uploadImageFile } from '@/utils/firebase-storage'
|
|
260
|
+
|
|
261
|
+
const { t } = useI18n()
|
|
217
262
|
|
|
218
263
|
interface Props {
|
|
219
264
|
restaurantId: string
|
|
@@ -249,9 +294,8 @@ const padDigitRules = computed(() => [nonNegativeRule])
|
|
|
249
294
|
const minRules = computed(() => [nonNegativeRule])
|
|
250
295
|
const maxRules = computed(() => [nonNegativeRule, greaterThanMinRule])
|
|
251
296
|
|
|
252
|
-
const validKioskOrderSetting = computed<MfKioskOrderSetting | null>(() => {
|
|
253
|
-
const f = kioskOrderSettingForm.value
|
|
254
|
-
const otaChannel = f.otaChannel?.trim()
|
|
297
|
+
const validKioskOrderSetting = computed<MfKioskOrderSetting | null>(() => {
|
|
298
|
+
const f = kioskOrderSettingForm.value
|
|
255
299
|
|
|
256
300
|
// Validate display stand settings if both dineIn and displayStand are enabled
|
|
257
301
|
if (f.dineIn.enabled && f.dineIn.displayStand.enabled) {
|
|
@@ -266,13 +310,12 @@ const validKioskOrderSetting = computed<MfKioskOrderSetting | null>(() => {
|
|
|
266
310
|
if (!isValid) return null
|
|
267
311
|
}
|
|
268
312
|
|
|
269
|
-
// Return the form as-is if valid, with display stand disabled when dineIn is disabled
|
|
270
|
-
return {
|
|
271
|
-
...f,
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
displayStand: {
|
|
313
|
+
// Return the form as-is if valid, with display stand disabled when dineIn is disabled
|
|
314
|
+
return {
|
|
315
|
+
...f,
|
|
316
|
+
dineIn: {
|
|
317
|
+
...f.dineIn,
|
|
318
|
+
displayStand: {
|
|
276
319
|
...f.dineIn.displayStand,
|
|
277
320
|
enabled: f.dineIn.enabled && f.dineIn.displayStand.enabled,
|
|
278
321
|
padDigit: f.dineIn.displayStand.padDigit ?? 0,
|
|
@@ -296,6 +339,56 @@ function updateEPaymentSetting(form: FdoEPaymentMethod) {
|
|
|
296
339
|
kioskOrderSettingForm.value.paymentSetting.ePaymentTypes = form
|
|
297
340
|
}
|
|
298
341
|
|
|
342
|
+
type CoverImageField = 'coverImageLandscape' | 'coverImagePortrait'
|
|
343
|
+
const MAX_IMAGE_FILE_SIZE = 10 * 1000 * 1000
|
|
344
|
+
|
|
345
|
+
function clearCoverImage(field: CoverImageField) {
|
|
346
|
+
kioskOrderSettingForm.value[field] = null
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
function getCoverImagePreview(field: CoverImageField): string | null {
|
|
350
|
+
const value = kioskOrderSettingForm.value[field]
|
|
351
|
+
if (!value) return null
|
|
352
|
+
const trimmed = value.trim()
|
|
353
|
+
return trimmed.length > 0 ? trimmed : null
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
async function uploadCoverImage(field: CoverImageField, file: File) {
|
|
357
|
+
try {
|
|
358
|
+
const imageUrl = await startAsyncCall(async () => {
|
|
359
|
+
const path = `/restaurant/${props.restaurantId}/kiosk/${field}`
|
|
360
|
+
return await uploadImageFile(path, file)
|
|
361
|
+
})
|
|
362
|
+
|
|
363
|
+
kioskOrderSettingForm.value[field] = imageUrl
|
|
364
|
+
SnackBar.open({
|
|
365
|
+
title: t('order.imageUploadSuccess'),
|
|
366
|
+
type: 'success'
|
|
367
|
+
})
|
|
368
|
+
} catch (e) {
|
|
369
|
+
console.error(e)
|
|
370
|
+
SnackBar.open({
|
|
371
|
+
title: t('order.imageUploadFailed'),
|
|
372
|
+
type: 'error'
|
|
373
|
+
})
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
function handleCoverImageRejected(
|
|
378
|
+
field: CoverImageField,
|
|
379
|
+
rejected: { file: File; reason: string[] }[]
|
|
380
|
+
) {
|
|
381
|
+
const fieldName =
|
|
382
|
+
field === 'coverImageLandscape' ? t('order.coverImageLandscape') : t('order.coverImagePortrait')
|
|
383
|
+
const firstReason = rejected[0]?.reason?.[0]
|
|
384
|
+
SnackBar.open({
|
|
385
|
+
title: firstReason
|
|
386
|
+
? `${t('order.imageUploadRejected')}: ${fieldName} (${firstReason})`
|
|
387
|
+
: `${t('order.imageUploadRejected')}: ${fieldName}`,
|
|
388
|
+
type: 'error'
|
|
389
|
+
})
|
|
390
|
+
}
|
|
391
|
+
|
|
299
392
|
const allowEPayment = computed(() => {
|
|
300
393
|
const paymentTypes = kioskOrderSettingForm.value.paymentSetting.paymentTypes || []
|
|
301
394
|
return paymentTypes.includes(F_ORDER_PAYMENT_TYPE.enum.ePayment)
|
|
@@ -77,6 +77,14 @@
|
|
|
77
77
|
label-placement="right"
|
|
78
78
|
@update:model-value="updatePrintChecklist"
|
|
79
79
|
></FmSwitch>
|
|
80
|
+
|
|
81
|
+
<FmSwitch
|
|
82
|
+
:model-value="orderSetting?.dineInSettings?.overridePax ?? true"
|
|
83
|
+
:label="t('order.overridePax')"
|
|
84
|
+
:sublabel="t('order.overridePaxSublabel')"
|
|
85
|
+
label-placement="right"
|
|
86
|
+
@update:model-value="updateOverridePax"
|
|
87
|
+
></FmSwitch>
|
|
80
88
|
</div>
|
|
81
89
|
<div class="p-[1.5rem] flex flex-col gap-2 m-5 w-2/3">
|
|
82
90
|
<PaymentType
|
|
@@ -182,12 +190,26 @@ function updateLastOrderMinutesBeforeClose(minutes: number) {
|
|
|
182
190
|
function updatePrintChecklist(v: boolean) {
|
|
183
191
|
if (orderSetting.value) {
|
|
184
192
|
if (!orderSetting.value.dineInSettings) {
|
|
185
|
-
orderSetting.value.dineInSettings = {
|
|
193
|
+
orderSetting.value.dineInSettings = {
|
|
194
|
+
overridePax: true,
|
|
195
|
+
};
|
|
186
196
|
}
|
|
187
197
|
orderSetting.value.dineInSettings.printChecklist = v
|
|
188
198
|
}
|
|
189
199
|
}
|
|
190
200
|
|
|
201
|
+
function updateOverridePax(v: boolean) {
|
|
202
|
+
if (orderSetting.value) {
|
|
203
|
+
if (!orderSetting.value.dineInSettings) {
|
|
204
|
+
orderSetting.value.dineInSettings = {
|
|
205
|
+
overridePax: v,
|
|
206
|
+
};
|
|
207
|
+
} else {
|
|
208
|
+
orderSetting.value.dineInSettings.overridePax = v
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
191
213
|
function initDineInSetting(): FdoRestaurantDineIn {
|
|
192
214
|
return {
|
|
193
215
|
ignoreStock: false,
|
|
@@ -35,20 +35,21 @@
|
|
|
35
35
|
</template>
|
|
36
36
|
|
|
37
37
|
<script setup lang="ts">
|
|
38
|
-
import { type FdoRestaurantDriveThru } from '@feedmepos/core/entity'
|
|
39
|
-
import RestaurantSelector from '../components/RestaurantSelector.vue'
|
|
40
|
-
import { onMounted, ref, watch } from 'vue'
|
|
41
|
-
import { useRestaurantStore } from '@/stores/restaurant'
|
|
42
|
-
import { useLoading } from '@/composables/loading'
|
|
43
|
-
import { useCoreStore } from '@feedmepos/mf-common'
|
|
44
|
-
import { utils } from '@feedmepos/core'
|
|
45
|
-
import { useI18n } from '@feedmepos/mf-common'
|
|
46
|
-
import { useSnackbarFunctions } from '@/components/snackbar'
|
|
47
|
-
import { useMenuStore } from '@/stores/menu/menu'
|
|
48
|
-
|
|
49
|
-
const { t } = useI18n()
|
|
50
|
-
|
|
51
|
-
const { currentRestaurant } = useCoreStore()
|
|
38
|
+
import { type FdoRestaurant, type FdoRestaurantDriveThru } from '@feedmepos/core/entity'
|
|
39
|
+
import RestaurantSelector from '../components/RestaurantSelector.vue'
|
|
40
|
+
import { computed, onMounted, ref, watch } from 'vue'
|
|
41
|
+
import { useRestaurantStore } from '@/stores/restaurant'
|
|
42
|
+
import { useLoading } from '@/composables/loading'
|
|
43
|
+
import { useCoreStore } from '@feedmepos/mf-common'
|
|
44
|
+
import { utils } from '@feedmepos/core'
|
|
45
|
+
import { useI18n } from '@feedmepos/mf-common'
|
|
46
|
+
import { useSnackbarFunctions } from '@/components/snackbar'
|
|
47
|
+
import { useMenuStore } from '@/stores/menu/menu'
|
|
48
|
+
|
|
49
|
+
const { t } = useI18n()
|
|
50
|
+
|
|
51
|
+
const { currentRestaurant: _currentRestaurant } = useCoreStore()
|
|
52
|
+
const currentRestaurant = computed(() => _currentRestaurant.value as FdoRestaurant | undefined)
|
|
52
53
|
const menuStore = useMenuStore()
|
|
53
54
|
const driveThruSetting = ref<FdoRestaurantDriveThru>(initDriveThruSetting())
|
|
54
55
|
|
|
@@ -73,7 +74,7 @@ async function updateDriveThruSetting() {
|
|
|
73
74
|
if (newDriveThruSetting) {
|
|
74
75
|
await restaurantStore.updateDriveThruSetting(newDriveThruSetting)
|
|
75
76
|
if (currentRestaurant.value) {
|
|
76
|
-
|
|
77
|
+
currentRestaurant.value.driveThru = newDriveThruSetting
|
|
77
78
|
}
|
|
78
79
|
}
|
|
79
80
|
})
|
|
@@ -83,8 +84,8 @@ async function updateDriveThruSetting() {
|
|
|
83
84
|
watch(
|
|
84
85
|
() => currentRestaurant.value,
|
|
85
86
|
async (newRestaurant) => {
|
|
86
|
-
if (
|
|
87
|
-
driveThruSetting.value = utils.clone(
|
|
87
|
+
if (newRestaurant?.driveThru) {
|
|
88
|
+
driveThruSetting.value = utils.clone(newRestaurant.driveThru)
|
|
88
89
|
} else {
|
|
89
90
|
driveThruSetting.value = initDriveThruSetting()
|
|
90
91
|
}
|
|
@@ -93,7 +94,7 @@ watch(
|
|
|
93
94
|
)
|
|
94
95
|
|
|
95
96
|
onMounted(async () => {
|
|
96
|
-
const newRestaurant = currentRestaurant.value
|
|
97
|
+
const newRestaurant = currentRestaurant.value
|
|
97
98
|
if (newRestaurant?.driveThru) {
|
|
98
99
|
driveThruSetting.value = utils.clone(newRestaurant.driveThru)
|
|
99
100
|
}
|
|
@@ -480,7 +480,11 @@ watch(
|
|
|
480
480
|
/>
|
|
481
481
|
</div>
|
|
482
482
|
<div class="fm-corner-radius-lg flex flex-col" v-if="showTable">
|
|
483
|
-
<div
|
|
483
|
+
<div
|
|
484
|
+
v-for="(item, index) in filteredTable"
|
|
485
|
+
:key="index"
|
|
486
|
+
class="flex flex-col pl-6"
|
|
487
|
+
>
|
|
484
488
|
<FmCheckbox
|
|
485
489
|
:value="item.name"
|
|
486
490
|
:model-value="selectedTables[item.name].isSelected"
|