@feedmepos/mf-order-setting 0.0.23 → 0.0.25
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-BdJCcotz.js → KioskDevicesView-gzH9-zL_.js} +1 -1
- package/dist/{KioskDevicesView.vue_vue_type_script_setup_true_lang-DUPfN7ti.js → KioskDevicesView.vue_vue_type_script_setup_true_lang-CLpClo-r.js} +3 -3
- package/dist/KioskSettingView-D1WdpaQN.js +821 -0
- package/dist/{KioskView-DPU-oQ1H.js → KioskView-D6-1bn1n.js} +90 -76
- package/dist/{OrderSettingsView-BOiflwB_.js → OrderSettingsView-CqZREmjo.js} +6155 -6096
- package/dist/{app-CaYWSLe1.js → app-i4N2c7ms.js} +54 -38
- package/dist/app.js +1 -1
- package/dist/{dayjs.min-8NyoNely.js → dayjs.min-CA-XbgTY.js} +36 -36
- package/dist/frontend/mf-order/src/app.d.ts +16 -0
- package/dist/frontend/mf-order/src/main.d.ts +797 -0
- package/dist/frontend/mf-order/src/modules/order-setting/kiosk/interface.d.ts +4 -0
- package/dist/frontend/mf-order/src/stores/iframe/index.d.ts +6 -6
- package/dist/frontend/mf-order/src/stores/kiosk/index.d.ts +8 -260
- package/dist/frontend/mf-order/src/stores/order-setting/index.d.ts +29 -710
- package/dist/frontend/mf-order/src/stores/order-setting/mapper.d.ts +3 -2
- package/dist/frontend/mf-order/src/stores/restaurant/index.d.ts +1456 -2239
- package/dist/frontend/mf-order/src/views/kiosk/settings/KioskEnablePaxDialogSection.vue.d.ts +9 -0
- package/dist/frontend/mf-order/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{index-B7GFhkAE.js → index-C4HI1NS4.js} +2 -2
- package/dist/package/entity/delivery/delivery.dto.d.ts +11 -6
- package/dist/package/entity/food-court/food-court.dto.d.ts +1 -1
- package/dist/package/entity/food-court/order.dto.d.ts +727 -378
- package/dist/package/entity/incoming-order/incoming-order-to-bill.dto.d.ts +6 -6
- package/dist/package/entity/incoming-order/incoming-order.do.d.ts +8 -8
- package/dist/package/entity/incoming-order/incoming-order.dto.d.ts +16 -16
- package/dist/package/entity/index.d.ts +1 -0
- package/dist/package/entity/kiosk/marketing/marketing.dto.d.ts +1337 -656
- package/dist/package/entity/order/order.dto.d.ts +4942 -2401
- package/dist/package/entity/order/order.enum.d.ts +1 -1
- package/dist/package/entity/order/payment/payment.dto.d.ts +2899 -1419
- package/dist/package/entity/order-platform/external/order/external-order.do.d.ts +9 -21
- package/dist/package/entity/order-platform/external/order/external-order.dto.d.ts +19 -51
- package/dist/package/entity/order-setting/kiosk/kiosk.do.d.ts +14 -0
- package/dist/package/entity/order-setting/kiosk/kiosk.dto.d.ts +30 -0
- package/dist/package/entity/order-setting/order-setting.do.d.ts +26 -0
- package/dist/package/entity/order-setting/order-setting.dto.d.ts +52 -0
- package/dist/package/entity/order-setting/v3/v3.do.d.ts +3 -0
- package/dist/package/entity/order-setting/v3/v3.dto.d.ts +3 -0
- package/dist/package/entity/order-setting/v3/v3.enum.d.ts +3 -0
- package/dist/package/entity/payment/payment.dto.d.ts +3 -3
- package/dist/package/entity/restaurant/restaurant.dto.d.ts +37 -11
- package/dist/package/entity/websocket/websocket.dto.d.ts +40 -0
- package/dist/{queue.do-CIyIpp22.js → queue.do-DcOVgeUq.js} +17143 -16655
- package/package.json +3 -3
- package/src/Entry.vue +3 -3
- package/src/locales/en-US.json +8 -0
- package/src/locales/th-TH.json +257 -0
- package/src/locales/zh-CN.json +8 -0
- package/src/main.ts +9 -1
- package/src/modules/order-setting/kiosk/interface.ts +4 -0
- package/src/stores/iframe/index.ts +1 -1
- package/src/stores/kiosk/index.ts +1 -1
- package/src/stores/order-setting/index.ts +1 -1
- package/src/stores/order-setting/mapper.ts +27 -11
- package/src/stores/restaurant/index.ts +106 -85
- package/src/views/kiosk/settings/KioskEnablePaxDialogSection.vue +33 -0
- package/src/views/kiosk/settings/KioskSettingView.vue +26 -0
- package/src/views/order-settings/delivery/DeliverySetting.vue +12 -12
- package/src/views/order-settings/delivery/inhouse/InHouseDelivery.vue +39 -35
- package/src/views/order-settings/dine-in/DineInSetting.vue +158 -24
- package/src/views/order-settings/general/GeneralSetting.vue +29 -33
- package/src/views/order-settings/pickup/PickUpSetting.vue +4 -2
- package/src/views/order-settings/pickup/PickUpSettingDialogContent.vue +23 -10
- package/src/views/order-settings/servicecharge/ServiceChargeSetting.vue +17 -8
- package/dist/KioskSettingView-BChhriPk.js +0 -782
|
@@ -12,13 +12,14 @@ import {
|
|
|
12
12
|
FdoShopeeFoodSettings,
|
|
13
13
|
type FdoAddress,
|
|
14
14
|
type FdoProfile,
|
|
15
|
-
|
|
15
|
+
FdoRestaurant,
|
|
16
16
|
} from '@feedmepos/core/entity'
|
|
17
17
|
import { FdoExternalSetting, FdoGrabfoodSettings } from '@entity'
|
|
18
18
|
import { FeatureFlag, Pos } from '@feedmepos/core'
|
|
19
19
|
import { SvcConfig } from '@/api'
|
|
20
20
|
import { remoteOrderApi } from '@/api/remoteOrder'
|
|
21
|
-
import { useI18n } from '@feedmepos/mf-common'
|
|
21
|
+
import { useI18n, useCoreStore} from '@feedmepos/mf-common'
|
|
22
|
+
import { computed, ref, watch} from 'vue'
|
|
22
23
|
|
|
23
24
|
|
|
24
25
|
export interface Profile extends FdoProfile {
|
|
@@ -42,10 +43,6 @@ export interface ExtendedRestaurant extends FdoRestaurant {
|
|
|
42
43
|
}
|
|
43
44
|
|
|
44
45
|
interface RestaurantState {
|
|
45
|
-
adminRestaurants: FdoRestaurant[]
|
|
46
|
-
managableRestaurants: ExtendedRestaurant[]
|
|
47
|
-
businessRestaurants: ExtendedRestaurant[]
|
|
48
|
-
currentRestaurantId: string
|
|
49
46
|
restaurantSettings: { [restaurantId: string]: RestaurantSettingDoc }
|
|
50
47
|
}
|
|
51
48
|
|
|
@@ -53,90 +50,114 @@ export declare function setRestaurantId(id?: string | null): void
|
|
|
53
50
|
|
|
54
51
|
function initRestaurantState(): RestaurantState {
|
|
55
52
|
return {
|
|
56
|
-
adminRestaurants: [],
|
|
57
|
-
managableRestaurants: [],
|
|
58
|
-
businessRestaurants: [],
|
|
59
|
-
currentRestaurantId: '',
|
|
60
53
|
restaurantSettings: {}
|
|
61
54
|
}
|
|
62
55
|
}
|
|
63
56
|
|
|
64
|
-
export const useRestaurantStore = defineStore('restaurant', {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
const restaurantSetting = await restaurantApi.readRestaurantSetting(restaurantId)
|
|
76
|
-
this.restaurantSettings = {
|
|
77
|
-
...this.restaurantSettings,
|
|
78
|
-
[restaurantId]: restaurantSetting
|
|
79
|
-
}
|
|
80
|
-
return restaurantSetting
|
|
81
|
-
},
|
|
82
|
-
async selectRestaurant(restaurantId: string) {
|
|
83
|
-
await this.readRestaurantSetting(restaurantId)
|
|
84
|
-
this.currentRestaurantId = restaurantId
|
|
85
|
-
SvcConfig.setRestaurantId(restaurantId)
|
|
86
|
-
setRestaurantId(restaurantId)
|
|
87
|
-
FeatureFlag.setRestaurant(restaurantId || undefined)
|
|
88
|
-
localStorage.set('feedme_restaurant', restaurantId)
|
|
89
|
-
},
|
|
90
|
-
async updateServiceCharge(serviceCharge: FdoServiceChargeSetting) {
|
|
91
|
-
await restaurantApi.updateServiceCharge(serviceCharge)
|
|
92
|
-
},
|
|
93
|
-
async updateDineInSetting(setting: FdoRestaurantDineIn) {
|
|
94
|
-
await restaurantApi.updateDineInSetting(setting)
|
|
95
|
-
},
|
|
96
|
-
async updatePickupSetting(setting: FdoRestaurantPickup) {
|
|
97
|
-
await restaurantApi.updatePickupSetting(setting)
|
|
98
|
-
},
|
|
99
|
-
|
|
100
|
-
async updateInhouseDelivery(restaurantId: string, dto: FdoRestaurantInHouseDelivery) {
|
|
101
|
-
await remoteOrderApi.integratedDelivery.updateInhouse(restaurantId, dto)
|
|
102
|
-
},
|
|
103
|
-
async updateFeedmeDelivery(restaurantId: string, dto: FdoRestaurantFeedmeDelivery) {
|
|
104
|
-
return await remoteOrderApi.integratedDelivery.updateFeedme(restaurantId, dto)
|
|
105
|
-
},
|
|
106
|
-
async updateIntegratedFoodpandaDelivery(restaurantId: string, dto: FdoFoodpandaSettings) {
|
|
107
|
-
await remoteOrderApi.integratedDelivery.updateFoodpanda(restaurantId, dto)
|
|
108
|
-
},
|
|
109
|
-
async updateIntegratedGrabfoodDelivery(restaurantId: string, dto: FdoGrabfoodSettings) {
|
|
110
|
-
await remoteOrderApi.integratedDelivery.updateGrabfood(restaurantId, dto)
|
|
111
|
-
},
|
|
112
|
-
async updateIntegratedShopeefoodDelivery(restaurantId: string, dto: FdoShopeeFoodSettings) {
|
|
113
|
-
await remoteOrderApi.integratedDelivery.updateShopeefood(restaurantId, dto)
|
|
114
|
-
},
|
|
115
|
-
async updateExternalDelivery(restaurantId: string, dto: FdoExternalSetting) {
|
|
116
|
-
await remoteOrderApi.integratedDelivery.updateExternal(restaurantId, dto)
|
|
117
|
-
},
|
|
118
|
-
getRestaurantEPayment(dto?: FdoRestaurant | undefined): true | string {
|
|
119
|
-
const { t } = useI18n()
|
|
120
|
-
if (!dto) {
|
|
121
|
-
return 'getRestaurantEPayment - Invalid restaurant ';
|
|
122
|
-
}
|
|
123
|
-
const { payoutAccount, posVersion } = dto;
|
|
124
|
-
const validPosVersion =
|
|
125
|
-
!!posVersion &&
|
|
126
|
-
Pos.canUse({
|
|
127
|
-
feature: F_FEATURE.enum.qrEPayment,
|
|
128
|
-
posVersion
|
|
129
|
-
})
|
|
130
|
-
|
|
131
|
-
if (!validPosVersion)
|
|
132
|
-
return t('order.payoutPosVersion', { version: Pos.minVersionToUse(F_FEATURE.enum.qrEPayment) })
|
|
133
|
-
if (!payoutAccount || !payoutAccount.enable) {
|
|
134
|
-
return t('order.payoutAccountIsRequired')
|
|
135
|
-
}
|
|
136
|
-
if (payoutAccount.status !== F_PAYOUT_ACCOUNT_STATUS.enum.APPROVED) {
|
|
137
|
-
return t('order.payoutAccountIsRequired')
|
|
57
|
+
export const useRestaurantStore = defineStore('restaurant', () => {
|
|
58
|
+
const CoreStore = useCoreStore()
|
|
59
|
+
|
|
60
|
+
const state = ref(initRestaurantState())
|
|
61
|
+
const currentRestaurant = ref<FdoRestaurant | undefined>(undefined)
|
|
62
|
+
|
|
63
|
+
watch(
|
|
64
|
+
() => CoreStore.currentRestaurant.value,
|
|
65
|
+
async () => {
|
|
66
|
+
if(CoreStore.currentRestaurant.value){
|
|
67
|
+
currentRestaurant.value = FdoRestaurant.parse(CoreStore.currentRestaurant.value)
|
|
138
68
|
}
|
|
139
|
-
return true
|
|
140
69
|
}
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
const currentRestaurantSetting = computed<RestaurantSettingDoc| undefined>(() => state.value.restaurantSettings[currentRestaurant.value?._id || ''])
|
|
73
|
+
|
|
74
|
+
async function readRestaurantSetting(restaurantId: string) {
|
|
75
|
+
const restaurantSetting = await restaurantApi.readRestaurantSetting(restaurantId)
|
|
76
|
+
state.value.restaurantSettings = {
|
|
77
|
+
...state.value.restaurantSettings,
|
|
78
|
+
[restaurantId]: restaurantSetting
|
|
79
|
+
}
|
|
80
|
+
return restaurantSetting
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
async function selectRestaurant(restaurantId: string) {
|
|
84
|
+
await readRestaurantSetting(restaurantId)
|
|
85
|
+
SvcConfig.setRestaurantId(restaurantId)
|
|
86
|
+
setRestaurantId(restaurantId)
|
|
87
|
+
FeatureFlag.setRestaurant(restaurantId || undefined)
|
|
88
|
+
localStorage.set('feedme_restaurant', restaurantId)
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
async function updateServiceCharge(serviceCharge: FdoServiceChargeSetting) {
|
|
92
|
+
await restaurantApi.updateServiceCharge(serviceCharge)
|
|
93
|
+
}
|
|
94
|
+
async function updateDineInSetting(setting: FdoRestaurantDineIn) {
|
|
95
|
+
await restaurantApi.updateDineInSetting(setting)
|
|
96
|
+
}
|
|
97
|
+
async function updatePickupSetting(setting: FdoRestaurantPickup) {
|
|
98
|
+
await restaurantApi.updatePickupSetting(setting)
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
async function updateInhouseDelivery(restaurantId: string, dto: FdoRestaurantInHouseDelivery) {
|
|
102
|
+
await remoteOrderApi.integratedDelivery.updateInhouse(restaurantId, dto)
|
|
103
|
+
}
|
|
104
|
+
async function updateFeedmeDelivery(restaurantId: string, dto: FdoRestaurantFeedmeDelivery) {
|
|
105
|
+
return await remoteOrderApi.integratedDelivery.updateFeedme(restaurantId, dto)
|
|
106
|
+
}
|
|
107
|
+
async function updateIntegratedFoodpandaDelivery(restaurantId: string, dto: FdoFoodpandaSettings) {
|
|
108
|
+
await remoteOrderApi.integratedDelivery.updateFoodpanda(restaurantId, dto)
|
|
109
|
+
}
|
|
110
|
+
async function updateIntegratedGrabfoodDelivery(restaurantId: string, dto: FdoGrabfoodSettings) {
|
|
111
|
+
await remoteOrderApi.integratedDelivery.updateGrabfood(restaurantId, dto)
|
|
112
|
+
}
|
|
113
|
+
async function updateIntegratedShopeefoodDelivery(restaurantId: string, dto: FdoShopeeFoodSettings) {
|
|
114
|
+
await remoteOrderApi.integratedDelivery.updateShopeefood(restaurantId, dto)
|
|
115
|
+
}
|
|
116
|
+
async function updateExternalDelivery(restaurantId: string, dto: FdoExternalSetting) {
|
|
117
|
+
await remoteOrderApi.integratedDelivery.updateExternal(restaurantId, dto)
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function getRestaurantEPayment(): true | string {
|
|
121
|
+
const { t } = useI18n()
|
|
122
|
+
if (!currentRestaurant.value) {
|
|
123
|
+
return 'getRestaurantEPayment - Invalid restaurant ';
|
|
124
|
+
}
|
|
125
|
+
const payoutAccount = currentRestaurant.value.payoutAccount;
|
|
126
|
+
const posVersion = currentRestaurant.value.posVersion;
|
|
127
|
+
|
|
128
|
+
const validPosVersion =
|
|
129
|
+
!!posVersion &&
|
|
130
|
+
Pos.canUse({
|
|
131
|
+
feature: F_FEATURE.enum.qrEPayment,
|
|
132
|
+
posVersion
|
|
133
|
+
})
|
|
134
|
+
|
|
135
|
+
if (!validPosVersion)
|
|
136
|
+
return t('order.payoutPosVersion', { version: Pos.minVersionToUse(F_FEATURE.enum.qrEPayment) })
|
|
137
|
+
if (!payoutAccount || !payoutAccount.enable) {
|
|
138
|
+
return t('order.payoutAccountIsRequired')
|
|
139
|
+
}
|
|
140
|
+
if (payoutAccount.status !== F_PAYOUT_ACCOUNT_STATUS.enum.APPROVED) {
|
|
141
|
+
return t('order.payoutAccountIsRequired')
|
|
142
|
+
}
|
|
143
|
+
return true
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
return {
|
|
147
|
+
state: state.value,
|
|
148
|
+
currentRestaurant: currentRestaurant.value,
|
|
149
|
+
currentRestaurantSetting : currentRestaurantSetting.value,
|
|
150
|
+
readRestaurantSetting,
|
|
151
|
+
selectRestaurant,
|
|
152
|
+
updateServiceCharge,
|
|
153
|
+
updateDineInSetting,
|
|
154
|
+
updatePickupSetting,
|
|
155
|
+
updateInhouseDelivery,
|
|
156
|
+
updateFeedmeDelivery,
|
|
157
|
+
updateIntegratedFoodpandaDelivery,
|
|
158
|
+
updateIntegratedGrabfoodDelivery,
|
|
159
|
+
updateIntegratedShopeefoodDelivery,
|
|
160
|
+
updateExternalDelivery,
|
|
161
|
+
getRestaurantEPayment
|
|
141
162
|
}
|
|
142
163
|
})
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<FmSwitch
|
|
4
|
+
:model-value="v"
|
|
5
|
+
:label="t('order.displayPaxDialogDescription')"
|
|
6
|
+
label-placement="right"
|
|
7
|
+
@update:model-value="updateEnablePaxDialog"
|
|
8
|
+
class="mb-5"
|
|
9
|
+
/>
|
|
10
|
+
</div>
|
|
11
|
+
</template>
|
|
12
|
+
<script setup lang="ts">
|
|
13
|
+
import type { KioskDineInSettingForm } from '@/modules/order-setting/kiosk/interface'
|
|
14
|
+
import { useI18n } from '@feedmepos/mf-common'
|
|
15
|
+
import { computed } from 'vue'
|
|
16
|
+
|
|
17
|
+
const { t } = useI18n()
|
|
18
|
+
|
|
19
|
+
interface Props {
|
|
20
|
+
v: boolean
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
interface Emits {
|
|
24
|
+
(e: 'updateEnablePaxDialog', v: boolean): void
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const props = defineProps<Props>()
|
|
28
|
+
const emits = defineEmits<Emits>()
|
|
29
|
+
|
|
30
|
+
function updateEnablePaxDialog(v: boolean) {
|
|
31
|
+
emits('updateEnablePaxDialog', v)
|
|
32
|
+
}
|
|
33
|
+
</script>
|
|
@@ -24,6 +24,14 @@
|
|
|
24
24
|
@update:model-value="updateMenuItemSetting"
|
|
25
25
|
/>
|
|
26
26
|
</div>
|
|
27
|
+
<div class="flex flex-col gap-2">
|
|
28
|
+
<span class="fm-typo-en-title-sm-600">{{ t('order.displayPaxDialogTitle') }}</span>
|
|
29
|
+
<KioskEnablePaxDialogSection
|
|
30
|
+
:key="'enable-pax-dialog-' + restaurantId"
|
|
31
|
+
:v="enablePaxDialog"
|
|
32
|
+
@update-enable-pax-dialog="updateEnablePaxDialogSetting"
|
|
33
|
+
/>
|
|
34
|
+
</div>
|
|
27
35
|
<div class="flex flex-col gap-2">
|
|
28
36
|
<span class="fm-typo-en-title-sm-600">{{ t('order.acceptedPayment') }}</span>
|
|
29
37
|
<span class="fm-typo-en-title-sm-400 font-bold">{{ t('order.configuration') }}</span>
|
|
@@ -70,6 +78,7 @@ import type {
|
|
|
70
78
|
import { useLoading } from '@/composables/loading'
|
|
71
79
|
import { useSnackbar } from '@feedmepos/ui-library'
|
|
72
80
|
import { useI18n } from '@feedmepos/mf-common'
|
|
81
|
+
import KioskEnablePaxDialogSection from './KioskEnablePaxDialogSection.vue'
|
|
73
82
|
|
|
74
83
|
const { t } = useI18n()
|
|
75
84
|
|
|
@@ -107,6 +116,7 @@ const validKioskOrderSetting = computed<MfKioskOrderSetting | null>(() => {
|
|
|
107
116
|
max: f.dineIn.displayStand.standSlotRange.max ?? 10
|
|
108
117
|
},
|
|
109
118
|
prefix: f.dineIn.displayStand.prefix ?? '',
|
|
119
|
+
enablePaxDialog: f.dineIn.displayStand.enablePaxDialog,
|
|
110
120
|
submitOrderInstruction: {
|
|
111
121
|
payAtCounter: f.dineIn.displayStand.submitOrderInstruction.payAtCounter ?? null,
|
|
112
122
|
paid: f.dineIn.displayStand.submitOrderInstruction.paid ?? null
|
|
@@ -139,6 +149,7 @@ const validKioskOrderSetting = computed<MfKioskOrderSetting | null>(() => {
|
|
|
139
149
|
max: displayStand.standSlotRange.max
|
|
140
150
|
},
|
|
141
151
|
prefix: displayStand.prefix ?? '',
|
|
152
|
+
enablePaxDialog: displayStand.enablePaxDialog,
|
|
142
153
|
submitOrderInstruction: {
|
|
143
154
|
payAtCounter: displayStand.submitOrderInstruction.payAtCounter ?? null,
|
|
144
155
|
paid: displayStand.submitOrderInstruction.paid ?? null
|
|
@@ -163,6 +174,7 @@ const validKioskOrderSetting = computed<MfKioskOrderSetting | null>(() => {
|
|
|
163
174
|
max: f.dineIn.displayStand.standSlotRange.max ?? 10
|
|
164
175
|
},
|
|
165
176
|
prefix: f.dineIn.displayStand.prefix ?? '',
|
|
177
|
+
enablePaxDialog: f.dineIn.displayStand.enablePaxDialog,
|
|
166
178
|
submitOrderInstruction: {
|
|
167
179
|
payAtCounter: f.dineIn.displayStand.submitOrderInstruction.payAtCounter ?? null,
|
|
168
180
|
paid: f.dineIn.displayStand.submitOrderInstruction.paid ?? null
|
|
@@ -199,6 +211,20 @@ const allowEPayment = computed(() => {
|
|
|
199
211
|
return paymentTypes.includes(F_ORDER_PAYMENT_TYPE.enum.ePayment);
|
|
200
212
|
})
|
|
201
213
|
|
|
214
|
+
async function updateEnablePaxDialogSetting(v: boolean) {
|
|
215
|
+
kioskOrderSettingForm.value.dineIn.displayStand.enablePaxDialog = v
|
|
216
|
+
kioskOrderSettingForm.value.dineIn.pickUp.enablePaxDialog = v
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
const enablePaxDialog = computed(() => {
|
|
220
|
+
return (
|
|
221
|
+
((kioskOrderSettingForm.value.dineIn.displayStand.enabled &&
|
|
222
|
+
kioskOrderSettingForm.value.dineIn.displayStand.enablePaxDialog) ||
|
|
223
|
+
kioskOrderSettingForm.value.dineIn.pickUp.enablePaxDialog) ??
|
|
224
|
+
false
|
|
225
|
+
)
|
|
226
|
+
})
|
|
227
|
+
|
|
202
228
|
async function submitForm() {
|
|
203
229
|
if (validKioskOrderSetting.value) {
|
|
204
230
|
const kioskOrderSetting = validKioskOrderSetting.value
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="flex flex-col lg:flex-row md:flex-row sm:flex-row xs:flex-wrap justify-between">
|
|
3
|
-
<RestaurantSelector
|
|
4
|
-
:model-value="currentRestaurant?._id ?? undefined"
|
|
5
|
-
class="xs:order-2 xs:mb-3"
|
|
6
|
-
/>
|
|
3
|
+
<RestaurantSelector class="xs:order-2 xs:mb-3" />
|
|
7
4
|
<FmSearch
|
|
8
5
|
v-model="searchKey"
|
|
9
6
|
:placeholder="t('order.search')"
|
|
@@ -203,8 +200,7 @@ const { t } = useI18n()
|
|
|
203
200
|
const { searchKey, filter } = useSearch()
|
|
204
201
|
const { showSuccess } = useSnackbarFunctions()
|
|
205
202
|
const restaurantStore = useRestaurantStore()
|
|
206
|
-
const {
|
|
207
|
-
useCoreStore()
|
|
203
|
+
const { currentBusiness, readRestaurants, changeRestaurant, sessionUser } = useCoreStore()
|
|
208
204
|
const menuStore = useMenuStore()
|
|
209
205
|
const linkedCompanies = ref<LinkedDeliveryDoc[]>([])
|
|
210
206
|
const deliveryCompanies = ref<DeliveryCompany[]>([])
|
|
@@ -231,6 +227,7 @@ export interface IntegratedDeliveryRow extends DeliveryRow {
|
|
|
231
227
|
}
|
|
232
228
|
|
|
233
229
|
const sideSheet = ref<boolean>(false)
|
|
230
|
+
const currentRestaurant = computed(() => restaurantStore.currentRestaurant)
|
|
234
231
|
const loading = computed(() => {
|
|
235
232
|
return !currentRestaurant.value || loadingDpi.value
|
|
236
233
|
})
|
|
@@ -380,7 +377,7 @@ async function updateInHouse({ key, setting }: IntegratedDeliveryRow) {
|
|
|
380
377
|
}
|
|
381
378
|
}
|
|
382
379
|
|
|
383
|
-
async function updateExternalDelivery(
|
|
380
|
+
async function updateExternalDelivery({ key, setting }: IntegratedDeliveryRow) {
|
|
384
381
|
clearComponentProps()
|
|
385
382
|
const externalSetting = setting as FdoExternalSetting
|
|
386
383
|
|
|
@@ -487,7 +484,7 @@ const external = computed<FdoExternalSetting>(() => {
|
|
|
487
484
|
...deliveryData.initExternalDelivery(),
|
|
488
485
|
...externalSetting.value
|
|
489
486
|
}
|
|
490
|
-
})
|
|
487
|
+
})
|
|
491
488
|
const localDeliveryCompanies = computed<DeliveryRow[]>(() => {
|
|
492
489
|
const res = filterLocalDeliveryCompanies(deliveryCompanies.value).map<DeliveryRow>((company) => {
|
|
493
490
|
const { name, paymentTypeKey, key } = company
|
|
@@ -619,9 +616,9 @@ const integratedCompanies = computed<IntegratedDeliveryRow[]>(() => {
|
|
|
619
616
|
key: AUTO_INTEGRATION_CLIENT.external,
|
|
620
617
|
setting: external.value,
|
|
621
618
|
catalog: '-',
|
|
622
|
-
paymentType: '-',
|
|
623
|
-
status: [generateStatus(false, external.value.enable)]
|
|
624
|
-
}
|
|
619
|
+
paymentType: '-',
|
|
620
|
+
status: [generateStatus(false, external.value.enable)]
|
|
621
|
+
}
|
|
625
622
|
]
|
|
626
623
|
})
|
|
627
624
|
|
|
@@ -828,7 +825,10 @@ async function updateInHouseSetting() {
|
|
|
828
825
|
|
|
829
826
|
async function updateExternalDeliverySetting() {
|
|
830
827
|
sideSheetIntegrated.value = false
|
|
831
|
-
await restaurantStore.updateExternalDelivery(
|
|
828
|
+
await restaurantStore.updateExternalDelivery(
|
|
829
|
+
currentRestaurant.value?._id ?? '',
|
|
830
|
+
externalDoc.value
|
|
831
|
+
)
|
|
832
832
|
const res = (await readRestaurants())?.find((res) => res._id === currentRestaurant.value?._id)
|
|
833
833
|
if (!!res) {
|
|
834
834
|
await changeRestaurant(res)
|
|
@@ -80,16 +80,16 @@ const inhouse = reactive<InhouseDialogData>(
|
|
|
80
80
|
props.initialValue
|
|
81
81
|
? clone(props.initialValue)
|
|
82
82
|
: {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
83
|
+
enable: false,
|
|
84
|
+
catalogId: null,
|
|
85
|
+
term: '',
|
|
86
|
+
areas: [],
|
|
87
|
+
ignoreStock: false,
|
|
88
|
+
paymentTypes: [],
|
|
89
|
+
offlinePaymentTypes: [],
|
|
90
|
+
deliveryTime: null,
|
|
91
|
+
taxes: {}
|
|
92
|
+
}
|
|
93
93
|
)
|
|
94
94
|
|
|
95
95
|
const tax = computed(() => ItemTax.taxSetting())
|
|
@@ -230,12 +230,13 @@ const actualDeliveryTime = computed({
|
|
|
230
230
|
</script>
|
|
231
231
|
|
|
232
232
|
<template>
|
|
233
|
-
<FmSwitch
|
|
234
|
-
:model-value="inhouse.enable"
|
|
235
|
-
:label="t('order.activateDeliveryCompany', {company:'In house'})"
|
|
233
|
+
<FmSwitch
|
|
234
|
+
:model-value="inhouse.enable"
|
|
235
|
+
:label="t('order.activateDeliveryCompany', { company: 'In house' })"
|
|
236
236
|
label-placement="right"
|
|
237
237
|
:sublabel="t('order.inhouseSwitchSublabel')"
|
|
238
|
-
@update:model-value="updateEnable"
|
|
238
|
+
@update:model-value="updateEnable"
|
|
239
|
+
/>
|
|
239
240
|
<div v-if="inhouse.enable">
|
|
240
241
|
<FmCard variant="outlined" class="p-5 mt-10">
|
|
241
242
|
<div class="flex-grow fm-typo-en-title-sm-600 mb-3">{{ t('order.generalSetting') }}</div>
|
|
@@ -272,40 +273,39 @@ const actualDeliveryTime = computed({
|
|
|
272
273
|
<FmCard variant="outlined" class="p-5 mt-10">
|
|
273
274
|
<div class="flex-grow fm-typo-en-title-sm-600 mb-3">
|
|
274
275
|
{{ t('order.taxSetting') }}
|
|
275
|
-
<span
|
|
276
|
-
|
|
277
|
-
v-if="!validPosVersion"
|
|
278
|
-
>
|
|
279
|
-
{{ t('order.taxSettingTerm', {validatePosVersion: minVersionForTax}) }}</span
|
|
276
|
+
<span class="text-fm-color-secondary-salmon fm-typo-en-body-sm-600" v-if="!validPosVersion">
|
|
277
|
+
{{ t('order.taxSettingTerm', { validatePosVersion: minVersionForTax }) }}</span
|
|
280
278
|
>
|
|
281
279
|
</div>
|
|
282
280
|
<div class="mb-5">
|
|
283
|
-
<FmSwitch
|
|
284
|
-
:model-value="hasInhouseDeliveryTax && validPosVersion"
|
|
281
|
+
<FmSwitch
|
|
282
|
+
:model-value="hasInhouseDeliveryTax && validPosVersion"
|
|
285
283
|
:disabled="!validPosVersion"
|
|
286
|
-
:label="t('order.inhouseDeliveryTaxLabel')"
|
|
287
|
-
label-placement="right"
|
|
284
|
+
:label="t('order.inhouseDeliveryTaxLabel')"
|
|
285
|
+
label-placement="right"
|
|
288
286
|
:sublabel="t('order.inhouseDeliveryTaxSublabel')"
|
|
289
|
-
@update:model-value="toggleTax"
|
|
287
|
+
@update:model-value="toggleTax"
|
|
288
|
+
/>
|
|
290
289
|
</div>
|
|
291
290
|
<div v-if="hasInhouseDeliveryTax && validPosVersion">
|
|
292
291
|
<div class="mb-5">
|
|
293
|
-
<TaxInput
|
|
294
|
-
:disable="!validPosVersion"
|
|
295
|
-
:model-value="taxSettings"
|
|
292
|
+
<TaxInput
|
|
293
|
+
:disable="!validPosVersion"
|
|
294
|
+
:model-value="taxSettings"
|
|
296
295
|
:tax-options="taxOptions"
|
|
297
296
|
:title="`${tax.systemCode} ${t('order.inhouseDeliveryInputLabel')}`"
|
|
298
|
-
@update:model-value="(ev) => updateTax(ev)"
|
|
297
|
+
@update:model-value="(ev) => updateTax(ev)"
|
|
299
298
|
/>
|
|
300
299
|
</div>
|
|
301
300
|
<div class="mb-5">
|
|
302
|
-
<FmRadioGroup
|
|
303
|
-
:disabled="!validPosVersion"
|
|
304
|
-
:model-value="taxInclusive"
|
|
305
|
-
label-mark="required"
|
|
301
|
+
<FmRadioGroup
|
|
302
|
+
:disabled="!validPosVersion"
|
|
303
|
+
:model-value="taxInclusive"
|
|
304
|
+
label-mark="required"
|
|
306
305
|
inline
|
|
307
306
|
:label="t('order.inhouseDeliveryTaxCalculation')"
|
|
308
|
-
@update:model-value="(ev) => updateTaxInclusive(ev as unknown as number)"
|
|
307
|
+
@update:model-value="(ev) => updateTaxInclusive(ev as unknown as number)"
|
|
308
|
+
>
|
|
309
309
|
<div v-for="option in taxInclusiveOptions" :key="option.value">
|
|
310
310
|
<FmRadio :value="option.value" :label="option.label" />
|
|
311
311
|
</div>
|
|
@@ -315,8 +315,12 @@ const actualDeliveryTime = computed({
|
|
|
315
315
|
</FmCard>
|
|
316
316
|
|
|
317
317
|
<FmCard variant="outlined" class="p-5 mt-10">
|
|
318
|
-
<PaymentSidesheet
|
|
319
|
-
:
|
|
318
|
+
<PaymentSidesheet
|
|
319
|
+
:paymentTypes="inhouse.paymentTypes"
|
|
320
|
+
:offlinePaymentTypes="inhouse.offlinePaymentTypes"
|
|
321
|
+
:allow-e-payment="restaurantStore.getRestaurantEPayment()"
|
|
322
|
+
@update:payments="updatePayment"
|
|
323
|
+
/>
|
|
320
324
|
</FmCard>
|
|
321
325
|
|
|
322
326
|
<FmCard variant="outlined" class="p-5 mt-10">
|