@feedmepos/mf-order-setting 0.0.26 → 0.0.28
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-BiF6v7Zj.js → KioskDevicesView-BgXkmJ7v.js} +1 -1
- package/dist/KioskDevicesView.vue_vue_type_script_setup_true_lang-DZT0BuUN.js +301 -0
- package/dist/{KioskSettingView-COhGcRtP.js → KioskSettingView-DyX3Wv_2.js} +3 -3
- package/dist/{KioskView-C1T-n1MY.js → KioskView-Bgff7QPc.js} +5 -5
- package/dist/OrderSettingsView-C63s4uCD.js +74334 -0
- package/dist/app-Dp79Gu_F.js +1016 -0
- package/dist/app.js +1 -1
- package/dist/{dayjs.min-BHDLv42p.js → dayjs.min-B2ZkfNUH.js} +633 -641
- package/dist/frontend/mf-order/src/App.vue.d.ts +1 -1
- package/dist/frontend/mf-order/src/Entry.vue.d.ts +1 -1
- package/dist/frontend/mf-order/src/api/business/index.d.ts +5 -0
- package/dist/frontend/mf-order/src/api/effects/index.d.ts +3 -0
- package/dist/frontend/mf-order/src/api/index.d.ts +2 -0
- package/dist/frontend/mf-order/src/api/kiosk/index.d.ts +2 -0
- package/dist/frontend/mf-order/src/app.d.ts +336 -0
- package/dist/frontend/mf-order/src/components/GoogleMap.vue.d.ts +3 -5
- package/dist/frontend/mf-order/src/main.d.ts +79 -0
- package/dist/frontend/mf-order/src/modules/kiosk/interface.d.ts +5 -1
- package/dist/frontend/mf-order/src/stores/business/index.d.ts +62 -0
- package/dist/frontend/mf-order/src/stores/kiosk/index.d.ts +16 -1
- package/dist/frontend/mf-order/src/stores/menu/menu.d.ts +207 -112
- package/dist/frontend/mf-order/src/stores/restaurant/index.d.ts +81 -78
- package/dist/frontend/mf-order/src/views/all-orders/ActionMenuCell.vue.d.ts +2 -2
- package/dist/frontend/mf-order/src/views/all-orders/FilterRestaurant.vue.d.ts +1 -1
- package/dist/frontend/mf-order/src/views/all-orders/FilterStatus.vue.d.ts +2 -2
- package/dist/frontend/mf-order/src/views/all-orders/FilterStatusMenu.vue.d.ts +2 -2
- package/dist/frontend/mf-order/src/views/all-orders/ReflowOrder.vue.d.ts +56 -54
- package/dist/frontend/mf-order/src/views/all-orders/UpdateDeliveryOrderDialog.vue.d.ts +2 -2
- package/dist/frontend/mf-order/src/views/kiosk/KioskSummary.vue.d.ts +1 -1
- package/dist/frontend/mf-order/src/views/kiosk/KioskView.vue.d.ts +1 -1
- package/dist/frontend/mf-order/src/views/kiosk/devices/KioskDeviceCard.vue.d.ts +1 -1
- package/dist/frontend/mf-order/src/views/kiosk/devices/KioskDeviceDetail.vue.d.ts +1 -1
- package/dist/frontend/mf-order/src/views/kiosk/devices/KioskDevicesView.vue.d.ts +1 -1
- package/dist/frontend/mf-order/src/views/kiosk/devices/KioskOtpDialog.vue.d.ts +1 -1
- package/dist/frontend/mf-order/src/views/kiosk/devices/KioskUnbindConfirm.vue.d.ts +2 -2
- package/dist/frontend/mf-order/src/views/kiosk/settings/KioskDineInSection.vue.d.ts +2 -2
- package/dist/frontend/mf-order/src/views/kiosk/settings/KioskDisplayStandSection.vue.d.ts +2 -2
- package/dist/frontend/mf-order/src/views/kiosk/settings/KioskEnablePaxDialogSection.vue.d.ts +2 -2
- package/dist/frontend/mf-order/src/views/kiosk/settings/KioskInstructionSection.vue.d.ts +2 -2
- package/dist/frontend/mf-order/src/views/kiosk/settings/KioskMenuItemSection.vue.d.ts +1 -1
- package/dist/frontend/mf-order/src/views/kiosk/settings/KioskPaymentTypeSection.vue.d.ts +1 -1
- package/dist/frontend/mf-order/src/views/kiosk/settings/KioskPickAtCounterSection.vue.d.ts +2 -2
- package/dist/frontend/mf-order/src/views/kiosk/settings/KioskSettingView.vue.d.ts +1 -1
- package/dist/frontend/mf-order/src/views/kiosk/settings/KioskTakeawaySection.vue.d.ts +2 -2
- package/dist/frontend/mf-order/src/views/order-settings/delivery/DeliveryList.vue.d.ts +2 -2
- package/dist/frontend/mf-order/src/views/order-settings/delivery/components/ManualIntegratedDeliverySetting.vue.d.ts +1 -1
- package/dist/frontend/mf-order/src/views/order-settings/delivery/components/TaxInput.vue.d.ts +2 -2
- package/dist/frontend/mf-order/src/views/order-settings/delivery/inhouse/CurrencyInput.vue.d.ts +1 -1
- package/dist/frontend/mf-order/src/views/order-settings/delivery/inhouse/DeliveryCustomTime.vue.d.ts +1 -1
- package/dist/frontend/mf-order/src/views/order-settings/delivery/inhouse/DeliveryOrder.vue.d.ts +6 -141
- package/dist/frontend/mf-order/src/views/order-settings/delivery/inhouse/DeliveryTime.vue.d.ts +1 -1
- package/dist/frontend/mf-order/src/views/order-settings/delivery/inhouse/InHouseDelivery.vue.d.ts +1 -1
- package/dist/frontend/mf-order/src/views/order-settings/delivery/inhouse/TimePicker.vue.d.ts +1 -1
- package/dist/frontend/mf-order/src/views/order-settings/delivery/inhouse/ZoneDialog.vue.d.ts +1 -1
- package/dist/frontend/mf-order/src/views/order-settings/delivery/integrated-delivery/ExternalSetting.vue.d.ts +6 -2
- package/dist/frontend/mf-order/src/views/order-settings/delivery/integrated-delivery/FeedmeDelivery.vue.d.ts +1 -1
- package/dist/frontend/mf-order/src/views/order-settings/delivery/integrated-delivery/FoodpandaCampaignDialog.vue.d.ts +1 -1
- package/dist/frontend/mf-order/src/views/order-settings/delivery/integrated-delivery/FoodpandaSetting.vue.d.ts +1 -1
- package/dist/frontend/mf-order/src/views/order-settings/delivery/integrated-delivery/GrabfoodSetting.vue.d.ts +1 -1
- package/dist/frontend/mf-order/src/views/order-settings/delivery/integrated-delivery/IntegratedDelivery.vue.d.ts +5 -5
- package/dist/frontend/mf-order/src/views/order-settings/delivery/integrated-delivery/ShopeefoodSetting.vue.d.ts +1 -1
- package/dist/frontend/mf-order/src/views/order-settings/dine-in/OfflinePaymentTypeDialog.vue.d.ts +1 -1
- package/dist/frontend/mf-order/src/views/order-settings/dine-in/OfflinePaymentTypeDialogContent.vue.d.ts +2 -2
- package/dist/frontend/mf-order/src/views/order-settings/dine-in/PaymentType.vue.d.ts +1 -1
- package/dist/frontend/mf-order/src/views/order-settings/discount-rule/DiscountRuleSetting.vue.d.ts +2 -0
- package/dist/frontend/mf-order/src/views/order-settings/pickup/AddressInput.vue.d.ts +1 -1
- package/dist/frontend/mf-order/src/views/order-settings/pickup/CustomPayment.vue.d.ts +1 -1
- package/dist/frontend/mf-order/src/views/order-settings/pickup/PaymentSidesheet.vue.d.ts +2 -2
- package/dist/frontend/mf-order/src/views/order-settings/pickup/PickUpPointDialog.vue.d.ts +1 -1
- package/dist/frontend/mf-order/src/views/order-settings/pickup/PickUpPointDialogContent.vue.d.ts +2 -137
- package/dist/frontend/mf-order/src/views/order-settings/pickup/PickUpSettingDialog.vue.d.ts +1 -1
- package/dist/frontend/mf-order/src/views/order-settings/pickup/PickUpSettingDialogContent.vue.d.ts +1 -1
- package/dist/frontend/mf-order/src/views/order-settings/pickup/PickupList.vue.d.ts +2 -2
- package/dist/frontend/mf-order/src/views/order-settings/pickup/Preorder.vue.d.ts +1 -1
- package/dist/frontend/mf-order/src/views/order-settings/servicecharge/RateInput.vue.d.ts +1 -1
- package/dist/frontend/mf-order/src/views/order-settings/servicecharge/ServiceChargeRule.vue.d.ts +1 -1
- package/dist/frontend/mf-order/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{index-DSCb3ndM.js → index-BXsnV_eO.js} +5 -5
- package/dist/{index-B5kfsi9C.js → index-DzQn92Tp.js} +2 -2
- package/dist/package/entity/booking/booking.do.d.ts +596 -551
- package/dist/package/entity/cursor/cursor.dto.d.ts +2 -2
- package/dist/package/entity/delivery/delivery.dto.d.ts +118 -109
- package/dist/package/entity/incoming-order/incoming-order-to-bill.dto.d.ts +349 -659
- package/dist/package/entity/incoming-order/incoming-order.do.d.ts +13800 -487
- package/dist/package/entity/incoming-order/incoming-order.dto.d.ts +746 -1245
- package/dist/package/entity/incoming-order/incoming-order.enum.d.ts +1 -1
- package/dist/package/entity/index.d.ts +1 -0
- package/dist/package/entity/kiosk/kiosk.do.d.ts +64 -0
- package/dist/package/entity/kiosk/kiosk.dto.d.ts +79 -0
- package/dist/package/entity/kiosk/marketing/marketing.dto.d.ts +1469 -621
- package/dist/package/entity/member/member.dto.d.ts +14 -7
- package/dist/package/entity/order/dine-in/dine-in.do.d.ts +8 -8
- package/dist/package/entity/order/dine-in/dine-in.dto.d.ts +4 -4
- package/dist/package/entity/order/effects/effect.dto.d.ts +154 -6
- package/dist/package/entity/order/menu/menu.dto.d.ts +12 -12
- package/dist/package/entity/order/order-item/order-item.dto.d.ts +101 -42
- package/dist/package/entity/order/order.do.d.ts +206 -601
- package/dist/package/entity/order/order.dto.d.ts +1096 -1600
- package/dist/package/entity/order/order.enum.d.ts +2 -2
- package/dist/package/entity/order-platform/external/menu/external-menu.dto.d.ts +8 -0
- package/dist/package/entity/order-platform/external/order/external-order.do.d.ts +8 -0
- package/dist/package/entity/order-platform/external/order/external-order.dto.d.ts +22 -3
- package/dist/package/entity/order-platform/external/order/external-order.enum.d.ts +1 -1
- package/dist/package/entity/order-platform/external/setting/external-setting.do.d.ts +5 -0
- package/dist/package/entity/order-platform/external/setting/external-setting.dto.d.ts +5 -0
- package/dist/package/entity/order-platform/external/zus/zus-menu.dto.d.ts +192 -0
- package/dist/package/entity/order-platform/foodpanda/foodpanda-order.do.d.ts +104 -0
- package/dist/package/entity/order-platform/foodpanda/foodpanda-order.dto.d.ts +152 -109
- package/dist/package/entity/order-platform/foodpanda/foodpanda-settings.do.d.ts +3 -0
- package/dist/package/entity/order-platform/foodpanda/foodpanda-settings.dto.d.ts +3 -0
- package/dist/package/entity/order-platform/foodpanda/foodpanda.enum.d.ts +2 -0
- package/dist/package/entity/order-platform/grabfood/grabfood-order.do.d.ts +139 -109
- package/dist/package/entity/order-platform/grabfood/grabfood-settings.do.d.ts +3 -0
- package/dist/package/entity/order-platform/grabfood/grabfood.dto.d.ts +112 -2
- package/dist/package/entity/order-platform/menu.dto.d.ts +31 -0
- package/dist/package/entity/order-platform/order-platform.dto.d.ts +6 -3
- package/dist/package/entity/order-platform/shopeefood/shopeefood-order.do.d.ts +164 -109
- package/dist/package/entity/order-platform/shopeefood/shopeefood-order.dto.d.ts +22 -0
- package/dist/package/entity/order-platform/shopeefood/shopeefood-settings.do.d.ts +3 -0
- package/dist/package/entity/order-platform/shopeefood/shopeefood-settings.dto.d.ts +3 -0
- package/dist/{queue.do-y-ubeoKZ.js → queue.do-BUtcyDk3.js} +53522 -50841
- package/package.json +4 -3
- package/src/api/business/index.ts +16 -0
- package/src/api/effects/index.ts +7 -0
- package/src/api/index.ts +9 -1
- package/src/api/kiosk/index.ts +9 -4
- package/src/app.ts +4 -1
- package/src/locales/en-US.json +24 -1
- package/src/locales/th-TH.json +31 -1
- package/src/locales/zh-CN.json +27 -1
- package/src/modules/kiosk/interface.ts +5 -1
- package/src/stores/business/index.ts +45 -0
- package/src/stores/kiosk/index.ts +9 -4
- package/src/stores/kiosk/mapper.ts +5 -1
- package/src/stores/restaurant/index.ts +3 -1
- package/src/views/kiosk/devices/KioskDeviceCard.vue +202 -80
- package/src/views/order-settings/OrderSettingsView.vue +17 -5
- package/src/views/order-settings/delivery/DeliverySetting.vue +1 -1
- package/src/views/order-settings/delivery/delivery.data.ts +2 -2
- package/src/views/order-settings/delivery/integrated-delivery/ExternalSetting.vue +14 -2
- package/src/views/order-settings/delivery/integrated-delivery/FoodpandaSetting.vue +2 -34
- package/src/views/order-settings/delivery/integrated-delivery/IntegratedDelivery.vue +15 -12
- package/src/views/order-settings/discount-rule/DiscountRuleSetting.vue +434 -0
- package/dist/KioskDevicesView.vue_vue_type_script_setup_true_lang-1r_DBAc-.js +0 -207
- package/dist/OrderSettingsView-CI5bdVXr.js +0 -72108
- package/dist/app-BfWp4ow3.js +0 -682
|
@@ -1,53 +1,118 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
2
|
+
<div class="border fm-corner-radius-lg flex justify-between pr-[1rem] w-11/12">
|
|
3
|
+
<FmSideSheet
|
|
4
|
+
:header="t('order.deviceDetails')"
|
|
5
|
+
dismiss-away
|
|
6
|
+
class="w-full"
|
|
7
|
+
:maxWidth="700"
|
|
8
|
+
@on:clickedAway="closeUpdateDevicePin"
|
|
9
|
+
>
|
|
10
|
+
<template #side-sheet-button>
|
|
11
|
+
<FmListItem
|
|
12
|
+
class="flex-1"
|
|
13
|
+
:label="device.name"
|
|
14
|
+
:sublabel="`${t('order.activatedDate')}: ${dayjs(device.activatedAt).format('DD MMM YYYY HH:mm')}`"
|
|
15
|
+
>
|
|
16
|
+
</FmListItem>
|
|
17
|
+
</template>
|
|
18
|
+
<div v-if="!showPinSetting" class="py-[1rem] flex flex-col gap-6">
|
|
19
|
+
<span class="fm-typo-en-title-sm-600">{{ device.name }}</span>
|
|
20
|
+
<div class="w-full border p-[1.5rem] fm-corner-radius-lg flex flex-col gap-2">
|
|
21
|
+
<span class="fm-typo-en-title-sm-600 mb-3">App Info</span>
|
|
22
|
+
<div class="flex flex-col gap-1 mb-2">
|
|
23
|
+
<span class="fm-typo-en-body-lg-400 text-fm-color-typo-secondary">Type</span>
|
|
24
|
+
<span class="fm-typo-en-body-lg-600 block">{{ appType }}</span>
|
|
25
|
+
</div>
|
|
26
|
+
<div class="flex flex-col gap-1 mb-2">
|
|
27
|
+
<span class="fm-typo-en-body-lg-400 text-fm-color-typo-secondary">Version</span>
|
|
28
|
+
<span class="fm-typo-en-body-lg-600 block">{{
|
|
29
|
+
device.deviceAppVersion ?? 'Below 0.0.42'
|
|
30
|
+
}}</span>
|
|
31
|
+
</div>
|
|
32
|
+
<div class="flex flex-col gap-1 mb-2">
|
|
33
|
+
<span class="fm-typo-en-body-lg-400 text-fm-color-typo-secondary">PIN Code</span>
|
|
34
|
+
<span class="fm-typo-en-body-lg-600 block">{{ isPinUpdate ? 'Yes' : 'No' }}</span>
|
|
35
|
+
</div>
|
|
36
|
+
<FmButton
|
|
37
|
+
class="w-auto"
|
|
38
|
+
variant="primary"
|
|
39
|
+
:label="device?.pinInfo ? 'Reset Device PIN' : 'Set Device PIN'"
|
|
40
|
+
@click="showUpdateDevicePin"
|
|
41
|
+
/>
|
|
42
|
+
</div>
|
|
43
|
+
<div
|
|
44
|
+
v-for="config in configs.filter((c) => c[1])"
|
|
45
|
+
class="w-full border p-[1.5rem] fm-corner-radius-lg flex flex-col gap-2"
|
|
46
|
+
>
|
|
47
|
+
<span class="fm-typo-en-title-sm-600" v-if="config[1]">{{ config[0] }}</span>
|
|
48
|
+
<div
|
|
49
|
+
class="flex flex-col gap-1"
|
|
50
|
+
v-if="config[1]"
|
|
51
|
+
v-for="configEntry in Object.entries(config[1])"
|
|
52
|
+
>
|
|
53
|
+
<span class="fm-typo-en-body-lg-400 text-fm-color-typo-secondary">{{
|
|
54
|
+
configEntry[0]
|
|
55
|
+
}}</span>
|
|
56
|
+
<span class="fm-typo-en-body-lg-600 block">{{
|
|
57
|
+
configEntry[1] == '' ? '-' : configEntry[1]
|
|
58
|
+
}}</span>
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
<div v-else>
|
|
63
|
+
<div class="py-[1rem] flex flex-col gap-6 text-center items-center">
|
|
64
|
+
<div class="flex flex-col gap-1 mb-2">
|
|
65
|
+
<span class="fm-typo-en-body-lg-400 text-fm-color-typo-secondary">{{ pinText }}</span>
|
|
66
|
+
<span class="mt-5 block">
|
|
67
|
+
<FmPinField v-if="!isPinEntered" :length="4" @complete="(val) => pinEntered(val)" />
|
|
68
|
+
<FmPinField v-if="isPinEntered" :length="4" @complete="(val) => pinEntered(val)" />
|
|
69
|
+
</span>
|
|
70
|
+
</div>
|
|
71
|
+
<FmButton
|
|
72
|
+
class="w-1/3"
|
|
73
|
+
variant="secondary"
|
|
74
|
+
label="Cancel reset PIN"
|
|
75
|
+
@click="closeUpdateDevicePin"
|
|
76
|
+
/>
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
</FmSideSheet>
|
|
80
|
+
<FmButton
|
|
81
|
+
variant="plain"
|
|
82
|
+
append-icon="link_off"
|
|
83
|
+
class="text-fm-color-system-error-300 align-middle my-auto"
|
|
84
|
+
@click="openUnbindDialog"
|
|
85
|
+
/>
|
|
86
|
+
</div>
|
|
27
87
|
</template>
|
|
28
88
|
<script setup lang="ts">
|
|
29
|
-
import type { MfKioskDevice } from '@/modules/kiosk/interface'
|
|
30
|
-
import { type SnackbarPosition, useDialog, useSnackbar } from '@feedmepos/ui-library'
|
|
31
|
-
import KioskUnbindConfirm from './KioskUnbindConfirm.vue'
|
|
32
|
-
import { computed, ref } from 'vue'
|
|
33
|
-
import { useKioskStore } from '@/stores/kiosk'
|
|
34
|
-
import dayjs from 'dayjs'
|
|
89
|
+
import type { MfKioskDevice } from '@/modules/kiosk/interface'
|
|
90
|
+
import { type SnackbarPosition, useDialog, useSnackbar } from '@feedmepos/ui-library'
|
|
91
|
+
import KioskUnbindConfirm from './KioskUnbindConfirm.vue'
|
|
92
|
+
import { computed, onUnmounted, ref } from 'vue'
|
|
93
|
+
import { useKioskStore } from '@/stores/kiosk'
|
|
94
|
+
import dayjs from 'dayjs'
|
|
35
95
|
import { useI18n } from '@feedmepos/mf-common'
|
|
36
96
|
|
|
37
97
|
const { t } = useI18n()
|
|
38
98
|
|
|
39
|
-
const Dialog = useDialog()
|
|
40
|
-
const Snackbar = useSnackbar()
|
|
41
|
-
const Kiosk = useKioskStore()
|
|
99
|
+
const Dialog = useDialog()
|
|
100
|
+
const Snackbar = useSnackbar()
|
|
101
|
+
const Kiosk = useKioskStore()
|
|
102
|
+
const showPinSetting = ref(false)
|
|
42
103
|
|
|
43
104
|
interface Props {
|
|
44
|
-
|
|
105
|
+
device: MfKioskDevice
|
|
45
106
|
}
|
|
46
|
-
const props = defineProps<Props>()
|
|
47
|
-
const unBindTextFieldValue = ref<string>('')
|
|
107
|
+
const props = defineProps<Props>()
|
|
108
|
+
const unBindTextFieldValue = ref<string>('')
|
|
48
109
|
|
|
49
110
|
const configs = computed(() => {
|
|
50
|
-
|
|
111
|
+
return Object.entries(props.device.config)
|
|
112
|
+
})
|
|
113
|
+
|
|
114
|
+
const appType = computed(() => {
|
|
115
|
+
return props.device?.deviceAppType === 'TABLET_APP' ? 'Tablet App' : 'Kiosk App'
|
|
51
116
|
})
|
|
52
117
|
|
|
53
118
|
// function showDeviceDetails() {
|
|
@@ -61,49 +126,106 @@ const configs = computed(() => {
|
|
|
61
126
|
// }
|
|
62
127
|
|
|
63
128
|
function openUnbindDialog() {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
});
|
|
129
|
+
unBindTextFieldValue.value = ''
|
|
130
|
+
Dialog.open({
|
|
131
|
+
title: t('order.unbindKioskDevice'),
|
|
132
|
+
contentComponent: KioskUnbindConfirm,
|
|
133
|
+
contentComponentProps: {
|
|
134
|
+
machineId: props.device.machineId,
|
|
135
|
+
'onUpdate:modelValue': (v: string) => {
|
|
136
|
+
unBindTextFieldValue.value = v
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
dismissAway: false,
|
|
140
|
+
primaryActions: {
|
|
141
|
+
text: t('order.unbind'),
|
|
142
|
+
variant: 'destructive',
|
|
143
|
+
close: false
|
|
144
|
+
},
|
|
145
|
+
secondaryActions: {
|
|
146
|
+
text: t('order.cancel'),
|
|
147
|
+
variant: 'tertiary',
|
|
148
|
+
close: true
|
|
149
|
+
}
|
|
150
|
+
}).onPrimary(async () => {
|
|
151
|
+
if (unBindTextFieldValue.value == props.device.machineId) {
|
|
152
|
+
await unbind()
|
|
153
|
+
Snackbar.open({
|
|
154
|
+
type: 'success',
|
|
155
|
+
message: t('order.unbindSuccess'),
|
|
156
|
+
position: 'bottom' as SnackbarPosition
|
|
157
|
+
})
|
|
158
|
+
Dialog.close()
|
|
159
|
+
} else {
|
|
160
|
+
Snackbar.open({
|
|
161
|
+
type: 'warning',
|
|
162
|
+
message: t('order.unbindWarning'),
|
|
163
|
+
position: 'bottom' as SnackbarPosition
|
|
164
|
+
})
|
|
165
|
+
}
|
|
166
|
+
})
|
|
103
167
|
}
|
|
104
168
|
|
|
105
|
-
|
|
106
|
-
|
|
169
|
+
const isPinUpdate = computed(() => {
|
|
170
|
+
return props.device?.pinInfo
|
|
171
|
+
})
|
|
172
|
+
|
|
173
|
+
const pinText = computed(() => {
|
|
174
|
+
return isPinEntered.value ? 'Re-enter new PIN' : 'Enter new PIN'
|
|
175
|
+
})
|
|
176
|
+
|
|
177
|
+
const isPinEntered = ref(false)
|
|
178
|
+
const enteredPin = ref()
|
|
179
|
+
const reEnteredPin = ref()
|
|
180
|
+
|
|
181
|
+
function showUpdateDevicePin() {
|
|
182
|
+
showPinSetting.value = true
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
function closeUpdateDevicePin() {
|
|
186
|
+
isPinEntered.value = false
|
|
187
|
+
enteredPin.value = null
|
|
188
|
+
reEnteredPin.value = null
|
|
189
|
+
showPinSetting.value = false
|
|
107
190
|
}
|
|
108
191
|
|
|
109
|
-
|
|
192
|
+
function pinEntered(pinVal: string) {
|
|
193
|
+
if (isPinEntered.value) {
|
|
194
|
+
reEnteredPin.value = pinVal
|
|
195
|
+
validatePin()
|
|
196
|
+
} else {
|
|
197
|
+
enteredPin.value = pinVal
|
|
198
|
+
isPinEntered.value = true
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
function checkCurrentPin(pinVal: string) {
|
|
203
|
+
return isPinUpdate.value && pinVal !== props.device?.pinInfo
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
async function validatePin() {
|
|
207
|
+
if (enteredPin.value === reEnteredPin.value) {
|
|
208
|
+
await updateDevicePin()
|
|
209
|
+
Snackbar.open({
|
|
210
|
+
type: 'success',
|
|
211
|
+
message: 'Successfuly update device PIN',
|
|
212
|
+
position: 'top' as SnackbarPosition
|
|
213
|
+
})
|
|
214
|
+
} else {
|
|
215
|
+
Snackbar.open({
|
|
216
|
+
type: 'error',
|
|
217
|
+
message: 'Entered PIN not the same, please try again',
|
|
218
|
+
position: 'top' as SnackbarPosition
|
|
219
|
+
})
|
|
220
|
+
}
|
|
221
|
+
closeUpdateDevicePin()
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
async function updateDevicePin() {
|
|
225
|
+
await Kiosk.updateDevicePin(enteredPin.value, props.device.machineId)
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
async function unbind() {
|
|
229
|
+
await Kiosk.unbind(props.device.machineId)
|
|
230
|
+
}
|
|
231
|
+
</script>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="py-[1.5rem]">
|
|
3
|
-
<FmPageHead :title="t('order.orderSetting')"/>
|
|
3
|
+
<FmPageHead :title="t('order.orderSetting')" />
|
|
4
4
|
<div class="flex px-[1.5rem]">
|
|
5
5
|
<div class="flex-[2_2_0%] overflow-auto">
|
|
6
|
-
<FmTabs v-model:model-value="selectedOrderSetting" :items="settingItem" />
|
|
6
|
+
<FmTabs v-model:model-value="selectedOrderSetting" :items="settingItem" :showMoreAt="99" />
|
|
7
7
|
</div>
|
|
8
8
|
</div>
|
|
9
9
|
</div>
|
|
@@ -18,11 +18,20 @@ import DineInSetting from './dine-in/DineInSetting.vue'
|
|
|
18
18
|
import PickUpSetting from './pickup/PickUpSetting.vue'
|
|
19
19
|
import SmsSetting from './sms/SmsSetting.vue'
|
|
20
20
|
import ServiceChargeSetting from './servicecharge/ServiceChargeSetting.vue'
|
|
21
|
+
import DiscountRuleSetting from './discount-rule/DiscountRuleSetting.vue'
|
|
22
|
+
|
|
21
23
|
import GeneralSetting from './general/GeneralSetting.vue'
|
|
22
24
|
import { useI18n } from '@feedmepos/mf-common'
|
|
23
25
|
|
|
24
26
|
const { t } = useI18n()
|
|
25
|
-
type OrderSettingMenuItemValue =
|
|
27
|
+
type OrderSettingMenuItemValue =
|
|
28
|
+
| 'delivery'
|
|
29
|
+
| 'pickup'
|
|
30
|
+
| 'dinein'
|
|
31
|
+
| 'servicecharge'
|
|
32
|
+
| 'sms'
|
|
33
|
+
| 'discountRule'
|
|
34
|
+
| 'general'
|
|
26
35
|
const selectedOrderSetting = ref<OrderSettingMenuItemValue>('delivery')
|
|
27
36
|
|
|
28
37
|
const settingItem = computed<FmTabProps[]>(() => [
|
|
@@ -30,8 +39,9 @@ const settingItem = computed<FmTabProps[]>(() => [
|
|
|
30
39
|
{ label: t('order.pickup'), value: 'pickup' },
|
|
31
40
|
{ label: t('order.dineIn'), value: 'dinein' },
|
|
32
41
|
{ label: t('order.serviceCharge'), value: 'servicecharge' },
|
|
42
|
+
{ label: t('order.discountRule.title'), value: 'discountRule' },
|
|
33
43
|
{ label: t('order.sms'), value: 'sms' },
|
|
34
|
-
{ label: t('order.general'), value: 'general'}
|
|
44
|
+
{ label: t('order.general'), value: 'general' }
|
|
35
45
|
])
|
|
36
46
|
|
|
37
47
|
const currentComponent = computed(() => {
|
|
@@ -46,7 +56,9 @@ const currentComponent = computed(() => {
|
|
|
46
56
|
return SmsSetting
|
|
47
57
|
case 'servicecharge':
|
|
48
58
|
return ServiceChargeSetting
|
|
49
|
-
case '
|
|
59
|
+
case 'discountRule':
|
|
60
|
+
return DiscountRuleSetting
|
|
61
|
+
case 'general':
|
|
50
62
|
return GeneralSetting
|
|
51
63
|
}
|
|
52
64
|
})
|
|
@@ -459,7 +459,7 @@ const foodpanda = computed<FdoFoodpandaSettings>(() => {
|
|
|
459
459
|
return {
|
|
460
460
|
...deliveryData.initFoodpandaDelivery(),
|
|
461
461
|
...foodpandaSetting.value,
|
|
462
|
-
autoAccept: foodpandaSetting?.value?.autoAccept ??
|
|
462
|
+
autoAccept: foodpandaSetting?.value?.autoAccept ?? true,
|
|
463
463
|
ignoreDiscount: foodpandaSetting?.value?.ignoreDiscount ?? false
|
|
464
464
|
}
|
|
465
465
|
})
|
|
@@ -39,7 +39,7 @@ export function initFoodpandaDelivery(): FdoFoodpandaSettings {
|
|
|
39
39
|
discountCampaigns: [],
|
|
40
40
|
commissionRate: 0
|
|
41
41
|
},
|
|
42
|
-
autoAccept:
|
|
42
|
+
autoAccept: true
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
45
|
|
|
@@ -72,7 +72,7 @@ function initExternalDelivery(): FdoExternalSetting {
|
|
|
72
72
|
_id: '',
|
|
73
73
|
enable: false,
|
|
74
74
|
config: {
|
|
75
|
-
autoAccept:
|
|
75
|
+
autoAccept: true,
|
|
76
76
|
autoSend: false,
|
|
77
77
|
autoCloseBill: false,
|
|
78
78
|
},
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
:label="t('order.activateIntegration', { integrationType: t('order.auto') })"
|
|
6
6
|
label-placement="right"
|
|
7
7
|
@update:model-value="updateEnable"
|
|
8
|
+
:disabled="!canEdit"
|
|
8
9
|
/>
|
|
9
10
|
<div v-if="data.enable">
|
|
10
11
|
<FmCard variant="outlined" class="mt-10 p-5">
|
|
@@ -17,6 +18,7 @@
|
|
|
17
18
|
:label="t('order.platform')"
|
|
18
19
|
:items="platformOptions"
|
|
19
20
|
@update:model-value="updatePlatform"
|
|
21
|
+
:disabled="!canEdit"
|
|
20
22
|
/>
|
|
21
23
|
|
|
22
24
|
<FmSelect
|
|
@@ -26,6 +28,7 @@
|
|
|
26
28
|
:label="t('order.deliveryCatalog')"
|
|
27
29
|
:items="menuStore.catalogOptions"
|
|
28
30
|
@update:model-value="updateDeliveryMenuCatalog"
|
|
31
|
+
:disabled="!canEdit"
|
|
29
32
|
/>
|
|
30
33
|
|
|
31
34
|
<FmSelect
|
|
@@ -35,11 +38,17 @@
|
|
|
35
38
|
:label="t('order.pickupCatalog')"
|
|
36
39
|
:items="menuStore.catalogOptions"
|
|
37
40
|
@update:model-value="updatePickupMenuCatalog"
|
|
41
|
+
:disabled="!canEdit"
|
|
38
42
|
/>
|
|
39
43
|
</div>
|
|
40
44
|
|
|
41
45
|
<div class="flex flex-row mt-5">
|
|
42
|
-
<FmButton
|
|
46
|
+
<FmButton
|
|
47
|
+
variant="primary"
|
|
48
|
+
:label="t('order.syncMenu')"
|
|
49
|
+
@click="syncMenu()"
|
|
50
|
+
:disabled="!canEdit"
|
|
51
|
+
/>
|
|
43
52
|
</div>
|
|
44
53
|
</FmCard>
|
|
45
54
|
</div>
|
|
@@ -49,7 +58,7 @@
|
|
|
49
58
|
<script setup lang="ts">
|
|
50
59
|
import { type PropType, computed, reactive, ref, watch } from 'vue'
|
|
51
60
|
import { F_ORDER_PLATFORM, type FdoExternalSetting } from '@entity'
|
|
52
|
-
import { useI18n } from '@feedmepos/mf-common'
|
|
61
|
+
import { useI18n, useCoreStore } from '@feedmepos/mf-common'
|
|
53
62
|
import { clone } from '@/helpers/object'
|
|
54
63
|
import { useMenuStore } from '@/stores/menu/menu'
|
|
55
64
|
import { useLoading } from '@/composables/loading'
|
|
@@ -59,6 +68,9 @@ import { useSnackbarFunctions } from '@/components/snackbar'
|
|
|
59
68
|
const { showSuccess } = useSnackbarFunctions()
|
|
60
69
|
const { t } = useI18n()
|
|
61
70
|
const menuStore = useMenuStore()
|
|
71
|
+
const CoreStore = useCoreStore()
|
|
72
|
+
|
|
73
|
+
const canEdit = computed(() => CoreStore.sessionUser.value?.role.isAdmin ?? false)
|
|
62
74
|
|
|
63
75
|
const props = defineProps({
|
|
64
76
|
initialValue: {
|
|
@@ -49,11 +49,11 @@ const modelValue = computed<IntegratedDeliverySettingData>(() => {
|
|
|
49
49
|
catalogId: auto?.catalogId ?? null,
|
|
50
50
|
commissionRate: auto.reportConfig?.commissionRate ?? 0,
|
|
51
51
|
lastSynchronize: auto.lastSynchronize ?? '',
|
|
52
|
-
autoAccept:
|
|
52
|
+
autoAccept: true,
|
|
53
53
|
ignoreDiscount: auto.ignoreDiscount ?? false,
|
|
54
54
|
status: auto.status,
|
|
55
55
|
updatedAt: auto.updatedAt,
|
|
56
|
-
sstInclusive: auto.sstInclusive,
|
|
56
|
+
sstInclusive: auto.sstInclusive ?? false,
|
|
57
57
|
menuSyncError: auto.menuSyncError
|
|
58
58
|
}
|
|
59
59
|
}
|
|
@@ -232,37 +232,5 @@ async function cancelTestOrder() {
|
|
|
232
232
|
@flow-test-order="flowTestOrder"
|
|
233
233
|
@cancel-test-order="cancelTestOrder"
|
|
234
234
|
>
|
|
235
|
-
<template #default="{ editable }">
|
|
236
|
-
<div class="flex-grow fm-typo-en-title-sm-600 mb-3 mt-10">
|
|
237
|
-
{{ t('order.discountCampaign') }}
|
|
238
|
-
</div>
|
|
239
|
-
<FmButton
|
|
240
|
-
:label="t('order.addNewCampaign')"
|
|
241
|
-
icon="add"
|
|
242
|
-
variant="plain"
|
|
243
|
-
@click="addCampaign"
|
|
244
|
-
class="mb-3"
|
|
245
|
-
/>
|
|
246
|
-
|
|
247
|
-
<div v-if="campaigns.length > 0">
|
|
248
|
-
<div v-for="(campaign, index) in campaigns" :key="index">
|
|
249
|
-
<FmCard variant="outlined" class="p-5 flex justify-between items-center mb-5">
|
|
250
|
-
<div>
|
|
251
|
-
<span class="font-bold"
|
|
252
|
-
>{{ campaign.name }} ({{ campaign.vendorBearPercentage }}%)</span
|
|
253
|
-
>
|
|
254
|
-
<br />
|
|
255
|
-
{{ formatCampaignDate(campaign.date) }}
|
|
256
|
-
</div>
|
|
257
|
-
<div>
|
|
258
|
-
<div class="flex flex-row">
|
|
259
|
-
<FmButton append-icon="edit" variant="tertiary" @click="updateCampaign(index)" />
|
|
260
|
-
<FmButton append-icon="delete" variant="tertiary" @click="deleteCampaign(index)" />
|
|
261
|
-
</div>
|
|
262
|
-
</div>
|
|
263
|
-
</FmCard>
|
|
264
|
-
</div>
|
|
265
|
-
</div>
|
|
266
|
-
</template>
|
|
267
235
|
</IntegratedDelivery>
|
|
268
236
|
</template>
|
|
@@ -53,10 +53,9 @@ const emits = defineEmits<{
|
|
|
53
53
|
}>()
|
|
54
54
|
|
|
55
55
|
const menuStore = useMenuStore()
|
|
56
|
-
|
|
57
|
-
const { sessionUser } = useCoreStore()
|
|
56
|
+
const CoreStore = useCoreStore()
|
|
58
57
|
|
|
59
|
-
const canEdit = computed(() => sessionUser.value?.role.isAdmin ?? false)
|
|
58
|
+
const canEdit = computed(() => CoreStore.sessionUser.value?.role.isAdmin ?? false)
|
|
60
59
|
|
|
61
60
|
function updateManual(manual: FdoLinkedDelivery | null) {
|
|
62
61
|
emits('update:model-value', {
|
|
@@ -120,7 +119,6 @@ type OrderSettingKey = 'autoAcceptOrder' | 'autoCloseBill' | 'ignoreDiscount' |
|
|
|
120
119
|
const orderSettingValue = computed(() => {
|
|
121
120
|
const { autoAccept, autoCloseBill, ignoreDiscount, sstInclusive } = props.modelValue.auto
|
|
122
121
|
const value: OrderSettingKey[] = []
|
|
123
|
-
if (autoAccept) value.push('autoAcceptOrder')
|
|
124
122
|
if (autoCloseBill) value.push('autoCloseBill')
|
|
125
123
|
if (ignoreDiscount) value.push('ignoreDiscount')
|
|
126
124
|
if (sstInclusive) value.push('sstInclusive')
|
|
@@ -141,12 +139,6 @@ const orderSettingOptions = computed<
|
|
|
141
139
|
value: 'autoCloseBill'
|
|
142
140
|
}
|
|
143
141
|
]
|
|
144
|
-
if (props.modelValue.auto.autoAccept !== undefined) {
|
|
145
|
-
options.unshift({
|
|
146
|
-
label: t('order.allowedAutoAcceptOrder'),
|
|
147
|
-
value: 'autoAcceptOrder'
|
|
148
|
-
})
|
|
149
|
-
}
|
|
150
142
|
if (props.modelValue.auto.autoAccept !== undefined) {
|
|
151
143
|
options.push({
|
|
152
144
|
label: t('order.ignoreDiscount'),
|
|
@@ -193,6 +185,7 @@ function convertStatusI18n(status: string) {
|
|
|
193
185
|
/>
|
|
194
186
|
<div v-if="canUseAutoDeliveryIntegration === true" class="mt-10">
|
|
195
187
|
<FmSwitch
|
|
188
|
+
:disabled="!canEdit"
|
|
196
189
|
:model-value="modelValue.auto.enable"
|
|
197
190
|
:label="t('order.activateIntegration', { integrationType: t('order.auto') })"
|
|
198
191
|
label-placement="right"
|
|
@@ -202,6 +195,7 @@ function convertStatusI18n(status: string) {
|
|
|
202
195
|
<div v-if="modelValue.auto.enable">
|
|
203
196
|
<FmCard variant="outlined" class="mt-10 p-5">
|
|
204
197
|
<FmTextField
|
|
198
|
+
:disabled="!canEdit"
|
|
205
199
|
:model-value="modelValue.auto.integrationId"
|
|
206
200
|
:label="t('order.remoteId')"
|
|
207
201
|
@update:model-value="updateIntegrateId"
|
|
@@ -217,6 +211,7 @@ function convertStatusI18n(status: string) {
|
|
|
217
211
|
:label="item.label"
|
|
218
212
|
:value="item.value"
|
|
219
213
|
@update:model-value="updateOrderSettings"
|
|
214
|
+
:disabled="!canEdit"
|
|
220
215
|
/>
|
|
221
216
|
</div>
|
|
222
217
|
</div>
|
|
@@ -226,6 +221,7 @@ function convertStatusI18n(status: string) {
|
|
|
226
221
|
:model-value="modelValue.auto.commissionRate"
|
|
227
222
|
:label="t('order.commission')"
|
|
228
223
|
@update:model-value="updateCommission"
|
|
224
|
+
:disabled="!canEdit"
|
|
229
225
|
>
|
|
230
226
|
<template #append>%</template>
|
|
231
227
|
</FmTextField>
|
|
@@ -238,6 +234,7 @@ function convertStatusI18n(status: string) {
|
|
|
238
234
|
:label="t('order.catalog')"
|
|
239
235
|
:items="menuStore.catalogOptions"
|
|
240
236
|
@update:model-value="updateMenuCatalog"
|
|
237
|
+
:disabled="!canEdit"
|
|
241
238
|
/>
|
|
242
239
|
</div>
|
|
243
240
|
|
|
@@ -250,6 +247,7 @@ function convertStatusI18n(status: string) {
|
|
|
250
247
|
v-if="modelValue.auto.status === 'FAILED' && modelValue.auto.menuSyncError !== null"
|
|
251
248
|
:content="modelValue.auto.menuSyncError"
|
|
252
249
|
:zIndex="1000"
|
|
250
|
+
:disabled="!canEdit"
|
|
253
251
|
>
|
|
254
252
|
<FmIcon name="info" size="sm" />
|
|
255
253
|
</FmTooltip>
|
|
@@ -261,7 +259,12 @@ function convertStatusI18n(status: string) {
|
|
|
261
259
|
</div>
|
|
262
260
|
</div>
|
|
263
261
|
<div class="flex flex-row">
|
|
264
|
-
<FmButton
|
|
262
|
+
<FmButton
|
|
263
|
+
variant="primary"
|
|
264
|
+
:label="t('order.syncMenu')"
|
|
265
|
+
@click="emits('syncMenu')"
|
|
266
|
+
:disabled="!canEdit"
|
|
267
|
+
/>
|
|
265
268
|
|
|
266
269
|
<div
|
|
267
270
|
v-if="modelValue.auto.lastSynchronize"
|
|
@@ -272,7 +275,7 @@ function convertStatusI18n(status: string) {
|
|
|
272
275
|
</div>
|
|
273
276
|
</div>
|
|
274
277
|
|
|
275
|
-
<slot :editable="canEdit" />
|
|
278
|
+
<slot :editable="!canEdit" />
|
|
276
279
|
</FmCard>
|
|
277
280
|
</div>
|
|
278
281
|
</div>
|